aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-08-10 06:34:18 -0400
committerArnd Bergmann <arnd@arndb.de>2012-08-13 11:09:38 -0400
commite05dd97c5c345bd1f6ce9f6fc242326a64191239 (patch)
treea3d700746bc2b5f809876bd7aa8c7c0ac93166ac
parent19e4ab54e7f5fe46a3c931afa7e786f11d57b558 (diff)
parent4cf3326ab5f34a333a46c59d0d3783db9cef13bf (diff)
Merge tag 'at91-for-next-soc' of git://github.com/at91linux/linux-at91 into at91/mci
AT91 SoC related code modifications: a cleanup in defconfigs and a one liner in a board file. The most important is the move to atmel-mci driver in AT91 SoC & boards. The old at91_mci (marked as deprecated) will be removed in 3.7. So all platform data for this old driver are erased and replace by information needed by atmel-mci driver. * tag 'at91-for-next-soc' of git://github.com/at91linux/linux-at91: ARM: at91: add atmel-mci support for chips and boards which can use it ARM: at91/defconfig: change the MCI driver to use in defconfigs ARM: at91: set i2c_board_info.type to "ds1339" directly ARM: at91/defconfig: Remove unaffected config option Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/configs/afeb9260_defconfig1
-rw-r--r--arch/arm/configs/at91rm9200_defconfig2
-rw-r--r--arch/arm/configs/at91sam9261_defconfig2
-rw-r--r--arch/arm/configs/at91sam9263_defconfig3
-rw-r--r--arch/arm/configs/at91sam9g20_defconfig2
-rw-r--r--arch/arm/configs/at91sam9rl_defconfig2
-rw-r--r--arch/arm/configs/cpu9260_defconfig2
-rw-r--r--arch/arm/configs/cpu9g20_defconfig2
-rw-r--r--arch/arm/configs/qil-a9260_defconfig3
-rw-r--r--arch/arm/configs/stamp9g20_defconfig1
-rw-r--r--arch/arm/configs/usb-a9260_defconfig1
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c92
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c84
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c60
-rw-r--r--arch/arm/mach-at91/at91sam9263.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c161
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c60
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c14
-rw-r--r--arch/arm/mach-at91/board-carmeva.c14
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c17
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c13
-rw-r--r--arch/arm/mach-at91/board-csb337.c14
-rw-r--r--arch/arm/mach-at91/board-eb9200.c14
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c14
-rw-r--r--arch/arm/mach-at91/board-eco920.c14
-rw-r--r--arch/arm/mach-at91/board-flexibity.c14
-rw-r--r--arch/arm/mach-at91/board-foxg20.c16
-rw-r--r--arch/arm/mach-at91/board-kb9202.c14
-rw-r--r--arch/arm/mach-at91/board-neocore926.c13
-rw-r--r--arch/arm/mach-at91/board-picotux200.c14
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c14
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c14
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c14
-rw-r--r--arch/arm/mach-at91/board-rsi-ews.c13
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c16
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c13
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c14
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c2
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c13
-rw-r--r--drivers/mtd/nand/Kconfig40
44 files changed, 384 insertions, 494 deletions
diff --git a/arch/arm/configs/afeb9260_defconfig b/arch/arm/configs/afeb9260_defconfig
index 2afdf67c212..c285a9d777d 100644
--- a/arch/arm/configs/afeb9260_defconfig
+++ b/arch/arm/configs/afeb9260_defconfig
@@ -39,7 +39,6 @@ CONFIG_MTD_BLOCK=y
39CONFIG_MTD_DATAFLASH=y 39CONFIG_MTD_DATAFLASH=y
40CONFIG_MTD_NAND=y 40CONFIG_MTD_NAND=y
41CONFIG_MTD_NAND_ATMEL=y 41CONFIG_MTD_NAND_ATMEL=y
42CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
43CONFIG_BLK_DEV_RAM=y 42CONFIG_BLK_DEV_RAM=y
44CONFIG_BLK_DEV_RAM_SIZE=8192 43CONFIG_BLK_DEV_RAM_SIZE=8192
45CONFIG_ATMEL_SSC=y 44CONFIG_ATMEL_SSC=y
diff --git a/arch/arm/configs/at91rm9200_defconfig b/arch/arm/configs/at91rm9200_defconfig
index d54e2acd3ab..4ae57a34a58 100644
--- a/arch/arm/configs/at91rm9200_defconfig
+++ b/arch/arm/configs/at91rm9200_defconfig
@@ -232,7 +232,7 @@ CONFIG_USB_GADGET=y
232CONFIG_USB_ETH=m 232CONFIG_USB_ETH=m
233CONFIG_USB_MASS_STORAGE=m 233CONFIG_USB_MASS_STORAGE=m
234CONFIG_MMC=y 234CONFIG_MMC=y
235CONFIG_MMC_AT91=y 235CONFIG_MMC_ATMELMCI=y
236CONFIG_NEW_LEDS=y 236CONFIG_NEW_LEDS=y
237CONFIG_LEDS_CLASS=y 237CONFIG_LEDS_CLASS=y
238CONFIG_LEDS_GPIO=y 238CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9261_defconfig b/arch/arm/configs/at91sam9261_defconfig
index ade6b2f2311..1e8712ef062 100644
--- a/arch/arm/configs/at91sam9261_defconfig
+++ b/arch/arm/configs/at91sam9261_defconfig
@@ -128,7 +128,7 @@ CONFIG_USB_GADGETFS=m
128CONFIG_USB_FILE_STORAGE=m 128CONFIG_USB_FILE_STORAGE=m
129CONFIG_USB_G_SERIAL=m 129CONFIG_USB_G_SERIAL=m
130CONFIG_MMC=y 130CONFIG_MMC=y
131CONFIG_MMC_AT91=m 131CONFIG_MMC_ATMELMCI=m
132CONFIG_NEW_LEDS=y 132CONFIG_NEW_LEDS=y
133CONFIG_LEDS_CLASS=y 133CONFIG_LEDS_CLASS=y
134CONFIG_LEDS_GPIO=y 134CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9263_defconfig b/arch/arm/configs/at91sam9263_defconfig
index 1cf96264cba..d2050cada82 100644
--- a/arch/arm/configs/at91sam9263_defconfig
+++ b/arch/arm/configs/at91sam9263_defconfig
@@ -61,7 +61,6 @@ CONFIG_MTD_DATAFLASH=y
61CONFIG_MTD_BLOCK2MTD=y 61CONFIG_MTD_BLOCK2MTD=y
62CONFIG_MTD_NAND=y 62CONFIG_MTD_NAND=y
63CONFIG_MTD_NAND_ATMEL=y 63CONFIG_MTD_NAND_ATMEL=y
64CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
65CONFIG_MTD_UBI=y 64CONFIG_MTD_UBI=y
66CONFIG_MTD_UBI_GLUEBI=y 65CONFIG_MTD_UBI_GLUEBI=y
67CONFIG_BLK_DEV_LOOP=y 66CONFIG_BLK_DEV_LOOP=y
@@ -138,7 +137,7 @@ CONFIG_USB_FILE_STORAGE=m
138CONFIG_USB_G_SERIAL=m 137CONFIG_USB_G_SERIAL=m
139CONFIG_MMC=y 138CONFIG_MMC=y
140CONFIG_SDIO_UART=m 139CONFIG_SDIO_UART=m
141CONFIG_MMC_AT91=m 140CONFIG_MMC_ATMELMCI=m
142CONFIG_NEW_LEDS=y 141CONFIG_NEW_LEDS=y
143CONFIG_LEDS_CLASS=y 142CONFIG_LEDS_CLASS=y
144CONFIG_LEDS_ATMEL_PWM=y 143CONFIG_LEDS_ATMEL_PWM=y
diff --git a/arch/arm/configs/at91sam9g20_defconfig b/arch/arm/configs/at91sam9g20_defconfig
index 994d331b231..e1b0e80b54a 100644
--- a/arch/arm/configs/at91sam9g20_defconfig
+++ b/arch/arm/configs/at91sam9g20_defconfig
@@ -99,7 +99,7 @@ CONFIG_USB_GADGETFS=m
99CONFIG_USB_FILE_STORAGE=m 99CONFIG_USB_FILE_STORAGE=m
100CONFIG_USB_G_SERIAL=m 100CONFIG_USB_G_SERIAL=m
101CONFIG_MMC=y 101CONFIG_MMC=y
102CONFIG_MMC_AT91=m 102CONFIG_MMC_ATMELMCI=m
103CONFIG_NEW_LEDS=y 103CONFIG_NEW_LEDS=y
104CONFIG_LEDS_CLASS=y 104CONFIG_LEDS_CLASS=y
105CONFIG_LEDS_GPIO=y 105CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/at91sam9rl_defconfig b/arch/arm/configs/at91sam9rl_defconfig
index ad562ee6420..7cf87856d63 100644
--- a/arch/arm/configs/at91sam9rl_defconfig
+++ b/arch/arm/configs/at91sam9rl_defconfig
@@ -60,7 +60,7 @@ CONFIG_AT91SAM9X_WATCHDOG=y
60CONFIG_FB=y 60CONFIG_FB=y
61CONFIG_FB_ATMEL=y 61CONFIG_FB_ATMEL=y
62CONFIG_MMC=y 62CONFIG_MMC=y
63CONFIG_MMC_AT91=m 63CONFIG_MMC_ATMELMCI=m
64CONFIG_RTC_CLASS=y 64CONFIG_RTC_CLASS=y
65CONFIG_RTC_DRV_AT91SAM9=y 65CONFIG_RTC_DRV_AT91SAM9=y
66CONFIG_EXT2_FS=y 66CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/cpu9260_defconfig b/arch/arm/configs/cpu9260_defconfig
index bbf729e2fb6..921480c23b9 100644
--- a/arch/arm/configs/cpu9260_defconfig
+++ b/arch/arm/configs/cpu9260_defconfig
@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
82CONFIG_USB_GADGET=y 82CONFIG_USB_GADGET=y
83CONFIG_USB_ETH=m 83CONFIG_USB_ETH=m
84CONFIG_MMC=y 84CONFIG_MMC=y
85CONFIG_MMC_AT91=m 85CONFIG_MMC_ATMELMCI=m
86CONFIG_NEW_LEDS=y 86CONFIG_NEW_LEDS=y
87CONFIG_LEDS_CLASS=y 87CONFIG_LEDS_CLASS=y
88CONFIG_LEDS_GPIO=y 88CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/cpu9g20_defconfig b/arch/arm/configs/cpu9g20_defconfig
index e7d7942927f..ea116cbdffa 100644
--- a/arch/arm/configs/cpu9g20_defconfig
+++ b/arch/arm/configs/cpu9g20_defconfig
@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
82CONFIG_USB_GADGET=y 82CONFIG_USB_GADGET=y
83CONFIG_USB_ETH=m 83CONFIG_USB_ETH=m
84CONFIG_MMC=y 84CONFIG_MMC=y
85CONFIG_MMC_AT91=m 85CONFIG_MMC_ATMELMCI=m
86CONFIG_NEW_LEDS=y 86CONFIG_NEW_LEDS=y
87CONFIG_LEDS_CLASS=y 87CONFIG_LEDS_CLASS=y
88CONFIG_LEDS_GPIO=y 88CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/qil-a9260_defconfig b/arch/arm/configs/qil-a9260_defconfig
index 9160f3b7751..42d5db1876a 100644
--- a/arch/arm/configs/qil-a9260_defconfig
+++ b/arch/arm/configs/qil-a9260_defconfig
@@ -50,7 +50,6 @@ CONFIG_MTD_BLOCK=y
50CONFIG_MTD_DATAFLASH=y 50CONFIG_MTD_DATAFLASH=y
51CONFIG_MTD_NAND=y 51CONFIG_MTD_NAND=y
52CONFIG_MTD_NAND_ATMEL=y 52CONFIG_MTD_NAND_ATMEL=y
53CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
54CONFIG_BLK_DEV_LOOP=y 53CONFIG_BLK_DEV_LOOP=y
55# CONFIG_MISC_DEVICES is not set 54# CONFIG_MISC_DEVICES is not set
56CONFIG_SCSI=y 55CONFIG_SCSI=y
@@ -87,7 +86,7 @@ CONFIG_USB_STORAGE=y
87CONFIG_USB_GADGET=y 86CONFIG_USB_GADGET=y
88CONFIG_USB_ETH=m 87CONFIG_USB_ETH=m
89CONFIG_MMC=y 88CONFIG_MMC=y
90CONFIG_MMC_AT91=m 89CONFIG_MMC_ATMELMCI=m
91CONFIG_NEW_LEDS=y 90CONFIG_NEW_LEDS=y
92CONFIG_LEDS_CLASS=y 91CONFIG_LEDS_CLASS=y
93CONFIG_LEDS_GPIO=y 92CONFIG_LEDS_GPIO=y
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig
index d5e260b8b16..52f1488591c 100644
--- a/arch/arm/configs/stamp9g20_defconfig
+++ b/arch/arm/configs/stamp9g20_defconfig
@@ -100,7 +100,6 @@ CONFIG_USB_ETH=m
100CONFIG_USB_FILE_STORAGE=m 100CONFIG_USB_FILE_STORAGE=m
101CONFIG_USB_G_SERIAL=m 101CONFIG_USB_G_SERIAL=m
102CONFIG_MMC=y 102CONFIG_MMC=y
103# CONFIG_MMC_AT91 is not set
104CONFIG_MMC_ATMELMCI=y 103CONFIG_MMC_ATMELMCI=y
105CONFIG_NEW_LEDS=y 104CONFIG_NEW_LEDS=y
106CONFIG_LEDS_CLASS=y 105CONFIG_LEDS_CLASS=y
diff --git a/arch/arm/configs/usb-a9260_defconfig b/arch/arm/configs/usb-a9260_defconfig
index 2e39f38b962..a1501e1e1a9 100644
--- a/arch/arm/configs/usb-a9260_defconfig
+++ b/arch/arm/configs/usb-a9260_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_BLOCK=y
49CONFIG_MTD_DATAFLASH=y 49CONFIG_MTD_DATAFLASH=y
50CONFIG_MTD_NAND=y 50CONFIG_MTD_NAND=y
51CONFIG_MTD_NAND_ATMEL=y 51CONFIG_MTD_NAND_ATMEL=y
52CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
53CONFIG_BLK_DEV_LOOP=y 52CONFIG_BLK_DEV_LOOP=y
54# CONFIG_MISC_DEVICES is not set 53# CONFIG_MISC_DEVICES is not set
55CONFIG_SCSI=y 54CONFIG_SCSI=y
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 01fb7325fec..9ac427a702d 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
294 * MMC / SD 294 * MMC / SD
295 * -------------------------------------------------------------------- */ 295 * -------------------------------------------------------------------- */
296 296
297#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 297#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 298static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct at91_mmc_data mmc_data; 299static struct mci_platform_data mmc_data;
300 300
301static struct resource mmc_resources[] = { 301static struct resource mmc_resources[] = {
302 [0] = { 302 [0] = {
@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
312}; 312};
313 313
314static struct platform_device at91rm9200_mmc_device = { 314static struct platform_device at91rm9200_mmc_device = {
315 .name = "at91_mci", 315 .name = "atmel_mci",
316 .id = -1, 316 .id = -1,
317 .dev = { 317 .dev = {
318 .dma_mask = &mmc_dmamask, 318 .dma_mask = &mmc_dmamask,
@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
323 .num_resources = ARRAY_SIZE(mmc_resources), 323 .num_resources = ARRAY_SIZE(mmc_resources),
324}; 324};
325 325
326void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 326void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
327{ 327{
328 unsigned int i;
329 unsigned int slot_count = 0;
330
328 if (!data) 331 if (!data)
329 return; 332 return;
330 333
331 /* input/irq */ 334 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
332 if (gpio_is_valid(data->det_pin)) {
333 at91_set_gpio_input(data->det_pin, 1);
334 at91_set_deglitch(data->det_pin, 1);
335 }
336 if (gpio_is_valid(data->wp_pin))
337 at91_set_gpio_input(data->wp_pin, 1);
338 if (gpio_is_valid(data->vcc_pin))
339 at91_set_gpio_output(data->vcc_pin, 0);
340
341 /* CLK */
342 at91_set_A_periph(AT91_PIN_PA27, 0);
343 335
344 if (data->slot_b) { 336 if (!data->slot[i].bus_width)
345 /* CMD */ 337 continue;
346 at91_set_B_periph(AT91_PIN_PA8, 1);
347 338
348 /* DAT0, maybe DAT1..DAT3 */ 339 /* input/irq */
349 at91_set_B_periph(AT91_PIN_PA9, 1); 340 if (gpio_is_valid(data->slot[i].detect_pin)) {
350 if (data->wire4) { 341 at91_set_gpio_input(data->slot[i].detect_pin, 1);
351 at91_set_B_periph(AT91_PIN_PA10, 1); 342 at91_set_deglitch(data->slot[i].detect_pin, 1);
352 at91_set_B_periph(AT91_PIN_PA11, 1);
353 at91_set_B_periph(AT91_PIN_PA12, 1);
354 } 343 }
355 } else { 344 if (gpio_is_valid(data->slot[i].wp_pin))
356 /* CMD */ 345 at91_set_gpio_input(data->slot[i].wp_pin, 1);
357 at91_set_A_periph(AT91_PIN_PA28, 1); 346
358 347 switch (i) {
359 /* DAT0, maybe DAT1..DAT3 */ 348 case 0: /* slot A */
360 at91_set_A_periph(AT91_PIN_PA29, 1); 349 /* CMD */
361 if (data->wire4) { 350 at91_set_A_periph(AT91_PIN_PA28, 1);
362 at91_set_B_periph(AT91_PIN_PB3, 1); 351 /* DAT0, maybe DAT1..DAT3 */
363 at91_set_B_periph(AT91_PIN_PB4, 1); 352 at91_set_A_periph(AT91_PIN_PA29, 1);
364 at91_set_B_periph(AT91_PIN_PB5, 1); 353 if (data->slot[i].bus_width == 4) {
354 at91_set_B_periph(AT91_PIN_PB3, 1);
355 at91_set_B_periph(AT91_PIN_PB4, 1);
356 at91_set_B_periph(AT91_PIN_PB5, 1);
357 }
358 slot_count++;
359 break;
360 case 1: /* slot B */
361 /* CMD */
362 at91_set_B_periph(AT91_PIN_PA8, 1);
363 /* DAT0, maybe DAT1..DAT3 */
364 at91_set_B_periph(AT91_PIN_PA9, 1);
365 if (data->slot[i].bus_width == 4) {
366 at91_set_B_periph(AT91_PIN_PA10, 1);
367 at91_set_B_periph(AT91_PIN_PA11, 1);
368 at91_set_B_periph(AT91_PIN_PA12, 1);
369 }
370 slot_count++;
371 break;
372 default:
373 printk(KERN_ERR
374 "AT91: SD/MMC slot %d not available\n", i);
375 break;
376 }
377 if (slot_count) {
378 /* CLK */
379 at91_set_A_periph(AT91_PIN_PA27, 0);
380
381 mmc_data = *data;
382 platform_device_register(&at91rm9200_mmc_device);
365 } 383 }
366 } 384 }
367 385
368 mmc_data = *data;
369 platform_device_register(&at91rm9200_mmc_device);
370} 386}
371#else 387#else
372void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 388void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
373#endif 389#endif
374 390
375 391
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 7b9c2ba396e..156e639257c 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -209,92 +209,10 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
209 209
210 210
211/* -------------------------------------------------------------------- 211/* --------------------------------------------------------------------
212 * MMC / SD
213 * -------------------------------------------------------------------- */
214
215#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
216static u64 mmc_dmamask = DMA_BIT_MASK(32);
217static struct at91_mmc_data mmc_data;
218
219static struct resource mmc_resources[] = {
220 [0] = {
221 .start = AT91SAM9260_BASE_MCI,
222 .end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 [1] = {
226 .start = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
227 .end = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct platform_device at91sam9260_mmc_device = {
233 .name = "at91_mci",
234 .id = -1,
235 .dev = {
236 .dma_mask = &mmc_dmamask,
237 .coherent_dma_mask = DMA_BIT_MASK(32),
238 .platform_data = &mmc_data,
239 },
240 .resource = mmc_resources,
241 .num_resources = ARRAY_SIZE(mmc_resources),
242};
243
244void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
245{
246 if (!data)
247 return;
248
249 /* input/irq */
250 if (gpio_is_valid(data->det_pin)) {
251 at91_set_gpio_input(data->det_pin, 1);
252 at91_set_deglitch(data->det_pin, 1);
253 }
254 if (gpio_is_valid(data->wp_pin))
255 at91_set_gpio_input(data->wp_pin, 1);
256 if (gpio_is_valid(data->vcc_pin))
257 at91_set_gpio_output(data->vcc_pin, 0);
258
259 /* CLK */
260 at91_set_A_periph(AT91_PIN_PA8, 0);
261
262 if (data->slot_b) {
263 /* CMD */
264 at91_set_B_periph(AT91_PIN_PA1, 1);
265
266 /* DAT0, maybe DAT1..DAT3 */
267 at91_set_B_periph(AT91_PIN_PA0, 1);
268 if (data->wire4) {
269 at91_set_B_periph(AT91_PIN_PA5, 1);
270 at91_set_B_periph(AT91_PIN_PA4, 1);
271 at91_set_B_periph(AT91_PIN_PA3, 1);
272 }
273 } else {
274 /* CMD */
275 at91_set_A_periph(AT91_PIN_PA7, 1);
276
277 /* DAT0, maybe DAT1..DAT3 */
278 at91_set_A_periph(AT91_PIN_PA6, 1);
279 if (data->wire4) {
280 at91_set_A_periph(AT91_PIN_PA9, 1);
281 at91_set_A_periph(AT91_PIN_PA10, 1);
282 at91_set_A_periph(AT91_PIN_PA11, 1);
283 }
284 }
285
286 mmc_data = *data;
287 platform_device_register(&at91sam9260_mmc_device);
288}
289#else
290void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
291#endif
292
293/* --------------------------------------------------------------------
294 * MMC / SD Slot for Atmel MCI Driver 212 * MMC / SD Slot for Atmel MCI Driver
295 * -------------------------------------------------------------------- */ 213 * -------------------------------------------------------------------- */
296 214
297#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) 215#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 216static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct mci_platform_data mmc_data; 217static struct mci_platform_data mmc_data;
300 218
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 8df5c1bdff9..06c0c6e025b 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
137 * MMC / SD 137 * MMC / SD
138 * -------------------------------------------------------------------- */ 138 * -------------------------------------------------------------------- */
139 139
140#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 140#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
141static u64 mmc_dmamask = DMA_BIT_MASK(32); 141static u64 mmc_dmamask = DMA_BIT_MASK(32);
142static struct at91_mmc_data mmc_data; 142static struct mci_platform_data mmc_data;
143 143
144static struct resource mmc_resources[] = { 144static struct resource mmc_resources[] = {
145 [0] = { 145 [0] = {
@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
155}; 155};
156 156
157static struct platform_device at91sam9261_mmc_device = { 157static struct platform_device at91sam9261_mmc_device = {
158 .name = "at91_mci", 158 .name = "atmel_mci",
159 .id = -1, 159 .id = -1,
160 .dev = { 160 .dev = {
161 .dma_mask = &mmc_dmamask, 161 .dma_mask = &mmc_dmamask,
@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = {
166 .num_resources = ARRAY_SIZE(mmc_resources), 166 .num_resources = ARRAY_SIZE(mmc_resources),
167}; 167};
168 168
169void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 169void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
170{ 170{
171 if (!data) 171 if (!data)
172 return; 172 return;
173 173
174 /* input/irq */ 174 if (data->slot[0].bus_width) {
175 if (gpio_is_valid(data->det_pin)) { 175 /* input/irq */
176 at91_set_gpio_input(data->det_pin, 1); 176 if (gpio_is_valid(data->slot[0].detect_pin)) {
177 at91_set_deglitch(data->det_pin, 1); 177 at91_set_gpio_input(data->slot[0].detect_pin, 1);
178 } 178 at91_set_deglitch(data->slot[0].detect_pin, 1);
179 if (gpio_is_valid(data->wp_pin)) 179 }
180 at91_set_gpio_input(data->wp_pin, 1); 180 if (gpio_is_valid(data->slot[0].wp_pin))
181 if (gpio_is_valid(data->vcc_pin)) 181 at91_set_gpio_input(data->slot[0].wp_pin, 1);
182 at91_set_gpio_output(data->vcc_pin, 0); 182
183 183 /* CLK */
184 /* CLK */ 184 at91_set_B_periph(AT91_PIN_PA2, 0);
185 at91_set_B_periph(AT91_PIN_PA2, 0);
186
187 /* CMD */
188 at91_set_B_periph(AT91_PIN_PA1, 1);
189
190 /* DAT0, maybe DAT1..DAT3 */
191 at91_set_B_periph(AT91_PIN_PA0, 1);
192 if (data->wire4) {
193 at91_set_B_periph(AT91_PIN_PA4, 1);
194 at91_set_B_periph(AT91_PIN_PA5, 1);
195 at91_set_B_periph(AT91_PIN_PA6, 1);
196 }
197 185
198 mmc_data = *data; 186 /* CMD */
199 platform_device_register(&at91sam9261_mmc_device); 187 at91_set_B_periph(AT91_PIN_PA1, 1);
188
189 /* DAT0, maybe DAT1..DAT3 */
190 at91_set_B_periph(AT91_PIN_PA0, 1);
191 if (data->slot[0].bus_width == 4) {
192 at91_set_B_periph(AT91_PIN_PA4, 1);
193 at91_set_B_periph(AT91_PIN_PA5, 1);
194 at91_set_B_periph(AT91_PIN_PA6, 1);
195 }
196
197 mmc_data = *data;
198 platform_device_register(&at91sam9261_mmc_device);
199 }
200} 200}
201#else 201#else
202void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 202void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
203#endif 203#endif
204 204
205 205
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 84b38105231..144ef5de51b 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -188,8 +188,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
188 CLKDEV_CON_ID("hclk", &macb_clk), 188 CLKDEV_CON_ID("hclk", &macb_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
191 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), 191 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
192 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), 192 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), 193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), 195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index eb6bbf86fb9..1e176aaaaec 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
218 * MMC / SD 218 * MMC / SD
219 * -------------------------------------------------------------------- */ 219 * -------------------------------------------------------------------- */
220 220
221#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 221#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
222static u64 mmc_dmamask = DMA_BIT_MASK(32); 222static u64 mmc_dmamask = DMA_BIT_MASK(32);
223static struct at91_mmc_data mmc0_data, mmc1_data; 223static struct mci_platform_data mmc0_data, mmc1_data;
224 224
225static struct resource mmc0_resources[] = { 225static struct resource mmc0_resources[] = {
226 [0] = { 226 [0] = {
@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
236}; 236};
237 237
238static struct platform_device at91sam9263_mmc0_device = { 238static struct platform_device at91sam9263_mmc0_device = {
239 .name = "at91_mci", 239 .name = "atmel_mci",
240 .id = 0, 240 .id = 0,
241 .dev = { 241 .dev = {
242 .dma_mask = &mmc_dmamask, 242 .dma_mask = &mmc_dmamask,
@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
261}; 261};
262 262
263static struct platform_device at91sam9263_mmc1_device = { 263static struct platform_device at91sam9263_mmc1_device = {
264 .name = "at91_mci", 264 .name = "atmel_mci",
265 .id = 1, 265 .id = 1,
266 .dev = { 266 .dev = {
267 .dma_mask = &mmc_dmamask, 267 .dma_mask = &mmc_dmamask,
@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
272 .num_resources = ARRAY_SIZE(mmc1_resources), 272 .num_resources = ARRAY_SIZE(mmc1_resources),
273}; 273};
274 274
275void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 275void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
276{ 276{
277 unsigned int i;
278 unsigned int slot_count = 0;
279
277 if (!data) 280 if (!data)
278 return; 281 return;
279 282
280 /* input/irq */ 283 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
281 if (gpio_is_valid(data->det_pin)) {
282 at91_set_gpio_input(data->det_pin, 1);
283 at91_set_deglitch(data->det_pin, 1);
284 }
285 if (gpio_is_valid(data->wp_pin))
286 at91_set_gpio_input(data->wp_pin, 1);
287 if (gpio_is_valid(data->vcc_pin))
288 at91_set_gpio_output(data->vcc_pin, 0);
289 284
290 if (mmc_id == 0) { /* MCI0 */ 285 if (!data->slot[i].bus_width)
291 /* CLK */ 286 continue;
292 at91_set_A_periph(AT91_PIN_PA12, 0);
293 287
294 if (data->slot_b) { 288 /* input/irq */
295 /* CMD */ 289 if (gpio_is_valid(data->slot[i].detect_pin)) {
296 at91_set_A_periph(AT91_PIN_PA16, 1); 290 at91_set_gpio_input(data->slot[i].detect_pin,
291 1);
292 at91_set_deglitch(data->slot[i].detect_pin,
293 1);
294 }
295 if (gpio_is_valid(data->slot[i].wp_pin))
296 at91_set_gpio_input(data->slot[i].wp_pin, 1);
297
298 if (mmc_id == 0) { /* MCI0 */
299 switch (i) {
300 case 0: /* slot A */
301 /* CMD */
302 at91_set_A_periph(AT91_PIN_PA1, 1);
303 /* DAT0, maybe DAT1..DAT3 */
304 at91_set_A_periph(AT91_PIN_PA0, 1);
305 if (data->slot[i].bus_width == 4) {
306 at91_set_A_periph(AT91_PIN_PA3, 1);
307 at91_set_A_periph(AT91_PIN_PA4, 1);
308 at91_set_A_periph(AT91_PIN_PA5, 1);
309 }
310 slot_count++;
311 break;
312 case 1: /* slot B */
313 /* CMD */
314 at91_set_A_periph(AT91_PIN_PA16, 1);
315 /* DAT0, maybe DAT1..DAT3 */
316 at91_set_A_periph(AT91_PIN_PA17, 1);
317 if (data->slot[i].bus_width == 4) {
318 at91_set_A_periph(AT91_PIN_PA18, 1);
319 at91_set_A_periph(AT91_PIN_PA19, 1);
320 at91_set_A_periph(AT91_PIN_PA20, 1);
321 }
322 slot_count++;
323 break;
324 default:
325 printk(KERN_ERR
326 "AT91: SD/MMC slot %d not available\n", i);
327 break;
328 }
329 if (slot_count) {
330 /* CLK */
331 at91_set_A_periph(AT91_PIN_PA12, 0);
297 332
298 /* DAT0, maybe DAT1..DAT3 */ 333 mmc0_data = *data;
299 at91_set_A_periph(AT91_PIN_PA17, 1); 334 platform_device_register(&at91sam9263_mmc0_device);
300 if (data->wire4) {
301 at91_set_A_periph(AT91_PIN_PA18, 1);
302 at91_set_A_periph(AT91_PIN_PA19, 1);
303 at91_set_A_periph(AT91_PIN_PA20, 1);
304 } 335 }
305 } else { 336 } else if (mmc_id == 1) { /* MCI1 */
306 /* CMD */ 337 switch (i) {
307 at91_set_A_periph(AT91_PIN_PA1, 1); 338 case 0: /* slot A */
308 339 /* CMD */
309 /* DAT0, maybe DAT1..DAT3 */ 340 at91_set_A_periph(AT91_PIN_PA7, 1);
310 at91_set_A_periph(AT91_PIN_PA0, 1); 341 /* DAT0, maybe DAT1..DAT3 */
311 if (data->wire4) { 342 at91_set_A_periph(AT91_PIN_PA8, 1);
312 at91_set_A_periph(AT91_PIN_PA3, 1); 343 if (data->slot[i].bus_width == 4) {
313 at91_set_A_periph(AT91_PIN_PA4, 1); 344 at91_set_A_periph(AT91_PIN_PA9, 1);
314 at91_set_A_periph(AT91_PIN_PA5, 1); 345 at91_set_A_periph(AT91_PIN_PA10, 1);
346 at91_set_A_periph(AT91_PIN_PA11, 1);
347 }
348 slot_count++;
349 break;
350 case 1: /* slot B */
351 /* CMD */
352 at91_set_A_periph(AT91_PIN_PA21, 1);
353 /* DAT0, maybe DAT1..DAT3 */
354 at91_set_A_periph(AT91_PIN_PA22, 1);
355 if (data->slot[i].bus_width == 4) {
356 at91_set_A_periph(AT91_PIN_PA23, 1);
357 at91_set_A_periph(AT91_PIN_PA24, 1);
358 at91_set_A_periph(AT91_PIN_PA25, 1);
359 }
360 slot_count++;
361 break;
362 default:
363 printk(KERN_ERR
364 "AT91: SD/MMC slot %d not available\n", i);
365 break;
315 } 366 }
316 } 367 if (slot_count) {
368 /* CLK */
369 at91_set_A_periph(AT91_PIN_PA6, 0);
317 370
318 mmc0_data = *data; 371 mmc1_data = *data;
319 platform_device_register(&at91sam9263_mmc0_device); 372 platform_device_register(&at91sam9263_mmc1_device);
320 } else { /* MCI1 */
321 /* CLK */
322 at91_set_A_periph(AT91_PIN_PA6, 0);
323
324 if (data->slot_b) {
325 /* CMD */
326 at91_set_A_periph(AT91_PIN_PA21, 1);
327
328 /* DAT0, maybe DAT1..DAT3 */
329 at91_set_A_periph(AT91_PIN_PA22, 1);
330 if (data->wire4) {
331 at91_set_A_periph(AT91_PIN_PA23, 1);
332 at91_set_A_periph(AT91_PIN_PA24, 1);
333 at91_set_A_periph(AT91_PIN_PA25, 1);
334 }
335 } else {
336 /* CMD */
337 at91_set_A_periph(AT91_PIN_PA7, 1);
338
339 /* DAT0, maybe DAT1..DAT3 */
340 at91_set_A_periph(AT91_PIN_PA8, 1);
341 if (data->wire4) {
342 at91_set_A_periph(AT91_PIN_PA9, 1);
343 at91_set_A_periph(AT91_PIN_PA10, 1);
344 at91_set_A_periph(AT91_PIN_PA11, 1);
345 } 373 }
346 } 374 }
347
348 mmc1_data = *data;
349 platform_device_register(&at91sam9263_mmc1_device);
350 } 375 }
351} 376}
352#else 377#else
353void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 378void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
354#endif 379#endif
355 380
356/* -------------------------------------------------------------------- 381/* --------------------------------------------------------------------
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index f09fff93217..ea4479e7c3f 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
161 * MMC / SD 161 * MMC / SD
162 * -------------------------------------------------------------------- */ 162 * -------------------------------------------------------------------- */
163 163
164#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 164#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
165static u64 mmc_dmamask = DMA_BIT_MASK(32); 165static u64 mmc_dmamask = DMA_BIT_MASK(32);
166static struct at91_mmc_data mmc_data; 166static struct mci_platform_data mmc_data;
167 167
168static struct resource mmc_resources[] = { 168static struct resource mmc_resources[] = {
169 [0] = { 169 [0] = {
@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
179}; 179};
180 180
181static struct platform_device at91sam9rl_mmc_device = { 181static struct platform_device at91sam9rl_mmc_device = {
182 .name = "at91_mci", 182 .name = "atmel_mci",
183 .id = -1, 183 .id = -1,
184 .dev = { 184 .dev = {
185 .dma_mask = &mmc_dmamask, 185 .dma_mask = &mmc_dmamask,
@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = {
190 .num_resources = ARRAY_SIZE(mmc_resources), 190 .num_resources = ARRAY_SIZE(mmc_resources),
191}; 191};
192 192
193void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 193void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
194{ 194{
195 if (!data) 195 if (!data)
196 return; 196 return;
197 197
198 /* input/irq */ 198 if (data->slot[0].bus_width) {
199 if (gpio_is_valid(data->det_pin)) { 199 /* input/irq */
200 at91_set_gpio_input(data->det_pin, 1); 200 if (gpio_is_valid(data->slot[0].detect_pin)) {
201 at91_set_deglitch(data->det_pin, 1); 201 at91_set_gpio_input(data->slot[0].detect_pin, 1);
202 } 202 at91_set_deglitch(data->slot[0].detect_pin, 1);
203 if (gpio_is_valid(data->wp_pin)) 203 }
204 at91_set_gpio_input(data->wp_pin, 1); 204 if (gpio_is_valid(data->slot[0].wp_pin))
205 if (gpio_is_valid(data->vcc_pin)) 205 at91_set_gpio_input(data->slot[0].wp_pin, 1);
206 at91_set_gpio_output(data->vcc_pin, 0); 206
207 207 /* CLK */
208 /* CLK */ 208 at91_set_A_periph(AT91_PIN_PA2, 0);
209 at91_set_A_periph(AT91_PIN_PA2, 0); 209
210 210 /* CMD */
211 /* CMD */ 211 at91_set_A_periph(AT91_PIN_PA1, 1);
212 at91_set_A_periph(AT91_PIN_PA1, 1); 212
213 213 /* DAT0, maybe DAT1..DAT3 */
214 /* DAT0, maybe DAT1..DAT3 */ 214 at91_set_A_periph(AT91_PIN_PA0, 1);
215 at91_set_A_periph(AT91_PIN_PA0, 1); 215 if (data->slot[0].bus_width == 4) {
216 if (data->wire4) { 216 at91_set_A_periph(AT91_PIN_PA3, 1);
217 at91_set_A_periph(AT91_PIN_PA3, 1); 217 at91_set_A_periph(AT91_PIN_PA4, 1);
218 at91_set_A_periph(AT91_PIN_PA4, 1); 218 at91_set_A_periph(AT91_PIN_PA5, 1);
219 at91_set_A_periph(AT91_PIN_PA5, 1); 219 }
220
221 mmc_data = *data;
222 platform_device_register(&at91sam9rl_mmc_device);
220 } 223 }
221
222 mmc_data = *data;
223 platform_device_register(&at91sam9rl_mmc_device);
224} 224}
225#else 225#else
226void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 226void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
227#endif 227#endif
228 228
229 229
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index de7be193181..93a832f7023 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -133,12 +133,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
133/* 133/*
134 * MCI (SD/MMC) 134 * MCI (SD/MMC)
135 */ 135 */
136static struct at91_mmc_data __initdata afeb9260_mmc_data = { 136static struct mci_platform_data __initdata afeb9260_mci0_data = {
137 .det_pin = AT91_PIN_PC9, 137 .slot[1] = {
138 .wp_pin = AT91_PIN_PC4, 138 .bus_width = 4,
139 .slot_b = 1, 139 .detect_pin = AT91_PIN_PC9,
140 .wire4 = 1, 140 .wp_pin = AT91_PIN_PC4,
141 .vcc_pin = -EINVAL, 141 },
142}; 142};
143 143
144 144
@@ -199,7 +199,7 @@ static void __init afeb9260_board_init(void)
199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */ 199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */ 200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
201 /* MMC */ 201 /* MMC */
202 at91_add_device_mmc(0, &afeb9260_mmc_data); 202 at91_add_device_mci(0, &afeb9260_mci0_data);
203 /* I2C */ 203 /* I2C */
204 at91_add_device_i2c(afeb9260_i2c_devices, 204 at91_add_device_i2c(afeb9260_i2c_devices,
205 ARRAY_SIZE(afeb9260_i2c_devices)); 205 ARRAY_SIZE(afeb9260_i2c_devices));
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index a5b002f32a6..71d8f362a1d 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -71,12 +71,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
71 // .vcc_pin = -EINVAL, 71 // .vcc_pin = -EINVAL,
72// }; 72// };
73 73
74static struct at91_mmc_data __initdata carmeva_mmc_data = { 74static struct mci_platform_data __initdata carmeva_mci0_data = {
75 .slot_b = 0, 75 .slot[0] = {
76 .wire4 = 1, 76 .bus_width = 4,
77 .det_pin = AT91_PIN_PB10, 77 .detect_pin = AT91_PIN_PB10,
78 .wp_pin = AT91_PIN_PC14, 78 .wp_pin = AT91_PIN_PC14,
79 .vcc_pin = -EINVAL, 79 },
80}; 80};
81 81
82static struct spi_board_info carmeva_spi_devices[] = { 82static struct spi_board_info carmeva_spi_devices[] = {
@@ -150,7 +150,7 @@ static void __init carmeva_board_init(void)
150 /* Compact Flash */ 150 /* Compact Flash */
151// at91_add_device_cf(&carmeva_cf_data); 151// at91_add_device_cf(&carmeva_cf_data);
152 /* MMC */ 152 /* MMC */
153 at91_add_device_mmc(0, &carmeva_mmc_data); 153 at91_add_device_mci(0, &carmeva_mci0_data);
154 /* LEDs */ 154 /* LEDs */
155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds)); 155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
156} 156}
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index ecbc13b594d..e71c473316e 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -254,8 +254,7 @@ static struct gpio_led cpu9krea_leds[] = {
254 254
255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = { 255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = {
256 { 256 {
257 I2C_BOARD_INFO("rtc-ds1307", 0x68), 257 I2C_BOARD_INFO("ds1339", 0x68),
258 .type = "ds1339",
259 }, 258 },
260}; 259};
261 260
@@ -312,12 +311,12 @@ static void __init cpu9krea_add_device_buttons(void)
312/* 311/*
313 * MCI (SD/MMC) 312 * MCI (SD/MMC)
314 */ 313 */
315static struct at91_mmc_data __initdata cpu9krea_mmc_data = { 314static struct mci_platform_data __initdata cpu9krea_mci0_data = {
316 .slot_b = 0, 315 .slot[0] = {
317 .wire4 = 1, 316 .bus_width = 4,
318 .det_pin = AT91_PIN_PA29, 317 .detect_pin = AT91_PIN_PA29,
319 .wp_pin = -EINVAL, 318 .wp_pin = -EINVAL,
320 .vcc_pin = -EINVAL, 319 },
321}; 320};
322 321
323static void __init cpu9krea_board_init(void) 322static void __init cpu9krea_board_init(void)
@@ -359,7 +358,7 @@ static void __init cpu9krea_board_init(void)
359 /* Ethernet */ 358 /* Ethernet */
360 at91_add_device_eth(&cpu9krea_macb_data); 359 at91_add_device_eth(&cpu9krea_macb_data);
361 /* MMC */ 360 /* MMC */
362 at91_add_device_mmc(0, &cpu9krea_mmc_data); 361 at91_add_device_mci(0, &cpu9krea_mci0_data);
363 /* I2C */ 362 /* I2C */
364 at91_add_device_i2c(cpu9krea_i2c_devices, 363 at91_add_device_i2c(cpu9krea_i2c_devices,
365 ARRAY_SIZE(cpu9krea_i2c_devices)); 364 ARRAY_SIZE(cpu9krea_i2c_devices));
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 2e6d043c82f..2cbd1a2b6c3 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -78,11 +78,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
78 .pullup_pin = AT91_PIN_PC14, 78 .pullup_pin = AT91_PIN_PC14,
79}; 79};
80 80
81static struct at91_mmc_data __initdata cpuat91_mmc_data = { 81static struct mci_platform_data __initdata cpuat91_mci0_data = {
82 .det_pin = AT91_PIN_PC2, 82 .slot[0] = {
83 .wire4 = 1, 83 .bus_width = 4,
84 .wp_pin = -EINVAL, 84 .detect_pin = AT91_PIN_PC2,
85 .vcc_pin = -EINVAL, 85 .wp_pin = -EINVAL,
86 },
86}; 87};
87 88
88static struct physmap_flash_data cpuat91_flash_data = { 89static struct physmap_flash_data cpuat91_flash_data = {
@@ -168,7 +169,7 @@ static void __init cpuat91_board_init(void)
168 /* USB Device */ 169 /* USB Device */
169 at91_add_device_udc(&cpuat91_udc_data); 170 at91_add_device_udc(&cpuat91_udc_data);
170 /* MMC */ 171 /* MMC */
171 at91_add_device_mmc(0, &cpuat91_mmc_data); 172 at91_add_device_mci(0, &cpuat91_mci0_data);
172 /* I2C */ 173 /* I2C */
173 at91_add_device_i2c(NULL, 0); 174 at91_add_device_i2c(NULL, 0);
174 /* Platform devices */ 175 /* Platform devices */
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 32396bb4a4c..3e37437a7a6 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -87,12 +87,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
87 .rst_pin = AT91_PIN_PD2, 87 .rst_pin = AT91_PIN_PD2,
88}; 88};
89 89
90static struct at91_mmc_data __initdata csb337_mmc_data = { 90static struct mci_platform_data __initdata csb337_mci0_data = {
91 .det_pin = AT91_PIN_PD5, 91 .slot[0] = {
92 .slot_b = 0, 92 .bus_width = 4,
93 .wire4 = 1, 93 .detect_pin = AT91_PIN_PD5,
94 .wp_pin = AT91_PIN_PD6, 94 .wp_pin = AT91_PIN_PD6,
95 .vcc_pin = -EINVAL, 95 },
96}; 96};
97 97
98static struct spi_board_info csb337_spi_devices[] = { 98static struct spi_board_info csb337_spi_devices[] = {
@@ -238,7 +238,7 @@ static void __init csb337_board_init(void)
238 /* SPI */ 238 /* SPI */
239 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); 239 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
240 /* MMC */ 240 /* MMC */
241 at91_add_device_mmc(0, &csb337_mmc_data); 241 at91_add_device_mci(0, &csb337_mci0_data);
242 /* NOR flash */ 242 /* NOR flash */
243 platform_device_register(&csb_flash); 243 platform_device_register(&csb_flash);
244 /* LEDs */ 244 /* LEDs */
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index d1e1f3fc0a4..0cfac16ee9d 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -70,12 +70,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
70 .rst_pin = AT91_PIN_PC5, 70 .rst_pin = AT91_PIN_PC5,
71}; 71};
72 72
73static struct at91_mmc_data __initdata eb9200_mmc_data = { 73static struct mci_platform_data __initdata eb9200_mci0_data = {
74 .slot_b = 0, 74 .slot[0] = {
75 .wire4 = 1, 75 .bus_width = 4,
76 .det_pin = -EINVAL, 76 .detect_pin = -EINVAL,
77 .wp_pin = -EINVAL, 77 .wp_pin = -EINVAL,
78 .vcc_pin = -EINVAL, 78 },
79}; 79};
80 80
81static struct i2c_board_info __initdata eb9200_i2c_devices[] = { 81static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
@@ -113,7 +113,7 @@ static void __init eb9200_board_init(void)
113 at91_add_device_spi(NULL, 0); 113 at91_add_device_spi(NULL, 0);
114 /* MMC */ 114 /* MMC */
115 /* only supports 1 or 4 bit interface, not wired through to SPI */ 115 /* only supports 1 or 4 bit interface, not wired through to SPI */
116 at91_add_device_mmc(0, &eb9200_mmc_data); 116 at91_add_device_mci(0, &eb9200_mci0_data);
117} 117}
118 118
119MACHINE_START(ATEB9200, "Embest ATEB9200") 119MACHINE_START(ATEB9200, "Embest ATEB9200")
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index 192ec76579c..3d931ffac4b 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -64,12 +64,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
64 .overcurrent_pin= {-EINVAL, -EINVAL}, 64 .overcurrent_pin= {-EINVAL, -EINVAL},
65}; 65};
66 66
67static struct at91_mmc_data __initdata ecb_at91mmc_data = { 67static struct mci_platform_data __initdata ecbat91_mci0_data = {
68 .slot_b = 0, 68 .slot[0] = {
69 .wire4 = 1, 69 .bus_width = 4,
70 .det_pin = -EINVAL, 70 .detect_pin = -EINVAL,
71 .wp_pin = -EINVAL, 71 .wp_pin = -EINVAL,
72 .vcc_pin = -EINVAL, 72 },
73}; 73};
74 74
75 75
@@ -170,7 +170,7 @@ static void __init ecb_at91board_init(void)
170 at91_add_device_i2c(NULL, 0); 170 at91_add_device_i2c(NULL, 0);
171 171
172 /* MMC */ 172 /* MMC */
173 at91_add_device_mmc(0, &ecb_at91mmc_data); 173 at91_add_device_mci(0, &ecbat91_mci0_data);
174 174
175 /* SPI */ 175 /* SPI */
176 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); 176 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index d2d4580df48..d93658a2b12 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -56,12 +56,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
56 .pullup_pin = AT91_PIN_PB13, 56 .pullup_pin = AT91_PIN_PB13,
57}; 57};
58 58
59static struct at91_mmc_data __initdata eco920_mmc_data = { 59static struct mci_platform_data __initdata eco920_mci0_data = {
60 .slot_b = 0, 60 .slot[0] = {
61 .wire4 = 0, 61 .bus_width = 1,
62 .det_pin = -EINVAL, 62 .detect_pin = -EINVAL,
63 .wp_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 .vcc_pin = -EINVAL, 64 },
65}; 65};
66 66
67static struct physmap_flash_data eco920_flash_data = { 67static struct physmap_flash_data eco920_flash_data = {
@@ -120,7 +120,7 @@ static void __init eco920_board_init(void)
120 at91_add_device_usbh(&eco920_usbh_data); 120 at91_add_device_usbh(&eco920_usbh_data);
121 at91_add_device_udc(&eco920_udc_data); 121 at91_add_device_udc(&eco920_udc_data);
122 122
123 at91_add_device_mmc(0, &eco920_mmc_data); 123 at91_add_device_mci(0, &eco920_mci0_data);
124 platform_device_register(&eco920_flash); 124 platform_device_register(&eco920_flash);
125 125
126 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) 126 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index 6cc83a87d77..fa98abacb1b 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -75,12 +75,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
75}; 75};
76 76
77/* MCI (SD/MMC) */ 77/* MCI (SD/MMC) */
78static struct at91_mmc_data __initdata flexibity_mmc_data = { 78static struct mci_platform_data __initdata flexibity_mci0_data = {
79 .slot_b = 0, 79 .slot[0] = {
80 .wire4 = 1, 80 .bus_width = 4,
81 .det_pin = AT91_PIN_PC9, 81 .detect_pin = AT91_PIN_PC9,
82 .wp_pin = AT91_PIN_PC4, 82 .wp_pin = AT91_PIN_PC4,
83 .vcc_pin = -EINVAL, 83 },
84}; 84};
85 85
86/* LEDs */ 86/* LEDs */
@@ -152,7 +152,7 @@ static void __init flexibity_board_init(void)
152 at91_add_device_spi(flexibity_spi_devices, 152 at91_add_device_spi(flexibity_spi_devices,
153 ARRAY_SIZE(flexibity_spi_devices)); 153 ARRAY_SIZE(flexibity_spi_devices));
154 /* MMC */ 154 /* MMC */
155 at91_add_device_mmc(0, &flexibity_mmc_data); 155 at91_add_device_mci(0, &flexibity_mci0_data);
156 /* LEDs */ 156 /* LEDs */
157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); 157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
158} 158}
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index 69ab1247ef8..6e47071d820 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -86,7 +86,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
86 * SPI devices. 86 * SPI devices.
87 */ 87 */
88static struct spi_board_info foxg20_spi_devices[] = { 88static struct spi_board_info foxg20_spi_devices[] = {
89#if !defined(CONFIG_MMC_AT91) 89#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
90 { 90 {
91 .modalias = "mtd_dataflash", 91 .modalias = "mtd_dataflash",
92 .chip_select = 1, 92 .chip_select = 1,
@@ -109,12 +109,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
109 * MCI (SD/MMC) 109 * MCI (SD/MMC)
110 * det_pin, wp_pin and vcc_pin are not connected 110 * det_pin, wp_pin and vcc_pin are not connected
111 */ 111 */
112static struct at91_mmc_data __initdata foxg20_mmc_data = { 112static struct mci_platform_data __initdata foxg20_mci0_data = {
113 .slot_b = 1, 113 .slot[1] = {
114 .wire4 = 1, 114 .bus_width = 4,
115 .det_pin = -EINVAL, 115 .detect_pin = -EINVAL,
116 .wp_pin = -EINVAL, 116 .wp_pin = -EINVAL,
117 .vcc_pin = -EINVAL, 117 },
118}; 118};
119 119
120 120
@@ -247,7 +247,7 @@ static void __init foxg20_board_init(void)
247 /* Ethernet */ 247 /* Ethernet */
248 at91_add_device_eth(&foxg20_macb_data); 248 at91_add_device_eth(&foxg20_macb_data);
249 /* MMC */ 249 /* MMC */
250 at91_add_device_mmc(0, &foxg20_mmc_data); 250 at91_add_device_mci(0, &foxg20_mci0_data);
251 /* I2C */ 251 /* I2C */
252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); 252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
253 /* LEDs */ 253 /* LEDs */
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index 00d60071770..abe9fed7a3e 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
69 .pullup_pin = AT91_PIN_PB22, 69 .pullup_pin = AT91_PIN_PB22,
70}; 70};
71 71
72static struct at91_mmc_data __initdata kb9202_mmc_data = { 72static struct mci_platform_data __initdata kb9202_mci0_data = {
73 .det_pin = AT91_PIN_PB2, 73 .slot[0] = {
74 .slot_b = 0, 74 .bus_width = 4,
75 .wire4 = 1, 75 .detect_pin = AT91_PIN_PB2,
76 .wp_pin = -EINVAL, 76 .wp_pin = -EINVAL,
77 .vcc_pin = -EINVAL, 77 },
78}; 78};
79 79
80static struct mtd_partition __initdata kb9202_nand_partition[] = { 80static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -136,7 +136,7 @@ static void __init kb9202_board_init(void)
136 /* USB Device */ 136 /* USB Device */
137 at91_add_device_udc(&kb9202_udc_data); 137 at91_add_device_udc(&kb9202_udc_data);
138 /* MMC */ 138 /* MMC */
139 at91_add_device_mmc(0, &kb9202_mmc_data); 139 at91_add_device_mci(0, &kb9202_mci0_data);
140 /* I2C */ 140 /* I2C */
141 at91_add_device_i2c(NULL, 0); 141 at91_add_device_i2c(NULL, 0);
142 /* SPI */ 142 /* SPI */
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 18103c5d993..9cda3fd346a 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -138,11 +138,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
138/* 138/*
139 * MCI (SD/MMC) 139 * MCI (SD/MMC)
140 */ 140 */
141static struct at91_mmc_data __initdata neocore926_mmc_data = { 141static struct mci_platform_data __initdata neocore926_mci0_data = {
142 .wire4 = 1, 142 .slot[0] = {
143 .det_pin = AT91_PIN_PE18, 143 .bus_width = 4,
144 .wp_pin = AT91_PIN_PE19, 144 .detect_pin = AT91_PIN_PE18,
145 .vcc_pin = -EINVAL, 145 .wp_pin = AT91_PIN_PE19,
146 },
146}; 147};
147 148
148 149
@@ -354,7 +355,7 @@ static void __init neocore926_board_init(void)
354 neocore926_add_device_ts(); 355 neocore926_add_device_ts();
355 356
356 /* MMC */ 357 /* MMC */
357 at91_add_device_mmc(1, &neocore926_mmc_data); 358 at91_add_device_mci(0, &neocore926_mci0_data);
358 359
359 /* Ethernet */ 360 /* Ethernet */
360 at91_add_device_eth(&neocore926_macb_data); 361 at91_add_device_eth(&neocore926_macb_data);
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 12706550450..f83e1de699e 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -62,12 +62,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
62 .overcurrent_pin= {-EINVAL, -EINVAL}, 62 .overcurrent_pin= {-EINVAL, -EINVAL},
63}; 63};
64 64
65static struct at91_mmc_data __initdata picotux200_mmc_data = { 65static struct mci_platform_data __initdata picotux200_mci0_data = {
66 .det_pin = AT91_PIN_PB27, 66 .slot[0] = {
67 .slot_b = 0, 67 .bus_width = 4,
68 .wire4 = 1, 68 .detect_pin = AT91_PIN_PB27,
69 .wp_pin = AT91_PIN_PA17, 69 .wp_pin = AT91_PIN_PA17,
70 .vcc_pin = -EINVAL, 70 },
71}; 71};
72 72
73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
@@ -112,7 +112,7 @@ static void __init picotux200_board_init(void)
112 at91_add_device_i2c(NULL, 0); 112 at91_add_device_i2c(NULL, 0);
113 /* MMC */ 113 /* MMC */
114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
115 at91_add_device_mmc(0, &picotux200_mmc_data); 115 at91_add_device_mci(0, &picotux200_mci0_data);
116 /* NOR Flash */ 116 /* NOR Flash */
117 platform_device_register(&picotux200_flash); 117 platform_device_register(&picotux200_flash);
118} 118}
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index bf351e28542..799f214edeb 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -156,12 +156,12 @@ static void __init ek_add_device_nand(void)
156/* 156/*
157 * MCI (SD/MMC) 157 * MCI (SD/MMC)
158 */ 158 */
159static struct at91_mmc_data __initdata ek_mmc_data = { 159static struct mci_platform_data __initdata ek_mci0_data = {
160 .slot_b = 0, 160 .slot[0] = {
161 .wire4 = 1, 161 .bus_width = 4,
162 .det_pin = -EINVAL, 162 .detect_pin = -EINVAL,
163 .wp_pin = -EINVAL, 163 .wp_pin = -EINVAL,
164 .vcc_pin = -EINVAL, 164 },
165}; 165};
166 166
167/* 167/*
@@ -245,7 +245,7 @@ static void __init ek_board_init(void)
245 /* Ethernet */ 245 /* Ethernet */
246 at91_add_device_eth(&ek_macb_data); 246 at91_add_device_eth(&ek_macb_data);
247 /* MMC */ 247 /* MMC */
248 at91_add_device_mmc(0, &ek_mmc_data); 248 at91_add_device_mci(0, &ek_mci0_data);
249 /* Push Buttons */ 249 /* Push Buttons */
250 ek_add_device_buttons(); 250 ek_add_device_buttons();
251 /* LEDs */ 251 /* LEDs */
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index 2526ad759b5..66338e7ebfb 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -77,12 +77,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
77}; 77};
78 78
79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
80static struct at91_mmc_data __initdata dk_mmc_data = { 80static struct mci_platform_data __initdata dk_mci0_data = {
81 .slot_b = 0, 81 .slot[0] = {
82 .wire4 = 1, 82 .bus_width = 4,
83 .det_pin = -EINVAL, 83 .detect_pin = -EINVAL,
84 .wp_pin = -EINVAL, 84 .wp_pin = -EINVAL,
85 .vcc_pin = -EINVAL, 85 },
86}; 86};
87#endif 87#endif
88 88
@@ -205,7 +205,7 @@ static void __init dk_board_init(void)
205#else 205#else
206 /* MMC */ 206 /* MMC */
207 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 207 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
208 at91_add_device_mmc(0, &dk_mmc_data); 208 at91_add_device_mci(0, &dk_mci0_data);
209#endif 209#endif
210 /* NAND */ 210 /* NAND */
211 at91_add_device_nand(&dk_nand_data); 211 at91_add_device_nand(&dk_nand_data);
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 06f2ce543e2..5d1b5729dc6 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
70}; 70};
71 71
72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
73static struct at91_mmc_data __initdata ek_mmc_data = { 73static struct mci_platform_data __initdata ek_mci0_data = {
74 .det_pin = AT91_PIN_PB27, 74 .slot[0] = {
75 .slot_b = 0, 75 .bus_width = 4,
76 .wire4 = 1, 76 .detect_pin = AT91_PIN_PB27,
77 .wp_pin = AT91_PIN_PA17, 77 .wp_pin = AT91_PIN_PA17,
78 .vcc_pin = -EINVAL, 78 }
79}; 79};
80#endif 80#endif
81 81
@@ -174,7 +174,7 @@ static void __init ek_board_init(void)
174#else 174#else
175 /* MMC */ 175 /* MMC */
176 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 176 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
177 at91_add_device_mmc(0, &ek_mmc_data); 177 at91_add_device_mci(0, &ek_mci0_data);
178#endif 178#endif
179 /* NOR Flash */ 179 /* NOR Flash */
180 platform_device_register(&ek_flash); 180 platform_device_register(&ek_flash);
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c
index 93b8e3a45e2..a0ecf04e9ae 100644
--- a/arch/arm/mach-at91/board-rsi-ews.c
+++ b/arch/arm/mach-at91/board-rsi-ews.c
@@ -58,11 +58,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
58/* 58/*
59 * SD/MC 59 * SD/MC
60 */ 60 */
61static struct at91_mmc_data rsi_ews_mmc_data __initdata = { 61static struct mci_platform_data __initdata rsi_ews_mci0_data = {
62 .slot_b = 0, 62 .slot[0] = {
63 .wire4 = 1, 63 .bus_width = 4,
64 .det_pin = AT91_PIN_PB27, 64 .detect_pin = AT91_PIN_PB27,
65 .wp_pin = AT91_PIN_PB29, 65 .wp_pin = AT91_PIN_PB29,
66 },
66}; 67};
67 68
68/* 69/*
@@ -212,7 +213,7 @@ static void __init rsi_ews_board_init(void)
212 at91_add_device_spi(rsi_ews_spi_devices, 213 at91_add_device_spi(rsi_ews_spi_devices,
213 ARRAY_SIZE(rsi_ews_spi_devices)); 214 ARRAY_SIZE(rsi_ews_spi_devices));
214 /* MMC */ 215 /* MMC */
215 at91_add_device_mmc(0, &rsi_ews_mmc_data); 216 at91_add_device_mci(0, &rsi_ews_mci0_data);
216 /* NOR Flash */ 217 /* NOR Flash */
217 platform_device_register(&rsiews_nor_flash); 218 platform_device_register(&rsiews_nor_flash);
218 /* LEDs */ 219 /* LEDs */
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 46e1eb55053..c5f01acce3c 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -73,7 +73,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
73 * SPI devices. 73 * SPI devices.
74 */ 74 */
75static struct spi_board_info ek_spi_devices[] = { 75static struct spi_board_info ek_spi_devices[] = {
76#if !defined(CONFIG_MMC_AT91) 76#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
77 { /* DataFlash chip */ 77 { /* DataFlash chip */
78 .modalias = "mtd_dataflash", 78 .modalias = "mtd_dataflash",
79 .chip_select = 1, 79 .chip_select = 1,
@@ -158,12 +158,12 @@ static void __init ek_add_device_nand(void)
158/* 158/*
159 * MCI (SD/MMC) 159 * MCI (SD/MMC)
160 */ 160 */
161static struct at91_mmc_data __initdata ek_mmc_data = { 161static struct mci_platform_data __initdata ek_mci0_data = {
162 .slot_b = 1, 162 .slot[1] = {
163 .wire4 = 1, 163 .bus_width = 4,
164 .det_pin = AT91_PIN_PC8, 164 .detect_pin = AT91_PIN_PC8,
165 .wp_pin = AT91_PIN_PC4, 165 .wp_pin = AT91_PIN_PC4,
166 .vcc_pin = -EINVAL, 166 },
167}; 167};
168 168
169/* 169/*
@@ -209,7 +209,7 @@ static void __init ek_board_init(void)
209 /* Ethernet */ 209 /* Ethernet */
210 at91_add_device_eth(&ek_macb_data); 210 at91_add_device_eth(&ek_macb_data);
211 /* MMC */ 211 /* MMC */
212 at91_add_device_mmc(0, &ek_mmc_data); 212 at91_add_device_mci(0, &ek_mci0_data);
213 /* I2C */ 213 /* I2C */
214 at91_add_device_i2c(NULL, 0); 214 at91_add_device_i2c(NULL, 0);
215 /* LEDs */ 215 /* LEDs */
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 889c1bf71eb..8cd6e679fbe 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -108,7 +108,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
108 * SPI devices. 108 * SPI devices.
109 */ 109 */
110static struct spi_board_info ek_spi_devices[] = { 110static struct spi_board_info ek_spi_devices[] = {
111#if !defined(CONFIG_MMC_AT91) 111#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
112 { /* DataFlash chip */ 112 { /* DataFlash chip */
113 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
114 .chip_select = 1, 114 .chip_select = 1,
@@ -211,12 +211,12 @@ static void __init ek_add_device_nand(void)
211/* 211/*
212 * MCI (SD/MMC) 212 * MCI (SD/MMC)
213 */ 213 */
214static struct at91_mmc_data __initdata ek_mmc_data = { 214static struct mci_platform_data __initdata ek_mci0_data = {
215 .slot_b = 1, 215 .slot[1] = {
216 .wire4 = 1, 216 .bus_width = 4,
217 .det_pin = -EINVAL, 217 .detect_pin = -EINVAL,
218 .wp_pin = -EINVAL, 218 .wp_pin = -EINVAL,
219 .vcc_pin = -EINVAL, 219 },
220}; 220};
221 221
222 222
@@ -329,7 +329,7 @@ static void __init ek_board_init(void)
329 /* Ethernet */ 329 /* Ethernet */
330 at91_add_device_eth(&ek_macb_data); 330 at91_add_device_eth(&ek_macb_data);
331 /* MMC */ 331 /* MMC */
332 at91_add_device_mmc(0, &ek_mmc_data); 332 at91_add_device_mci(0, &ek_mci0_data);
333 /* I2C */ 333 /* I2C */
334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
335 /* SSC (to AT73C213) */ 335 /* SSC (to AT73C213) */
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 802d4946bb3..27b3af1a304 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -340,11 +340,12 @@ static struct spi_board_info ek_spi_devices[] = {
340 * MCI (SD/MMC) 340 * MCI (SD/MMC)
341 * det_pin, wp_pin and vcc_pin are not connected 341 * det_pin, wp_pin and vcc_pin are not connected
342 */ 342 */
343static struct at91_mmc_data __initdata ek_mmc_data = { 343static struct mci_platform_data __initdata mci0_data = {
344 .wire4 = 1, 344 .slot[0] = {
345 .det_pin = -EINVAL, 345 .bus_width = 4,
346 .wp_pin = -EINVAL, 346 .detect_pin = -EINVAL,
347 .vcc_pin = -EINVAL, 347 .wp_pin = -EINVAL,
348 },
348}; 349};
349 350
350#endif /* CONFIG_SPI_ATMEL_* */ 351#endif /* CONFIG_SPI_ATMEL_* */
@@ -595,7 +596,7 @@ static void __init ek_board_init(void)
595 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX); 596 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
596#else 597#else
597 /* MMC */ 598 /* MMC */
598 at91_add_device_mmc(0, &ek_mmc_data); 599 at91_add_device_mci(0, &mci0_data);
599#endif 600#endif
600 /* LCD Controller */ 601 /* LCD Controller */
601 at91_add_device_lcdc(&ek_lcdc_data); 602 at91_add_device_lcdc(&ek_lcdc_data);
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 82adf581afc..073e17403d9 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -141,11 +141,12 @@ static struct spi_board_info ek_spi_devices[] = {
141/* 141/*
142 * MCI (SD/MMC) 142 * MCI (SD/MMC)
143 */ 143 */
144static struct at91_mmc_data __initdata ek_mmc_data = { 144static struct mci_platform_data __initdata mci1_data = {
145 .wire4 = 1, 145 .slot[0] = {
146 .det_pin = AT91_PIN_PE18, 146 .bus_width = 4,
147 .wp_pin = AT91_PIN_PE19, 147 .detect_pin = AT91_PIN_PE18,
148 .vcc_pin = -EINVAL, 148 .wp_pin = AT91_PIN_PE19,
149 },
149}; 150};
150 151
151 152
@@ -420,7 +421,7 @@ static void __init ek_board_init(void)
420 /* Touchscreen */ 421 /* Touchscreen */
421 ek_add_device_ts(); 422 ek_add_device_ts();
422 /* MMC */ 423 /* MMC */
423 at91_add_device_mmc(1, &ek_mmc_data); 424 at91_add_device_mci(1, &mci1_data);
424 /* Ethernet */ 425 /* Ethernet */
425 at91_add_device_eth(&ek_macb_data); 426 at91_add_device_eth(&ek_macb_data);
426 /* NAND */ 427 /* NAND */
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 4ea4ee00364..3ab2b86a376 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -92,7 +92,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
92 * SPI devices. 92 * SPI devices.
93 */ 93 */
94static struct spi_board_info ek_spi_devices[] = { 94static struct spi_board_info ek_spi_devices[] = {
95#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) 95#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
96 { /* DataFlash chip */ 96 { /* DataFlash chip */
97 .modalias = "mtd_dataflash", 97 .modalias = "mtd_dataflash",
98 .chip_select = 1, 98 .chip_select = 1,
@@ -199,7 +199,6 @@ static void __init ek_add_device_nand(void)
199 * MCI (SD/MMC) 199 * MCI (SD/MMC)
200 * wp_pin and vcc_pin are not connected 200 * wp_pin and vcc_pin are not connected
201 */ 201 */
202#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
203static struct mci_platform_data __initdata ek_mmc_data = { 202static struct mci_platform_data __initdata ek_mmc_data = {
204 .slot[1] = { 203 .slot[1] = {
205 .bus_width = 4, 204 .bus_width = 4,
@@ -208,28 +207,15 @@ static struct mci_platform_data __initdata ek_mmc_data = {
208 }, 207 },
209 208
210}; 209};
211#else
212static struct at91_mmc_data __initdata ek_mmc_data = {
213 .slot_b = 1, /* Only one slot so use slot B */
214 .wire4 = 1,
215 .det_pin = AT91_PIN_PC9,
216 .wp_pin = -EINVAL,
217 .vcc_pin = -EINVAL,
218};
219#endif
220 210
221static void __init ek_add_device_mmc(void) 211static void __init ek_add_device_mmc(void)
222{ 212{
223#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
224 if (ek_have_2mmc()) { 213 if (ek_have_2mmc()) {
225 ek_mmc_data.slot[0].bus_width = 4; 214 ek_mmc_data.slot[0].bus_width = 4;
226 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; 215 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
227 ek_mmc_data.slot[0].wp_pin = -1; 216 ek_mmc_data.slot[0].wp_pin = -1;
228 } 217 }
229 at91_add_device_mci(0, &ek_mmc_data); 218 at91_add_device_mci(0, &ek_mmc_data);
230#else
231 at91_add_device_mmc(0, &ek_mmc_data);
232#endif
233} 219}
234 220
235/* 221/*
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index e7dc3ead704..fb89ea92e3f 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -56,11 +56,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
56/* 56/*
57 * MCI (SD/MMC) 57 * MCI (SD/MMC)
58 */ 58 */
59static struct at91_mmc_data __initdata ek_mmc_data = { 59static struct mci_platform_data __initdata mci0_data = {
60 .wire4 = 1, 60 .slot[0] = {
61 .det_pin = AT91_PIN_PA15, 61 .bus_width = 4,
62 .wp_pin = -EINVAL, 62 .detect_pin = AT91_PIN_PA15,
63 .vcc_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 },
64}; 65};
65 66
66 67
@@ -303,7 +304,7 @@ static void __init ek_board_init(void)
303 /* SPI */ 304 /* SPI */
304 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 305 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
305 /* MMC */ 306 /* MMC */
306 at91_add_device_mmc(0, &ek_mmc_data); 307 at91_add_device_mci(0, &mci0_data);
307 /* LCD Controller */ 308 /* LCD Controller */
308 at91_add_device_lcdc(&ek_lcdc_data); 309 at91_add_device_lcdc(&ek_lcdc_data);
309 /* AC97 */ 310 /* AC97 */
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 29eae1626bf..c3fb31d5116 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -83,7 +83,6 @@ static void __init add_device_nand(void)
83 * MCI (SD/MMC) 83 * MCI (SD/MMC)
84 * det_pin, wp_pin and vcc_pin are not connected 84 * det_pin, wp_pin and vcc_pin are not connected
85 */ 85 */
86#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
87static struct mci_platform_data __initdata mmc_data = { 86static struct mci_platform_data __initdata mmc_data = {
88 .slot[0] = { 87 .slot[0] = {
89 .bus_width = 4, 88 .bus_width = 4,
@@ -91,15 +90,6 @@ static struct mci_platform_data __initdata mmc_data = {
91 .wp_pin = -1, 90 .wp_pin = -1,
92 }, 91 },
93}; 92};
94#else
95static struct at91_mmc_data __initdata mmc_data = {
96 .slot_b = 0,
97 .wire4 = 1,
98 .det_pin = -EINVAL,
99 .wp_pin = -EINVAL,
100 .vcc_pin = -EINVAL,
101};
102#endif
103 93
104 94
105/* 95/*
@@ -223,11 +213,7 @@ void __init stamp9g20_board_init(void)
223 /* NAND */ 213 /* NAND */
224 add_device_nand(); 214 add_device_nand();
225 /* MMC */ 215 /* MMC */
226#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
227 at91_add_device_mci(0, &mmc_data); 216 at91_add_device_mci(0, &mmc_data);
228#else
229 at91_add_device_mmc(0, &mmc_data);
230#endif
231 /* W1 */ 217 /* W1 */
232 add_w1(); 218 add_w1();
233} 219}
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index c1476b9fe7b..6ea069b5733 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -109,14 +109,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
109 * SPI devices. 109 * SPI devices.
110 */ 110 */
111static struct spi_board_info usb_a9263_spi_devices[] = { 111static struct spi_board_info usb_a9263_spi_devices[] = {
112#if !defined(CONFIG_MMC_AT91)
113 { /* DataFlash chip */ 112 { /* DataFlash chip */
114 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
115 .chip_select = 0, 114 .chip_select = 0,
116 .max_speed_hz = 15 * 1000 * 1000, 115 .max_speed_hz = 15 * 1000 * 1000,
117 .bus_num = 0, 116 .bus_num = 0,
118 } 117 }
119#endif
120}; 118};
121 119
122static struct spi_board_info usb_a9g20_spi_devices[] = { 120static struct spi_board_info usb_a9g20_spi_devices[] = {
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 9fd57bcac69..f162fdfd66e 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -119,11 +119,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
119/* 119/*
120 * MMC 120 * MMC
121 */ 121 */
122static struct at91_mmc_data __initdata yl9200_mmc_data = { 122static struct mci_platform_data __initdata yl9200_mci0_data = {
123 .det_pin = AT91_PIN_PB9, 123 .slot[0] = {
124 .wire4 = 1, 124 .bus_width = 4,
125 .wp_pin = -EINVAL, 125 .detect_pin = AT91_PIN_PB9,
126 .vcc_pin = -EINVAL, 126 .wp_pin = -EINVAL,
127 },
127}; 128};
128 129
129/* 130/*
@@ -565,7 +566,7 @@ static void __init yl9200_board_init(void)
565 /* I2C */ 566 /* I2C */
566 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices)); 567 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
567 /* MMC */ 568 /* MMC */
568 at91_add_device_mmc(0, &yl9200_mmc_data); 569 at91_add_device_mci(0, &yl9200_mci0_data);
569 /* NAND */ 570 /* NAND */
570 at91_add_device_nand(&yl9200_nand_data); 571 at91_add_device_nand(&yl9200_nand_data);
571 /* NOR Flash */ 572 /* NOR Flash */
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 31bb7e5b504..0d934079895 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -406,46 +406,6 @@ config MTD_NAND_ATMEL
406 help 406 help
407 Enables support for NAND Flash / Smart Media Card interface 407 Enables support for NAND Flash / Smart Media Card interface
408 on Atmel AT91 and AVR32 processors. 408 on Atmel AT91 and AVR32 processors.
409choice
410 prompt "ECC management for NAND Flash / SmartMedia on AT91 / AVR32"
411 depends on MTD_NAND_ATMEL
412
413config MTD_NAND_ATMEL_ECC_HW
414 bool "Hardware ECC"
415 depends on ARCH_AT91SAM9263 || ARCH_AT91SAM9260 || AVR32
416 help
417 Use hardware ECC instead of software ECC when the chip
418 supports it.
419
420 The hardware ECC controller is capable of single bit error
421 correction and 2-bit random detection per page.
422
423 NB : hardware and software ECC schemes are incompatible.
424 If you switch from one to another, you'll have to erase your
425 mtd partition.
426
427 If unsure, say Y
428
429config MTD_NAND_ATMEL_ECC_SOFT
430 bool "Software ECC"
431 help
432 Use software ECC.
433
434 NB : hardware and software ECC schemes are incompatible.
435 If you switch from one to another, you'll have to erase your
436 mtd partition.
437
438config MTD_NAND_ATMEL_ECC_NONE
439 bool "No ECC (testing only, DANGEROUS)"
440 depends on DEBUG_KERNEL
441 help
442 No ECC will be used.
443 It's not a good idea and it should be reserved for testing
444 purpose only.
445
446 If unsure, say N
447
448endchoice
449 409
450config MTD_NAND_PXA3xx 410config MTD_NAND_PXA3xx
451 tristate "Support for NAND flash devices on PXA3xx" 411 tristate "Support for NAND flash devices on PXA3xx"