public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL
@ 2023-09-25 21:55 Jonas Karlman
  2023-09-27  1:31 ` Kever Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jonas Karlman @ 2023-09-25 21:55 UTC (permalink / raw)
  To: Peng Fan, Jaehoon Chung, Neil Armstrong, Simon Glass,
	Philipp Tomsich, Kever Yang
  Cc: Ferass El Hafidi, Jonas Karlman, u-boot, u-boot-amlogic

With MMC_PWRSEQ enabled the following link issue may happen when
building SPL and SPL_PWRSEQ is not enabled.

  aarch64-linux-gnu-ld.bfd: drivers/mmc/meson_gx_mmc.o: in function `meson_mmc_probe':
  drivers/mmc/meson_gx_mmc.c:295: undefined reference to `pwrseq_set_power'

Fix this by adding a SPL_MMC_PWRSEQ Kconfig option used to enable mmc
pwrseq support in SPL.

Also add depends on DM_GPIO to fix following link issue:

  aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.o: in function `mmc_pwrseq_set_power':
  drivers/mmc/mmc-pwrseq.c:26: undefined reference to `gpio_request_by_name'
  aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:29: undefined reference to `dm_gpio_set_value'
  aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:31: undefined reference to `dm_gpio_set_value'

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/mmc/Kconfig           | 10 +++++++++-
 drivers/mmc/Makefile          |  2 +-
 drivers/mmc/meson_gx_mmc.c    |  2 +-
 drivers/mmc/rockchip_dw_mmc.c |  2 +-
 include/mmc.h                 |  4 ++--
 5 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index de01b9687bad..a9931d39412d 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -20,11 +20,19 @@ config MMC_WRITE
 
 config MMC_PWRSEQ
 	bool "HW reset support for eMMC"
-	depends on PWRSEQ
+	depends on PWRSEQ && DM_GPIO
 	help
 	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
 	  devices.
 
+config SPL_MMC_PWRSEQ
+	bool "HW reset support for eMMC in SPL"
+	depends on SPL_PWRSEQ && SPL_DM_GPIO
+	default y if MMC_PWRSEQ
+	help
+	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
+	  devices in SPL.
+
 config MMC_BROKEN_CD
 	bool "Poll for broken card detection case"
 	help
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 2c65c4765ab2..0a79dd058bef 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += mmc_bootdev.o
 endif
 
 obj-$(CONFIG_$(SPL_TPL_)MMC_WRITE) += mmc_write.o
-obj-$(CONFIG_MMC_PWRSEQ) += mmc-pwrseq.o
+obj-$(CONFIG_$(SPL_)MMC_PWRSEQ) += mmc-pwrseq.o
 obj-$(CONFIG_MMC_SDHCI_ADMA_HELPERS) += sdhci-adma.o
 
 ifndef CONFIG_$(SPL_)BLK
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index fcf4f03d1e24..0825c0a2a838 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -288,7 +288,7 @@ static int meson_mmc_probe(struct udevice *dev)
 
 	mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
 
-#ifdef CONFIG_MMC_PWRSEQ
+#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
 	/* Enable power if needed */
 	ret = mmc_pwrseq_get_power(dev, cfg);
 	if (!ret) {
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index 72c820ee6330..ad4529d6afa8 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -145,7 +145,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 
 	host->fifo_mode = priv->fifo_mode;
 
-#ifdef CONFIG_MMC_PWRSEQ
+#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
 	/* Enable power if needed */
 	ret = mmc_pwrseq_get_power(dev, &plat->cfg);
 	if (!ret) {
diff --git a/include/mmc.h b/include/mmc.h
index 1022db3ffa7c..9aef31ea5deb 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -590,7 +590,7 @@ struct mmc_config {
 	uint f_max;
 	uint b_max;
 	unsigned char part_type;
-#ifdef CONFIG_MMC_PWRSEQ
+#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
 	struct udevice *pwr_dev;
 #endif
 };
@@ -808,7 +808,7 @@ int mmc_deinit(struct mmc *mmc);
  */
 int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg);
 
-#ifdef CONFIG_MMC_PWRSEQ
+#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
 /**
  * mmc_pwrseq_get_power() - get a power device from device tree
  *
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL
  2023-09-25 21:55 [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL Jonas Karlman
@ 2023-09-27  1:31 ` Kever Yang
  2023-09-28  9:02 ` Neil Armstrong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kever Yang @ 2023-09-27  1:31 UTC (permalink / raw)
  To: Jonas Karlman, Peng Fan, Jaehoon Chung, Neil Armstrong,
	Simon Glass, Philipp Tomsich
  Cc: Ferass El Hafidi, u-boot, u-boot-amlogic


On 2023/9/26 05:55, Jonas Karlman wrote:
> With MMC_PWRSEQ enabled the following link issue may happen when
> building SPL and SPL_PWRSEQ is not enabled.
>
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/meson_gx_mmc.o: in function `meson_mmc_probe':
>    drivers/mmc/meson_gx_mmc.c:295: undefined reference to `pwrseq_set_power'
>
> Fix this by adding a SPL_MMC_PWRSEQ Kconfig option used to enable mmc
> pwrseq support in SPL.
>
> Also add depends on DM_GPIO to fix following link issue:
>
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.o: in function `mmc_pwrseq_set_power':
>    drivers/mmc/mmc-pwrseq.c:26: undefined reference to `gpio_request_by_name'
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:29: undefined reference to `dm_gpio_set_value'
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:31: undefined reference to `dm_gpio_set_value'
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/mmc/Kconfig           | 10 +++++++++-
>   drivers/mmc/Makefile          |  2 +-
>   drivers/mmc/meson_gx_mmc.c    |  2 +-
>   drivers/mmc/rockchip_dw_mmc.c |  2 +-
>   include/mmc.h                 |  4 ++--
>   5 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index de01b9687bad..a9931d39412d 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -20,11 +20,19 @@ config MMC_WRITE
>   
>   config MMC_PWRSEQ
>   	bool "HW reset support for eMMC"
> -	depends on PWRSEQ
> +	depends on PWRSEQ && DM_GPIO
>   	help
>   	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
>   	  devices.
>   
> +config SPL_MMC_PWRSEQ
> +	bool "HW reset support for eMMC in SPL"
> +	depends on SPL_PWRSEQ && SPL_DM_GPIO
> +	default y if MMC_PWRSEQ
> +	help
> +	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
> +	  devices in SPL.
> +
>   config MMC_BROKEN_CD
>   	bool "Poll for broken card detection case"
>   	help
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 2c65c4765ab2..0a79dd058bef 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -11,7 +11,7 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += mmc_bootdev.o
>   endif
>   
>   obj-$(CONFIG_$(SPL_TPL_)MMC_WRITE) += mmc_write.o
> -obj-$(CONFIG_MMC_PWRSEQ) += mmc-pwrseq.o
> +obj-$(CONFIG_$(SPL_)MMC_PWRSEQ) += mmc-pwrseq.o
>   obj-$(CONFIG_MMC_SDHCI_ADMA_HELPERS) += sdhci-adma.o
>   
>   ifndef CONFIG_$(SPL_)BLK
> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
> index fcf4f03d1e24..0825c0a2a838 100644
> --- a/drivers/mmc/meson_gx_mmc.c
> +++ b/drivers/mmc/meson_gx_mmc.c
> @@ -288,7 +288,7 @@ static int meson_mmc_probe(struct udevice *dev)
>   
>   	mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	/* Enable power if needed */
>   	ret = mmc_pwrseq_get_power(dev, cfg);
>   	if (!ret) {
> diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
> index 72c820ee6330..ad4529d6afa8 100644
> --- a/drivers/mmc/rockchip_dw_mmc.c
> +++ b/drivers/mmc/rockchip_dw_mmc.c
> @@ -145,7 +145,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
>   
>   	host->fifo_mode = priv->fifo_mode;
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	/* Enable power if needed */
>   	ret = mmc_pwrseq_get_power(dev, &plat->cfg);
>   	if (!ret) {
> diff --git a/include/mmc.h b/include/mmc.h
> index 1022db3ffa7c..9aef31ea5deb 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -590,7 +590,7 @@ struct mmc_config {
>   	uint f_max;
>   	uint b_max;
>   	unsigned char part_type;
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	struct udevice *pwr_dev;
>   #endif
>   };
> @@ -808,7 +808,7 @@ int mmc_deinit(struct mmc *mmc);
>    */
>   int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg);
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   /**
>    * mmc_pwrseq_get_power() - get a power device from device tree
>    *

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL
  2023-09-25 21:55 [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL Jonas Karlman
  2023-09-27  1:31 ` Kever Yang
@ 2023-09-28  9:02 ` Neil Armstrong
  2023-09-28 11:08 ` Ferass El Hafidi
  2023-10-29 13:47 ` Ferass El Hafidi
  3 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-09-28  9:02 UTC (permalink / raw)
  To: Jonas Karlman, Peng Fan, Jaehoon Chung, Simon Glass,
	Philipp Tomsich, Kever Yang
  Cc: Ferass El Hafidi, u-boot, u-boot-amlogic

On 25/09/2023 23:55, Jonas Karlman wrote:
> With MMC_PWRSEQ enabled the following link issue may happen when
> building SPL and SPL_PWRSEQ is not enabled.
> 
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/meson_gx_mmc.o: in function `meson_mmc_probe':
>    drivers/mmc/meson_gx_mmc.c:295: undefined reference to `pwrseq_set_power'
> 
> Fix this by adding a SPL_MMC_PWRSEQ Kconfig option used to enable mmc
> pwrseq support in SPL.
> 
> Also add depends on DM_GPIO to fix following link issue:
> 
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.o: in function `mmc_pwrseq_set_power':
>    drivers/mmc/mmc-pwrseq.c:26: undefined reference to `gpio_request_by_name'
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:29: undefined reference to `dm_gpio_set_value'
>    aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:31: undefined reference to `dm_gpio_set_value'
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>   drivers/mmc/Kconfig           | 10 +++++++++-
>   drivers/mmc/Makefile          |  2 +-
>   drivers/mmc/meson_gx_mmc.c    |  2 +-
>   drivers/mmc/rockchip_dw_mmc.c |  2 +-
>   include/mmc.h                 |  4 ++--
>   5 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index de01b9687bad..a9931d39412d 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -20,11 +20,19 @@ config MMC_WRITE
>   
>   config MMC_PWRSEQ
>   	bool "HW reset support for eMMC"
> -	depends on PWRSEQ
> +	depends on PWRSEQ && DM_GPIO
>   	help
>   	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
>   	  devices.
>   
> +config SPL_MMC_PWRSEQ
> +	bool "HW reset support for eMMC in SPL"
> +	depends on SPL_PWRSEQ && SPL_DM_GPIO
> +	default y if MMC_PWRSEQ
> +	help
> +	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
> +	  devices in SPL.
> +
>   config MMC_BROKEN_CD
>   	bool "Poll for broken card detection case"
>   	help
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 2c65c4765ab2..0a79dd058bef 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -11,7 +11,7 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += mmc_bootdev.o
>   endif
>   
>   obj-$(CONFIG_$(SPL_TPL_)MMC_WRITE) += mmc_write.o
> -obj-$(CONFIG_MMC_PWRSEQ) += mmc-pwrseq.o
> +obj-$(CONFIG_$(SPL_)MMC_PWRSEQ) += mmc-pwrseq.o
>   obj-$(CONFIG_MMC_SDHCI_ADMA_HELPERS) += sdhci-adma.o
>   
>   ifndef CONFIG_$(SPL_)BLK
> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
> index fcf4f03d1e24..0825c0a2a838 100644
> --- a/drivers/mmc/meson_gx_mmc.c
> +++ b/drivers/mmc/meson_gx_mmc.c
> @@ -288,7 +288,7 @@ static int meson_mmc_probe(struct udevice *dev)
>   
>   	mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	/* Enable power if needed */
>   	ret = mmc_pwrseq_get_power(dev, cfg);
>   	if (!ret) {
> diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
> index 72c820ee6330..ad4529d6afa8 100644
> --- a/drivers/mmc/rockchip_dw_mmc.c
> +++ b/drivers/mmc/rockchip_dw_mmc.c
> @@ -145,7 +145,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
>   
>   	host->fifo_mode = priv->fifo_mode;
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	/* Enable power if needed */
>   	ret = mmc_pwrseq_get_power(dev, &plat->cfg);
>   	if (!ret) {
> diff --git a/include/mmc.h b/include/mmc.h
> index 1022db3ffa7c..9aef31ea5deb 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -590,7 +590,7 @@ struct mmc_config {
>   	uint f_max;
>   	uint b_max;
>   	unsigned char part_type;
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   	struct udevice *pwr_dev;
>   #endif
>   };
> @@ -808,7 +808,7 @@ int mmc_deinit(struct mmc *mmc);
>    */
>   int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg);
>   
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>   /**
>    * mmc_pwrseq_get_power() - get a power device from device tree
>    *

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL
  2023-09-25 21:55 [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL Jonas Karlman
  2023-09-27  1:31 ` Kever Yang
  2023-09-28  9:02 ` Neil Armstrong
@ 2023-09-28 11:08 ` Ferass El Hafidi
  2023-10-29 13:47 ` Ferass El Hafidi
  3 siblings, 0 replies; 5+ messages in thread
From: Ferass El Hafidi @ 2023-09-28 11:08 UTC (permalink / raw)
  To: Jonas Karlman, Peng Fan, Jaehoon Chung, Neil Armstrong,
	Simon Glass, Philipp Tomsich, Kever Yang
  Cc: u-boot, u-boot-amlogic

On Mon Sep 25, 2023 at 11:55 PM CEST, Jonas Karlman wrote:
> With MMC_PWRSEQ enabled the following link issue may happen when
> building SPL and SPL_PWRSEQ is not enabled.
>
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/meson_gx_mmc.o: in function `meson_mmc_probe':
>   drivers/mmc/meson_gx_mmc.c:295: undefined reference to `pwrseq_set_power'
>
> Fix this by adding a SPL_MMC_PWRSEQ Kconfig option used to enable mmc
> pwrseq support in SPL.
>
> Also add depends on DM_GPIO to fix following link issue:
>
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.o: in function `mmc_pwrseq_set_power':
>   drivers/mmc/mmc-pwrseq.c:26: undefined reference to `gpio_request_by_name'
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:29: undefined reference to `dm_gpio_set_value'
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:31: undefined reference to `dm_gpio_set_value'
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

This issue was discovered while working on SPL support for Amlogic
devices (not upstream yet), which is why the errors are related to
the `meson_gx_mmc.c` file. It doesn't seem to be an issue specific to
meson_gx_mmc though.

Cheers.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL
  2023-09-25 21:55 [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL Jonas Karlman
                   ` (2 preceding siblings ...)
  2023-09-28 11:08 ` Ferass El Hafidi
@ 2023-10-29 13:47 ` Ferass El Hafidi
  3 siblings, 0 replies; 5+ messages in thread
From: Ferass El Hafidi @ 2023-10-29 13:47 UTC (permalink / raw)
  To: Jonas Karlman, Peng Fan, Jaehoon Chung, Neil Armstrong,
	Simon Glass, Philipp Tomsich, Kever Yang
  Cc: u-boot, u-boot-amlogic

Hi,

On Mon Sep 25, 2023 at 11:55 PM CEST, Jonas Karlman wrote:
> With MMC_PWRSEQ enabled the following link issue may happen when
> building SPL and SPL_PWRSEQ is not enabled.
>
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/meson_gx_mmc.o: in function `meson_mmc_probe':
>   drivers/mmc/meson_gx_mmc.c:295: undefined reference to `pwrseq_set_power'
>
> Fix this by adding a SPL_MMC_PWRSEQ Kconfig option used to enable mmc
> pwrseq support in SPL.
>
> Also add depends on DM_GPIO to fix following link issue:
>
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.o: in function `mmc_pwrseq_set_power':
>   drivers/mmc/mmc-pwrseq.c:26: undefined reference to `gpio_request_by_name'
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:29: undefined reference to `dm_gpio_set_value'
>   aarch64-linux-gnu-ld.bfd: drivers/mmc/mmc-pwrseq.c:31: undefined reference to `dm_gpio_set_value'
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>  drivers/mmc/Kconfig           | 10 +++++++++-
>  drivers/mmc/Makefile          |  2 +-
>  drivers/mmc/meson_gx_mmc.c    |  2 +-
>  drivers/mmc/rockchip_dw_mmc.c |  2 +-
>  include/mmc.h                 |  4 ++--
>  5 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index de01b9687bad..a9931d39412d 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -20,11 +20,19 @@ config MMC_WRITE
>
>  config MMC_PWRSEQ
>  	bool "HW reset support for eMMC"
> -	depends on PWRSEQ
> +	depends on PWRSEQ && DM_GPIO
>  	help
>  	  Ths select Hardware reset support aka pwrseq-emmc for eMMC
>  	  devices.
>
> +config SPL_MMC_PWRSEQ
> +	bool "HW reset support for eMMC in SPL"
> +	depends on SPL_PWRSEQ && SPL_DM_GPIO
> +	default y if MMC_PWRSEQ
> +	help
> +	  Ths select Hardware reset support aka pwrseq-emmc for eMMC

nit: 'Ths'->'This'

Seems to be the same earlier, in MMC_PWRSEQ

> +	  devices in SPL.
> +
>  config MMC_BROKEN_CD
>  	bool "Poll for broken card detection case"
>  	help
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 2c65c4765ab2..0a79dd058bef 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -11,7 +11,7 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += mmc_bootdev.o
>  endif
>
>  obj-$(CONFIG_$(SPL_TPL_)MMC_WRITE) += mmc_write.o
> -obj-$(CONFIG_MMC_PWRSEQ) += mmc-pwrseq.o
> +obj-$(CONFIG_$(SPL_)MMC_PWRSEQ) += mmc-pwrseq.o
>  obj-$(CONFIG_MMC_SDHCI_ADMA_HELPERS) += sdhci-adma.o
>
>  ifndef CONFIG_$(SPL_)BLK
> diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
> index fcf4f03d1e24..0825c0a2a838 100644
> --- a/drivers/mmc/meson_gx_mmc.c
> +++ b/drivers/mmc/meson_gx_mmc.c
> @@ -288,7 +288,7 @@ static int meson_mmc_probe(struct udevice *dev)
>
>  	mmc_set_clock(mmc, cfg->f_min, MMC_CLK_ENABLE);
>
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>  	/* Enable power if needed */
>  	ret = mmc_pwrseq_get_power(dev, cfg);
>  	if (!ret) {
> diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
> index 72c820ee6330..ad4529d6afa8 100644
> --- a/drivers/mmc/rockchip_dw_mmc.c
> +++ b/drivers/mmc/rockchip_dw_mmc.c
> @@ -145,7 +145,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
>
>  	host->fifo_mode = priv->fifo_mode;
>
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>  	/* Enable power if needed */
>  	ret = mmc_pwrseq_get_power(dev, &plat->cfg);
>  	if (!ret) {
> diff --git a/include/mmc.h b/include/mmc.h
> index 1022db3ffa7c..9aef31ea5deb 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -590,7 +590,7 @@ struct mmc_config {
>  	uint f_max;
>  	uint b_max;
>  	unsigned char part_type;
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>  	struct udevice *pwr_dev;
>  #endif
>  };
> @@ -808,7 +808,7 @@ int mmc_deinit(struct mmc *mmc);
>   */
>  int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg);
>
> -#ifdef CONFIG_MMC_PWRSEQ
> +#if CONFIG_IS_ENABLED(MMC_PWRSEQ)
>  /**
>   * mmc_pwrseq_get_power() - get a power device from device tree
>   *
> --
> 2.42.0

Otherwise, looks good to me.

Acked-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-29 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 21:55 [PATCH] mmc: Add SPL_MMC_PWRSEQ to fix link issue when building SPL Jonas Karlman
2023-09-27  1:31 ` Kever Yang
2023-09-28  9:02 ` Neil Armstrong
2023-09-28 11:08 ` Ferass El Hafidi
2023-10-29 13:47 ` Ferass El Hafidi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox