mekotronics-r58x-4g: mainline u-boot v2026.01; mainline 6.19 kernel (edge)

- rockchip64-6.19: mainline kernel (edge/6.19):
  - most stuff works, incl 4G modem, NPU, RS-485, RS-232, HDMI-RX
  - except:
    - type-c (fusb302, I've no schematics nor will to reverse)
    - DisplayPort (I don't have test hardware)
    - Analog Audio (ditto)
- keep vendor u-boot for vendor branch
- mainline u-boot v2026.01:
  - same DT as edge kernel, save for NPU nodes
  - boot order: NVMe -> SATA -> USB -> eMMC -> Ethernet/PXE
  - stable MAC addresses for GMAC0/1 via DT aliases (confirm with logging patch)
This commit is contained in:
Ricardo Pardini 2026-02-13 08:36:46 -03:00 committed by Igor
parent 2681a3a682
commit 99df7c5760
5 changed files with 1422 additions and 6 deletions

View File

@ -3,10 +3,94 @@ declare -g BOARD_NAME="Mekotronics R58X-4G"
declare -g BOARD_VENDOR="mekotronics"
declare -g BOARDFAMILY="rockchip-rk3588"
declare -g BOARD_MAINTAINER=""
declare -g KERNEL_TARGET="vendor"
declare -g BOOTCONFIG="mekotronics_r58x-rk3588_defconfig" # vendor u-boot; with NVMe and a DTS
declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-edge-v12-linux.dtb" # Specific to this board
declare -g UEFI_EDK2_BOARD_ID="r58x" # This _only_ used for uefi-edk2-rk3588 extension
declare -g KERNEL_TARGET="edge,vendor"
declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-edge-v12-linux.dtb" # same name for mainline and vendor
declare -g DISPLAY_MANAGER="wayland"
declare -g ASOUND_STATE="asound.state.rk3588hd"
declare -g BOOT_SOC="rk3588"
declare -g IMAGE_PARTITION_TABLE="gpt"
# Does not have a UEFI_EDK2_BOARD_ID
# Source vendor-specific configuration
source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh"
if [[ "${BRANCH}" == "vendor" || "${BRANCH}" == "legacy" ]]; then
display_alert "$BOARD" "vendor/legacy configuration applied for $BOARD / $BRANCH" "info"
declare -g BOOTCONFIG="mekotronics_r58x-rk3588_defconfig" # vendor u-boot; with NVMe and a DTS
# Source shared vendor configuration; it does BOOT_SCENARIO="spl-blobs" & hciattach - common to all vendor-kernel Meko's
source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh"
return 0 # this returns early so below code is only for current/edge branches
fi
# For current/edge branches:
display_alert "$BOARD" "applying mainline configuration for $BOARD / $BRANCH" "info"
declare -g BOOT_SCENARIO="tpl-blob-atf-mainline" # Mainline ATF
function post_family_config__mekor58x_4g_use_mainline_uboot() {
display_alert "$BOARD" "mainline u-boot overrides for $BOARD / $BRANCH" "info"
declare -g BOOTCONFIG="mekotronics-r58x-4g-rk3588_defconfig" # mainline
declare -g BOOTDELAY=1
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
declare -g BOOTBRANCH="tag:v2026.01"
declare -g BOOTPATCHDIR="v2026.01"
declare -g BOOTDIR="u-boot-${BOARD}"
declare -g UBOOT_TARGET_MAP="BL31=bl31.elf ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin"
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd
function write_uboot_platform() {
dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none
}
declare -g PLYMOUTH="no" # Disable plymouth as that only causes more confusion
}
# "rockchip-common: boot NVMe, SATA, USB, then eMMC last before PXE"
# include/configs/rockchip-common.h
# On the meko r58-r58x_4g: mmc0 is eMMC; there is no SDcard reader
# Enumerating usb is pretty slow so do it after nvme
function pre_config_uboot_target__mekor58x_4g_patch_rockchip_common_boot_order() {
declare -a rockchip_uboot_targets=("nvme" "scsi" "usb" "mmc0" "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
}
function post_config_uboot_target__extra_configs_for_mekor58x_4g_mainline_environment_in_spi() {
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable board-specific configs" "info"
run_host_command_logged scripts/config --enable CONFIG_CMD_MISC
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 4G on; sleep 0.1; led LAN on; sleep 0.1; led PWR on; sleep 0.1; led 4G off; sleep 0.1; led LAN off; sleep 0.1;'" # 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
}

View File

@ -0,0 +1,200 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ricardo Pardini <ricardo@pardini.net>
Date: Mon, 12 Jan 2026 18:26:25 +0100
Subject: fdt_fixup_ethernet: add logs
---
boot/fdt_support.c | 57 +++++++---
boot/image-fdt.c | 25 ++++
2 files changed, 67 insertions(+), 15 deletions(-)
diff --git a/boot/fdt_support.c b/boot/fdt_support.c
index 111111111111..222222222222 100644
--- a/boot/fdt_support.c
+++ b/boot/fdt_support.c
@@ -630,29 +630,34 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return fdt_fixup_memory_banks(blob, &start, &size, 1);
}
+#warning "Compiling fdt_fixup_ethernet() for MAC debugging."
void fdt_fixup_ethernet(void *fdt)
{
+ log_info("[fdt_fixup_ethernet] called\n");
int i = 0, j, prop;
char *tmp, *end;
char mac[16];
const char *path;
unsigned char mac_addr[ARP_HLEN];
int offset;
+ int total_aliases = 0, total_attempted = 0, total_skipped = 0, total_patched = 0;
#ifdef FDT_SEQ_MACADDR_FROM_ENV
int nodeoff;
const struct fdt_property *fdt_prop;
#endif
- if (fdt_path_offset(fdt, "/aliases") < 0)
+ int aliases_off = fdt_path_offset(fdt, "/aliases");
+ if (aliases_off < 0) {
+ log_info("[fdt_fixup_ethernet] /aliases node not found\n");
return;
+ }
/* Cycle through all aliases */
for (prop = 0; ; prop++) {
const char *name;
/* FDT might have been edited, recompute the offset */
- offset = fdt_first_property_offset(fdt,
- fdt_path_offset(fdt, "/aliases"));
+ offset = fdt_first_property_offset(fdt, aliases_off);
/* Select property number 'prop' */
for (j = 0; j < prop; j++)
offset = fdt_next_property_offset(fdt, offset);
@@ -660,7 +665,10 @@ void fdt_fixup_ethernet(void *fdt)
if (offset < 0)
break;
+ total_aliases++;
path = fdt_getprop_by_offset(fdt, offset, &name, NULL);
+ log_info("[fdt_fixup_ethernet] alias #%d: name='%s', path='%s'\n", prop, name, path ? path : "<null>");
+
if (!strncmp(name, "ethernet", 8)) {
/* Treat plain "ethernet" same as "ethernet0". */
if (!strcmp(name, "ethernet")
@@ -679,33 +687,52 @@ void fdt_fixup_ethernet(void *fdt)
else
sprintf(mac, "eth%daddr", i);
} else {
+ log_info("[fdt_fixup_ethernet] Skipping alias '%s' (invalid index)\n", name);
+ total_skipped++;
continue;
}
#ifdef FDT_SEQ_MACADDR_FROM_ENV
nodeoff = fdt_path_offset(fdt, path);
- fdt_prop = fdt_get_property(fdt, nodeoff, "status",
- NULL);
- if (fdt_prop && !strcmp(fdt_prop->data, "disabled"))
+ fdt_prop = fdt_get_property(fdt, nodeoff, "status", NULL);
+ if (fdt_prop && !strcmp(fdt_prop->data, "disabled")) {
+ log_info("[fdt_fixup_ethernet] Node '%s' is disabled, skipping\n", path);
+ total_skipped++;
continue;
+ }
i++;
#endif
+ total_attempted++;
tmp = env_get(mac);
- if (!tmp)
+ log_info("[fdt_fixup_ethernet] env var for alias '%s' is '%s', value='%s'\n", name, mac, tmp ? tmp : "<not set>");
+ if (!tmp) {
+ log_info("[fdt_fixup_ethernet] env var '%s' not set, skipping\n", mac);
+ total_skipped++;
continue;
-
+ }
+ int nodeoff = fdt_path_offset(fdt, path);
+ if (nodeoff < 0) {
+ log_info("[fdt_fixup_ethernet] Node path '%s' not found, skipping\n", path);
+ total_skipped++;
+ continue;
+ }
+ const struct fdt_property *status_prop = fdt_get_property(fdt, nodeoff, "status", NULL);
+ if (status_prop && strcmp((const char *)status_prop->data, "okay")) {
+ log_info("[fdt_fixup_ethernet] Node '%s' status is '%s', skipping\n", path, (const char *)status_prop->data);
+ total_skipped++;
+ continue;
+ }
for (j = 0; j < 6; j++) {
- mac_addr[j] = tmp ?
- hextoul(tmp, &end) : 0;
+ mac_addr[j] = tmp ? hextoul(tmp, &end) : 0;
if (tmp)
tmp = (*end) ? end + 1 : end;
}
-
- do_fixup_by_path(fdt, path, "mac-address",
- &mac_addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- &mac_addr, 6, 1);
+ log_info("[fdt_fixup_ethernet] Patching node '%s' (offset %d) with MAC %02x:%02x:%02x:%02x:%02x:%02x\n", path, nodeoff, mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
+ do_fixup_by_path(fdt, path, "mac-address", &mac_addr, 6, 0);
+ do_fixup_by_path(fdt, path, "local-mac-address", &mac_addr, 6, 1);
+ total_patched++;
}
}
+ log_info("[fdt_fixup_ethernet] SUMMARY: aliases found=%d, attempted=%d, skipped=%d, patched=%d\n", total_aliases, total_attempted, total_skipped, total_patched);
}
int fdt_record_loadable(void *blob, u32 index, const char *name,
diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index 111111111111..222222222222 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -1,3 +1,4 @@
+#warning "Building image-fdt.c: fdt fixup call chain instrumented for MAC debugging."
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2013, Google Inc.
@@ -578,13 +579,31 @@ __weak int ft_verify_fdt(void *fdt)
return 1;
}
+#warning "Compiling arch_fixup_fdt() weak stub for MAC debugging."
__weak int arch_fixup_fdt(void *blob)
{
+ log_info("[arch_fixup_fdt] called (weak stub)\n");
return 0;
}
+#warning "Compiling ft_board_setup() weak stub for MAC debugging."
+__weak int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ log_info("[ft_board_setup] called (weak stub)\n");
+ return 0;
+}
+
+#warning "Compiling ft_system_setup() weak stub for MAC debugging."
+__weak int ft_system_setup(void *blob, struct bd_info *bd)
+{
+ log_info("[ft_system_setup] called (weak stub)\n");
+ return 0;
+}
+
+#warning "Compiling image_setup_libfdt()"
int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb)
{
+ log_info("[image_setup_libfdt] called\n");
ulong *initrd_start = &images->initrd_start;
ulong *initrd_end = &images->initrd_end;
bool skip_board_fixup = false;
@@ -632,6 +651,8 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb)
strlen(images->fit_uname_cfg) + 1, 1);
/* Update ethernet nodes */
+ #warning "Compiling fdt_fixup_ethernet() call site in image_setup_libfdt()"
+ log_info("[image_setup_libfdt] calling fdt_fixup_ethernet\n");
fdt_fixup_ethernet(blob);
#if IS_ENABLED(CONFIG_CMD_PSTORE)
/* Append PStore configuration */
@@ -645,6 +666,8 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb)
}
if (IS_ENABLED(CONFIG_OF_BOARD_SETUP) && !skip_board_fixup) {
+ #warning "Compiling ft_board_setup() call site in image_setup_libfdt()"
+ log_info("[image_setup_libfdt] calling ft_board_setup\n");
fdt_ret = ft_board_setup(blob, gd->bd);
if (fdt_ret) {
printf("ERROR: board-specific fdt fixup failed: %s\n",
@@ -652,7 +675,9 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb)
goto err;
}
}
+ #warning "Compiling ft_system_setup() call site in image_setup_libfdt()"
if (IS_ENABLED(CONFIG_OF_SYSTEM_SETUP)) {
+ log_info("[image_setup_libfdt] calling ft_system_setup\n");
fdt_ret = ft_system_setup(blob, gd->bd);
if (fdt_ret) {
printf("ERROR: system-specific fdt fixup failed: %s\n",
--
Armbian

View File

@ -0,0 +1,96 @@
CONFIG_ARM=y
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_COUNTER_FREQUENCY=24000000
CONFIG_ARCH_ROCKCHIP=y
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588-blueberry-edge-v12-linux"
CONFIG_ROCKCHIP_RK3588=y
CONFIG_SPL_SERIAL=y
CONFIG_TARGET_ROCK5B_RK3588=y
CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
CONFIG_AHCI=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-blueberry-edge-v12-linux.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
CONFIG_SPL_ATF=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_USB=y
CONFIG_CMD_ROCKUSB=y
CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_REGULATOR=y
# CONFIG_SPL_DOS_PARTITION is not set
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_LIVE=y
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SPL_REGMAP=y
CONFIG_SPL_SYSCON=y
CONFIG_AHCI_PCI=y
CONFIG_DWC_AHCI=y
CONFIG_SPL_CLK=y
# CONFIG_USB_FUNCTION_FASTBOOT is not set
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_MISC=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
CONFIG_PHY_REALTEK=y
CONFIG_DWC_ETH_QOS=y
CONFIG_DWC_ETH_QOS_ROCKCHIP=y
CONFIG_NVME_PCI=y
CONFIG_PCIE_DW_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
CONFIG_PHY_ROCKCHIP_USBDP=y
CONFIG_SPL_PINCTRL=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_SPL_RAM=y
CONFIG_SCSI=y
CONFIG_BAUDRATE=1500000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550_MEM32=y
CONFIG_SYSRESET=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_SPL_USB_DWC3_GENERIC=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_ASIX88179=y
CONFIG_USB_ETHER_LAN75XX=y
CONFIG_USB_ETHER_LAN78XX=y
CONFIG_USB_ETHER_MCS7830=y
CONFIG_USB_ETHER_RTL8152=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_ROCKUSB=y
CONFIG_ERRNO_STR=y

View File

@ -0,0 +1 @@
#include "rk3588-generic-u-boot.dtsi"

File diff suppressed because it is too large Load Diff