Skip to content

Commit 18d0bae

Browse files
committed
orangepi5: overhaul board config, update mainline uboot
1 parent a4b1edd commit 18d0bae

File tree

1 file changed

+15
-46
lines changed

1 file changed

+15
-46
lines changed

config/boards/orangepi5.conf

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,22 @@ BOOT_SPI_RKSPI_LOADER="yes"
1616
IMAGE_PARTITION_TABLE="gpt"
1717
declare -g UEFI_EDK2_BOARD_ID="orangepi-5" # This _only_ used for uefi-edk2-rk3588 extension
1818

19+
declare -g BLUETOOTH_HCIATTACH_PARAMS="-s 115200 /dev/ttyS9 bcm43xx 1500000" # For the bluetooth-hciattach extension
20+
enable_extension "bluetooth-hciattach" # Enable the bluetooth-hciattach extension
21+
1922
# Mainline U-Boot for current kernel
20-
function post_family_config_branch_current__orangepi5_use_mainline_uboot() {
23+
function post_family_config__orangepi5_use_mainline_uboot() {
24+
if [[ $BRANCH == "vendor" ]]; then
25+
return
26+
fi
27+
2128
display_alert "$BOARD" "Mainline U-Boot overrides for $BOARD - $BRANCH" "info"
2229

2330
declare -g BOOTCONFIG="orangepi-5-rk3588s_defconfig" # override the default for the board/family
2431
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
2532
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ mainline U-Boot
26-
declare -g BOOTBRANCH="tag:v2025.01"
27-
declare -g BOOTPATCHDIR="v2025.01"
33+
declare -g BOOTBRANCH="tag:v2025.04"
34+
declare -g BOOTPATCHDIR="v2025.04"
2835
declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory
2936
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
3037
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
@@ -39,13 +46,8 @@ function post_family_config_branch_current__orangepi5_use_mainline_uboot() {
3946
}
4047
}
4148

42-
43-
44-
declare -g BLUETOOTH_HCIATTACH_PARAMS="-s 115200 /dev/ttyS9 bcm43xx 1500000" # For the bluetooth-hciattach extension
45-
enable_extension "bluetooth-hciattach" # Enable the bluetooth-hciattach extension
46-
4749
function post_family_tweaks_bsp__orangepi5_copy_usb2_service() {
48-
if [[ $BRANCH == "edge" ]]; then
50+
if [[ $BRANCH == "edge" || $BRANCH == "current" ]]; then
4951
return
5052
fi
5153

@@ -58,7 +60,7 @@ function post_family_tweaks_bsp__orangepi5_copy_usb2_service() {
5860
}
5961

6062
function post_family_tweaks__orangepi5_enable_usb2_service() {
61-
if [[ $BRANCH == "edge" ]]; then
63+
if [[ $BRANCH == "edge" || $BRANCH == "current" ]]; then
6264
return
6365
fi
6466

@@ -71,7 +73,7 @@ function post_family_tweaks__orangepi5_enable_usb2_service() {
7173
}
7274

7375
function post_family_tweaks__orangepi5_naming_audios() {
74-
if [[ $BRANCH == "edge" ]]; then
76+
if [[ $BRANCH == "edge" || $BRANCH == "current" ]]; then
7577
return
7678
fi
7779

@@ -86,7 +88,7 @@ function post_family_tweaks__orangepi5_naming_audios() {
8688
}
8789

8890
function post_family_config__orangepi5_uboot_add_sata_target() {
89-
if [[ $BRANCH == "edge" ]]; then
91+
if [[ $BRANCH == "edge" || $BRANCH == "current" ]]; then
9092
return
9193
fi
9294

@@ -96,31 +98,8 @@ function post_family_config__orangepi5_uboot_add_sata_target() {
9698
BL31=$RKBIN_DIR/$BL31_BLOB $BOOTCONFIG_SATA spl/u-boot-spl.bin u-boot.dtb u-boot.itb;; rkspi_loader_sata.img"
9799
}
98100

99-
function post_family_config_branch_edge__uboot_config() {
100-
display_alert "$BOARD" "u-boot ${BOOTBRANCH_BOARD} edge overrides" "info"
101-
UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin u-boot.itb idbloader.img idbloader-spi.img"
102-
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
103-
104-
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
105-
function write_uboot_platform() {
106-
dd if=${1}/u-boot-rockchip.bin of=${2} bs=32k seek=1 conv=fsync
107-
}
108-
109-
# Smarter/faster/better to-spi writer using flashcp (hopefully with --partition), using the binman-provided 'u-boot-rockchip-spi.bin'
110-
function write_uboot_platform_mtd() {
111-
declare -a extra_opts_flashcp=("--verbose")
112-
if flashcp -h | grep -q -e '--partition'; then
113-
echo "Confirmed flashcp supports --partition -- read and write only changed blocks." >&2
114-
extra_opts_flashcp+=("--partition")
115-
else
116-
echo "flashcp does not support --partition, will write full SPI flash blocks." >&2
117-
fi
118-
flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-rockchip-spi.bin" /dev/mtd0
119-
}
120-
}
121-
122101
function post_uboot_custom_postprocess__create_sata_spi_image() {
123-
if [[ $BRANCH == "edge" ]]; then
102+
if [[ $BRANCH == "edge" || $BRANCH == "current" ]]; then
124103
return
125104
fi
126105

@@ -138,13 +117,3 @@ function post_uboot_custom_postprocess__create_sata_spi_image() {
138117
dd if=idbloader.img of=rkspi_loader_sata.img seek=64 conv=notrunc
139118
dd if=u-boot.itb of=rkspi_loader_sata.img seek=16384 conv=notrunc
140119
}
141-
142-
function post_family_config_branch_edge__orangepi5_use_mainline_uboot() {
143-
if [[ $BRANCH == "edge" ]]; then
144-
BOOTCONFIG="orangepi-5-rk3588s_defconfig"
145-
BOOTSOURCE="https://github.com/u-boot/u-boot.git"
146-
BOOTBRANCH="commit:2f0282922b2c458eea7f85c500a948a587437b63"
147-
BOOTDIR="u-boot-${BOARD}"
148-
BOOTPATCHDIR="v2024.01/board_${BOARD}"
149-
fi
150-
}

0 commit comments

Comments
 (0)