.. | .. |
---|
16 | 16 | #include <linux/platform_device.h> |
---|
17 | 17 | #include <linux/mv643xx_eth.h> |
---|
18 | 18 | #include <linux/ata_platform.h> |
---|
19 | | -#include <linux/mtd/rawnand.h> |
---|
20 | | -#include <linux/mtd/partitions.h> |
---|
| 19 | +#include <linux/mtd/platnand.h> |
---|
21 | 20 | #include <linux/timeriomem-rng.h> |
---|
22 | 21 | #include <asm/mach-types.h> |
---|
23 | 22 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
131 | 130 | * NAND_CLE: bit 1 -> bit 1 |
---|
132 | 131 | * NAND_ALE: bit 2 -> bit 0 |
---|
133 | 132 | */ |
---|
134 | | -static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, |
---|
135 | | - unsigned int ctrl) |
---|
| 133 | +static void ts78xx_ts_nand_cmd_ctrl(struct nand_chip *this, int cmd, |
---|
| 134 | + unsigned int ctrl) |
---|
136 | 135 | { |
---|
137 | | - struct nand_chip *this = mtd_to_nand(mtd); |
---|
138 | | - |
---|
139 | 136 | if (ctrl & NAND_CTRL_CHANGE) { |
---|
140 | 137 | unsigned char bits; |
---|
141 | 138 | |
---|
.. | .. |
---|
147 | 144 | } |
---|
148 | 145 | |
---|
149 | 146 | if (cmd != NAND_CMD_NONE) |
---|
150 | | - writeb(cmd, this->IO_ADDR_W); |
---|
| 147 | + writeb(cmd, this->legacy.IO_ADDR_W); |
---|
151 | 148 | } |
---|
152 | 149 | |
---|
153 | | -static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd) |
---|
| 150 | +static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip) |
---|
154 | 151 | { |
---|
155 | 152 | return readb(TS_NAND_CTRL) & 0x20; |
---|
156 | 153 | } |
---|
157 | 154 | |
---|
158 | | -static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd, |
---|
159 | | - const uint8_t *buf, int len) |
---|
| 155 | +static void ts78xx_ts_nand_write_buf(struct nand_chip *chip, |
---|
| 156 | + const uint8_t *buf, int len) |
---|
160 | 157 | { |
---|
161 | | - struct nand_chip *chip = mtd_to_nand(mtd); |
---|
162 | | - void __iomem *io_base = chip->IO_ADDR_W; |
---|
| 158 | + void __iomem *io_base = chip->legacy.IO_ADDR_W; |
---|
163 | 159 | unsigned long off = ((unsigned long)buf & 3); |
---|
164 | 160 | int sz; |
---|
165 | 161 | |
---|
.. | .. |
---|
182 | 178 | writesb(io_base, buf, len); |
---|
183 | 179 | } |
---|
184 | 180 | |
---|
185 | | -static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd, |
---|
186 | | - uint8_t *buf, int len) |
---|
| 181 | +static void ts78xx_ts_nand_read_buf(struct nand_chip *chip, |
---|
| 182 | + uint8_t *buf, int len) |
---|
187 | 183 | { |
---|
188 | | - struct nand_chip *chip = mtd_to_nand(mtd); |
---|
189 | | - void __iomem *io_base = chip->IO_ADDR_R; |
---|
| 184 | + void __iomem *io_base = chip->legacy.IO_ADDR_R; |
---|
190 | 185 | unsigned long off = ((unsigned long)buf & 3); |
---|
191 | 186 | int sz; |
---|
192 | 187 | |
---|
.. | .. |
---|
403 | 398 | |
---|
404 | 399 | static int ts78xx_fpga_unload_devices(void) |
---|
405 | 400 | { |
---|
406 | | - int ret = 0; |
---|
407 | 401 | |
---|
408 | 402 | if (ts78xx_fpga.supports.ts_rtc.present == 1) |
---|
409 | 403 | ts78xx_ts_rtc_unload(); |
---|
.. | .. |
---|
412 | 406 | if (ts78xx_fpga.supports.ts_rng.present == 1) |
---|
413 | 407 | ts78xx_ts_rng_unload(); |
---|
414 | 408 | |
---|
415 | | - return ret; |
---|
| 409 | + return 0; |
---|
416 | 410 | } |
---|
417 | 411 | |
---|
418 | 412 | static int ts78xx_fpga_load(void) |
---|