On 7/4/22 11:50, Bin Meng wrote:
On Sun, Jul 3, 2022 at 7:28 PM Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:

Consider which boot devices are enabled in the definition of the
BOOT_TARGET_DEVICES() macro.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
  include/configs/qemu-riscv.h | 25 ++++++++++++++++++++++---
  1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index f462895fb5..427da69d3f 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -33,11 +33,30 @@
  /* Environment options */

  #ifndef CONFIG_SPL_BUILD
+
+#if defined(CONFIG_CMD_DHCP)
+#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define BOOT_TARGET_DEVICES_DHCP(func)
+#endif
+
+#if defined(CONFIG_SCSI)

For consistency, maybe CONFIG_CMD_SCSI?

The situation is quite messy:

./include/config_distro_bootcmd.h uses
#ifdef CONFIG_SCSI

CONFIG_CMD_SCSI does not depend on CONFIG_SCSI.

Probably the best thing to do is:

Let CONFIG_CMD_SCSI depend on CONFIG_SCSI.
Change config_distro_bootcmd.h to use CONFIG_CMD_SCSI.
Change this patch to use CONFIG_CMD_SCSI.

Best regards

Heinrich


+# define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
+#else
+# define BOOT_TARGET_DEVICES_SCSI(func)
+#endif
+
+#if defined(CONFIG_CMD_VIRTIO)
+# define BOOT_TARGET_DEVICES_VIRTIO(func) func(VIRTIO, virtio, 0)
+#else
+# define BOOT_TARGET_DEVICES_VIRTIO(func)
+#endif
+
  #define BOOT_TARGET_DEVICES(func) \
         func(QEMU, qemu, na) \
-       func(VIRTIO, virtio, 0) \
-       func(SCSI, scsi, 0) \
-       func(DHCP, dhcp, na)
+       BOOT_TARGET_DEVICES_VIRTIO(func) \
+       BOOT_TARGET_DEVICES_SCSI(func) \
+       BOOT_TARGET_DEVICES_DHCP(func)

  #include <config_distro_bootcmd.h>


Regards,
Bin

Reply via email to