Commit e05dd97c authored by Arnd Bergmann's avatar Arnd Bergmann

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: default avatarArnd Bergmann <arnd@arndb.de>
parents 19e4ab54 4cf3326a
...@@ -39,7 +39,6 @@ CONFIG_MTD_BLOCK=y ...@@ -39,7 +39,6 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_DATAFLASH=y CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_NAND=y CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_ATMEL=y
CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_ATMEL_SSC=y CONFIG_ATMEL_SSC=y
......
...@@ -232,7 +232,7 @@ CONFIG_USB_GADGET=y ...@@ -232,7 +232,7 @@ CONFIG_USB_GADGET=y
CONFIG_USB_ETH=m CONFIG_USB_ETH=m
CONFIG_USB_MASS_STORAGE=m CONFIG_USB_MASS_STORAGE=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=y CONFIG_MMC_ATMELMCI=y
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -128,7 +128,7 @@ CONFIG_USB_GADGETFS=m ...@@ -128,7 +128,7 @@ CONFIG_USB_GADGETFS=m
CONFIG_USB_FILE_STORAGE=m CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_G_SERIAL=m CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -61,7 +61,6 @@ CONFIG_MTD_DATAFLASH=y ...@@ -61,7 +61,6 @@ CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_BLOCK2MTD=y CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND=y CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_ATMEL=y
CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
CONFIG_MTD_UBI=y CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_GLUEBI=y CONFIG_MTD_UBI_GLUEBI=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
...@@ -138,7 +137,7 @@ CONFIG_USB_FILE_STORAGE=m ...@@ -138,7 +137,7 @@ CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_G_SERIAL=m CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_SDIO_UART=m CONFIG_SDIO_UART=m
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_ATMEL_PWM=y CONFIG_LEDS_ATMEL_PWM=y
......
...@@ -99,7 +99,7 @@ CONFIG_USB_GADGETFS=m ...@@ -99,7 +99,7 @@ CONFIG_USB_GADGETFS=m
CONFIG_USB_FILE_STORAGE=m CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_G_SERIAL=m CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -60,7 +60,7 @@ CONFIG_AT91SAM9X_WATCHDOG=y ...@@ -60,7 +60,7 @@ CONFIG_AT91SAM9X_WATCHDOG=y
CONFIG_FB=y CONFIG_FB=y
CONFIG_FB_ATMEL=y CONFIG_FB_ATMEL=y
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_RTC_CLASS=y CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_AT91SAM9=y CONFIG_RTC_DRV_AT91SAM9=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
......
...@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y ...@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y CONFIG_USB_GADGET=y
CONFIG_USB_ETH=m CONFIG_USB_ETH=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y ...@@ -82,7 +82,7 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y CONFIG_USB_GADGET=y
CONFIG_USB_ETH=m CONFIG_USB_ETH=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -50,7 +50,6 @@ CONFIG_MTD_BLOCK=y ...@@ -50,7 +50,6 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_DATAFLASH=y CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_NAND=y CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_ATMEL=y
CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
# CONFIG_MISC_DEVICES is not set # CONFIG_MISC_DEVICES is not set
CONFIG_SCSI=y CONFIG_SCSI=y
...@@ -87,7 +86,7 @@ CONFIG_USB_STORAGE=y ...@@ -87,7 +86,7 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y CONFIG_USB_GADGET=y
CONFIG_USB_ETH=m CONFIG_USB_ETH=m
CONFIG_MMC=y CONFIG_MMC=y
CONFIG_MMC_AT91=m CONFIG_MMC_ATMELMCI=m
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
......
...@@ -100,7 +100,6 @@ CONFIG_USB_ETH=m ...@@ -100,7 +100,6 @@ CONFIG_USB_ETH=m
CONFIG_USB_FILE_STORAGE=m CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_G_SERIAL=m CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y CONFIG_MMC=y
# CONFIG_MMC_AT91 is not set
CONFIG_MMC_ATMELMCI=y CONFIG_MMC_ATMELMCI=y
CONFIG_NEW_LEDS=y CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y CONFIG_LEDS_CLASS=y
......
...@@ -49,7 +49,6 @@ CONFIG_MTD_BLOCK=y ...@@ -49,7 +49,6 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_DATAFLASH=y CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_NAND=y CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_ATMEL=y
CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
# CONFIG_MISC_DEVICES is not set # CONFIG_MISC_DEVICES is not set
CONFIG_SCSI=y CONFIG_SCSI=y
......
...@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {} ...@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
* MMC / SD * MMC / SD
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
static u64 mmc_dmamask = DMA_BIT_MASK(32); static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct at91_mmc_data mmc_data; static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = { static struct resource mmc_resources[] = {
[0] = { [0] = {
...@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = { ...@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
}; };
static struct platform_device at91rm9200_mmc_device = { static struct platform_device at91rm9200_mmc_device = {
.name = "at91_mci", .name = "atmel_mci",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &mmc_dmamask, .dma_mask = &mmc_dmamask,
...@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = { ...@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources), .num_resources = ARRAY_SIZE(mmc_resources),
}; };
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
{ {
unsigned int i;
unsigned int slot_count = 0;
if (!data) if (!data)
return; return;
/* input/irq */ for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
if (gpio_is_valid(data->det_pin)) {
at91_set_gpio_input(data->det_pin, 1);
at91_set_deglitch(data->det_pin, 1);
}
if (gpio_is_valid(data->wp_pin))
at91_set_gpio_input(data->wp_pin, 1);
if (gpio_is_valid(data->vcc_pin))
at91_set_gpio_output(data->vcc_pin, 0);
/* CLK */
at91_set_A_periph(AT91_PIN_PA27, 0);
if (data->slot_b) { if (!data->slot[i].bus_width)
/* CMD */ continue;
at91_set_B_periph(AT91_PIN_PA8, 1);
/* DAT0, maybe DAT1..DAT3 */ /* input/irq */
at91_set_B_periph(AT91_PIN_PA9, 1); if (gpio_is_valid(data->slot[i].detect_pin)) {
if (data->wire4) { at91_set_gpio_input(data->slot[i].detect_pin, 1);
at91_set_B_periph(AT91_PIN_PA10, 1); at91_set_deglitch(data->slot[i].detect_pin, 1);
at91_set_B_periph(AT91_PIN_PA11, 1);
at91_set_B_periph(AT91_PIN_PA12, 1);
} }
} else { if (gpio_is_valid(data->slot[i].wp_pin))
/* CMD */ at91_set_gpio_input(data->slot[i].wp_pin, 1);
at91_set_A_periph(AT91_PIN_PA28, 1);
switch (i) {
/* DAT0, maybe DAT1..DAT3 */ case 0: /* slot A */
at91_set_A_periph(AT91_PIN_PA29, 1); /* CMD */
if (data->wire4) { at91_set_A_periph(AT91_PIN_PA28, 1);
at91_set_B_periph(AT91_PIN_PB3, 1); /* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PB4, 1); at91_set_A_periph(AT91_PIN_PA29, 1);
at91_set_B_periph(AT91_PIN_PB5, 1); if (data->slot[i].bus_width == 4) {
at91_set_B_periph(AT91_PIN_PB3, 1);
at91_set_B_periph(AT91_PIN_PB4, 1);
at91_set_B_periph(AT91_PIN_PB5, 1);
}
slot_count++;
break;
case 1: /* slot B */
/* CMD */
at91_set_B_periph(AT91_PIN_PA8, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PA9, 1);
if (data->slot[i].bus_width == 4) {
at91_set_B_periph(AT91_PIN_PA10, 1);
at91_set_B_periph(AT91_PIN_PA11, 1);
at91_set_B_periph(AT91_PIN_PA12, 1);
}
slot_count++;
break;
default:
printk(KERN_ERR
"AT91: SD/MMC slot %d not available\n", i);
break;
}
if (slot_count) {
/* CLK */
at91_set_A_periph(AT91_PIN_PA27, 0);
mmc_data = *data;
platform_device_register(&at91rm9200_mmc_device);
} }
} }
mmc_data = *data;
platform_device_register(&at91rm9200_mmc_device);
} }
#else #else
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
#endif #endif
......
...@@ -208,93 +208,11 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {} ...@@ -208,93 +208,11 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
#endif #endif
/* --------------------------------------------------------------------
* MMC / SD
* -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct at91_mmc_data mmc_data;
static struct resource mmc_resources[] = {
[0] = {
.start = AT91SAM9260_BASE_MCI,
.end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
.end = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device at91sam9260_mmc_device = {
.name = "at91_mci",
.id = -1,
.dev = {
.dma_mask = &mmc_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &mmc_data,
},
.resource = mmc_resources,
.num_resources = ARRAY_SIZE(mmc_resources),
};
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
{
if (!data)
return;
/* input/irq */
if (gpio_is_valid(data->det_pin)) {
at91_set_gpio_input(data->det_pin, 1);
at91_set_deglitch(data->det_pin, 1);
}
if (gpio_is_valid(data->wp_pin))
at91_set_gpio_input(data->wp_pin, 1);
if (gpio_is_valid(data->vcc_pin))
at91_set_gpio_output(data->vcc_pin, 0);
/* CLK */
at91_set_A_periph(AT91_PIN_PA8, 0);
if (data->slot_b) {
/* CMD */
at91_set_B_periph(AT91_PIN_PA1, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PA0, 1);
if (data->wire4) {
at91_set_B_periph(AT91_PIN_PA5, 1);
at91_set_B_periph(AT91_PIN_PA4, 1);
at91_set_B_periph(AT91_PIN_PA3, 1);
}
} else {
/* CMD */
at91_set_A_periph(AT91_PIN_PA7, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA6, 1);
if (data->wire4) {
at91_set_A_periph(AT91_PIN_PA9, 1);
at91_set_A_periph(AT91_PIN_PA10, 1);
at91_set_A_periph(AT91_PIN_PA11, 1);
}
}
mmc_data = *data;
platform_device_register(&at91sam9260_mmc_device);
}
#else
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
#endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* MMC / SD Slot for Atmel MCI Driver * MMC / SD Slot for Atmel MCI Driver
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
static u64 mmc_dmamask = DMA_BIT_MASK(32); static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct mci_platform_data mmc_data; static struct mci_platform_data mmc_data;
......
...@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} ...@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
* MMC / SD * MMC / SD
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
static u64 mmc_dmamask = DMA_BIT_MASK(32); static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct at91_mmc_data mmc_data; static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = { static struct resource mmc_resources[] = {
[0] = { [0] = {
...@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = { ...@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
}; };
static struct platform_device at91sam9261_mmc_device = { static struct platform_device at91sam9261_mmc_device = {
.name = "at91_mci", .name = "atmel_mci",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &mmc_dmamask, .dma_mask = &mmc_dmamask,
...@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = { ...@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources), .num_resources = ARRAY_SIZE(mmc_resources),
}; };
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
{ {
if (!data) if (!data)
return; return;
/* input/irq */ if (data->slot[0].bus_width) {
if (gpio_is_valid(data->det_pin)) { /* input/irq */
at91_set_gpio_input(data->det_pin, 1); if (gpio_is_valid(data->slot[0].detect_pin)) {
at91_set_deglitch(data->det_pin, 1); at91_set_gpio_input(data->slot[0].detect_pin, 1);
} at91_set_deglitch(data->slot[0].detect_pin, 1);
if (gpio_is_valid(data->wp_pin)) }
at91_set_gpio_input(data->wp_pin, 1); if (gpio_is_valid(data->slot[0].wp_pin))
if (gpio_is_valid(data->vcc_pin)) at91_set_gpio_input(data->slot[0].wp_pin, 1);
at91_set_gpio_output(data->vcc_pin, 0);
/* CLK */
/* CLK */ at91_set_B_periph(AT91_PIN_PA2, 0);
at91_set_B_periph(AT91_PIN_PA2, 0);
/* CMD */
at91_set_B_periph(AT91_PIN_PA1, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PA0, 1);
if (data->wire4) {
at91_set_B_periph(AT91_PIN_PA4, 1);
at91_set_B_periph(AT91_PIN_PA5, 1);
at91_set_B_periph(AT91_PIN_PA6, 1);
}
mmc_data = *data; /* CMD */
platform_device_register(&at91sam9261_mmc_device); at91_set_B_periph(AT91_PIN_PA1, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PA0, 1);
if (data->slot[0].bus_width == 4) {
at91_set_B_periph(AT91_PIN_PA4, 1);
at91_set_B_periph(AT91_PIN_PA5, 1);
at91_set_B_periph(AT91_PIN_PA6, 1);
}
mmc_data = *data;
platform_device_register(&at91sam9261_mmc_device);
}
} }
#else #else
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
#endif #endif
......
...@@ -188,8 +188,8 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -188,8 +188,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_ID("hclk", &macb_clk), CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
......
...@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {} ...@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
* MMC / SD * MMC / SD
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
static u64 mmc_dmamask = DMA_BIT_MASK(32); static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct at91_mmc_data mmc0_data, mmc1_data; static struct mci_platform_data mmc0_data, mmc1_data;
static struct resource mmc0_resources[] = { static struct resource mmc0_resources[] = {
[0] = { [0] = {
...@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = { ...@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
}; };
static struct platform_device at91sam9263_mmc0_device = { static struct platform_device at91sam9263_mmc0_device = {
.name = "at91_mci", .name = "atmel_mci",
.id = 0, .id = 0,
.dev = { .dev = {
.dma_mask = &mmc_dmamask, .dma_mask = &mmc_dmamask,
...@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = { ...@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
}; };
static struct platform_device at91sam9263_mmc1_device = { static struct platform_device at91sam9263_mmc1_device = {
.name = "at91_mci", .name = "atmel_mci",
.id = 1, .id = 1,
.dev = { .dev = {
.dma_mask = &mmc_dmamask, .dma_mask = &mmc_dmamask,
...@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = { ...@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
.num_resources = ARRAY_SIZE(mmc1_resources), .num_resources = ARRAY_SIZE(mmc1_resources),
}; };
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
{ {
unsigned int i;
unsigned int slot_count = 0;
if (!data) if (!data)
return; return;
/* input/irq */ for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
if (gpio_is_valid(data->det_pin)) {
at91_set_gpio_input(data->det_pin, 1);
at91_set_deglitch(data->det_pin, 1);
}
if (gpio_is_valid(data->wp_pin))
at91_set_gpio_input(data->wp_pin, 1);
if (gpio_is_valid(data->vcc_pin))
at91_set_gpio_output(data->vcc_pin, 0);
if (mmc_id == 0) { /* MCI0 */ if (!data->slot[i].bus_width)
/* CLK */ continue;
at91_set_A_periph(AT91_PIN_PA12, 0);
if (data->slot_b) { /* input/irq */
/* CMD */ if (gpio_is_valid(data->slot[i].detect_pin)) {
at91_set_A_periph(AT91_PIN_PA16, 1); at91_set_gpio_input(data->slot[i].detect_pin,
1);
at91_set_deglitch(data->slot[i].detect_pin,
1);
}
if (gpio_is_valid(data->slot[i].wp_pin))
at91_set_gpio_input(data->slot[i].wp_pin, 1);
if (mmc_id == 0) { /* MCI0 */
switch (i) {
case 0: /* slot A */
/* CMD */
at91_set_A_periph(AT91_PIN_PA1, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA0, 1);
if (data->slot[i].bus_width == 4) {
at91_set_A_periph(AT91_PIN_PA3, 1);
at91_set_A_periph(AT91_PIN_PA4, 1);
at91_set_A_periph(AT91_PIN_PA5, 1);
}
slot_count++;
break;
case 1: /* slot B */
/* CMD */
at91_set_A_periph(AT91_PIN_PA16, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA17, 1);
if (data->slot[i].bus_width == 4) {
at91_set_A_periph(AT91_PIN_PA18, 1);
at91_set_A_periph(AT91_PIN_PA19, 1);
at91_set_A_periph(AT91_PIN_PA20, 1);
}
slot_count++;
break;
default:
printk(KERN_ERR
"AT91: SD/MMC slot %d not available\n", i);
break;
}
if (slot_count) {
/* CLK */
at91_set_A_periph(AT91_PIN_PA12, 0);
/* DAT0, maybe DAT1..DAT3 */ mmc0_data = *data;
at91_set_A_periph(AT91_PIN_PA17, 1); platform_device_register(&at91sam9263_mmc0_device);
if (data->wire4) {
at91_set_A_periph(AT91_PIN_PA18, 1);
at91_set_A_periph(AT91_PIN_PA19, 1);
at91_set_A_periph(AT91_PIN_PA20, 1);
} }
} else { } else if (mmc_id == 1) { /* MCI1 */
/* CMD */ switch (i) {
at91_set_A_periph(AT91_PIN_PA1, 1); case 0: /* slot A */
/* CMD */
/* DAT0, maybe DAT1..DAT3 */ at91_set_A_periph(AT91_PIN_PA7, 1);
at91_set_A_periph(AT91_PIN_PA0, 1); /* DAT0, maybe DAT1..DAT3 */
if (data->wire4) { at91_set_A_periph(AT91_PIN_PA8, 1);
at91_set_A_periph(AT91_PIN_PA3, 1); if (data->slot[i].bus_width == 4) {
at91_set_A_periph(AT91_PIN_PA4, 1); at91_set_A_periph(AT91_PIN_PA9, 1);
at91_set_A_periph(AT91_PIN_PA5, 1); at91_set_A_periph(AT91_PIN_PA10, 1);
at91_set_A_periph(AT91_PIN_PA11, 1);
}
slot_count++;
break;
case 1: /* slot B */
/* CMD */
at91_set_A_periph(AT91_PIN_PA21, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA22, 1);
if (data->slot[i].bus_width == 4) {
at91_set_A_periph(AT91_PIN_PA23, 1);
at91_set_A_periph(AT91_PIN_PA24, 1);
at91_set_A_periph(AT91_PIN_PA25, 1);
}
slot_count++;
break;
default:
printk(KERN_ERR
"AT91: SD/MMC slot %d not available\n", i);
break;
} }
} if (slot_count) {
/* CLK */
at91_set_A_periph(AT91_PIN_PA6, 0);
mmc0_data = *data; mmc1_data = *data;
platform_device_register(&at91sam9263_mmc0_device); platform_device_register(&at91sam9263_mmc1_device);
} else { /* MCI1 */
/* CLK */
at91_set_A_periph(AT91_PIN_PA6, 0);
if (data->slot_b) {
/* CMD */
at91_set_A_periph(AT91_PIN_PA21, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA22, 1);
if (data->wire4) {
at91_set_A_periph(AT91_PIN_PA23, 1);
at91_set_A_periph(AT91_PIN_PA24, 1);
at91_set_A_periph(AT91_PIN_PA25, 1);
}
} else {
/* CMD */
at91_set_A_periph(AT91_PIN_PA7, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA8, 1);
if (data->wire4) {
at91_set_A_periph(AT91_PIN_PA9, 1);
at91_set_A_periph(AT91_PIN_PA10, 1);
at91_set_A_periph(AT91_PIN_PA11, 1);
} }
} }
mmc1_data = *data;
platform_device_register(&at91sam9263_mmc1_device);
} }
} }
#else #else
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
#endif #endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
......
...@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {} ...@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
* MMC / SD * MMC / SD
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) #if IS_ENABLED(CONFIG_MMC_ATMELMCI)
static u64 mmc_dmamask = DMA_BIT_MASK(32); static u64 mmc_dmamask = DMA_BIT_MASK(32);
static struct at91_mmc_data mmc_data; static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = { static struct resource mmc_resources[] = {
[0] = { [0] = {
...@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = { ...@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
}; };
static struct platform_device at91sam9rl_mmc_device = { static struct platform_device at91sam9rl_mmc_device = {
.name = "at91_mci", .name = "atmel_mci",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &mmc_dmamask, .dma_mask = &mmc_dmamask,
...@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = { ...@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources), .num_resources = ARRAY_SIZE(mmc_resources),
}; };
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
{ {
if (!data) if (!data)
return; return;
/* input/irq */ if (data->slot[0].bus_width) {
if (gpio_is_valid(data->det_pin)) { /* input/irq */
at91_set_gpio_input(data->det_pin, 1); if (gpio_is_valid(data->slot[0].detect_pin)) {
at91_set_deglitch(data->det_pin, 1); at91_set_gpio_input(data->slot[0].detect_pin, 1);
} at91_set_deglitch(data->slot[0].detect_pin, 1);
if (gpio_is_valid(data->wp_pin)) }
at91_set_gpio_input(data->wp_pin, 1); if (gpio_is_valid(data->slot[0].wp_pin))
if (gpio_is_valid(data->vcc_pin)) at91_set_gpio_input(data->slot[0].wp_pin, 1);
at91_set_gpio_output(data->vcc_pin, 0);
/* CLK */
/* CLK */ at91_set_A_periph(AT91_PIN_PA2, 0);
at91_set_A_periph(AT91_PIN_PA2, 0);
/* CMD */
/* CMD */ at91_set_A_periph(AT91_PIN_PA1, 1);
at91_set_A_periph(AT91_PIN_PA1, 1);
/* DAT0, maybe DAT1..DAT3 */
/* DAT0, maybe DAT1..DAT3 */ at91_set_A_periph(AT91_PIN_PA0, 1);
at91_set_A_periph(AT91_PIN_PA0, 1); if (data->slot[0].bus_width == 4) {
if (data->wire4) { at91_set_A_periph(AT91_PIN_PA3, 1);
at91_set_A_periph(AT91_PIN_PA3, 1); at91_set_A_periph(AT91_PIN_PA4, 1);
at91_set_A_periph(AT91_PIN_PA4, 1); at91_set_A_periph(AT91_PIN_PA5, 1);
at91_set_A_periph(AT91_PIN_PA5, 1); }
mmc_data = *data;
platform_device_register(&at91sam9rl_mmc_device);
} }
mmc_data = *data;
platform_device_register(&at91sam9rl_mmc_device);
} }
#else #else
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
#endif #endif
......
...@@ -133,12 +133,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = { ...@@ -133,12 +133,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata afeb9260_mmc_data = { static struct mci_platform_data __initdata afeb9260_mci0_data = {
.det_pin = AT91_PIN_PC9, .slot[1] = {
.wp_pin = AT91_PIN_PC4, .bus_width = 4,
.slot_b = 1, .detect_pin = AT91_PIN_PC9,
.wire4 = 1, .wp_pin = AT91_PIN_PC4,
.vcc_pin = -EINVAL, },
}; };
...@@ -199,7 +199,7 @@ static void __init afeb9260_board_init(void) ...@@ -199,7 +199,7 @@ static void __init afeb9260_board_init(void)
at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */ at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */ at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
/* MMC */ /* MMC */
at91_add_device_mmc(0, &afeb9260_mmc_data); at91_add_device_mci(0, &afeb9260_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(afeb9260_i2c_devices, at91_add_device_i2c(afeb9260_i2c_devices,
ARRAY_SIZE(afeb9260_i2c_devices)); ARRAY_SIZE(afeb9260_i2c_devices));
......
...@@ -71,12 +71,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = { ...@@ -71,12 +71,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
// .vcc_pin = -EINVAL, // .vcc_pin = -EINVAL,
// }; // };
static struct at91_mmc_data __initdata carmeva_mmc_data = { static struct mci_platform_data __initdata carmeva_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = AT91_PIN_PB10, .detect_pin = AT91_PIN_PB10,
.wp_pin = AT91_PIN_PC14, .wp_pin = AT91_PIN_PC14,
.vcc_pin = -EINVAL, },
}; };
static struct spi_board_info carmeva_spi_devices[] = { static struct spi_board_info carmeva_spi_devices[] = {
...@@ -150,7 +150,7 @@ static void __init carmeva_board_init(void) ...@@ -150,7 +150,7 @@ static void __init carmeva_board_init(void)
/* Compact Flash */ /* Compact Flash */
// at91_add_device_cf(&carmeva_cf_data); // at91_add_device_cf(&carmeva_cf_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &carmeva_mmc_data); at91_add_device_mci(0, &carmeva_mci0_data);
/* LEDs */ /* LEDs */
at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds)); at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
} }
......
...@@ -254,8 +254,7 @@ static struct gpio_led cpu9krea_leds[] = { ...@@ -254,8 +254,7 @@ static struct gpio_led cpu9krea_leds[] = {
static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = { static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = {
{ {
I2C_BOARD_INFO("rtc-ds1307", 0x68), I2C_BOARD_INFO("ds1339", 0x68),
.type = "ds1339",
}, },
}; };
...@@ -312,12 +311,12 @@ static void __init cpu9krea_add_device_buttons(void) ...@@ -312,12 +311,12 @@ static void __init cpu9krea_add_device_buttons(void)
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata cpu9krea_mmc_data = { static struct mci_platform_data __initdata cpu9krea_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = AT91_PIN_PA29, .detect_pin = AT91_PIN_PA29,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
static void __init cpu9krea_board_init(void) static void __init cpu9krea_board_init(void)
...@@ -359,7 +358,7 @@ static void __init cpu9krea_board_init(void) ...@@ -359,7 +358,7 @@ static void __init cpu9krea_board_init(void)
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&cpu9krea_macb_data); at91_add_device_eth(&cpu9krea_macb_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &cpu9krea_mmc_data); at91_add_device_mci(0, &cpu9krea_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(cpu9krea_i2c_devices, at91_add_device_i2c(cpu9krea_i2c_devices,
ARRAY_SIZE(cpu9krea_i2c_devices)); ARRAY_SIZE(cpu9krea_i2c_devices));
......
...@@ -78,11 +78,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = { ...@@ -78,11 +78,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
.pullup_pin = AT91_PIN_PC14, .pullup_pin = AT91_PIN_PC14,
}; };
static struct at91_mmc_data __initdata cpuat91_mmc_data = { static struct mci_platform_data __initdata cpuat91_mci0_data = {
.det_pin = AT91_PIN_PC2, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.wp_pin = -EINVAL, .detect_pin = AT91_PIN_PC2,
.vcc_pin = -EINVAL, .wp_pin = -EINVAL,
},
}; };
static struct physmap_flash_data cpuat91_flash_data = { static struct physmap_flash_data cpuat91_flash_data = {
...@@ -168,7 +169,7 @@ static void __init cpuat91_board_init(void) ...@@ -168,7 +169,7 @@ static void __init cpuat91_board_init(void)
/* USB Device */ /* USB Device */
at91_add_device_udc(&cpuat91_udc_data); at91_add_device_udc(&cpuat91_udc_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &cpuat91_mmc_data); at91_add_device_mci(0, &cpuat91_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* Platform devices */ /* Platform devices */
......
...@@ -87,12 +87,12 @@ static struct at91_cf_data __initdata csb337_cf_data = { ...@@ -87,12 +87,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
.rst_pin = AT91_PIN_PD2, .rst_pin = AT91_PIN_PD2,
}; };
static struct at91_mmc_data __initdata csb337_mmc_data = { static struct mci_platform_data __initdata csb337_mci0_data = {
.det_pin = AT91_PIN_PD5, .slot[0] = {
.slot_b = 0, .bus_width = 4,
.wire4 = 1, .detect_pin = AT91_PIN_PD5,
.wp_pin = AT91_PIN_PD6, .wp_pin = AT91_PIN_PD6,
.vcc_pin = -EINVAL, },
}; };
static struct spi_board_info csb337_spi_devices[] = { static struct spi_board_info csb337_spi_devices[] = {
...@@ -238,7 +238,7 @@ static void __init csb337_board_init(void) ...@@ -238,7 +238,7 @@ static void __init csb337_board_init(void)
/* SPI */ /* SPI */
at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
/* MMC */ /* MMC */
at91_add_device_mmc(0, &csb337_mmc_data); at91_add_device_mci(0, &csb337_mci0_data);
/* NOR flash */ /* NOR flash */
platform_device_register(&csb_flash); platform_device_register(&csb_flash);
/* LEDs */ /* LEDs */
......
...@@ -70,12 +70,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = { ...@@ -70,12 +70,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
.rst_pin = AT91_PIN_PC5, .rst_pin = AT91_PIN_PC5,
}; };
static struct at91_mmc_data __initdata eb9200_mmc_data = { static struct mci_platform_data __initdata eb9200_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
static struct i2c_board_info __initdata eb9200_i2c_devices[] = { static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
...@@ -113,7 +113,7 @@ static void __init eb9200_board_init(void) ...@@ -113,7 +113,7 @@ static void __init eb9200_board_init(void)
at91_add_device_spi(NULL, 0); at91_add_device_spi(NULL, 0);
/* MMC */ /* MMC */
/* only supports 1 or 4 bit interface, not wired through to SPI */ /* only supports 1 or 4 bit interface, not wired through to SPI */
at91_add_device_mmc(0, &eb9200_mmc_data); at91_add_device_mci(0, &eb9200_mci0_data);
} }
MACHINE_START(ATEB9200, "Embest ATEB9200") MACHINE_START(ATEB9200, "Embest ATEB9200")
......
...@@ -64,12 +64,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = { ...@@ -64,12 +64,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
.overcurrent_pin= {-EINVAL, -EINVAL}, .overcurrent_pin= {-EINVAL, -EINVAL},
}; };
static struct at91_mmc_data __initdata ecb_at91mmc_data = { static struct mci_platform_data __initdata ecbat91_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
...@@ -170,7 +170,7 @@ static void __init ecb_at91board_init(void) ...@@ -170,7 +170,7 @@ static void __init ecb_at91board_init(void)
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ecb_at91mmc_data); at91_add_device_mci(0, &ecbat91_mci0_data);
/* SPI */ /* SPI */
at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
......
...@@ -56,12 +56,12 @@ static struct at91_udc_data __initdata eco920_udc_data = { ...@@ -56,12 +56,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
.pullup_pin = AT91_PIN_PB13, .pullup_pin = AT91_PIN_PB13,
}; };
static struct at91_mmc_data __initdata eco920_mmc_data = { static struct mci_platform_data __initdata eco920_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 0, .bus_width = 1,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
static struct physmap_flash_data eco920_flash_data = { static struct physmap_flash_data eco920_flash_data = {
...@@ -120,7 +120,7 @@ static void __init eco920_board_init(void) ...@@ -120,7 +120,7 @@ static void __init eco920_board_init(void)
at91_add_device_usbh(&eco920_usbh_data); at91_add_device_usbh(&eco920_usbh_data);
at91_add_device_udc(&eco920_udc_data); at91_add_device_udc(&eco920_udc_data);
at91_add_device_mmc(0, &eco920_mmc_data); at91_add_device_mci(0, &eco920_mci0_data);
platform_device_register(&eco920_flash); platform_device_register(&eco920_flash);
at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
......
...@@ -75,12 +75,12 @@ static struct spi_board_info flexibity_spi_devices[] = { ...@@ -75,12 +75,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
}; };
/* MCI (SD/MMC) */ /* MCI (SD/MMC) */
static struct at91_mmc_data __initdata flexibity_mmc_data = { static struct mci_platform_data __initdata flexibity_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = AT91_PIN_PC9, .detect_pin = AT91_PIN_PC9,
.wp_pin = AT91_PIN_PC4, .wp_pin = AT91_PIN_PC4,
.vcc_pin = -EINVAL, },
}; };
/* LEDs */ /* LEDs */
...@@ -152,7 +152,7 @@ static void __init flexibity_board_init(void) ...@@ -152,7 +152,7 @@ static void __init flexibity_board_init(void)
at91_add_device_spi(flexibity_spi_devices, at91_add_device_spi(flexibity_spi_devices,
ARRAY_SIZE(flexibity_spi_devices)); ARRAY_SIZE(flexibity_spi_devices));
/* MMC */ /* MMC */
at91_add_device_mmc(0, &flexibity_mmc_data); at91_add_device_mci(0, &flexibity_mci0_data);
/* LEDs */ /* LEDs */
at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
} }
......
...@@ -86,7 +86,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = { ...@@ -86,7 +86,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
* SPI devices. * SPI devices.
*/ */
static struct spi_board_info foxg20_spi_devices[] = { static struct spi_board_info foxg20_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91) #if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ {
.modalias = "mtd_dataflash", .modalias = "mtd_dataflash",
.chip_select = 1, .chip_select = 1,
...@@ -109,12 +109,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = { ...@@ -109,12 +109,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
* MCI (SD/MMC) * MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected * det_pin, wp_pin and vcc_pin are not connected
*/ */
static struct at91_mmc_data __initdata foxg20_mmc_data = { static struct mci_platform_data __initdata foxg20_mci0_data = {
.slot_b = 1, .slot[1] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
...@@ -247,7 +247,7 @@ static void __init foxg20_board_init(void) ...@@ -247,7 +247,7 @@ static void __init foxg20_board_init(void)
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&foxg20_macb_data); at91_add_device_eth(&foxg20_macb_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &foxg20_mmc_data); at91_add_device_mci(0, &foxg20_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
/* LEDs */ /* LEDs */
......
...@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = { ...@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
.pullup_pin = AT91_PIN_PB22, .pullup_pin = AT91_PIN_PB22,
}; };
static struct at91_mmc_data __initdata kb9202_mmc_data = { static struct mci_platform_data __initdata kb9202_mci0_data = {
.det_pin = AT91_PIN_PB2, .slot[0] = {
.slot_b = 0, .bus_width = 4,
.wire4 = 1, .detect_pin = AT91_PIN_PB2,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
static struct mtd_partition __initdata kb9202_nand_partition[] = { static struct mtd_partition __initdata kb9202_nand_partition[] = {
...@@ -136,7 +136,7 @@ static void __init kb9202_board_init(void) ...@@ -136,7 +136,7 @@ static void __init kb9202_board_init(void)
/* USB Device */ /* USB Device */
at91_add_device_udc(&kb9202_udc_data); at91_add_device_udc(&kb9202_udc_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &kb9202_mmc_data); at91_add_device_mci(0, &kb9202_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* SPI */ /* SPI */
......
...@@ -138,11 +138,12 @@ static struct spi_board_info neocore926_spi_devices[] = { ...@@ -138,11 +138,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata neocore926_mmc_data = { static struct mci_platform_data __initdata neocore926_mci0_data = {
.wire4 = 1, .slot[0] = {
.det_pin = AT91_PIN_PE18, .bus_width = 4,
.wp_pin = AT91_PIN_PE19, .detect_pin = AT91_PIN_PE18,
.vcc_pin = -EINVAL, .wp_pin = AT91_PIN_PE19,
},
}; };
...@@ -354,7 +355,7 @@ static void __init neocore926_board_init(void) ...@@ -354,7 +355,7 @@ static void __init neocore926_board_init(void)
neocore926_add_device_ts(); neocore926_add_device_ts();
/* MMC */ /* MMC */
at91_add_device_mmc(1, &neocore926_mmc_data); at91_add_device_mci(0, &neocore926_mci0_data);
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&neocore926_macb_data); at91_add_device_eth(&neocore926_macb_data);
......
...@@ -62,12 +62,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = { ...@@ -62,12 +62,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
.overcurrent_pin= {-EINVAL, -EINVAL}, .overcurrent_pin= {-EINVAL, -EINVAL},
}; };
static struct at91_mmc_data __initdata picotux200_mmc_data = { static struct mci_platform_data __initdata picotux200_mci0_data = {
.det_pin = AT91_PIN_PB27, .slot[0] = {
.slot_b = 0, .bus_width = 4,
.wire4 = 1, .detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PA17, .wp_pin = AT91_PIN_PA17,
.vcc_pin = -EINVAL, },
}; };
#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
...@@ -112,7 +112,7 @@ static void __init picotux200_board_init(void) ...@@ -112,7 +112,7 @@ static void __init picotux200_board_init(void)
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* MMC */ /* MMC */
at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
at91_add_device_mmc(0, &picotux200_mmc_data); at91_add_device_mci(0, &picotux200_mci0_data);
/* NOR Flash */ /* NOR Flash */
platform_device_register(&picotux200_flash); platform_device_register(&picotux200_flash);
} }
......
...@@ -156,12 +156,12 @@ static void __init ek_add_device_nand(void) ...@@ -156,12 +156,12 @@ static void __init ek_add_device_nand(void)
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata ek_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
/* /*
...@@ -245,7 +245,7 @@ static void __init ek_board_init(void) ...@@ -245,7 +245,7 @@ static void __init ek_board_init(void)
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&ek_macb_data); at91_add_device_eth(&ek_macb_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &ek_mci0_data);
/* Push Buttons */ /* Push Buttons */
ek_add_device_buttons(); ek_add_device_buttons();
/* LEDs */ /* LEDs */
......
...@@ -77,12 +77,12 @@ static struct at91_cf_data __initdata dk_cf_data = { ...@@ -77,12 +77,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
}; };
#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
static struct at91_mmc_data __initdata dk_mmc_data = { static struct mci_platform_data __initdata dk_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
#endif #endif
...@@ -205,7 +205,7 @@ static void __init dk_board_init(void) ...@@ -205,7 +205,7 @@ static void __init dk_board_init(void)
#else #else
/* MMC */ /* MMC */
at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
at91_add_device_mmc(0, &dk_mmc_data); at91_add_device_mci(0, &dk_mci0_data);
#endif #endif
/* NAND */ /* NAND */
at91_add_device_nand(&dk_nand_data); at91_add_device_nand(&dk_nand_data);
......
...@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata ek_udc_data = { ...@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
}; };
#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata ek_mci0_data = {
.det_pin = AT91_PIN_PB27, .slot[0] = {
.slot_b = 0, .bus_width = 4,
.wire4 = 1, .detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PA17, .wp_pin = AT91_PIN_PA17,
.vcc_pin = -EINVAL, }
}; };
#endif #endif
...@@ -174,7 +174,7 @@ static void __init ek_board_init(void) ...@@ -174,7 +174,7 @@ static void __init ek_board_init(void)
#else #else
/* MMC */ /* MMC */
at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &ek_mci0_data);
#endif #endif
/* NOR Flash */ /* NOR Flash */
platform_device_register(&ek_flash); platform_device_register(&ek_flash);
......
...@@ -58,11 +58,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = { ...@@ -58,11 +58,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
/* /*
* SD/MC * SD/MC
*/ */
static struct at91_mmc_data rsi_ews_mmc_data __initdata = { static struct mci_platform_data __initdata rsi_ews_mci0_data = {
.slot_b = 0, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.det_pin = AT91_PIN_PB27, .detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PB29, .wp_pin = AT91_PIN_PB29,
},
}; };
/* /*
...@@ -212,7 +213,7 @@ static void __init rsi_ews_board_init(void) ...@@ -212,7 +213,7 @@ static void __init rsi_ews_board_init(void)
at91_add_device_spi(rsi_ews_spi_devices, at91_add_device_spi(rsi_ews_spi_devices,
ARRAY_SIZE(rsi_ews_spi_devices)); ARRAY_SIZE(rsi_ews_spi_devices));
/* MMC */ /* MMC */
at91_add_device_mmc(0, &rsi_ews_mmc_data); at91_add_device_mci(0, &rsi_ews_mci0_data);
/* NOR Flash */ /* NOR Flash */
platform_device_register(&rsiews_nor_flash); platform_device_register(&rsiews_nor_flash);
/* LEDs */ /* LEDs */
......
...@@ -73,7 +73,7 @@ static struct at91_udc_data __initdata ek_udc_data = { ...@@ -73,7 +73,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
* SPI devices. * SPI devices.
*/ */
static struct spi_board_info ek_spi_devices[] = { static struct spi_board_info ek_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91) #if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ /* DataFlash chip */ { /* DataFlash chip */
.modalias = "mtd_dataflash", .modalias = "mtd_dataflash",
.chip_select = 1, .chip_select = 1,
...@@ -158,12 +158,12 @@ static void __init ek_add_device_nand(void) ...@@ -158,12 +158,12 @@ static void __init ek_add_device_nand(void)
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata ek_mci0_data = {
.slot_b = 1, .slot[1] = {
.wire4 = 1, .bus_width = 4,
.det_pin = AT91_PIN_PC8, .detect_pin = AT91_PIN_PC8,
.wp_pin = AT91_PIN_PC4, .wp_pin = AT91_PIN_PC4,
.vcc_pin = -EINVAL, },
}; };
/* /*
...@@ -209,7 +209,7 @@ static void __init ek_board_init(void) ...@@ -209,7 +209,7 @@ static void __init ek_board_init(void)
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&ek_macb_data); at91_add_device_eth(&ek_macb_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &ek_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(NULL, 0); at91_add_device_i2c(NULL, 0);
/* LEDs */ /* LEDs */
......
...@@ -108,7 +108,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {} ...@@ -108,7 +108,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
* SPI devices. * SPI devices.
*/ */
static struct spi_board_info ek_spi_devices[] = { static struct spi_board_info ek_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91) #if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ /* DataFlash chip */ { /* DataFlash chip */
.modalias = "mtd_dataflash", .modalias = "mtd_dataflash",
.chip_select = 1, .chip_select = 1,
...@@ -211,12 +211,12 @@ static void __init ek_add_device_nand(void) ...@@ -211,12 +211,12 @@ static void __init ek_add_device_nand(void)
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata ek_mci0_data = {
.slot_b = 1, .slot[1] = {
.wire4 = 1, .bus_width = 4,
.det_pin = -EINVAL, .detect_pin = -EINVAL,
.wp_pin = -EINVAL, .wp_pin = -EINVAL,
.vcc_pin = -EINVAL, },
}; };
...@@ -329,7 +329,7 @@ static void __init ek_board_init(void) ...@@ -329,7 +329,7 @@ static void __init ek_board_init(void)
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&ek_macb_data); at91_add_device_eth(&ek_macb_data);
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &ek_mci0_data);
/* I2C */ /* I2C */
at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
/* SSC (to AT73C213) */ /* SSC (to AT73C213) */
......
...@@ -340,11 +340,12 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -340,11 +340,12 @@ static struct spi_board_info ek_spi_devices[] = {
* MCI (SD/MMC) * MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected * det_pin, wp_pin and vcc_pin are not connected
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata mci0_data = {
.wire4 = 1, .slot[0] = {
.det_pin = -EINVAL, .bus_width = 4,
.wp_pin = -EINVAL, .detect_pin = -EINVAL,
.vcc_pin = -EINVAL, .wp_pin = -EINVAL,
},
}; };
#endif /* CONFIG_SPI_ATMEL_* */ #endif /* CONFIG_SPI_ATMEL_* */
...@@ -595,7 +596,7 @@ static void __init ek_board_init(void) ...@@ -595,7 +596,7 @@ static void __init ek_board_init(void)
at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX); at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
#else #else
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &mci0_data);
#endif #endif
/* LCD Controller */ /* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data); at91_add_device_lcdc(&ek_lcdc_data);
......
...@@ -141,11 +141,12 @@ static struct spi_board_info ek_spi_devices[] = { ...@@ -141,11 +141,12 @@ static struct spi_board_info ek_spi_devices[] = {
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata mci1_data = {
.wire4 = 1, .slot[0] = {
.det_pin = AT91_PIN_PE18, .bus_width = 4,
.wp_pin = AT91_PIN_PE19, .detect_pin = AT91_PIN_PE18,
.vcc_pin = -EINVAL, .wp_pin = AT91_PIN_PE19,
},
}; };
...@@ -420,7 +421,7 @@ static void __init ek_board_init(void) ...@@ -420,7 +421,7 @@ static void __init ek_board_init(void)
/* Touchscreen */ /* Touchscreen */
ek_add_device_ts(); ek_add_device_ts();
/* MMC */ /* MMC */
at91_add_device_mmc(1, &ek_mmc_data); at91_add_device_mci(1, &mci1_data);
/* Ethernet */ /* Ethernet */
at91_add_device_eth(&ek_macb_data); at91_add_device_eth(&ek_macb_data);
/* NAND */ /* NAND */
......
...@@ -92,7 +92,7 @@ static struct at91_udc_data __initdata ek_udc_data = { ...@@ -92,7 +92,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
* SPI devices. * SPI devices.
*/ */
static struct spi_board_info ek_spi_devices[] = { static struct spi_board_info ek_spi_devices[] = {
#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) #if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ /* DataFlash chip */ { /* DataFlash chip */
.modalias = "mtd_dataflash", .modalias = "mtd_dataflash",
.chip_select = 1, .chip_select = 1,
...@@ -199,7 +199,6 @@ static void __init ek_add_device_nand(void) ...@@ -199,7 +199,6 @@ static void __init ek_add_device_nand(void)
* MCI (SD/MMC) * MCI (SD/MMC)
* wp_pin and vcc_pin are not connected * wp_pin and vcc_pin are not connected
*/ */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
static struct mci_platform_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata ek_mmc_data = {
.slot[1] = { .slot[1] = {
.bus_width = 4, .bus_width = 4,
...@@ -208,28 +207,15 @@ static struct mci_platform_data __initdata ek_mmc_data = { ...@@ -208,28 +207,15 @@ static struct mci_platform_data __initdata ek_mmc_data = {
}, },
}; };
#else
static struct at91_mmc_data __initdata ek_mmc_data = {
.slot_b = 1, /* Only one slot so use slot B */
.wire4 = 1,
.det_pin = AT91_PIN_PC9,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
};
#endif
static void __init ek_add_device_mmc(void) static void __init ek_add_device_mmc(void)
{ {
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
if (ek_have_2mmc()) { if (ek_have_2mmc()) {
ek_mmc_data.slot[0].bus_width = 4; ek_mmc_data.slot[0].bus_width = 4;
ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
ek_mmc_data.slot[0].wp_pin = -1; ek_mmc_data.slot[0].wp_pin = -1;
} }
at91_add_device_mci(0, &ek_mmc_data); at91_add_device_mci(0, &ek_mmc_data);
#else
at91_add_device_mmc(0, &ek_mmc_data);
#endif
} }
/* /*
......
...@@ -56,11 +56,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = { ...@@ -56,11 +56,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
/* /*
* MCI (SD/MMC) * MCI (SD/MMC)
*/ */
static struct at91_mmc_data __initdata ek_mmc_data = { static struct mci_platform_data __initdata mci0_data = {
.wire4 = 1, .slot[0] = {
.det_pin = AT91_PIN_PA15, .bus_width = 4,
.wp_pin = -EINVAL, .detect_pin = AT91_PIN_PA15,
.vcc_pin = -EINVAL, .wp_pin = -EINVAL,
},
}; };
...@@ -303,7 +304,7 @@ static void __init ek_board_init(void) ...@@ -303,7 +304,7 @@ static void __init ek_board_init(void)
/* SPI */ /* SPI */
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
/* MMC */ /* MMC */
at91_add_device_mmc(0, &ek_mmc_data); at91_add_device_mci(0, &mci0_data);
/* LCD Controller */ /* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data); at91_add_device_lcdc(&ek_lcdc_data);
/* AC97 */ /* AC97 */
......
...@@ -83,7 +83,6 @@ static void __init add_device_nand(void) ...@@ -83,7 +83,6 @@ static void __init add_device_nand(void)
* MCI (SD/MMC) * MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected * det_pin, wp_pin and vcc_pin are not connected
*/ */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
static struct mci_platform_data __initdata mmc_data = { static struct mci_platform_data __initdata mmc_data = {
.slot[0] = { .slot[0] = {
.bus_width = 4, .bus_width = 4,
...@@ -91,15 +90,6 @@ static struct mci_platform_data __initdata mmc_data = { ...@@ -91,15 +90,6 @@ static struct mci_platform_data __initdata mmc_data = {
.wp_pin = -1, .wp_pin = -1,
}, },
}; };
#else
static struct at91_mmc_data __initdata mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
};
#endif
/* /*
...@@ -223,11 +213,7 @@ void __init stamp9g20_board_init(void) ...@@ -223,11 +213,7 @@ void __init stamp9g20_board_init(void)
/* NAND */ /* NAND */
add_device_nand(); add_device_nand();
/* MMC */ /* MMC */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
at91_add_device_mci(0, &mmc_data); at91_add_device_mci(0, &mmc_data);
#else
at91_add_device_mmc(0, &mmc_data);
#endif
/* W1 */ /* W1 */
add_w1(); add_w1();
} }
......
...@@ -109,14 +109,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = { ...@@ -109,14 +109,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
* SPI devices. * SPI devices.
*/ */
static struct spi_board_info usb_a9263_spi_devices[] = { static struct spi_board_info usb_a9263_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
{ /* DataFlash chip */ { /* DataFlash chip */
.modalias = "mtd_dataflash", .modalias = "mtd_dataflash",
.chip_select = 0, .chip_select = 0,
.max_speed_hz = 15 * 1000 * 1000, .max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0, .bus_num = 0,
} }
#endif
}; };
static struct spi_board_info usb_a9g20_spi_devices[] = { static struct spi_board_info usb_a9g20_spi_devices[] = {
......
...@@ -119,11 +119,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = { ...@@ -119,11 +119,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
/* /*
* MMC * MMC
*/ */
static struct at91_mmc_data __initdata yl9200_mmc_data = { static struct mci_platform_data __initdata yl9200_mci0_data = {
.det_pin = AT91_PIN_PB9, .slot[0] = {
.wire4 = 1, .bus_width = 4,
.wp_pin = -EINVAL, .detect_pin = AT91_PIN_PB9,
.vcc_pin = -EINVAL, .wp_pin = -EINVAL,
},
}; };
/* /*
...@@ -565,7 +566,7 @@ static void __init yl9200_board_init(void) ...@@ -565,7 +566,7 @@ static void __init yl9200_board_init(void)
/* I2C */ /* I2C */
at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices)); at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
/* MMC */ /* MMC */
at91_add_device_mmc(0, &yl9200_mmc_data); at91_add_device_mci(0, &yl9200_mci0_data);
/* NAND */ /* NAND */
at91_add_device_nand(&yl9200_nand_data); at91_add_device_nand(&yl9200_nand_data);
/* NOR Flash */ /* NOR Flash */
......
...@@ -406,46 +406,6 @@ config MTD_NAND_ATMEL ...@@ -406,46 +406,6 @@ config MTD_NAND_ATMEL
help help
Enables support for NAND Flash / Smart Media Card interface Enables support for NAND Flash / Smart Media Card interface
on Atmel AT91 and AVR32 processors. on Atmel AT91 and AVR32 processors.
choice
prompt "ECC management for NAND Flash / SmartMedia on AT91 / AVR32"
depends on MTD_NAND_ATMEL
config MTD_NAND_ATMEL_ECC_HW
bool "Hardware ECC"
depends on ARCH_AT91SAM9263 || ARCH_AT91SAM9260 || AVR32
help
Use hardware ECC instead of software ECC when the chip
supports it.
The hardware ECC controller is capable of single bit error
correction and 2-bit random detection per page.
NB : hardware and software ECC schemes are incompatible.
If you switch from one to another, you'll have to erase your
mtd partition.
If unsure, say Y
config MTD_NAND_ATMEL_ECC_SOFT
bool "Software ECC"
help
Use software ECC.
NB : hardware and software ECC schemes are incompatible.
If you switch from one to another, you'll have to erase your
mtd partition.
config MTD_NAND_ATMEL_ECC_NONE
bool "No ECC (testing only, DANGEROUS)"
depends on DEBUG_KERNEL
help
No ECC will be used.
It's not a good idea and it should be reserved for testing
purpose only.
If unsure, say N
endchoice
config MTD_NAND_PXA3xx config MTD_NAND_PXA3xx
tristate "Support for NAND flash devices on PXA3xx" tristate "Support for NAND flash devices on PXA3xx"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment