diff mbox series

[V3] stm32mp1: configs: Make all boot devices in distro boot conditional

Message ID 20200110002654.97561-1-marex@denx.de
State Accepted
Commit c3ab0fe6c1f000fe7cbee3b52c61756990b89abc
Headers show
Series [V3] stm32mp1: configs: Make all boot devices in distro boot conditional | expand

Commit Message

Marek Vasut Jan. 10, 2020, 12:26 a.m. UTC
Not all systems have all the boot devices enabled, e.g. not all systems
have MTD devices and thus do not enable UBI. Make all the boot devices
in the distro bootcmd conditional to avoid failures.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Patrick Delaunay <patrick.delaunay at st.com>
Cc: Patrice Chotard <patrice.chotard at st.com>
---
V2: Drop the _DEVICE from BOOT_TARGET_DEVICE_*
V3: Fix BOOT_TARGET_DEVICES, which was missing the _DEVICE in V2
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

Comments

Patrice CHOTARD Jan. 10, 2020, 8:39 a.m. UTC | #1
Hi Marek

On 1/10/20 1:26 AM, Marek Vasut wrote:
> Not all systems have all the boot devices enabled, e.g. not all systems
> have MTD devices and thus do not enable UBI. Make all the boot devices
> in the distro bootcmd conditional to avoid failures.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Patrick Delaunay <patrick.delaunay at st.com>
> Cc: Patrice Chotard <patrice.chotard at st.com>
> ---
> V2: Drop the _DEVICE from BOOT_TARGET_DEVICE_*
> V3: Fix BOOT_TARGET_DEVICES, which was missing the _DEVICE in V2
> ---
>  include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
>  1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
> index d42a7860be..655833428e 100644
> --- a/include/configs/stm32mp1.h
> +++ b/include/configs/stm32mp1.h
> @@ -98,12 +98,34 @@
>  
>  #if !defined(CONFIG_SPL_BUILD)
>  
> -#define BOOT_TARGET_DEVICES(func) \
> -	func(MMC, mmc, 1) \
> -	func(UBIFS, ubifs, 0) \
> -	func(MMC, mmc, 0) \
> -	func(MMC, mmc, 2) \
> -	func(PXE, pxe, na)
> +#ifdef CONFIG_CMD_MMC
> +#define BOOT_TARGET_MMC0(func)	func(MMC, mmc, 0)
> +#define BOOT_TARGET_MMC1(func)	func(MMC, mmc, 1)
> +#define BOOT_TARGET_MMC2(func)	func(MMC, mmc, 2)
> +#else
> +#define BOOT_TARGET_MMC0(func)
> +#define BOOT_TARGET_MMC1(func)
> +#define BOOT_TARGET_MMC2(func)
> +#endif
> +
> +#ifdef CONFIG_NET
> +#define BOOT_TARGET_PXE(func)	func(PXE, pxe, na)
> +#else
> +#define BOOT_TARGET_PXE(func)
> +#endif
> +
> +#ifdef CONFIG_CMD_UBIFS
> +#define BOOT_TARGET_UBIFS(func)	func(UBIFS, ubifs, 0)
> +#else
> +#define BOOT_TARGET_UBIFS(func)
> +#endif
> +
> +#define BOOT_TARGET_DEVICES(func)	\
> +	BOOT_TARGET_MMC1(func)		\
> +	BOOT_TARGET_UBIFS(func)		\
> +	BOOT_TARGET_MMC0(func)		\
> +	BOOT_TARGET_MMC2(func)		\
> +	BOOT_TARGET_PXE(func)
>  
>  /*
>   * bootcmd for stm32mp1:

Reviewed-by: Patrice Chotard <patrice.chotard at st.com>

Thanks
Patrick Delaunay Jan. 13, 2020, 10:44 a.m. UTC | #2
Hi Marek,

> From: Marek Vasut <marex at denx.de>
> Sent: vendredi 10 janvier 2020 01:27
> 
> Not all systems have all the boot devices enabled, e.g. not all systems have MTD
> devices and thus do not enable UBI. Make all the boot devices in the distro
> bootcmd conditional to avoid failures.

Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>
 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Patrick Delaunay <patrick.delaunay at st.com>
> Cc: Patrice Chotard <patrice.chotard at st.com>
> ---

Regards

Patrick
Marek Vasut Jan. 13, 2020, 10:46 a.m. UTC | #3
On 1/13/20 11:44 AM, Patrick DELAUNAY wrote:
> Hi Marek,

Hi,

>> From: Marek Vasut <marex at denx.de>
>> Sent: vendredi 10 janvier 2020 01:27
>>
>> Not all systems have all the boot devices enabled, e.g. not all systems have MTD
>> devices and thus do not enable UBI. Make all the boot devices in the distro
>> bootcmd conditional to avoid failures.
> 
> Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>

Are you planning to pick those up ?
Patrick Delaunay Jan. 17, 2020, 12:42 p.m. UTC | #4
Hi

> From: Marek Vasut <marex at denx.de>
> Sent: lundi 13 janvier 2020 11:46
> To: Patrick DELAUNAY <patrick.delaunay at st.com>; u-boot at lists.denx.de
> Cc: Patrice CHOTARD <patrice.chotard at st.com>
> Subject: Re: [PATCH V3] stm32mp1: configs: Make all boot devices in distro boot
> conditional
> Importance: High
> 
> On 1/13/20 11:44 AM, Patrick DELAUNAY wrote:
> > Hi Marek,
> 
> Hi,
> 
> >> From: Marek Vasut <marex at denx.de>
> >> Sent: vendredi 10 janvier 2020 01:27
> >>
> >> Not all systems have all the boot devices enabled, e.g. not all
> >> systems have MTD devices and thus do not enable UBI. Make all the
> >> boot devices in the distro bootcmd conditional to avoid failures.
> >
> > Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>
> 
> Are you planning to pick those up ?

Applied to u-boot-stm32/master, thanks!

Regards
Patrick
diff mbox series

Patch

diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
index d42a7860be..655833428e 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -98,12 +98,34 @@ 
 
 #if !defined(CONFIG_SPL_BUILD)
 
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 1) \
-	func(UBIFS, ubifs, 0) \
-	func(MMC, mmc, 0) \
-	func(MMC, mmc, 2) \
-	func(PXE, pxe, na)
+#ifdef CONFIG_CMD_MMC
+#define BOOT_TARGET_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_MMC0(func)
+#define BOOT_TARGET_MMC1(func)
+#define BOOT_TARGET_MMC2(func)
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_UBIFS(func)	func(UBIFS, ubifs, 0)
+#else
+#define BOOT_TARGET_UBIFS(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_MMC1(func)		\
+	BOOT_TARGET_UBIFS(func)		\
+	BOOT_TARGET_MMC0(func)		\
+	BOOT_TARGET_MMC2(func)		\
+	BOOT_TARGET_PXE(func)
 
 /*
  * bootcmd for stm32mp1: