diff options
-rw-r--r-- | drivers/mtd/nand/Kconfig | 5 | ||||
-rw-r--r-- | drivers/mtd/nand/sm_common.c | 40 |
2 files changed, 38 insertions, 7 deletions
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 5010344f4bb2..c89aaab15712 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -18,10 +18,6 @@ config MTD_NAND_VERIFY_WRITE | |||
18 | device thinks the write was successful, a bit could have been | 18 | device thinks the write was successful, a bit could have been |
19 | flipped accidentally due to device wear or something else. | 19 | flipped accidentally due to device wear or something else. |
20 | 20 | ||
21 | config MTD_NAND_SMARTMEDIA | ||
22 | boolean | ||
23 | default n | ||
24 | |||
25 | config MTD_NAND_ECC_SMC | 21 | config MTD_NAND_ECC_SMC |
26 | bool "NAND ECC Smart Media byte order" | 22 | bool "NAND ECC Smart Media byte order" |
27 | default n | 23 | default n |
@@ -30,7 +26,6 @@ config MTD_NAND_ECC_SMC | |||
30 | The original Linux implementation had byte 0 and 1 swapped. | 26 | The original Linux implementation had byte 0 and 1 swapped. |
31 | 27 | ||
32 | config MTD_SM_COMMON | 28 | config MTD_SM_COMMON |
33 | select MTD_NAND_SMARTMEDIA | ||
34 | tristate | 29 | tristate |
35 | default n | 30 | default n |
36 | 31 | ||
diff --git a/drivers/mtd/nand/sm_common.c b/drivers/mtd/nand/sm_common.c index f52bb3949275..aae0b9acd7ae 100644 --- a/drivers/mtd/nand/sm_common.c +++ b/drivers/mtd/nand/sm_common.c | |||
@@ -67,15 +67,51 @@ static int sm_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
70 | static struct nand_flash_dev nand_smartmedia_flash_ids[] = { | ||
71 | |||
72 | /* SmartMedia */ | ||
73 | {"SmartMedia 1MiB 5V", 0x6e, 256, 1, 0x1000, 0}, | ||
74 | {"SmartMedia 1MiB 3,3V", 0xe8, 256, 1, 0x1000, 0}, | ||
75 | {"SmartMedia 1MiB 3,3V", 0xec, 256, 1, 0x1000, 0}, | ||
76 | {"SmartMedia 2MiB 3,3V", 0xea, 256, 2, 0x1000, 0}, | ||
77 | {"SmartMedia 2MiB 5V", 0x64, 256, 2, 0x1000, 0}, | ||
78 | {"SmartMedia 2MiB 3,3V ROM", 0x5d, 512, 2, 0x2000, NAND_ROM}, | ||
79 | {"SmartMedia 4MiB 3,3V", 0xe3, 512, 4, 0x2000, 0}, | ||
80 | {"SmartMedia 4MiB 3,3/5V", 0xe5, 512, 4, 0x2000, 0}, | ||
81 | {"SmartMedia 4MiB 5V", 0x6b, 512, 4, 0x2000, 0}, | ||
82 | {"SmartMedia 4MiB 3,3V ROM", 0xd5, 512, 4, 0x2000, NAND_ROM}, | ||
83 | {"SmartMedia 8MiB 3,3V", 0xe6, 512, 8, 0x2000, 0}, | ||
84 | {"SmartMedia 8MiB 3,3V ROM", 0xd6, 512, 8, 0x2000, NAND_ROM}, | ||
85 | |||
86 | #define XD_TYPEM (NAND_NO_AUTOINCR | NAND_BROKEN_XD) | ||
87 | /* xD / SmartMedia */ | ||
88 | {"SmartMedia/xD 16MiB 3,3V", 0x73, 512, 16, 0x4000, 0}, | ||
89 | {"SmartMedia 16MiB 3,3V ROM", 0x57, 512, 16, 0x4000, NAND_ROM}, | ||
90 | {"SmartMedia/xD 32MiB 3,3V", 0x75, 512, 32, 0x4000, 0}, | ||
91 | {"SmartMedia 32MiB 3,3V ROM", 0x58, 512, 32, 0x4000, NAND_ROM}, | ||
92 | {"SmartMedia/xD 64MiB 3,3V", 0x76, 512, 64, 0x4000, 0}, | ||
93 | {"SmartMedia 64MiB 3,3V ROM", 0xd9, 512, 64, 0x4000, NAND_ROM}, | ||
94 | {"SmartMedia/xD 128MiB 3,3V", 0x79, 512, 128, 0x4000, 0}, | ||
95 | {"SmartMedia 128MiB 3,3V ROM", 0xda, 512, 128, 0x4000, NAND_ROM}, | ||
96 | {"SmartMedia/xD 256MiB 3,3V", 0x71, 512, 256, 0x4000, XD_TYPEM}, | ||
97 | {"SmartMedia 256MiB 3,3V ROM", 0x5b, 512, 256, 0x4000, NAND_ROM}, | ||
98 | |||
99 | /* xD only */ | ||
100 | {"xD 512MiB 3,3V", 0xDC, 512, 512, 0x4000, XD_TYPEM}, | ||
101 | {"xD 1GiB 3,3V", 0xD3, 512, 1024, 0x4000, XD_TYPEM}, | ||
102 | {"xD 2GiB 3,3V", 0xD5, 512, 2048, 0x4000, XD_TYPEM}, | ||
103 | {NULL,} | ||
104 | }; | ||
105 | |||
70 | int sm_register_device(struct mtd_info *mtd) | 106 | int sm_register_device(struct mtd_info *mtd) |
71 | { | 107 | { |
72 | struct nand_chip *chip = (struct nand_chip *)mtd->priv; | 108 | struct nand_chip *chip = (struct nand_chip *)mtd->priv; |
73 | int ret; | 109 | int ret; |
74 | 110 | ||
75 | chip->options |= NAND_SKIP_BBTSCAN | NAND_SMARTMEDIA; | 111 | chip->options |= NAND_SKIP_BBTSCAN; |
76 | 112 | ||
77 | /* Scan for card properties */ | 113 | /* Scan for card properties */ |
78 | ret = nand_scan_ident(mtd, 1, NULL); | 114 | ret = nand_scan_ident(mtd, 1, nand_smartmedia_flash_ids); |
79 | 115 | ||
80 | if (ret) | 116 | if (ret) |
81 | return ret; | 117 | return ret; |