Source code for the u-boot SPI build

Very thanks !!! I waited :), nvme drivers are included in the kernel and STORAGE can now be located on nvme

/dev/mmcblk1p6          511.7M    158.4M    353.3M  31% /flash
/dev/nvme0n1p9            4.7G     16.0M      4.5G   0% /storage

As far as I can see, your launch is not completely with NVMe ?

my SSD not boot trough spi :frowning:
https://forum.radxa.com/t/fixing-u-boot-to-support-boot-from-nvmes/2076/9?u=rua1

Можете показать лог UART при использовании моего u-boot-spi с подключенным модулем NVMe ?

ок … у меня много символов на 1500000 теряется, могу тормознуть , перейти на 115200 , тогда все выводится

Очень странно, на этой скорости на RK вообще не должно ни чего в лог попадать …

good news :slight_smile:

https://forum.armbian.com/topic/12162-single-armbian-image-for-rk-aml-aw/?do=findComment&comment=96341

Если не вывелось В каком месте это должно быть и что там должно быть? я несколько раз подергаю может и вылезет

Summary
CPUId = 0x0
ChipType = 0x10, Spi_ChipId = b4016
SpiBootInit:0
mmc0:cmd5,32
SdmmcInit=0 0
BootCapSize=0
UserCapSize=15193MB
FwPartOffset=2000 , 0
StorageInit ok = 188403
SecureMode = 0
SecureInit reGPT  signature is wrong
LoadTruLoadTrust Addr:0x1c00
LoadTrust Addr:0x2000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
hdr 00000000031912Load OK, addr=0x200000, size=0xb15d8
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 wiINFO:    Using opteed sec cpu_cotus 3e
INFO:    BL31: Initializing runtime services
WARNING: NSMC_UNK
ERROR:   Error initializing runtime service opteed_fast


U-Boot 2017.09 (Feb 06 2020 - 17:07:41 +0300)

Model: Rock3.9 GiB
Sysmem: init
Relocation Offset is: f7d0d000
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff399 Evaluation Board
CLK: (uboot. arml: enter 816000 KHz, init z, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cplpclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  0 
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
USB4:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 11 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 3 for devices... 1 USB Device(s) found
scanning bus 4 for devices... 1 USB Device(s) found
scanning bus 5 for devices... 1 USB Device(s) found
       scanning usb for storage devices..switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:b...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlin797 bytes read in 9 ms (85.9 KiB/s)
select kernel
1:      kernel-4.4.154-104-rockchip-g3037f71a0de71:     kernel-4.4.154-104-rockchip-g3037f71a0de7
Retrieving file: /19494920 bytes read in 877 ms (21.2 MiB/s)
append: earlyprintk nk=0 rw init=/sbin/init rootfstype=ext4 rootwait root=/dev/nvme0n1p5
Retrieving file: /dtbs/4.494293 bytes read in 83 ms (1.1 MiB/s)
## Flattened Device Tree  blob at 0x8300000
   Loading Device Tree to 00000000ebeda000, end 00000000ebef4054Adding bank: 0x00200000 - 0xf8000000 (size: 0xf7e00000)
Total: 11960.576 ms

Starting kernel ...

Это не мой последний u-boot-spi :slight_smile:
Мой даёт такой вывод

U-Boot 2017.09-00010-g18c70dba63-dirty (Feb 25 2020 - 12:23:09 +0300)

Model: Radxa ROCK Pi 4
PreSerial: 2
DRAM: 2 GiB
Relocation Offset is: 7dbd5000
Sysmem: init
I2c speed: 400000Hz
PMIC: RK808
vdd_center 900000 uV
vdd_cpu_l 800000 uV
vdd-log init 950000 uV
MMC: dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

ага sd забыл вынуть … вынул … и оно увиделось :))))))

Summary
=> setenv baudrate 115200
## Switch baudrate to 115200 bps and press ENTER ...
=> nvme scan
=> nvme info  
Device 0: Vendor: 0x1987 Rev: ECFM12.2 Prod: LSL78256A95EF02545  
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
=> nvme part

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
        t72699c7
        guid:   bbf86b96-61b3-446d-a789-bed7e5b85490
  5     0x00108000      0x03bc7fde      "mate"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   ec15ec14-1781-45fe-9328-8012d52b4b54
  6     0x03bc8000      0x063c7fff      "xubuntu"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   4640415b-956d-4627-84e9-f5e7cf630be0
  7     0x063c8000      0x08113fff      "none"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   0328f464-d501-4d8d-8f61-f51822ae6fca
  8     0x08114000      0x14463fff      "data63daf-8483-4772-8e79-3d69d8477de4
        guid:   5d925b1c-5d31-4c15-a03f-d81bf324e09a
 10     0x14e28000      0x16b73fff      "slak"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   ed75ee03-149a-4cf2-bf88-d1c37b79895e
 11     0x16b74000      0x188bffff      "armbian54"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   5e6dfaa8-f304-4646-91f3-bdf5dcb7b99f
 12     0x188c0000      0x19cbffff      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   ac160133-43ad-4726-8c5b-ae233e8d235c
 13     0x19cc0000      0x1a4bffff      ""
        attrs:  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-  0x03bc7fde      "mate"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   ec15ec14-1781-45fe-9328-8012d52b4b54
  6     0x03bc8000      0x063c7fff      "xubuntu"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   4640415b-956d-4627-84e9-f5e7cf630be0
  7     0x063c8000      0x08113fff      "none"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   0328f464-d501-4d8d-8f61-f51822ae6fca
  8     0x08114000      0x14463fff      "data"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   f4484f08-192f-4caa-97d1-70efafd1db95
  9     0x14464000      0x14e27fff      "libre"
        attrs:  af-8483-4772-8e79-3d69d8477de4
        guid:   ed75ee03-149a-4cf2-bf88-d1c37b79895e
 11     0x16b74000      0x188bffff      "armbian54"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   5e6dfaa8-f304-4646-91f3-bdf5dcb7b99f
 12     0x188c0000      0x19cbffff      ""
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   ac160133-43ad-4726-8c5b-ae233e8d235c
 13     0x19cc0000      0x1a4bffff      ""
        attrs:  0x0000000000000000
        type:   0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
        guid:   3e3dec41-e471-49f2-b655-98670394ee75
=> 

Для использования SD карты - сотри с нее u-boot. Для правильной работы u-boot-spi нужно удалить все u-boot с SD карты и eMMC, должен быть только в SPI. Для полного запуска всей системы с NVMe есть нюанс, нужно использовать boot.scr из моего образа Armbian или LE.

ясное дело, это я просто забыл выдернуть, мне с нее стирать пока не надо. Я сначала загрузил без СД , ничего интересного в логе не увидел. Потестировал юсб. Как и прошлый раз в юсб 3.0 разъемах флэшки не видны. Я решил уточнить то ли я шил, воткнул СД , загрузился в линукс, проверил. Перегрузился, а СД вынуть забыл. Увидел более жирный лог и отослал не обратив внимание на дату убута :wink: .
Прошлый раз эти команды nvme делал и была индейская хижина. СД тогда я вынимал точно , в СД убуте nvme нет. Видимо тогда M2 расширитель неконтачил.

Это для того ссд самсунг с ошибкой кластера? Через ехтлинукс у меня ошибка кластера.

Summary
Device 0: Vendor: 0x1987 Rev: ECFM12.2 Prod: LSL78256A95EF02545  
       0118192 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/exux.conf
797 bytes read in 1 ms (778.3 KiB/s)
select kernel
1:      kernel-4.4.154-104-rockchip-g3037f71a0de7
2:      Retrieving file: /hw_intfc.conf
reading /hw_intfc.conf
1807 bytes read in 1 ms (1.7 MiB/s)
dtdtoverlay number: 1, name:/overlays/spi1-flash.dtbo 
hw_conf.vaconf.i2c2 = 0
hw_conf.i2c6 = 0
hw_conf.i2c7 = 0
hw_conf.dts_overlay_count = 2
hw_conf.dts_ovckchip-g3037f71a0de7
Retrieving file: /vmlinuz-4.4.154-104-rockreading /vmlinuz-4.4.154-104-rocERROR: status = 2013, phase = 1, head = 1
Error reading cluster
** Unable to read file /vmlinuz-4.4.154-1kchip-g3037f71a0de7 for failure retrieving kernel

HI!

Many thanks for your efforts here and at armbian forum.

Does your version of u-boot is supposed to load Android (eg mo123 image) from USB?

I’ve tried flashing Android to USB stick with etcher, uboot recognised USB but in console there was an error that EXT2 could not be mounted and further boot continued from MMC.

Android can’t work with USB.

@rua1 It is interesting to check this option. Write to the Android SD card, delete u-boot from it (erase u-boot to SD, from Android after recording), and check the launch using my version of u-boot-SPI (you still need to disable NVMe to check it ). If this works, I can move the Android startup before NVMe and then it will be easy to launch any system including Android in any order.

Okay, I will try time. It is inconvenient to work with SPI. It is flashed for a long time. And when I want to erase it, I do not have /proc/mtd at this time. It is necessary to erase through the usb-A-A cable.
And you could not give the uboot.img and trust.img files from your branch? I am poorly versed in git and don’t know how to tie your commits to the project. Could file-by-file copy, but laziness;)
p.s. although I already foresee the result, it will go in cycles in loading pxe. You have to Strel-S and run boot_android manually … and so I already tried like. I’ll try again.

as expected endless loop on pxe

U-Boot 2017.09-00010-g18c70dba63-dirty (Feb 25 2020 - 12:23:3.9 GiB
...
** Unrecognized filesystem tethernet@fe300000 Waiting for PHY auto negotiation to complete. done
Speed: 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.39 (7 ms)
*** Warning: nrom server 192.168.1.1; our IP address is 192.168.1.39
Filename 'C0A80127.img'.
Load address: T T T 
...
... <Ctrl-C>
=> <INTERRUPT>
=> boot_android mmc 1
ANDROID: reboot reason: "(none)"

and everything hangs …

How do you try to write u-boot to SPI ? I created an image with Debian according to the instructions (with updating the kernel and other packages to the latest versions , as indicated in the instructions) and use it, everything works without problems (erases and updates the u-boot in SPI). I only replace the file with the u-boot image for SPI in the /usr/lib/u-boot directory .

I have already checked the Android launch itself from the SD card. It turned out that you do not need to delete anything after recording. Just recorded an image of Android 7 ( taken from of.site), recorded on the SD card and when connected to the RockPI machine started Android. I didn’t disable the NVMe module with Armbian. That is, you can have Armbian or Libreelec on NVMe and quickly launch Android , just connect the SD card with Android.

through nandwrite … the instruction did not catch the eye. With spi flashed, mtd disappears

root@rockpi:/home/alex# cat /proc/mtd
dev:    size   erasesize  name
root@rockpi:/home/alex#

.
… I don’t see the point in this spi at all. I am satisfied with everything being removed on SD … so I ask for your uboot.img and trust.img since uboots from radxa do not see usb devices in all sockets

p.s. By the disappearance of mtd I figured it out, wrote down on SD they collected from the branch of this topic instead of the regular