13 #include <linux/slab.h>
14 #include <linux/module.h>
23 #include <asm/sizes.h>
26 static void orion_nand_cmd_ctrl(
struct mtd_info *mtd,
int cmd,
unsigned int ctrl)
36 offs = (1 << board->
cle);
38 offs = (1 << board->
ale);
55 while (len && (
unsigned long)buf & 7) {
56 *buf++ =
readb(io_base);
68 asm volatile (
"ldrd\t%0, [%1]" :
"=&r" (
x) :
"r" (io_base));
73 buf[i++] =
readb(io_base);
90 printk(
KERN_ERR "orion_nand: failed to allocate device structure.\n");
109 if (pdev->
dev.of_node) {
113 printk(
KERN_ERR "orion_nand: failed to allocate board structure.\n");
117 if (!of_property_read_u32(pdev->
dev.of_node,
"cle", &val))
118 board->
cle = (
u8)val;
121 if (!of_property_read_u32(pdev->
dev.of_node,
"ale", &val))
125 if (!of_property_read_u32(pdev->
dev.of_node,
130 if (!of_property_read_u32(pdev->
dev.of_node,
134 board = pdev->
dev.platform_data;
149 "%d bit bus width out of range",
152 if (board->
width == 16)
158 platform_set_drvdata(pdev, mtd);
164 clk_prepare_enable(clk);
173 mtd->
name =
"orion_nand";
186 clk_disable_unprepare(clk);
189 platform_set_drvdata(pdev,
NULL);
199 struct mtd_info *mtd = platform_get_drvdata(pdev);
211 clk_disable_unprepare(clk);
219 static struct of_device_id orion_nand_of_match_table[] = {
228 .name =
"orion_nand",
230 .of_match_table =
of_match_ptr(orion_nand_of_match_table),
234 static int __init orion_nand_init(
void)
239 static void __exit orion_nand_exit(
void)