diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-09-06 18:38:34 -0400 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-10-03 05:12:25 -0400 |
commit | 82fc5099744e5f30cd8c9ee13075f28fb37e9518 (patch) | |
tree | 19fa15428ac6dbb8bc79bac579c9914b1e2010cb | |
parent | 4ae94025171608e0661372cf846e17d062cb9620 (diff) |
mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R, W} there
We regularly have new NAND controller drivers that are making use of
fields/hooks that we want to get rid of but can't because of all the
legacy drivers that we might break if we do.
So, instead of removing those fields/hooks, let's move them to a
sub-struct which is clearly documented as deprecated.
We start with the ->IO_ADDR_{R,W] fields.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
37 files changed, 190 insertions, 175 deletions
diff --git a/Documentation/driver-api/mtdnand.rst b/Documentation/driver-api/mtdnand.rst index 5470a3d6bd9e..1d2403f1d8c5 100644 --- a/Documentation/driver-api/mtdnand.rst +++ b/Documentation/driver-api/mtdnand.rst | |||
@@ -180,10 +180,10 @@ by a chip select decoder. | |||
180 | { | 180 | { |
181 | struct nand_chip *this = mtd_to_nand(mtd); | 181 | struct nand_chip *this = mtd_to_nand(mtd); |
182 | switch(cmd){ | 182 | switch(cmd){ |
183 | case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break; | 183 | case NAND_CTL_SETCLE: this->legacy.IO_ADDR_W |= CLE_ADRR_BIT; break; |
184 | case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break; | 184 | case NAND_CTL_CLRCLE: this->legacy.IO_ADDR_W &= ~CLE_ADRR_BIT; break; |
185 | case NAND_CTL_SETALE: this->IO_ADDR_W |= ALE_ADRR_BIT; break; | 185 | case NAND_CTL_SETALE: this->legacy.IO_ADDR_W |= ALE_ADRR_BIT; break; |
186 | case NAND_CTL_CLRALE: this->IO_ADDR_W &= ~ALE_ADRR_BIT; break; | 186 | case NAND_CTL_CLRALE: this->legacy.IO_ADDR_W &= ~ALE_ADRR_BIT; break; |
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
@@ -235,8 +235,8 @@ necessary information about the device. | |||
235 | } | 235 | } |
236 | 236 | ||
237 | /* Set address of NAND IO lines */ | 237 | /* Set address of NAND IO lines */ |
238 | this->IO_ADDR_R = baseaddr; | 238 | this->legacy.IO_ADDR_R = baseaddr; |
239 | this->IO_ADDR_W = baseaddr; | 239 | this->legacy.IO_ADDR_W = baseaddr; |
240 | /* Reference hardware control function */ | 240 | /* Reference hardware control function */ |
241 | this->hwcontrol = board_hwcontrol; | 241 | this->hwcontrol = board_hwcontrol; |
242 | /* Set command delay time, see datasheet for correct value */ | 242 | /* Set command delay time, see datasheet for correct value */ |
@@ -336,17 +336,17 @@ connected to an address decoder. | |||
336 | struct nand_chip *this = mtd_to_nand(mtd); | 336 | struct nand_chip *this = mtd_to_nand(mtd); |
337 | 337 | ||
338 | /* Deselect all chips */ | 338 | /* Deselect all chips */ |
339 | this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; | 339 | this->legacy.IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; |
340 | this->IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK; | 340 | this->legacy.IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK; |
341 | switch (chip) { | 341 | switch (chip) { |
342 | case 0: | 342 | case 0: |
343 | this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0; | 343 | this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0; |
344 | this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0; | 344 | this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0; |
345 | break; | 345 | break; |
346 | .... | 346 | .... |
347 | case n: | 347 | case n: |
348 | this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn; | 348 | this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn; |
349 | this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn; | 349 | this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn; |
350 | break; | 350 | break; |
351 | } | 351 | } |
352 | } | 352 | } |
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index aa03ea79c5f5..1dad83a0bc5b 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */ | 43 | #define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */ |
44 | #define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */ | 44 | #define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */ |
45 | 45 | ||
46 | #define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40) | 46 | #define NAND_CTRL_ADDR(chip) (chip->legacy.IO_ADDR_W + 0x40) |
47 | 47 | ||
48 | static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, | 48 | static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, |
49 | unsigned int ctrl) | 49 | unsigned int ctrl) |
@@ -69,7 +69,8 @@ static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, | |||
69 | } | 69 | } |
70 | 70 | ||
71 | if (cmd != NAND_CMD_NONE) | 71 | if (cmd != NAND_CMD_NONE) |
72 | __raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W); | 72 | __raw_writew((cmd & 0xff) | nand_state, |
73 | chip->legacy.IO_ADDR_W); | ||
73 | } | 74 | } |
74 | 75 | ||
75 | static int snappercl15_nand_dev_ready(struct nand_chip *chip) | 76 | static int snappercl15_nand_dev_ready(struct nand_chip *chip) |
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 26259dd9e951..188bf02595c5 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
@@ -80,7 +80,7 @@ static void ts72xx_nand_hwcontrol(struct nand_chip *chip, | |||
80 | int cmd, unsigned int ctrl) | 80 | int cmd, unsigned int ctrl) |
81 | { | 81 | { |
82 | if (ctrl & NAND_CTRL_CHANGE) { | 82 | if (ctrl & NAND_CTRL_CHANGE) { |
83 | void __iomem *addr = chip->IO_ADDR_R; | 83 | void __iomem *addr = chip->legacy.IO_ADDR_R; |
84 | unsigned char bits; | 84 | unsigned char bits; |
85 | 85 | ||
86 | addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE); | 86 | addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE); |
@@ -94,12 +94,12 @@ static void ts72xx_nand_hwcontrol(struct nand_chip *chip, | |||
94 | } | 94 | } |
95 | 95 | ||
96 | if (cmd != NAND_CMD_NONE) | 96 | if (cmd != NAND_CMD_NONE) |
97 | __raw_writeb(cmd, chip->IO_ADDR_W); | 97 | __raw_writeb(cmd, chip->legacy.IO_ADDR_W); |
98 | } | 98 | } |
99 | 99 | ||
100 | static int ts72xx_nand_device_ready(struct nand_chip *chip) | 100 | static int ts72xx_nand_device_ready(struct nand_chip *chip) |
101 | { | 101 | { |
102 | void __iomem *addr = chip->IO_ADDR_R; | 102 | void __iomem *addr = chip->legacy.IO_ADDR_R; |
103 | 103 | ||
104 | addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE); | 104 | addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE); |
105 | 105 | ||
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c index ff015f603ac9..48972944bb95 100644 --- a/arch/arm/mach-imx/mach-qong.c +++ b/arch/arm/mach-imx/mach-qong.c | |||
@@ -136,9 +136,9 @@ static void qong_nand_cmd_ctrl(struct nand_chip *nand_chip, int cmd, | |||
136 | return; | 136 | return; |
137 | 137 | ||
138 | if (ctrl & NAND_CLE) | 138 | if (ctrl & NAND_CLE) |
139 | writeb(cmd, nand_chip->IO_ADDR_W + (1 << 24)); | 139 | writeb(cmd, nand_chip->legacy.IO_ADDR_W + (1 << 24)); |
140 | else | 140 | else |
141 | writeb(cmd, nand_chip->IO_ADDR_W + (1 << 23)); | 141 | writeb(cmd, nand_chip->legacy.IO_ADDR_W + (1 << 23)); |
142 | } | 142 | } |
143 | 143 | ||
144 | /* | 144 | /* |
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 7c39edc121ba..797e7edc7124 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -92,7 +92,7 @@ ixdp425_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | if (cmd != NAND_CMD_NONE) | 94 | if (cmd != NAND_CMD_NONE) |
95 | writeb(cmd, this->IO_ADDR_W + offset); | 95 | writeb(cmd, this->legacy.IO_ADDR_W + offset); |
96 | } | 96 | } |
97 | 97 | ||
98 | static struct platform_nand_data ixdp425_flash_nand_data = { | 98 | static struct platform_nand_data ixdp425_flash_nand_data = { |
diff --git a/arch/arm/mach-omap1/board-nand.c b/arch/arm/mach-omap1/board-nand.c index 59d56a30bc63..20923eb2d9b6 100644 --- a/arch/arm/mach-omap1/board-nand.c +++ b/arch/arm/mach-omap1/board-nand.c | |||
@@ -31,6 +31,6 @@ void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd, unsigned int ctrl) | |||
31 | if (ctrl & NAND_ALE) | 31 | if (ctrl & NAND_ALE) |
32 | mask |= 0x04; | 32 | mask |= 0x04; |
33 | 33 | ||
34 | writeb(cmd, this->IO_ADDR_W + mask); | 34 | writeb(cmd, this->legacy.IO_ADDR_W + mask); |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index 48d85ddf7c31..aac2c6eb35e2 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -145,7 +145,7 @@ static void ts78xx_ts_nand_cmd_ctrl(struct nand_chip *this, int cmd, | |||
145 | } | 145 | } |
146 | 146 | ||
147 | if (cmd != NAND_CMD_NONE) | 147 | if (cmd != NAND_CMD_NONE) |
148 | writeb(cmd, this->IO_ADDR_W); | 148 | writeb(cmd, this->legacy.IO_ADDR_W); |
149 | } | 149 | } |
150 | 150 | ||
151 | static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip) | 151 | static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip) |
@@ -156,7 +156,7 @@ static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip) | |||
156 | static void ts78xx_ts_nand_write_buf(struct nand_chip *chip, | 156 | static void ts78xx_ts_nand_write_buf(struct nand_chip *chip, |
157 | const uint8_t *buf, int len) | 157 | const uint8_t *buf, int len) |
158 | { | 158 | { |
159 | void __iomem *io_base = chip->IO_ADDR_W; | 159 | void __iomem *io_base = chip->legacy.IO_ADDR_W; |
160 | unsigned long off = ((unsigned long)buf & 3); | 160 | unsigned long off = ((unsigned long)buf & 3); |
161 | int sz; | 161 | int sz; |
162 | 162 | ||
@@ -182,7 +182,7 @@ static void ts78xx_ts_nand_write_buf(struct nand_chip *chip, | |||
182 | static void ts78xx_ts_nand_read_buf(struct nand_chip *chip, | 182 | static void ts78xx_ts_nand_read_buf(struct nand_chip *chip, |
183 | uint8_t *buf, int len) | 183 | uint8_t *buf, int len) |
184 | { | 184 | { |
185 | void __iomem *io_base = chip->IO_ADDR_R; | 185 | void __iomem *io_base = chip->legacy.IO_ADDR_R; |
186 | unsigned long off = ((unsigned long)buf & 3); | 186 | unsigned long off = ((unsigned long)buf & 3); |
187 | int sz; | 187 | int sz; |
188 | 188 | ||
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 71fda90b9599..256e60c38a6d 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -597,7 +597,7 @@ static void balloon3_nand_cmd_ctl(struct nand_chip *this, int cmd, | |||
597 | } | 597 | } |
598 | 598 | ||
599 | if (cmd != NAND_CMD_NONE) | 599 | if (cmd != NAND_CMD_NONE) |
600 | writeb(cmd, this->IO_ADDR_W); | 600 | writeb(cmd, this->legacy.IO_ADDR_W); |
601 | } | 601 | } |
602 | 602 | ||
603 | static void balloon3_nand_select_chip(struct nand_chip *this, int chip) | 603 | static void balloon3_nand_select_chip(struct nand_chip *this, int chip) |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index ba1ec9992830..3acb945a2628 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -288,7 +288,7 @@ static void nand_cs_off(void) | |||
288 | static void em_x270_nand_cmd_ctl(struct nand_chip *this, int dat, | 288 | static void em_x270_nand_cmd_ctl(struct nand_chip *this, int dat, |
289 | unsigned int ctrl) | 289 | unsigned int ctrl) |
290 | { | 290 | { |
291 | unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; | 291 | unsigned long nandaddr = (unsigned long)this->legacy.IO_ADDR_W; |
292 | 292 | ||
293 | dsb(); | 293 | dsb(); |
294 | 294 | ||
@@ -308,9 +308,9 @@ static void em_x270_nand_cmd_ctl(struct nand_chip *this, int dat, | |||
308 | } | 308 | } |
309 | 309 | ||
310 | dsb(); | 310 | dsb(); |
311 | this->IO_ADDR_W = (void __iomem *)nandaddr; | 311 | this->legacy.IO_ADDR_W = (void __iomem *)nandaddr; |
312 | if (dat != NAND_CMD_NONE) | 312 | if (dat != NAND_CMD_NONE) |
313 | writel(dat, this->IO_ADDR_W); | 313 | writel(dat, this->legacy.IO_ADDR_W); |
314 | 314 | ||
315 | dsb(); | 315 | dsb(); |
316 | } | 316 | } |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index ed9661e70b83..36ea32c1bbcc 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -250,7 +250,7 @@ static inline void palmtx_keys_init(void) {} | |||
250 | static void palmtx_nand_cmd_ctl(struct nand_chip *this, int cmd, | 250 | static void palmtx_nand_cmd_ctl(struct nand_chip *this, int cmd, |
251 | unsigned int ctrl) | 251 | unsigned int ctrl) |
252 | { | 252 | { |
253 | char __iomem *nandaddr = this->IO_ADDR_W; | 253 | char __iomem *nandaddr = this->legacy.IO_ADDR_W; |
254 | 254 | ||
255 | if (cmd == NAND_CMD_NONE) | 255 | if (cmd == NAND_CMD_NONE) |
256 | return; | 256 | return; |
diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c index f043615c1a99..97dc74f7f41a 100644 --- a/arch/mips/alchemy/devboards/db1200.c +++ b/arch/mips/alchemy/devboards/db1200.c | |||
@@ -200,7 +200,7 @@ static struct i2c_board_info db1200_i2c_devs[] __initdata = { | |||
200 | static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd, | 200 | static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
201 | unsigned int ctrl) | 201 | unsigned int ctrl) |
202 | { | 202 | { |
203 | unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; | 203 | unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W; |
204 | 204 | ||
205 | ioaddr &= 0xffffff00; | 205 | ioaddr &= 0xffffff00; |
206 | 206 | ||
@@ -212,9 +212,9 @@ static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd, | |||
212 | /* assume we want to r/w real data by default */ | 212 | /* assume we want to r/w real data by default */ |
213 | ioaddr += MEM_STNAND_DATA; | 213 | ioaddr += MEM_STNAND_DATA; |
214 | } | 214 | } |
215 | this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; | 215 | this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr; |
216 | if (cmd != NAND_CMD_NONE) { | 216 | if (cmd != NAND_CMD_NONE) { |
217 | __raw_writeb(cmd, this->IO_ADDR_W); | 217 | __raw_writeb(cmd, this->legacy.IO_ADDR_W); |
218 | wmb(); | 218 | wmb(); |
219 | } | 219 | } |
220 | } | 220 | } |
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c index 1201fa655e78..b813dc1c1682 100644 --- a/arch/mips/alchemy/devboards/db1300.c +++ b/arch/mips/alchemy/devboards/db1300.c | |||
@@ -152,7 +152,7 @@ static void __init db1300_gpio_config(void) | |||
152 | static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd, | 152 | static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
153 | unsigned int ctrl) | 153 | unsigned int ctrl) |
154 | { | 154 | { |
155 | unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; | 155 | unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W; |
156 | 156 | ||
157 | ioaddr &= 0xffffff00; | 157 | ioaddr &= 0xffffff00; |
158 | 158 | ||
@@ -164,9 +164,9 @@ static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd, | |||
164 | /* assume we want to r/w real data by default */ | 164 | /* assume we want to r/w real data by default */ |
165 | ioaddr += MEM_STNAND_DATA; | 165 | ioaddr += MEM_STNAND_DATA; |
166 | } | 166 | } |
167 | this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; | 167 | this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr; |
168 | if (cmd != NAND_CMD_NONE) { | 168 | if (cmd != NAND_CMD_NONE) { |
169 | __raw_writeb(cmd, this->IO_ADDR_W); | 169 | __raw_writeb(cmd, this->legacy.IO_ADDR_W); |
170 | wmb(); | 170 | wmb(); |
171 | } | 171 | } |
172 | } | 172 | } |
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c index cae39cde5de6..65f6b7184fbe 100644 --- a/arch/mips/alchemy/devboards/db1550.c +++ b/arch/mips/alchemy/devboards/db1550.c | |||
@@ -129,7 +129,7 @@ static struct i2c_board_info db1550_i2c_devs[] __initdata = { | |||
129 | static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd, | 129 | static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
130 | unsigned int ctrl) | 130 | unsigned int ctrl) |
131 | { | 131 | { |
132 | unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; | 132 | unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W; |
133 | 133 | ||
134 | ioaddr &= 0xffffff00; | 134 | ioaddr &= 0xffffff00; |
135 | 135 | ||
@@ -141,9 +141,9 @@ static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd, | |||
141 | /* assume we want to r/w real data by default */ | 141 | /* assume we want to r/w real data by default */ |
142 | ioaddr += MEM_STNAND_DATA; | 142 | ioaddr += MEM_STNAND_DATA; |
143 | } | 143 | } |
144 | this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; | 144 | this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr; |
145 | if (cmd != NAND_CMD_NONE) { | 145 | if (cmd != NAND_CMD_NONE) { |
146 | __raw_writeb(cmd, this->IO_ADDR_W); | 146 | __raw_writeb(cmd, this->legacy.IO_ADDR_W); |
147 | wmb(); | 147 | wmb(); |
148 | } | 148 | } |
149 | } | 149 | } |
diff --git a/arch/mips/pnx833x/common/platform.c b/arch/mips/pnx833x/common/platform.c index ca8a2889431e..33d0f070b33d 100644 --- a/arch/mips/pnx833x/common/platform.c +++ b/arch/mips/pnx833x/common/platform.c | |||
@@ -180,7 +180,7 @@ static struct platform_device pnx833x_sata_device = { | |||
180 | static void | 180 | static void |
181 | pnx833x_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) | 181 | pnx833x_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) |
182 | { | 182 | { |
183 | unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; | 183 | unsigned long nandaddr = (unsigned long)this->legacy.IO_ADDR_W; |
184 | 184 | ||
185 | if (cmd == NAND_CMD_NONE) | 185 | if (cmd == NAND_CMD_NONE) |
186 | return; | 186 | return; |
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 9173949892ed..02a9e042fb44 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c | |||
@@ -160,7 +160,7 @@ static void rb532_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl) | |||
160 | set_latch_u5(orbits, nandbits); | 160 | set_latch_u5(orbits, nandbits); |
161 | } | 161 | } |
162 | if (cmd != NAND_CMD_NONE) | 162 | if (cmd != NAND_CMD_NONE) |
163 | writeb(cmd, chip->IO_ADDR_W); | 163 | writeb(cmd, chip->legacy.IO_ADDR_W); |
164 | } | 164 | } |
165 | 165 | ||
166 | static struct resource nand_slot0_res[] = { | 166 | static struct resource nand_slot0_res[] = { |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 833f3e49027b..ebcc4d5a67ce 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -172,11 +172,11 @@ static void migor_nand_flash_cmd_ctl(struct nand_chip *chip, int cmd, | |||
172 | return; | 172 | return; |
173 | 173 | ||
174 | if (ctrl & NAND_CLE) | 174 | if (ctrl & NAND_CLE) |
175 | writeb(cmd, chip->IO_ADDR_W + 0x00400000); | 175 | writeb(cmd, chip->legacy.IO_ADDR_W + 0x00400000); |
176 | else if (ctrl & NAND_ALE) | 176 | else if (ctrl & NAND_ALE) |
177 | writeb(cmd, chip->IO_ADDR_W + 0x00800000); | 177 | writeb(cmd, chip->legacy.IO_ADDR_W + 0x00800000); |
178 | else | 178 | else |
179 | writeb(cmd, chip->IO_ADDR_W); | 179 | writeb(cmd, chip->legacy.IO_ADDR_W); |
180 | } | 180 | } |
181 | 181 | ||
182 | static int migor_nand_flash_ready(struct nand_chip *chip) | 182 | static int migor_nand_flash_ready(struct nand_chip *chip) |
diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 48413203dbc2..5bc8b29faf6d 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c | |||
@@ -68,7 +68,7 @@ static void ams_delta_write_byte(struct nand_chip *this, u_char byte) | |||
68 | void __iomem *io_base = (void __iomem *)nand_get_controller_data(this); | 68 | void __iomem *io_base = (void __iomem *)nand_get_controller_data(this); |
69 | 69 | ||
70 | writew(0, io_base + OMAP_MPUIO_IO_CNTL); | 70 | writew(0, io_base + OMAP_MPUIO_IO_CNTL); |
71 | writew(byte, this->IO_ADDR_W); | 71 | writew(byte, this->legacy.IO_ADDR_W); |
72 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 0); | 72 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 0); |
73 | ndelay(40); | 73 | ndelay(40); |
74 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 1); | 74 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 1); |
@@ -82,7 +82,7 @@ static u_char ams_delta_read_byte(struct nand_chip *this) | |||
82 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 0); | 82 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 0); |
83 | ndelay(40); | 83 | ndelay(40); |
84 | writew(~0, io_base + OMAP_MPUIO_IO_CNTL); | 84 | writew(~0, io_base + OMAP_MPUIO_IO_CNTL); |
85 | res = readw(this->IO_ADDR_R); | 85 | res = readw(this->legacy.IO_ADDR_R); |
86 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 1); | 86 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 1); |
87 | 87 | ||
88 | return res; | 88 | return res; |
@@ -208,8 +208,8 @@ static int ams_delta_init(struct platform_device *pdev) | |||
208 | nand_set_controller_data(this, (void *)io_base); | 208 | nand_set_controller_data(this, (void *)io_base); |
209 | 209 | ||
210 | /* Set address of NAND IO lines */ | 210 | /* Set address of NAND IO lines */ |
211 | this->IO_ADDR_R = io_base + OMAP_MPUIO_INPUT_LATCH; | 211 | this->legacy.IO_ADDR_R = io_base + OMAP_MPUIO_INPUT_LATCH; |
212 | this->IO_ADDR_W = io_base + OMAP_MPUIO_OUTPUT; | 212 | this->legacy.IO_ADDR_W = io_base + OMAP_MPUIO_OUTPUT; |
213 | this->read_byte = ams_delta_read_byte; | 213 | this->read_byte = ams_delta_read_byte; |
214 | this->write_buf = ams_delta_write_buf; | 214 | this->write_buf = ams_delta_write_buf; |
215 | this->read_buf = ams_delta_read_buf; | 215 | this->read_buf = ams_delta_read_buf; |
diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c index d0ec8606e769..b7bb2b2af4ef 100644 --- a/drivers/mtd/nand/raw/au1550nd.c +++ b/drivers/mtd/nand/raw/au1550nd.c | |||
@@ -35,7 +35,7 @@ struct au1550nd_ctx { | |||
35 | */ | 35 | */ |
36 | static u_char au_read_byte(struct nand_chip *this) | 36 | static u_char au_read_byte(struct nand_chip *this) |
37 | { | 37 | { |
38 | u_char ret = readb(this->IO_ADDR_R); | 38 | u_char ret = readb(this->legacy.IO_ADDR_R); |
39 | wmb(); /* drain writebuffer */ | 39 | wmb(); /* drain writebuffer */ |
40 | return ret; | 40 | return ret; |
41 | } | 41 | } |
@@ -49,7 +49,7 @@ static u_char au_read_byte(struct nand_chip *this) | |||
49 | */ | 49 | */ |
50 | static void au_write_byte(struct nand_chip *this, u_char byte) | 50 | static void au_write_byte(struct nand_chip *this, u_char byte) |
51 | { | 51 | { |
52 | writeb(byte, this->IO_ADDR_W); | 52 | writeb(byte, this->legacy.IO_ADDR_W); |
53 | wmb(); /* drain writebuffer */ | 53 | wmb(); /* drain writebuffer */ |
54 | } | 54 | } |
55 | 55 | ||
@@ -61,7 +61,7 @@ static void au_write_byte(struct nand_chip *this, u_char byte) | |||
61 | */ | 61 | */ |
62 | static u_char au_read_byte16(struct nand_chip *this) | 62 | static u_char au_read_byte16(struct nand_chip *this) |
63 | { | 63 | { |
64 | u_char ret = (u_char) cpu_to_le16(readw(this->IO_ADDR_R)); | 64 | u_char ret = (u_char) cpu_to_le16(readw(this->legacy.IO_ADDR_R)); |
65 | wmb(); /* drain writebuffer */ | 65 | wmb(); /* drain writebuffer */ |
66 | return ret; | 66 | return ret; |
67 | } | 67 | } |
@@ -75,7 +75,7 @@ static u_char au_read_byte16(struct nand_chip *this) | |||
75 | */ | 75 | */ |
76 | static void au_write_byte16(struct nand_chip *this, u_char byte) | 76 | static void au_write_byte16(struct nand_chip *this, u_char byte) |
77 | { | 77 | { |
78 | writew(le16_to_cpu((u16) byte), this->IO_ADDR_W); | 78 | writew(le16_to_cpu((u16) byte), this->legacy.IO_ADDR_W); |
79 | wmb(); /* drain writebuffer */ | 79 | wmb(); /* drain writebuffer */ |
80 | } | 80 | } |
81 | 81 | ||
@@ -92,7 +92,7 @@ static void au_write_buf(struct nand_chip *this, const u_char *buf, int len) | |||
92 | int i; | 92 | int i; |
93 | 93 | ||
94 | for (i = 0; i < len; i++) { | 94 | for (i = 0; i < len; i++) { |
95 | writeb(buf[i], this->IO_ADDR_W); | 95 | writeb(buf[i], this->legacy.IO_ADDR_W); |
96 | wmb(); /* drain writebuffer */ | 96 | wmb(); /* drain writebuffer */ |
97 | } | 97 | } |
98 | } | 98 | } |
@@ -110,7 +110,7 @@ static void au_read_buf(struct nand_chip *this, u_char *buf, int len) | |||
110 | int i; | 110 | int i; |
111 | 111 | ||
112 | for (i = 0; i < len; i++) { | 112 | for (i = 0; i < len; i++) { |
113 | buf[i] = readb(this->IO_ADDR_R); | 113 | buf[i] = readb(this->legacy.IO_ADDR_R); |
114 | wmb(); /* drain writebuffer */ | 114 | wmb(); /* drain writebuffer */ |
115 | } | 115 | } |
116 | } | 116 | } |
@@ -130,7 +130,7 @@ static void au_write_buf16(struct nand_chip *this, const u_char *buf, int len) | |||
130 | len >>= 1; | 130 | len >>= 1; |
131 | 131 | ||
132 | for (i = 0; i < len; i++) { | 132 | for (i = 0; i < len; i++) { |
133 | writew(p[i], this->IO_ADDR_W); | 133 | writew(p[i], this->legacy.IO_ADDR_W); |
134 | wmb(); /* drain writebuffer */ | 134 | wmb(); /* drain writebuffer */ |
135 | } | 135 | } |
136 | 136 | ||
@@ -152,7 +152,7 @@ static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | |||
152 | len >>= 1; | 152 | len >>= 1; |
153 | 153 | ||
154 | for (i = 0; i < len; i++) { | 154 | for (i = 0; i < len; i++) { |
155 | p[i] = readw(this->IO_ADDR_R); | 155 | p[i] = readw(this->legacy.IO_ADDR_R); |
156 | wmb(); /* drain writebuffer */ | 156 | wmb(); /* drain writebuffer */ |
157 | } | 157 | } |
158 | } | 158 | } |
@@ -179,19 +179,19 @@ static void au1550_hwcontrol(struct mtd_info *mtd, int cmd) | |||
179 | switch (cmd) { | 179 | switch (cmd) { |
180 | 180 | ||
181 | case NAND_CTL_SETCLE: | 181 | case NAND_CTL_SETCLE: |
182 | this->IO_ADDR_W = ctx->base + MEM_STNAND_CMD; | 182 | this->legacy.IO_ADDR_W = ctx->base + MEM_STNAND_CMD; |
183 | break; | 183 | break; |
184 | 184 | ||
185 | case NAND_CTL_CLRCLE: | 185 | case NAND_CTL_CLRCLE: |
186 | this->IO_ADDR_W = ctx->base + MEM_STNAND_DATA; | 186 | this->legacy.IO_ADDR_W = ctx->base + MEM_STNAND_DATA; |
187 | break; | 187 | break; |
188 | 188 | ||
189 | case NAND_CTL_SETALE: | 189 | case NAND_CTL_SETALE: |
190 | this->IO_ADDR_W = ctx->base + MEM_STNAND_ADDR; | 190 | this->legacy.IO_ADDR_W = ctx->base + MEM_STNAND_ADDR; |
191 | break; | 191 | break; |
192 | 192 | ||
193 | case NAND_CTL_CLRALE: | 193 | case NAND_CTL_CLRALE: |
194 | this->IO_ADDR_W = ctx->base + MEM_STNAND_DATA; | 194 | this->legacy.IO_ADDR_W = ctx->base + MEM_STNAND_DATA; |
195 | /* FIXME: Nobody knows why this is necessary, | 195 | /* FIXME: Nobody knows why this is necessary, |
196 | * but it works only that way */ | 196 | * but it works only that way */ |
197 | udelay(1); | 197 | udelay(1); |
@@ -208,7 +208,7 @@ static void au1550_hwcontrol(struct mtd_info *mtd, int cmd) | |||
208 | break; | 208 | break; |
209 | } | 209 | } |
210 | 210 | ||
211 | this->IO_ADDR_R = this->IO_ADDR_W; | 211 | this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W; |
212 | 212 | ||
213 | wmb(); /* Drain the writebuffer */ | 213 | wmb(); /* Drain the writebuffer */ |
214 | } | 214 | } |
diff --git a/drivers/mtd/nand/raw/cmx270_nand.c b/drivers/mtd/nand/raw/cmx270_nand.c index e8458036419b..b4ed69815bed 100644 --- a/drivers/mtd/nand/raw/cmx270_nand.c +++ b/drivers/mtd/nand/raw/cmx270_nand.c | |||
@@ -51,7 +51,7 @@ static const struct mtd_partition partition_info[] = { | |||
51 | 51 | ||
52 | static u_char cmx270_read_byte(struct nand_chip *this) | 52 | static u_char cmx270_read_byte(struct nand_chip *this) |
53 | { | 53 | { |
54 | return (readl(this->IO_ADDR_R) >> 16); | 54 | return (readl(this->legacy.IO_ADDR_R) >> 16); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void cmx270_write_buf(struct nand_chip *this, const u_char *buf, | 57 | static void cmx270_write_buf(struct nand_chip *this, const u_char *buf, |
@@ -60,7 +60,7 @@ static void cmx270_write_buf(struct nand_chip *this, const u_char *buf, | |||
60 | int i; | 60 | int i; |
61 | 61 | ||
62 | for (i=0; i<len; i++) | 62 | for (i=0; i<len; i++) |
63 | writel((*buf++ << 16), this->IO_ADDR_W); | 63 | writel((*buf++ << 16), this->legacy.IO_ADDR_W); |
64 | } | 64 | } |
65 | 65 | ||
66 | static void cmx270_read_buf(struct nand_chip *this, u_char *buf, int len) | 66 | static void cmx270_read_buf(struct nand_chip *this, u_char *buf, int len) |
@@ -68,7 +68,7 @@ static void cmx270_read_buf(struct nand_chip *this, u_char *buf, int len) | |||
68 | int i; | 68 | int i; |
69 | 69 | ||
70 | for (i=0; i<len; i++) | 70 | for (i=0; i<len; i++) |
71 | *buf++ = readl(this->IO_ADDR_R) >> 16; | 71 | *buf++ = readl(this->legacy.IO_ADDR_R) >> 16; |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void nand_cs_on(void) | 74 | static inline void nand_cs_on(void) |
@@ -89,7 +89,7 @@ static void nand_cs_off(void) | |||
89 | static void cmx270_hwcontrol(struct nand_chip *this, int dat, | 89 | static void cmx270_hwcontrol(struct nand_chip *this, int dat, |
90 | unsigned int ctrl) | 90 | unsigned int ctrl) |
91 | { | 91 | { |
92 | unsigned int nandaddr = (unsigned int)this->IO_ADDR_W; | 92 | unsigned int nandaddr = (unsigned int)this->legacy.IO_ADDR_W; |
93 | 93 | ||
94 | dsb(); | 94 | dsb(); |
95 | 95 | ||
@@ -109,9 +109,9 @@ static void cmx270_hwcontrol(struct nand_chip *this, int dat, | |||
109 | } | 109 | } |
110 | 110 | ||
111 | dsb(); | 111 | dsb(); |
112 | this->IO_ADDR_W = (void __iomem*)nandaddr; | 112 | this->legacy.IO_ADDR_W = (void __iomem*)nandaddr; |
113 | if (dat != NAND_CMD_NONE) | 113 | if (dat != NAND_CMD_NONE) |
114 | writel((dat << 16), this->IO_ADDR_W); | 114 | writel((dat << 16), this->legacy.IO_ADDR_W); |
115 | 115 | ||
116 | dsb(); | 116 | dsb(); |
117 | } | 117 | } |
@@ -173,8 +173,8 @@ static int __init cmx270_init(void) | |||
173 | cmx270_nand_mtd->owner = THIS_MODULE; | 173 | cmx270_nand_mtd->owner = THIS_MODULE; |
174 | 174 | ||
175 | /* insert callbacks */ | 175 | /* insert callbacks */ |
176 | this->IO_ADDR_R = cmx270_nand_io; | 176 | this->legacy.IO_ADDR_R = cmx270_nand_io; |
177 | this->IO_ADDR_W = cmx270_nand_io; | 177 | this->legacy.IO_ADDR_W = cmx270_nand_io; |
178 | this->cmd_ctrl = cmx270_hwcontrol; | 178 | this->cmd_ctrl = cmx270_hwcontrol; |
179 | this->dev_ready = cmx270_device_ready; | 179 | this->dev_ready = cmx270_device_ready; |
180 | 180 | ||
diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c index c1628c03282a..b03fb36e9e69 100644 --- a/drivers/mtd/nand/raw/cs553x_nand.c +++ b/drivers/mtd/nand/raw/cs553x_nand.c | |||
@@ -96,43 +96,43 @@ | |||
96 | static void cs553x_read_buf(struct nand_chip *this, u_char *buf, int len) | 96 | static void cs553x_read_buf(struct nand_chip *this, u_char *buf, int len) |
97 | { | 97 | { |
98 | while (unlikely(len > 0x800)) { | 98 | while (unlikely(len > 0x800)) { |
99 | memcpy_fromio(buf, this->IO_ADDR_R, 0x800); | 99 | memcpy_fromio(buf, this->legacy.IO_ADDR_R, 0x800); |
100 | buf += 0x800; | 100 | buf += 0x800; |
101 | len -= 0x800; | 101 | len -= 0x800; |
102 | } | 102 | } |
103 | memcpy_fromio(buf, this->IO_ADDR_R, len); | 103 | memcpy_fromio(buf, this->legacy.IO_ADDR_R, len); |
104 | } | 104 | } |
105 | 105 | ||
106 | static void cs553x_write_buf(struct nand_chip *this, const u_char *buf, int len) | 106 | static void cs553x_write_buf(struct nand_chip *this, const u_char *buf, int len) |
107 | { | 107 | { |
108 | while (unlikely(len > 0x800)) { | 108 | while (unlikely(len > 0x800)) { |
109 | memcpy_toio(this->IO_ADDR_R, buf, 0x800); | 109 | memcpy_toio(this->legacy.IO_ADDR_R, buf, 0x800); |
110 | buf += 0x800; | 110 | buf += 0x800; |
111 | len -= 0x800; | 111 | len -= 0x800; |
112 | } | 112 | } |
113 | memcpy_toio(this->IO_ADDR_R, buf, len); | 113 | memcpy_toio(this->legacy.IO_ADDR_R, buf, len); |
114 | } | 114 | } |
115 | 115 | ||
116 | static unsigned char cs553x_read_byte(struct nand_chip *this) | 116 | static unsigned char cs553x_read_byte(struct nand_chip *this) |
117 | { | 117 | { |
118 | return readb(this->IO_ADDR_R); | 118 | return readb(this->legacy.IO_ADDR_R); |
119 | } | 119 | } |
120 | 120 | ||
121 | static void cs553x_write_byte(struct nand_chip *this, u_char byte) | 121 | static void cs553x_write_byte(struct nand_chip *this, u_char byte) |
122 | { | 122 | { |
123 | int i = 100000; | 123 | int i = 100000; |
124 | 124 | ||
125 | while (i && readb(this->IO_ADDR_R + MM_NAND_STS) & CS_NAND_CTLR_BUSY) { | 125 | while (i && readb(this->legacy.IO_ADDR_R + MM_NAND_STS) & CS_NAND_CTLR_BUSY) { |
126 | udelay(1); | 126 | udelay(1); |
127 | i--; | 127 | i--; |
128 | } | 128 | } |
129 | writeb(byte, this->IO_ADDR_W + 0x801); | 129 | writeb(byte, this->legacy.IO_ADDR_W + 0x801); |
130 | } | 130 | } |
131 | 131 | ||
132 | static void cs553x_hwcontrol(struct nand_chip *this, int cmd, | 132 | static void cs553x_hwcontrol(struct nand_chip *this, int cmd, |
133 | unsigned int ctrl) | 133 | unsigned int ctrl) |
134 | { | 134 | { |
135 | void __iomem *mmio_base = this->IO_ADDR_R; | 135 | void __iomem *mmio_base = this->legacy.IO_ADDR_R; |
136 | if (ctrl & NAND_CTRL_CHANGE) { | 136 | if (ctrl & NAND_CTRL_CHANGE) { |
137 | unsigned char ctl = (ctrl & ~NAND_CTRL_CHANGE ) ^ 0x01; | 137 | unsigned char ctl = (ctrl & ~NAND_CTRL_CHANGE ) ^ 0x01; |
138 | writeb(ctl, mmio_base + MM_NAND_CTL); | 138 | writeb(ctl, mmio_base + MM_NAND_CTL); |
@@ -143,7 +143,7 @@ static void cs553x_hwcontrol(struct nand_chip *this, int cmd, | |||
143 | 143 | ||
144 | static int cs553x_device_ready(struct nand_chip *this) | 144 | static int cs553x_device_ready(struct nand_chip *this) |
145 | { | 145 | { |
146 | void __iomem *mmio_base = this->IO_ADDR_R; | 146 | void __iomem *mmio_base = this->legacy.IO_ADDR_R; |
147 | unsigned char foo = readb(mmio_base + MM_NAND_STS); | 147 | unsigned char foo = readb(mmio_base + MM_NAND_STS); |
148 | 148 | ||
149 | return (foo & CS_NAND_STS_FLASH_RDY) && !(foo & CS_NAND_CTLR_BUSY); | 149 | return (foo & CS_NAND_STS_FLASH_RDY) && !(foo & CS_NAND_CTLR_BUSY); |
@@ -151,7 +151,7 @@ static int cs553x_device_ready(struct nand_chip *this) | |||
151 | 151 | ||
152 | static void cs_enable_hwecc(struct nand_chip *this, int mode) | 152 | static void cs_enable_hwecc(struct nand_chip *this, int mode) |
153 | { | 153 | { |
154 | void __iomem *mmio_base = this->IO_ADDR_R; | 154 | void __iomem *mmio_base = this->legacy.IO_ADDR_R; |
155 | 155 | ||
156 | writeb(0x07, mmio_base + MM_NAND_ECC_CTL); | 156 | writeb(0x07, mmio_base + MM_NAND_ECC_CTL); |
157 | } | 157 | } |
@@ -160,7 +160,7 @@ static int cs_calculate_ecc(struct nand_chip *this, const u_char *dat, | |||
160 | u_char *ecc_code) | 160 | u_char *ecc_code) |
161 | { | 161 | { |
162 | uint32_t ecc; | 162 | uint32_t ecc; |
163 | void __iomem *mmio_base = this->IO_ADDR_R; | 163 | void __iomem *mmio_base = this->legacy.IO_ADDR_R; |
164 | 164 | ||
165 | ecc = readl(mmio_base + MM_NAND_STS); | 165 | ecc = readl(mmio_base + MM_NAND_STS); |
166 | 166 | ||
@@ -199,8 +199,8 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) | |||
199 | new_mtd->owner = THIS_MODULE; | 199 | new_mtd->owner = THIS_MODULE; |
200 | 200 | ||
201 | /* map physical address */ | 201 | /* map physical address */ |
202 | this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096); | 202 | this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = ioremap(adr, 4096); |
203 | if (!this->IO_ADDR_R) { | 203 | if (!this->legacy.IO_ADDR_R) { |
204 | pr_warn("ioremap cs553x NAND @0x%08lx failed\n", adr); | 204 | pr_warn("ioremap cs553x NAND @0x%08lx failed\n", adr); |
205 | err = -EIO; | 205 | err = -EIO; |
206 | goto out_mtd; | 206 | goto out_mtd; |
@@ -242,7 +242,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) | |||
242 | out_free: | 242 | out_free: |
243 | kfree(new_mtd->name); | 243 | kfree(new_mtd->name); |
244 | out_ior: | 244 | out_ior: |
245 | iounmap(this->IO_ADDR_R); | 245 | iounmap(this->legacy.IO_ADDR_R); |
246 | out_mtd: | 246 | out_mtd: |
247 | kfree(this); | 247 | kfree(this); |
248 | out: | 248 | out: |
@@ -324,7 +324,7 @@ static void __exit cs553x_cleanup(void) | |||
324 | continue; | 324 | continue; |
325 | 325 | ||
326 | this = mtd_to_nand(mtd); | 326 | this = mtd_to_nand(mtd); |
327 | mmio_base = this->IO_ADDR_R; | 327 | mmio_base = this->legacy.IO_ADDR_R; |
328 | 328 | ||
329 | /* Release resources, unregister device */ | 329 | /* Release resources, unregister device */ |
330 | nand_release(this); | 330 | nand_release(this); |
diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index 4b261c73b240..1204b5120176 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c | |||
@@ -110,11 +110,11 @@ static void nand_davinci_hwcontrol(struct nand_chip *nand, int cmd, | |||
110 | else if ((ctrl & NAND_CTRL_ALE) == NAND_CTRL_ALE) | 110 | else if ((ctrl & NAND_CTRL_ALE) == NAND_CTRL_ALE) |
111 | addr += info->mask_ale; | 111 | addr += info->mask_ale; |
112 | 112 | ||
113 | nand->IO_ADDR_W = addr; | 113 | nand->legacy.IO_ADDR_W = addr; |
114 | } | 114 | } |
115 | 115 | ||
116 | if (cmd != NAND_CMD_NONE) | 116 | if (cmd != NAND_CMD_NONE) |
117 | iowrite8(cmd, nand->IO_ADDR_W); | 117 | iowrite8(cmd, nand->legacy.IO_ADDR_W); |
118 | } | 118 | } |
119 | 119 | ||
120 | static void nand_davinci_select_chip(struct nand_chip *nand, int chip) | 120 | static void nand_davinci_select_chip(struct nand_chip *nand, int chip) |
@@ -127,8 +127,8 @@ static void nand_davinci_select_chip(struct nand_chip *nand, int chip) | |||
127 | if (chip > 0) | 127 | if (chip > 0) |
128 | info->current_cs += info->mask_chipsel; | 128 | info->current_cs += info->mask_chipsel; |
129 | 129 | ||
130 | info->chip.IO_ADDR_W = info->current_cs; | 130 | info->chip.legacy.IO_ADDR_W = info->current_cs; |
131 | info->chip.IO_ADDR_R = info->chip.IO_ADDR_W; | 131 | info->chip.legacy.IO_ADDR_R = info->chip.legacy.IO_ADDR_W; |
132 | } | 132 | } |
133 | 133 | ||
134 | /*----------------------------------------------------------------------*/ | 134 | /*----------------------------------------------------------------------*/ |
@@ -438,22 +438,22 @@ static void nand_davinci_read_buf(struct nand_chip *chip, uint8_t *buf, | |||
438 | int len) | 438 | int len) |
439 | { | 439 | { |
440 | if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) | 440 | if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) |
441 | ioread32_rep(chip->IO_ADDR_R, buf, len >> 2); | 441 | ioread32_rep(chip->legacy.IO_ADDR_R, buf, len >> 2); |
442 | else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) | 442 | else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) |
443 | ioread16_rep(chip->IO_ADDR_R, buf, len >> 1); | 443 | ioread16_rep(chip->legacy.IO_ADDR_R, buf, len >> 1); |
444 | else | 444 | else |
445 | ioread8_rep(chip->IO_ADDR_R, buf, len); | 445 | ioread8_rep(chip->legacy.IO_ADDR_R, buf, len); |
446 | } | 446 | } |
447 | 447 | ||
448 | static void nand_davinci_write_buf(struct nand_chip *chip, const uint8_t *buf, | 448 | static void nand_davinci_write_buf(struct nand_chip *chip, const uint8_t *buf, |
449 | int len) | 449 | int len) |
450 | { | 450 | { |
451 | if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) | 451 | if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) |
452 | iowrite32_rep(chip->IO_ADDR_R, buf, len >> 2); | 452 | iowrite32_rep(chip->legacy.IO_ADDR_R, buf, len >> 2); |
453 | else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) | 453 | else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) |
454 | iowrite16_rep(chip->IO_ADDR_R, buf, len >> 1); | 454 | iowrite16_rep(chip->legacy.IO_ADDR_R, buf, len >> 1); |
455 | else | 455 | else |
456 | iowrite8_rep(chip->IO_ADDR_R, buf, len); | 456 | iowrite8_rep(chip->legacy.IO_ADDR_R, buf, len); |
457 | } | 457 | } |
458 | 458 | ||
459 | /* | 459 | /* |
@@ -759,8 +759,8 @@ static int nand_davinci_probe(struct platform_device *pdev) | |||
759 | mtd->dev.parent = &pdev->dev; | 759 | mtd->dev.parent = &pdev->dev; |
760 | nand_set_flash_node(&info->chip, pdev->dev.of_node); | 760 | nand_set_flash_node(&info->chip, pdev->dev.of_node); |
761 | 761 | ||
762 | info->chip.IO_ADDR_R = vaddr; | 762 | info->chip.legacy.IO_ADDR_R = vaddr; |
763 | info->chip.IO_ADDR_W = vaddr; | 763 | info->chip.legacy.IO_ADDR_W = vaddr; |
764 | info->chip.chip_delay = 0; | 764 | info->chip.chip_delay = 0; |
765 | info->chip.select_chip = nand_davinci_select_chip; | 765 | info->chip.select_chip = nand_davinci_select_chip; |
766 | 766 | ||
diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c index 48c5215f9a0e..f59fd57fc529 100644 --- a/drivers/mtd/nand/raw/fsl_upm.c +++ b/drivers/mtd/nand/raw/fsl_upm.c | |||
@@ -101,7 +101,7 @@ static void fun_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl) | |||
101 | 101 | ||
102 | mar = (cmd << (32 - fun->upm.width)) | | 102 | mar = (cmd << (32 - fun->upm.width)) | |
103 | fun->mchip_offsets[fun->mchip_number]; | 103 | fun->mchip_offsets[fun->mchip_number]; |
104 | fsl_upm_run_pattern(&fun->upm, chip->IO_ADDR_R, mar); | 104 | fsl_upm_run_pattern(&fun->upm, chip->legacy.IO_ADDR_R, mar); |
105 | 105 | ||
106 | if (fun->wait_flags & FSL_UPM_WAIT_RUN_PATTERN) | 106 | if (fun->wait_flags & FSL_UPM_WAIT_RUN_PATTERN) |
107 | fun_wait_rnb(fun); | 107 | fun_wait_rnb(fun); |
@@ -115,8 +115,8 @@ static void fun_select_chip(struct nand_chip *chip, int mchip_nr) | |||
115 | chip->cmd_ctrl(chip, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); | 115 | chip->cmd_ctrl(chip, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); |
116 | } else if (mchip_nr >= 0 && mchip_nr < NAND_MAX_CHIPS) { | 116 | } else if (mchip_nr >= 0 && mchip_nr < NAND_MAX_CHIPS) { |
117 | fun->mchip_number = mchip_nr; | 117 | fun->mchip_number = mchip_nr; |
118 | chip->IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr]; | 118 | chip->legacy.IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr]; |
119 | chip->IO_ADDR_W = chip->IO_ADDR_R; | 119 | chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; |
120 | } else { | 120 | } else { |
121 | BUG(); | 121 | BUG(); |
122 | } | 122 | } |
@@ -126,7 +126,7 @@ static uint8_t fun_read_byte(struct nand_chip *chip) | |||
126 | { | 126 | { |
127 | struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip)); | 127 | struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip)); |
128 | 128 | ||
129 | return in_8(fun->chip.IO_ADDR_R); | 129 | return in_8(fun->chip.legacy.IO_ADDR_R); |
130 | } | 130 | } |
131 | 131 | ||
132 | static void fun_read_buf(struct nand_chip *chip, uint8_t *buf, int len) | 132 | static void fun_read_buf(struct nand_chip *chip, uint8_t *buf, int len) |
@@ -135,7 +135,7 @@ static void fun_read_buf(struct nand_chip *chip, uint8_t *buf, int len) | |||
135 | int i; | 135 | int i; |
136 | 136 | ||
137 | for (i = 0; i < len; i++) | 137 | for (i = 0; i < len; i++) |
138 | buf[i] = in_8(fun->chip.IO_ADDR_R); | 138 | buf[i] = in_8(fun->chip.legacy.IO_ADDR_R); |
139 | } | 139 | } |
140 | 140 | ||
141 | static void fun_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) | 141 | static void fun_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) |
@@ -144,7 +144,7 @@ static void fun_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) | |||
144 | int i; | 144 | int i; |
145 | 145 | ||
146 | for (i = 0; i < len; i++) { | 146 | for (i = 0; i < len; i++) { |
147 | out_8(fun->chip.IO_ADDR_W, buf[i]); | 147 | out_8(fun->chip.legacy.IO_ADDR_W, buf[i]); |
148 | if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BYTE) | 148 | if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BYTE) |
149 | fun_wait_rnb(fun); | 149 | fun_wait_rnb(fun); |
150 | } | 150 | } |
@@ -160,8 +160,8 @@ static int fun_chip_init(struct fsl_upm_nand *fun, | |||
160 | int ret; | 160 | int ret; |
161 | struct device_node *flash_np; | 161 | struct device_node *flash_np; |
162 | 162 | ||
163 | fun->chip.IO_ADDR_R = fun->io_base; | 163 | fun->chip.legacy.IO_ADDR_R = fun->io_base; |
164 | fun->chip.IO_ADDR_W = fun->io_base; | 164 | fun->chip.legacy.IO_ADDR_W = fun->io_base; |
165 | fun->chip.cmd_ctrl = fun_cmd_ctrl; | 165 | fun->chip.cmd_ctrl = fun_cmd_ctrl; |
166 | fun->chip.chip_delay = fun->chip_delay; | 166 | fun->chip.chip_delay = fun->chip_delay; |
167 | fun->chip.read_byte = fun_read_byte; | 167 | fun->chip.read_byte = fun_read_byte; |
diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c index 273437c1ae6c..bb43fad65362 100644 --- a/drivers/mtd/nand/raw/gpio.c +++ b/drivers/mtd/nand/raw/gpio.c | |||
@@ -90,7 +90,7 @@ static void gpio_nand_cmd_ctrl(struct nand_chip *chip, int cmd, | |||
90 | if (cmd == NAND_CMD_NONE) | 90 | if (cmd == NAND_CMD_NONE) |
91 | return; | 91 | return; |
92 | 92 | ||
93 | writeb(cmd, gpiomtd->nand_chip.IO_ADDR_W); | 93 | writeb(cmd, gpiomtd->nand_chip.legacy.IO_ADDR_W); |
94 | gpio_nand_dosync(gpiomtd); | 94 | gpio_nand_dosync(gpiomtd); |
95 | } | 95 | } |
96 | 96 | ||
@@ -225,9 +225,9 @@ static int gpio_nand_probe(struct platform_device *pdev) | |||
225 | chip = &gpiomtd->nand_chip; | 225 | chip = &gpiomtd->nand_chip; |
226 | 226 | ||
227 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 227 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
228 | chip->IO_ADDR_R = devm_ioremap_resource(dev, res); | 228 | chip->legacy.IO_ADDR_R = devm_ioremap_resource(dev, res); |
229 | if (IS_ERR(chip->IO_ADDR_R)) | 229 | if (IS_ERR(chip->legacy.IO_ADDR_R)) |
230 | return PTR_ERR(chip->IO_ADDR_R); | 230 | return PTR_ERR(chip->legacy.IO_ADDR_R); |
231 | 231 | ||
232 | res = gpio_nand_get_io_sync(pdev); | 232 | res = gpio_nand_get_io_sync(pdev); |
233 | if (res) { | 233 | if (res) { |
@@ -274,7 +274,7 @@ static int gpio_nand_probe(struct platform_device *pdev) | |||
274 | chip->dev_ready = gpio_nand_devready; | 274 | chip->dev_ready = gpio_nand_devready; |
275 | 275 | ||
276 | nand_set_flash_node(chip, pdev->dev.of_node); | 276 | nand_set_flash_node(chip, pdev->dev.of_node); |
277 | chip->IO_ADDR_W = chip->IO_ADDR_R; | 277 | chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; |
278 | chip->ecc.mode = NAND_ECC_SOFT; | 278 | chip->ecc.mode = NAND_ECC_SOFT; |
279 | chip->ecc.algo = NAND_ECC_HAMMING; | 279 | chip->ecc.algo = NAND_ECC_HAMMING; |
280 | chip->options = gpiomtd->plat.options; | 280 | chip->options = gpiomtd->plat.options; |
diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c index 946a71cf816d..449180de92e2 100644 --- a/drivers/mtd/nand/raw/jz4740_nand.c +++ b/drivers/mtd/nand/raw/jz4740_nand.c | |||
@@ -91,8 +91,8 @@ static void jz_nand_select_chip(struct nand_chip *chip, int chipnr) | |||
91 | banknr = -1; | 91 | banknr = -1; |
92 | } else { | 92 | } else { |
93 | banknr = nand->banks[chipnr] - 1; | 93 | banknr = nand->banks[chipnr] - 1; |
94 | chip->IO_ADDR_R = nand->bank_base[banknr]; | 94 | chip->legacy.IO_ADDR_R = nand->bank_base[banknr]; |
95 | chip->IO_ADDR_W = nand->bank_base[banknr]; | 95 | chip->legacy.IO_ADDR_W = nand->bank_base[banknr]; |
96 | } | 96 | } |
97 | writel(ctrl, nand->base + JZ_REG_NAND_CTRL); | 97 | writel(ctrl, nand->base + JZ_REG_NAND_CTRL); |
98 | 98 | ||
@@ -114,7 +114,7 @@ static void jz_nand_cmd_ctrl(struct nand_chip *chip, int dat, | |||
114 | bank_base += JZ_NAND_MEM_ADDR_OFFSET; | 114 | bank_base += JZ_NAND_MEM_ADDR_OFFSET; |
115 | else if (ctrl & NAND_CLE) | 115 | else if (ctrl & NAND_CLE) |
116 | bank_base += JZ_NAND_MEM_CMD_OFFSET; | 116 | bank_base += JZ_NAND_MEM_CMD_OFFSET; |
117 | chip->IO_ADDR_W = bank_base; | 117 | chip->legacy.IO_ADDR_W = bank_base; |
118 | 118 | ||
119 | reg = readl(nand->base + JZ_REG_NAND_CTRL); | 119 | reg = readl(nand->base + JZ_REG_NAND_CTRL); |
120 | if (ctrl & NAND_NCE) | 120 | if (ctrl & NAND_NCE) |
@@ -124,7 +124,7 @@ static void jz_nand_cmd_ctrl(struct nand_chip *chip, int dat, | |||
124 | writel(reg, nand->base + JZ_REG_NAND_CTRL); | 124 | writel(reg, nand->base + JZ_REG_NAND_CTRL); |
125 | } | 125 | } |
126 | if (dat != NAND_CMD_NONE) | 126 | if (dat != NAND_CMD_NONE) |
127 | writeb(dat, chip->IO_ADDR_W); | 127 | writeb(dat, chip->legacy.IO_ADDR_W); |
128 | } | 128 | } |
129 | 129 | ||
130 | static int jz_nand_dev_ready(struct nand_chip *chip) | 130 | static int jz_nand_dev_ready(struct nand_chip *chip) |
diff --git a/drivers/mtd/nand/raw/jz4780_nand.c b/drivers/mtd/nand/raw/jz4780_nand.c index d54b2774f7f9..89909a17242d 100644 --- a/drivers/mtd/nand/raw/jz4780_nand.c +++ b/drivers/mtd/nand/raw/jz4780_nand.c | |||
@@ -275,8 +275,8 @@ static int jz4780_nand_init_chip(struct platform_device *pdev, | |||
275 | return -ENOMEM; | 275 | return -ENOMEM; |
276 | mtd->dev.parent = dev; | 276 | mtd->dev.parent = dev; |
277 | 277 | ||
278 | chip->IO_ADDR_R = cs->base + OFFSET_DATA; | 278 | chip->legacy.IO_ADDR_R = cs->base + OFFSET_DATA; |
279 | chip->IO_ADDR_W = cs->base + OFFSET_DATA; | 279 | chip->legacy.IO_ADDR_W = cs->base + OFFSET_DATA; |
280 | chip->chip_delay = RB_DELAY_US; | 280 | chip->chip_delay = RB_DELAY_US; |
281 | chip->options = NAND_NO_SUBPAGE_WRITE; | 281 | chip->options = NAND_NO_SUBPAGE_WRITE; |
282 | chip->select_chip = jz4780_nand_select_chip; | 282 | chip->select_chip = jz4780_nand_select_chip; |
diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index ae31f6ccbeb3..cc1c6e6c59e1 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c | |||
@@ -742,8 +742,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
742 | nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; | 742 | nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; |
743 | nand_chip->dev_ready = lpc32xx_nand_device_ready; | 743 | nand_chip->dev_ready = lpc32xx_nand_device_ready; |
744 | nand_chip->chip_delay = 25; /* us */ | 744 | nand_chip->chip_delay = 25; /* us */ |
745 | nand_chip->IO_ADDR_R = MLC_DATA(host->io_base); | 745 | nand_chip->legacy.IO_ADDR_R = MLC_DATA(host->io_base); |
746 | nand_chip->IO_ADDR_W = MLC_DATA(host->io_base); | 746 | nand_chip->legacy.IO_ADDR_W = MLC_DATA(host->io_base); |
747 | 747 | ||
748 | /* Init NAND controller */ | 748 | /* Init NAND controller */ |
749 | lpc32xx_nand_setup(host); | 749 | lpc32xx_nand_setup(host); |
diff --git a/drivers/mtd/nand/raw/lpc32xx_slc.c b/drivers/mtd/nand/raw/lpc32xx_slc.c index 26d27a81f814..8a6f109c43af 100644 --- a/drivers/mtd/nand/raw/lpc32xx_slc.c +++ b/drivers/mtd/nand/raw/lpc32xx_slc.c | |||
@@ -878,8 +878,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) | |||
878 | goto enable_wp; | 878 | goto enable_wp; |
879 | 879 | ||
880 | /* Set NAND IO addresses and command/ready functions */ | 880 | /* Set NAND IO addresses and command/ready functions */ |
881 | chip->IO_ADDR_R = SLC_DATA(host->io_base); | 881 | chip->legacy.IO_ADDR_R = SLC_DATA(host->io_base); |
882 | chip->IO_ADDR_W = SLC_DATA(host->io_base); | 882 | chip->legacy.IO_ADDR_W = SLC_DATA(host->io_base); |
883 | chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; | 883 | chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; |
884 | chip->dev_ready = lpc32xx_nand_device_ready; | 884 | chip->dev_ready = lpc32xx_nand_device_ready; |
885 | chip->chip_delay = 20; /* 20us command delay time */ | 885 | chip->chip_delay = 20; /* 20us command delay time */ |
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index e63dfad8235b..1edaa9fdbce9 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c | |||
@@ -260,7 +260,7 @@ static void nand_release_device(struct mtd_info *mtd) | |||
260 | */ | 260 | */ |
261 | static uint8_t nand_read_byte(struct nand_chip *chip) | 261 | static uint8_t nand_read_byte(struct nand_chip *chip) |
262 | { | 262 | { |
263 | return readb(chip->IO_ADDR_R); | 263 | return readb(chip->legacy.IO_ADDR_R); |
264 | } | 264 | } |
265 | 265 | ||
266 | /** | 266 | /** |
@@ -272,7 +272,7 @@ static uint8_t nand_read_byte(struct nand_chip *chip) | |||
272 | */ | 272 | */ |
273 | static uint8_t nand_read_byte16(struct nand_chip *chip) | 273 | static uint8_t nand_read_byte16(struct nand_chip *chip) |
274 | { | 274 | { |
275 | return (uint8_t) cpu_to_le16(readw(chip->IO_ADDR_R)); | 275 | return (uint8_t) cpu_to_le16(readw(chip->legacy.IO_ADDR_R)); |
276 | } | 276 | } |
277 | 277 | ||
278 | /** | 278 | /** |
@@ -348,7 +348,7 @@ static void nand_write_byte16(struct nand_chip *chip, uint8_t byte) | |||
348 | */ | 348 | */ |
349 | static void nand_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) | 349 | static void nand_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) |
350 | { | 350 | { |
351 | iowrite8_rep(chip->IO_ADDR_W, buf, len); | 351 | iowrite8_rep(chip->legacy.IO_ADDR_W, buf, len); |
352 | } | 352 | } |
353 | 353 | ||
354 | /** | 354 | /** |
@@ -361,7 +361,7 @@ static void nand_write_buf(struct nand_chip *chip, const uint8_t *buf, int len) | |||
361 | */ | 361 | */ |
362 | static void nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len) | 362 | static void nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len) |
363 | { | 363 | { |
364 | ioread8_rep(chip->IO_ADDR_R, buf, len); | 364 | ioread8_rep(chip->legacy.IO_ADDR_R, buf, len); |
365 | } | 365 | } |
366 | 366 | ||
367 | /** | 367 | /** |
@@ -377,7 +377,7 @@ static void nand_write_buf16(struct nand_chip *chip, const uint8_t *buf, | |||
377 | { | 377 | { |
378 | u16 *p = (u16 *) buf; | 378 | u16 *p = (u16 *) buf; |
379 | 379 | ||
380 | iowrite16_rep(chip->IO_ADDR_W, p, len >> 1); | 380 | iowrite16_rep(chip->legacy.IO_ADDR_W, p, len >> 1); |
381 | } | 381 | } |
382 | 382 | ||
383 | /** | 383 | /** |
@@ -392,7 +392,7 @@ static void nand_read_buf16(struct nand_chip *chip, uint8_t *buf, int len) | |||
392 | { | 392 | { |
393 | u16 *p = (u16 *) buf; | 393 | u16 *p = (u16 *) buf; |
394 | 394 | ||
395 | ioread16_rep(chip->IO_ADDR_R, p, len >> 1); | 395 | ioread16_rep(chip->legacy.IO_ADDR_R, p, len >> 1); |
396 | } | 396 | } |
397 | 397 | ||
398 | /** | 398 | /** |
diff --git a/drivers/mtd/nand/raw/ndfc.c b/drivers/mtd/nand/raw/ndfc.c index b96070a3afff..adc4060c65ad 100644 --- a/drivers/mtd/nand/raw/ndfc.c +++ b/drivers/mtd/nand/raw/ndfc.c | |||
@@ -142,8 +142,8 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, | |||
142 | struct mtd_info *mtd = nand_to_mtd(chip); | 142 | struct mtd_info *mtd = nand_to_mtd(chip); |
143 | int ret; | 143 | int ret; |
144 | 144 | ||
145 | chip->IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA; | 145 | chip->legacy.IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA; |
146 | chip->IO_ADDR_W = ndfc->ndfcbase + NDFC_DATA; | 146 | chip->legacy.IO_ADDR_W = ndfc->ndfcbase + NDFC_DATA; |
147 | chip->cmd_ctrl = ndfc_hwcontrol; | 147 | chip->cmd_ctrl = ndfc_hwcontrol; |
148 | chip->dev_ready = ndfc_ready; | 148 | chip->dev_ready = ndfc_ready; |
149 | chip->select_chip = ndfc_select_chip; | 149 | chip->select_chip = ndfc_select_chip; |
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c index 6f0fec3596cc..627048886c95 100644 --- a/drivers/mtd/nand/raw/omap2.c +++ b/drivers/mtd/nand/raw/omap2.c | |||
@@ -275,7 +275,7 @@ static void omap_read_buf8(struct mtd_info *mtd, u_char *buf, int len) | |||
275 | { | 275 | { |
276 | struct nand_chip *nand = mtd_to_nand(mtd); | 276 | struct nand_chip *nand = mtd_to_nand(mtd); |
277 | 277 | ||
278 | ioread8_rep(nand->IO_ADDR_R, buf, len); | 278 | ioread8_rep(nand->legacy.IO_ADDR_R, buf, len); |
279 | } | 279 | } |
280 | 280 | ||
281 | /** | 281 | /** |
@@ -291,7 +291,7 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) | |||
291 | bool status; | 291 | bool status; |
292 | 292 | ||
293 | while (len--) { | 293 | while (len--) { |
294 | iowrite8(*p++, info->nand.IO_ADDR_W); | 294 | iowrite8(*p++, info->nand.legacy.IO_ADDR_W); |
295 | /* wait until buffer is available for write */ | 295 | /* wait until buffer is available for write */ |
296 | do { | 296 | do { |
297 | status = info->ops->nand_writebuffer_empty(); | 297 | status = info->ops->nand_writebuffer_empty(); |
@@ -309,7 +309,7 @@ static void omap_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | |||
309 | { | 309 | { |
310 | struct nand_chip *nand = mtd_to_nand(mtd); | 310 | struct nand_chip *nand = mtd_to_nand(mtd); |
311 | 311 | ||
312 | ioread16_rep(nand->IO_ADDR_R, buf, len / 2); | 312 | ioread16_rep(nand->legacy.IO_ADDR_R, buf, len / 2); |
313 | } | 313 | } |
314 | 314 | ||
315 | /** | 315 | /** |
@@ -327,7 +327,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) | |||
327 | len >>= 1; | 327 | len >>= 1; |
328 | 328 | ||
329 | while (len--) { | 329 | while (len--) { |
330 | iowrite16(*p++, info->nand.IO_ADDR_W); | 330 | iowrite16(*p++, info->nand.legacy.IO_ADDR_W); |
331 | /* wait until buffer is available for write */ | 331 | /* wait until buffer is available for write */ |
332 | do { | 332 | do { |
333 | status = info->ops->nand_writebuffer_empty(); | 333 | status = info->ops->nand_writebuffer_empty(); |
@@ -373,7 +373,7 @@ static void omap_read_buf_pref(struct nand_chip *chip, u_char *buf, int len) | |||
373 | r_count = readl(info->reg.gpmc_prefetch_status); | 373 | r_count = readl(info->reg.gpmc_prefetch_status); |
374 | r_count = PREFETCH_STATUS_FIFO_CNT(r_count); | 374 | r_count = PREFETCH_STATUS_FIFO_CNT(r_count); |
375 | r_count = r_count >> 2; | 375 | r_count = r_count >> 2; |
376 | ioread32_rep(info->nand.IO_ADDR_R, p, r_count); | 376 | ioread32_rep(info->nand.legacy.IO_ADDR_R, p, r_count); |
377 | p += r_count; | 377 | p += r_count; |
378 | len -= r_count << 2; | 378 | len -= r_count << 2; |
379 | } while (len); | 379 | } while (len); |
@@ -401,7 +401,7 @@ static void omap_write_buf_pref(struct nand_chip *chip, const u_char *buf, | |||
401 | 401 | ||
402 | /* take care of subpage writes */ | 402 | /* take care of subpage writes */ |
403 | if (len % 2 != 0) { | 403 | if (len % 2 != 0) { |
404 | writeb(*buf, info->nand.IO_ADDR_W); | 404 | writeb(*buf, info->nand.legacy.IO_ADDR_W); |
405 | p = (u16 *)(buf + 1); | 405 | p = (u16 *)(buf + 1); |
406 | len--; | 406 | len--; |
407 | } | 407 | } |
@@ -421,7 +421,7 @@ static void omap_write_buf_pref(struct nand_chip *chip, const u_char *buf, | |||
421 | w_count = PREFETCH_STATUS_FIFO_CNT(w_count); | 421 | w_count = PREFETCH_STATUS_FIFO_CNT(w_count); |
422 | w_count = w_count >> 1; | 422 | w_count = w_count >> 1; |
423 | for (i = 0; (i < w_count) && len; i++, len -= 2) | 423 | for (i = 0; (i < w_count) && len; i++, len -= 2) |
424 | iowrite16(*p++, info->nand.IO_ADDR_W); | 424 | iowrite16(*p++, info->nand.legacy.IO_ADDR_W); |
425 | } | 425 | } |
426 | /* wait for data to flushed-out before reset the prefetch */ | 426 | /* wait for data to flushed-out before reset the prefetch */ |
427 | tim = 0; | 427 | tim = 0; |
@@ -585,14 +585,14 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) | |||
585 | bytes = info->buf_len; | 585 | bytes = info->buf_len; |
586 | else if (!info->buf_len) | 586 | else if (!info->buf_len) |
587 | bytes = 0; | 587 | bytes = 0; |
588 | iowrite32_rep(info->nand.IO_ADDR_W, | 588 | iowrite32_rep(info->nand.legacy.IO_ADDR_W, (u32 *)info->buf, |
589 | (u32 *)info->buf, bytes >> 2); | 589 | bytes >> 2); |
590 | info->buf = info->buf + bytes; | 590 | info->buf = info->buf + bytes; |
591 | info->buf_len -= bytes; | 591 | info->buf_len -= bytes; |
592 | 592 | ||
593 | } else { | 593 | } else { |
594 | ioread32_rep(info->nand.IO_ADDR_R, | 594 | ioread32_rep(info->nand.legacy.IO_ADDR_R, (u32 *)info->buf, |
595 | (u32 *)info->buf, bytes >> 2); | 595 | bytes >> 2); |
596 | info->buf = info->buf + bytes; | 596 | info->buf = info->buf + bytes; |
597 | 597 | ||
598 | if (this_irq == info->gpmc_irq_count) | 598 | if (this_irq == info->gpmc_irq_count) |
@@ -2221,15 +2221,15 @@ static int omap_nand_probe(struct platform_device *pdev) | |||
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2223 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2224 | nand_chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res); | 2224 | nand_chip->legacy.IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res); |
2225 | if (IS_ERR(nand_chip->IO_ADDR_R)) | 2225 | if (IS_ERR(nand_chip->legacy.IO_ADDR_R)) |
2226 | return PTR_ERR(nand_chip->IO_ADDR_R); | 2226 | return PTR_ERR(nand_chip->legacy.IO_ADDR_R); |
2227 | 2227 | ||
2228 | info->phys_base = res->start; | 2228 | info->phys_base = res->start; |
2229 | 2229 | ||
2230 | nand_chip->controller = &omap_gpmc_controller; | 2230 | nand_chip->controller = &omap_gpmc_controller; |
2231 | 2231 | ||
2232 | nand_chip->IO_ADDR_W = nand_chip->IO_ADDR_R; | 2232 | nand_chip->legacy.IO_ADDR_W = nand_chip->legacy.IO_ADDR_R; |
2233 | nand_chip->cmd_ctrl = omap_hwcontrol; | 2233 | nand_chip->cmd_ctrl = omap_hwcontrol; |
2234 | 2234 | ||
2235 | info->ready_gpiod = devm_gpiod_get_optional(&pdev->dev, "rb", | 2235 | info->ready_gpiod = devm_gpiod_get_optional(&pdev->dev, "rb", |
diff --git a/drivers/mtd/nand/raw/orion_nand.c b/drivers/mtd/nand/raw/orion_nand.c index 92d8f249ee97..d73e3c7a3f3a 100644 --- a/drivers/mtd/nand/raw/orion_nand.c +++ b/drivers/mtd/nand/raw/orion_nand.c | |||
@@ -45,12 +45,12 @@ static void orion_nand_cmd_ctrl(struct nand_chip *nc, int cmd, | |||
45 | if (nc->options & NAND_BUSWIDTH_16) | 45 | if (nc->options & NAND_BUSWIDTH_16) |
46 | offs <<= 1; | 46 | offs <<= 1; |
47 | 47 | ||
48 | writeb(cmd, nc->IO_ADDR_W + offs); | 48 | writeb(cmd, nc->legacy.IO_ADDR_W + offs); |
49 | } | 49 | } |
50 | 50 | ||
51 | static void orion_nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len) | 51 | static void orion_nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len) |
52 | { | 52 | { |
53 | void __iomem *io_base = chip->IO_ADDR_R; | 53 | void __iomem *io_base = chip->legacy.IO_ADDR_R; |
54 | #if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >= 5 | 54 | #if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >= 5 |
55 | uint64_t *buf64; | 55 | uint64_t *buf64; |
56 | #endif | 56 | #endif |
@@ -136,7 +136,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
136 | 136 | ||
137 | nand_set_controller_data(nc, board); | 137 | nand_set_controller_data(nc, board); |
138 | nand_set_flash_node(nc, pdev->dev.of_node); | 138 | nand_set_flash_node(nc, pdev->dev.of_node); |
139 | nc->IO_ADDR_R = nc->IO_ADDR_W = io_base; | 139 | nc->legacy.IO_ADDR_R = nc->legacy.IO_ADDR_W = io_base; |
140 | nc->cmd_ctrl = orion_nand_cmd_ctrl; | 140 | nc->cmd_ctrl = orion_nand_cmd_ctrl; |
141 | nc->read_buf = orion_nand_read_buf; | 141 | nc->read_buf = orion_nand_read_buf; |
142 | nc->ecc.mode = NAND_ECC_SOFT; | 142 | nc->ecc.mode = NAND_ECC_SOFT; |
diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c index a1e3bf7a276b..1b367bf9ef53 100644 --- a/drivers/mtd/nand/raw/pasemi_nand.c +++ b/drivers/mtd/nand/raw/pasemi_nand.c | |||
@@ -46,22 +46,22 @@ static const char driver_name[] = "pasemi-nand"; | |||
46 | static void pasemi_read_buf(struct nand_chip *chip, u_char *buf, int len) | 46 | static void pasemi_read_buf(struct nand_chip *chip, u_char *buf, int len) |
47 | { | 47 | { |
48 | while (len > 0x800) { | 48 | while (len > 0x800) { |
49 | memcpy_fromio(buf, chip->IO_ADDR_R, 0x800); | 49 | memcpy_fromio(buf, chip->legacy.IO_ADDR_R, 0x800); |
50 | buf += 0x800; | 50 | buf += 0x800; |
51 | len -= 0x800; | 51 | len -= 0x800; |
52 | } | 52 | } |
53 | memcpy_fromio(buf, chip->IO_ADDR_R, len); | 53 | memcpy_fromio(buf, chip->legacy.IO_ADDR_R, len); |
54 | } | 54 | } |
55 | 55 | ||
56 | static void pasemi_write_buf(struct nand_chip *chip, const u_char *buf, | 56 | static void pasemi_write_buf(struct nand_chip *chip, const u_char *buf, |
57 | int len) | 57 | int len) |
58 | { | 58 | { |
59 | while (len > 0x800) { | 59 | while (len > 0x800) { |
60 | memcpy_toio(chip->IO_ADDR_R, buf, 0x800); | 60 | memcpy_toio(chip->legacy.IO_ADDR_R, buf, 0x800); |
61 | buf += 0x800; | 61 | buf += 0x800; |
62 | len -= 0x800; | 62 | len -= 0x800; |
63 | } | 63 | } |
64 | memcpy_toio(chip->IO_ADDR_R, buf, len); | 64 | memcpy_toio(chip->legacy.IO_ADDR_R, buf, len); |
65 | } | 65 | } |
66 | 66 | ||
67 | static void pasemi_hwcontrol(struct nand_chip *chip, int cmd, | 67 | static void pasemi_hwcontrol(struct nand_chip *chip, int cmd, |
@@ -71,9 +71,9 @@ static void pasemi_hwcontrol(struct nand_chip *chip, int cmd, | |||
71 | return; | 71 | return; |
72 | 72 | ||
73 | if (ctrl & NAND_CLE) | 73 | if (ctrl & NAND_CLE) |
74 | out_8(chip->IO_ADDR_W + (1 << CLE_PIN_CTL), cmd); | 74 | out_8(chip->legacy.IO_ADDR_W + (1 << CLE_PIN_CTL), cmd); |
75 | else | 75 | else |
76 | out_8(chip->IO_ADDR_W + (1 << ALE_PIN_CTL), cmd); | 76 | out_8(chip->legacy.IO_ADDR_W + (1 << ALE_PIN_CTL), cmd); |
77 | 77 | ||
78 | /* Push out posted writes */ | 78 | /* Push out posted writes */ |
79 | eieio(); | 79 | eieio(); |
@@ -117,10 +117,10 @@ static int pasemi_nand_probe(struct platform_device *ofdev) | |||
117 | /* Link the private data with the MTD structure */ | 117 | /* Link the private data with the MTD structure */ |
118 | pasemi_nand_mtd->dev.parent = dev; | 118 | pasemi_nand_mtd->dev.parent = dev; |
119 | 119 | ||
120 | chip->IO_ADDR_R = of_iomap(np, 0); | 120 | chip->legacy.IO_ADDR_R = of_iomap(np, 0); |
121 | chip->IO_ADDR_W = chip->IO_ADDR_R; | 121 | chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; |
122 | 122 | ||
123 | if (!chip->IO_ADDR_R) { | 123 | if (!chip->legacy.IO_ADDR_R) { |
124 | err = -EIO; | 124 | err = -EIO; |
125 | goto out_mtd; | 125 | goto out_mtd; |
126 | } | 126 | } |
@@ -169,7 +169,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) | |||
169 | out_lpc: | 169 | out_lpc: |
170 | release_region(lpcctl, 4); | 170 | release_region(lpcctl, 4); |
171 | out_ior: | 171 | out_ior: |
172 | iounmap(chip->IO_ADDR_R); | 172 | iounmap(chip->legacy.IO_ADDR_R); |
173 | out_mtd: | 173 | out_mtd: |
174 | kfree(chip); | 174 | kfree(chip); |
175 | out: | 175 | out: |
@@ -190,7 +190,7 @@ static int pasemi_nand_remove(struct platform_device *ofdev) | |||
190 | 190 | ||
191 | release_region(lpcctl, 4); | 191 | release_region(lpcctl, 4); |
192 | 192 | ||
193 | iounmap(chip->IO_ADDR_R); | 193 | iounmap(chip->legacy.IO_ADDR_R); |
194 | 194 | ||
195 | /* Free the MTD device structure */ | 195 | /* Free the MTD device structure */ |
196 | kfree(chip); | 196 | kfree(chip); |
diff --git a/drivers/mtd/nand/raw/plat_nand.c b/drivers/mtd/nand/raw/plat_nand.c index d65e4084dea4..c06347531d26 100644 --- a/drivers/mtd/nand/raw/plat_nand.c +++ b/drivers/mtd/nand/raw/plat_nand.c | |||
@@ -60,8 +60,8 @@ static int plat_nand_probe(struct platform_device *pdev) | |||
60 | mtd = nand_to_mtd(&data->chip); | 60 | mtd = nand_to_mtd(&data->chip); |
61 | mtd->dev.parent = &pdev->dev; | 61 | mtd->dev.parent = &pdev->dev; |
62 | 62 | ||
63 | data->chip.IO_ADDR_R = data->io_base; | 63 | data->chip.legacy.IO_ADDR_R = data->io_base; |
64 | data->chip.IO_ADDR_W = data->io_base; | 64 | data->chip.legacy.IO_ADDR_W = data->io_base; |
65 | data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl; | 65 | data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl; |
66 | data->chip.dev_ready = pdata->ctrl.dev_ready; | 66 | data->chip.dev_ready = pdata->ctrl.dev_ready; |
67 | data->chip.select_chip = pdata->ctrl.select_chip; | 67 | data->chip.select_chip = pdata->ctrl.select_chip; |
diff --git a/drivers/mtd/nand/raw/s3c2410.c b/drivers/mtd/nand/raw/s3c2410.c index 1f70eb35320b..473abf10eeec 100644 --- a/drivers/mtd/nand/raw/s3c2410.c +++ b/drivers/mtd/nand/raw/s3c2410.c | |||
@@ -681,7 +681,7 @@ static int s3c2440_nand_calculate_ecc(struct nand_chip *chip, | |||
681 | 681 | ||
682 | static void s3c2410_nand_read_buf(struct nand_chip *this, u_char *buf, int len) | 682 | static void s3c2410_nand_read_buf(struct nand_chip *this, u_char *buf, int len) |
683 | { | 683 | { |
684 | readsb(this->IO_ADDR_R, buf, len); | 684 | readsb(this->legacy.IO_ADDR_R, buf, len); |
685 | } | 685 | } |
686 | 686 | ||
687 | static void s3c2440_nand_read_buf(struct nand_chip *this, u_char *buf, int len) | 687 | static void s3c2440_nand_read_buf(struct nand_chip *this, u_char *buf, int len) |
@@ -703,7 +703,7 @@ static void s3c2440_nand_read_buf(struct nand_chip *this, u_char *buf, int len) | |||
703 | static void s3c2410_nand_write_buf(struct nand_chip *this, const u_char *buf, | 703 | static void s3c2410_nand_write_buf(struct nand_chip *this, const u_char *buf, |
704 | int len) | 704 | int len) |
705 | { | 705 | { |
706 | writesb(this->IO_ADDR_W, buf, len); | 706 | writesb(this->legacy.IO_ADDR_W, buf, len); |
707 | } | 707 | } |
708 | 708 | ||
709 | static void s3c2440_nand_write_buf(struct nand_chip *this, const u_char *buf, | 709 | static void s3c2440_nand_write_buf(struct nand_chip *this, const u_char *buf, |
@@ -881,7 +881,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
881 | 881 | ||
882 | switch (info->cpu_type) { | 882 | switch (info->cpu_type) { |
883 | case TYPE_S3C2410: | 883 | case TYPE_S3C2410: |
884 | chip->IO_ADDR_W = regs + S3C2410_NFDATA; | 884 | chip->legacy.IO_ADDR_W = regs + S3C2410_NFDATA; |
885 | info->sel_reg = regs + S3C2410_NFCONF; | 885 | info->sel_reg = regs + S3C2410_NFCONF; |
886 | info->sel_bit = S3C2410_NFCONF_nFCE; | 886 | info->sel_bit = S3C2410_NFCONF_nFCE; |
887 | chip->cmd_ctrl = s3c2410_nand_hwcontrol; | 887 | chip->cmd_ctrl = s3c2410_nand_hwcontrol; |
@@ -889,7 +889,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
889 | break; | 889 | break; |
890 | 890 | ||
891 | case TYPE_S3C2440: | 891 | case TYPE_S3C2440: |
892 | chip->IO_ADDR_W = regs + S3C2440_NFDATA; | 892 | chip->legacy.IO_ADDR_W = regs + S3C2440_NFDATA; |
893 | info->sel_reg = regs + S3C2440_NFCONT; | 893 | info->sel_reg = regs + S3C2440_NFCONT; |
894 | info->sel_bit = S3C2440_NFCONT_nFCE; | 894 | info->sel_bit = S3C2440_NFCONT_nFCE; |
895 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; | 895 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; |
@@ -899,7 +899,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
899 | break; | 899 | break; |
900 | 900 | ||
901 | case TYPE_S3C2412: | 901 | case TYPE_S3C2412: |
902 | chip->IO_ADDR_W = regs + S3C2440_NFDATA; | 902 | chip->legacy.IO_ADDR_W = regs + S3C2440_NFDATA; |
903 | info->sel_reg = regs + S3C2440_NFCONT; | 903 | info->sel_reg = regs + S3C2440_NFCONT; |
904 | info->sel_bit = S3C2412_NFCONT_nFCE0; | 904 | info->sel_bit = S3C2412_NFCONT_nFCE0; |
905 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; | 905 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; |
@@ -911,7 +911,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
911 | break; | 911 | break; |
912 | } | 912 | } |
913 | 913 | ||
914 | chip->IO_ADDR_R = chip->IO_ADDR_W; | 914 | chip->legacy.IO_ADDR_R = chip->legacy.IO_ADDR_W; |
915 | 915 | ||
916 | nmtd->info = info; | 916 | nmtd->info = info; |
917 | nmtd->set = set; | 917 | nmtd->set = set; |
diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c index 31abbe33798e..d9cdd11fbd3a 100644 --- a/drivers/mtd/nand/raw/sharpsl.c +++ b/drivers/mtd/nand/raw/sharpsl.c | |||
@@ -75,7 +75,7 @@ static void sharpsl_nand_hwcontrol(struct nand_chip *chip, int cmd, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | if (cmd != NAND_CMD_NONE) | 77 | if (cmd != NAND_CMD_NONE) |
78 | writeb(cmd, chip->IO_ADDR_W); | 78 | writeb(cmd, chip->legacy.IO_ADDR_W); |
79 | } | 79 | } |
80 | 80 | ||
81 | static int sharpsl_nand_dev_ready(struct nand_chip *chip) | 81 | static int sharpsl_nand_dev_ready(struct nand_chip *chip) |
@@ -153,8 +153,8 @@ static int sharpsl_nand_probe(struct platform_device *pdev) | |||
153 | writeb(readb(sharpsl->io + FLASHCTL) | FLWP, sharpsl->io + FLASHCTL); | 153 | writeb(readb(sharpsl->io + FLASHCTL) | FLWP, sharpsl->io + FLASHCTL); |
154 | 154 | ||
155 | /* Set address of NAND IO lines */ | 155 | /* Set address of NAND IO lines */ |
156 | this->IO_ADDR_R = sharpsl->io + FLASHIO; | 156 | this->legacy.IO_ADDR_R = sharpsl->io + FLASHIO; |
157 | this->IO_ADDR_W = sharpsl->io + FLASHIO; | 157 | this->legacy.IO_ADDR_W = sharpsl->io + FLASHIO; |
158 | /* Set address of hardware control function */ | 158 | /* Set address of hardware control function */ |
159 | this->cmd_ctrl = sharpsl_nand_hwcontrol; | 159 | this->cmd_ctrl = sharpsl_nand_hwcontrol; |
160 | this->dev_ready = sharpsl_nand_dev_ready; | 160 | this->dev_ready = sharpsl_nand_dev_ready; |
diff --git a/drivers/mtd/nand/raw/tmio_nand.c b/drivers/mtd/nand/raw/tmio_nand.c index f44621672779..0b23587bf47c 100644 --- a/drivers/mtd/nand/raw/tmio_nand.c +++ b/drivers/mtd/nand/raw/tmio_nand.c | |||
@@ -155,7 +155,7 @@ static void tmio_nand_hwcontrol(struct nand_chip *chip, int cmd, | |||
155 | } | 155 | } |
156 | 156 | ||
157 | if (cmd != NAND_CMD_NONE) | 157 | if (cmd != NAND_CMD_NONE) |
158 | tmio_iowrite8(cmd, chip->IO_ADDR_W); | 158 | tmio_iowrite8(cmd, chip->legacy.IO_ADDR_W); |
159 | } | 159 | } |
160 | 160 | ||
161 | static int tmio_nand_dev_ready(struct nand_chip *chip) | 161 | static int tmio_nand_dev_ready(struct nand_chip *chip) |
@@ -399,8 +399,8 @@ static int tmio_probe(struct platform_device *dev) | |||
399 | return retval; | 399 | return retval; |
400 | 400 | ||
401 | /* Set address of NAND IO lines */ | 401 | /* Set address of NAND IO lines */ |
402 | nand_chip->IO_ADDR_R = tmio->fcr; | 402 | nand_chip->legacy.IO_ADDR_R = tmio->fcr; |
403 | nand_chip->IO_ADDR_W = tmio->fcr; | 403 | nand_chip->legacy.IO_ADDR_W = tmio->fcr; |
404 | 404 | ||
405 | /* Set address of hardware control function */ | 405 | /* Set address of hardware control function */ |
406 | nand_chip->cmd_ctrl = tmio_nand_hwcontrol; | 406 | nand_chip->cmd_ctrl = tmio_nand_hwcontrol; |
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index e3a96ee7e531..6b1dc8fef89d 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h | |||
@@ -1173,12 +1173,26 @@ int nand_op_parser_exec_op(struct nand_chip *chip, | |||
1173 | const struct nand_operation *op, bool check_only); | 1173 | const struct nand_operation *op, bool check_only); |
1174 | 1174 | ||
1175 | /** | 1175 | /** |
1176 | * struct nand_legacy - NAND chip legacy fields/hooks | ||
1177 | * @IO_ADDR_R: address to read the 8 I/O lines of the flash device | ||
1178 | * @IO_ADDR_W: address to write the 8 I/O lines of the flash device | ||
1179 | * | ||
1180 | * If you look at this structure you're already wrong. These fields/hooks are | ||
1181 | * all deprecated. | ||
1182 | */ | ||
1183 | struct nand_legacy { | ||
1184 | void __iomem *IO_ADDR_R; | ||
1185 | void __iomem *IO_ADDR_W; | ||
1186 | }; | ||
1187 | |||
1188 | /** | ||
1176 | * struct nand_chip - NAND Private Flash Chip Data | 1189 | * struct nand_chip - NAND Private Flash Chip Data |
1177 | * @mtd: MTD device registered to the MTD framework | 1190 | * @mtd: MTD device registered to the MTD framework |
1178 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the | 1191 | * @legacy: All legacy fields/hooks. If you develop a new driver, |
1179 | * flash device | 1192 | * don't even try to use any of these fields/hooks, and if |
1180 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the | 1193 | * you're modifying an existing driver that is using those |
1181 | * flash device. | 1194 | * fields/hooks, you should consider reworking the driver |
1195 | * avoid using them. | ||
1182 | * @read_byte: [REPLACEABLE] read one byte from the chip | 1196 | * @read_byte: [REPLACEABLE] read one byte from the chip |
1183 | * @write_byte: [REPLACEABLE] write a single byte to the chip on the | 1197 | * @write_byte: [REPLACEABLE] write a single byte to the chip on the |
1184 | * low 8 I/O lines | 1198 | * low 8 I/O lines |
@@ -1280,8 +1294,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip, | |||
1280 | 1294 | ||
1281 | struct nand_chip { | 1295 | struct nand_chip { |
1282 | struct mtd_info mtd; | 1296 | struct mtd_info mtd; |
1283 | void __iomem *IO_ADDR_R; | 1297 | |
1284 | void __iomem *IO_ADDR_W; | 1298 | struct nand_legacy legacy; |
1285 | 1299 | ||
1286 | uint8_t (*read_byte)(struct nand_chip *chip); | 1300 | uint8_t (*read_byte)(struct nand_chip *chip); |
1287 | void (*write_byte)(struct nand_chip *chip, uint8_t byte); | 1301 | void (*write_byte)(struct nand_chip *chip, uint8_t byte); |