Skip to content

Commit

Permalink
mekotronics: mainline u-boot experiment using `generic-rk3588_defconf…
Browse files Browse the repository at this point in the history
…ig`, gated by `MEKO_USE_MAINLINE_UBOOT=yes`

- Kwiboo's `rk3xxx-2024.04` -- also works with mainline's `next`
- works! (sd/emmc only ofc)
  • Loading branch information
rpardini committed Apr 3, 2024
1 parent ac163dc commit d263949
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions config/sources/vendors/mekotronics/mekotronics-rk3588.hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# This file is a part of the Armbian Build Framework https://github.com/armbian/build/
#

# DISABLED: Vendor u-boot, standard rockchip, plus patches.
function DISABLED_post_family_config_branch_legacy__uboot_mekotronics() {
# Vendor u-boot, standard rockchip, plus patches.
function post_family_config__vendor_uboot_mekotronics() {
display_alert "$BOARD" "Configuring Mekotronics R58 ($BOARD) u-boot" "info"

declare -g BOOTSOURCE='https://github.com/radxa/u-boot.git'
Expand All @@ -19,32 +19,34 @@ function DISABLED_post_family_config_branch_legacy__uboot_mekotronics() {
declare -g BOOTDELAY=1 # build injects this into u-boot config. we can then get into UMS mode and avoid the whole rockusb/rkdeveloptool thing
}

# Mainline u-boot with generic rk3588 support from next branch upstream (2024-03-31)
# Conditional hook to allow experimenting with this against legacy/vendor branches
if [[ "${MEKO_USE_MAINLINE_UBOOT:-"no"}" == "yes" ]]; then
# Mainline u-boot with generic rk3588 support from next branch upstream (2024-03-31) or Kwiboo's tree

# Override family config for this board; let's avoid conditionals in family config.
function post_family_config__meko_use_mainline_uboot() {
display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info"
function post_family_config__meko_use_mainline_uboot() {
display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info"

declare -g BOOTCONFIG="generic-rk3588_defconfig" # MAINLINE U-BOOT OVERRIDE - for all boards - maybe nanopc-t6-rk3588_defconfig ?
declare -g BOOTCONFIG="generic-rk3588_defconfig" # MAINLINE U-BOOT OVERRIDE

declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc

BOOTSOURCE="https://github.com/u-boot/u-boot.git"
BOOTBRANCH="commit:27795dd717dadc73091e1b4d6c50952b93aaa819" # head of `branch:next` as of 2024-03-31
BOOTPATCHDIR="v2024.04-mekotronics" # empty
BOOTSOURCE="https://github.com/Kwiboo/u-boot-rockchip.git"
BOOTBRANCH="branch:rk3xxx-2024.04" # commit:31522fe7b3c7733313e1c5eb4e340487f6000196 as of 2024-04-01
BOOTPATCHDIR="v2024.04-mekotronics" # empty

BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory
BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory

UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin" # NOT u-boot-rockchip-spi.bin
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
UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin" # NOT u-boot-rockchip-spi.bin
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

# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
function write_uboot_platform() {
dd if=${1}/u-boot-rockchip.bin of=${2} bs=32k seek=1 conv=fsync
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
function write_uboot_platform() {
dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none
}
}
}

# I'm FED UP with this, lets make part of core
function add_host_dependencies__new_uboot_wants_pyelftools() {
declare -g EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} python3-pyelftools" # @TODO: convert to array later
}
# I'm FED UP with this, @TODO lets make it part of core deps soon and cleanup all those hooks all spread around
function add_host_dependencies__new_uboot_wants_pyelftools() {
declare -g EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} python3-pyelftools" # @TODO: convert to array later
}
fi

0 comments on commit d263949

Please sign in to comment.