armbian-build/config/boards/radxa-e24c.wip
Ricardo Pardini 4cfdd3c361 radxa-e24c: enable edge branch by picking from Kwiboo's WiP tree
- works pretty nice (albeit no USB support in kernel, only u-boot)
- this is still `WiP`: once Kwiboo lands his rk3528 patchset,
  most of this will change / be much simpler. Just be patient!
- Important: the Realtek DSA switch chip is not really understood
  by the likes of NetworkManager and systemd-networkd; they'll think
  the board has 4 ethernet interfaces, which is not really true.
  Only one real MAC address (the SoC's GMAC) exists; in front of it
  is a programmable switch; to make it work one needs custom setup
  to bridge the LANx ports and keep WAN separate. Even then, the
  WAN port will have the same MAC as LANx and needs to be really
  used on a separate physical network, otherwise chaos/conflicts.
  For simple usage/testing, I recommend to connect only LAN1 and
  disable the other ports in NetworkManager after the first boot.
- Note: `edge` u-boot can be written to MTD/SPI-FLASH and works.
  But keep in mind  it _cannot_ boot the vendor kernel (it hangs
  during pcie init); might work when booting from SD, if pcie is
  not enumerated by u-boot.
2025-12-19 16:16:17 +01:00

116 lines
5.7 KiB
Plaintext

# Rockchip RK3528 SoC GMAC1 RTL8367RB NVMe
BOARD_NAME="Radxa E24C"
BOARD_VENDOR="radxa"
BOARDFAMILY="rockchip-rk3588"
BOARD_MAINTAINER="rpardini"
BOOTCONFIG="radxa-e24c-spi-rk3528_defconfig" # same name across vendor and mainline
KERNEL_TARGET="edge,vendor" # edge (6.18+) is still not ready, many patches required. keep an eye on Kwiboo
BOOT_FDT_FILE="rockchip/rk3528-radxa-e24c-spi.dtb" # same name across vendor and mainline; for SPI boards
#BOOT_FDT_FILE="rockchip/rk3528-radxa-e24c.dtb" # same name across vendor and mainline; for eMMC boards
BOOT_SCENARIO="spl-blobs"
BOOT_SOC="rk3528"
IMAGE_PARTITION_TABLE="gpt"
# Schematics: https://dl.radxa.com/e/e24c/docs/radxa_e24c_v1200_schematic.pdf
# Mainline U-Boot, only for non-vendor BRANCH
function post_family_config__e24c_use_mainline_uboot() {
if [[ "${BRANCH}" == "vendor" ]]; then
return 0
fi
declare -g BOOTCONFIG="radxa-e24c-rk3528_defconfig" # mainline uboot defconfig; Kwiboo's name
display_alert "$BOARD" "Using Half-mainline/half-Kwiboo U-Boot for $BOARD / $BRANCH" "info"
declare -g BOOTDELAY=1
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
declare -g BOOTBRANCH="commit:47b50fb1125c539d80ed3e7f739c02c6486e1b52" # midway after 2026.01-rc4
declare -g BOOTPATCHDIR="v2026.01"
declare -g BOOTDIR="u-boot-${BOARD}"
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 u-boot-rockchip-usb471.bin u-boot-rockchip-usb472.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=notrunc status=none
}
function write_uboot_platform_mtd() {
flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0
}
}
# Mainline U-Boot, only for non-vendor BRANCH
# "rockchip-common: boot SD card first, then NVMe, then mmc"
# On radxa-e24c, mmc0 is the eMMC, mmc1 is the SD card slot
function pre_config_uboot_target__cm3588_patch_rockchip_common_boot_order() {
if [[ "${BRANCH}" == "vendor" ]]; then
return 0
fi
declare -a rockchip_uboot_targets=("mmc1" "nvme" "mmc0" "scsi" "usb" "pxe" "dhcp" "spi") # for future make-this-generic delight
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info"
sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
regular_git diff -u include/configs/rockchip-common.h || true
}
# Mainline U-Boot, only for non-vendor BRANCH
function post_config_uboot_target__extra_configs_for_e24c_uboot() {
if [[ "${BRANCH}" == "vendor" ]]; then
return 0
fi
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable RAMBoot images" "info"
run_host_command_logged scripts/config --enable CONFIG_ROCKCHIP_MASKROM_IMAGE
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable preboot & flash user LED in preboot" "info"
run_host_command_logged scripts/config --enable CONFIG_USE_PREBOOT
run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'led SYS on; sleep 0.1; led SYS off; led LAN1 on; sleep 0.1; led LAN1 off; led LAN2 on; sleep 0.1; led LAN2 off; led LAN3 on; sleep 0.1; led LAN3 off; '" # double quotes required due to run_host_command_logged's quirks
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable EFI debugging commands" "info"
run_host_command_logged scripts/config --enable CMD_EFIDEBUG
run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more filesystems support" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable more compression support" "info"
run_host_command_logged scripts/config --enable CONFIG_LZO
run_host_command_logged scripts/config --enable CONFIG_BZIP2
run_host_command_logged scripts/config --enable CONFIG_ZSTD
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable gpio LED support" "info"
run_host_command_logged scripts/config --enable CONFIG_LED
run_host_command_logged scripts/config --enable CONFIG_LED_GPIO
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable networking cmds" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_NFS
run_host_command_logged scripts/config --enable CONFIG_CMD_WGET
run_host_command_logged scripts/config --enable CONFIG_CMD_DNS
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP
run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK
# UMS, RockUSB, gadget stuff
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable UMS/RockUSB gadget" "info"
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")
for config in "${enable_configs[@]}"; do
run_host_command_logged scripts/config --enable "${config}"
done
# Auto-enabled by the above, force off...
run_host_command_logged scripts/config --disable USB_FUNCTION_FASTBOOT
return 0
}
# When not using vendor, set use ttyS0 as default console in bootscript
function post_family_config__e24c_set_serial_console_for_edge() {
if [[ "${BRANCH}" == vendor ]]; then
display_alert "$BOARD" "Using vendor kernel; keeping default console settings" "info"
else
display_alert "$BOARD" "Setting default console to serial ttyS0 for mainline kernel bootscript" "info"
declare -g BOOTSCRIPT="boot-rockchip64-ttyS0.cmd:boot.cmd"
declare -g SERIALCON="ttyS0"
fi
}