diff mbox series

[isar-cip-core,v3,6/9] enhance qemu-riscv64 machine to be testable

Message ID 20230302152659.2096307-7-felix.moessbauer@siemens.com (mailing list archive)
State Superseded
Headers show
Series Add swupdate support for riscv64 | expand

Commit Message

Felix Moessbauer March 2, 2023, 3:26 p.m. UTC
This patch enhances the qemu-riscv64 machine by adding a reference to
u-boot. Further, we now use the qemu_riscv64 defconfig from
cip-kernel-config.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 conf/machine/qemu-riscv64.conf | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Jan Kiszka March 3, 2023, 7:13 a.m. UTC | #1
On 02.03.23 16:26, Felix Moessbauer wrote:
> This patch enhances the qemu-riscv64 machine by adding a reference to
> u-boot. Further, we now use the qemu_riscv64 defconfig from
> cip-kernel-config.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  conf/machine/qemu-riscv64.conf | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/conf/machine/qemu-riscv64.conf b/conf/machine/qemu-riscv64.conf
> index f1f3e87..8c1764b 100644
> --- a/conf/machine/qemu-riscv64.conf
> +++ b/conf/machine/qemu-riscv64.conf
> @@ -12,4 +12,11 @@
>  DISTRO_ARCH = "riscv64"
>  
>  IMAGE_FSTYPES ?= "ext4"
> -KERNEL_DEFCONFIG ?= "defconfig"
> +USE_CIP_KERNEL_CONFIG = "1"
> +
> +KERNEL_DEFCONFIG ?= "cip-kernel-config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig"
> +
> +# for SWUpdate setups: watchdog is configured in U-Boot

Is that true for qemu, or is that just a copy-and-paste statement?

> +WDOG_TIMEOUT = "0"
> +
> +PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-qemu-riscv64"

Jan
Felix Moessbauer March 3, 2023, 8:35 a.m. UTC | #2
On Fri, 2023-03-03 at 08:13 +0100, Jan Kiszka wrote:
> On 02.03.23 16:26, Felix Moessbauer wrote:
> > This patch enhances the qemu-riscv64 machine by adding a reference
> > to
> > u-boot. Further, we now use the qemu_riscv64 defconfig from
> > cip-kernel-config.
> > 
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> >  conf/machine/qemu-riscv64.conf | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/conf/machine/qemu-riscv64.conf b/conf/machine/qemu-
> > riscv64.conf
> > index f1f3e87..8c1764b 100644
> > --- a/conf/machine/qemu-riscv64.conf
> > +++ b/conf/machine/qemu-riscv64.conf
> > @@ -12,4 +12,11 @@
> >  DISTRO_ARCH = "riscv64"
> >  
> >  IMAGE_FSTYPES ?= "ext4"
> > -KERNEL_DEFCONFIG ?= "defconfig"
> > +USE_CIP_KERNEL_CONFIG = "1"
> > +
> > +KERNEL_DEFCONFIG ?= "cip-kernel-
> > config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig"
> > +
> > +# for SWUpdate setups: watchdog is configured in U-Boot
> 
> Is that true for qemu, or is that just a copy-and-paste statement?

Actually, I just copied that from the arm64 example. But having a
second look at the code, makes me think that it is also wrong there:

- the u-boot option CONFIG_HW_WATCHDOG is not set
- the start-qemu.sh script does not setup any watchdog in QEMU

In short: It works, because we don't have a watchdog and nobody enables
it.

But I'm not an expert in this domain. Maybe Quirin can briefly comment
on the intention of the original code.

Felix

> 
> > +WDOG_TIMEOUT = "0"
> > +
> > +PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-qemu-riscv64"
> 
> Jan
>
Jan Kiszka March 3, 2023, 8:45 a.m. UTC | #3
On 03.03.23 09:35, Moessbauer, Felix (T CED INW-CN) wrote:
> On Fri, 2023-03-03 at 08:13 +0100, Jan Kiszka wrote:
>> On 02.03.23 16:26, Felix Moessbauer wrote:
>>> This patch enhances the qemu-riscv64 machine by adding a reference
>>> to
>>> u-boot. Further, we now use the qemu_riscv64 defconfig from
>>> cip-kernel-config.
>>>
>>> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
>>> ---
>>>  conf/machine/qemu-riscv64.conf | 9 ++++++++-
>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/conf/machine/qemu-riscv64.conf b/conf/machine/qemu-
>>> riscv64.conf
>>> index f1f3e87..8c1764b 100644
>>> --- a/conf/machine/qemu-riscv64.conf
>>> +++ b/conf/machine/qemu-riscv64.conf
>>> @@ -12,4 +12,11 @@
>>>  DISTRO_ARCH = "riscv64"
>>>
>>>  IMAGE_FSTYPES ?= "ext4"
>>> -KERNEL_DEFCONFIG ?= "defconfig"
>>> +USE_CIP_KERNEL_CONFIG = "1"
>>> +
>>> +KERNEL_DEFCONFIG ?= "cip-kernel-
>>> config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig"
>>> +
>>> +# for SWUpdate setups: watchdog is configured in U-Boot
>>
>> Is that true for qemu, or is that just a copy-and-paste statement?
> 
> Actually, I just copied that from the arm64 example. But having a
> second look at the code, makes me think that it is also wrong there:
> 
> - the u-boot option CONFIG_HW_WATCHDOG is not set
> - the start-qemu.sh script does not setup any watchdog in QEMU

Ah, I recall. There was a plan to have one, but it was shot down because
I was not motivated to add that exotic watchdog driver to U-Boot:
https://mail.gnu.org/archive/html/qemu-arm/2022-05/msg00154.html

Jan
Felix Moessbauer March 3, 2023, 8:51 a.m. UTC | #4
On Fri, 2023-03-03 at 09:45 +0100, Jan Kiszka wrote:
> On 03.03.23 09:35, Moessbauer, Felix (T CED INW-CN) wrote:
> > On Fri, 2023-03-03 at 08:13 +0100, Jan Kiszka wrote:
> > > On 02.03.23 16:26, Felix Moessbauer wrote:
> > > > This patch enhances the qemu-riscv64 machine by adding a
> > > > reference
> > > > to
> > > > u-boot. Further, we now use the qemu_riscv64 defconfig from
> > > > cip-kernel-config.
> > > > 
> > > > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > > > ---
> > > >  conf/machine/qemu-riscv64.conf | 9 ++++++++-
> > > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/conf/machine/qemu-riscv64.conf
> > > > b/conf/machine/qemu-
> > > > riscv64.conf
> > > > index f1f3e87..8c1764b 100644
> > > > --- a/conf/machine/qemu-riscv64.conf
> > > > +++ b/conf/machine/qemu-riscv64.conf
> > > > @@ -12,4 +12,11 @@
> > > >  DISTRO_ARCH = "riscv64"
> > > > 
> > > >  IMAGE_FSTYPES ?= "ext4"
> > > > -KERNEL_DEFCONFIG ?= "defconfig"
> > > > +USE_CIP_KERNEL_CONFIG = "1"
> > > > +
> > > > +KERNEL_DEFCONFIG ?= "cip-kernel-
> > > > config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig
> > > > "
> > > > +
> > > > +# for SWUpdate setups: watchdog is configured in U-Boot
> > > 
> > > Is that true for qemu, or is that just a copy-and-paste
> > > statement?
> > 
> > Actually, I just copied that from the arm64 example. But having a
> > second look at the code, makes me think that it is also wrong
> > there:
> > 
> > - the u-boot option CONFIG_HW_WATCHDOG is not set
> > - the start-qemu.sh script does not setup any watchdog in QEMU
> 
> Ah, I recall. There was a plan to have one, but it was shot down
> because
> I was not motivated to add that exotic watchdog driver to U-Boot:
> https://mail.gnu.org/archive/html/qemu-arm/2022-05/msg00154.html

Thanks for the notice. How shall we proceed?
I vote for keeping WDOG_TIMEOUT=0 but changing the comment to something
like that:

"Watchdog is not yet supported in our QEMU executor for this platform,
disable it".

Felix

> 
> Jan
>
Jan Kiszka March 3, 2023, 8:55 a.m. UTC | #5
On 03.03.23 09:51, Moessbauer, Felix (T CED INW-CN) wrote:
> On Fri, 2023-03-03 at 09:45 +0100, Jan Kiszka wrote:
>> On 03.03.23 09:35, Moessbauer, Felix (T CED INW-CN) wrote:
>>> On Fri, 2023-03-03 at 08:13 +0100, Jan Kiszka wrote:
>>>> On 02.03.23 16:26, Felix Moessbauer wrote:
>>>>> This patch enhances the qemu-riscv64 machine by adding a
>>>>> reference
>>>>> to
>>>>> u-boot. Further, we now use the qemu_riscv64 defconfig from
>>>>> cip-kernel-config.
>>>>>
>>>>> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
>>>>> ---
>>>>>  conf/machine/qemu-riscv64.conf | 9 ++++++++-
>>>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/conf/machine/qemu-riscv64.conf
>>>>> b/conf/machine/qemu-
>>>>> riscv64.conf
>>>>> index f1f3e87..8c1764b 100644
>>>>> --- a/conf/machine/qemu-riscv64.conf
>>>>> +++ b/conf/machine/qemu-riscv64.conf
>>>>> @@ -12,4 +12,11 @@
>>>>>  DISTRO_ARCH = "riscv64"
>>>>>
>>>>>  IMAGE_FSTYPES ?= "ext4"
>>>>> -KERNEL_DEFCONFIG ?= "defconfig"
>>>>> +USE_CIP_KERNEL_CONFIG = "1"
>>>>> +
>>>>> +KERNEL_DEFCONFIG ?= "cip-kernel-
>>>>> config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig
>>>>> "
>>>>> +
>>>>> +# for SWUpdate setups: watchdog is configured in U-Boot
>>>>
>>>> Is that true for qemu, or is that just a copy-and-paste
>>>> statement?
>>>
>>> Actually, I just copied that from the arm64 example. But having a
>>> second look at the code, makes me think that it is also wrong
>>> there:
>>>
>>> - the u-boot option CONFIG_HW_WATCHDOG is not set
>>> - the start-qemu.sh script does not setup any watchdog in QEMU
>>
>> Ah, I recall. There was a plan to have one, but it was shot down
>> because
>> I was not motivated to add that exotic watchdog driver to U-Boot:
>> https://mail.gnu.org/archive/html/qemu-arm/2022-05/msg00154.html
> 
> Thanks for the notice. How shall we proceed?
> I vote for keeping WDOG_TIMEOUT=0 but changing the comment to something
> like that:
> 
> "Watchdog is not yet supported in our QEMU executor for this platform,
> disable it".

Fine with me.

Given that qemu-riscv64 would be the second "board" to benefit from a
i6300esb driver in U-Boot, it might be worth looking into eventually.
Provided both qemu-riscv64 and qemu-arm* can have PCI support as well in
U-Boot. But not a topic for this series, for sure.

Jan
diff mbox series

Patch

diff --git a/conf/machine/qemu-riscv64.conf b/conf/machine/qemu-riscv64.conf
index f1f3e87..8c1764b 100644
--- a/conf/machine/qemu-riscv64.conf
+++ b/conf/machine/qemu-riscv64.conf
@@ -12,4 +12,11 @@ 
 DISTRO_ARCH = "riscv64"
 
 IMAGE_FSTYPES ?= "ext4"
-KERNEL_DEFCONFIG ?= "defconfig"
+USE_CIP_KERNEL_CONFIG = "1"
+
+KERNEL_DEFCONFIG ?= "cip-kernel-config/${KERNEL_DEFCONFIG_VERSION}/riscv/qemu_riscv64_defconfig"
+
+# for SWUpdate setups: watchdog is configured in U-Boot
+WDOG_TIMEOUT = "0"
+
+PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-qemu-riscv64"