提交 4cf3326a 编写于 作者: L Ludovic Desroches 提交者: Nicolas Ferre

ARM: at91: add atmel-mci support for chips and boards which can use it

Since atmel-mci driver supports all atmel mci versions,
use it instead of the deprecated at91_mci driver.
Platform data and all related configuration are removed.
Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com>
[nicolas.ferre@atmel.com: remove at91_mci platform data]
Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
上级 24f5c4b6
......@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
* 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 struct at91_mmc_data mmc_data;
static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = {
[0] = {
......@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
};
static struct platform_device at91rm9200_mmc_device = {
.name = "at91_mci",
.name = "atmel_mci",
.id = -1,
.dev = {
.dma_mask = &mmc_dmamask,
......@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
.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)
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);
for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
/* CLK */
at91_set_A_periph(AT91_PIN_PA27, 0);
if (!data->slot[i].bus_width)
continue;
if (data->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->wire4) {
at91_set_B_periph(AT91_PIN_PA10, 1);
at91_set_B_periph(AT91_PIN_PA11, 1);
at91_set_B_periph(AT91_PIN_PA12, 1);
/* input/irq */
if (gpio_is_valid(data->slot[i].detect_pin)) {
at91_set_gpio_input(data->slot[i].detect_pin, 1);
at91_set_deglitch(data->slot[i].detect_pin, 1);
}
} else {
if (gpio_is_valid(data->slot[i].wp_pin))
at91_set_gpio_input(data->slot[i].wp_pin, 1);
switch (i) {
case 0: /* slot A */
/* CMD */
at91_set_A_periph(AT91_PIN_PA28, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA29, 1);
if (data->wire4) {
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);
}
}
}
#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
......
......@@ -208,93 +208,11 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
#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 = AT91SAM9260_ID_MCI,
.end = 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
* -------------------------------------------------------------------- */
#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 struct mci_platform_data mmc_data;
......
......@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
* 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 struct at91_mmc_data mmc_data;
static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = {
[0] = {
......@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
};
static struct platform_device at91sam9261_mmc_device = {
.name = "at91_mci",
.name = "atmel_mci",
.id = -1,
.dev = {
.dma_mask = &mmc_dmamask,
......@@ -166,20 +166,19 @@ static struct platform_device at91sam9261_mmc_device = {
.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)
return;
if (data->slot[0].bus_width) {
/* 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->slot[0].detect_pin)) {
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->vcc_pin))
at91_set_gpio_output(data->vcc_pin, 0);
if (gpio_is_valid(data->slot[0].wp_pin))
at91_set_gpio_input(data->slot[0].wp_pin, 1);
/* CLK */
at91_set_B_periph(AT91_PIN_PA2, 0);
......@@ -189,7 +188,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
/* DAT0, maybe DAT1..DAT3 */
at91_set_B_periph(AT91_PIN_PA0, 1);
if (data->wire4) {
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);
......@@ -197,9 +196,10 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
mmc_data = *data;
platform_device_register(&at91sam9261_mmc_device);
}
}
#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
......
......@@ -187,8 +187,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_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", "at91_mci.1", &mmc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_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.1", &spi1_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) {}
* 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 struct at91_mmc_data mmc0_data, mmc1_data;
static struct mci_platform_data mmc0_data, mmc1_data;
static struct resource mmc0_resources[] = {
[0] = {
......@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
};
static struct platform_device at91sam9263_mmc0_device = {
.name = "at91_mci",
.name = "atmel_mci",
.id = 0,
.dev = {
.dma_mask = &mmc_dmamask,
......@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
};
static struct platform_device at91sam9263_mmc1_device = {
.name = "at91_mci",
.name = "atmel_mci",
.id = 1,
.dev = {
.dma_mask = &mmc_dmamask,
......@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
.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)
return;
for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
if (!data->slot[i].bus_width)
continue;
/* 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->slot[i].detect_pin)) {
at91_set_gpio_input(data->slot[i].detect_pin,
1);
at91_set_deglitch(data->slot[i].detect_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 (gpio_is_valid(data->slot[i].wp_pin))
at91_set_gpio_input(data->slot[i].wp_pin, 1);
if (mmc_id == 0) { /* MCI0 */
/* CLK */
at91_set_A_periph(AT91_PIN_PA12, 0);
if (data->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->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 {
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->wire4) {
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);
mmc0_data = *data;
platform_device_register(&at91sam9263_mmc0_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 {
} else if (mmc_id == 1) { /* MCI1 */
switch (i) {
case 0: /* slot A */
/* CMD */
at91_set_A_periph(AT91_PIN_PA7, 1);
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA8, 1);
if (data->wire4) {
if (data->slot[i].bus_width == 4) {
at91_set_A_periph(AT91_PIN_PA9, 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);
mmc1_data = *data;
platform_device_register(&at91sam9263_mmc1_device);
}
}
}
}
#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
/* --------------------------------------------------------------------
......
......@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
* 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 struct at91_mmc_data mmc_data;
static struct mci_platform_data mmc_data;
static struct resource mmc_resources[] = {
[0] = {
......@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
};
static struct platform_device at91sam9rl_mmc_device = {
.name = "at91_mci",
.name = "atmel_mci",
.id = -1,
.dev = {
.dma_mask = &mmc_dmamask,
......@@ -190,20 +190,19 @@ static struct platform_device at91sam9rl_mmc_device = {
.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)
return;
if (data->slot[0].bus_width) {
/* 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->slot[0].detect_pin)) {
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->vcc_pin))
at91_set_gpio_output(data->vcc_pin, 0);
if (gpio_is_valid(data->slot[0].wp_pin))
at91_set_gpio_input(data->slot[0].wp_pin, 1);
/* CLK */
at91_set_A_periph(AT91_PIN_PA2, 0);
......@@ -213,7 +212,7 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
/* DAT0, maybe DAT1..DAT3 */
at91_set_A_periph(AT91_PIN_PA0, 1);
if (data->wire4) {
if (data->slot[0].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);
......@@ -221,9 +220,10 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
mmc_data = *data;
platform_device_register(&at91sam9rl_mmc_device);
}
}
#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
......
......@@ -132,12 +132,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata afeb9260_mmc_data = {
.det_pin = AT91_PIN_PC9,
static struct mci_platform_data __initdata afeb9260_mci0_data = {
.slot[1] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PC9,
.wp_pin = AT91_PIN_PC4,
.slot_b = 1,
.wire4 = 1,
.vcc_pin = -EINVAL,
},
};
......@@ -198,7 +198,7 @@ static void __init afeb9260_board_init(void)
at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
/* MMC */
at91_add_device_mmc(0, &afeb9260_mmc_data);
at91_add_device_mci(0, &afeb9260_mci0_data);
/* I2C */
at91_add_device_i2c(afeb9260_i2c_devices,
ARRAY_SIZE(afeb9260_i2c_devices));
......
......@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
// .vcc_pin = -EINVAL,
// };
static struct at91_mmc_data __initdata carmeva_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = AT91_PIN_PB10,
static struct mci_platform_data __initdata carmeva_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB10,
.wp_pin = AT91_PIN_PC14,
.vcc_pin = -EINVAL,
},
};
static struct spi_board_info carmeva_spi_devices[] = {
......@@ -149,7 +149,7 @@ static void __init carmeva_board_init(void)
/* Compact Flash */
// at91_add_device_cf(&carmeva_cf_data);
/* MMC */
at91_add_device_mmc(0, &carmeva_mmc_data);
at91_add_device_mci(0, &carmeva_mci0_data);
/* LEDs */
at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
}
......
......@@ -310,12 +310,12 @@ static void __init cpu9krea_add_device_buttons(void)
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata cpu9krea_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = AT91_PIN_PA29,
static struct mci_platform_data __initdata cpu9krea_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PA29,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
static void __init cpu9krea_board_init(void)
......@@ -357,7 +357,7 @@ static void __init cpu9krea_board_init(void)
/* Ethernet */
at91_add_device_eth(&cpu9krea_macb_data);
/* MMC */
at91_add_device_mmc(0, &cpu9krea_mmc_data);
at91_add_device_mci(0, &cpu9krea_mci0_data);
/* I2C */
at91_add_device_i2c(cpu9krea_i2c_devices,
ARRAY_SIZE(cpu9krea_i2c_devices));
......
......@@ -77,11 +77,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
.pullup_pin = AT91_PIN_PC14,
};
static struct at91_mmc_data __initdata cpuat91_mmc_data = {
.det_pin = AT91_PIN_PC2,
.wire4 = 1,
static struct mci_platform_data __initdata cpuat91_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PC2,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
static struct physmap_flash_data cpuat91_flash_data = {
......@@ -167,7 +168,7 @@ static void __init cpuat91_board_init(void)
/* USB Device */
at91_add_device_udc(&cpuat91_udc_data);
/* MMC */
at91_add_device_mmc(0, &cpuat91_mmc_data);
at91_add_device_mci(0, &cpuat91_mci0_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* Platform devices */
......
......@@ -86,12 +86,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
.rst_pin = AT91_PIN_PD2,
};
static struct at91_mmc_data __initdata csb337_mmc_data = {
.det_pin = AT91_PIN_PD5,
.slot_b = 0,
.wire4 = 1,
static struct mci_platform_data __initdata csb337_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PD5,
.wp_pin = AT91_PIN_PD6,
.vcc_pin = -EINVAL,
},
};
static struct spi_board_info csb337_spi_devices[] = {
......@@ -239,7 +239,7 @@ static void __init csb337_board_init(void)
/* SPI */
at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
/* MMC */
at91_add_device_mmc(0, &csb337_mmc_data);
at91_add_device_mci(0, &csb337_mci0_data);
/* NOR flash */
platform_device_register(&csb_flash);
/* LEDs */
......
......@@ -69,12 +69,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
.rst_pin = AT91_PIN_PC5,
};
static struct at91_mmc_data __initdata eb9200_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata eb9200_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
......@@ -112,7 +112,7 @@ static void __init eb9200_board_init(void)
at91_add_device_spi(NULL, 0);
/* MMC */
/* 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")
......
......@@ -63,12 +63,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
.overcurrent_pin= {-EINVAL, -EINVAL},
};
static struct at91_mmc_data __initdata ecb_at91mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata ecbat91_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
......@@ -160,7 +160,7 @@ static void __init ecb_at91board_init(void)
at91_add_device_i2c(NULL, 0);
/* MMC */
at91_add_device_mmc(0, &ecb_at91mmc_data);
at91_add_device_mci(0, &ecbat91_mci0_data);
/* SPI */
at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
......
......@@ -55,12 +55,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
.pullup_pin = AT91_PIN_PB13,
};
static struct at91_mmc_data __initdata eco920_mmc_data = {
.slot_b = 0,
.wire4 = 0,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata eco920_mci0_data = {
.slot[0] = {
.bus_width = 1,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
static struct physmap_flash_data eco920_flash_data = {
......@@ -103,7 +103,7 @@ static void __init eco920_board_init(void)
at91_add_device_usbh(&eco920_usbh_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);
at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
......
......@@ -74,12 +74,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
};
/* MCI (SD/MMC) */
static struct at91_mmc_data __initdata flexibity_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = AT91_PIN_PC9,
static struct mci_platform_data __initdata flexibity_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PC9,
.wp_pin = AT91_PIN_PC4,
.vcc_pin = -EINVAL,
},
};
/* LEDs */
......@@ -151,7 +151,7 @@ static void __init flexibity_board_init(void)
at91_add_device_spi(flexibity_spi_devices,
ARRAY_SIZE(flexibity_spi_devices));
/* MMC */
at91_add_device_mmc(0, &flexibity_mmc_data);
at91_add_device_mci(0, &flexibity_mci0_data);
/* LEDs */
at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
}
......
......@@ -85,7 +85,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
* SPI devices.
*/
static struct spi_board_info foxg20_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{
.modalias = "mtd_dataflash",
.chip_select = 1,
......@@ -108,12 +108,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
* MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected
*/
static struct at91_mmc_data __initdata foxg20_mmc_data = {
.slot_b = 1,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata foxg20_mci0_data = {
.slot[1] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
......@@ -246,7 +246,7 @@ static void __init foxg20_board_init(void)
/* Ethernet */
at91_add_device_eth(&foxg20_macb_data);
/* MMC */
at91_add_device_mmc(0, &foxg20_mmc_data);
at91_add_device_mci(0, &foxg20_mci0_data);
/* I2C */
at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
/* LEDs */
......
......@@ -68,12 +68,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
.pullup_pin = AT91_PIN_PB22,
};
static struct at91_mmc_data __initdata kb9202_mmc_data = {
.det_pin = AT91_PIN_PB2,
.slot_b = 0,
.wire4 = 1,
static struct mci_platform_data __initdata kb9202_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB2,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
static struct mtd_partition __initdata kb9202_nand_partition[] = {
......@@ -120,7 +120,7 @@ static void __init kb9202_board_init(void)
/* USB Device */
at91_add_device_udc(&kb9202_udc_data);
/* MMC */
at91_add_device_mmc(0, &kb9202_mmc_data);
at91_add_device_mci(0, &kb9202_mci0_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* SPI */
......
......@@ -137,11 +137,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata neocore926_mmc_data = {
.wire4 = 1,
.det_pin = AT91_PIN_PE18,
static struct mci_platform_data __initdata neocore926_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PE18,
.wp_pin = AT91_PIN_PE19,
.vcc_pin = -EINVAL,
},
};
......@@ -353,7 +354,7 @@ static void __init neocore926_board_init(void)
neocore926_add_device_ts();
/* MMC */
at91_add_device_mmc(1, &neocore926_mmc_data);
at91_add_device_mci(0, &neocore926_mci0_data);
/* Ethernet */
at91_add_device_eth(&neocore926_macb_data);
......
......@@ -61,12 +61,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
.overcurrent_pin= {-EINVAL, -EINVAL},
};
static struct at91_mmc_data __initdata picotux200_mmc_data = {
.det_pin = AT91_PIN_PB27,
.slot_b = 0,
.wire4 = 1,
static struct mci_platform_data __initdata picotux200_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PA17,
.vcc_pin = -EINVAL,
},
};
#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
......@@ -111,7 +111,7 @@ static void __init picotux200_board_init(void)
at91_add_device_i2c(NULL, 0);
/* MMC */
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 */
platform_device_register(&picotux200_flash);
}
......
......@@ -155,12 +155,12 @@ static void __init ek_add_device_nand(void)
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata ek_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
/*
......@@ -244,7 +244,7 @@ static void __init ek_board_init(void)
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
at91_add_device_mci(0, &ek_mci0_data);
/* Push Buttons */
ek_add_device_buttons();
/* LEDs */
......
......@@ -76,12 +76,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
};
#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
static struct at91_mmc_data __initdata dk_mmc_data = {
.slot_b = 0,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata dk_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
#endif
......@@ -207,7 +207,7 @@ static void __init dk_board_init(void)
#else
/* MMC */
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
/* NAND */
at91_add_device_nand(&dk_nand_data);
......
......@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
};
#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
static struct at91_mmc_data __initdata ek_mmc_data = {
.det_pin = AT91_PIN_PB27,
.slot_b = 0,
.wire4 = 1,
static struct mci_platform_data __initdata ek_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PA17,
.vcc_pin = -EINVAL,
}
};
#endif
......@@ -176,7 +176,7 @@ static void __init ek_board_init(void)
#else
/* MMC */
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
/* NOR Flash */
platform_device_register(&ek_flash);
......
......@@ -57,11 +57,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
/*
* SD/MC
*/
static struct at91_mmc_data rsi_ews_mmc_data __initdata = {
.slot_b = 0,
.wire4 = 1,
.det_pin = AT91_PIN_PB27,
static struct mci_platform_data __initdata rsi_ews_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB27,
.wp_pin = AT91_PIN_PB29,
},
};
/*
......@@ -214,7 +215,7 @@ static void __init rsi_ews_board_init(void)
at91_add_device_spi(rsi_ews_spi_devices,
ARRAY_SIZE(rsi_ews_spi_devices));
/* MMC */
at91_add_device_mmc(0, &rsi_ews_mmc_data);
at91_add_device_mci(0, &rsi_ews_mci0_data);
/* NOR Flash */
platform_device_register(&rsiews_nor_flash);
/* LEDs */
......
......@@ -72,7 +72,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
* SPI devices.
*/
static struct spi_board_info ek_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ /* DataFlash chip */
.modalias = "mtd_dataflash",
.chip_select = 1,
......@@ -157,12 +157,12 @@ static void __init ek_add_device_nand(void)
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.slot_b = 1,
.wire4 = 1,
.det_pin = AT91_PIN_PC8,
static struct mci_platform_data __initdata ek_mci0_data = {
.slot[1] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PC8,
.wp_pin = AT91_PIN_PC4,
.vcc_pin = -EINVAL,
},
};
static void __init ek_board_init(void)
......@@ -193,7 +193,7 @@ static void __init ek_board_init(void)
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
at91_add_device_mci(0, &ek_mci0_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
}
......
......@@ -107,7 +107,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
* SPI devices.
*/
static struct spi_board_info ek_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
{ /* DataFlash chip */
.modalias = "mtd_dataflash",
.chip_select = 1,
......@@ -210,12 +210,12 @@ static void __init ek_add_device_nand(void)
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.slot_b = 1,
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata ek_mci0_data = {
.slot[1] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
......@@ -328,7 +328,7 @@ static void __init ek_board_init(void)
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
at91_add_device_mci(0, &ek_mci0_data);
/* I2C */
at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
/* SSC (to AT73C213) */
......
......@@ -339,11 +339,12 @@ static struct spi_board_info ek_spi_devices[] = {
* MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.wire4 = 1,
.det_pin = -EINVAL,
static struct mci_platform_data __initdata mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = -EINVAL,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
#endif /* CONFIG_SPI_ATMEL_* */
......@@ -597,7 +598,7 @@ static void __init ek_board_init(void)
at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
#else
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
at91_add_device_mci(0, &mci0_data);
#endif
/* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data);
......
......@@ -140,11 +140,12 @@ static struct spi_board_info ek_spi_devices[] = {
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.wire4 = 1,
.det_pin = AT91_PIN_PE18,
static struct mci_platform_data __initdata mci1_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PE18,
.wp_pin = AT91_PIN_PE19,
.vcc_pin = -EINVAL,
},
};
......@@ -419,7 +420,7 @@ static void __init ek_board_init(void)
/* Touchscreen */
ek_add_device_ts();
/* MMC */
at91_add_device_mmc(1, &ek_mmc_data);
at91_add_device_mci(1, &mci1_data);
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
/* NAND */
......
......@@ -91,7 +91,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
* 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 */
.modalias = "mtd_dataflash",
.chip_select = 1,
......@@ -198,7 +198,6 @@ static void __init ek_add_device_nand(void)
* MCI (SD/MMC)
* 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 = {
.slot[1] = {
.bus_width = 4,
......@@ -207,28 +206,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)
{
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
if (ek_have_2mmc()) {
ek_mmc_data.slot[0].bus_width = 4;
ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
ek_mmc_data.slot[0].wp_pin = -1;
}
at91_add_device_mci(0, &ek_mmc_data);
#else
at91_add_device_mmc(0, &ek_mmc_data);
#endif
}
/*
......
......@@ -55,11 +55,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
/*
* MCI (SD/MMC)
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.wire4 = 1,
.det_pin = AT91_PIN_PA15,
static struct mci_platform_data __initdata mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PA15,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
......@@ -302,7 +303,7 @@ static void __init ek_board_init(void)
/* SPI */
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
at91_add_device_mci(0, &mci0_data);
/* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data);
/* AC97 */
......
......@@ -82,7 +82,6 @@ static void __init add_device_nand(void)
* MCI (SD/MMC)
* 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 = {
.slot[0] = {
.bus_width = 4,
......@@ -90,15 +89,6 @@ static struct mci_platform_data __initdata mmc_data = {
.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
/*
......@@ -222,11 +212,7 @@ void __init stamp9g20_board_init(void)
/* NAND */
add_device_nand();
/* MMC */
#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
at91_add_device_mci(0, &mmc_data);
#else
at91_add_device_mmc(0, &mmc_data);
#endif
/* W1 */
add_w1();
}
......
......@@ -108,14 +108,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
* SPI devices.
*/
static struct spi_board_info usb_a9263_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
{ /* DataFlash chip */
.modalias = "mtd_dataflash",
.chip_select = 0,
.max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0,
}
#endif
};
static struct spi_board_info usb_a9g20_spi_devices[] = {
......
......@@ -118,11 +118,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
/*
* MMC
*/
static struct at91_mmc_data __initdata yl9200_mmc_data = {
.det_pin = AT91_PIN_PB9,
.wire4 = 1,
static struct mci_platform_data __initdata yl9200_mci0_data = {
.slot[0] = {
.bus_width = 4,
.detect_pin = AT91_PIN_PB9,
.wp_pin = -EINVAL,
.vcc_pin = -EINVAL,
},
};
/*
......@@ -567,7 +568,7 @@ static void __init yl9200_board_init(void)
/* I2C */
at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
/* MMC */
at91_add_device_mmc(0, &yl9200_mmc_data);
at91_add_device_mci(0, &yl9200_mci0_data);
/* NAND */
at91_add_device_nand(&yl9200_nand_data);
/* NOR Flash */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册