* [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
@ 2022-07-03 11:28 Heinrich Schuchardt
2022-07-03 12:09 ` Heinrich Schuchardt
2022-07-04 9:50 ` Bin Meng
0 siblings, 2 replies; 7+ messages in thread
From: Heinrich Schuchardt @ 2022-07-03 11:28 UTC (permalink / raw)
To: Bin Meng; +Cc: u-boot, Heinrich Schuchardt
Consider which boot devices are enabled in the definition of the
BOOT_TARGET_DEVICES() macro.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@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)
+# 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>
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-03 11:28 [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO Heinrich Schuchardt
@ 2022-07-03 12:09 ` Heinrich Schuchardt
2022-07-04 9:55 ` Bin Meng
2022-07-04 9:50 ` Bin Meng
1 sibling, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2022-07-03 12:09 UTC (permalink / raw)
To: Bin Meng; +Cc: u-boot
On 7/3/22 13:28, Heinrich Schuchardt wrote:
> Consider which boot devices are enabled in the definition of the
> BOOT_TARGET_DEVICES() macro.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Hello Bin,
With the patch I can run U-Boot
qemu-riscv_smode_defconfig
CONFIG_MTD_NOR_FLASH=n
CONFIG_CMD_NET=n
with QEMU 7.0 using KVM using command
qemu-system-riscv64
-M virt -accel kvm -m 2G -smp 2
-nographic
-kernel u-boot
-device virtio-net-device,netdev=eth0
-netdev user,id=eth0,hostfwd=tcp::8022-:22
-drive file=riscv64.img,format=raw,if=none,id=NVME1
-device nvme,drive=NVME1,serial=nvme-1
and boot Linux from it.
But whenever virtio is accessed by U-Boot QEMU crashes without output.
E.g. after 'virtio scan' even CTRL+A,C is ignored.
Did you have more success? Any clue how to debug this?
Best regards
Heinrich
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-03 12:09 ` Heinrich Schuchardt
@ 2022-07-04 9:55 ` Bin Meng
2022-07-04 11:02 ` Heinrich Schuchardt
0 siblings, 1 reply; 7+ messages in thread
From: Bin Meng @ 2022-07-04 9:55 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: U-Boot Mailing List
Hi Heinrich,
On Sun, Jul 3, 2022 at 8:09 PM Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
>
>
> On 7/3/22 13:28, Heinrich Schuchardt wrote:
> > Consider which boot devices are enabled in the definition of the
> > BOOT_TARGET_DEVICES() macro.
> >
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>
> Hello Bin,
>
> With the patch I can run U-Boot
>
> qemu-riscv_smode_defconfig
> CONFIG_MTD_NOR_FLASH=n
> CONFIG_CMD_NET=n
>
> with QEMU 7.0 using KVM using command
>
> qemu-system-riscv64
> -M virt -accel kvm -m 2G -smp 2
> -nographic
> -kernel u-boot
> -device virtio-net-device,netdev=eth0
> -netdev user,id=eth0,hostfwd=tcp::8022-:22
> -drive file=riscv64.img,format=raw,if=none,id=NVME1
> -device nvme,drive=NVME1,serial=nvme-1
>
> and boot Linux from it.
I see you specifically wanted to run U-Boot with KVM, and it did not
work. If without KVM it boots then it's a problem of KVM/QEMU.
>
> But whenever virtio is accessed by U-Boot QEMU crashes without output.
>
> E.g. after 'virtio scan' even CTRL+A,C is ignored.
>
> Did you have more success? Any clue how to debug this?
>
Which QEMU/KVM (Linux kernel version) did you use for the testing?
Regards,
Bin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-04 9:55 ` Bin Meng
@ 2022-07-04 11:02 ` Heinrich Schuchardt
0 siblings, 0 replies; 7+ messages in thread
From: Heinrich Schuchardt @ 2022-07-04 11:02 UTC (permalink / raw)
To: Bin Meng; +Cc: U-Boot Mailing List
On 7/4/22 11:55, Bin Meng wrote:
> Hi Heinrich,
>
> On Sun, Jul 3, 2022 at 8:09 PM Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>>
>>
>> On 7/3/22 13:28, Heinrich Schuchardt wrote:
>>> Consider which boot devices are enabled in the definition of the
>>> BOOT_TARGET_DEVICES() macro.
>>>
>>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>>
>> Hello Bin,
>>
>> With the patch I can run U-Boot
>>
>> qemu-riscv_smode_defconfig
>> CONFIG_MTD_NOR_FLASH=n
>> CONFIG_CMD_NET=n
>>
>> with QEMU 7.0 using KVM using command
>>
>> qemu-system-riscv64
>> -M virt -accel kvm -m 2G -smp 2
>> -nographic
>> -kernel u-boot
>> -device virtio-net-device,netdev=eth0
>> -netdev user,id=eth0,hostfwd=tcp::8022-:22
>> -drive file=riscv64.img,format=raw,if=none,id=NVME1
>> -device nvme,drive=NVME1,serial=nvme-1
>>
>> and boot Linux from it.
>
> I see you specifically wanted to run U-Boot with KVM, and it did not
> work. If without KVM it boots then it's a problem of KVM/QEMU.
Booting with KVM works if U-Boot does not touch virtio. Linux accessing
virtio does not cause a crash.
So it looks like a U-Boot issue.
I have set CONFIG_MTD_NOR_FLASH=n, CONFIG_CMD_NET=n to avoid touching
virtio before reaching the command prompt.
>
>>
>> But whenever virtio is accessed by U-Boot QEMU crashes without output.
>>
>> E.g. after 'virtio scan' even CTRL+A,C is ignored.
>>
>> Did you have more success? Any clue how to debug this?
>>
>
> Which QEMU/KVM (Linux kernel version) did you use for the testing?
From:
https://launchpad.net/~ubuntu-risc-v-team/+archive/ubuntu/develop/+packages
https://launchpad.net/~ubuntu-risc-v-team/+archive/ubuntu/develop/+files/qemu-system-misc_7.0+dfsg-7ubuntu1~ppa3_riscv64.deb
From:
https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa/+packages
https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa/+files/linux-image-5.17.0-1003-starfive_5.17.0-1003.4_riscv64.deb
Best regards
Heinrich
>
> Regards,
> Bin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-03 11:28 [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO Heinrich Schuchardt
2022-07-03 12:09 ` Heinrich Schuchardt
@ 2022-07-04 9:50 ` Bin Meng
2022-07-04 10:07 ` Heinrich Schuchardt
1 sibling, 1 reply; 7+ messages in thread
From: Bin Meng @ 2022-07-04 9:50 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: U-Boot Mailing List
On Sun, Jul 3, 2022 at 7:28 PM Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> Consider which boot devices are enabled in the definition of the
> BOOT_TARGET_DEVICES() macro.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@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?
> +# 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-04 9:50 ` Bin Meng
@ 2022-07-04 10:07 ` Heinrich Schuchardt
2022-07-04 10:16 ` Bin Meng
0 siblings, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2022-07-04 10:07 UTC (permalink / raw)
To: Bin Meng; +Cc: U-Boot Mailing List
On 7/4/22 11:50, Bin Meng wrote:
> On Sun, Jul 3, 2022 at 7:28 PM Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> Consider which boot devices are enabled in the definition of the
>> BOOT_TARGET_DEVICES() macro.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO
2022-07-04 10:07 ` Heinrich Schuchardt
@ 2022-07-04 10:16 ` Bin Meng
0 siblings, 0 replies; 7+ messages in thread
From: Bin Meng @ 2022-07-04 10:16 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: U-Boot Mailing List
On Mon, Jul 4, 2022 at 6:07 PM Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> On 7/4/22 11:50, Bin Meng wrote:
> > On Sun, Jul 3, 2022 at 7:28 PM Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> >>
> >> Consider which boot devices are enabled in the definition of the
> >> BOOT_TARGET_DEVICES() macro.
> >>
> >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@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.
>
Yes, I think that's a better approach.
Regards,
Bin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-04 11:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-03 11:28 [PATCH 1/1] riscv: allow building w/o DHCP, SCSI, VIRTIO Heinrich Schuchardt
2022-07-03 12:09 ` Heinrich Schuchardt
2022-07-04 9:55 ` Bin Meng
2022-07-04 11:02 ` Heinrich Schuchardt
2022-07-04 9:50 ` Bin Meng
2022-07-04 10:07 ` Heinrich Schuchardt
2022-07-04 10:16 ` Bin Meng
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.