From 99df7c5760cb9c823a8f1c6cb3280693938b4231 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 13 Feb 2026 08:36:46 -0300 Subject: [PATCH] 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) --- config/boards/mekotronics-r58x-4g.csc | 96 +- .../1001-fdt_fixup_ethernet-add-logs.patch | 200 ++++ .../mekotronics-r58x-4g-rk3588_defconfig | 96 ++ .../rk3588-blueberry-edge-v12-linux.dtsi | 1 + .../rk3588-blueberry-edge-v12-linux.dts | 1035 +++++++++++++++++ 5 files changed, 1422 insertions(+), 6 deletions(-) create mode 100644 patch/u-boot/v2026.01/board_mekotronics-r58x-4g/1001-fdt_fixup_ethernet-add-logs.patch create mode 100644 patch/u-boot/v2026.01/defconfig/mekotronics-r58x-4g-rk3588_defconfig create mode 100644 patch/u-boot/v2026.01/dt_uboot/rk3588-blueberry-edge-v12-linux.dtsi create mode 100644 patch/u-boot/v2026.01/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts diff --git a/config/boards/mekotronics-r58x-4g.csc b/config/boards/mekotronics-r58x-4g.csc index fd3042094f..36b7904e3a 100644 --- a/config/boards/mekotronics-r58x-4g.csc +++ b/config/boards/mekotronics-r58x-4g.csc @@ -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 +} diff --git a/patch/u-boot/v2026.01/board_mekotronics-r58x-4g/1001-fdt_fixup_ethernet-add-logs.patch b/patch/u-boot/v2026.01/board_mekotronics-r58x-4g/1001-fdt_fixup_ethernet-add-logs.patch new file mode 100644 index 0000000000..85646f97b5 --- /dev/null +++ b/patch/u-boot/v2026.01/board_mekotronics-r58x-4g/1001-fdt_fixup_ethernet-add-logs.patch @@ -0,0 +1,200 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ricardo Pardini +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 : ""); ++ + 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 : ""); ++ 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 + diff --git a/patch/u-boot/v2026.01/defconfig/mekotronics-r58x-4g-rk3588_defconfig b/patch/u-boot/v2026.01/defconfig/mekotronics-r58x-4g-rk3588_defconfig new file mode 100644 index 0000000000..7f6d0971cc --- /dev/null +++ b/patch/u-boot/v2026.01/defconfig/mekotronics-r58x-4g-rk3588_defconfig @@ -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 diff --git a/patch/u-boot/v2026.01/dt_uboot/rk3588-blueberry-edge-v12-linux.dtsi b/patch/u-boot/v2026.01/dt_uboot/rk3588-blueberry-edge-v12-linux.dtsi new file mode 100644 index 0000000000..e80f9bbfa5 --- /dev/null +++ b/patch/u-boot/v2026.01/dt_uboot/rk3588-blueberry-edge-v12-linux.dtsi @@ -0,0 +1 @@ +#include "rk3588-generic-u-boot.dtsi" diff --git a/patch/u-boot/v2026.01/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts b/patch/u-boot/v2026.01/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts new file mode 100644 index 0000000000..bb69d01295 --- /dev/null +++ b/patch/u-boot/v2026.01/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts @@ -0,0 +1,1035 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include +#include +#include +#include "rk3588.dtsi" + +/ { + model = "Mekotronics R58X-4G"; + compatible = "mekotronics,r58x-4G", "rockchip,rk3588"; + + aliases { + mmc0 = &sdhci; // eMMC + ethernet0 = &gmac0; + ethernet1 = &gmac1; + rs485 = &uart0; + rs232 = &uart3; + }; + + chosen { + stdout-path = "serial2:1500000n8"; + }; + + leds { + compatible = "gpio-leds"; + + fourg_led: fourg-led { + color = ; + label = "4G"; + gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&fourg_led_pin>; + }; + + lan_led: lan-led { + color = ; + label = "LAN"; + gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&lan_led_pin>; + }; + + // actually two leds: blue one labelled "PWR", and white one on Power button itself + power_led: power-led { + color = ; + label = "PWR"; + gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + pinctrl-names = "default"; + pinctrl-0 = <&power_led_pin>; + }; + + }; + + vcc12v_dcin: vcc12v-dcin { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc5v0_sys: vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_host: vcc5v0-host-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_host"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; + vin-supply = <&vcc5v0_sys>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_host_en>; + }; + + vcc_1v1_nldo_s3: vcc-1v1-nldo-s3 { + compatible = "regulator-fixed"; + regulator-name = "vcc_1v1_nldo_s3"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + vin-supply = <&vcc5v0_sys>; + }; + + pcie30_avdd0v75: pcie30-avdd0v75 { + compatible = "regulator-fixed"; + regulator-name = "pcie30_avdd0v75"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <750000>; + vin-supply = <&vdd_0v75_s0>; + }; + + pcie30_avdd1v8: pcie30-avdd1v8 { + compatible = "regulator-fixed"; + regulator-name = "pcie30_avdd1v8"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&avcc_1v8_s0>; + }; + + vcc3v3_pcie30: vcc3v3-pcie30 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie30"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + pinctrl-names = "default"; + pinctrl-0 = <&vcc3v3_pcie30_en>; + gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>; //PCIE30x4_PWREN_H + startup-delay-us = <10000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc3v3_wlan: regulator-vcc3v3-wlan { + compatible = "regulator-fixed"; + regulator-name = "wlan-en"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + gpios = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_pwren>; + vin-supply = <&vcc12v_dcin>; + }; + + hdmi0-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi0_con_in: endpoint { + remote-endpoint = <&hdmi0_out_con>; + }; + }; + }; +}; + +&cpu_b0 { + cpu-supply = <&vdd_cpu_big0_s0>; + mem-supply = <&vdd_cpu_big0_s0>; +}; + +&cpu_b1 { + cpu-supply = <&vdd_cpu_big0_s0>; + mem-supply = <&vdd_cpu_big0_s0>; +}; + +&cpu_b2 { + cpu-supply = <&vdd_cpu_big1_s0>; + mem-supply = <&vdd_cpu_big1_s0>; +}; + +&cpu_b3 { + cpu-supply = <&vdd_cpu_big1_s0>; + mem-supply = <&vdd_cpu_big1_s0>; +}; + +&cpu_l0 { + cpu-supply = <&vdd_cpu_lit_s0>; + mem-supply = <&vdd_cpu_lit_mem_s0>; +}; + +&cpu_l1 { + cpu-supply = <&vdd_cpu_lit_s0>; + mem-supply = <&vdd_cpu_lit_mem_s0>; +}; + +&cpu_l2 { + cpu-supply = <&vdd_cpu_lit_s0>; + mem-supply = <&vdd_cpu_lit_mem_s0>; +}; + +&cpu_l3 { + cpu-supply = <&vdd_cpu_lit_s0>; + mem-supply = <&vdd_cpu_lit_mem_s0>; +}; + +&gmac0 { + clock_in_out = "output"; + phy-handle = <&rgmii_phy0>; + phy-mode = "rgmii-rxid"; + + snps,reset-gpio = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 20000 100000>; + + pinctrl-names = "default"; + pinctrl-0 = <&gmac0_miim + &gmac0_tx_bus2 + &gmac0_rx_bus2 + &gmac0_rgmii_clk + &gmac0_rgmii_bus>; + + tx_delay = <0x44>; + //rx_delay = <0x4a>; + + status = "okay"; +}; + +&gmac1 { + clock_in_out = "output"; + phy-handle = <&rgmii_phy1>; + phy-mode = "rgmii-rxid"; + + snps,reset-gpio = <&gpio4 RK_PA2 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 20000 100000>; + + pinctrl-names = "default"; + pinctrl-0 = <&gmac1_miim + &gmac1_tx_bus2 + &gmac1_rx_bus2 + &gmac1_rgmii_clk + &gmac1_rgmii_bus>; + + tx_delay = <0x42>; + //rx_delay = <0x4f>; + + status = "okay"; +}; + +&gpu { + mali-supply = <&vdd_gpu_s0>; + status = "okay"; +}; + +&pd_gpu { + domain-supply = <&vdd_gpu_s0>; +}; + +&hdmi0 { + enable-gpios = <&gpio4 RK_PB1 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +&hdmi0_in { + hdmi0_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi0>; + }; +}; + +&hdmi0_out { + hdmi0_out_con: endpoint { + remote-endpoint = <&hdmi0_con_in>; + }; +}; + +&hdmi0_sound { + status = "okay"; +}; + +&hdptxphy0 { + status = "okay"; +}; + +&hdmi_receiver_cma { + status = "okay"; +}; + +&hdmi_receiver { + hpd-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&hdmim1_rx_cec &hdmim1_rx_hpdin &hdmim1_rx_scl &hdmim1_rx_sda &hdmirx_hpd>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0m2_xfer>; + status = "okay"; + + vdd_cpu_big0_s0: regulator@42 { + compatible = "rockchip,rk8602"; + reg = <0x42>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu_big0_s0"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <1050000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc5v0_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_cpu_big1_s0: regulator@43 { + compatible = "rockchip,rk8603", "rockchip,rk8602"; + reg = <0x43>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu_big1_s0"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <1050000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc5v0_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2m0_xfer>; + status = "okay"; + + vdd_npu_s0: regulator@42 { + compatible = "rockchip,rk8602"; + reg = <0x42>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_npu_s0"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <950000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc5v0_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; +}; + +// Unknown where this is wired to, maybe some header pins. Found on vendor DT. +&i2c5 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c5m3_xfer>; + status = "okay"; +}; + +&i2c6 { + status = "okay"; + + hym8563: rtc@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "hym8563"; + pinctrl-names = "default"; + pinctrl-0 = <&hym8563_int>; + interrupt-parent = <&gpio0>; + interrupts = ; //RTCIC_INT_L_GPIO0_B2 + wakeup-source; + }; +}; + +//hdmi0 sound +&i2s5_8ch { + status = "okay"; +}; + +//hdmirx sound +&i2s7_8ch { + status = "okay"; +}; + +&mdio0 { + rgmii_phy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1>; + }; +}; + +&mdio1 { + rgmii_phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1>; + }; +}; + +&pcie30phy { + status = "okay"; +}; + +//m.2 +&pcie3x4 { + reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie30>; + status = "okay"; +}; + +// wifi BCM43752 [14e4:449d] +&pcie2x1l0 { + pinctrl-names = "default"; + pinctrl-0 = <&wifi_host_wake_irq>; + reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_wlan>; + status = "okay"; + + pcie@0,0 { + reg = <0x200000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + device_type = "pci"; + bus-range = <0x20 0x2f>; + + wifi: wifi@0,0 { + compatible = "pci14e4,449d"; + reg = <0x210000 0 0 0 0>; + clocks = <&hym8563>; + clock-names = "lpo"; + }; + }; +}; + +&combphy0_ps { + status = "okay"; +}; + +&combphy1_ps { // for &pcie2x1l0 (wifi) + status = "okay"; +}; + +&combphy2_psu { + status = "okay"; +}; + +/* @TODO + modem { + compatible = "rockchip,modem"; + power-on_gpio = <&gpio0 0x1d 0x00>; + reset_gpio = <&gpio0 0x00 0x00>; + status = "okay"; + }; +*/ + + +&pinctrl { + + gpio-leds { + fourg_led_pin: fourg-led-pin { + rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + lan_led_pin: lan-led-pin { + rockchip,pins = <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + power_led_pin: power-led-pin { + rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pcie { + vcc3v3_pcie30_en: vcc3v3-pcie30-en { + rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + hdmirx { + hdmirx_hpd: hdmirx-5v-detection { + rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + hym8563 { + hym8563_int: hym8563-int { + rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + wlan { + wifi_host_wake_irq: wifi-host-wake-irq { + rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + wifi_pwren: wifi-pwren { + rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + wireless-bluetooth { + bt_reset_pin: bt-reset-pin { + rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + bt_wake_pin: bt-wake-pin { + rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + bt_wake_host_irq: bt-wake-host-irq { + rockchip,pins = <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + usb { + vcc5v0_host_en: vcc5v0-host-en { + rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + +}; + +&sata0 { + status = "okay"; +}; + +&saradc { + status = "okay"; + vref-supply = <&vcc_1v8_s0>; +}; + +&sdhci { + bus-width = <8>; + no-sdio; + no-sd; + non-removable; + max-frequency = <200000000>; // vendor + // hs400 causes immediate trouble, hs200 works at around 150mb/s + // mmc-hs400-1_8v; + // mmc-hs400-enhanced-strobe; + mmc-hs200-1_8v; + status = "okay"; +}; + +&spi2 { + assigned-clocks = <&cru CLK_SPI2>; + assigned-clock-rates = <200000000>; + num-cs = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; + status = "okay"; + + pmic@0 { + compatible = "rockchip,rk806"; + reg = <0x0>; + interrupt-parent = <&gpio0>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default", "pmic-power-off"; + pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, + <&rk806_dvs2_null>, <&rk806_dvs3_null>; + pinctrl-1 = <&rk806_dvs1_slp>, <&rk806_dvs2_null>, <&rk806_dvs3_null>; + + spi-max-frequency = <1000000>; + system-power-controller; + + vcc1-supply = <&vcc5v0_sys>; + vcc2-supply = <&vcc5v0_sys>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc5v0_sys>; + vcc6-supply = <&vcc5v0_sys>; + vcc7-supply = <&vcc5v0_sys>; + vcc8-supply = <&vcc5v0_sys>; + vcc9-supply = <&vcc5v0_sys>; + vcc10-supply = <&vcc5v0_sys>; + vcc11-supply = <&vcc_2v0_pldo_s3>; + vcc12-supply = <&vcc5v0_sys>; + vcc13-supply = <&vcc_1v1_nldo_s3>; + vcc14-supply = <&vcc_1v1_nldo_s3>; + vcca-supply = <&vcc5v0_sys>; + + gpio-controller; + #gpio-cells = <2>; + + rk806_dvs1_null: dvs1-null-pins { + pins = "gpio_pwrctrl1"; + function = "pin_fun0"; + }; + + rk806_dvs1_slp: dvs1-slp-pins { + pins = "gpio_pwrctrl1"; + function = "pin_fun1"; + }; + + rk806_dvs2_null: dvs2-null-pins { + pins = "gpio_pwrctrl2"; + function = "pin_fun0"; + }; + + rk806_dvs3_null: dvs3-null-pins { + pins = "gpio_pwrctrl3"; + function = "pin_fun0"; + }; + + regulators { + vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 { + regulator-boot-on; + regulator-enable-ramp-delay = <400>; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <950000>; + regulator-name = "vdd_gpu_s0"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <950000>; + regulator-name = "vdd_cpu_lit_s0"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_log_s0: dcdc-reg3 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <675000>; + regulator-max-microvolt = <800000>; + regulator-name = "vdd_log_s0"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <750000>; + }; + }; + + vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <550000>; + regulator-max-microvolt = <950000>; + regulator-name = "vdd_vdenc_s0"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_ddr_s0: dcdc-reg5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <675000>; + regulator-max-microvolt = <900000>; + regulator-name = "vdd_ddr_s0"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <850000>; + }; + }; + + vdd2_ddr_s3: dcdc-reg6 { + regulator-always-on; + regulator-boot-on; + regulator-name = "vdd2_ddr_s3"; + + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc_2v0_pldo_s3: dcdc-reg7 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <2000000>; + regulator-max-microvolt = <2000000>; + regulator-name = "vdd_2v0_pldo_s3"; + regulator-ramp-delay = <12500>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <2000000>; + }; + }; + + vcc_3v3_s3: dcdc-reg8 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc_3v3_s3"; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vddq_ddr_s0: dcdc-reg9 { + regulator-always-on; + regulator-boot-on; + regulator-name = "vddq_ddr_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v8_s3: dcdc-reg10 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc_1v8_s3"; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + avcc_1v8_s0: pldo-reg1 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "avcc_1v8_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v8_s0: pldo-reg2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc_1v8_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + avdd_1v2_s0: pldo-reg3 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "avdd_1v2_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_3v3_s0: pldo-reg4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12500>; + regulator-name = "vcc_3v3_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd_s0: pldo-reg5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12500>; + regulator-name = "vccio_sd_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + pldo6_s3: pldo-reg6 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "pldo6_s3"; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdd_0v75_s3: nldo-reg1 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <750000>; + regulator-name = "vdd_0v75_s3"; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <750000>; + }; + }; + + vdd_ddr_pll_s0: nldo-reg2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-name = "vdd_ddr_pll_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <850000>; + }; + }; + + avdd_0v75_s0: nldo-reg3 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <750000>; + regulator-name = "avdd_0v75_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_0v85_s0: nldo-reg4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-name = "vdd_0v85_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_0v75_s0: nldo-reg5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <750000>; + regulator-name = "vdd_0v75_s0"; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; +}; + +&tsadc { + status = "okay"; +}; + +// RS-485 on the back +&uart0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0m2_xfer>; + + linux,rs485-enabled-at-boot-time; +}; + +&uart2 { + pinctrl-0 = <&uart2m0_xfer>; + status = "okay"; +}; + +// RS-232 on the back +&uart3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m2_xfer>; +}; + +// bluetooth via the BCM43752 +&uart6 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart6m1_xfer &uart6m1_ctsn &uart6m1_rtsn>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + clocks = <&hym8563>; + clock-names = "lpo"; + interrupt-parent = <&gpio1>; // bt_wake_host_irq + interrupts = ; // bt_wake_host_irq + interrupt-names = "host-wakeup"; + device-wakeup-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>; // bt_wake_pin + shutdown-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; // bt_reset_pin + max-speed = <1500000>; + pinctrl-names = "default"; + pinctrl-0 = <&bt_wake_host_irq &bt_wake_pin &bt_reset_pin>; + vbat-supply = <&vcc_3v3_s3>; + vddio-supply = <&vcc_1v8_s3>; + }; +}; + + +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { // for fc000000.usb UDC + status = "okay"; +}; + +&usb_host0_xhci { // usb@fc000000 + dr_mode = "peripheral"; + maximum-speed = "high-speed"; + phys = <&u2phy0_otg>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +// XHCI (USB3) stuff is disabled, as it all depends on the fusb302 USB-C controller +// the blue ports on the front of the board, labelled "USB3", arent really USB3, but USB2. +&u2phy1 { // for usbdp_phy1 which is also usb_host1_xhci + status = "disabled"; +}; + +&u2phy1_otg { // for usb_host1_xhci + phy-supply = <&vcc5v0_host>; + status = "disabled"; +}; + +// USB 2.0 stuff that somewhat works: +&u2phy2 { // for usb_host0_ohci and usb_host0_ehci + status = "okay"; +}; + +&u2phy2_host { // for usb_host0_ohci and usb_host0_ehci + phy-supply = <&vcc5v0_host>; + status = "okay"; +}; + +&u2phy3 { // for usb_host1_ehci and usb_host1_ohci + status = "okay"; +}; + +&u2phy3_host { // for usb_host1_ehci and usb_host1_ohci + phy-supply = <&vcc5v0_host>; + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&vop { + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +}; + +&vp0 { + vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = ; + remote-endpoint = <&hdmi0_in_vp0>; + }; +}; + +/* NOT for u-boot yet +&pd_npu { + domain-supply = <&vdd_npu_s0>; +}; + +&rknn_core_0 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_core_1 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_core_2 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_mmu_0 { + status = "okay"; +}; + +&rknn_mmu_1 { + status = "okay"; +}; + +&rknn_mmu_2 { + status = "okay"; +}; +*/