19 #include <linux/slab.h>
21 #include <linux/module.h>
30 #include <asm/sizes.h>
34 #include <mach/hardware.h>
52 { .name =
"u-boot params",
55 { .name =
"Amstrad LDR",
58 { .name =
"File system",
61 { .name =
"PBL reserved",
63 .size = 3 * SZ_256K },
99 ams_delta_write_byte(mtd, buf[i]);
102 static void ams_delta_read_buf(
struct mtd_info *mtd,
u_char *buf,
int len)
106 for (i=0; i<len; i++)
107 buf[i] = ams_delta_read_byte(mtd);
118 static void ams_delta_hwcontrol(
struct mtd_info *mtd,
int cmd,
132 ams_delta_write_byte(mtd, cmd);
135 static int ams_delta_nand_ready(
struct mtd_info *mtd)
140 static const struct gpio _mandatory_gpio[] = {
142 .gpio = AMS_DELTA_GPIO_PIN_NAND_NCE,
147 .gpio = AMS_DELTA_GPIO_PIN_NAND_NRE,
152 .gpio = AMS_DELTA_GPIO_PIN_NAND_NWP,
157 .gpio = AMS_DELTA_GPIO_PIN_NAND_NWE,
162 .gpio = AMS_DELTA_GPIO_PIN_NAND_ALE,
167 .gpio = AMS_DELTA_GPIO_PIN_NAND_CLE,
189 if (!ams_delta_mtd) {
198 this = (
struct nand_chip *) (&ams_delta_mtd[1]);
205 ams_delta_mtd->
priv =
this;
214 if (io_base ==
NULL) {
227 this->
read_buf = ams_delta_read_buf;
228 this->
cmd_ctrl = ams_delta_hwcontrol;
229 if (
gpio_request(AMS_DELTA_GPIO_PIN_NAND_RB,
"nand_rdy") == 0) {
239 platform_set_drvdata(pdev, io_base);
261 platform_set_drvdata(pdev,
NULL);
265 kfree(ams_delta_mtd);
275 void __iomem *io_base = platform_get_drvdata(pdev);
285 kfree(ams_delta_mtd);
291 .probe = ams_delta_init,
294 .name =
"ams-delta-nand",