diff mbox series

[1/5] configs/nezha_defconfig: bump versions for uboot, sbi and linux kernel

Message ID 20221211201704.25858-1-indrek.kruusa@gmail.com
State Superseded
Headers show
Series [1/5] configs/nezha_defconfig: bump versions for uboot, sbi and linux kernel | expand

Commit Message

Indrek Kruusa Dec. 11, 2022, 8:17 p.m. UTC
kernel: bump to version 6.1.0-rc3 in d1/wip branch
u-boot: use the version with full SPL support from d1-wip branch
opensbi: take in the latest fixes from d1-wip branch

Other:
remove patches directory definition as no patches are needed anymore
update linux headers version
update binary name as the new uboot generates it

Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>
---
 configs/nezha_defconfig | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Thomas Petazzoni Dec. 11, 2022, 9:47 p.m. UTC | #1
On Sun, 11 Dec 2022 22:17:00 +0200
Indrek Kruusa <indrek.kruusa@gmail.com> wrote:

> kernel: bump to version 6.1.0-rc3 in d1/wip branch
> u-boot: use the version with full SPL support from d1-wip branch
> opensbi: take in the latest fixes from d1-wip branch
> 
> Other:
> remove patches directory definition as no patches are needed anymore
> update linux headers version
> update binary name as the new uboot generates it
> 
> Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>
> ---
>  configs/nezha_defconfig | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Thanks for this patch series, however PATCH 3/5 has apparently not made
its way to the mailing list. Could you double-check?

Thanks!

Thomas
Peter Korsgaard Dec. 12, 2022, 7:22 a.m. UTC | #2
>>>>> "Indrek" == Indrek Kruusa <indrek.kruusa@gmail.com> writes:

 > kernel: bump to version 6.1.0-rc3 in d1/wip branch
 > u-boot: use the version with full SPL support from d1-wip branch
 > opensbi: take in the latest fixes from d1-wip branch

 > Other:
 > remove patches directory definition as no patches are needed anymore
 > update linux headers version
 > update binary name as the new uboot generates it

Thanks. Funny enough I was just working on doing pretty much the same
thing here. I've CC'ed you on the patch series I just sent.

This patch does a bunch of different things, but it doesn't do enough -
E.G. it doesn't update genimage.cfg so the build is broken after this
commit - So that is not good. Maybe have a look at my series where I
update each component (U-Boot/OpenSBI/Linux) separately.

 > Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>

 > @@ -17,14 +16,14 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 >  # BR2_TARGET_ROOTFS_TAR is not set
 >  BR2_TARGET_OPENSBI=y
 >  BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
 > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
 > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"

Why still use this custom opensbi? There is D1 support in version 1.1 as
mentioned on https://linux-sunxi.org/Allwinner_Nezha


 >  BR2_TARGET_OPENSBI_PLAT="generic"
 >  # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 >  BR2_TARGET_SUN20I_D1_SPL=y

You are still enabling the old sun20i-d1-spl even though you change to
use U-Boot SPL?
Frank Hunleth Dec. 12, 2022, 3:32 p.m. UTC | #3
> >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
> 
> > BR2_TARGET_OPENSBI=y
> 
> > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
> 
> > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
> 
> > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
> 
> 
> Why still use this custom opensbi? There is D1 support in version 1.1 as
> mentioned on https://linux-sunxi.org/Allwinner_Nezha
> 

Just in case it helps, I've been testing both the Korsgaard and Kruusa patches on a MangoPI MQ Pro. This board is close, but not exactly like the Nezha, so I expect differences.

Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's the error:

```
Unhandled exception: Store/AMO access fault
EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted

Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
```

If I use riscv-software-src/opensbi master, Linux boots again. From my point of view, the Linux Sunxi wiki is correct that forks don't need to be used, but something appears to have been fixed after 1.1.

As a second note, I added the following based on the Sunxi wiki:

BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="FW_PIC=y"

It's not clear to me that it makes a difference.

It doesn't seem right for me to add a Tested-By to the patch series since I have a different board. However, the Linux 6.1.0-rc3 update and U-Boot updates appear to be working well in my testing so far. My setup is closer to the Korsgaard patch set since I'm not using the HDMI output change. The OpenSBI issue with 1.1 is the only snag I hit.

Thank you both for your Nezha updates.

-Frank
Indrek Kruusa Dec. 12, 2022, 4:52 p.m. UTC | #4
Kontakt Frank Hunleth (<fhunleth@troodon-software.com>) kirjutas kuupäeval
E, 12. detsember 2022 kell 17:32:

> > >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
> >
> > > BR2_TARGET_OPENSBI=y
> >
> > > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
> >
> > > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
> github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
> >
> > > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
> github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
> >
> >
> > Why still use this custom opensbi? There is D1 support in version 1.1 as
> > mentioned on https://linux-sunxi.org/Allwinner_Nezha
> >


Ahh, I didn't catch that one. Very nice, will check!


>
>
> Just in case it helps, I've been testing both the Korsgaard and Kruusa
> patches on a MangoPI MQ Pro. This board is close, but not exactly like the
> Nezha, so I expect differences.
>

Nice, then we can prepare support for more boards and test it properly :)
Actually I did my "it boots" testing on Lichee dock. Also known as Lichee
RV dock. The naming of this carrier board or SOM combo is a mess. The
official product is just Lichee dock AFAIK. But none is calling it like
that. Anyway, I can help to prepare support for this board also.

@Angelo Compagnucci <angelo@amarulasolutions.com> , any chance you could
update your Lichee RV patches to the latest "known" goodies? :)



>
> Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's the
> error:
>
> ```
> Unhandled exception: Store/AMO access fault
> EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
> EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted
>
> Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
> ```
>
> If I use riscv-software-src/opensbi master, Linux boots again. From my
> point of view, the Linux Sunxi wiki is correct that forks don't need to be
> used, but something appears to have been fixed after 1.1.
>
> As a second note, I added the following based on the Sunxi wiki:
>
> BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="FW_PIC=y"
>
> It's not clear to me that it makes a difference.
>
> It doesn't seem right for me to add a Tested-By to the patch series since
> I have a different board. However, the Linux 6.1.0-rc3 update and U-Boot
> updates appear to be working well in my testing so far. My setup is closer
> to the Korsgaard patch set since I'm not using the HDMI output change. The
> OpenSBI issue with 1.1 is the only snag I hit.
>
> Thank you both for your Nezha updates.
>
> -Frank
>
>
Angelo Compagnucci Dec. 12, 2022, 4:54 p.m. UTC | #5
On Mon, Dec 12, 2022 at 5:52 PM Indrek Kruusa <indrek.kruusa@gmail.com>
wrote:

> Kontakt Frank Hunleth (<fhunleth@troodon-software.com>) kirjutas
> kuupäeval E, 12. detsember 2022 kell 17:32:
>
>> > >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
>> >
>> > > BR2_TARGET_OPENSBI=y
>> >
>> > > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
>> >
>> > > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>> github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
>> >
>> > > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>> github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
>> >
>> >
>> > Why still use this custom opensbi? There is D1 support in version 1.1 as
>> > mentioned on https://linux-sunxi.org/Allwinner_Nezha
>> >
>
>
> Ahh, I didn't catch that one. Very nice, will check!
>
>
>>
>>
>> Just in case it helps, I've been testing both the Korsgaard and Kruusa
>> patches on a MangoPI MQ Pro. This board is close, but not exactly like the
>> Nezha, so I expect differences.
>>
>
> Nice, then we can prepare support for more boards and test it properly :)
> Actually I did my "it boots" testing on Lichee dock. Also known as Lichee
> RV dock. The naming of this carrier board or SOM combo is a mess. The
> official product is just Lichee dock AFAIK. But none is calling it like
> that. Anyway, I can help to prepare support for this board also.
>
> @Angelo Compagnucci <angelo@amarulasolutions.com> , any chance you could
> update your Lichee RV patches to the latest "known" goodies? :)
>

Got a bad flu, I'll try to work on them ASAP.


>
>
>
>>
>> Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's
>> the error:
>>
>> ```
>> Unhandled exception: Store/AMO access fault
>> EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
>> EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted
>>
>> Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
>> ```
>>
>> If I use riscv-software-src/opensbi master, Linux boots again. From my
>> point of view, the Linux Sunxi wiki is correct that forks don't need to be
>> used, but something appears to have been fixed after 1.1.
>>
>> As a second note, I added the following based on the Sunxi wiki:
>>
>> BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="FW_PIC=y"
>>
>> It's not clear to me that it makes a difference.
>>
>> It doesn't seem right for me to add a Tested-By to the patch series since
>> I have a different board. However, the Linux 6.1.0-rc3 update and U-Boot
>> updates appear to be working well in my testing so far. My setup is closer
>> to the Korsgaard patch set since I'm not using the HDMI output change. The
>> OpenSBI issue with 1.1 is the only snag I hit.
>>
>> Thank you both for your Nezha updates.
>>
>> -Frank
>>
>>
Indrek Kruusa Dec. 12, 2022, 5:02 p.m. UTC | #6
Kontakt Angelo Compagnucci (<angelo@amarulasolutions.com>) kirjutas
kuupäeval E, 12. detsember 2022 kell 18:55:

>
>
> On Mon, Dec 12, 2022 at 5:52 PM Indrek Kruusa <indrek.kruusa@gmail.com>
> wrote:
>
>> Kontakt Frank Hunleth (<fhunleth@troodon-software.com>) kirjutas
>> kuupäeval E, 12. detsember 2022 kell 17:32:
>>
>>> > >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
>>> >
>>> > > BR2_TARGET_OPENSBI=y
>>> >
>>> > > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
>>> >
>>> > > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>>> github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
>>> >
>>> > > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>>> github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
>>> >
>>> >
>>> > Why still use this custom opensbi? There is D1 support in version 1.1
>>> as
>>> > mentioned on https://linux-sunxi.org/Allwinner_Nezha
>>> >
>>
>>
>> Ahh, I didn't catch that one. Very nice, will check!
>>
>>
>>>
>>>
>>> Just in case it helps, I've been testing both the Korsgaard and Kruusa
>>> patches on a MangoPI MQ Pro. This board is close, but not exactly like the
>>> Nezha, so I expect differences.
>>>
>>
>> Nice, then we can prepare support for more boards and test it properly :)
>> Actually I did my "it boots" testing on Lichee dock. Also known as Lichee
>> RV dock. The naming of this carrier board or SOM combo is a mess. The
>> official product is just Lichee dock AFAIK. But none is calling it like
>> that. Anyway, I can help to prepare support for this board also.
>>
>> @Angelo Compagnucci <angelo@amarulasolutions.com> , any chance you could
>> update your Lichee RV patches to the latest "known" goodies? :)
>>
>
> Got a bad flu, I'll try to work on them ASAP.
>

Oh, get well soon!


>
>
>>
>>
>>
>>>
>>> Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's
>>> the error:
>>>
>>> ```
>>> Unhandled exception: Store/AMO access fault
>>> EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
>>> EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted
>>>
>>> Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
>>> ```
>>>
>>> If I use riscv-software-src/opensbi master, Linux boots again. From my
>>> point of view, the Linux Sunxi wiki is correct that forks don't need to be
>>> used, but something appears to have been fixed after 1.1.
>>>
>>> As a second note, I added the following based on the Sunxi wiki:
>>>
>>> BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="FW_PIC=y"
>>>
>>> It's not clear to me that it makes a difference.
>>>
>>> It doesn't seem right for me to add a Tested-By to the patch series
>>> since I have a different board. However, the Linux 6.1.0-rc3 update and
>>> U-Boot updates appear to be working well in my testing so far. My setup is
>>> closer to the Korsgaard patch set since I'm not using the HDMI output
>>> change. The OpenSBI issue with 1.1 is the only snag I hit.
>>>
>>> Thank you both for your Nezha updates.
>>>
>>> -Frank
>>>
>>>
>
> --
>
> Angelo Compagnucci
>
> Software Engineer
>
> angelo@amarulasolutions.com
> __________________________________
> Amarula Solutions SRL
>
> Via le Canevare 30, 31100 Treviso, Veneto, IT
>
> T. +39 (0)42 243 5310
> info@amarulasolutions.com
>
> www.amarulasolutions.com
> [`as] https://www.amarulasolutions.com|
>
Peter Korsgaard Dec. 12, 2022, 5:56 p.m. UTC | #7
>>>>> "Frank" == Frank Hunleth <fhunleth@troodon-software.com> writes:

Hi,

 >> >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
 >> 
 >> > BR2_TARGET_OPENSBI=y
 >> 
 >> > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
 >> 
 >> > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
 >> > github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
 >> 
 >> > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
 >> > github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
 >> 
 >> 
 >> Why still use this custom opensbi? There is D1 support in version 1.1 as
 >> mentioned on https://linux-sunxi.org/Allwinner_Nezha
 >> 

 > Just in case it helps, I've been testing both the Korsgaard and Kruusa
 > patches on a MangoPI MQ Pro. This board is close, but not exactly like
 > the Nezha, so I expect differences.

 > Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's the error:

Just to be sure, is this with the 5.19 based kernel we used to use
(fe178cf0153d98b71cb01a46c8cc050826a17e77) or the "new" 6.1-rc3 based
one (ca67838d84af4c9f85d06311c9e98e1adf46308f)?


 > Unhandled exception: Store/AMO access fault
 > EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
 > EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted

 > Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)

Sounds like access to an invalid address to me. When does this trigger?
Early doing Linux boot?

I see the mangopi mq-pro only has 512MB RAM. 0x5xxx.xxxx is at the very
end of that (memory starts at 0x4xxx.xxxx), did you update the memory
size in the device tree passed to OpenSBI?

I just did a clean rebuild of nezha_defconfig here, and it boots without
any issues:

U-Boot SPL 2022.10 (Dec 12 2022 - 17:20:45 +0100)
sunxi_ram_probe: dram-controller@3102000: probing
DRAM only have internal ZQ!!
ddr_efuse_type: 0x0
[AUTO DEBUG] two rank and full DQ!
ddr_efuse_type: 0x0
[AUTO DEBUG] rank 0 row = 15
[AUTO DEBUG] rank 0 bank = 8
[AUTO DEBUG] rank 0 page size = 2 KB
[AUTO DEBUG] rank 1 row = 15
[AUTO DEBUG] rank 1 bank = 8
[AUTO DEBUG] rank 1 page size = 2 KB
rank1 config same as rank0
DRAM BOOT DRIVE INFO: V0.24
DRAM CLK = 792 MHz
DRAM Type = 3 (2:DDR2,3:DDR3)
DRAMC ZQ value: 0x7b7bfb
DRAM ODT value: 0x42.
ddr_efuse_type: 0x0
DRAM SIZE =1024 M
DRAM simple test OK.
mxstatus=0xc0408000 mhcr=0x00000109 mcor=0x00000003 mhint=0x00004000
Trying to boot from MMC1
PLL reg = 0xf8216300, freq = 1200000000
SPL size = 81920, sector = 160
sunxi_ram_get_info: dram-controller@3102000: getting info

OpenSBI v1.1
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Allwinner D1 Nezha
Platform Features         : medeleg
Platform HART Count       : 1
Platform IPI Device       : ---
Platform Timer Device     : --- @ 0Hz
Platform Console Device   : uart8250
Platform HSM Device       : sun20i-d1-ppu
Platform Reboot Device    : sunxi-wdt-reset
Platform Shutdown Device  : ---
Firmware Base             : 0x40000000
Firmware Size             : 288 KB
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000040000000-0x000000004007ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000042e00000
Domain0 Next Arg1         : 0x0000000042e8b978
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcvx
Boot HART ISA Extensions  : time
Boot HART PMP Count       : 8
Boot HART PMP Granularity : 2048
Boot HART PMP Address Bits: 38
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109
sunxi_set_gate: (CLK#24) unhandled


U-Boot 2022.10 (Dec 12 2022 - 17:20:45 +0100) Allwinner Technology

..

Starting kernel ...

[    0.000000] Linux version 6.1.0-rc3 (peko@dell) (riscv64-buildroot-linux-gnu-gcc.br_real (Buildroot 2022.11-477-g5cb74c92f7) 11.3.0, GNU ld (GNU Binutils) 2.38) #1 PREEMPT Mon Dec 12 17:28:21 CET 2022

..

# uptime
 00:07:05 up 6 min,  load average: 0.00, 0.00, 0.00
Indrek Kruusa Dec. 13, 2022, 8:09 p.m. UTC | #8
Kontakt Peter Korsgaard (<peter@korsgaard.com>) kirjutas kuupäeval E, 12.
detsember 2022 kell 19:56:

> >>>>> "Frank" == Frank Hunleth <fhunleth@troodon-software.com> writes:
>
> Hi,
>
>  >> >>>>> "Indrek" == Indrek Kruusa indrek.kruusa@gmail.com writes:
>  >>
>  >> > BR2_TARGET_OPENSBI=y
>  >>
>  >> > BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
>  >>
>  >> > -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>  >> >
> github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
>  >>
>  >> > +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call
>  >> >
> github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
>  >>
>  >>
>  >> Why still use this custom opensbi? There is D1 support in version 1.1
> as
>  >> mentioned on https://linux-sunxi.org/Allwinner_Nezha
>  >>
>
>  > Just in case it helps, I've been testing both the Korsgaard and Kruusa
>  > patches on a MangoPI MQ Pro. This board is close, but not exactly like
>  > the Nezha, so I expect differences.
>
>  > Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's
> the error:
>
> Just to be sure, is this with the 5.19 based kernel we used to use
> (fe178cf0153d98b71cb01a46c8cc050826a17e77) or the "new" 6.1-rc3 based
> one (ca67838d84af4c9f85d06311c9e98e1adf46308f)?
>
>
>  > Unhandled exception: Store/AMO access fault
>  > EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
>  > EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted
>
>  > Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
>
> Sounds like access to an invalid address to me. When does this trigger?
> Early doing Linux boot?
>
> I see the mangopi mq-pro only has 512MB RAM. 0x5xxx.xxxx is at the very
> end of that (memory starts at 0x4xxx.xxxx), did you update the memory
> size in the device tree passed to OpenSBI?
>
> I just did a clean rebuild of nezha_defconfig here, and it boots without
> any issues:
>
> U-Boot SPL 2022.10 (Dec 12 2022 - 17:20:45 +0100)
> sunxi_ram_probe: dram-controller@3102000: probing
> DRAM only have internal ZQ!!
> ddr_efuse_type: 0x0
> [AUTO DEBUG] two rank and full DQ!
> ddr_efuse_type: 0x0
> [AUTO DEBUG] rank 0 row = 15
> [AUTO DEBUG] rank 0 bank = 8
> [AUTO DEBUG] rank 0 page size = 2 KB
> [AUTO DEBUG] rank 1 row = 15
> [AUTO DEBUG] rank 1 bank = 8
> [AUTO DEBUG] rank 1 page size = 2 KB
> rank1 config same as rank0
> DRAM BOOT DRIVE INFO: V0.24
> DRAM CLK = 792 MHz
> DRAM Type = 3 (2:DDR2,3:DDR3)
> DRAMC ZQ value: 0x7b7bfb
> DRAM ODT value: 0x42.
> ddr_efuse_type: 0x0
> DRAM SIZE =1024 M
> DRAM simple test OK.
> mxstatus=0xc0408000 mhcr=0x00000109 mcor=0x00000003 mhint=0x00004000
> Trying to boot from MMC1
> PLL reg = 0xf8216300, freq = 1200000000
> SPL size = 81920, sector = 160
> sunxi_ram_get_info: dram-controller@3102000: getting info
>
> OpenSBI v1.1
>    ____                    _____ ____ _____
>   / __ \                  / ____|  _ \_   _|
>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
>  | |__| | |_) |  __/ | | |____) | |_) || |_
>   \____/| .__/ \___|_| |_|_____/|____/_____|
>         | |
>         |_|
>
> Platform Name             : Allwinner D1 Nezha
> Platform Features         : medeleg
> Platform HART Count       : 1
> Platform IPI Device       : ---
> Platform Timer Device     : --- @ 0Hz
> Platform Console Device   : uart8250
> Platform HSM Device       : sun20i-d1-ppu
> Platform Reboot Device    : sunxi-wdt-reset
> Platform Shutdown Device  : ---
> Firmware Base             : 0x40000000
> Firmware Size             : 288 KB
> Runtime SBI Version       : 1.0
>
> Domain0 Name              : root
> Domain0 Boot HART         : 0
> Domain0 HARTs             : 0*
> Domain0 Region00          : 0x0000000040000000-0x000000004007ffff ()
> Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
> Domain0 Next Address      : 0x0000000042e00000
> Domain0 Next Arg1         : 0x0000000042e8b978
> Domain0 Next Mode         : S-mode
> Domain0 SysReset          : yes
>
> Boot HART ID              : 0
> Boot HART Domain          : root
> Boot HART Priv Version    : v1.11
> Boot HART Base ISA        : rv64imafdcvx
> Boot HART ISA Extensions  : time
> Boot HART PMP Count       : 8
> Boot HART PMP Granularity : 2048
> Boot HART PMP Address Bits: 38
> Boot HART MHPM Count      : 0
> Boot HART MIDELEG         : 0x0000000000000222
> Boot HART MEDELEG         : 0x000000000000b109
> sunxi_set_gate: (CLK#24) unhandled
>
>
> U-Boot 2022.10 (Dec 12 2022 - 17:20:45 +0100) Allwinner Technology
>
> ..
>
> Starting kernel ...
>
> [    0.000000] Linux version 6.1.0-rc3 (peko@dell)
> (riscv64-buildroot-linux-gnu-gcc.br_real (Buildroot
> 2022.11-477-g5cb74c92f7) 11.3.0, GNU ld (GNU Binutils) 2.38) #1 PREEMPT Mon
> Dec 12 17:28:21 CET 2022
>
> ..
>
> # uptime
>  00:07:05 up 6 min,  load average: 0.00, 0.00, 0.00
>

I also did a clean build with Peter's patches and the Lichee RV dock is
fine with it. Some snippets from output below. I will drop my patch series
as Peter's series is superior.

U-Boot SPL 2022.10 (Dec 13 2022 - 21:00:50 +0200)
sunxi_ram_probe: dram-controller@3102000: probing
DRAM only have internal ZQ!!
ddr_efuse_type: 0x0
[AUTO DEBUG] single rank and full DQ!
ddr_efuse_type: 0x0
[AUTO DEBUG] rank 0 row = 15
[AUTO DEBUG] rank 0 bank = 8
[AUTO DEBUG] rank 0 page size = 2 KB
DRAM BOOT DRIVE INFO: V0.24
DRAM CLK = 792 MHz
DRAM Type = 3 (2:DDR2,3:DDR3)
DRAMC ZQ value: 0x7b7bfb
DRAM ODT value: 0x42.
ddr_efuse_type: 0x0
DRAM SIZE =512 M
DRAM simple test OK.
mxstatus=0xc0408000 mhcr=0x00000109 mcor=0x00000003 mhint=0x00004000
Trying to boot from MMC1
PLL reg = 0xf8216300, freq = 1200000000
SPL size = 81920, sector = 160
sunxi_ram_get_info: dram-controller@3102000: getting info

OpenSBI v1.1
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Allwinner D1 Nezha
Platform Features         : medeleg
Platform HART Count       : 1
Platform IPI Device       : ---
Platform Timer Device     : --- @ 0Hz
Platform Console Device   : uart8250
Platform HSM Device       : sun20i-d1-ppu
Platform Reboot Device    : sunxi-wdt-reset
Platform Shutdown Device  : ---
Firmware Base             : 0x40000000
Firmware Size             : 288 KB
Runtime SBI Version       : 1.0

...

U-Boot 2022.10 (Dec 13 2022 - 21:00:50 +0200) Allwinner Technology

DRAM:  512 MiB
sunxi_set_gate: (CLK#24) unhandled
Core:  54 devices, 20 uclasses, devicetree: separate

...

Moving Image from 0x41000000 to 0x40200000, end=4162d000
## Flattened Device Tree blob at 5fd3e320
   Booting using the fdt blob at 0x5fd3e320
Working FDT set to 5fd3e320
   Loading Device Tree to 0000000042df2000, end 0000000042dffa9f ... OK
Working FDT set to 42df2000

Starting kernel ...

[    0.000000] Linux version 6.1.0-rc3 (indrek@stuudio)
(riscv64-buildroot-linux-gnu-gcc.br_real (Buildroot
2022.11-518-gd3d1d5a2da-dirty) 11.3.0, GNU ld (GNU Binutils) 2.38) #1
PREEMPT Tue Dec 13 21:06:48 EET 2022
[    0.000000] OF: fdt: Ignoring memory range 0x40000000 - 0x40200000
[    0.000000] Machine model: Allwinner D1 Nezha

...

# uptime
 00:32:39 up 32 min,  load average: 0.00, 0.00, 0.00

# cat /proc/iomem
02000000-020007ff : 2000000.pinctrl pinctrl@2000000
02000c00-02000fff : 2000c00.pwm pwm@2000c00
02001000-02001fff : 2001000.clock-controller clock-controller@2001000
02008000-020083ff : 2008000.led-controller led-controller@2008000
02009400-020097ff : 2009400.temperature-sensor temperature-sensor@2009400
02009800-02009bff : 2009800.keys keys@2009800
02010000-0201ffff : 2010000.iommu iommu@2010000
02030000-02030fff : 2030000.audio-codec audio-codec@2030000
02500000-0250001f : serial
02500400-0250041f : serial
02502800-02502bff : 2502800.i2c i2c@2502800
03000000-03000fff : 3000000.syscon syscon@3000000
03002000-03002fff : 3002000.dma-controller dma-controller@3002000
03006000-03006fff : 3006000.efuse efuse@3006000
03040000-030407ff : 3040000.crypto crypto@3040000
04020000-04020fff : 4020000.mmc mmc@4020000
04021000-04021fff : 4021000.mmc mmc@4021000
04025000-04025fff : 4025000.spi spi@4025000
04026000-04026fff : 4026000.spi spi@4026000
04100000-041003ff : usb@4100000
  04100000-041003ff : musb-hdrc.4.auto usb@4100000
04100400-041004ff : 4100400.phy phy_ctrl
04101000-041010ff : 4101000.usb usb@4101000
04101400-041014ff : 4101400.usb usb@4101400
04101800-041018ff : 4100400.phy pmu0
04200000-042000ff : 4200000.usb usb@4200000
04200400-042004ff : 4200400.usb usb@4200400
04200800-042008ff : 4100400.phy pmu1
05000000-0500ffff : 5000000.clock-controller clock-controller@5000000
05100000-051fffff : 5100000.mixer mixer@5100000
05200000-052fffff : 5200000.mixer mixer@5200000
05451000-05451fff : 5451000.phy phy@5451000
05460000-05460fff : 5460000.tcon-top tcon-top@5460000
05461000-05461fff : 5461000.lcd-controller lcd-controller@5461000
05470000-05470fff : 5470000.lcd-controller lcd-controller@5470000
05500000-0550ffff : 5500000.hdmi hdmi@5500000
05510000-0551ffff : 5510000.phy phy@5510000
06011000-0601101f : 6011000.watchdog watchdog@6011000
07010000-070103ff : 7010000.clock-controller clock-controller@7010000
07090000-070903ff : 7090000.rtc rtc@7090000
40000000-4007ffff : Reserved
40200000-5fffffff : System RAM
  40202000-4162c4cb : Kernel image
    40202000-409df031 : Kernel code
    40e00000-411fffff : Kernel rodata
    41400000-415dafff : Kernel data
    415db000-4162c4cb : Kernel bss



>
> --
> Bye, Peter Korsgaard
>
Peter Korsgaard Dec. 13, 2022, 8:18 p.m. UTC | #9
>>>>> "Indrek" == Indrek Kruusa <indrek.kruusa@gmail.com> writes:

Hi,

 > I also did a clean build with Peter's patches and the Lichee RV dock is
 > fine with it. Some snippets from output below. I will drop my patch series
 > as Peter's series is superior.

Great, thanks for the feedback!
Frank Hunleth Dec. 13, 2022, 9:32 p.m. UTC | #10
Peter, Indrek,

------- Original Message -------
On Monday, December 12th, 2022 at 12:56 PM, Peter Korsgaard <peter@korsgaard.com> wrote:
> > Just in case it helps, I've been testing both the Korsgaard and Kruusa
>
> > patches on a MangoPI MQ Pro. This board is close, but not exactly like
>
> > the Nezha, so I expect differences.
>
> > Using OpenSBI 1.1 results in a non-booting Linux kernel for me. Here's the error:
>
>
> Just to be sure, is this with the 5.19 based kernel we used to use
> (fe178cf0153d98b71cb01a46c8cc050826a17e77) or the "new" 6.1-rc3 based
> one (ca67838d84af4c9f85d06311c9e98e1adf46308f)?
>
> > Unhandled exception: Store/AMO access fault
>
> > EPC: 000000005ff8f838 RA: 000000005ffb6346 TVAL: 0000000040040000
>
> > EPC: 0000000042e01838 RA: 0000000042e28346 reloc adjusted
>
> > Code: b383 0385 be03 0405 be83 0485 bf03 0505 (e110)
>

I am able to run fine on a 512MB MangoPi MQ-Pro now. This is with the patches that were just merged and with the U-Boot defconfig and Linux DTS witched to the Mango Pi MQ-Pro options. 

I don't have an understanding of the store/AMO access fault above. I had an unintended change to my Linux configuration that just happens to require a later version of OpenSBI. I just wanted to follow up in case anyone stumbles on this thread that the simple U-Boot defconfig and dts switch to the MangoPi versions works.

-Frank
Peter Korsgaard Dec. 13, 2022, 9:35 p.m. UTC | #11
>>>>> "Frank" == Frank Hunleth <fhunleth@troodon-software.com> writes:

Hi,

 > I am able to run fine on a 512MB MangoPi MQ-Pro now. This is with the
 > patches that were just merged and with the U-Boot defconfig and Linux
 > DTS witched to the Mango Pi MQ-Pro options.

 > I don't have an understanding of the store/AMO access fault above. I
 > had an unintended change to my Linux configuration that just happens
 > to require a later version of OpenSBI. I just wanted to follow up in
 > case anyone stumbles on this thread that the simple U-Boot defconfig
 > and dts switch to the MangoPi versions works.

Ok, great to hear!
diff mbox series

Patch

diff --git a/configs/nezha_defconfig b/configs/nezha_defconfig
index 5d0948a013..428c443d65 100644
--- a/configs/nezha_defconfig
+++ b/configs/nezha_defconfig
@@ -1,13 +1,12 @@ 
 BR2_riscv=y
-BR2_GLOBAL_PATCH_DIR="board/nezha/patches"
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_19=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_0=y
 BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_OVERLAY="board/nezha/overlay"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/nezha/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
-BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,ca67838d84af4c9f85d06311c9e98e1adf46308f)/linux-ca67838d84af4c9f85d06311c9e98e1adf46308f.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="nezha"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"
@@ -17,14 +16,14 @@  BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
-BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3)/opensbi-5307908fb651a01cc6a2f3fd9fc7b9b471bbccb3.tar.gz"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_SUN20I_D1_SPL=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,528ae9bc6c55edd3ffe642734b4132a8246ea777)/uboot-528ae9bc6c55edd3ffe642734b4132a8246ea777.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nezha"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
@@ -33,5 +32,5 @@  BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
-BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.toc1"
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
 BR2_PACKAGE_HOST_GENIMAGE=y