Skip to contentSkip to conversation

stm32mp1: configs: Make all boot devices in distro boot conditional

PATCH New Marek Vasut 2 participants 5 messages Dec 18, 2019 – Jan 10, 2020 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stm32mp1: configs: Make all boot devices in distro boot conditional

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
include/configs/stm32mp1.h +28 -6
index d42a7860be..dfc397c63c 100644
@@ -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_DEVICE_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_DEVICE_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_DEVICE_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_DEVICE_MMC0(func)
+#define BOOT_TARGET_DEVICE_MMC1(func)
+#define BOOT_TARGET_DEVICE_MMC2(func)
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_DEVICE_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICE_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func)	func(UBIFS, ubifs, 0)
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_DEVICE_MMC1(func)	\
+	BOOT_TARGET_DEVICE_UBIFS(func)	\
+	BOOT_TARGET_DEVICE_MMC0(func)	\
+	BOOT_TARGET_DEVICE_MMC2(func)	\
+	BOOT_TARGET_DEVICE_PXE(func)
 
 /*
  * bootcmd for stm32mp1:
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 stm32mp1: configs: Make all boot devices in distro boot conditional

Hi Marek,

Quoted 9 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:58
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Patrick DELAUNAY <[email protected]>; Patrice CHOTARD <[email protected]>
Subject: [PATCH] stm32mp1: configs: Make all boot devices in distro boot conditional
Importance: High

Quoted 7 lines

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>

With a minor remark below.

Quoted 36 lines
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
include/configs/stm32mp1.h index renamed from include/configs/stm32mp1.h +0 -0

d42a7860be..dfc397c63c 100644

include/configs/stm32mp1.h +18 -6
@@ -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_DEVICE_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_DEVICE_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_DEVICE_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_DEVICE_MMC0(func)
+#define BOOT_TARGET_DEVICE_MMC1(func)
+#define BOOT_TARGET_DEVICE_MMC2(func)
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_DEVICE_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICE_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func)	func(UBIFS, ubifs, 0)

include/configs/stm32mp1.h line 128

Quoted 10 lines
include/configs/stm32mp1.h +10 -0
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_DEVICE_MMC1(func)	\
+	BOOT_TARGET_DEVICE_UBIFS(func)	\
+	BOOT_TARGET_DEVICE_MMC0(func)	\
+	BOOT_TARGET_DEVICE_MMC2(func)	\
+	BOOT_TARGET_DEVICE_PXE(func)

For other board, the same defines are named BOOT_TARGET_DEVICES_XXXX (with a S at the end of DEVICES)

./include/configs/sunxi-common.h:404:#define BOOT_TARGET_DEVICES(func) \
./include/configs/sunxi-common.h:406: BOOT_TARGET_DEVICES_MMC(func) \
./include/configs/sunxi-common.h:407: BOOT_TARGET_DEVICES_SCSI(func) \
./include/configs/sunxi-common.h:408: BOOT_TARGET_DEVICES_USB(func) \
./include/configs/sunxi-common.h:409: BOOT_TARGET_DEVICES_PXE(func) \
./include/configs/sunxi-common.h:410: BOOT_TARGET_DEVICES_DHCP(func)

Except for ./include/configs/uniphier.h

Any reason to change the name for stm32mp1 ?

Othe exception for rockchip 😊

./include/configs/rockchip-common.h:41:#define BOOT_TARGET_DEVICES(func) \
./include/configs/rockchip-common.h:42: BOOT_TARGET_MMC(func) \
./include/configs/rockchip-common.h:43: BOOT_TARGET_USB(func) \
./include/configs/rockchip-common.h:44: BOOT_TARGET_PXE(func) \
./include/configs/rockchip-common.h:45: BOOT_TARGET_DHCP(func)

If I can choose I prefer the rockchip name (with shorter define name)

Quoted 4 lines
include/configs/stm32mp1.h +0 -1
 /*
  * bootcmd for stm32mp1:
--

2.24.1

Regards

Patrick

#2 lore raw

PATCH 1/1 stm32mp1: configs: Make all boot devices in distro boot conditional

Quoted 1 line · Patrick DELAUNAY

Hi Marek,

Hi,

Quoted 83 lines
Quoted 9 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:58
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Patrick DELAUNAY <[email protected]>; Patrice CHOTARD <[email protected]>
Subject: [PATCH] stm32mp1: configs: Make all boot devices in distro boot conditional
Importance: High

Quoted 7 lines

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>

With a minor remark below.

Quoted 36 lines
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
include/configs/stm32mp1.h index renamed from include/configs/stm32mp1.h +0 -0

d42a7860be..dfc397c63c 100644

include/configs/stm32mp1.h +18 -6
@@ -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_DEVICE_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_DEVICE_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_DEVICE_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_DEVICE_MMC0(func)
+#define BOOT_TARGET_DEVICE_MMC1(func)
+#define BOOT_TARGET_DEVICE_MMC2(func)
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_DEVICE_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICE_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func)	func(UBIFS, ubifs, 0)

include/configs/stm32mp1.h line 128

Quoted 10 lines
include/configs/stm32mp1.h +10 -0
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_DEVICE_MMC1(func)	\
+	BOOT_TARGET_DEVICE_UBIFS(func)	\
+	BOOT_TARGET_DEVICE_MMC0(func)	\
+	BOOT_TARGET_DEVICE_MMC2(func)	\
+	BOOT_TARGET_DEVICE_PXE(func)

For other board, the same defines are named BOOT_TARGET_DEVICES_XXXX (with a S at the end of DEVICES)

./include/configs/sunxi-common.h:404:#define BOOT_TARGET_DEVICES(func) \
./include/configs/sunxi-common.h:406: BOOT_TARGET_DEVICES_MMC(func) \
./include/configs/sunxi-common.h:407: BOOT_TARGET_DEVICES_SCSI(func) \
./include/configs/sunxi-common.h:408: BOOT_TARGET_DEVICES_USB(func) \
./include/configs/sunxi-common.h:409: BOOT_TARGET_DEVICES_PXE(func) \
./include/configs/sunxi-common.h:410: BOOT_TARGET_DEVICES_DHCP(func)

Except for ./include/configs/uniphier.h

Any reason to change the name for stm32mp1 ?

Othe exception for rockchip 😊

Quoted 7 lines

./include/configs/rockchip-common.h:41:#define BOOT_TARGET_DEVICES(func) \
./include/configs/rockchip-common.h:42: BOOT_TARGET_MMC(func) \
./include/configs/rockchip-common.h:43: BOOT_TARGET_USB(func) \
./include/configs/rockchip-common.h:44: BOOT_TARGET_PXE(func) \
./include/configs/rockchip-common.h:45: BOOT_TARGET_DHCP(func)

If I can choose I prefer the rockchip name (with shorter define name)

We can rename the other boards' macros in a separate patch too, so it's the same.

#3 lore raw

PATCH 1/1 stm32mp1: configs: Make all boot devices in distro boot conditional

Hi Marek,

Quoted 104 lines

From: Marek Vasut <[email protected]>
Sent: jeudi 9 janvier 2020 15:27

Quoted 1 line · Patrick DELAUNAY

Hi Marek,

Hi,

Quoted 33 lines
Quoted 9 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:58
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Patrick DELAUNAY <[email protected]>; Patrice CHOTARD <[email protected]>
Subject: [PATCH] stm32mp1: configs: Make all boot devices in distro boot conditional
Importance: High

Quoted 7 lines

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>

With a minor remark below.

Quoted 12 lines
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
include/configs/stm32mp1.h +0 -0
index d42a7860be..dfc397c63c 100644
@@ -98,12 +98,34 @@
 
 #if !defined(CONFIG_SPL_BUILD)
 
Quoted 13 lines

include/configs/stm32mp1.h

Quoted 13 lines
include/configs/stm32mp1.h +7 -6
-#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_DEVICE_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_DEVICE_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_DEVICE_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_DEVICE_MMC0(func) #define
+BOOT_TARGET_DEVICE_MMC1(func) #define

BOOT_TARGET_DEVICE_MMC2(func)

Quoted 12 lines
Quoted 12 lines
include/configs/stm32mp1.h +12 -0
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_DEVICE_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICE_PXE(func) #endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func)	func(UBIFS, ubifs, 0)
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func) #endif
+
Quoted 8 lines

include/configs/stm32mp1.h line 128

Quoted 6 lines
include/configs/stm32mp1.h +6 -0
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_DEVICE_MMC1(func)	\
+	BOOT_TARGET_DEVICE_UBIFS(func)	\
+	BOOT_TARGET_DEVICE_MMC0(func)	\
+	BOOT_TARGET_DEVICE_MMC2(func)	\
+	BOOT_TARGET_DEVICE_PXE(func)

For other board, the same defines are named

BOOT_TARGET_DEVICES_XXXX

Quoted 3 lines

(with a S at the end of DEVICES)

./include/configs/sunxi-common.h:404:#define BOOT_TARGET_DEVICES(func)

\

Quoted 1 line

./include/configs/sunxi-common.h:406:

	BOOT_TARGET_DEVICES_MMC(func) \
Quoted 1 line

./include/configs/sunxi-common.h:407:

	BOOT_TARGET_DEVICES_SCSI(func) \
Quoted 1 line

./include/configs/sunxi-common.h:408:

	BOOT_TARGET_DEVICES_USB(func) \
Quoted 1 line

./include/configs/sunxi-common.h:409:

	BOOT_TARGET_DEVICES_PXE(func) \
Quoted 1 line

./include/configs/sunxi-common.h:410:

BOOT_TARGET_DEVICES_DHCP(func)

Quoted 8 lines

Except for ./include/configs/uniphier.h

Any reason to change the name for stm32mp1 ?

Othe exception for rockchip 😊

./include/configs/rockchip-common.h:41:#define

BOOT_TARGET_DEVICES(func) \

Quoted 5 lines

./include/configs/rockchip-common.h:42: BOOT_TARGET_MMC(func) \
./include/configs/rockchip-common.h:43: BOOT_TARGET_USB(func) \
./include/configs/rockchip-common.h:44: BOOT_TARGET_PXE(func) \
./include/configs/rockchip-common.h:45: BOOT_TARGET_DHCP(func)

Quoted 4 lines
Quoted 1 line

If I can choose I prefer the rockchip name (with shorter define name)

We can rename the other boards' macros in a separate patch too, so it's the same.

Yes

For stm32mp1, you send V2 patch with BOOT_TARGET_XXX name or you plan to align other board to BOOT_TARGET_DEVICES_XXX ?

Thanks
Patrick

#4 lore raw

PATCH 1/1 stm32mp1: configs: Make all boot devices in distro boot conditional

Quoted 108 lines · Patrick DELAUNAY

Hi Marek,

Quoted 106 lines

From: Marek Vasut <[email protected]>
Sent: jeudi 9 janvier 2020 15:27

Quoted 1 line · Patrick DELAUNAY

Hi Marek,

Hi,

Quoted 33 lines
Quoted 9 lines

From: Marek Vasut <[email protected]>
Sent: mercredi 18 décembre 2019 07:58
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Patrick DELAUNAY <[email protected]>; Patrice CHOTARD <[email protected]>
Subject: [PATCH] stm32mp1: configs: Make all boot devices in distro boot conditional
Importance: High

Quoted 7 lines

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.

Cc Patrick Delaunay <[email protected]>
Cc Patrice Chotard <[email protected]>

With a minor remark below.

Quoted 12 lines
---
 include/configs/stm32mp1.h | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
include/configs/stm32mp1.h +0 -0
index d42a7860be..dfc397c63c 100644
@@ -98,12 +98,34 @@
 
 #if !defined(CONFIG_SPL_BUILD)
 
Quoted 13 lines

include/configs/stm32mp1.h

Quoted 13 lines
include/configs/stm32mp1.h +7 -6
-#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_DEVICE_MMC0(func)	func(MMC, mmc, 0)
+#define BOOT_TARGET_DEVICE_MMC1(func)	func(MMC, mmc, 1)
+#define BOOT_TARGET_DEVICE_MMC2(func)	func(MMC, mmc, 2)
+#else
+#define BOOT_TARGET_DEVICE_MMC0(func) #define
+BOOT_TARGET_DEVICE_MMC1(func) #define

BOOT_TARGET_DEVICE_MMC2(func)

Quoted 12 lines
Quoted 12 lines
include/configs/stm32mp1.h +12 -0
+#endif
+
+#ifdef CONFIG_NET
+#define BOOT_TARGET_DEVICE_PXE(func)	func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICE_PXE(func) #endif
+
+#ifdef CONFIG_CMD_UBIFS
+#define BOOT_TARGET_DEVICE_UBIFS(func)	func(UBIFS, ubifs, 0)
+#else
+#define BOOT_TARGET_DEVICE_UBIFS(func) #endif
+
Quoted 8 lines

include/configs/stm32mp1.h line 128

Quoted 6 lines
include/configs/stm32mp1.h +6 -0
+#define BOOT_TARGET_DEVICES(func)	\
+	BOOT_TARGET_DEVICE_MMC1(func)	\
+	BOOT_TARGET_DEVICE_UBIFS(func)	\
+	BOOT_TARGET_DEVICE_MMC0(func)	\
+	BOOT_TARGET_DEVICE_MMC2(func)	\
+	BOOT_TARGET_DEVICE_PXE(func)

For other board, the same defines are named

BOOT_TARGET_DEVICES_XXXX

Quoted 3 lines

(with a S at the end of DEVICES)

./include/configs/sunxi-common.h:404:#define BOOT_TARGET_DEVICES(func)

\

Quoted 1 line

./include/configs/sunxi-common.h:406:

	BOOT_TARGET_DEVICES_MMC(func) \
Quoted 1 line

./include/configs/sunxi-common.h:407:

	BOOT_TARGET_DEVICES_SCSI(func) \
Quoted 1 line

./include/configs/sunxi-common.h:408:

	BOOT_TARGET_DEVICES_USB(func) \
Quoted 1 line

./include/configs/sunxi-common.h:409:

	BOOT_TARGET_DEVICES_PXE(func) \
Quoted 1 line

./include/configs/sunxi-common.h:410:

BOOT_TARGET_DEVICES_DHCP(func)

Quoted 8 lines

Except for ./include/configs/uniphier.h

Any reason to change the name for stm32mp1 ?

Othe exception for rockchip 😊

./include/configs/rockchip-common.h:41:#define

BOOT_TARGET_DEVICES(func) \

Quoted 6 lines

./include/configs/rockchip-common.h:42: BOOT_TARGET_MMC(func) \
./include/configs/rockchip-common.h:43: BOOT_TARGET_USB(func) \
./include/configs/rockchip-common.h:44: BOOT_TARGET_PXE(func) \
./include/configs/rockchip-common.h:45: BOOT_TARGET_DHCP(func)

If I can choose I prefer the rockchip name (with shorter define name)

Quoted 7 lines
Quoted 2 lines

We can rename the other boards' macros in a separate patch too, so it's the same.

Yes

For stm32mp1, you send V2 patch with BOOT_TARGET_XXX name or you plan to align other board to BOOT_TARGET_DEVICES_XXX ?

Done