Ok, the little kid is with his mother in the park so daddy gets to play with the N1.
This time I recompiled u-boot (did a git pull on your repo yesterday), and also recompiled the 5.2.1 kernel based on your repo, with the goal of migrating to mainline uboot and mainline kernel.
I fused the emmc and rebooted with console attached. My boot.scr is built with this config:
Code: Select all
$ strings /boot/boot.scr
f]i"
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,0x152d:0x0578:u
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}
Here is the boot log, with some commands issued by me manually:
Code: Select all
U-Boot 2019.10-rc2-01501-gce78fb2834 (Aug 30 2019 - 16:31:15 +0300)
Model: Odroid-N1-RK3399 Board
DRAM: 3.9 GiB
MMC: dwmmc@fe320000: 1, sdhci@fe330000: 0
In: serial@ff1a0000
Out: serial@ff1a0000
Err: serial@ff1a0000
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:
Error: ethernet@fe300000 address not set.
eth-1: ethernet@fe300000
Hit any key to stop autoboot: 0
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
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe380000 for devices... 1 USB Device(s) found
scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Device 0: unknown device
No ethernet found.
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/000000
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.
No ethernet found.
# printenv
arch=arm
baudrate=115200
board=odroidn1_rk3399
board_name=odroidn1_rk3399
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc0 mmc1 usb0 pxe dhcp
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=devnum=0; run usb_boot
bootdelay=2
bootfstype=fat
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdt_addr_r=0x01f00000
fdtcontroladdr=f5f2ba68
kernel_addr_r=0x02080000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
partitions=uuid_disk=${uuid_gpt_disk};name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};name=trust,size=4M,uuid=${uuid_gpt_atf};name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};name=rootfs,size=-,uuid=B921B045-1DF0-41C3-AF44-4C6F280D3FAE;
pxefile_addr_r=0x00600000
ramdisk_addr_r=0x04000000
sata_boot=if sata dev ${devnum}; then devtype=sata; run scan_dev_for_boot_part; fi
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x00500000
soc=rk3399
stderr=serial@ff1a0000
stdin=serial@ff1a0000
stdout=serial@ff1a0000
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=rockchip
Environment size: 4011/32764 bytes
# mmcinfo
Device: sdhci@fe330000
Manufacturer ID: 15
OEM: 100
Name: BJTD4
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.1 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.1 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
# fatls mmc 0:1
15839240 Image.owersun
backup-4.4/
19654664 Image
689 boot.ini.4.4
313 boot.ini.default
813 boot.ini
705 boot.ini.petitboot
204800 idbspl.bin
72839 rk3399-odroidn1-linux.dtb
11526152 Image.mainline
22367 rk3399-odroidn1-linux.dts
788844 u-boot.itb
9648346 uInitrd
3543910 uInitrd.igz
55252 rk3399-odroidn1-mainline.dtb
9761217 uInitrd.mainline
7554157 uInitrd.owersun
813 boot.ini.owersun
93314 rk3399-odroidn1-linux-owersun.dtb
748 boot.ini.mainline
19 file(s), 1 dir(s)
# ext4ls mmc 0:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<DIR> 4096 snap
<DIR> 4096 boot
<DIR> 4096 srv
<DIR> 12288 etc
<DIR> 4096 dev
<DIR> 4096 DataVolume
<DIR> 4096 root
<DIR> 4096 backup
<DIR> 4096 sys
<DIR> 4096 media
<DIR> 4096 proc
<DIR> 4096 run
<DIR> 4096 bin
<DIR> 4096 mnt
<DIR> 4096 var
<DIR> 4096 usr
<DIR> 4096 opt
<DIR> 4096 lib
<DIR> 12288 sbin
<DIR> 4096 tmp
<DIR> 4096 home
<DIR> 4096 tee
932 webmin-setup.out
134217728 .journal
# ext4ls mmc 0:2 boot
<DIR> 4096 .
<DIR> 4096 ..
144129 config-4.4.169
7554157 uInitrd-4.4.169
7557000 initrd.img-4.4.169
<DIR> 4096 uboot-mainline
519 boot4.4.txt
409 boot.txt
15839240 Image.owersun
93314 rk3399-odroidn1-linux-owersun.dtb
7554157 uInitrd.owersun
481 boot.scr
591 boot4.4.scr
441 boot4.4-noinitrd.txt
513 boot4.4-noinitrd.scr
16757248 vmlinuz-5.2.1+
3772174 System.map-5.2.1+
9892741 initrd.img-5.0.0-rc3-329696-g2d7194c14b31
228076 config-5.2.1+
56270 rk3399-odroidn1.dtb
9582691 initrd.img-5.2.1+
16482816 vmlinuz-5.2.1+.old
69 make_boot_scr.sh
3714466 System.map-5.2.1+.old
227540 config-5.2.1+.old
# 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,0x152d:0x0578:u
# 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}
## Flattened Device Tree blob at 01f00000
Booting using the fdt blob at 0x1f00000
Loading Device Tree to 00000000f5f10000, end 00000000f5f29c81 ... OK
fdt_find_or_add_subnode: chosen: FDT_ERR_BADSTRUCTURE
ERROR: /chosen node create failed
- must RESET the board to recover.
FDT creation failed! hanging...### ERROR ### Please RESET the board ###
I have a 32G Orange EMMC connected to the N1. It seems uboot can see it just fine (I listed the first partition just for reference, I know it's not used), but it can't boot from it. It may be it's searching for boot.scr only on the first partition (and I have it on the second one). I may need to try to create /boot/boot.scr on the vfat partition (if uboot can accept the first partition as vfat - not sure).
But in any case, I tried to load the commands manually and it failed. Not sure where it would try to map /boot (for /boot/vmlinuz, etc) if it's on the second partition. I'm guessing it's relative to where boot.scr was found, right? In this case I may need to move kernel/dtb together with boot.scr on the first partition, right?
Any other suggestions?
I will need to see when my next maintenance window will be - maybe monday if weather permits...