Skip to content

Commit 7b0670b

Browse files
committed
Radxa Zero 3: Switch to U-Boot master
Switch to U-Boot master since it works reliably and provides upstream improvements. Add patch/u-boot/v2025.10 and the generic patch, as BOOTPATCHDIR cannot be unset (fallback to legacy fails). BOOT_SCENARIO="binman-atf-mainline" cannot be set here since it applies globally to the CSC file and would break branch=vendor. Users who want it can enable it manually.
1 parent 8b3881f commit 7b0670b

File tree

2 files changed

+107
-4
lines changed

2 files changed

+107
-4
lines changed

config/boards/radxa-zero3.csc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,24 @@ function post_family_tweaks__enable_aic8800_bluetooth_service() {
5454
fi
5555
}
5656

57-
5857
function post_family_config__use_mainline_uboot_except_vendor() {
5958
# use mainline u-boot for _current_ and _edge_
6059
if [[ "$BRANCH" != "current" && "$BRANCH" != "edge" ]]; then
61-
return 0
60+
return 0
6261
fi
6362
unset BOOT_FDT_FILE # boot.scr will use whatever u-boot detects and sets 'fdtfile' to
6463
unset BOOTFS_TYPE # mainline u-boot can boot ext4 directly
6564
BOOTCONFIG="radxa-zero-3-rk3566_defconfig"
6665
BOOTSOURCE="https://github.com/u-boot/u-boot"
67-
BOOTBRANCH="tag:v2025.04"
68-
BOOTPATCHDIR="v2025.04"
66+
BOOTBRANCH="tag:v2025.10-rc2"
67+
BOOTPATCHDIR="v2025.10"
6968

7069
UBOOT_TARGET_MAP="BL31=$RKBIN_DIR/$BL31_BLOB ROCKCHIP_TPL=$RKBIN_DIR/$DDR_BLOB;;u-boot-rockchip.bin"
70+
## For binman-atf-mainline: setting BOOT_SCENARIO at the top would break branch=vendor, so we don't enable it globally.
71+
# We cannot set BOOT_SOC=rk3566 as it has side effects in Armbian scripts; ATF_TARGET_MAP is the safer override.
72+
# ATF does not separate rk3566 from rk3568.#
73+
#ATF_TARGET_MAP="M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=rk3568 bl31;;build/rk3568/release/bl31/bl31.elf:bl31.elf"
74+
#UBOOT_TARGET_MAP="BL31=bl31.elf ROCKCHIP_TPL=$RKBIN_DIR/$DDR_BLOB;;u-boot-rockchip.bin"
7175

7276
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd
7377

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ricardo Pardini <ricardo@pardini.net>
3+
Date: Fri, 31 Jan 2025 15:52:03 +0100
4+
Subject: cmd: fileenv: read string from file into env
5+
6+
- rpardini: adapted from vendor/legacy patch from 2018
7+
8+
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
9+
Signed-off-by: Stefan Agner <stefan@agner.ch>
10+
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
11+
---
12+
cmd/Kconfig | 5 +
13+
cmd/Makefile | 1 +
14+
cmd/fileenv.c | 46 ++++++++++
15+
3 files changed, 52 insertions(+)
16+
17+
diff --git a/cmd/Kconfig b/cmd/Kconfig
18+
index 111111111111..222222222222 100644
19+
--- a/cmd/Kconfig
20+
+++ b/cmd/Kconfig
21+
@@ -1825,6 +1825,11 @@ config CMD_XXD
22+
help
23+
Print file as hexdump to standard output
24+
25+
+config CMD_FILEENV
26+
+ bool "fileenv"
27+
+ help
28+
+ Read a file into memory and store it to env.
29+
+
30+
endmenu
31+
32+
if NET || NET_LWIP
33+
diff --git a/cmd/Makefile b/cmd/Makefile
34+
index 111111111111..222222222222 100644
35+
--- a/cmd/Makefile
36+
+++ b/cmd/Makefile
37+
@@ -173,6 +173,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
38+
obj-$(CONFIG_CMD_SEAMA) += seama.o
39+
obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
40+
obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o
41+
+obj-$(CONFIG_CMD_FILEENV) += fileenv.o
42+
obj-$(CONFIG_CMD_SPI) += spi.o
43+
obj-$(CONFIG_CMD_STRINGS) += strings.o
44+
obj-$(CONFIG_CMD_SMBIOS) += smbios.o
45+
diff --git a/cmd/fileenv.c b/cmd/fileenv.c
46+
new file mode 100644
47+
index 000000000000..111111111111
48+
--- /dev/null
49+
+++ b/cmd/fileenv.c
50+
@@ -0,0 +1,46 @@
51+
+#include <config.h>
52+
+#include <command.h>
53+
+#include <fs.h>
54+
+#include <linux/ctype.h>
55+
+#include <vsprintf.h>
56+
+
57+
+static char *fs_argv[5];
58+
+
59+
+int do_fileenv(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
60+
+{
61+
+ if (argc < 6)
62+
+ return CMD_RET_USAGE;
63+
+
64+
+ fs_argv[0] = "fatload";
65+
+ fs_argv[1] = argv[1];
66+
+ fs_argv[2] = argv[2];
67+
+ fs_argv[3] = argv[3];
68+
+ fs_argv[4] = argv[4];
69+
+
70+
+ if (do_fat_fsload(cmdtp, 0, 5, fs_argv) != 0)
71+
+ return 1;
72+
+
73+
+ char *addr = (char *)simple_strtoul(argv[3], NULL, 16);
74+
+ size_t size = env_get_hex("filesize", 0);
75+
+
76+
+ // Prepare string
77+
+ addr[size] = 0x00;
78+
+ char *s = addr;
79+
+ while(*s != 0x00) {
80+
+ if (isprint(*s)) {
81+
+ s++;
82+
+ }
83+
+ else {
84+
+ *s = 0x00;
85+
+ }
86+
+ }
87+
+
88+
+ return env_set(argv[5], addr);
89+
+}
90+
+
91+
+U_BOOT_CMD(
92+
+ fileenv, 6, 0, do_fileenv,
93+
+ "Read file and store it into env.",
94+
+ "<interface> <dev:part> <addr> <filename> <envname>\n"
95+
+ " - Read file from fat32 and store it as env."
96+
+);
97+
--
98+
Armbian
99+

0 commit comments

Comments
 (0)