SPI + NVMe booting(beta)

I just got a weird one as also made a mistake but mtd0 dissapeared doing something else I removed the nvme and mtd0 turned back up on next boot ??!!

If I boot now with sd card in

linaro@linaro-alip:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0    29G  0 disk
├─mmcblk0p1 179:1    0   3.9M  0 part
├─mmcblk0p2 179:2    0     4M  0 part
├─mmcblk0p3 179:3    0     4M  0 part
├─mmcblk0p4 179:4    0   512M  0 part
└─mmcblk0p5 179:5    0  28.5G  0 part /media/linaro/2670c200-f2ba-4a8f-a4a2-2c78
nvme0n1     259:0    0 111.8G  0 disk
├─nvme0n1p1 259:1    0   3.9M  0 part
├─nvme0n1p2 259:2    0     4M  0 part
├─nvme0n1p3 259:3    0     4M  0 part
├─nvme0n1p4 259:4    0   512M  0 part /boot
└─nvme0n1p5 259:5    0 111.3G  0 part /

But no /dev/md0

linaro@linaro-alip:~$ sudo -i
root@linaro-alip:~# ls /dev
autofs           i2c-0         mali0               nvme0n1p2     stdout  tty24  tty41  tty59    usbmon2  vcsa3
block            i2c-1         mapper              nvme0n1p3     tty     tty25  tty42  tty6     usbmon3  vcsa4
btrfs-control    i2c-2         media0              nvme0n1p4     tty0    tty26  tty43  tty60    usbmon4  vcsa5
bus              i2c-7         mem                 nvme0n1p5     tty1    tty27  tty44  tty61    usbmon5  vcsa6
cec0             i2c-9         memory_bandwidth    opteearmtz00  tty10   tty28  tty45  tty62    usbmon6  vcsa7
char             iio:device0   mmcblk0             port          tty11   tty29  tty46  tty63    usbmon7  vhci
console          initctl       mmcblk0p1           ppp           tty12   tty3   tty47  tty7     usbmon8  video0
cpu_dma_latency  input         mmcblk0p2           ptmx          tty13   tty30  tty48  tty8     v4l      video1
disk             kmsg          mmcblk0p3           pts           tty14   tty31  tty49  tty9     vcs      video2
dri              log           mmcblk0p4           ram0          tty15   tty32  tty5   ttyS0    vcs1     video3
fb0              loop-control  mmcblk0p5           random        tty16   tty33  tty50  ttyS1    vcs2     vpu_service
fd               loop0         mqueue              rfkill        tty17   tty34  tty51  ttyS2    vcs3     watchdog
full             loop1         net                 rkvdec        tty18   tty35  tty52  ttyS3    vcs4     zero
fuse             loop2         network_latency     rtc           tty19   tty36  tty53  ttyS4    vcs5
hdmi_hdcp1x      loop3         network_throughput  rtc0          tty2    tty37  tty54  uhid     vcs6
hidraw0          loop4         null                shm           tty20   tty38  tty55  uinput   vcs7
hidraw1          loop5         nvme0               snd           tty21   tty39  tty56  urandom  vcsa
hugepages        loop6         nvme0n1             stderr        tty22   tty4   tty57  usbmon0  vcsa1
hwrng            loop7         nvme0n1p1           stdin         tty23   tty40  tty58  usbmon1  vcsa2

The kernel goes through a bit of a song and dance

Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 221
Spi_ChipId = ef4017
SpiBootInit:0
mmc0:cmd5,32
SdmmcInit=0 0
BootCapSize=0
UserCapSize=29664MB
FwPartOffset=2000 , 0
StorageInit ok = 163161
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT  signature is wrong
LoadTrust Addr:0x1800
LoadTrust Addr:0x1c00
LoadTrust Addr:0x2000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3000
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1400
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3400
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1800
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3800
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1c00
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3c00
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 2000
Load OK, addr=0x200000, size=0xeea98
RunBL31 0x10000
.NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02676-g4490220 (Jul 30 2019 - 17:52:33 +0800)

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  2 GiB
Relocation Offset is: 7dbe0000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
dcache off

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Bootdev: nvme 0
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
rockchip_get_boot_mode: dev_desc is NULL!
rockchip_get_bootdev: can't find dev_desc!
init_resource_list: dev_desc is NULL!
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  1 ... 0 

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Scanning nvme 0:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
825 bytes read in 2 ms (402.3 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 0, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_overlay[0] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[1] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
ERROR: status = 13, phase = 1, head = 1
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-90-rockchip-ga14f6502e045 **
Skipping kernel-4.4.154-90-rockchip-ga14f6502e045 for failure retrieving kernel
Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 2, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 3, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 4
hw_conf.dts_overlay[0] = 
hw_conf.dts_overlay[1] = 
hw_conf.dts_overlay[2] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[3] = /overlays/spi1-flash.dtbo
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Retrieving file: /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
reading /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
ERROR: status = 13, phase = 1, head = 0
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-88-rockchip-00030-g90239a6 **
Skipping kernel-4.4.154-88-rockchip-00030-g90239a6 for failure retrieving kernel
SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
597 bytes read in 5 ms (116.2 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 3 ms (559.6 KiB/s)
dtoverlay number: 4, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 5, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 6
hw_conf.dts_overlay[0] = 
hw_conf.dts_overlay[1] = 
hw_conf.dts_overlay[2] = 
hw_conf.dts_overlay[3] = 
hw_conf.dts_overlay[4] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[5] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
19427336 bytes read in 822 ms (22.5 MiB/s)
append: earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1d rw rootwait rootfstype=ext4
Retrieving file: /dtbs/4.4.154-90-rockchip-ga14f6502e045/rockchip/rockpi-4b-linux.dtb
reading /dtbs/4.4.154-90-rockchip-ga14f6502e045/rockchip/rockpi-4b-linux.dtb
93859 bytes read in 20 ms (4.5 MiB/s)
fdt addr 0000000008300000
fdt magic number edfe0dd0
fdt size 1048576
merge_dts_overlay
Retrieving file: /extlinux/
** Unable to read file /extlinux/ **
Can't load dts overlay
Can not merge dts overlay
## Flattened Device Tree blob at 08300000
   Booting using the fdt blob at 0x8300000
   Loading Device Tree to 0000000071cc3000, end 0000000071dc5fff ... OK
Adding bank: 0x00200000 - 0x80000000 (size: 0x7fe00000)
Total: 5701.581 ms

Starting kernel ...

Remove the SD card no boot but for some reason is trying network boot

Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 221
Spi_ChipId = ef4017
SpiBootInit:0
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
SdmmcInit=0 1
StorageInit ok = 21732
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT vendor signature is wrong
LoadTrust Addr:0x1800
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
Load OK, addr=0x200000, size=0xee888
RunBL31 0x10000
.NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02676-g4490220395 (Jul 01 2019 - 07:49:56 +0000)

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  2 GiB
Relocation Offset is: 7dbe0000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
dcache off

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Bootdev: nvme 0
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
rockchip_get_boot_mode: dev_desc is NULL!
rockchip_get_bootdev: can't find dev_desc!
init_resource_list: dev_desc is NULL!
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  1 ... 0 

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Scanning nvme 0:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
825 bytes read in 2 ms (402.3 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 0, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_overlay[0] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[1] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
ERROR: status = 13, phase = 1, head = 1
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-90-rockchip-ga14f6502e045 **
Skipping kernel-4.4.154-90-rockchip-ga14f6502e045 for failure retrieving kernel
Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 2, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 3, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 4
hw_conf.dts_overlay[0] = 
hw_conf.dts_overlay[1] = 
hw_conf.dts_overlay[2] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[3] = /overlays/spi1-flash.dtbo
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Retrieving file: /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
reading /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
ERROR: status = 13, phase = 1, head = 0
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-88-rockchip-00030-g90239a6 **
Skipping kernel-4.4.154-88-rockchip-00030-g90239a6 for failure retrieving kernel
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
mmc_init: -95, time 9
Card did not respond to voltage select!
mmc_init: -95, time 27
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   failed to get usb phy
Port not available.
USB3:   failed to get usb phy
Port not available.
USB4:   Can't get the usbphy register address
probe failed, error -6
USB5:   Can't get the usbphy register address
probe failed, error -6
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
ethernet@fe300000 Waiting for PHY auto negotiation to complete.. done
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.10 (108 ms)
*** Warning: no boot file name; using 'C0A8010A.img'
Using ethernet@fe300000 device
TFTP from server 0.0.0.0; our IP address is 192.168.1.10; sending through gateway 192.168.1.1
Filename 'C0A8010A.img'.
Load address: 0x800800
Loading: *.T T T T T T 

Remove the nvme

Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 221
Spi_ChipId = ef4017
SpiBootInit:0
mmc0:cmd5,32
SdmmcInit=0 0
BootCapSize=0
UserCapSize=29664MB
FwPartOffset=2000 , 0
StorageInit ok = 160828
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT  signature is wrong
LoadTrust Addr:0x1800
LoadTrust Addr:0x1c00
LoadTrust Addr:0x2000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3000
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1400
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3400
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1800
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3800
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 1c00
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

tag:LOADER error,addr:0x3c00
hdr 00000000031912c0 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

Load uboot, ReadLba = 2000
Load OK, addr=0x200000, size=0xeea98
RunBL31 0x10000
.NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02676-g4490220 (Jul 30 2019 - 17:52:33 +0800)

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  2 GiB
Relocation Offset is: 7dbe0000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
dcache off

Device 0: unknown device
dcache on
switch to partitions #0, OK
mmc1 is current device
do_rkimg_test found IDB in SDcard
Boot from SDcard
Bootdev: mmc 1
PartType: EFI
get part misc fail -1
boot mode: None
init_resource_list: failed to get resource part, ret=-1
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  1 ... 0 

Device 0: unknown device
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
597 bytes read in 5 ms (116.2 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 3 ms (559.6 KiB/s)
dtoverlay number: 0, name:/overlays/pcie-gen2.dtbo 
dtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_overlay[0] = /overlays/pcie-gen2.dtbo
hw_conf.dts_overlay[1] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
19427336 bytes read in 822 ms (22.5 MiB/s)
append: earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1d rw rootwait rootfstype=ext4
Retrieving file: /dtbs/4.4.154-90-rockchip-ga14f6502e045/rockchip/rockpi-4b-linux.dtb
reading /dtbs/4.4.154-90-rockchip-ga14f6502e045/rockchip/rockpi-4b-linux.dtb
93859 bytes read in 19 ms (4.7 MiB/s)
fdt addr 0000000008300000
fdt magic number edfe0dd0
fdt size 1048576
merge_dts_overlay
Retrieving file: /overlays/pcie-gen2.dtbo
reading /overlays/pcie-gen2.dtbo
313 bytes read in 5 ms (60.5 KiB/s)
overlay dtb(0x0000000008200000) is valid
fdt_overlay_apply 0000000008300000 0000000008200000
merge_dts_overlay
Retrieving file: /overlays/spi1-flash.dtbo
reading /overlays/spi1-flash.dtbo
765 bytes read in 7 ms (106.4 KiB/s)
overlay dtb(0x0000000008200000) is valid
fdt_overlay_apply 0000000008300000 0000000008200000
## Flattened Device Tree blob at 08300000
   Booting using the fdt blob at 0x8300000
   Loading Device Tree to 0000000071cc3000, end 0000000071dc5fff ... OK
Adding bank: 0x00200000 - 0x80000000 (size: 0x7fe00000)
Total: 9566.762 ms

Starting kernel ...

mtd0 is back again

linaro@linaro-alip:~$ ls /dev
autofs           loop2               ram0    tty25  tty52    usbmon6
block            loop3               random  tty26  tty53    usbmon7
btrfs-control    loop4               rfkill  tty27  tty54    usbmon8
bus              loop5               rkvdec  tty28  tty55    v4l
cec0             loop6               rtc     tty29  tty56    vcs
char             loop7               rtc0    tty3   tty57    vcs1
console          mali0               shm     tty30  tty58    vcs2
cpu_dma_latency  mapper              snd     tty31  tty59    vcs3
disk             media0              stderr  tty32  tty6     vcs4
dri              mem                 stdin   tty33  tty60    vcs5
fb0              memory_bandwidth    stdout  tty34  tty61    vcs6
fd               mmcblk0             tty     tty35  tty62    vcs7
full             mmcblk0p1           tty0    tty36  tty63    vcsa
fuse             mmcblk0p2           tty1    tty37  tty7     vcsa1
hdmi_hdcp1x      mmcblk0p3           tty10   tty38  tty8     vcsa2
hidraw0          mmcblk0p4           tty11   tty39  tty9     vcsa3
hidraw1          mmcblk0p5           tty12   tty4   ttyS0    vcsa4
hugepages        mqueue              tty13   tty40  ttyS1    vcsa5
hwrng            mtd0                tty14   tty41  ttyS2    vcsa6
i2c-0            mtd0ro              tty15   tty42  ttyS3    vcsa7
i2c-1            mtdblock0           tty16   tty43  ttyS4    vhci
i2c-9            net                 tty17   tty44  uhid     video0
iio:device0      network_latency     tty18   tty45  uinput   video1
initctl          network_throughput  tty19   tty46  urandom  video2
input            null                tty2    tty47  usbmon0  video3
kmsg             opteearmtz00        tty20   tty48  usbmon1  vpu_service
log              port                tty21   tty49  usbmon2  watchdog
loop-control     ppp                 tty22   tty5   usbmon3  zero
loop0            ptmx                tty23   tty50  usbmon4
loop1            pts                 tty24   tty51  usbmon5

So I am going to edit //boot/extlinux/extlinux.conf
Force sd use as the partition labels are duplicated so use device as fstab is empty
reboot

fdisk /dev/nvme0n1
d 5-1 delete those partitions
w
fdisk /dev/nvme0n
o
write a new disklabel and identifier
w

Okay so now completely clean nvme again
Now pull sd card and flash with image from top.
https://dl.radxa.com/rockpi4/images/debian/rockpi4-debian-stretch-desktop-arm64-20190730_2022-gpt.img.gz

Boot
sudo /usr/local/sbin/rockpi4b_upgrade_bootloader.sh finishes with

Step two: upgrade bootloader on uSD card or eMMC
Boot device, uSD card or eMMC, is not found.
Done.
linaro@linaro-alip:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mtdblock0    31:0    0     4M  0 disk
mmcblk0     179:0    0    29G  0 disk
├─mmcblk0p1 179:1    0   3.9M  0 part
├─mmcblk0p2 179:2    0     4M  0 part
├─mmcblk0p3 179:3    0     4M  0 part
├─mmcblk0p4 179:4    0   512M  0 part
└─mmcblk0p5 179:5    0  28.5G  0 part /
nvme0n1     259:0    0 111.8G  0 disk

sudo apt-get install pigz
for some reason

Unpacking pigz (2.3.4-1) ...
Setting up rockpi4b-rk-ubootimg (2017.09-2676-g4490220395-5) ...
Consider upgrading device bootloader with 'rockpi4b_upgrade_bootloader.sh'.
You are currently running on board:
ROCK PI 4B
There will be two steps that you have to confirm. One is upgrading bootloader on SPI Flash.
The other is upgrading bootloader on eMMC or uSD card.

Step one: upgrade bootloader on SPI Flash
One boot device, SPI Flash, is found, would you like to upgrade bootloader on it?
The installation would cost several minutes.
If yes, type Y/y. If no, type N/n.

So N as already just done that but why did it start again??!

unpigz -p 6 -c rockpi4-debian-stretch-desktop-arm64-20190730_2022-gpt.img.gz | sudo dd of=/dev/nvme0n1 bs=4M conv=fsync status=progress
quick!

linaro@linaro-alip:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mtdblock0    31:0    0     4M  0 disk
mmcblk0     179:0    0    29G  0 disk
├─mmcblk0p1 179:1    0   3.9M  0 part
├─mmcblk0p2 179:2    0     4M  0 part
├─mmcblk0p3 179:3    0     4M  0 part
├─mmcblk0p4 179:4    0   512M  0 part
└─mmcblk0p5 179:5    0  28.5G  0 part /
nvme0n1     259:0    0 111.8G  0 disk
├─nvme0n1p1 259:1    0   3.9M  0 part
├─nvme0n1p2 259:2    0     4M  0 part
├─nvme0n1p3 259:3    0     4M  0 part
├─nvme0n1p4 259:4    0   512M  0 part
└─nvme0n1p5 259:5    0     3G  0 part
Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 221
Spi_ChipId = ef4017
SpiBootInit:0
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
SdmmcInit=0 1
StorageInit ok = 21731
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT vendor signature is wrong
LoadTrust Addr:0x1800
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
Load OK, addr=0x200000, size=0xee888
RunBL31 0x10000
.NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02676-g4490220395 (Jul 01 2019 - 07:49:56 +0000)

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  2 GiB
Relocation Offset is: 7dbe0000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
dcache off

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Bootdev: nvme 0
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
rockchip_get_boot_mode: dev_desc is NULL!
rockchip_get_bootdev: can't find dev_desc!
init_resource_list: dev_desc is NULL!
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  1 ... 0 

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Scanning nvme 0:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
598 bytes read in 1 ms (584 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 0, name:/overlays/console-on-ttyS2.dtbo 
dtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_overlay[0] = /overlays/console-on-ttyS2.dtbo
hw_conf.dts_overlay[1] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
ERROR: status = 13, phase = 0, head = 0
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-90-rockchip-ga14f6502e045 **
Skipping kernel-4.4.154-90-rockchip-ga14f6502e045 for failure retrieving kernel
Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 2, name:/overlays/console-on-ttyS2.dtbo 
dtoverlay number: 3, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 4
hw_conf.dts_overlay[0] = 
hw_conf.dts_overlay[1] = 
hw_conf.dts_overlay[2] = /overlays/console-on-ttyS2.dtbo
hw_conf.dts_overlay[3] = /overlays/spi1-flash.dtbo
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Retrieving file: /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
reading /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
ERROR: status = 13, phase = 0, head = 1
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-88-rockchip-00030-g90239a6 **
Skipping kernel-4.4.154-88-rockchip-00030-g90239a6 for failure retrieving kernel
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
mmc_init: -95, time 9
Card did not respond to voltage select!
mmc_init: -95, time 27
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   failed to get usb phy
Port not available.
USB3:   failed to get usb phy
Port not available.
USB4:   Can't get the usbphy register address
probe failed, error -6
USB5:   Can't get the usbphy register address
probe failed, error -6
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
ethernet@fe300000 Waiting for PHY auto negotiation to complete.. done
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.10 (88 ms)
*** Warning: no boot file name; using 'C0A8010A.img'
Using ethernet@fe300000 device
TFTP from server 0.0.0.0; our IP address is 192.168.1.10; sending through gateway 192.168.1.1
Filename 'C0A8010A.img'.
Load address: 0x800800
Loading: *.T T 

trying to pxeboot again!!!
Eventually its times out and I am in uboot
so

=> nvme scan
=> 
=> nvme detail
Blk device 0: Optional Admin Command Support:
.Namespace Management/Attachment: no
.Firmware Commit/Image download: yes
.Format NVM: yes
.Security Send/Receive: yes
Blk device 0: Optional NVM Command Support:
.Reservation: yes
.Save/Select field in the Set/Get features: yes
.Write Zeroes: yes
.Dataset Management: yes
.Write Uncorrectable: no
Blk device 0: Format NVM Attributes:
.Support Cryptographic Erase: yes
.Support erase a particular namespace: Yes
.Support format a particular namespace: No
Blk device 0: LBA Format Support:
.LBA Foramt 0 Support: (current)
..Metadata Size: 0
..LBA Data Size: 512
..Relative Performance: Better
Blk device 0: End-to-End DataProtect Capabilities:
.As last eight bytes: No
.As first eight bytes: No
.Support Type3: No
.Support Type2: No
.Support Type1: No
Blk device 0: Metadata capabilities:
.As part of a separate buffer: No
.As part of an extended data LBA: No
=> 
Blk device 0: Optional Admin Command Support:
.Namespace Management/Attachment: no
.Firmware Commit/Image download: yes
.Format NVM: yes
.Security Send/Receive: yes
Blk device 0: Optional NVM Command Support:
.Reservation: yes
.Save/Select field in the Set/Get features: yes
.Write Zeroes: yes
.Dataset Management: yes
.Write Uncorrectable: no
Blk device 0: Format NVM Attributes:
.Support Cryptographic Erase: yes
.Support erase a particular namespace: Yes
.Support format a particular namespace: No
Blk device 0: LBA Format Support:
.LBA Foramt 0 Support: (current)
..Metadata Size: 0
..LBA Data Size: 512
..Relative Performance: Better
Blk device 0: End-to-End DataProtect Capabilities:
.As last eight bytes: No
.As first eight bytes: No
.Support Type3: No
.Support Type2: No
.Support Type1: No
Blk device 0: Metadata capabilities:
.As part of a separate buffer: No
.As part of an extended data LBA: No
=> nvme info
Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
=> 
Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
=> 
=> rkimgtest
"Synchronous Abort" handler, esr 0x96000010
* Relocate offset = 000000007dbe0000
* ELR(PC)    =   000000000028fc1c
* LR         =   000000000028fc7c
* SP         =   0000000071dca7a0

* ESR_EL2    =   0000000096000010
.EC[31:26] == 100101, Exception from a Data abort, from current exception level
.IL[25] == 1, 32-bit instruction trapped

* DAIF       =   00000000000003c0
.D[9] == 1, DBG masked
.A[8] == 1, ABORT masked
.I[7] == 1, IRQ masked
.F[6] == 1, FIQ masked

* SPSR_EL2   =. 0000000060000349
.D[9] == 1, DBG masked
.A[8] == 1, ABORT masked
.I[7] == 0, IRQ not masked
.F[6] == 1, FIQ masked
.M[4] == 0, Exception taken from AArch64
.M[3:0] == 1001, EL2h

* SCTLR_EL2  =. 0000000030c51830
.I[12] == 1, Icaches enabled
.C[2] == 0, Dcache disabled
.M[0] == 0, MMU disabled

* HCR_EL2    =   000000000800003a
* VBAR_EL2   =   000000007dde0800
* TTBR0_EL2  =   000000007fff0000

x0 : 0000000000000020 x1 : 0000000000000010
x2 : 0000000000000010 x3 : 0000000071e03820
x4 : 000000007dde7108 x5 : 0000000000000074
x6 : 0000000000000000 x7 : 0000000000000000
x8 : 0000000071e32b40 x9 : 0000000000000008
x10: 00000000ffffffd8 x11: 0000000000000006
x12: 000000000001869f x13: 0000000000010310
x14: 000000000000000b x15: 0000000000000002
x16: 0000000000002100 x17: 00000000888f2042
x18: 0000000071dd7d80 x19: 0000000000000000
x20: 0000000000000000 x21: 0000000071e03820
x22: 000000007dec2d1c x23: 0000000000000001
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000071e08890 x29: 0000000071dca980

SP:
71dca7a0:  00000000 00000000 00000000 00000000 
71dca7b0:  00000000 00000000 7de9bb02 00000000 
71dca7c0:  00000000 00000000 00000000 00000000 
71dca7d0:  7de9bb49 00000000 7de9bb6f 00000000 
71dca7e0:  7de9bbbc 00000000 7de9bc09 00000000 
71dca7f0:  7de9bc49 00000000 7de9bc89 00000000 
71dca800:  7de9bcc6 00000000 00000000 00000000 
71dca810:  00000000 00000000 7de9bd03 00000000 
71dca820:  71dca980 00000000 7dde0a0c 00000000 
71dca830:  00000000 00000000 7deae6d0 00000000 
71dca840:  7fff0000 00000000 0800003a 00000000 
71dca850:  30c51830 00000000 71dca7a0 00000000 
71dca860:  60000349 00000000 7dde0800 00000000 
71dca870:  000003c0 00000000 96000010 00000000 
71dca880:  7de6fc1c 00000000 00000020 00000000 
71dca890:  00000010 00000000 00000010 00000000 


Call trace:
  PC:.[< 0028fc1c >]
  LR:.[< 0028fc7c >]

Stack:
.[< 0028fc1c >]
.[< 00207124 >]
.[< 002298f8 >]
.[< 00214f1c >]
.[< 002150c0 >]
.[< 00215600 >]
.[< 00228fd8 >]
.[< 002131c4 >]
.[< 00215cdc >]
.[< 00277454 >]
.[< 00215eec >]
.[< 00201b8c >]

NOTE: Please use ./scripts/stacktrace.sh to parse trace info
Resetting CPU ...

DDR Version 1.20 20190314
In
soft reset
SRX
channel 0
CS = 0
MR0=0x98
MR4=0x3
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0x0
channel 1
CS = 0
MR0=0x98
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0x0
channel 0 training pass!
channel 1 training pass!
change freq to 400MHz 0,1
channel 0
CS = 0
MR0=0x98
MR4=0x3
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0x0
channel 1
CS = 0
MR0=0x98
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0x0
channel 0 training pass!
channel 1 training pass!
change freq to 800MHz 1,0
Channel 0: LPDDR4,800MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Channel 1: LPDDR4,800MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
256B stride
ch 0 ddrconfig = 0x101, ddrsize = 0x20
ch 1 ddrconfig = 0x101, ddrsize = 0x20
pmugrf_os_reg[2] = 0x3281F281, stride = 0x9
OUT
Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 279
Spi_ChipId = ef4017
SpiBootInit:0
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
SdmmcInit=0 1
StorageInit ok = 23267
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT vendor signature is wrong
LoadTrust Addr:0x1800
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
Load OK, addr=0x200000, size=0xee888
RunBL31 0x10000
NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02676-g4490220395 (Jul 01 2019 - 07:49:56 +0000)

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  2 GiB
Relocation Offset is: 7dbe0000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
dcache off

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Bootdev: nvme 0
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
rockchip_get_bootdev: can't find dev_desc!
rockchip_get_boot_mode: dev_desc is NULL!
rockchip_get_bootdev: can't find dev_desc!
init_resource_list: dev_desc is NULL!
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  1 ... 0 

Device 0: Vendor: 0x1987 Rev: E8FMQ1.9 Prod: CD8E0791179E52095009
            Type: Hard Disk
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
... is now current device
Scanning nvme 0:4...
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
598 bytes read in 2 ms (292 KiB/s)
select kernel
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Enter choice: Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 0, name:/overlays/console-on-ttyS2.dtbo 
dtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_overlay[0] = /overlays/console-on-ttyS2.dtbo
hw_conf.dts_overlay[1] = /overlays/spi1-flash.dtbo
1:.kernel-4.4.154-90-rockchip-ga14f6502e045
Retrieving file: /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
reading /vmlinuz-4.4.154-90-rockchip-ga14f6502e045
ERROR: status = 13, phase = 0, head = 0
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-90-rockchip-ga14f6502e045 **
Skipping kernel-4.4.154-90-rockchip-ga14f6502e045 for failure retrieving kernel
Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1720 bytes read in 1 ms (1.6 MiB/s)
dtoverlay number: 2, name:/overlays/console-on-ttyS2.dtbo 
dtoverlay number: 3, name:/overlays/spi1-flash.dtbo 
hw_conf.valid = 1
hw_conf.pwm0 = 0
hw_conf.pwm1 = 0
hw_conf.uart2 = 0
hw_conf.uart4 = 0
hw_conf.spi1 = 1
hw_conf.spi2 = 0
hw_conf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 4
hw_conf.dts_overlay[0] = 
hw_conf.dts_overlay[1] = 
hw_conf.dts_overlay[2] = /overlays/console-on-ttyS2.dtbo
hw_conf.dts_overlay[3] = /overlays/spi1-flash.dtbo
2:.kernel-4.4.154-88-rockchip-00030-g90239a6
Retrieving file: /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
reading /vmlinuz-4.4.154-88-rockchip-00030-g90239a6
ERROR: status = 13, phase = 0, head = 1
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-88-rockchip-00030-g90239a6 **
Skipping kernel-4.4.154-88-rockchip-00030-g90239a6 for failure retrieving kernel
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
mmc_init: -95, time 9
Card did not respond to voltage select!
mmc_init: -95, time 27
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   failed to get usb phy
Port not available.
USB3:   failed to get usb phy
Port not available.
USB4:   Can't get the usbphy register address
probe failed, error -6
USB5:   Can't get the usbphy register address
probe failed, error -6
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
ethernet@fe300000 Waiting for PHY auto negotiation to complete.. done
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.10 (161 ms)
*** Warning: no boot file name; using 'C0A8010A.img'
Using ethernet@fe300000 device
TFTP from server 0.0.0.0; our IP address is 192.168.1.10; sending through gateway 192.168.1.1
Filename 'C0A8010A.img'.
Load address: 0x800800
Loading: *.T T T T 
=> part list nvme 0

Partition Map for NVMe device 0  --   Partition Type: EFI

Part.Start LBA.End LBA..Name
.Attributes
.Type GUID
.Partition GUID
  1.0x00000040.0x00001f7f."loader1"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.4c98c92e-398a-4fb8-afd1-1529095b79b8
  2.0x00004000.0x00005fff."loader2"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.c8bdd4f5-12d8-42b8-8f69-147391c0438a
  3.0x00006000.0x00007fff."trust"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.8e58643e-760f-452c-94f9-8703182e8fb2
  4.0x00008000.0x00107fff."boot"
.attrs:.0x0000000000000000
.type:.c12a7328-f81f-11d2-ba4b-00a0c93ec93b
.guid:.bbf86b96-61b3-446d-a789-bed7e5b85490
  5.0x00108000.0x006fdfde."rootfs"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.b921b045-1df0-41c3-af44-4c6f280d3fae
=> 

Partition Map for NVMe device 0  --   Partition Type: EFI

Part.Start LBA.End LBA..Name
.Attributes
.Type GUID
.Partition GUID
  1.0x00000040.0x00001f7f."loader1"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.4c98c92e-398a-4fb8-afd1-1529095b79b8
  2.0x00004000.0x00005fff."loader2"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.c8bdd4f5-12d8-42b8-8f69-147391c0438a
  3.0x00006000.0x00007fff."trust"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.8e58643e-760f-452c-94f9-8703182e8fb2
  4.0x00008000.0x00107fff."boot"
.attrs:.0x0000000000000000
.type:.c12a7328-f81f-11d2-ba4b-00a0c93ec93b
.guid:.bbf86b96-61b3-446d-a789-bed7e5b85490
  5.0x00108000.0x006fdfde."rootfs"
.attrs:.0x0000000000000000
.type:.0fc63daf-8483-4772-8e79-3d69d8477de4
.guid:.b921b045-1df0-41c3-af44-4c6f280d3fae
=> 

I am seaching mouser electronics to order a tradename “SpiFlash”, NOR flash, spi interface, 2.7v matching the parts listed in the wiki hardware. The closest I can find are the series W25Q64JV.
they are all size SOIC-8, none really low-profile.

Anyone have recommendations

edit: I found the answer to part numbers… use the last digit of Q

Q(5)=Green Package (Lead-free, RoHS Compliant, Halogen-free (TBBA), Antimony-Oxide-free Sb2O3)with QE = 1 (fixed) in Status register-2.

Backward compatible to FV family.

Looks like you have issue loading image from spi flash. Is the flash good? Maybe you need to flash it from the usb otg port to make sure clean image inside.

It’s safe to update rockpi4b-rk-u-boot-latest and rockpi4b-rk-uboot.img.
What’s brand of your NVMe SSD?

The nvme that I am using with good success is

Lenova SL700 PCIe m.2 ssd 2280 256G

Note when ‘initializing’ and formating on a windows 10 was a little crazy before writing the
debian image. I ended up having to use minitool partition wizard free from http://www.PartitionWizard.com then a simple fat32

The heatsik if you look at it is actually cutaway at least on latter units where the Flash fits.
So there isn’t much problem apart from its an extremely fiddly job for old eyes and hands.

Hi there, thanks for the steps, it works for my KingSpec 256GB NVMe drive. But after it boots up form the NVMe drive, I did a update & upgrade but some how, it prompt to me to write the latest to some where which I am not sure of and I key Yes. Half way writing it just hanged. I had to power off the unit and it cannot boot up at all from NVMe or the SDcard(with the NVMe drive connected) that was flashed with 20190730_2022 image. But when I used the older SDcard that was flashed with 20190xx_2012(I think) image, it can boot up from SDcard with the NVMe drive connected. How to completely erase the NVMe drive partition with the older flashed(2012) that cannot detect the NVMe(lsblk). Thanks

With my ‘working’ nvme I did the sudo apt update , and it still listed the two files I listed a couple of days ago as upgradable,

So I ran sudo apt upgrade, It prompted me to ‘consider reflashing the spi’ It said something about the two step process and it would take seven minutes. So I said no to the bootloader.sh.

I rebooted just fine on the nvme, ran apt update and upgrade, it says all up to date. So I guess don’t attempt to the repeat the spiflash if you update from the repository. I think the
rockpi4b-rk-xxxxxx version 2019.09-2676-g4490220395-7 is different from the version in the
image I used from post #1 of this thread.

Now I am not able to boot up from the NVMe with the SDcard. Any way to go around it? Thanks

How to clean the old NVMe.

Flash the 20190730_2022-gpt.img.gz to SD card, and edit the extlinux/extlinux.conf in sdx4 partition and change

root=PARTUUID=bb921b045-1d

to

root=/dev/mmcblk0p4

so you will not mount the nvme as root booting from uSD card.

Then boot into the uSD Linux and run

dd if=/dev/zero of=/dev/nvme0n1 bs=1M count=100

and reboot, you will not load the kernel in NVMe but uSD card instead.

Now you should see /dev/mtd* and update the u-boot in spi again.

Then write the 20190730_2022-gpt.img.gz to nvme again.

Remove the uSD card and boot from NVMe.

Ok. thank you Jack. I try it over the week end. Blessing

HI Jack, seems like I am not able to access the Boot directory. I found a file “update-Extlinux.sh” in it. Pls help. Thanks

dd the image to your sdcard, it should contains 5 partitions, the 4th partitions is boot. If you have issue with that, you should check if the uSD card is faulty. Check if there is unusual kernel log on PC.

Ok, I see the 4th as Boot partition.

Absolutely and totally disagree with this statement. Booting from nvme is just as needed as boot from usb. Nice feature, but that’s it. Emmc is more than enough for booting and it doesn’t take so needed PCI-E port. Which IS actually what makes all rk3399’s SBC “edge over RasPi”. Second thing, what actually makes RockPi “edge over RasPi” is standart usb-type-c, whuch actually support QC. If we go bold and say what Radxa should do - it’s adding pci-e into 5.3 and creating images with panfrost for gpu acceleration.

My opinion is that nvme is pretty essential for the RockPi and that 5.3 pcie with panfrost creates and extremely capable desktop.
That is prob not how I will use it, but there is likely a market for Radxa for it.
Boot from USB isn’t that important because unlike the RPi its has sd, eMMC and nvme using the pcie slot which equally could be sata with the right interface card.

Boot from USB is only important if you have no other options, which the RPi hasn’t.

The 4.4 image at the top of this thread looks quite good, but I have ancillaries such as a 2.5gb usb ethernet that needs a minimum of 4.12.
4.19 as an LTS is likely to be leapfrogged as much is mainline and open source.

For the first time I am beginning to be a fan of u-boot and wondering why hdmi is not enabled as think it could be.
For those with a serial console and have edited extlinux.conf with a longer timeout than a second you can hit control and escape the boot loader and tinker with u-boot.

I corrupted the nvme image by using gdisk to try and fix the bad GPT it had and now seem totally stuck as irrespective of extlinux root partition declaration it always pulls from nvme its like the sd card has been turned off by the first loader.
Anyway I will stick it in my computer and wipe the nvme and start again but because of that its had me playing with u-boot and it would seem as long as it has the hardware declarations it can pretty do everything and a bit more.
Prob likely we will see multiboot as its looks extremely possible.
There isn’t actually problems with incompatible nvme with the corruption as not sure why but the GPT layout when copied to SD becomes corrupt but somehow still works but copying to the nvme strangely works on some nvme.
The above should sort that and just remember to copy the image direct from the original source and don’t just clone your sd or emmc.

I am thinking the mounts and gpt structure that has been chosen need to change but to be honest slightly confused how the corruption happens and why only some.

U-boot, 5.3, panfrost and nvme are hugely important because of what they offer usb-boot is very likely but on the rockpi has zero advantages over other existing methods.
U-boot is actually pretty damn amazing it can read/write/update nodes inside the device tree blob before booting a chosen kernel.
Its like a bios on steroids and really shouldn’t hidden via serial console as access could make any boot even pxe easy and simple to accomplish.

For current u-boot, booting from usb2 is supported, just dd the image to your u disk. u-boot doesn’t have usb3 driver and there is some issue with usb3 fallback to usb2 mode. it takes some time to fix it.

In reviewing the wiki-hardware-spi, one reason for not having spi is a note that
“If the bootloader in the SPI flash corrupted, it will brick the ROCK Pi 4”

I guess this could happen if a file like rockpi4b-rk-u-boot-latest shows up and initiates the script like bootloader spi flashing procedure.

I assume the only corrective actions are

  1. the usb OTG as outlined
    in https://wiki.radxa.com/Rockpi4/dev/spi-install
  2. unsolder the wrongly programmed spi

Is there a more user friendly option if the spi corrupted? or force it to sd or emmc boot default ?