]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Nokia RX-51: Convert to CONFIG_DM_MMC
authorPali Rohár <pali@kernel.org>
Sat, 16 Jan 2021 00:04:54 +0000 (01:04 +0100)
committerLokesh Vutla <lokeshvutla@ti.com>
Thu, 4 Feb 2021 15:07:56 +0000 (20:37 +0530)
Move twl4030_power_mmc_init() from board_mmc_power_init() to misc_init_r()
and disable CONFIG_SYS_MALLOC_F. Otherwise U-Boot cannot initialize MMC.
Also disable CONFIG_CMD_SLEEP CONFIG_DM_DEVICE_REMOVE CONFIG_MMC_VERBOSE to
free some space.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
board/nokia/rx51/rx51.c
configs/nokia_rx51_defconfig

index ceb4317901ce23ab2bf3ea1e5f9d3d1b9153118a..84739ae129e74135b706905e8070980bab8f6b95 100644 (file)
@@ -415,6 +415,8 @@ int misc_init_r(void)
 
        /* initialize twl4030 power managment */
        twl4030_power_init();
+       twl4030_power_mmc_init(0);
+       twl4030_power_mmc_init(1);
 
        /* set VSIM to 1.8V */
        twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VSIM_DEDICATED,
@@ -686,22 +688,23 @@ int rx51_kp_getc(struct stdio_dev *sdev)
        return keybuf[keybuf_head++];
 }
 
-/*
- * Routine: board_mmc_init
- * Description: Initialize mmc devices.
- */
-int board_mmc_init(struct bd_info *bis)
-{
-       omap_mmc_init(0, 0, 0, -1, -1);
-       omap_mmc_init(1, 0, 0, -1, -1);
-       return 0;
-}
+static const struct mmc_config rx51_mmc_cfg = {
+       .host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS,
+       .f_min = 400000,
+       .f_max = 52000000,
+       .b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+       .voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195,
+};
 
-void board_mmc_power_init(void)
-{
-       twl4030_power_mmc_init(0);
-       twl4030_power_mmc_init(1);
-}
+static const struct omap_hsmmc_plat rx51_mmc[] = {
+       { rx51_mmc_cfg, (struct hsmmc *)OMAP_HSMMC1_BASE },
+       { rx51_mmc_cfg, (struct hsmmc *)OMAP_HSMMC2_BASE },
+};
+
+U_BOOT_DRVINFOS(rx51_mmc) = {
+       { "omap_hsmmc", &rx51_mmc[0] },
+       { "omap_hsmmc", &rx51_mmc[1] },
+};
 
 static const struct omap_i2c_plat rx51_i2c[] = {
        { I2C_BASE1, 100000, OMAP_I2C_REV_V1 },
index d0c892952514baf56dca9ba0b6161418c560d9f9..3b782715c74068df5735c5fea8a839227b7d87b6 100644 (file)
@@ -4,6 +4,8 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_NOKIA_RX51=y
+# CONFIG_SYS_MALLOC_F is not set
+# CONFIG_TI_SYSC is not set
 # CONFIG_FIT is not set
 CONFIG_BOOTDELAY=30
 CONFIG_AUTOBOOT_KEYED=y
@@ -35,6 +37,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
 CONFIG_CMD_ONENAND=y
 # CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_SLEEP is not set
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
@@ -44,9 +47,12 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 CONFIG_DM=y
+# CONFIG_DM_DEVICE_REMOVE is not set
 CONFIG_DM_I2C=y
 CONFIG_TWL4030_LED=y
+CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
+# CONFIG_MMC_VERBOSE is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_CONS_INDEX=3