Trying to get mainline kernel working on N1

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

That's excellent news (fan)! I'll rebuild it and try it next week!

Regarding video encoders, last time I played with the 4.4 kernel ffmpeg supported only video decoding. I thought that maybe the soc didn't have encoding capability. Is the encoder v4l2 compatible (seems so)?

hominoid
Posts: 485
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 47 times
Been thanked: 160 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by hominoid »

I don't know about the capabilities of the silicon IP or the codecs but let me know how it goes when you get to trying 5.8-rc5. And yeah, having a working fan is excellent! :)

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

Re: Trying to get mainline kernel working on N1

Post by rooted »

Wow that's great news, thanks for the update.

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

@hominid - just for clarification - you're using the direct mainline kernel, no longer @tobetter's branch, right? I'll try to compile it too and see how it goes. :)

hominoid
Posts: 485
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 47 times
Been thanked: 160 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by hominoid »

mad_ady wrote:
Tue Jul 21, 2020 6:21 pm
@hominid - just for clarification - you're using the direct mainline kernel, no longer @tobetter's branch, right? I'll try to compile it too and see how it goes. :)
Yes, direct mainline kernel. I have compiled and run several versions(headless) of it already including 5.8-rc6 last night. I haven't seen any problems yet so far. I also recently setup a raid0 for testing on 2.5" 2gb seagates 5400rpm on kernel 5.7.8 if I remember correctly.

Code: Select all

hominoid@odroid-n1:~$ lsblk -o UUID,NAME,FSTYPE,SIZE,LABEL,MODEL
UUID                                 NAME         FSTYPE             SIZE LABEL       MODEL
aff63bf3-933d-52c7-be42-ae8a78faf911 sda          linux_raid_member  1.8T odroid-n1:0 ST2000LM007-1R8174
413b8314-25c4-4e4f-b356-aaabb2bd00fc └─md0        ext4               3.7T             
aff63bf3-933d-52c7-be42-ae8a78faf911 sdb          linux_raid_member  1.8T odroid-n1:0 ST2000LM007-1R8174
413b8314-25c4-4e4f-b356-aaabb2bd00fc └─md0        ext4               3.7T             
                                     mmcblk1                        29.1G             
a9a7bb11-3323-426e-9e7b-1e9dd07800c1 ├─mmcblk1p1  ext2               256M BOOT        
a977a8c4-0492-48d9-9876-8f53ac858a41 └─mmcblk1p2  ext4              28.9G rootfs      
                                     mmcblk1boot0                      4M             
                                     mmcblk1boot1                      4M             

Code: Select all

hominoid@odroid-n1:/archive$ sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
	Iozone: Performance Test of File I/O
	        Version $Revision: 3.489 $
		Compiled for 64 bit mode.
		Build: linux 

	Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
	             Al Slater, Scott Rhine, Mike Wisner, Ken Goss
	             Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
	             Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
	             Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
	             Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,
	             Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer,
	             Vangel Bojaxhi, Ben England, Vikentsi Lapa,
	             Alexey Skidanov, Sudhir Kumar.

	Run began: Tue Jul 14 17:15:48 2020

	Include fsync in write timing
	O_DIRECT feature enabled
	Auto Mode
	File size set to 102400 kB
	Record Size 4 kB
	Record Size 16 kB
	Record Size 512 kB
	Record Size 1024 kB
	Record Size 16384 kB
	Command line used: iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
	Output is in kBytes/sec
	Time Resolution = 0.000001 seconds.
	Processor cache size set to 1024 kBytes.
	Processor cache line size set to 32 bytes.
	File stride size set to 17 * record size.
                                                              random    random     bkwd    record    stride                                    
              kB  reclen    write  rewrite    read    reread    read     write     read   rewrite      read   fwrite frewrite    fread  freread
          102400       4    14657    15700    18147    19780     5330     2847                                                                
          102400      16    52575    58216    51761    73863    15356    12026                                                                
          102400     512   182393   186711   230043   237479    75404   141589                                                                
          102400    1024   189821   186742   224223   244256    98548   156136                                                                
          102400   16384   155943   171314   221525   232339   205939   162712                                                                

iozone test complete.
Not bad for older 5400rpm drives.
Last edited by hominoid on Tue Jul 21, 2020 10:26 pm, edited 2 times in total.

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

Re: Trying to get mainline kernel working on N1

Post by tobetter »

hominoid wrote:
Tue Jul 21, 2020 10:13 pm
mad_ady wrote:
Tue Jul 21, 2020 6:21 pm
@hominid - just for clarification - you're using the direct mainline kernel, no longer @tobetter's branch, right? I'll try to compile it too and see how it goes. :)
Yes, direct mainline kernel. I have compiled and run several versions(headless) of it already including 5.8-rc6 last night. I haven't seen any problems yet so far.
Can you share your branch if possible? Let me try to see if I can merge it to my branch and release through my server. But........I have to find out where I put N1. :(

hominoid
Posts: 485
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 47 times
Been thanked: 160 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by hominoid »

tobetter wrote:
Tue Jul 21, 2020 10:17 pm

Can you share your branch if possible? Let me try to see if I can merge it to my branch and release through my server. But........I have to find out where I put N1. :(
I'm running un-patched directly from the archive https://git.kernel.org/torvalds/t/linux-5.8-rc6.tar.gz

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

@tobetter Look for it. Thanks to its built-in sata it's worth more to some than the N2+! :)

@hominid I'm already compiling it, but it's slow because of -j2 and thermal throttling.... Hope to try it tomorrow

hominoid
Posts: 485
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 47 times
Been thanked: 160 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by hominoid »

For reference, with a fan and -j6 it takes about 60min.

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

Re: Trying to get mainline kernel working on N1

Post by tobetter »

@moon.anand, can you shares the branch or patch for U-boot? Not able to find out odroid-n1_rk3399_defconfig. My eyes are painful. :D

hominoid
Posts: 485
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 47 times
Been thanked: 160 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by hominoid »

tobetter wrote:
Wed Jul 22, 2020 2:30 pm
@moon.anand, can you shares the branch or patch for U-boot? Not able to find out odroid-n1_rk3399_defconfig. My eyes are painful. :D
@tobetter, The patch that @moon.linux provided, which I used to compile mainline uboot, is located here and the compiled uboot I'm using is located here. It can be flashed using sudo dd if=u-boot-rockchip.bin of=/dev/mmcblk0 seek=64 FYI, The included dts has changed since that post.
These users thanked the author hominoid for the post:
tobetter (Wed Jul 22, 2020 10:56 pm)

moon.linux
Posts: 1199
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
ODROIDs: U3, XU3. XU4, C1+...
Has thanked: 0
Been thanked: 13 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by moon.linux »

Sorry, I am completely going partial blind now a days, But I will try to enable SPI flash on N1 as well.

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

Oh, sorry to hear that... Hope you get well soon!

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

Re: Trying to get mainline kernel working on N1

Post by rooted »

moon.linux wrote:Sorry, I am completely going partial blind now a days, But I will try to enable SPI flash on N1 as well.
I hope it's something that can be slowed, stopped, or even reversed mate. Best wishes @moon.linux

moon.linux
Posts: 1199
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
ODROIDs: U3, XU3. XU4, C1+...
Has thanked: 0
Been thanked: 13 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by moon.linux »

Sorry for misunderstanding of my comments, earlier I user to work without eye glasses, now I have to use them regularly for work. :ugeek:

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

Re: Trying to get mainline kernel working on N1

Post by rooted »

moon.linux wrote:Sorry for misunderstanding of my comments, earlier I user to work without eye glasses, now I have to use them regularly for work. :ugeek:
That's much better than going blind ;)

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

Hey there... I'm running 5.8.0-rc5 as per @hominid's instructions and fan works just fine. System is stable too. But now, my IR blaster doesn't work. I managed to get it working on 5.7 as documented here: viewtopic.php?p=297849#p297849.
On closer inspection it seems the phandle for gpio1 has changed from 0x83 to 0x82, so my changes to the DTB for this kernel need to be:

Code: Select all

sudo fdtput -v -c rk3399-odroid-n1.dtb  /ir-tx
sudo fdtput -t s rk3399-odroid-n1.dtb  /ir-tx compatible "gpio-ir-tx"
sudo fdtput -t x rk3399-odroid-n1.dtb  /ir-tx "gpios" 0x82 0x01 0x0

User avatar
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

I'm currently making a Image based on Debian Bullseye and the infos found in this thread.
In fact you can actually use vanilla Debian Bullseye with the dtb/dts discussed here and the N1 will work out of the box, including panfrost support.
It's a really great experience.

I used Kodi just for fun and it's working fine, although it does only software decoding.
It actually complains at the start:

Code: Select all

libva info: VA-API version 1.9.0
libva info: Trying to open /usr/lib/aarch64-linux-gnu/dri/rockchip_drv_video.so
libva info: va_openDriver() returns -1
Failed to open VDPAU backend libvdpau_rockchip.so: cannot open shared object file: No such file or directory
Which of cause is nowhere to be found.

Same goes for ffplay forcing v4l2_m2m interface, which is not working.
Anyone of you having luck to get hardware video decoding to work?
Not that I rely on it even 1080p H265 was working with software decoding.
Even my favorite test videos birds90.mkv and jellyfish-25-mbps-hd-h264.mkv are working fine and those are quite hard.

So overall I enjoy the N1 very much and are working on a clean image.
These users thanked the author meveric for the post (total 2):
mad_ady (Fri Oct 30, 2020 5:27 pm) • joerg (Fri Oct 30, 2020 7:47 pm)
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.

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

That's nice that you're bringing a new image to such a beloved device!

User avatar
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

The beauty of it is that it runs perfectly fine even on vanilla kernel from Debian. Means full Mesa support included. Panfrost works for both X11 as weil as Wayland no configuration needed. With the correct settings for flash-kernel you can just run vanilla OS and everything works.
Normal kernel updated will just work as on a regular x86 PC.

But of cause it still allows for your own kernel and Mesa as well
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.

mad_ady
Posts: 8831
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 531 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by mad_ady »

How do you manage the dtb on kernel updates? Is it static and hardcoded in boot.ini?

User avatar
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

Currently static located in /etc/flash-kernel/dtbs/ rest is handled by flash-kernel.
Generally if you have a post.inst script that copies the latest dtb to that folder you would already be done.
But I want to look if I can't tell flash-kernel directly where to look for the dtb file. Then it would be just config and no scripting (keeping it vanilla).

Edit:
Here's what I found:
If you have a correctly build Kernel (I compiled 5.10.0-rc1) that includes the dtb file, flash-kernel will find the dtb file automatically and copies it to the bootfs as needed.
This doesn't work of cause with the Kernel from Debian itself, as they don't have the dts file of the odroid-n1 (maybe someone should do a pull request?).
In that case you can place it into: /etc/flash-kernel/dtbs/
Sadly this also means, that when you install a self compiled Kernel later on, it will still use /etc/flash-kernel/dtbs/ as a source.
So even if you have an updated dtb file it would still use the old one.
A proposed solution would be to use the following script:

Code: Select all

$ cat /etc/kernel/postinst.d/copy-dtbs 
#!/bin/sh -e

version="$1"

if [ -f /usr/lib/linux-image-${version}/rockchip/rk3399-odroid-n1.dtb ]; then
	cp -av /usr/lib/linux-image-${version}/rockchip/rk3399-odroid-n1.dtb /etc/flash-kernel/dtbs/
fi
That way if you have your own Kernel it would copy your rk3399-odroid-n1.dtb to the dtbs folder.
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
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

I compiled u-boot from Debian Bullseye (2020.10) with the patches described here:
viewtopic.php?p=294262#p294262

I changed the build script to compile natively on arm64 rather than cross-compiling.
Also there are some things I really don't understand:

include/configs/odroid-n1_rk3399.h

Code: Select all

#define CONFIG_SYS_MMC_ENV_DEV         1
This overwrites the default which is 0 and causes the u-boot to ONLY look on eMMC (mmc1) to check for boot scripts and with that start the system.
If I remove this line to allow for the default, the u-boot will check on both eMMC (mmc1) and SD card (mmc0) to check for boot scripts and load the kernel etc.
Why did you put this default there, any particular reason?

Even with the u-boot that only searches for boot scripts on mmc1 if I type in the u-boot commands to boot the board (what's inside the boot.scr) it will boot from SD card just fine, so only the check for the correct boot devices was removed for whatever reason it seems.

I currently still have an issue where SD card doesn't find the rootfs properly so I will investigate the code further to see if there are other changes that force mmc1 only but overall I find it strange that the u-boot was configured to only accept eMMC as a boot device.
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.

moon.linux
Posts: 1199
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english
ODROIDs: U3, XU3. XU4, C1+...
Has thanked: 0
Been thanked: 13 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by moon.linux »

boot order is defined by # arch/arm/dts/rk3399-odroid-n1.dts
Check this patch: should fix the issue you are observing.

https://patchwork.kernel.org/project/li ... techno.de/

User avatar
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

moon.linux wrote:
Thu Nov 05, 2020 3:39 am
boot order is defined by # arch/arm/dts/rk3399-odroid-n1.dts
Check this patch: should fix the issue you are observing.

https://patchwork.kernel.org/project/li ... techno.de/
I don't think this helps.
It only defines new aliases that &sdmmc is also known as mmc1 and has nothing to do with boot order.
The boot order is defined in the u-boot and not in the Kernel dtb file.
The u-boot was already skipping the SD card, so it never gets to the point where the device tree file is even loaded.
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
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

I'm still investigating.
It seem the entire SD card isn't working at all.
If I boot from eMMC and plug in an SD card, it's registered that I plugged something in, but it will only show up errors in the process:

Code: Select all

Nov  8 08:28:46 odroid-bullseye64 kernel: [  451.934078] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
Nov  8 08:28:46 odroid-bullseye64 kernel: [  451.991358] mmc1: error -110 whilst initialising SD card
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.013476] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.282501] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.295483] dwmmc_rockchip fe320000.mmc: All phases bad!
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.301456] mmc1: tuning execution failed: -5
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.306348] mmc1: error -5 whilst initialising SD card
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.324953] mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.609171] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.622460] dwmmc_rockchip fe320000.mmc: All phases bad!
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.628484] mmc1: tuning execution failed: -5
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.633372] mmc1: error -5 whilst initialising SD card
Nov  8 08:28:46 odroid-bullseye64 kernel: [  452.652994] mmc_host mmc1: Bus speed (slot 0) = 100000Hz (slot req 100000Hz, actual 100000HZ div = 0)
Nov  8 08:28:47 odroid-bullseye64 kernel: [  452.952703] mmc_host mmc1: Bus speed (slot 0) = 148500000Hz (slot req 150000000Hz, actual 148500000HZ div = 0)
Nov  8 08:28:47 odroid-bullseye64 kernel: [  452.966126] dwmmc_rockchip fe320000.mmc: All phases bad!
Nov  8 08:28:47 odroid-bullseye64 kernel: [  452.972155] mmc1: tuning execution failed: -5
Nov  8 08:28:47 odroid-bullseye64 kernel: [  452.977044] mmc1: error -5 whilst initialising SD card
The same errors of cause I get when booting from SD card.
While the Kernel and initramfs can be loaded from bootfs, I always end in the recovery environment of initramfs with no /dev/mmcblk* or even a /dev/disk.
I don't think the SD card is activated correctly.
I played around with the settings from the old 4.4 Kernel in the dts file instead, bit doesn't change anything or doesn't work at all.
If anyone has an idea how to fix SD card support in the DTS file would be nice if you could help me out :)
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.

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: Trying to get mainline kernel working on N1

Post by brad »

meveric wrote:
Mon Nov 09, 2020 1:10 am
If anyone has an idea how to fix SD card support in the DTS file would be nice if you could help me out :)
As a test it might be worth trying to limit the sd card speed (and thus the voltage it selects) in uboot by adding this to the sd section of the dts

Code: Select all

cap-sd-highspeed;
also remove any of the sd-uhs lines if they exist. I have seen if uboot tries to negotiate higher speeds (or lower voltage) the kernel cannot find it and negotiate its own preference (but this was amlogic)

If that works then can disable uhs mode in uboot compile, add the full speeds back to dts and let the kernel negotiate it properly

Edit: maybe this wont work, uboot might have the card in uhs mode already. It might have to be disabled in uboot options and recompiled
These users thanked the author brad for the post:
meveric (Mon Nov 09, 2020 2:15 am)

User avatar
meveric
Posts: 11251
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, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: Trying to get mainline kernel working on N1

Post by meveric »

brad wrote:
Mon Nov 09, 2020 1:28 am
As a test it might be worth trying to limit the sd card speed (and thus the voltage it selects) in uboot by adding this to the sd section of the dts

Code: Select all

cap-sd-highspeed;
Already in the code, both Kernel dts as well as u-boot dts.

brad wrote:
Mon Nov 09, 2020 1:28 am
also remove any of the sd-uhs lines if they exist. I have seen if uboot tries to negotiate higher speeds (or lower voltage) the kernel cannot find it and negotiate its own preference (but this was amlogic)

If that works then can disable uhs mode in uboot compile, add the full speeds back to dts and let the kernel negotiate it properly
Thanks, apparently that's all that was needed.
In fact only in the Kernel dts file I needed to remove:

Code: Select all

--- rk3399-odroid-n1.dts.old	2020-11-04 22:33:00.338444171 +0100
+++ rk3399-odroid-n1.dts	2020-11-08 17:52:01.000000000 +0100
@@ -826,7 +826,6 @@
 	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
 	bus-width = <4>;
 	cap-sd-highspeed;
-	sd-uhs-sdr104;
 	disable-wp;
 	max-frequency = <150000000>;
 	pinctrl-names = "default";
With my previous change in the u-boot removing the:

Code: Select all

#define CONFIG_SYS_MMC_ENV_DEV         1
from include/configs/odroid-n1_rk3399.h

The board is now once again able to boot from SD and eMMC as it should be :)

Thanks a lot.
Time to update the Kernel and image ;)
These users thanked the author meveric for the post:
brad (Mon Nov 09, 2020 8:31 pm)
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.

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests