]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
starfive: add ubootenv support
authorZoltan HERPAI <wigyori@uid0.hu>
Sun, 1 Jun 2025 21:34:50 +0000 (21:34 +0000)
committerZoltan HERPAI <wigyori@uid0.hu>
Sun, 22 Mar 2026 11:41:54 +0000 (12:41 +0100)
The VF2 boards store their ubootenv on /dev/mtd1 which is a SPI flash
partition. Add support for reading this partition in uboot-envtools,
and add the package into the VF2 image.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
package/boot/uboot-tools/uboot-envtools/files/starfive [new file with mode: 0644]
target/linux/starfive/image/Makefile

diff --git a/package/boot/uboot-tools/uboot-envtools/files/starfive b/package/boot/uboot-tools/uboot-envtools/files/starfive
new file mode 100644 (file)
index 0000000..752963d
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(board_name)
+
+case "$board" in
+starfive,visionfive-2-v1.3b)
+       ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
+       ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
index 7099f7592ae76e8ca39e453b92597021e0ea3e53..11fb09f63ce6ca1443d88ef45d49c93c7e5a2712 100644 (file)
@@ -60,7 +60,7 @@ define Device/visionfive2-v1.3b
   DEVICE_VENDOR := StarFive
   DEVICE_MODEL := VisionFive2 v1.3b
   DEVICE_DTS := starfive/jh7110-starfive-visionfive-2-v1.3b
-  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-leds-gpio
+  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-leds-gpio uboot-envtools
 endef
 TARGET_DEVICES += visionfive2-v1.3b