Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1431)

Side by Side Diff: board/tegra2/common/nand/tegra2_nand.h

Issue 6623073: Chromium: arm: tegra: Add NAND support (Closed) Base URL: http://git.chromium.org/git/u-boot-next.git@chromeos-v2010.09
Patch Set: Moving CONFIG_NAND_XXX and CONFIG_TEGRA2_NAND_XXX settings Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* register offset */
robotboy 2011/03/21 16:50:12 Please remove this file.
2 #define NAND_COMMAND_0 0x00
3 #define NAND_CMD_GO Bit31
4 #define NAND_CMD_CLE Bit30
5 #define NAND_CMD_ALE Bit29
6 #define NAND_CMD_PIO Bit28
7 #define NAND_CMD_TX Bit27
8 #define NAND_CMD_RX Bit26
9 #define NAND_CMD_SEC_CMD Bit25
10 #define NAND_CMD_AFT_DAT Bit24
11 #define NAND_CMD_TRANS_SIZE_SHIFT 20
12 #define NAND_CMD_TRANS_SIZE_BYTES1 0
13 #define NAND_CMD_TRANS_SIZE_BYTES2 1
14 #define NAND_CMD_TRANS_SIZE_BYTES3 2
15 #define NAND_CMD_TRANS_SIZE_BYTES4 3
16 #define NAND_CMD_TRANS_SIZE_BYTES5 4
17 #define NAND_CMD_TRANS_SIZE_BYTES6 5
18 #define NAND_CMD_TRANS_SIZE_BYTES7 6
19 #define NAND_CMD_TRANS_SIZE_BYTES8 7
20 #define NAND_CMD_A_VALID Bit19
21 #define NAND_CMD_B_VALID Bit18
22 #define NAND_CMD_RD_STATUS_CHK Bit17
23 #define NAND_CMD_R_BSY_CHK Bit16
24 #define NAND_CMD_CE7 Bit15
25 #define NAND_CMD_CE6 Bit14
26 #define NAND_CMD_CE5 Bit13
27 #define NAND_CMD_CE4 Bit12
28 #define NAND_CMD_CE3 Bit11
29 #define NAND_CMD_CE2 Bit10
30 #define NAND_CMD_CE1 Bit9
31 #define NAND_CMD_CE0 Bit8
32 #define NAND_CMD_CLE_BYTE_SIZE_SHIFT 4
33 #define NAND_CMD_CLE_BYTES1 0
34 #define NAND_CMD_CLE_BYTES2 1
35 #define NAND_CMD_CLE_BYTES3 2
36 #define NAND_CMD_CLE_BYTES4 3
37 #define NAND_CMD_ALE_BYTE_SIZE_SHIFT 0
38 #define NAND_CMD_ALE_BYTES1 0
39 #define NAND_CMD_ALE_BYTES2 1
40 #define NAND_CMD_ALE_BYTES3 2
41 #define NAND_CMD_ALE_BYTES4 3
42 #define NAND_CMD_ALE_BYTES5 4
43 #define NAND_CMD_ALE_BYTES6 5
44 #define NAND_CMD_ALE_BYTES7 6
45 #define NAND_CMD_ALE_BYTES8 7
46
47 #define NAND_STATUS_0 0x04
48 #define NAND_STATUS_RBSY0 Bit8
49 #define NAND_ISR_0 0x08
50 #define NAND_IER_0 0x0C
51 #define NAND_CONFIG_0 0x10
52 #define NAND_CONFIG_HW_ECC_MASK Bit31
53 #define NAND_CONFIG_HW_ECC_DISABLE 0
54 #define NAND_CONFIG_HW_ECC_ENABLE Bit31
55 #define NAND_CONFIG_HW_ECC_SEL_MASK Bit30
56 #define NAND_CONFIG_HW_ECC_SEL_HAMMING 0
57 #define NAND_CONFIG_HW_ECC_SEL_RS Bit30
58 #define NAND_CONFIG_HW_ECC_CORRECTION_MASK Bit29
59 #define NAND_CONFIG_HW_ECC_CORRECTION_DISABLE 0
60 #define NAND_CONFIG_HW_ECC_CORRECTION_ENABLE Bit29
61 #define NAND_CONFIG_PIPELINE_EN_MASK Bit28
62 #define NAND_CONFIG_PIPELINE_EN_DISABLE 0
63 #define NAND_CONFIG_PIPELINE_EN_ENABLE Bit28
64 #define NAND_CONFIG_ECC_EN_TAG_MASK Bit27
65 #define NAND_CONFIG_ECC_EN_TAG_DISABLE 0
66 #define NAND_CONFIG_ECC_EN_TAG_ENABLE Bit27
67 #define NAND_CONFIG_TVALUE (Bit25+Bit24)
68 #define NAND_CONFIG_TVAL4 (0<<24)
69 #define NAND_CONFIG_TVAL6 (1<<24)
70 #define NAND_CONFIG_TVAL8 (2<<24)
71 #define NAND_CONFIG_SKIP_SPARE_MASK Bit23
72 #define NAND_CONFIG_SKIP_SPARE_DISABLE 0
73 #define NAND_CONFIG_SKIP_SPARE_ENABLE Bit23
74 #define NAND_CONFIG_COM_BSY_MASK Bit22
75 #define NAND_CONFIG_COM_BSY_DISABLE 0
76 #define NAND_CONFIG_COM_BSY_ENABLE Bit22
77 #define NAND_CONFIG_BUS_WIDTH_MASK Bit21
78 #define NAND_CONFIG_BUS_WIDTH_8BIT 0
79 #define NAND_CONFIG_BUS_WIDTH_16BIT Bit21
80 #define NAND_CONFIG_LPDDR1_MODE_MASK Bit20
81 #define NAND_CONFIG_LPDDR1_MODE_DISABLE 0
82 #define NAND_CONFIG_LPDDR1_MODE_ENABLE Bit20
83 #define NAND_CONFIG_EDO_MODE_MASK Bit19
84 #define NAND_CONFIG_EDO_MODE_DISABLE 0
85 #define NAND_CONFIG_EDO_MODE_ENABLE Bit19
86 #define NAND_CONFIG_PAGE_SIZE_SEL_MASK (Bit18+Bit17+Bit16)
87 #define NAND_CONFIG_PAGE_SIZE_256 (0<<16)
88 #define NAND_CONFIG_PAGE_SIZE_512 (1<<16)
89 #define NAND_CONFIG_PAGE_SIZE_1024 (2<<16)
90 #define NAND_CONFIG_PAGE_SIZE_2048 (3<<16)
91 #define NAND_CONFIG_PAGE_SIZE_4096 (4<<16)
92 #define NAND_CONFIG_SKIP_SPARE_SEL_MASK (Bit15+Bit14)
93 #define NAND_CONFIG_SKIP_SPARE_SEL_4 (0<<14)
94 #define NAND_CONFIG_SKIP_SPARE_SEL_8 (1<<14)
95 #define NAND_CONFIG_SKIP_SPARE_SEL_12 (2<<14)
96 #define NAND_CONFIG_SKIP_SPARE_SEL_16 (3<<14)
97 #define NAND_CONFIG_TAG_BYTE_SIZE_MASK 0x1FF
98
99 #define NAND_TIMING_0 0x14
100 #define NAND_TIMING_TRP_RESP_CNT_SHIFT 28
101 #define NAND_TIMING_TWB_CNT_SHIFT 24
102 #define NAND_TIMING_TCR_TAR_TRR_CNT_SHIFT 20
103 #define NAND_TIMING_TWHR_CNT_SHIFT 16
104 #define NAND_TIMING_TCS_CNT_SHIFT 14
105 #define NAND_TIMING_TWH_CNT_SHIFT 12
106 #define NAND_TIMING_TWP_CNT_SHIFT 8
107 #define NAND_TIMING_TRH_CNT_SHIFT 4
108 #define NAND_TIMING_TRP_CNT_SHIFT 0
109 #define NAND_RESP_0 0x18
110 #define NAND_TIMING2_0 0x1C
111 #define NAND_TIMING2_TADL_CNT_SHIFT 0
112 #define NAND_CMD_REG1_0 0x20
113 #define NAND_CMD_REG2_0 0x24
114 #define NAND_ADDR_REG1_0 0x28
115 #define NAND_ADDR_REG2_0 0x2C
116
117 #define LP_OPTIONS (NAND_NO_READRDY | NAND_NO_AUTOINCR)
118
119 static uint8_t tegra2_nand_read_byte(struct mtd_info *mtd);
120 static void tegra2_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, \
121 int len);
122 static void tegra2_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
123 static int tegra2_nand_waitfor_cmd_completion(struct mtd_info *mtd);
124 static int tegra2_nand_dev_ready(struct mtd_info *mtd);
125
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698