From: Marek Szyprowski Date: Tue, 19 May 2020 12:46:43 +0000 (+0200) Subject: mmc: s5p_sdhci: add Tizen specific bind codes X-Git-Tag: submit/tizen/20200528.065747^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51011739031dd7b481ac028f790399da01c77e05;p=platform%2Fkernel%2Fu-boot.git mmc: s5p_sdhci: add Tizen specific bind codes Add Tizen specific bind codes for OdroidU3. When device is booted from SD, SDHCI MMC controller is registered as MMC0, like it is done for DWMMC for OdroidXU3. Based on commit 76f4fcf ("mmc: exynos_dw_mmc: add tizen specific bind codes"). Signed-off-by: Marek Szyprowski Change-Id: I624be4f0c6f7b1ce5a392249d73e36785649fd35 --- diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index f280b550c8..5aef4d3f65 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -305,7 +305,7 @@ static int exynos_dwmmc_probe(struct udevice *dev) static int exynos_dwmmc_bind(struct udevice *dev) { struct exynos_mmc_plat *plat = dev_get_platdata(dev); -#ifdef CONFIG_TIZEN_XU3 +#if defined(CONFIG_TIZEN_XU3) || defined(CONFIG_TARGET_TIZEN) struct blk_desc *bdesc; struct udevice *bdev; int ret, devnum = -1; diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index b5fe828dd6..e0d2bfe4b6 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef CONFIG_DM_MMC struct s5p_sdhci_plat { @@ -225,11 +226,41 @@ static int s5p_sdhci_bind(struct udevice *dev) { struct s5p_sdhci_plat *plat = dev_get_platdata(dev); int ret; +#ifdef CONFIG_TARGET_TIZEN + struct blk_desc *bdesc; + struct udevice *bdev; + int devnum = -1; + ret = dev_read_alias_seq(dev, &devnum); + if (get_boot_mode() == BOOT_MODE_SD) + devnum = 0; + + ret = blk_create_devicef(dev, "mmc_blk", "blk", IF_TYPE_MMC, + devnum, 512, 0, &bdev); + if (ret) { + debug("Cannot create block device\n"); + return ret; + } + bdesc = dev_get_uclass_platdata(bdev); + plat->mmc.cfg = &plat->cfg; + plat->mmc.priv = dev; + + /* the following chunk was from mmc_register() */ + + /* Setup dsr related values */ + plat->mmc.dsr_imp = 0; + plat->mmc.dsr = 0xffffffff; + /* Setup the universal parts of the block interface just once */ + bdesc->removable = 1; + + /* setup initial part type */ + bdesc->part_type = plat->cfg.part_type; + plat->mmc.dev = dev; +#else ret = sdhci_bind(dev, &plat->mmc, &plat->cfg); if (ret) return ret; - +#endif return 0; }