Skip to content

mekotronics-r58x-4g: usb fixes + u-boot v2026.04-rc2 + analog audio#9412

Merged
rpardini merged 10 commits intoarmbian:mainfrom
rpardini:pr/mekotronics-r58x-4g-usb-fixes--u-boot-v202604-rc2--analog-audio
Feb 19, 2026
Merged

mekotronics-r58x-4g: usb fixes + u-boot v2026.04-rc2 + analog audio#9412
rpardini merged 10 commits intoarmbian:mainfrom
rpardini:pr/mekotronics-r58x-4g-usb-fixes--u-boot-v202604-rc2--analog-audio

Conversation

@rpardini
Copy link
Member

@rpardini rpardini commented Feb 18, 2026

mekotronics-r58x-4g: usb fixes + u-boot v2026.04-rc2 + analog audio

  • 🌳 rockchip64-6.19: mekotronics-r58x-4g: drop invalid hdmi enable-gpios
    • drop invalid and useless enable-gpios on hdmi0 node
      • was from vendor kernel
      • does nothing in mainline
      • is not required in mainline for working HDMI
  • 🍀 rockchip64-6.19: mekotronics-r58x-4g: add vcc5v0_otg regulator (gpio4_PA7)
    • probably type-c stuff, but we never know with Meko
  • 🐸 rockchip64-6.19: mekotronics-r58x-4g: fix type-A USB ports
    • this gets the 3 usb type-A ports in the front working
  • 🌱 rockchip64-6.19: mekotronics-r58x-4g: add analog sound es8388
    • also: drop old modem (4G) to-do, as modem already works without it
  • 🌵 u-boot: v2026.04: prepare patching dir for v2026.04
    • fileenv patch (same as v2026.01)
    • fdt_fixup_ethernet logging patch (same as v2026.01)
    • 0000.patching_config.yaml: defconfig/dt_upstream_rockchip/dt_uboot
    • notable in v2026.04:
      • dt-rebasing bumped up to v6.18 (which has NPU nodes)
        • this allows us to share complete DTs between kernel and u-boot via symlinks
      • Kwiboo had a go at LWIP which should be usable now; Kwiboo rocks.
  • 🌴 mekotronics-r58x-4g: u-boot: bump to v2026.04-rc2 with symlink-shared DT
    • u-boot v2026.04-rcX has bumped dt-rebasing to v6.18, thus it knows about NPU nodes now and we can simply symlink to kernel DT, reducing duplication by a lot
  • 🌿 rockchip64-6.19: mekotronics-r58x-4g: add fusb302
    • works as far as I can tell
    • both orientations
    • also wired DP, but can't test (I've no USB-DP hw)
  • 🍃 mekotronics-r58x-4g: u-boot: enable tpcm/fusb302 support
    • also tcpm cmd for debugging
  • 🌳 mekotronics-r58x-4g: u-boot: create -u-boot.dtsi via hook
    • saves one .dtsi file in patch/.../dt_uboot
    • I had the wrong name (missing -u-boot suffix) too so this fixes it too
  • 🍀 Revert "rockchip64-6.19: mekotronics-r58x-4g: add fusb302"
    • This reverts commit e94425f.
    • I am clearly not up to par with type-c/fusb302 stuff yet
      • sending this for future reference

Summary by CodeRabbit

Release Notes

  • New Features

    • Audio codec support enabled for audio playback
    • USB On-The-Go and mass storage functionality for file transfers
    • USB Type-C port management and host capabilities
    • Dual USB host port support activated
  • Chores

    • Upgraded U-Boot bootloader to v2026.04-rc2

@github-actions github-actions bot added size/large PR with 250 lines or more 02 Milestone: First quarter release labels Feb 18, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Updated Mekotronics R58X-4G board onboarding: bumped U-Boot references to v2026.04, added a UMS DT-patching helper (duplicated in file), introduced a new U-Boot "fileenv" command and Kconfig/Makefile entries, added u-boot patching overlays mapping, and expanded kernel DT with audio, OTG regulator, Type-C, and USB host nodes.

Changes

Cohort / File(s) Summary
Board config / U-Boot hooks
config/boards/mekotronics-r58x-4g.csc
Updated post-family U-Boot branch/patchdir to v2026.04, added pre_config_uboot_target__ekor58x_4g_patch_uboot_dtsi_for_ums() helper to append UMS-related DT entries; helper appears duplicated in the file (two identical implementations).
U-Boot v2026.01 -> removal
patch/u-boot/v2026.01/dt_uboot/rk3588-blueberry-edge-v12-linux.dtsi, patch/u-boot/v2026.01/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts
Removed the include line from the U-Boot DT include and deleted the upstream v2026.01 DTS file (large removal).
U-Boot v2026.04 overlays & defconfig
patch/u-boot/v2026.04/0000.patching_config.yaml, patch/u-boot/v2026.04/defconfig/mekotronics-r58x-4g-rk3588_defconfig, patch/u-boot/v2026.04/dt_upstream_rockchip/rk3588-blueberry-edge-v12-linux.dts
Added patching_config.yaml with overlay->target mappings, new defconfig lines enabling TCPM/Type-C/FUSB302, and a DTS that references the kernel archive DTS.
New U-Boot command
patch/u-boot/v2026.04/cmd-fileenv-read-string-from-file-into-env.patch, cmd/Kconfig, cmd/Makefile
Introduced fileenv command implementation, argument validation, FAT file load, in-place sanitization, env storage, plus Kconfig/Makefile updates to build it.
Kernel device tree additions
patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts
Added top-level sound node and codec (es8388), vcc5v0_otg regulator, USB Type-C pinctrl nodes, enabled USB PHY/OTG/u2phy/xhci host nodes, removed hdmi enable-gpios, and added related pinctrl/ports/endpoints.

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant User as Console
participant U-Boot as U-Boot Cmd
participant FS as FAT Driver
participant RAM as Memory
participant ENV as Env Subsystem

User->>U-Boot: run "fileenv dev:part "
U-Boot->>FS: do_fat_fsload(dev:part, , )
FS-->>U-Boot: file data + filesize
U-Boot->>RAM: write data at , append '\0'
U-Boot->>RAM: sanitize non-printable bytes
U-Boot->>ENV: set =
ENV-->>U-Boot: success/failure
U-Boot-->>User: output result

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • igorpecovnik
  • JohnTheCoolingFan
  • pyavitz
  • catalinii
  • prahal
  • SuperKali
  • Tonymac32
  • ColorfulRhino
  • amazingfate
  • brentr
  • chainsx
  • joekhoobyar

Poem

🐰 I hopped through trees of device-tree and code,
Pushed U-Boot forward down a winding road,
Type‑C wakes up, audio hums in tune,
A fileenv trick stores secrets by the moon,
Hooray — the board now dances to a newer tune! 🎶

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the three main changes: USB fixes, U-Boot version bump to v2026.04-rc2, and analog audio support, matching the PR's objectives and changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Feb 18, 2026
@rpardini
Copy link
Member Author

@igorpecovnik -- follow-up to #9398

"proof" of USB-enablement, all type-a and the type-c port work now. type-c is orientation-sensitive still, and in u-boot is reserved for UMS.

usb enablement proof

# lsusb -vt
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        ID 0bda:9210 Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0608 Genesys Logic, Inc. Hub
        |__ Port 001: Dev 011, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 1c4f:0048 SiGma Micro
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=ehci-platform/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        ID 0781:cfcb SanDisk Corp.
/:  Bus 005.Port 001: Dev 001, Class=root_hub, Driver=ohci-platform/1p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 006.Port 001: Dev 001, Class=root_hub, Driver=xhci-hcd/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        ID 045e:07f8 Microsoft Corp. Wired Keyboard 600 (model 1576)
    |__ Port 001: Dev 002, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        ID 045e:07f8 Microsoft Corp. Wired Keyboard 600 (model 1576)

# ls -la /sys/bus/usb/devices/
total 0
drwxr-xr-x 2 root root 0 Feb 18 02:35 .
drwxr-xr-x 4 root root 0 Jan  1  1970 ..
lrwxrwxrwx 1 root root 0 Jan  1  1970 1-0:1.0 -> ../../../devices/platform/fc000000.usb/xhci-hcd.0.auto/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jan  1  1970 1-1 -> ../../../devices/platform/fc000000.usb/xhci-hcd.0.auto/usb1/1-1
lrwxrwxrwx 1 root root 0 Jan  1  1970 1-1:1.0 -> ../../../devices/platform/fc000000.usb/xhci-hcd.0.auto/usb1/1-1/1-1:1.0
lrwxrwxrwx 1 root root 0 Jan  1  1970 2-0:1.0 -> ../../../devices/platform/fc880000.usb/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:32 2-1 -> ../../../devices/platform/fc880000.usb/usb2/2-1
lrwxrwxrwx 1 root root 0 Feb 18 02:35 2-1.1 -> ../../../devices/platform/fc880000.usb/usb2/2-1/2-1.1
lrwxrwxrwx 1 root root 0 Feb 18 02:32 2-1:1.0 -> ../../../devices/platform/fc880000.usb/usb2/2-1/2-1:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:35 2-1.1:1.0 -> ../../../devices/platform/fc880000.usb/usb2/2-1/2-1.1/2-1.1:1.0
lrwxrwxrwx 1 root root 0 Jan  1  1970 3-0:1.0 -> ../../../devices/platform/fc8c0000.usb/usb3/3-0:1.0
lrwxrwxrwx 1 root root 0 Jan  1  1970 4-0:1.0 -> ../../../devices/platform/fc800000.usb/usb4/4-0:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:34 4-1 -> ../../../devices/platform/fc800000.usb/usb4/4-1
lrwxrwxrwx 1 root root 0 Feb 18 02:34 4-1:1.0 -> ../../../devices/platform/fc800000.usb/usb4/4-1/4-1:1.0
lrwxrwxrwx 1 root root 0 Jan  1  1970 5-0:1.0 -> ../../../devices/platform/fc840000.usb/usb5/5-0:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:32 6-0:1.0 -> ../../../devices/platform/fc400000.usb/xhci-hcd.7.auto/usb6/6-0:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:34 6-1 -> ../../../devices/platform/fc400000.usb/xhci-hcd.7.auto/usb6/6-1
lrwxrwxrwx 1 root root 0 Feb 18 02:34 6-1:1.0 -> ../../../devices/platform/fc400000.usb/xhci-hcd.7.auto/usb6/6-1/6-1:1.0
lrwxrwxrwx 1 root root 0 Feb 18 02:34 6-1:1.1 -> ../../../devices/platform/fc400000.usb/xhci-hcd.7.auto/usb6/6-1/6-1:1.1
lrwxrwxrwx 1 root root 0 Jan  1  1970 usb1 -> ../../../devices/platform/fc000000.usb/xhci-hcd.0.auto/usb1
lrwxrwxrwx 1 root root 0 Jan  1  1970 usb2 -> ../../../devices/platform/fc880000.usb/usb2
lrwxrwxrwx 1 root root 0 Jan  1  1970 usb3 -> ../../../devices/platform/fc8c0000.usb/usb3
lrwxrwxrwx 1 root root 0 Jan  1  1970 usb4 -> ../../../devices/platform/fc800000.usb/usb4
lrwxrwxrwx 1 root root 0 Jan  1  1970 usb5 -> ../../../devices/platform/fc840000.usb/usb5
lrwxrwxrwx 1 root root 0 Feb 18 02:32 usb6 -> ../../../devices/platform/fc400000.usb/xhci-hcd.7.auto/usb6

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts (1)

1008-1014: 🛠️ Refactor suggestion | 🟠 Major

Duplicate &usb_host0_xhci overrides — consolidate into one block.

There are two &usb_host0_xhci blocks: lines 1008–1014 set dr_mode = "peripheral" with PHY bindings and speed limit, then lines 1052–1055 override dr_mode = "host". The later block silently wins on dr_mode, but the stale dr_mode = "peripheral" at line 1009 is dead/misleading. This split makes the final effective state hard to reason about.

Consolidate into a single block with the intended final state:

♻️ Merge into one coherent block
-&usb_host0_xhci { // usb@fc000000
-	dr_mode = "peripheral";
-	maximum-speed = "high-speed";
-	phys = <&u2phy0_otg>;
-	phy-names = "usb2-phy";
-	status = "okay";
-};
...
-&usb_host0_xhci {
-	dr_mode = "host";
-	status = "okay";
-};
+&usb_host0_xhci { // usb@fc000000 - Type-C port, USB2 only (usbdp_phy0 not wired)
+	dr_mode = "host";
+	maximum-speed = "high-speed";
+	phys = <&u2phy0_otg>;
+	phy-names = "usb2-phy";
+	status = "okay";
+};

Also applies to: 1052-1055

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts`
around lines 1008 - 1014, Two duplicate &usb_host0_xhci override blocks exist;
consolidate them into one coherent override by merging properties from both
blocks (maximum-speed, phys, phy-names, status) and keeping the intended final
dr_mode ("host" as set in the later block) so there are no conflicting or stale
settings—remove the earlier dr_mode="peripheral" and the redundant second
&usb_host0_xhci block so a single &usb_host0_xhci contains dr_mode="host",
maximum-speed, phys, phy-names and status.
🧹 Nitpick comments (2)
config/boards/mekotronics-r58x-4g.csc (1)

57-69: Inconsistent function name prefix: ekor58x_4g vs mekor58x_4g used elsewhere.

Other hook functions in this file use the mekor58x_4g prefix (e.g., pre_config_uboot_target__mekor58x_4g_patch_rockchip_common_boot_order), but this one uses ekor58x_4g. While functionally harmless (Armbian hooks just need unique names), it makes grepping/discovering board-related hooks harder.

♻️ Suggested rename for consistency
-function pre_config_uboot_target__ekor58x_4g_patch_uboot_dtsi_for_ums() {
+function pre_config_uboot_target__mekor58x_4g_patch_uboot_dtsi_for_ums() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/boards/mekotronics-r58x-4g.csc` around lines 57 - 69, The function
name pre_config_uboot_target__ekor58x_4g_patch_uboot_dtsi_for_ums uses the wrong
board prefix; rename it to
pre_config_uboot_target__mekor58x_4g_patch_uboot_dtsi_for_ums to match other
hooks (e.g.,
pre_config_uboot_target__mekor58x_4g_patch_rockchip_common_boot_order), and
update any internal references or registrations to use the new name so all
mekotronics-r58x-4g hooks share the same prefix for discoverability.
patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts (1)

389-390: Endpoint labels say es8316 but the codec is an ES8388.

The label es8316_p0_0 (line 389) and its remote-endpoint reference &es8316_p0_0 (line 433) refer to a different Everest codec model (ES8316). While functionally harmless (labels are just internal references), this is confusing for anyone reading or maintaining the DTS.

♻️ Rename labels to match the actual codec
 		port {
-			es8316_p0_0: endpoint {
+			es8388_p0_0: endpoint {
 				remote-endpoint = <&i2s0_8ch_p0_0>;
 			};
 		i2s0_8ch_p0_0: endpoint {
 			dai-format = "i2s";
 			mclk-fs = <256>;
-			remote-endpoint = <&es8316_p0_0>;
+			remote-endpoint = <&es8388_p0_0>;
 		};

Also applies to: 430-433

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts`
around lines 389 - 390, Rename the misleading ES8316 labels to ES8388 to match
the actual codec: change the endpoint label es8316_p0_0 to es8388_p0_0 and
update any remote-endpoint references (e.g., &es8316_p0_0) to &es8388_p0_0;
ensure both the endpoint declaration (es8316_p0_0: endpoint { ... }) and its
consumers (remote-endpoint = <&es8316_p0_0> and any other occurrences around the
same block) are updated so the label names are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts`:
- Around line 379-381: The device tree node es8388: audio-codec@11 has a
mismatched unit address and reg value (node name uses `@11` while reg = <0x10>);
update the node's unit address to match the reg value (change audio-codec@11 to
audio-codec@10) or adjust the reg to <0x11> so the unit address and the first
reg entry match, ensuring consistency for the node es8388: audio-codec and its
reg property.

---

Outside diff comments:
In `@patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts`:
- Around line 1008-1014: Two duplicate &usb_host0_xhci override blocks exist;
consolidate them into one coherent override by merging properties from both
blocks (maximum-speed, phys, phy-names, status) and keeping the intended final
dr_mode ("host" as set in the later block) so there are no conflicting or stale
settings—remove the earlier dr_mode="peripheral" and the redundant second
&usb_host0_xhci block so a single &usb_host0_xhci contains dr_mode="host",
maximum-speed, phys, phy-names and status.

---

Nitpick comments:
In `@config/boards/mekotronics-r58x-4g.csc`:
- Around line 57-69: The function name
pre_config_uboot_target__ekor58x_4g_patch_uboot_dtsi_for_ums uses the wrong
board prefix; rename it to
pre_config_uboot_target__mekor58x_4g_patch_uboot_dtsi_for_ums to match other
hooks (e.g.,
pre_config_uboot_target__mekor58x_4g_patch_rockchip_common_boot_order), and
update any internal references or registrations to use the new name so all
mekotronics-r58x-4g hooks share the same prefix for discoverability.

In `@patch/kernel/archive/rockchip64-6.19/dt/rk3588-blueberry-edge-v12-linux.dts`:
- Around line 389-390: Rename the misleading ES8316 labels to ES8388 to match
the actual codec: change the endpoint label es8316_p0_0 to es8388_p0_0 and
update any remote-endpoint references (e.g., &es8316_p0_0) to &es8388_p0_0;
ensure both the endpoint declaration (es8316_p0_0: endpoint { ... }) and its
consumers (remote-endpoint = <&es8316_p0_0> and any other occurrences around the
same block) are updated so the label names are consistent.

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Feb 18, 2026
@github-actions
Copy link
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions bot removed the Needs review Seeking for review label Feb 18, 2026
- drop invalid and useless enable-gpios on hdmi0 node
  - was from vendor kernel
  - does nothing in mainline
  - is not required in mainline for working HDMI
…_PA7)

- probably type-c stuff, but we never know with Meko
- this gets the 3 usb type-A ports in the front working
- also: drop old modem (4G) to-do, as modem already works without it
- fileenv patch (same as v2026.01)
- fdt_fixup_ethernet logging patch (same as v2026.01)
- 0000.patching_config.yaml: defconfig/dt_upstream_rockchip/dt_uboot
- notable in v2026.04:
  - dt-rebasing bumped up to v6.18 (which has NPU nodes)
    - this allows us to share complete DTs between kernel and u-boot via symlinks
  - Kwiboo had a go at LWIP which should be usable now; Kwiboo rocks.
- u-boot v2026.04-rcX has bumped dt-rebasing to v6.18, thus it knows about
  NPU nodes now and we can simply symlink to kernel DT, reducing duplication by a lot
- works as far as I can tell
- both orientations
- also wired DP, but can't test (I've no USB-DP hw)
- saves one .dtsi file in patch/.../dt_uboot
- I had the wrong name (missing `-u-boot` suffix) too so this fixes it too
- This reverts commit e94425f.
- I am clearly not up to par with type-c/fusb302 stuff yet
  - sending this for future reference
@rpardini rpardini force-pushed the pr/mekotronics-r58x-4g-usb-fixes--u-boot-v202604-rc2--analog-audio branch from c0db53c to f40fb9d Compare February 19, 2026 11:59
@github-actions github-actions bot added Needs review Seeking for review and removed Ready to merge Reviewed, tested and ready for merge labels Feb 19, 2026
@rpardini rpardini merged commit ef15fe1 into armbian:main Feb 19, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

2 participants

Comments