Environment Description
-
OS: Ubuntu 20.04.5 LTS -
GCC: arm-none-linux-gnueabihf-gcc 10.3.0
Compiler download link: Downloads | GNU-A Downloads – Arm Developer[1]
U-Boot Porting
Current latest version v2023.04-rc2 download link: https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz[2]
Set cross compiler:
export CROSS_COMPILE=arm-none-linux-gnueabihf-
Compile configuration:
make nanopi_neo_defconfig
Compile:
make -j8
Encountered issues: Solution:
sudo apt install python3-pip
pip3 install setuptools
Compilation output: Burning:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8 oflag=direct
Boot test: According to the boot log, the DDR size is correct, and compared to the NanoPi provided image, there is additional support for the network.
Check if the SD card is recognized normally: Check network card information: Set IP address for the network card:
setenv ipaddr 192.168.0.110
setenv gatewayip 192.168.0.1
setenv netmask 255.255.255.0
saveenv
Test network communication, normal: This makes it much easier to set up a TFTP service on the PC and use U-Boot to pull the kernel and device tree via TFTP, but this article still uses the SD card boot method. Interested readers can check my article on IMX6ULL.
Kernel Porting
Current stable version 6.1.11 download link: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz[3]
Set cross compiler:
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabihf-
Compile configuration:
make sunxi_defconfig
Compile:
make -j16
Compilation output: Replace the original zImage image and device tree file in the first boot partition of the SD card.
sudo mount /dev/sdb1 /mnt
sudo cp arch/arm/boot/zImage /mnt/zImage
sudo cp arch/arm/boot/dts/sun8i-h3-nanopi-neo.dtb /mnt/sun8i-h3-nanopi-neo.dtb
sync
sudo umount /mnt
Insert the SD card into the development board and restart, enter the U-Boot command line, and directly pull the kernel to boot:
fatload mmc 0 0x46000000 zImage
fatload mmc 0 0x48000000 sun8i-h3-nanopi-neo.dtb
setenv bootargs "console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait"
bootz 0x46000000 - 0x48000000
Rootfs Porting
Rootfs uses the system ported based on Ubuntu 20.04: i.MX6ULL System Porting | Building Root File System Based on Ubuntu Base 20.04
Testing
Kernel version: Distribution version: CPU information: Network normal:
References
Downloads | GNU-A Downloads – Arm Developer: https://developer.arm.com/downloads/-/gnu-a
[2]https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz: https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz
[3]https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz
Leave a Comment
Your email address will not be published. Required fields are marked *