Jump to content

Custom u-boot configuration howto?


Recommended Posts

Hi, You can compile with: 

 

./compile.sh CREATE_PATCHES="yes"

 

The build will pause; atf, uboot, kernel, with each stop you can make your respective changes.

 

Haven't looked much at boot options - perhaps someone with experience can chime in?

Link to comment
Share on other sites

In devices with allwinner chips, a simple code is hard-wired that polls possible boot devices in the following order:
1) sd card
2) a memory chip soldered on the board.
3) if they are empty, the device switches to "fel" mode and becomes available when it is connected to another computer using a USB cable.

In this mode, you have the opportunity to read or write any boot code to a soldered memory chip. This is done using the "sunxi-tools" utility.

 

1-2) When the boot code "u-boot" is found on one of these media, it starts working and scans the devices for downloading about which it has information.

This process can be seen in the UART console. "u-boot" reads the file armbianEnv.txt

For verification, you can boot from the SD card. Connect an external drive via the USB connector.

Having previously written the file system of any OS to one of its partitions. Determine its UUID using the blkid command.

Edit the file armbianEnv.txt on your sd card, register a new UUID for the root partition there and reboot.

 

Link to comment
Share on other sites

I was successful to boot uBoot over SPI-FLASH and continue to boot over network (PXE+NFS), and my few comments:

  1. uboot (orangepi)
     - https://github.com/orangepi-xunlong/u-boot-orangepi.git (v2021.10-sunxi)
    does not support SPI-FLASH boot
  2.  upstream uboot hungs, but it has patch to support SPI boot (since v2023.01-rc1)
    - https://patchwork.ozlabs.org/project/uboot/list/?series=252044&state=*
    - https://github.com/u-boot/u-boot/commit/e50ee3a8d7328142eb24741305f751e5c0952380
  3. so I extend 1. with 2. (attached) and rebuild uBoot
  4. flash uboot, in linux ` nandwrite /dev/mtd0 u-boot-sunxi-with-spl.bin ` (erase: ` flash_eraseall /dev/mtd0 `)
  5. install jumper between PC5 and GND (13-14 pinheader)
    image.thumb.png.1e374d6d92d209f29fb02f94850013ce.png
  6. ... and boot
    U-Boot SPL 2021.10-g0b91e222-dirty (Jan 09 2023 - 02:10:12 +0100)
    DRAM: 1024 MiB
    Trying to boot from sunxi SPI
    NOTICE:  BL31: v2.8(debug):f4d8ed5
    NOTICE:  BL31: Built : 23:43:55, Jan  7 2023
    NOTICE:  BL31: Detected Allwinner H616 SoC (1823)
    NOTICE:  BL31: Found U-Boot DTB at 0x4a087b80, model: OrangePi Zero2
    INFO:    ARM GICv2 driver initialized
    INFO:    Configuring SPC Controller
    INFO:    PMIC: Probing AXP305 on RSB
    INFO:    PMIC: aldo1 voltage: 3.300V
    INFO:    PMIC: aldo2 voltage: 3.300V
    INFO:    PMIC: aldo3 voltage: 3.300V
    INFO:    PMIC: bldo1 voltage: 1.800V
    INFO:    PMIC: bldo2 voltage: 1.800V
    INFO:    PMIC: dcdcd voltage: 1.500V
    INFO:    PMIC: dcdce voltage: 3.300V
    INFO:    BL31: Platform setup done
    INFO:    BL31: Initializing runtime services
    INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
    INFO:    BL31: cortex_a53: CPU workaround for 1530924 was applied
    INFO:    PSCI: Suspend is unavailable
    INFO:    BL31: Preparing for EL3 exit to normal world
    INFO:    Entry point address = 0x4a000000
    INFO:    SPSR = 0x3c9
    INFO:    Changed devicetree.
    
    
    U-Boot 2021.10-g0b91e222-dirty (Jan 09 2023 - 02:10:12 +0100) Allwinner Technology
    
    CPU:   Allwinner H616 (SUN50I)
    Model: OrangePi Zero2
    I2C:   ready
    DRAM:  1 GiB
    MMC:   mmc@4020000: 0
    Loading Environment from SPIFlash... SF: Detected mx25l1606e with page size 256 Bytes, erase size 4 KiB, total 2 MiB
    OK
    In:    serial@5000000
    Out:   serial@5000000
    Err:   serial@5000000
    Net:   phy interface7
    eth0: ethernet@5020000
    Autoboot in 2 seconds, press <Space> to stop
    MMC: no card present
    ethernet@5020000 Waiting for PHY auto negotiation to complete.. done
    BOOTP broadcast 1
    *** Unhandled DHCP Option in OFFER/ACK: 2
    *** Unhandled DHCP Option in OFFER/ACK: 42
    *** Unhandled DHCP Option in OFFER/ACK: 4
    *** Unhandled DHCP Option in OFFER/ACK: 252
    *** Unhandled DHCP Option in OFFER/ACK: 2
    *** Unhandled DHCP Option in OFFER/ACK: 42
    *** Unhandled DHCP Option in OFFER/ACK: 4
    *** Unhandled DHCP Option in OFFER/ACK: 252
    DHCP client bound to address 192.168.1.242 (45 ms)
    *** Warning: no boot file name; using 'C0A801F2.img'
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'C0A801F2.img'.
    Load address: 0x42000000
    Loading: *
    TFTP error: 'Access violation' (2)
    Not retrying...
    missing environment variable: pxeuuid
    missing environment variable: bootfile
    Retrieving file: pxelinux.cfg/01-02-00-d2-c3-32-42
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'pxelinux.cfg/01-02-00-d2-c3-32-42'.
    Load address: 0x4fd00000
    Loading: *
    TFTP error: 'Access violation' (2)
    Not retrying...
    missing environment variable: bootfile
    Retrieving file: pxelinux.cfg/C0A801F2
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'pxelinux.cfg/C0A801F2'.
    Load address: 0x4fd00000
    Loading: #
         11.7 KiB/s
    done
    Bytes transferred = 126 (7e hex)
    Config file found
    1:    linux
    missing environment variable: bootfile
    Retrieving file: uInitrd
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'uInitrd'.
    Load address: 0x4ff00000
    Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########################
         9.2 MiB/s
    done
    Bytes transferred = 15625901 (ee6ead hex)
    missing environment variable: bootfile
    Retrieving file: Image
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'Image'.
    Load address: 0x40080000
    Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################
         9.8 MiB/s
    done
    Bytes transferred = 22259720 (153a808 hex)
    append: root=/dev/nfs nfsroot=192.168.1.1:/sunxi/ ip=dhcp rw
    missing environment variable: bootfile
    Retrieving file: dtb/allwinner/sun50i-h616-orangepi-zero2.dtb
    Using ethernet@5020000 device
    TFTP from server 192.168.1.1; our IP address is 192.168.1.242
    Filename 'dtb/allwinner/sun50i-h616-orangepi-zero2.dtb'.
    Load address: 0x4fa00000
    Loading: ###
         706.1 KiB/s
    done
    Bytes transferred = 38323 (95b3 hex)
    Moving Image from 0x40080000 to 0x40200000, end=417a0000
    ## Loading init Ramdisk from Legacy Image at 4ff00000 ...
       Image Name:   uInitrd
       Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
       Data Size:    15625837 Bytes = 14.9 MiB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 4fa00000
       Booting using the fdt blob at 0x4fa00000
       Loading Ramdisk to 49119000, end 49fffe6d ... OK
       Loading Device Tree to 000000004910c000, end 00000000491185b2 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.16.17-sun50iw9 (martin@martin-v15) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #3 SMP Wed Jan 11 14:07:16 CET 2023
    [    0.000000] Machine model: OrangePi Zero2
    [    0.000000] NUMA: No NUMA configuration found
    [    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000007fffffff]
    [    0.000000] NUMA: NODE_DATA [mem 0x7fdca040-0x7fdcbfff]
    [    0.000000] Zone ranges:
    [    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
    [    0.000000]   DMA32    empty
    [    0.000000]   Normal   empty
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000040000000-0x000000004007ffff]
    [    0.000000]   node   0: [mem 0x0000000040080000-0x000000007fffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
    [    0.000000] cma: Reserved 128 MiB at 0x0000000076c00000
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs

     

spiboot.patch

Edited by mcerveny
Link to comment
Share on other sites

28.01.2023 в 11:25, mcerveny сказал:

install jumper between PC5 and GND (13-14 pinheader)

H616_User_Manual_V1.0.

Yes it is different from other allwinner chips. The register is read-only and a jumper is needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines