DESK-XZ7-L/Deployment/Restoring U-Boot on NOR flash

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2022/11/22 DESK-XZ7-L-1.0.0-rc1 release
2024/01/22 DESK-XZ7-L-1.0.1 release


Restoring U-Boot on SPI NOR flash[edit | edit source]

This article describes how to restore U-Boot on SPI NOR flash in case it gets corrupted or it is deleted accidentally.

Instructions[edit | edit source]

First of all, create a bootable microSD card as described here.

Then, boot the board with the microSD card and stop the automatic boot process of U-Boot in order to access the console.

U-Boot 2021.01-desk-xz7-l-1.0.1 (Jan 12 2024 - 10:44:15 +0000)

CPU:   Zynq 7z030
Silicon: v3.1
Model: Bora
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
SOM ConfigID#: 00000004
SOM UniqueID#: 2a0e92c4:03193a4b
CB ConfigID#: ffffffff
CB UniqueID#: ffffffff:ffffffff
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Warning: MAC addr not found in SPI NOR at block 8
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 7, interface rgmii-id

Warning: ethernet@e000b000 (eth0) using random MAC address - 72:2c:e1:44:08:28
eth0: ethernet@e000b000
Hit ENTER within 2 seconds to stop autoboot
Zynq>

Programming U-Boot from uSD[edit | edit source]

  • Initialize and format QSPINOR memory
Zynq> sf probe
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Zynq> sf erase 0 0x1000000
SF: 16777216 bytes @ 0x0 Erased: OK
  • Install BOOT.BIN on QSPINOR memory
Zynq> fatload mmc 0:1 $kernel_addr_r BOOT.BIN
7033004 bytes read in 406 ms (16.5 MiB/s)
Zynq> sf write $kernel_addr_r 0x0 $filesize
device 0 offset 0x0, size 0x6b50ac
SF: 7033004 bytes @ 0x0 Written: OK
  • Install image.ub on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> fatload mmc 0:1 $kernel_addr_r image.ub
4868556 bytes read in 287 ms (16.2 MiB/s)
Zynq> sf write $kernel_addr_r 0x700000 $filesize
device 0 offset 0x700000, size 0x4a49cc
SF: 4868556 bytes @ 0x700000 Written: OK
  • Install boot.scr on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> fatload mmc 0:1 $kernel_addr_r boot.scr
2709 bytes read in 14 ms (188.5 KiB/s)
Zynq> sf write $kernel_addr_r 0xFC0000 $filesize
device 0 offset 0xfc0000, size 0xa95
SF: 2709 bytes @ 0xfc0000 Written: OK

Programming U-Boot from ethernet[edit | edit source]

Properly define the ethernet configuration parameter:

Zynq> setenv ipaddr 192.168.0.90
Zynq> setenv serverip 192.168.0.23
  • download via TFTP the BOOT.BIN binary image. Then, burn them in NOR flash memory:
Zynq> setenv boot_addr_r 0x1000000
Zynq> tftpboot ${boot_addr_r} desk-xz7/BOOT.BIN
Using ethernet@e000b000 device
TFTP from server 192.168.0.23; our IP address is 192.168.0.90
Filename 'desk-xz7/BOOT.BIN'.
ERROR: reserving fdt memory region failed (addr=3e000000 size=1000000)
Load address: 0x1000000
Loading: #################################################################
...
...
#####################################
         1.7 MiB/s
done
Bytes transferred = 22149396 (151f914 hex)
Zynq>

Select the SPI NOR flash as boot device, remove the microSD card, and reset the board. The board should boot off the NOR flash as shown in the following image.

Zynq> reset
resetting ...

U-Boot 2021.01 (Oct 12 2021 - 09:28:42 +0000)

CPU:   Zynq 7z020
Silicon: v3.1
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0
Loading Environment from SPIFlash... SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr -1, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0