Skip to content

Commit 8dd2de6

Browse files
rpardiniigorpecovnik
authored andcommitted
nanopi-r5s: u-boot: main: bump u-boot to v2026.07-rc5 + make it patch-less
- convert patches to hooks that do the patching/configuring - one for boot order - one for OTG ("the USB-A closest to the edge is the OTG port") - enable lwip, btrfs, etc
1 parent 28523a4 commit 8dd2de6

3 files changed

Lines changed: 34 additions & 64 deletions

File tree

config/boards/nanopi-r5s.csc

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ IMAGE_PARTITION_TABLE="gpt"
1414
FULL_DESKTOP="yes"
1515
BOOT_LOGO="desktop"
1616

17-
BOOTBRANCH_BOARD="tag:v2024.04"
18-
BOOTPATCHDIR="v2024.04"
17+
BOOTBRANCH_BOARD="tag:v2026.07-rc5"
18+
BOOTPATCHDIR="v2026.07"
1919
BOOTCONFIG="nanopi-r5s-rk3568_defconfig"
2020

2121
OVERLAY_PREFIX="rockchip-rk3568"
@@ -44,40 +44,62 @@ function pre_customize_image__nanopi-r5s_leds_kernel_only() {
4444
chroot_sdcard systemctl --no-reload disable armbian-led-state
4545
}
4646

47-
# For UMS/RockUSB to work in u-boot, &usb_host0_xhci { dr_mode = "otg" } is required. See 0002-usb-otg-mode.patch
4847
# Attention: the Power USB-C port is NOT the OTG port; instead, the USB-A closest to the edge is the OTG port.
49-
function post_config_uboot_target__extra_configs_for_nanopi-r5s() {
50-
display_alert "u-boot for ${BOARD}" "u-boot: enable preboot & flash all LEDs and do PCI/NVMe enumeration in preboot" "info"
48+
function pre_config_uboot_target__nanopir5s_patch_uboot_dtsi_for_ums() {
49+
display_alert "u-boot for ${BOARD}" "u-boot: add to u-boot dtsi for UMS" "info" # avoid a patch, just append to the dtsi file
50+
# Append to the u-boot dtsi file with stuff for enabling gadget/otg/peripheral mode
51+
cat <<- EOD >> arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi
52+
&usb_host0_xhci { dr_mode = "otg"; };
53+
EOD
54+
}
55+
56+
# "rockchip-common: boot SD card first, then NVMe, then mmc"
57+
# include/configs/rockchip-common.h
58+
function pre_config_uboot_target__nanopir5s_patch_rockchip_common_boot_order() {
59+
declare -a rockchip_uboot_targets=("mmc1" "nvme" "usb" "mmc0" "scsi" "pxe" "dhcp" "spi") # for future make-this-generic delight
60+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info"
61+
sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
62+
regular_git diff -u include/configs/rockchip-common.h || true
63+
}
64+
65+
function post_config_uboot_target__extra_configs_for_nanopir5s_mainline() {
66+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable preboot & flash user LED in preboot" "info"
5167
run_host_command_logged scripts/config --enable CONFIG_USE_PREBOOT
5268
run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'led led-power on; led led-lan1 on; led led-lan2 on; led led-wan on; pci enum; nvme scan; led led-lan1 off; led led-lan2 off; led led-wan off'" # double quotes required due to run_host_command_logged's quirks
5369

54-
display_alert "u-boot for ${BOARD}" "u-boot: enable EFI debugging command" "info"
70+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable EFI debugging commands" "info"
5571
run_host_command_logged scripts/config --enable CMD_EFIDEBUG
5672
run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI
5773

58-
display_alert "u-boot for ${BOARD}" "u-boot: enable more compression support" "info"
74+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more filesystems support" "info"
75+
run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS
76+
77+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more compression support" "info"
5978
run_host_command_logged scripts/config --enable CONFIG_LZO
6079
run_host_command_logged scripts/config --enable CONFIG_BZIP2
6180
run_host_command_logged scripts/config --enable CONFIG_ZSTD
6281

63-
display_alert "u-boot for ${BOARD}" "u-boot: enable gpio LED support" "info"
82+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable gpio LED support" "info"
6483
run_host_command_logged scripts/config --enable CONFIG_LED
6584
run_host_command_logged scripts/config --enable CONFIG_LED_GPIO
6685

67-
display_alert "u-boot for ${BOARD}" "u-boot: enable networking cmds" "info"
86+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable networking cmds" "info"
6887
run_host_command_logged scripts/config --enable CONFIG_CMD_NFS
6988
run_host_command_logged scripts/config --enable CONFIG_CMD_WGET
7089
run_host_command_logged scripts/config --enable CONFIG_CMD_DNS
7190
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP
7291
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK
7392

93+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable LWIP (new networking stack)" "info"
94+
run_host_command_logged scripts/config --enable CONFIG_CMD_MII
95+
run_host_command_logged scripts/config --enable CONFIG_NET_LWIP
96+
7497
# UMS, RockUSB, gadget stuff
75-
declare -a enable_configs=("CONFIG_CMD_USB_MASS_STORAGE" "CONFIG_USB_GADGET" "USB_GADGET_DOWNLOAD" "CONFIG_USB_FUNCTION_ROCKUSB" "CONFIG_USB_FUNCTION_ACM" "CONFIG_CMD_ROCKUSB" "CONFIG_CMD_USB_MASS_STORAGE")
98+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable UMS/RockUSB gadget" "info"
99+
declare -a enable_configs=("CONFIG_CMD_USB_MASS_STORAGE" "CONFIG_USB_GADGET" "USB_GADGET_DOWNLOAD" "CONFIG_USB_FUNCTION_ROCKUSB" "CONFIG_USB_FUNCTION_ACM" "CONFIG_CMD_ROCKUSB")
76100
for config in "${enable_configs[@]}"; do
77-
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable ${config}" "info"
78101
run_host_command_logged scripts/config --enable "${config}"
79102
done
80103
# Auto-enabled by the above, force off...
81104
run_host_command_logged scripts/config --disable USB_FUNCTION_FASTBOOT
82-
83105
}

patch/u-boot/v2024.04/board_nanopi-r5s/0001-rockchip-common-boot-USB-devices-first-then-nvme-mmc-s-scsi.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

patch/u-boot/v2024.04/board_nanopi-r5s/0002-usb-otg-mode.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)