准备工作:

uboot下载:ftp://ftp.denx.de/pub/u-boot/u-boot-2018.07.tar.bz2

toolchain下载:http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

arm-trusted-firmware(编译bl31.bin)下载:git clone -b allwinner https://github.com/apritzel/arm-trusted-firmware.git

编译工作:

第一步:进入arm-trusted-firmware文件夹编译uboot用到的bl31.bin文件(原因请百度or谷歌or参考:uboot/board/sunxi/README.sunxi64)

$ export CROSS_COMPILE=aarch64-linux-gnu-
$ make PLAT=sun50iw1p1 DEBUG=1 bl31

执行完上述指令后会在 arm-trusted-firmware/build/sun50iw1p1/debug文件夹中生成bl31.bin

注意:主线arm--trusted-firmware没有sun50iw1p1平台,所以我用的老的(上边的地址)

第二步:将第一步生成的bl31.bin文件拷贝到uboot根目录下

第三步:编译uboot

$ export CROSS_COMPILE=aarch64-linux-gnu-
$ make orangepi_pc2_defconfig
$ make

执行完上述指令后在uboot根目录下生成:u-boot-sunxi-with-spl.bin文件

第四步:下载uboot到SD卡

$ sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=8k seek=1

注意:上述指令 of=/dev/sdx 中的 sdx 根据你自己的环境替换,我的环境是sdb

第五步:将SD卡插入开发板测试

打印如下信息:


U-Boot SPL 2018.07 (Aug 07 2018 - 18:02:30 +0800)
DRAM: 1024 MiB
Trying to boot from MMC1
NOTICE:  BL3-1: Running on H5 (1718) in SRAM A2 (@0x44000)
NOTICE:  Configuring SPC Controller
NOTICE:  BL3-1: v1.0(debug):4fe12b7
NOTICE:  BL3-1: Built : 17:31:07, Aug  7 2018
NOTICE:  PLL_CPUX: 90001521
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address: 0x4a000000, SPSR: 0x3c9


U-Boot 2018.07 (Aug 07 2018 - 18:02:30 +0800) Allwinner Technology

CPU:   Allwinner H5 (SUN50I)
Model: OrangePi PC 2
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   vidconsole
Err:   vidconsole
Allwinner mUSB OTG (Peripheral)
Net:   phy interface7
eth0: ethernet@1c30000
Warning: usb_ether using MAC address from ROM
, eth1: usb_ether
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 3 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  2  1  0 

 

Logo

更多推荐