From bd602c536771c53d0d56273d8f7d6596425b8f5c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 25 Feb 2020 02:25:30 +0900 Subject: mmc: make self-contained This header uses bd_t without including its definition. Change it to (struct bd_info), and add the forward declaration to specify it as a structure. Signed-off-by: Masahiro Yamada Reviewed-by: Jaehoon Chung --- include/mmc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index 71e2e1735a..4bdeb929d7 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -15,6 +15,8 @@ #include #include +struct bd_info; + #if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) #define MMC_SUPPORTS_TUNING #endif @@ -712,7 +714,7 @@ void mmc_destroy(struct mmc *mmc); * @return 0 if OK, -ve on error */ int mmc_unbind(struct udevice *dev); -int mmc_initialize(bd_t *bis); +int mmc_initialize(struct bd_info *bis); int mmc_init_device(int num); int mmc_init(struct mmc *mmc); int mmc_send_tuning(struct mmc *mmc, u32 opcode, int *cmd_error); @@ -857,8 +859,8 @@ void mmc_set_preinit(struct mmc *mmc, int preinit); #endif void board_mmc_power_init(void); -int board_mmc_init(bd_t *bis); -int cpu_mmc_init(bd_t *bis); +int board_mmc_init(struct bd_info *bis); +int cpu_mmc_init(struct bd_info *bis); int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr); # ifdef CONFIG_SYS_MMC_ENV_PART extern uint mmc_get_env_part(struct mmc *mmc); -- cgit From 0d3c8584885a7c76929bfa59fa34e44a2134ae1f Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Wed, 26 Feb 2020 13:44:29 +0530 Subject: mmc: Add a saved_clock member Add a saved_clock member to struct mmc to store the previous clock speed in the clock needs to be stopped for some time. Signed-off-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- include/mmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index 4bdeb929d7..8a9ea0bf98 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -605,6 +605,7 @@ struct mmc { bool clk_disable; /* true if the clock can be turned off */ uint bus_width; uint clock; + uint saved_clock; enum mmc_voltage signal_voltage; uint card_caps; uint host_caps; -- cgit From 32860bdbc1f2d4133c1ef38685c6b02368136fbb Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Wed, 26 Feb 2020 13:44:30 +0530 Subject: mmc: Add a deferred_probe() API Add a deferred_probe() API for platforms that want to do some configurations just before starting to enumerate the device. Signed-off-by: Faiz Abbas --- include/mmc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index 8a9ea0bf98..be59ee742b 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -409,6 +409,14 @@ struct mmc; #if CONFIG_IS_ENABLED(DM_MMC) struct dm_mmc_ops { + /** + * deferred_probe() - Some configurations that need to be deferred + * to just before enumerating the device + * + * @dev: Device to init + * @return 0 if Ok, -ve if error + */ + int (*deferred_probe)(struct udevice *dev); /** * send_cmd() - Send a command to the MMC device * @@ -492,6 +500,7 @@ int dm_mmc_get_wp(struct udevice *dev); int dm_mmc_execute_tuning(struct udevice *dev, uint opcode); int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout_us); int dm_mmc_host_power_cycle(struct udevice *dev); +int dm_mmc_deferred_probe(struct udevice *dev); /* Transition functions for compatibility */ int mmc_set_ios(struct mmc *mmc); @@ -501,6 +510,7 @@ int mmc_execute_tuning(struct mmc *mmc, uint opcode); int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us); int mmc_set_enhanced_strobe(struct mmc *mmc); int mmc_host_power_cycle(struct mmc *mmc); +int mmc_deferred_probe(struct mmc *mmc); #else struct mmc_ops { -- cgit From cb884347f4f902b605932da1d45d477d10c144e3 Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Wed, 26 Feb 2020 13:44:31 +0530 Subject: sdhci: Add sdhci_deferred_probe() API Add the sdhci_deferred_probe() function to register as the deferred_probe() callback to the mmc core. It will in turn call the deferred_probe() callback of the platform drivers as declared in the sdhci_ops. Signed-off-by: Faiz Abbas --- include/sdhci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sdhci.h b/include/sdhci.h index 7f8feefa45..aa4378fd57 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -268,6 +268,7 @@ struct sdhci_ops { void (*set_clock)(struct sdhci_host *host, u32 div); int (*platform_execute_tuning)(struct mmc *host, u8 opcode); void (*set_delay)(struct sdhci_host *host); + int (*deferred_probe)(struct sdhci_host *host); }; #if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA) -- cgit From e8d5dde4473514327b5ea67fb69d8fdd8410240c Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Wed, 26 Feb 2020 13:44:32 +0530 Subject: mmc: Merge SD_LEGACY and MMC_LEGACY bus modes MMC_LEGACY & SD_LEGACY are not differentiated timings in the spec and don't have any meaningful differences. Therefore, get rid of all references to SD_LEGACY and use MMC_LEGACY to mean both of them. Signed-off-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- include/mmc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index be59ee742b..e83c22423b 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -545,7 +545,6 @@ struct sd_ssr { enum bus_mode { MMC_LEGACY, - SD_LEGACY, MMC_HS, SD_HS, MMC_HS_52, -- cgit From 91332bd2107daf23126c47a93fd57e24afbf1113 Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Wed, 26 Feb 2020 13:44:38 +0530 Subject: configs: am65x_evm: Add CONFIG_SUPPORT_EMMC_BOOT With CONFIG_SUPPORT_EMMC_BOOT moved to Kconfig, move it to defconfig files. Signed-off-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- include/configs/am65x_evm.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 7d7f86a059..23ee2254ed 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -127,8 +127,6 @@ #define CONFIG_SYS_MMC_ENV_PART 1 #endif -#define CONFIG_SUPPORT_EMMC_BOOT - /* Now for the remaining common defines */ #include -- cgit