Building Allwinner RISCV 64Neza D1 Board with Buildroot 2021

To gain a deeper understanding of the Linux implementation of the RISC-V 64 architecture, we have specially adapted the Buildroot 2021 open-source build tool, making it easier for everyone to delve into various parts of the Neza D1, such as the boot process, OpenSBI, U-Boot, kernel, root filesystem, etc.

Using Buildroot to compile the build system

  • Buildroot GitHub repository: https://github.com/100askTeam/neza-d1-buildroot.git

  • OpenSBI Gitee repository: https://gitee.com/weidongshan/NezaD1-opensbi.git

  • U-Boot Gitee repository: https://gitee.com/weidongshan/NezaD1-u-boot-2018.git

  • Linux Kernel Gitee repository: https://gitee.com/weidongshan/NezaD1-linuxkernel.git

  • We welcome everyone to compile, use, and submit issues and suggestions to the corresponding repositories.

Compile the Full System or Individual Parts

  • We compiled using Ubuntu 18.04. Before proceeding with the following compilation, you need to configure the basic compilation environment. Refer to the commands below to install the necessary packages.

book@virtual-machine:~/Neza-D1/buildroot-2021$ sudo apt-get install -y which sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc wget python ncurses5 bazaar cvs git mercurial rsync scp subversion android-tools-mkbootimg
  • Use the Git command to clone the source code

book@virtual-machine:~$ mkdir -p ~/Neza-D1/ && cd ~/Neza-D1/
book@virtual-machine:~/Neza-D1$ git clone https://gitee.com/weidongshan/neza-d1-buildroot.git buildroot-2021

Build the Full System Image

  • Compile the full system image

book@virtual-machine:~/Neza-D1/buildroot-2021$ make neza-d1_defconfig  // Load configuration file 
book@virtual-machine:~/Neza-D1/buildroot-2021$ make all // Complete system compilation
  • The generated system image is located in the output/image directory, where sdcard.img is the complete system image.

book@virtual-machine:~/Neza-D1/buildroot-2021/output/images$ ls
board.dtb boot.img boot_package.fex boot.vfat env.cfg fw_dynamic.bin fw_jump.bin Image rootfs.cpio rootfs.ext2 rootfs.tar sunxi.fex uImage
boot0_sdcard.fex boot_package.cfg boot.scr dragonsecboot env.fex fw_dynamic.elf fw_jump.elf ramdisk.img rootfs.cpio.gz rootfs.ext4 sdcard.img u-boot-sun20iw1p1.bin
book@virtual-machine:~/Neza-D1/buildroot-2021/output/images$

Individually Compile Each Part

  • Individually compile the OpenSBI stage

book@virtual-machine:~/Neza-D1/buildroot-2021$ make opensbi-rebuild V=1
  • Individually compile the U-Boot stage

book@virtual-machine:~/Neza-D1/buildroot-2021$ make uboot-rebuild V=1
  • Individually compile the kernel stage

book@virtual-machine:~/Neza-D1/buildroot-2021$ make kernel-rebuild V=1
  • Individually compile the filesystem

    • Specify the toolchain, system configuration, required packages, and formats, then execute the following command. The final generated image is in the output/image directory.

book@virtual-machine:~/Neza-D1/buildroot-2021$ make all // Complete system compilation

Flashing the Bootloader

  • Use the Win32DiskImager tool on Windows to flash, and on Linux, use the dd command to write completely.

Building Allwinner RISCV 64Neza D1 Board with Buildroot 2021

  • After successful flashing, insert the card into the development board and power it on to automatically boot from the SD card into the system.

Building Allwinner RISCV 64Neza D1 Board with Buildroot 2021

To-Do List

Implemented Features

  • Support for the Pingtouge RV64D external toolchain.

  • Support for Buildroot to build the Tina SDK with Thead C910 OpenSBI.

  • Support for Buildroot to build U-Boot 2018 in the Tina SDK.

  • Support for Buildroot to build Linux kernel 5.4, automatically generating Image and subsequently packaging it as boot.img.

  • Automatically build and package the SD card with BusyBox and udev for minimal system boot.

  • Support for common software packages such as Qt, Python, MQTT, and GStreamer.

Planned Features

  • Support for systemD init services.

  • Support for onboard Wi-Fi modules.

How to Participate in This Project

Submit PRs

You can submit your code modifications and examples on this page to better support Buildroot.

Building Allwinner RISCV 64Neza D1 Board with Buildroot 2021

Submit Issues

You can submit any questions, ideas, or suggestions regarding this repository on this page.

Building Allwinner RISCV 64Neza D1 Board with Buildroot 2021

Visit the Allwinner D1 forum for more information on this article: https://bbs.aw-ol.com/topic/171

Leave a Comment