All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu
@ 2019-05-25 22:25 Ezequiel Garcia
  2019-05-25 22:25 ` [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY Ezequiel Garcia
  2019-07-14 13:07 ` [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Ezequiel Garcia @ 2019-05-25 22:25 UTC (permalink / raw)
  To: u-boot

The SPL_MMC_TINY implements feature-reduced MMC support
on SPL, and as such, it's more consistent and convenient
to find it as part of the SPL configuration.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 common/spl/Kconfig  | 17 +++++++++++++++++
 drivers/mmc/Kconfig | 15 ---------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c7cd34449a52..1408575dd511 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -515,6 +515,23 @@ config SPL_MMC_SUPPORT
 	  this option to build the drivers in drivers/mmc as part of an SPL
 	  build.
 
+config SPL_MMC_TINY
+	bool "Tiny MMC framework in SPL"
+	depends on SPL_MMC_SUPPORT
+	default n
+	help
+	  Enable MMC framework tinification support. This option is useful if
+	  if your SPL is extremely size constrained. Heed the warning, enable
+	  this option if and only if you know exactly what you are doing, if
+	  you are reading this help text, you most likely have no idea :-)
+
+	  The MMC framework is reduced to bare minimum to be useful. No malloc
+	  support is needed for the MMC framework operation with this option
+	  enabled. The framework supports exactly one MMC device and exactly
+	  one MMC driver. The MMC driver can be adjusted to avoid any malloc
+	  operations too, which can remove the need for malloc support in SPL
+	  and thus further reduce footprint.
+
 config SPL_MMC_WRITE
 	bool "MMC/SD/SDIO card support for write operations in SPL"
 	depends on SPL_MMC_SUPPORT
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index c23299ea962b..76d8bff2eb83 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -158,21 +158,6 @@ config MMC_TRACE
 
 	  If you need to see the MMC core message, say Y.
 
-config SPL_MMC_TINY
-	bool "Tiny MMC framework in SPL"
-	help
-	  Enable MMC framework tinification support. This option is useful if
-	  if your SPL is extremely size constrained. Heed the warning, enable
-	  this option if and only if you know exactly what you are doing, if
-	  you are reading this help text, you most likely have no idea :-)
-
-	  The MMC framework is reduced to bare minimum to be useful. No malloc
-	  support is needed for the MMC framework operation with this option
-	  enabled. The framework supports exactly one MMC device and exactly
-	  one MMC driver. The MMC driver can be adjusted to avoid any malloc
-	  operations too, which can remove the need for malloc support in SPL
-	  and thus further reduce footprint.
-
 config MMC_DAVINCI
 	bool "TI DAVINCI Multimedia Card Interface support"
 	depends on ARCH_DAVINCI
-- 
2.20.1

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

* [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY
  2019-05-25 22:25 [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Ezequiel Garcia
@ 2019-05-25 22:25 ` Ezequiel Garcia
  2019-06-05 20:30   ` Ezequiel Garcia
  2019-07-14 13:07   ` Tom Rini
  2019-07-14 13:07 ` [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Tom Rini
  1 sibling, 2 replies; 5+ messages in thread
From: Ezequiel Garcia @ 2019-05-25 22:25 UTC (permalink / raw)
  To: u-boot

When MMC_TINY is enabled, support for only one MMC device
is provided. Boards that register more than one device,
will just write over mmc_static keeping only the last one
registered.

This commit prevents this, keeping only the first MMC
device created. A debug warning message is added, if nothing
else, as a hint/documentation for developers.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/mmc/mmc_legacy.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 66a7cda440cd..b0f5cf58a2b3 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -150,6 +150,15 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
 {
 	struct mmc *mmc = &mmc_static;
 
+	/* First MMC device registered, fail to register a new one.
+	 * Given users are not expecting this to fail, instead
+	 * of failing let's just return the only MMC device
+	 */
+	if (mmc->cfg) {
+		debug("Warning: MMC_TINY doesn't support multiple MMC devices\n");
+		return mmc;
+	}
+
 	mmc->cfg = cfg;
 	mmc->priv = priv;
 
-- 
2.20.1

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

* [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY
  2019-05-25 22:25 ` [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY Ezequiel Garcia
@ 2019-06-05 20:30   ` Ezequiel Garcia
  2019-07-14 13:07   ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Ezequiel Garcia @ 2019-06-05 20:30 UTC (permalink / raw)
  To: u-boot

On Sat, 25 May 2019 at 19:26, Ezequiel Garcia <ezequiel@collabora.com> wrote:
>
> When MMC_TINY is enabled, support for only one MMC device
> is provided. Boards that register more than one device,
> will just write over mmc_static keeping only the last one
> registered.
>
> This commit prevents this, keeping only the first MMC
> device created. A debug warning message is added, if nothing
> else, as a hint/documentation for developers.
>
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Not sure if it's too early for an gently ping here.

I just want to make sure these two will get some eyes.

Thanks,
Eze

> ---
>  drivers/mmc/mmc_legacy.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
> index 66a7cda440cd..b0f5cf58a2b3 100644
> --- a/drivers/mmc/mmc_legacy.c
> +++ b/drivers/mmc/mmc_legacy.c
> @@ -150,6 +150,15 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
>  {
>         struct mmc *mmc = &mmc_static;
>
> +       /* First MMC device registered, fail to register a new one.
> +        * Given users are not expecting this to fail, instead
> +        * of failing let's just return the only MMC device
> +        */
> +       if (mmc->cfg) {
> +               debug("Warning: MMC_TINY doesn't support multiple MMC devices\n");
> +               return mmc;
> +       }
> +
>         mmc->cfg = cfg;
>         mmc->priv = priv;
>
> --
> 2.20.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

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

* [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu
  2019-05-25 22:25 [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Ezequiel Garcia
  2019-05-25 22:25 ` [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY Ezequiel Garcia
@ 2019-07-14 13:07 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2019-07-14 13:07 UTC (permalink / raw)
  To: u-boot

On Sat, May 25, 2019 at 07:25:21PM -0300, Ezequiel Garcia wrote:

> The SPL_MMC_TINY implements feature-reduced MMC support
> on SPL, and as such, it's more consistent and convenient
> to find it as part of the SPL configuration.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190714/7b22ebde/attachment.sig>

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

* [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY
  2019-05-25 22:25 ` [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY Ezequiel Garcia
  2019-06-05 20:30   ` Ezequiel Garcia
@ 2019-07-14 13:07   ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2019-07-14 13:07 UTC (permalink / raw)
  To: u-boot

On Sat, May 25, 2019 at 07:25:22PM -0300, Ezequiel Garcia wrote:

> When MMC_TINY is enabled, support for only one MMC device
> is provided. Boards that register more than one device,
> will just write over mmc_static keeping only the last one
> registered.
> 
> This commit prevents this, keeping only the first MMC
> device created. A debug warning message is added, if nothing
> else, as a hint/documentation for developers.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190714/6c7944b9/attachment.sig>

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

end of thread, other threads:[~2019-07-14 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-25 22:25 [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Ezequiel Garcia
2019-05-25 22:25 ` [U-Boot] [PATCH 2/2] mmc: Register only the first MMC device on MMC_TINY Ezequiel Garcia
2019-06-05 20:30   ` Ezequiel Garcia
2019-07-14 13:07   ` Tom Rini
2019-07-14 13:07 ` [U-Boot] [PATCH 1/2] spl: Move SPL_MMC_TINY option to appear under SPL menu Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.