Odroid N2 does not boot using kernel 5.10-rcX [SOLVED]

Post Reply
nl.smart
Posts: 25
Joined: Sat Aug 24, 2019 6:02 pm
languages_spoken: English && French;
ODROIDs: C2 && N2 && C4;
Has thanked: 21 times
Been thanked: 6 times
Contact:

Odroid N2 does not boot using kernel 5.10-rcX [SOLVED]

Post by nl.smart »

Hi,

At Manjaro ARM, we like to be looking forward and as such we try the RC upstream kernels when we can.

The Odroid C4 and Odroid N2 has booted just fine with upstream kernels up to 5.9, if you change the TEXT_OFFSET, set in arm/arm64/Makefile of the kernel, differently.
But kernel 5.10 has now removed TEXT_OFFSET support entirely.

This means, that the 5.10 kernel cannot boot, if we use this old (2015) u-boot from Hardkernel.
And it's not possible to build mainline uboot on aarch64 that works, since it requires x86_64 binaries (see #62).

Attached is a boot log from Odroid C4, with Uboot 2015.1 from Hardkernel and kernel 5.10-rc2 from kernel.org.
5.10-uboot.log

Strit

more details here
https://github.com/hardkernel/u-boot/issues/63
Last edited by nl.smart on Thu Nov 19, 2020 9:45 pm, edited 1 time in total.

brad
Posts: 1351
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 114 times
Been thanked: 167 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by brad »

Interesting I could not get 5.10-rc to boot either on C4, should be able to work around this maybe using a uImage wrapper to hold the kernel and define correct entry points. I will try when I have the chance. Another alternative is using mainline uboot which uses standard entry point and offset. Also you can use qemu to build the x64 parts on arm64 if needed.
These users thanked the author brad for the post:
nl.smart (Mon Nov 16, 2020 9:53 pm)

Strit
Posts: 5
Joined: Mon Nov 16, 2020 9:53 pm
languages_spoken: english
ODROIDs: Odroid N2, Odroid N2+, Odroid C1+, Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by Strit »

Oh good. It's not just me then.

Let me know if you find a workaround or even a solution, a kernel patch maybe, to get around this.
These users thanked the author Strit for the post:
nl.smart (Mon Nov 16, 2020 10:03 pm)
Project lead on the Manjaro ARM project

Strit
Posts: 5
Joined: Mon Nov 16, 2020 9:53 pm
languages_spoken: english
ODROIDs: Odroid N2, Odroid N2+, Odroid C1+, Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by Strit »

We found some prebuilt uboots, which seem to be mainline based here: https://chewitt.libreelec.tv/testing/9.80/u-boot/

I am going to test them further later today, to see if that works.

I already tried with a uImage wrapper, but it didn't seem to work, something about a "bad magic number" in the UART log.
These users thanked the author Strit for the post:
nl.smart (Mon Nov 16, 2020 10:37 pm)
Project lead on the Manjaro ARM project

jonathon
Posts: 68
Joined: Fri Oct 30, 2020 4:40 am
languages_spoken: English
ODROIDs: N2+
Has thanked: 24 times
Been thanked: 17 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by jonathon »

Looks like other people have it running so it should be possible with the current versions: viewtopic.php?p=309574#p309574
--
N2+ 4GB - Arch Linux ARM - MATE - Xorg - Kernel 5.9 - Desktop use
<sangy>,"jonathon: big fan, happy to see you back"

User avatar
tobetter
Posts: 6622
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 328 times
Been thanked: 921 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by tobetter »

This may be not a solution, but just let you know 5.10 kernel can boot by the Petitboot. Tested with ODROID-HC4 just now, will be the same with ODROID-N2.

Code: Select all

Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64
 _   _               _ _                        _ 
| | | | __ _ _ __ __| | | _____ _ __ _ __   ___| |
| |_| |/ _` | '__/ _` | |/ / _ \ '__| '_ \ / _ \ |
|  _  | (_| | | | (_| |   <  __/ |  | | | |  __/ |
|_| |_|\__,_|_|  \__,_|_|\_\___|_|  |_| |_|\___|_|
                                                  
  ___  ____  ____   ___ ___ ____        _   _  ____ _  _   
 / _ \|  _ \|  _ \ / _ \_ _|  _ \      | | | |/ ___| || |  
| | | | | | | |_) | | | | || | | |_____| |_| | |   | || |_ 
| |_| | |_| |  _ <| |_| | || |_| |_____|  _  | |___|__   _|
 \___/|____/|_| \_\\___/___|____/      |_| |_|\____|  |_|  
                                                           

Welcome to Debian GNU/Linux 10 (buster)
Monday, 16 November 2020, 12:40:01 PM
Up time:     0 days, 00:01:30
Free memory: 1688644 / 1834520 kB
IP:          192.168.0.149

[!] Please visit 'https://launchpad.net/odroid-image' to report a bug

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 16 12:39:42 2020
tobetter@debian:~$ uname -a
Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64 GNU/Linux
These users thanked the author tobetter for the post (total 3):
jonathon (Tue Nov 17, 2020 2:47 am) • brad (Tue Nov 17, 2020 6:45 am) • nl.smart (Tue Nov 17, 2020 9:41 pm)

Strit
Posts: 5
Joined: Mon Nov 16, 2020 9:53 pm
languages_spoken: english
ODROIDs: Odroid N2, Odroid N2+, Odroid C1+, Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by Strit »

tobetter wrote:
Tue Nov 17, 2020 2:43 am
This may be not a solution, but just let you know 5.10 kernel can boot by the Petitboot. Tested with ODROID-HC4 just now, will be the same with ODROID-N2.

Code: Select all

Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64
 _   _               _ _                        _ 
| | | | __ _ _ __ __| | | _____ _ __ _ __   ___| |
| |_| |/ _` | '__/ _` | |/ / _ \ '__| '_ \ / _ \ |
|  _  | (_| | | | (_| |   <  __/ |  | | | |  __/ |
|_| |_|\__,_|_|  \__,_|_|\_\___|_|  |_| |_|\___|_|
                                                  
  ___  ____  ____   ___ ___ ____        _   _  ____ _  _   
 / _ \|  _ \|  _ \ / _ \_ _|  _ \      | | | |/ ___| || |  
| | | | | | | |_) | | | | || | | |_____| |_| | |   | || |_ 
| |_| | |_| |  _ <| |_| | || |_| |_____|  _  | |___|__   _|
 \___/|____/|_| \_\\___/___|____/      |_| |_|\____|  |_|  
                                                           

Welcome to Debian GNU/Linux 10 (buster)
Monday, 16 November 2020, 12:40:01 PM
Up time:     0 days, 00:01:30
Free memory: 1688644 / 1834520 kB
IP:          192.168.0.149

[!] Please visit 'https://launchpad.net/odroid-image' to report a bug

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 16 12:39:42 2020
tobetter@debian:~$ uname -a
Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64 GNU/Linux
Good to know. So that would work for the N2, but not for the C4, as that does not have petitboot in SPI.

Are you testing with kernel built from kernel.org sources or a special source tree?
We use kernel.org sources for ours and would like to continue doing so.
Project lead on the Manjaro ARM project

User avatar
tobetter
Posts: 6622
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 328 times
Been thanked: 921 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by tobetter »

Strit wrote:
Tue Nov 17, 2020 4:24 pm
tobetter wrote:
Tue Nov 17, 2020 2:43 am
This may be not a solution, but just let you know 5.10 kernel can boot by the Petitboot. Tested with ODROID-HC4 just now, will be the same with ODROID-N2.

Code: Select all

Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64
 _   _               _ _                        _ 
| | | | __ _ _ __ __| | | _____ _ __ _ __   ___| |
| |_| |/ _` | '__/ _` | |/ / _ \ '__| '_ \ / _ \ |
|  _  | (_| | | | (_| |   <  __/ |  | | | |  __/ |
|_| |_|\__,_|_|  \__,_|_|\_\___|_|  |_| |_|\___|_|
                                                  
  ___  ____  ____   ___ ___ ____        _   _  ____ _  _   
 / _ \|  _ \|  _ \ / _ \_ _|  _ \      | | | |/ ___| || |  
| | | | | | | |_) | | | | || | | |_____| |_| | |   | || |_ 
| |_| | |_| |  _ <| |_| | || |_| |_____|  _  | |___|__   _|
 \___/|____/|_| \_\\___/___|____/      |_| |_|\____|  |_|  
                                                           

Welcome to Debian GNU/Linux 10 (buster)
Monday, 16 November 2020, 12:40:01 PM
Up time:     0 days, 00:01:30
Free memory: 1688644 / 1834520 kB
IP:          192.168.0.149

[!] Please visit 'https://launchpad.net/odroid-image' to report a bug

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 16 12:39:42 2020
tobetter@debian:~$ uname -a
Linux debian 5.10.0-rc4+ #5 SMP PREEMPT Tue Nov 17 02:29:24 KST 2020 aarch64 GNU/Linux
Good to know. So that would work for the N2, but not for the C4, as that does not have petitboot in SPI.

Are you testing with kernel built from kernel.org sources or a special source tree?
We use kernel.org sources for ours and would like to continue doing so.
I am managing the my kernel tree Github and rebasing the branch with kernel.org, this is my branch for 5.10 that will be packaged for Debian/Ubuntu users from next week hopefully.
https://github.com/tobetter/linux/tree/odroid-5.10.y

ODROID-C4 does not have SPI flash memory so the Petitboot is not there. Alternative, you can make your bootable image to have the Petitboot.
viewtopic.php?p=299473#p299473

wallyz21
Posts: 184
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by wallyz21 »

Or you could just use a modern u-boot that has already been compiled and tested on the N2 that supports grub.

As I previously mentioned in this post viewtopic.php?f=93&t=40900&p=311755#p311755
Walter Zambotti
N2 - Ubuntu Mate Desktop

jonathon
Posts: 68
Joined: Fri Oct 30, 2020 4:40 am
languages_spoken: English
ODROIDs: N2+
Has thanked: 24 times
Been thanked: 17 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by jonathon »

That sounds like something which is perfect for @strit to test and feed back on given he's already looking at the mainline kernel.

As an aside, you posted that thread in the XU4 etc. area which might be why it hasn't been picked up as applicable to the N2.
--
N2+ 4GB - Arch Linux ARM - MATE - Xorg - Kernel 5.9 - Desktop use
<sangy>,"jonathon: big fan, happy to see you back"

brad
Posts: 1351
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 114 times
Been thanked: 167 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by brad »

Trying to get my head around this

- text offset for mainline is now 0x0 rather than 0x8000
- mainline will expect the kernel entry point to be at 0x1000000 now we cannot set a text offset

I wonder if we can move the kernel (it is 0x1080000 by default):

The problem here is we load the dtb initially into 0x1000000 (and relocated later to 0x20000000) so I think would need to change the initial dtb address to something different (maybe just before the ramdisk location). I think a change to the following 4 uboot parameters to be something like this might work (which can be done near the start ofboot.ini or boot.scr )

loadaddr=0x1000000
kernel_addr_r=0x1000000
fdt_addr_r=0x3000000
dtb_mem_addr=0x3000000

I'm probably missing something but it might just do the trick, need to test it out.
These users thanked the author brad for the post:
nl.smart (Wed Nov 18, 2020 2:58 am)

wallyz21
Posts: 184
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by wallyz21 »

jonathon wrote:
Tue Nov 17, 2020 7:55 pm
That sounds like something which is perfect for @strit to test and feed back on given he's already looking at the mainline kernel.

As an aside, you posted that thread in the XU4 etc. area which might be why it hasn't been picked up as applicable to the N2.
Fat fingers and must be going blind!!!
Walter Zambotti
N2 - Ubuntu Mate Desktop

User avatar
ajcard
Posts: 79
Joined: Fri Jun 07, 2019 4:46 pm
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by ajcard »

I use ;
setenv loadaddr "0x01080000"
setenv dtb_loadaddr "0x1000000"

this works for me up to 5.10rc4. Or should I change em?

Strit
Posts: 5
Joined: Mon Nov 16, 2020 9:53 pm
languages_spoken: english
ODROIDs: Odroid N2, Odroid N2+, Odroid C1+, Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by Strit »

Okay. I found out how to boot N2, N2+ and C4 on upstream 5.10-rc.

It's a simple change really.
I just had to change
setenv initrd_loadaddr "0x3080000"
to
setenv initrd_loadaddr "0x4080000"
in boot.ini. Works on both 5.9.y and 5.10-rc kernels with regular BSP uboot.

Sorry for all the noise.
These users thanked the author Strit for the post (total 3):
tobetter (Wed Nov 18, 2020 1:44 am) • nl.smart (Wed Nov 18, 2020 3:01 am) • brad (Wed Nov 18, 2020 6:48 am)
Project lead on the Manjaro ARM project

User avatar
tobetter
Posts: 6622
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 328 times
Been thanked: 921 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by tobetter »

Strit wrote:
Wed Nov 18, 2020 1:41 am
Okay. I found out how to boot N2, N2+ and C4 on upstream 5.10-rc.

It's a simple change really.
I just had to change
setenv initrd_loadaddr "0x3080000"
to
setenv initrd_loadaddr "0x4080000"
in boot.ini. Works on both 5.9.y and 5.10-rc kernels with regular BSP uboot.

Sorry for all the noise.
So...is that like memory overlap issue?

Strit
Posts: 5
Joined: Mon Nov 16, 2020 9:53 pm
languages_spoken: english
ODROIDs: Odroid N2, Odroid N2+, Odroid C1+, Odroid C2, Odroid C4
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by Strit »

Looks like it to me.

You guys talking about the addresses just got me thinking that it might be why. ;)
Project lead on the Manjaro ARM project

User avatar
tobetter
Posts: 6622
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 328 times
Been thanked: 921 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by tobetter »

Strit wrote:
Wed Nov 18, 2020 1:50 am
Looks like it to me.

You guys talking about the addresses just got me thinking that it might be why. ;)
Cool, anyway one problem is resolved...so no need to change U-boot. :D

brad
Posts: 1351
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 114 times
Been thanked: 167 times
Contact:

Re: Odroid N2 does not boot using kernel 5.10-rcX

Post by brad »

yeah cool nice pickup ramdisk can be loaded anywhere, must not have been enough room for the kernel.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest