Building U-Boot for the Kumquat Board

This guide explains how to build U-Boot for the NetCube Kumquat board using a custom defconfig. It includes steps to set up your environment, fetch the source, apply necessary patches (if not upstream yet), and produce a bootable u-boot-sunxi-with-spl.bin for SPI-NOR installation.

Date: 07.06.2025 Status: U-Boot support is currently being upstreamed.


Prerequisites

Host System Requirements (Debian/Ubuntu)

sudo apt update
sudo apt install build-essential gcc-arm-linux-gnueabihf libncurses-dev flex bison u-boot-tools device-tree-compiler git

Step 1: Clone the U-Boot Source Tree

Use the next branch of upstream U-Boot (currently contains required patches for sunxi platforms):

git clone https://source.denx.de/u-boot/u-boot.git -b next u-boot-kumquat
cd u-boot-kumquat

You may also check if there is a tagged release for Kumquat in the upstream or vendor repository that includes the defconfig and patches. This would allow you to skip the manual configuration and patching steps.

Step 2: Check for Defconfig and Apply Patch (if needed)

Check if the defconfig is already present:

ls configs/sun8i_v3s_netcube_kumquat_defconfig

If it exists, it likely means that the required MAC address patch is also already applied. In that case, you can skip to the build step.

If not, do the following:

Download the custom defconfig:

wget https://gitlab.com/netcube-systems-austria/kumquat-buildroot/-/raw/cb6398097227f209cab6079fc1ab3c201e84d401/board/netcube/kumquat/uboot.config -O configs/sun8i_v3s_netcube_kumquat_defconfig

Apply the MAC Address nvmem Patch:

From 3122b01981dac49bbb19aa72f31729fcd38e7e99 Mon Sep 17 00:00:00 2001
From: Lukas Schmid <lukas.schmid@netcube.li>
Date: Fri, 6 Jun 2025 20:35:24 +0200
Subject: [PATCH 1/2] sunxi: setup_environment: do not generate a MAC address
 when one is set using nvmem-cells

Boards using MAC addresses stored in EEPROM via the device tree's
`nvmem-cells` mechanism may already have a valid MAC loaded by the
device model. However, setup_environment() currently ignores this
and generates a fallback address from the SoC SID if no environment
variable is set.

This leads to a mismatch warning during boot when the kernel or U-Boot
detects the MAC from nvmem and compares it to the environment.

This patch checks whether the corresponding ethernet device node
has a `nvmem-cells` property and skips generating a fallback MAC
if it does, thus avoiding redundant or incorrect ethaddr setup.

This improves compatibility with nvmem-based MAC provisioning and
aligns U-Boot behavior with Linux.

Signed-off-by: Lukas Schmid <lukas.schmid@netcube.li>
---
 board/sunxi/board.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ac9cefc6..41b85c66 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -774,10 +774,23 @@ static void setup_environment(const void *fdt)
                return;

        for (i = 0; i < 4; i++) {
+               const char *alias;
+               int nodeoffset;
+               int len;
+               const fdt32_t *prop;
+
                sprintf(ethaddr, "ethernet%d", i);
-               if (!fdt_get_alias(fdt, ethaddr))
+               alias = fdt_get_alias(fdt, ethaddr);
+               if (!alias)
                        continue;

+               nodeoffset = fdt_path_offset(fdt, alias);
+               if (nodeoffset >= 0) {
+                       prop = fdt_getprop(fdt, nodeoffset, "nvmem-cells", &len);
+                       if (prop && len > 0)
+                               continue;
+               }
+
                if (i == 0)
                        strcpy(ethaddr, "ethaddr");
                else
--
2.39.5

To apply:

git apply <patch-file>.patch

Ensure the patch applies cleanly before proceeding.

Step 3: Build U-Boot

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun8i_v3s_netcube_kumquat_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)

You should now have the file:

u-boot-sunxi-with-spl.bin

Step 4: Flashing the Built U-Boot

Use the u-boot-sunxi-with-spl.bin file to flash the board’s SPI-NOR flash memory.

Please refer to the guide below for detailed flashing instructions:

👉 Flashing U-Boot onto the SPI-NOR

You’ll use:

sunxi-fel -p spiflash-write 0 u-boot-sunxi-with-spl.bin wdreset

Notes

  • You only need to apply the defconfig and patch manually if upstream support is not yet merged.
  • Once support lands in upstream U-Boot, using sun8i_v3s_netcube_kumquat_defconfig is all that’s needed.
  • u-boot-sunxi-with-spl.bin includes the SPL and U-Boot proper, suitable for flashing at offset 0 in SPI-NOR.