diff options
-rw-r--r-- | arch/arm/mach-ux500/board-u5500-regulators.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-u5500-sdi.c | 74 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-db5500.h | 20 |
3 files changed, 89 insertions, 21 deletions
diff --git a/arch/arm/mach-ux500/board-u5500-regulators.c b/arch/arm/mach-ux500/board-u5500-regulators.c index 89c6feda167..a5d3e585e48 100644 --- a/arch/arm/mach-ux500/board-u5500-regulators.c +++ b/arch/arm/mach-ux500/board-u5500-regulators.c @@ -19,7 +19,7 @@ */ static struct regulator_consumer_supply ab5500_ldo_g_consumers[] = { - REGULATOR_SUPPLY("v-MMC-SD", "sdi1"), + REGULATOR_SUPPLY("vmmc", "sdi1"), }; static struct regulator_consumer_supply ab5500_ldo_h_consumers[] = { @@ -36,8 +36,8 @@ static struct regulator_consumer_supply ab5500_ldo_k_consumers[] = { }; static struct regulator_consumer_supply ab5500_ldo_l_consumers[] = { - REGULATOR_SUPPLY("v-EMMC", "sdi0"), - REGULATOR_SUPPLY("v-EMMC", "sdi2"), + REGULATOR_SUPPLY("vmmc", "sdi0"), + REGULATOR_SUPPLY("vmmc", "sdi2"), }; static struct regulator_consumer_supply ab5500_ldo_vdigmic_consumers[] = { @@ -140,11 +140,11 @@ static struct regulator_consumer_supply u5500_vape_consumers[] = { REGULATOR_SUPPLY("v-i2c", "nmk-i2c.1"), REGULATOR_SUPPLY("v-i2c", "nmk-i2c.2"), REGULATOR_SUPPLY("v-i2c", "nmk-i2c.3"), - REGULATOR_SUPPLY("v-mmc", "sdi0"), - REGULATOR_SUPPLY("v-mmc", "sdi1"), - REGULATOR_SUPPLY("v-mmc", "sdi2"), - REGULATOR_SUPPLY("v-mmc", "sdi3"), - REGULATOR_SUPPLY("v-mmc", "sdi4"), + REGULATOR_SUPPLY("vcore", "sdi0"), + REGULATOR_SUPPLY("vcore", "sdi1"), + REGULATOR_SUPPLY("vcore", "sdi2"), + REGULATOR_SUPPLY("vcore", "sdi3"), + REGULATOR_SUPPLY("vcore", "sdi4"), REGULATOR_SUPPLY("v-uart", "uart0"), REGULATOR_SUPPLY("v-uart", "uart1"), REGULATOR_SUPPLY("v-uart", "uart2"), diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c index abad7fb1cbc..8c8f0334d10 100644 --- a/arch/arm/mach-ux500/board-u5500-sdi.c +++ b/arch/arm/mach-ux500/board-u5500-sdi.c @@ -20,6 +20,12 @@ #include "board-u5500.h" #include "../../../drivers/mmc/host/mmci.h" /* to avoid MCI_ST* redefinition */ +#define BACKUPRAM_ROM_DEBUG_ADDR 0xFFC +#define MMC_BLOCK_ID 0x20 + +#define SDI_PID_V1 0x00480180 +#define SDI_PID_V2 0x10480180 + /* * SDI0 (EMMC) */ @@ -63,6 +69,28 @@ static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { }; /* + * SDI2 (EMMC2) + */ + +struct stedma40_chan_cfg sdi2_dma_cfg_rx = { + .mode = STEDMA40_MODE_LOGICAL, + .dir = STEDMA40_PERIPH_TO_MEM, + .src_dev_type = DB5500_DMA_DEV26_SDMMC2_RX, + .dst_dev_type = STEDMA40_DEV_DST_MEMORY, + .src_info.data_width = STEDMA40_WORD_WIDTH, + .dst_info.data_width = STEDMA40_WORD_WIDTH, +}; + +static struct stedma40_chan_cfg sdi2_dma_cfg_tx = { + .mode = STEDMA40_MODE_LOGICAL, + .dir = STEDMA40_MEM_TO_PERIPH, + .src_dev_type = STEDMA40_DEV_SRC_MEMORY, + .dst_dev_type = DB5500_DMA_DEV26_SDMMC2_TX, + .src_info.data_width = STEDMA40_WORD_WIDTH, + .dst_info.data_width = STEDMA40_WORD_WIDTH, +}; + +/* * SDI3 (SDIO) */ static struct stedma40_chan_cfg sdi3_dma_cfg_rx = { @@ -98,6 +126,21 @@ static struct mmci_platform_data u5500_sdi0_data = { #endif }; +static struct mmci_platform_data u5500_sdi2_data = { + .ocr_mask = MMC_VDD_165_195, + .f_max = 50000000, + .capabilities = MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA | + MMC_CAP_MMC_HIGHSPEED, + .gpio_cd = -1, + .gpio_wp = -1, +#ifdef CONFIG_STE_DMA40 + .dma_filter = stedma40_filter, + .dma_rx_param = &sdi2_dma_cfg_rx, + .dma_tx_param = &sdi2_dma_cfg_tx, +#endif +}; + static u32 u5500_sdi1_vdd_handler(struct device *dev, unsigned int vdd, unsigned char power_mode) { @@ -187,8 +230,33 @@ static struct mmci_platform_data u5500_sdi3_data = { void __init u5500_sdi_init(void) { - db5500_add_sdi0(&u5500_sdi0_data); + int pid; + int mmc_blk = 0; + + if (cpu_is_u5500v1()) + pid = SDI_PID_V1; + else + pid = SDI_PID_V2; + + if (cpu_is_u5500v1()) + u5500_sdi0_data.ocr_mask = MMC_VDD_165_195; + else + /* + Fix me in 5500 v2.1 + Dynamic detection of booting device by reading + ROM debug register from BACKUP RAM and register the + corresponding EMMC. + This is done due to wrong configuration of MMC0 clock + in ROM code for u5500 v2. + */ + mmc_blk = readl(__io_address(U5500_BACKUPRAM1_BASE) + + BACKUPRAM_ROM_DEBUG_ADDR); + + if (mmc_blk & MMC_BLOCK_ID) + db5500_add_sdi2(&u5500_sdi2_data, pid); + else + db5500_add_sdi0(&u5500_sdi0_data, pid); sdi1_configure(); - db5500_add_sdi1(&u5500_sdi1_data); - db5500_add_sdi3(&u5500_sdi3_data); + db5500_add_sdi1(&u5500_sdi1_data, pid); + db5500_add_sdi3(&u5500_sdi3_data, pid); } diff --git a/arch/arm/mach-ux500/devices-db5500.h b/arch/arm/mach-ux500/devices-db5500.h index 77f34130e83..a6536edd2d1 100644 --- a/arch/arm/mach-ux500/devices-db5500.h +++ b/arch/arm/mach-ux500/devices-db5500.h @@ -47,21 +47,21 @@ db5500_add_keypad(struct db5500_keypad_platform_data *pdata) #define db5500_add_usb(rx_cfg, tx_cfg) \ ux500_add_usb(U5500_USBOTG_BASE, IRQ_DB5500_USBOTG, rx_cfg, tx_cfg) -#define db5500_add_sdi0(pdata) \ +#define db5500_add_sdi0(pdata, pid) \ dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata, \ - 0x10480180) -#define db5500_add_sdi1(pdata) \ + pid) +#define db5500_add_sdi1(pdata, pid) \ dbx500_add_sdi("sdi1", U5500_SDI1_BASE, IRQ_DB5500_SDMMC1, pdata, \ - 0x10480180) -#define db5500_add_sdi2(pdata) \ + pid) +#define db5500_add_sdi2(pdata, pid) \ dbx500_add_sdi("sdi2", U5500_SDI2_BASE, IRQ_DB5500_SDMMC2, pdata, \ - 0x10480180) -#define db5500_add_sdi3(pdata) \ + pid) +#define db5500_add_sdi3(pdata, pid) \ dbx500_add_sdi("sdi3", U5500_SDI3_BASE, IRQ_DB5500_SDMMC3, pdata, \ - 0x10480180) -#define db5500_add_sdi4(pdata) \ + pid) +#define db5500_add_sdi4(pdata, pid) \ dbx500_add_sdi("sdi4", U5500_SDI4_BASE, IRQ_DB5500_SDMMC4, pdata, \ - 0x10480180) + pid) /* This one has a bad peripheral ID in the U5500 silicon */ #define db5500_add_spi0(pdata) \ |