16 #include <linux/slab.h>
17 #include <linux/module.h>
28 #include <mach/hardware.h>
38 #define mtd_to_sharpsl(_mtd) container_of(_mtd, struct sharpsl_nand, mtd)
50 #define FLRYBY (1 << 5)
51 #define FLCE1 (1 << 4)
53 #define FLALE (1 << 2)
54 #define FLCLE (1 << 1)
55 #define FLCE0 (1 << 0)
65 static void sharpsl_nand_hwcontrol(
struct mtd_info *mtd,
int cmd,
72 unsigned char bits = ctrl & 0x07;
74 bits |= (ctrl & 0x01) << 4;
85 static int sharpsl_nand_dev_ready(
struct mtd_info *mtd)
102 ecc_code[2] = (~
readb(sharpsl->
io +
ECCCP) << 2) | 0x03;
125 printk(
"Unable to allocate SharpSL NAND MTD device structure.\n");
131 dev_err(&pdev->
dev,
"no io memory resource defined!\n");
139 printk(
"ioremap to access Sharp SL NAND chip failed\n");
148 sharpsl->
mtd.priv =
this;
151 platform_set_drvdata(pdev, sharpsl);
162 this->
cmd_ctrl = sharpsl_nand_hwcontrol;
163 this->
dev_ready = sharpsl_nand_dev_ready;
168 this->
ecc.size = 256;
170 this->
ecc.strength = 1;
173 this->
ecc.hwctl = sharpsl_nand_enable_hwecc;
174 this->
ecc.calculate = sharpsl_nand_calculate_ecc;
183 sharpsl->
mtd.name =
"sharpsl-nand";
197 platform_set_drvdata(pdev,
NULL);
210 struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev);
215 platform_set_drvdata(pdev,
NULL);
227 .name =
"sharpsl-nand",
230 .probe = sharpsl_nand_probe,