Trying to get mainline kernel working on N1

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by meveric » Fri Feb 01, 2019 5:14 pm

mad_ady wrote:
Fri Feb 01, 2019 5:01 pm
@rooted: you can try my ubuntu 18.04 image - it should contain most of what OverSun mentioned. But there may be bugs lurking around... (last time kodi would not react to mouse/keyboard input, but it worked with hardware decoding).
Have you changed the permissions that the user has access to the mouse and keyboard devices?
I think by default a user does not have the permissions.
On the desktop this is handled by xinput drivers, but when you run Kodi it runs under GBM and the user needs to have access to the physical devices.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
rooted
Posts: 6585
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 88 times
Been thanked: 17 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by rooted » Fri Feb 01, 2019 7:24 pm

How soon we forget things when stressed, I will try your image Adrian. Thanks for the reminder.

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Fri Feb 01, 2019 8:20 pm

Thanks for the suggestion @meveric. I'm currently moving my n1 into production and haven't tried further, but maybe @rooted can have a look when he experiences the problem.

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Mon Jul 15, 2019 3:16 pm

Maybe everyone forgot about N1, but in reality rk3399 chipset is becoming more and more supported with mainline kernel and I actually returned back to solid N1 product that's becoming better and better with time.
First of all I was able to compile recent u-boot for the board, and mainline u-boot 2019.07 is way more stable than hardkernel one. It solidly boot every time without any issues and work really cool.
After that I was able to make pretty solid .dts file for the latest 5.2 kernel and this one boots great, everything works, including I think panfrost Lima driver (didn't test that though, I'm planning the board for headless server since N2 is better for Kodi).
I was thinking of making repos of all that, but at some point I realised that every guy who has N1 should be able to do compilation and flashing himself and know how to do that.
So I just attach four files here, the u-boot idbloader.img, trust.img and uboot.img that can be flashed using sd_fuse.sh and rk3399-odroidn1.dts from 5.2 kernel in one archive.

Issues I have so far is non-working reboot, the board hangs at "Rebooting", and network card not being able to successfully negotiate network speed, it always go for 1Gbit, and if you other end is only 100Mbit compatible that will make it not work. I use ethtool at start to force the speed and it's all fine. Have no idea what's wrong with it, there are no warnings or errors, it's just that autonegotiation on N1 side excitingly go for 1Gbit all the time.
Attachments
n1-u-boot-v2019.07-and-5.2-dts.tar.gz
(1.69 MiB) Downloaded 18 times
These users thanked the author OverSun for the post (total 3):
mad_ady (Tue Jul 16, 2019 2:34 am) • elatllat (Tue Jul 16, 2019 6:06 am) • rooted (Wed Jul 17, 2019 12:50 pm)

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Mon Jul 15, 2019 3:49 pm

Few notes on booting, since this is mainline u-boot it doesn't use "boot.ini" and is going to search for boot.scr or other types of boot files. (boot.scr in /boot is the easiest way of doing that).
This is the content of source I use to generate it, which also can be used to boot from u-boot command line:

Code: Select all

setenv ethaddr be:f9:8f:92:be:d9
setenv bootargs earlyprintk console=ttyS2,115200 root=/dev/mmcblk1p1 net.ifnames=0 biosdevname=0 fsck.mode=auto fsck.repair=yes mitigations=off rootwait ro
load ${devtype} ${devnum} ${kernel_addr_r} /boot/vmlinuz-5.2.1+
load ${devtype} ${devnum} ${fdt_addr_r} /boot/rk3399-odroidn1.dtb
booti ${kernel_addr_r} - ${fdt_addr_r}
and boot.scr is generated from this as

Code: Select all

mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
These users thanked the author OverSun for the post:
mad_ady (Tue Jul 16, 2019 2:35 am)

brad
Posts: 956
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2
Location: Australia
Has thanked: 14 times
Been thanked: 28 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by brad » Mon Jul 15, 2019 5:09 pm

My N1 is still rock solid as a basic fileserver running happily in the background for me. I think you are right mainline support has picked up quiet a bit for rk3399 I need to get back and do some more testing (I now have a working UART adatptor for it so no excuses for me now) :)
These users thanked the author brad for the post:
mad_ady (Tue Jul 16, 2019 2:35 am)

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Tue Jul 16, 2019 3:07 am

Thank you both for keeping the N1 alive. Mine is doing NAS/lan monitoring/Home Automation, so I can't experiment, sadly. (I wouldn't want to replace it with the N2 for its lack of sata ports). I'm also using the gpio pins for a 1-wire temperature sensor and an ir blaster (with the odroid-lirc driver stolen from xu4). So, I'd like to make sure those work before upgrading the kernel. Who knows, maybe when I'm home alone (if ever) I can experiment too.

A couple of questions:
1. Can the mainline uboot boot the old 4.4 kernel? I'm using Oversun's 4.4 branch, without reboot issues)
2. Do you know if the reboot issue is caused by uboot or the kernel?

Regarding ethernet I seem to remember that somebody (either @Oversun or @crashoverride) told me to change a setting in the dtb to make it receive packets. Not sure if it's relevant to this problem...

Anyway, looking forward to your experiments. Don't forget to document stuff for those of us who'll follow your steps in a few months :)

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Tue Jul 16, 2019 4:37 am

Reset seems to be caused by u-boot I believe.
There is a rk3399-reset block specific for N1 in N1 kernel dtb, but it's compatible with gpio-reset and I've upgraded it, seems to be not working. u-boot is my only guess in that case.
I have high suspicion there are many things that are wrongly setup in u-boot dts and kernel dts that make hardware have issues. It would be really helpful if Odroid provide logical schematic, like a draft of the board where it's shown what's connected to what, so proper .dts can be created...
Ethernet is setup according to what was discussed here, it's another kind of issues, it's autonegotiation not working properly. it always negotiate to 1G, even when other side explicitly says 100Mbit...
I think mainline u-boot boots 4.4 kernel without any problems.

If not reboot issue I would forget about ethernet thing... But without proper headless reboot I cannot leave it as a server unfortunately, have to keep digging. A schematic would really be extremely helpful... @odroid?

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Wed Jul 17, 2019 5:52 am

Allright, I do some adjustments still so I decided to put it to github anyways.
I did some sync between u-boot and kernel .dts'es, and now even hdmi (including 5.2 linux panfrost lima driver), sound, cec, this stuff works. There are none warnings or problems during boot, all devices are visible where they should be, PCI, gpio, SATA, that kind of stuff...
Unfortunately same problem with no reboot and network card going 1Gbit all the time is still there.
With the reboot I suspect this is linux kernel problem, because I hit mentioned gpio from uboot and board went reset, so it all work in hardware, and should work as described in software as well according to "gpio-reset" driver doc. But it doesn't.
There are still few things that doesn't add up and are different in u-boot and kernel .dts even originally, I've asked odroid for datasheet which can be digged and proper .dts composed, no answer yet and could be never, but so far almost everything work on mainline, this is really cool.
https://github.com/Owersun/u-boot/tree/odroid-n1
https://github.com/Owersun/linux-hardke ... idn1-5.2.y
PS. you would need to read README.rockchip to compile u-boot, u-boot itself is not everything what's needed, there is also rkbin and arm-trusted-firmware required.
These users thanked the author OverSun for the post (total 2):
mad_ady (Wed Jul 17, 2019 12:13 pm) • rooted (Wed Jul 17, 2019 12:51 pm)

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Sat Jul 20, 2019 8:53 pm

I have finished sync-up and update of .dts files in u-boot (for 2019.07 latest version) and for kernel (for 5.2.y version).
All work great, except same problems with reboot and ethernet. This thing seems to be related to mistakes in initial .dts that were compensated by drivers in 4.4 kernel. And this is something that cannot be solved without the datasheet. No reply from odroid still, sad new on that side.
It would be really helpful to have a simple schematic what's connected where, don't know why it's not disclosed, there should be absolutely nothing secret in that...

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Sat Jul 20, 2019 9:44 pm

+1 for odroid's help on the matter. Full mainline on the N1 would be awesome :)

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Sat Jul 20, 2019 9:56 pm

It is already somewhat full.
Everything meant for rk3399 is working what's in mainline. sound, hdmi, panfrost gpu driver, sata, gpio, usb, you name it. I believe even HDR is going to be working when it's in mainline. I think reboot and ethernet issue are something related to wrong .dts settings I cannot figure out myself. Let's see what's 5.3 is going to bring, from what I saw what was merged today there are some fixes and additions to rk3399. It could be some of them could be it.
These users thanked the author OverSun for the post (total 2):
mad_ady (Sat Jul 20, 2019 11:31 pm) • rooted (Sun Jul 21, 2019 7:59 am)

User avatar
rooted
Posts: 6585
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 88 times
Been thanked: 17 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by rooted » Sun Jul 21, 2019 7:59 am

Thanks for staying on top on this and sharing, very useful to us few with a N1.

moon.linux
Posts: 1165
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by moon.linux » Sat Jul 27, 2019 11:20 am

@oversun
Thank for your good work.
I tired to compile the u-boot for odroid n1 at my end and ran into compilation issue, which I fixed locally.
But the document for building uboot.img ,trust.img idbloader.img is bit confuse plz share the instruction to build this u-boot images.

Are your enable SPL image to build uboot.img ?

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Sun Jul 28, 2019 3:37 am

Allright, this is how I do it:

I build on x86_64 host, you would need linaro gcc 7.4.1 toolchain in ~/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu directory and make sure it's reachable and useable.
In the directory where I build there are three directories,
u-boot which is git odroid-n1 of https://github.com/Owersun/u-boot.git
rkbit which is git master of https://github.com/rockchip-linux/rkbin.git

this is the script that has the steps I do:

Code: Select all

#!/bin/bash

export CFLAGS=
export CXXFLAGS=
export CPPFLAGS=
export CROSS_COMPILE=aarch64-linux-gnu-
export PATH=$PATH:~/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin

cd u-boot
make clean
make odroidn1_defconfig
make

./tools/mkimage  -n rk3399 -T rksd -d ../rkbin/bin/rk33/rk3399_ddr_800MHz_v1.23.bin ../idbloader.img
cat ../rkbin/bin/rk33/rk3399_miniloader_v1.19.bin >> ../idbloader.img

cd ../rkbin
./tools/trust_merger RKTRUST/RK3399TRUST.ini
./tools/loaderimage --pack --uboot ../u-boot/u-boot-dtb.bin ../uboot.img
mv trust.img ../
there is going to be a failure notice about generating uboot.itb, thing is that this file is not needed in this case, so you can freely ignore it.
you will have after that three files that can be flashed the way hardkernel sdfuse https://github.com/hardkernel/u-boot/bl ... /sdfuse.sh does that.
These users thanked the author OverSun for the post:
mad_ady (Sun Jul 28, 2019 1:30 pm)

moon.linux
Posts: 1165
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by moon.linux » Sun Jul 28, 2019 11:15 am

Thanks I have taken similar approach to build these image.
By the way did you get the SPL or TPL images to work with rk3399 boards.

By the way this board has LPDR3/4 ram chip.

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Sun Jul 28, 2019 5:10 pm

Nope, I didn't try any other images than this produces (u-boot-dtb.bin).
I know the memory is different, but other rkbin loaders doesn't work.

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Sat Aug 03, 2019 3:28 am

@OverSun: I have some (silly?) questions about your boot.txt example that you use to generate boot.scr (I will try to migrate to your uboot/kernel during this month, but I want to minimize my downtime).
Your example is:

Code: Select all

setenv ethaddr be:f9:8f:92:be:d9
setenv bootargs earlyprintk console=ttyS2,115200 root=/dev/mmcblk1p1 net.ifnames=0 biosdevname=0 fsck.mode=auto fsck.repair=yes mitigations=off rootwait ro
load ${devtype} ${devnum} ${kernel_addr_r} /boot/vmlinuz-5.2.1+
load ${devtype} ${devnum} ${fdt_addr_r} /boot/rk3399-odroidn1.dtb
booti ${kernel_addr_r} - ${fdt_addr_r}
Should this be merged with what's in boot.ini? Or is it standalone? I find it weird that a lot of the variables are not defined anywhere. Also some specific questions:
* ethaddr is the mac address used only by uboot?
* console=ttyS2 is the equivalent of the onboard serial? (ttyAML0)?
* /dev/mmcblk1p1 - are you using sd card? I suspect it's not a "standard" HK image layout with /media/boot and partition 2 rootfs, right? I should use /dev/mmcblk0p2 for my "standard emmc"
* you're not using an initrd. Assuming I don't need early drivers, can it still fsck and repair a broken rootfs, or not? I'm guessing no, with the exception, maybe if the rootfs can be mounted read-only and then it finds fsck.
* when building the kernel, can I start from make oldconfig? Or should I start with a new base and track down what I added? I'll still need to add the odroid-lirc module to control my AC and keep my fingers crossed...

Thanks!

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Sat Aug 03, 2019 4:09 am

this is standalone script, if you want anything from boot.ini - copy it from there. just remember that all specific settings like hdmitx=whatever most probably are not going to affect anything on vanilla kernel.
all the variables that are unset are coming from u-boot stadard environment that is fused to u-boot. There are commands in u-boot that are now pretty mature, they pretty effectively search for boot.scr script throuh eMMC/SD, different partitions, different directories, and when found execute it. At the time of it's execution those variables are going to point to where boot.scr was found. As mostly it's kept next to the kernel it's pretty safe to use like this. Very convenient, very universal.
ethaddr is set by uboot to the .dts, and kernel is able to read it from there. network drivers mostly now comply to the procedure of getting mac - read from hw, if not found read from .dts (which also propogates to .dts used by uboot), generate randomly.
console=ttyS2 is equivalent of what was ttyAML0 before. previously there was special driver for console that implemented special device ttyAML0, on mainline kernel this is different and all is standart now, uart is connected to serial, serial is standard serial, no special driver is needed.
/dev/mmcblk1 is eMMC. sd card is /dev/mmcblk0
yes, the "ro" option mounts rootfs read only and repairs it if needed. never had problems with that, I sometimes use initramfs, sometimes don't don't really see a need of that mostly.
I guess it's better to take odroidn1_defconfig I have in my branch, make with it, and then modify the configuration as you want on top of it. I composed the config with everything that is mentioned in .dts, I'm not sure oldconfig from 4.4 is going to have all the drivers by correct names that are now referenced in .dts.
These users thanked the author OverSun for the post:
mad_ady (Sat Aug 03, 2019 1:28 pm)

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Thu Aug 15, 2019 9:57 pm

Ok, I've been preparing all week. I put the kid to sleep and I've messed with my N1's uboot in hopes of going to mainline in the near future. For now I want to run mainline uboot and legacy 4.4 kernel. Made backups of old uboot and flashed the new one. This is my boot.scr:

Code: Select all

setenv ethaddr 00:1e:06:ae:d4:2e
setenv bootargs earlyprintk console=ttyS2,115200 root=/dev/mmcblk1p2 net.ifnames=0 biosdevname=0 fsck.mode=auto fsck.repair=yes mitigations=off rootwait ro usb-storage.quirks=0x174c:0x1153:u usb-storage.quirks=0x152d:0x0578:u
load ${devtype} ${devnum} ${kernel_addr_r} /boot/Image.owersun
load ${devtype} ${devnum} ${fdt_addr_r} /boot/rk3399-odroidn1-linux-owersun.dtb
booti ${kernel_addr_r} - ${fdt_addr_r}
I've copied the 4.4 kernel and dtb in /boot. My filesystem structure is the stock HardKernel structure - with mmcblk1p1 a 128MB vfat partition and mmcblk1p2 the ext4 rootfs.

Now, when I rebooted, uboot did not load boot.scr:

Code: Select all

��@���@`����@���H�������������@�@��MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Net:
Error: ethernet@fe300000 address not set.
eth-1: ethernet@fe300000
Hit any key to stop autoboot:  2 switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
** Unable to read file / **
Card did not respond to voltage select!
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: USB EHCI 1.00
scanning bus usb@fe380000 for devices... 1 USB Device(s) found
scanning bus usb@fe3c0000 for devices... missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-rk3399-odroidn1_rk3399
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-rk3399
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.

# version
U-Boot 2019.07-00007-gdd9367bbe3 (Aug 03 2019 - 09:01:33 +0300)

aarch64-linux-gnu-gcc (Linaro GCC 7.4-2019.02) 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4]
GNU ld (Linaro_Binutils-2019.02) 2.28.2.20170706

My guess is - it expects boot.scr to be on the first partition inside /boot, right? Is it ok if I copy it to my vfat partition inside a "boot" directory? Can this uboot read vfat partitions?

Despite this problem, I tried to have it boot manually by my pasting the contents of boot.scr:

Code: Select all

# setenv ethaddr 00:1e:06:ae:d4:2e
# setenv bootargs earlyprintk console=ttyS2,115200 root=/dev/mmcblk1p2 net.ifnames=0 biosdevname=0 fsck.mode=auto fsck.repair=yes mitigations=off rootwait ro usb-storage.quirks=0x174c:0x1153:u usb-storage.quirks=0x152d:0x0578:u
# load ${devtype} ${devnum} ${kernel_addr_r} /boot/Image.owersun
# load ${devtype} ${devnum} ${fdt_addr_r} /boot/rk3399-odroidn1-linux-owersun.dtb
# booti ${kernel_addr_r} - ${fdt_addr_r}
Bad Linux ARM64 Image magic!
and it didn't boot. My guess here is that the old kernel is in the "Image" format and the new uboot may be expecting a different one. If yes which one? Can I convert the binary Image to the new format without recompiling the old kernel?

Also, loading an initrd didn't work as I expected:

Code: Select all

# load ${devtype} ${devnum} ${initrd_addr} /boot/uInitrd.owersun
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
I'll try to retry next tuesday when I hope to have a bit of time. In the meantime I reverted to the old uboot (backups FTW!)

User avatar
OverSun
Posts: 1484
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 15 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by OverSun » Thu Aug 15, 2019 10:04 pm

you have problematic u-boot build with .dts WIP.
I've worked with it some time and there is a chance you checkout out version that doesn't boot.
The u-boot u have wrongly initialize emmc to lower capabilities it can do due to some voltage regulator options adjusted wrong, it cannot read emmc at all, you can see it by this lines:
Scanning mmc 0:1...
** Unable to read file / **
Card did not respond to voltage select!

Please try the latest version in git:
https://github.com/Owersun/u-boot/tree/odroid-n1
These users thanked the author OverSun for the post:
mad_ady (Thu Aug 15, 2019 10:20 pm)

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Thu Aug 15, 2019 10:23 pm

Indeed, I see you have newer commits. I'll start fresh next week. Thanks

brad
Posts: 956
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2
Location: Australia
Has thanked: 14 times
Been thanked: 28 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by brad » Thu Aug 15, 2019 10:39 pm

@OverSun thanks for you work far, I havent had a chance to test as yet though.

@mad_ady a few things as you want 4.4 kernel

- Im not exactly sure how OverSun has setup the uboot environment but mainline uboot should go searching for a boot.scr on the root partitions of all detected devices and then even try to find it on default pxe network server on the LAN. Normally it will find it on the root of the partition but it may even go search in /boot/ in OverSun's build unsure of this. You can generally ignore the "Card did not respond to voltage select!" but oversun could be right about the card not being detected. Do you have boot.src in boot partition on the vfat? If not try it. ext3 and ext4 partition support is optional in mainline uboot build but I assume this is added in OverSun's build.

When you enter the boot command manually and see "Bad Linux ARM64 Image magic!" this generally means mainline uboot cannot boot the image and considering its legacy hardkernel 4.4 will be the reason why. hardkernel kernel requires a different entry point than mainline linux. The custom entrypoint can usually be defined by wrapping the kernel in a uImage format which allows a custom entry point to be specified in the uImage header. Unfortunately for the moment I don't know what this is as I have not looked at it yet.

Lastly for legacy kernel the serial should be "ttyFIQ0" rather than "ttyS2" (mainline) or "ttyAML0" (amlogic boards). This is a parameter which gets passed to the kernel (not used in uboot)

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Trying to get mainline kernel working on N1

Unread post by mad_ady » Fri Aug 16, 2019 12:35 am

Thank for pointing out the serial port mistake. I knew about it, but forgot I was booting 4.4 when I wrote the file. Will correct it.

boot.scr exists only in mmcblk1p2/boot for now, but I can move it elsewhere if needed. I'll do more experiments next time, hopefully I won't be as time constrained, and now I know revert works.

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests