On 18 October 2026 09:35:14 BST, Josef Schlehofer
<[email protected]> wrote:
>A Turris 1.x configuration without CONFIG_NVME or CONFIG_SCSI does not
>build. The NVMe and SCSI distroboot targets are listed unconditionally,
>and config_distro_bootcmd.h turns a target whose support is disabled
>into a build error such as:
>
>  error: expected '}' before
>  'BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME'
>
>List the NVMe target only when CONFIG_NVME is enabled and the SCSI
>target only when CONFIG_SCSI is enabled, so that the NOR build can drop
>NVMe and SCSI to make room for the ubi command. Both defconfigs enable
>NVMe and SCSI, so nothing changes yet.
>
>Signed-off-by: Josef Schlehofer <[email protected]>

Reviewed-by: Bradley Morgan <[email protected]>


>Reviewed-by: Marek Mojík <[email protected]>
>Cc: Marek Mojík <[email protected]>
>---
>(no changes since v1)
>
>u-boot.bin of turris_1x_nor and turris_1x_sdcard has the same size and
>md5 before and after this patch (Debian GCC 14.2).
>---
> include/configs/turris_1x.h | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
>diff --git a/include/configs/turris_1x.h b/include/configs/turris_1x.h
>index c05614950c7..3a2818d1904 100644
>--- a/include/configs/turris_1x.h
>+++ b/include/configs/turris_1x.h
>@@ -71,6 +71,18 @@
>  *         define CONFIG_SPL_MAX_SIZE = CONFIG_SYS_L2_SIZE
>  */
> 
>+#ifdef CONFIG_NVME
>+#define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
>+#else
>+#define BOOT_TARGET_NVME(func)
>+#endif
>+
>+#ifdef CONFIG_SCSI
>+#define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
>+#else
>+#define BOOT_TARGET_SCSI(func)
>+#endif
>+
> #ifdef CONFIG_SDCARD
> #define CFG_SYS_MMC_U_BOOT_SIZE       CONFIG_BOARD_SIZE_LIMIT
> #define CFG_SYS_MMC_U_BOOT_DST        CONFIG_TEXT_BASE
>@@ -266,8 +278,8 @@
> #ifdef CONFIG_SDCARD
> #define BOOT_TARGET_DEVICES(func) \
>       func(MMC, mmc, 0) \
>-      func(NVME, nvme, 0) \
>-      func(SCSI, scsi, 0) \
>+      BOOT_TARGET_NVME(func) \
>+      BOOT_TARGET_SCSI(func) \
>       func(USB, usb, 0) \
>       func(USB, usb, 1) \
>       func(USB, usb, 2) \
>@@ -279,8 +291,8 @@
> #else
> #define BOOT_TARGET_DEVICES(func) \
>       func(MMC, mmc, 0) \
>-      func(NVME, nvme, 0) \
>-      func(SCSI, scsi, 0) \
>+      BOOT_TARGET_NVME(func) \
>+      BOOT_TARGET_SCSI(func) \
>       func(USB, usb, 0) \
>       func(USB, usb, 1) \
>       func(USB, usb, 2) \
>

--- Thanks!
"I'm not a very positive person" - Linus torvalds

Reply via email to