Restoring U-Boot on NAND flash (BELK/BXELK)

From DAVE Developer's Wiki
Revision as of 08:28, 31 January 2020 by U0007 (talk | contribs) (History)

Jump to: navigation, search
Info Box
BORALite-TOP.png Applies to BORA Lite


History[edit | edit source]

Version Date BELK version Notes
1.0.0 Jan 2020 4.1.0 First version for BELK 4.1.0

Introduction[edit | edit source]

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

The example refers to BoraXEVB carrier board. The procedure was tested with the binaries released with BELK 4.1.0.

At the end of the procedure, the default partitioning of the NAND flash will be restored. It is depicted in the following image.


NAND flash default partitioning scheme

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 automatic boot process of U-Boot in order to access the console.

U-Boot SPL 2017.01-belk-4.1.1 (Jan 08 2020 - 16:46:11)
mmc boot
Trying to boot from MMC1
reading fpga.bit
reading fpga.bit
  design filename = "bora_LVDS_wrapper;UserID=0XFFFFFFFF;Version=2017.1"
  part number = "7z020clg400"
  date = "2020/01/08"
  time = "16:04:17"
  bytes in bitstream = 4045564
zynq_align_dma_buffer: Align buffer at 4000071 to 3ffff80(swap 1)
reading u-boot.img
reading u-boot.img


U-Boot 2017.01-belk-4.1.1 (Jan 08 2020 - 16:46:11 +0100), Build: belk-4.1.1

Model: Bora
Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
Relocating to 3ff14000, new gd at 3ead3ee8, sp at 3ead3ec0
NAND:  1024 MiB
MMC:   sdhci@e0100000: 0 (SD)
reading bora.env
In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Model: Bora
Board: Xilinx Zynq
SF: Detected is25lp128 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
SOM ConfigID CRC mismatch for 0xff0101ff (was 0xffffffff, expected 0xca9a6d16) at block 2 (offset 96): using default
SF: Detected is25lp128 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
SOM UniqueID not found, using default
SOM ConfigID#: ffffffff
SOM UniqueID#: ffffffff:ffffffff
ds2431_readmem(): error in chip reset
ds2431_readmem(): error in reading buffer
ds2431_readmem(): error in chip reset
ds2431_readmem(): error in reading buffer
CB ConfigID CRC mismatch for 0x00000000 (was 0x00000000, expected 0x2144df1c) at block 3 (offset 96): using default
CB ConfigID#: ffffffff
CB UniqueID#: 00000000:00000000
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
Hit ENTER within 3 seconds to stop autoboot
Bora>

Download via TFTP the U-Boot SPL and the U-Boot binary images. Then, burn them in NAND flash memory.

Bora> setenv ipaddr 192.168.0.91
Bora> setenv ethaddr 00:50:C2:1E:AF:B3
Bora> setenv serverip 192.168.0.23
Bora> tftpboot ${loadaddr} bora/u-boot/belk-4.1.1_bora_nand_boot.bin
Using ethernet@e000b000 device
TFTP from server 192.168.0.23; our IP address is 192.168.0.91
Filename 'bora/u-boot/belk-4.1.1_bora_nand_boot.bin'.
Load address: 0x2080000
Loading: ##############################
         1.2 MiB/s
done
Bytes transferred = 149904 (24990 hex)
Bora> run nand_update_spl

NAND erase.part: device 0 offset 0x0, size 0x40000
Erasing at 0x20000 -- 100% complete.
OK

NAND write: device 0 offset 0x0, size 0x24990
 149904 bytes written: OK
Bora> tftpboot ${loadaddr} bora/u-boot/belk-4.1.1_bora_nand_u-boot.img
Using ethernet@e000b000 device
TFTP from server 192.168.0.23; our IP address is 192.168.0.91
Filename 'bora/u-boot/belk-4.1.1_bora_nand_u-boot.img'.
Load address: 0x2080000
Loading: #################################################################
         #################################################################
         ####
         1.2 MiB/s
done
Bytes transferred = 682324 (a6954 hex)
Bora> run nand_update

NAND erase.part: device 0 offset 0x40000, size 0xc0000
Erasing at 0xe0000 -- 100% complete.
OK

NAND write: device 0 offset 0x40000, size 0xa6954
 682324 bytes written: OK
Bora>

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

Bora> reset
resetting ...

U-Boot SPL 2017.01-belk-4.1.1 (Jan 08 2020 - 16:52:16)
nand boot
Trying to boot from NAND
1024 MiB


U-Boot 2017.01-belk-4.1.1 (Jan 08 2020 - 16:52:16 +0100), Build: belk-4.1.1

Model: Bora
Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
Relocating to 3ff14000, new gd at 3ead3ee8, sp at 3ead3ec0
NAND:  1024 MiB
MMC:   sdhci@e0100000: 0 (SD)
In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Model: Bora
Board: Xilinx Zynq
SOM ConfigID#: 00000008
SOM UniqueID#: 01234567:89abcdef
CB ConfigID CRC mismatch for 0x00000000 (was 0x00000000, expected 0x2144df1c) at block 3 (offset 96): using default
CB ConfigID#: ffffffff
CB UniqueID#: 00000000:00000000
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
Hit ENTER within 3 seconds to stop autoboot
Bora>