Skip to content

Add board: Luckfox Nova (RK3308B)#9985

Merged
igorpecovnik merged 9 commits into
armbian:mainfrom
crackerjacques:board-luckfox-rk3308b-nova
Jun 19, 2026
Merged

Add board: Luckfox Nova (RK3308B)#9985
igorpecovnik merged 9 commits into
armbian:mainfrom
crackerjacques:board-luckfox-rk3308b-nova

Conversation

@crackerjacques

@crackerjacques crackerjacques commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Luckfox Nova (RK3308B)

Adds support for the Luckfox Nova: Rockchip RK3308B (quad Cortex-A35), 512 MB DDR3, 8 GB eMMC, 100M Ethernet (RTL8201F), USB-C OTG + USB-A host, microSD, no video out. Debug console is UART4 (ttyS4) @ 1500000n8.

The board boots on mainline-style native U-Boot v2025.04 (binman + rkbin rk3308 DDR/BL31/miniloader) from eMMC — no vendor U-Boot and no Android boot image. SPL → U-Boot 2025.04 → standard boot.scrbooti → Armbian. Verified end to end on hardware.

KERNEL_TARGET="current,edge" (current = 6.18, edge = 7.0).

What's in the PR (all verified on hardware)

  1. Add board (csc, ttyS4 bootscript, DTS, U-Boot v2025.04 board patches)
  2. On-board mic via the RK3308 internal codec
  3. PDM digital-mic interface on the P1 header (disabled by default)
  4. AIC8800DC SDIO WiFi (Nova W; harmless on a plain Nova without the module)
  5. Board helper tools via the bsp-cli package (novaconfig / mictest / pdmtest / gpiocheck / pwmtest / asound.conf)
  6. eMMC HS200 (52 → 147 MHz; the microSD slot is untouched and stays 1-bit)
  7. I2S (TX/master) raw exposure on the P1 header (disabled by default)
  8. I2S RX capture interface — optional; happy to drop this last commit if reviewers prefer, since it adds a dmic-codec capture card

PDM, I2S TX and I2S RX share the GPIO2 audio pins and are mutually exclusive; novaconfig enforces this. The mainline kernel has no runtime DT-overlay interface, so these are toggled via boot-time overlays that novaconfig generates and compiles on the device.

Verification highlights

  • eMMC HS200: mmc0: new HS200 MMC card, bus clock 52 → 147 MHz.
  • PDM: card: pdmmics [pdm-mics], captured from a PDM mic.
  • I2S: controller binds (rockchip-i2s-tdm), clocks come up, pins are muxed to the i2s_8ch_0 function; the RX path captures an external I2S master (RP2040/Pico, 1 kHz sine, 48 kHz/16-bit) via arecord -D hw:i2srxtest.

Flashing

The image is written to the on-board eMMC over USB (Rockchip rockusb/maskrom), not dd'd to an SD card. Enter download mode (hold BOOT while plugging in USB-C, or sudo reboot loader from a running system), then:

sudo ./upgrade_tool wl 0 Armbian-..._Luckfox-rk3308b-nova_..._minimal.img
sudo ./upgrade_tool rd

Windows users can use RKDevTool. Luckfox wiki: https://wiki.luckfox.com/Luckfox-Nova/Flash-image/

Notes

  • The SDK split-image build extension and host-local build tweaks are intentionally excluded from this PR.
  • Companion website PR (board image) for armbian/armbian.github.io is submitted separately.

Summary by CodeRabbit

  • New Features

    • Added support for the Luckfox RK3308B “Nova” board, including updated boot flow, kernel settings, and device tree support.
    • Introduced board-specific boot scripting with overlay enablement and safer overlay handling.
    • Added utilities for GPIO inspection, PWM control, and microphone/audio capture (including interactive overlay/interface configuration).
  • Bug Fixes

    • Fixed MMC bus width handling and timing/initialization behavior on the RK3308 family.
    • Corrected RK3308 download/recovery key detection related to SARADC naming.
    • Enabled the DMIC audio module as a loadable kernel component.

crackerjacques added 4 commits June 16, 2026 14:49
Compact RK3308B board: 512MB DDR3, 8GB eMMC, 100M Ethernet (RTL8201F),
USB-C OTG peripheral, USB-A host, microSD. Debug console is UART4 at
1500000 baud. Fully mainline: U-Boot 2025.04 (binman, rkbin DDR/BL31)
and mainline kernel for both current (6.18) and edge (7.0).

Board quirks handled:
- the microSD slot only has DAT0 usable - 4-bit transfers fail with a
  Start Bit Error in U-Boot and I/O errors in Linux (verified with two
  cards), so both the U-Boot and kernel DTS pin the slot to bus-width=1
  (SD High Speed at 50MHz works fine). The U-Boot side also needs
  dwmci_setup_cfg() to honor a 1-bit DT bus-width plus two dw_mmc fixes
  backported from upstream (dwmci_control_clken CDONE ack, setup_bus
  same-frequency skip).
- the evb_rk3308 download-key handler hardcodes the pre-DM "saradc"
  device name; fixed to the actual device name so the recovery key
  works, and the key now enters RockUSB directly (usable with
  rkdeveloptool/upgrade_tool without entering maskrom).
- ethernet PHY is strapped at MDIO address 0; the gmac node lets stmmac
  scan the bus instead of assuming an address.

Tested on hardware: boots from eMMC and SD (SD preferred when
inserted), ethernet, USB host/OTG, PWM, SARADC, recovery key.
The mainline kernels (current 6.18, edge 7.0) had no audio enabled.
Add a simple-audio-card binding i2s_8ch_2 to the RK3308 internal codec
and enable both nodes, following the Rock S0 pattern. This brings up
the on-board analog mic (and the lineout) on card 0.

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
rk3308.dtsi carries the PDM pin groups but no controller node, so the
PDM interface on the P1 header is unusable. Define pdm@ff380000 (values
from the Rockchip BSP) on the M2 pin mux plus a dmic-codec simple-card.
Disabled by default - the pins are shared with i2s_8ch_0 and GPIO.
Enable CONFIG_SND_SOC_DMIC (current + edge) for the dmic-codec.

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
Enable the dedicated SDIO controller (mmc@ff4a0000) for the on-board
AIC8800DC WiFi module with an mmc-pwrseq-simple driving WL_REG_ON
(GPIO0_A2). Harmless on a plain Nova (empty SDIO scan). The AIC8800DC
fullmac driver is out-of-tree; build it via DKMS on the running system
(LYU4662/aic8800-sdio-linux + the 6.16+ API compat fixups).

current(6.18) and edge(7.0).

Signed-off-by: crackerjacques <jack@supremeoverlordjabs.co>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2fd541d-90a8-42a4-8195-d96053f46069

📥 Commits

Reviewing files that changed from the base of the PR and between d313b09 and 2110a9f.

📒 Files selected for processing (2)
  • patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts
  • patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts
🚧 Files skipped from review as they are similar to previous changes (2)
  • patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts
  • patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts

📝 Walkthrough

Walkthrough

Adds full Armbian board support for the Luckfox Nova (RK3308B/rockchip64): Armbian board config, UART4 U-Boot boot script, U-Boot DTS/defconfig and four dw_mmc/download-key driver patches, kernel device trees for rockchip64-6.18 and 7.1, DMIC kernel module enablement, and a BSP CLI package with ALSA configs plus GPIO/PWM/audio/overlay management scripts.

Changes

Luckfox Nova RK3308B board support

Layer / File(s) Summary
Armbian board config and UART4 boot script
config/boards/luckfox-rk3308b-nova.csc, config/bootscripts/boot-rockchip64-ttyS4.cmd
Board constants (name, SoC family, console ttyS4, kernel target, boot paths, BSP packages) and shell hooks for BOOTSCRIPT assignment and extraargs=cma=16M injection. Full U-Boot boot script with armbianEnv.txt import, bootargs construction, kernel/initrd/DT load, DT overlay application with failure recovery, fixup-script sourcing, and booti.
U-Boot board DTS, DTSI, and defconfig
patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/add-board-luckfox-rk3308b-nova.patch
U-Boot DTSI for SPL boot order and UART4 pre-relocation DM; Linux board DTS with regulators, eMMC (8-bit HS200), IO-domain supplies, SD 1-bit, USB/UART4 enablement; defconfig for FIT/SPL sizing and MMC/USB/ADC/SARADC/networking feature flags.
U-Boot dw_mmc driver fixes
patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-*.patch
Three patches: dwmci_control_clken() polls DWMCI_RINTSTS/CDONE instead of DWMCI_CMD_START; dwmci_setup_cfg() honors 1-bit bus-width from DT; dwmci_setup_bus() no longer skips register setup when requested frequency equals current clock.
U-Boot download-key and SARADC fixes
patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/fix-evb-rk3308-dnl-key-saradc-name.patch, .../boot-mode-enter-rockusb-on-download-key.patch
SARADC lookup name changed from "saradc" to "saradc@ff1e0000" for correct DM device resolution; download-key handler invokes rockusb 0 mmc 0 directly before falling back to BOOTROM download-mode reset.
Kernel device trees for rockchip64-6.18 and 7.1
patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts
Complete board DTS for both archive trees: regulators, codec audio card, disabled PDM/I2S-RX nodes, WiFi SDIO power sequencing, eMMC/GMAC/IO-domain overrides, LED/SD/USB/WiFi pinctrl, PWM0–PWM11 and SARADC enablement, SDIO (4-bit AIC8800DC), SDMMC (1-bit broken-CD), UART4 console, USB PHY/OTG/EHCI/OHCI, and watchdog.
Kernel config: DMIC audio module
config/kernel/linux-rockchip64-current.config, config/kernel/linux-rockchip64-edge.config
Adds CONFIG_SND_SOC_DMIC=m to both current and edge kernel configs.
BSP audio: ALSA config and test utilities
config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/etc/asound.conf, .../usr/sbin/mictest, .../usr/sbin/pdmtest
ALSA PCM routing for pcm.mic/pcm.mics (hw:0,0, 8-ch S32_LE). mictest enables ALSA mixer and records 1 or 8-channel WAV. pdmtest detects pdm-mics card and records S32_LE 48 kHz WAV with configurable duration and channel count.
BSP GPIO and PWM inspection tools
config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck, .../usr/sbin/pwmtest
gpiocheck decodes RK3308B GRF mux/pull registers via devmem or /dev/mem, parses GPIO pin names, and supports sysfs GPIO drive actions with kernel-owner display. pwmtest lists sysfs PWM channels with timing attributes, configures frequency/duty in nanoseconds, and blocks unsafe modifications to pwm0.
BSP overlay manager: novaconfig
config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig
Interactive POSIX shell utility that detects Armbian vs extlinux boot mode, generates and compiles per-interface DTS overlays via dtc, enforces pin-group conflict checks, reads/writes overlay lists in armbianEnv.txt or extlinux.conf, and provides a terminal menu for sysinfo, GPIO/PWM tool invocation, and interface toggle.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(70, 130, 180, 0.5)
    note over UBoot,BOOTROM: U-Boot recovery key detection
    participant UBoot as U-Boot
    participant SARADC as saradc@ff1e0000
    participant RockUSB as rockusb gadget
    participant BOOTROM as BOOTROM
  end
  UBoot->>SARADC: adc_channel_single_shot("saradc@ff1e0000")
  SARADC-->>UBoot: ADC key value
  alt download key pressed
    UBoot->>RockUSB: rockusb 0 mmc 0
    RockUSB-->>RockUSB: serve USB flashing commands
    RockUSB-->>UBoot: command returns
    UBoot->>BOOTROM: set_back_to_bootrom_dnl_flag + do_reset()
  else normal boot
    UBoot->>UBoot: continue to boot script
  end
Loading
sequenceDiagram
  rect rgba(60, 179, 113, 0.5)
    note over User,BootConfig: novaconfig overlay management
    participant User
    participant novaconfig
    participant dtc as dtc compiler
    participant BootConfig as armbianEnv.txt / extlinux.conf
    participant DTB as live device tree
  end
  User->>novaconfig: run (root required)
  novaconfig->>BootConfig: detect Armbian vs extlinux mode
  novaconfig->>User: show interface menu with enabled state
  User->>novaconfig: toggle interface (e.g. pdm)
  novaconfig->>novaconfig: check pin-group conflicts
  novaconfig->>dtc: compile nova-pdm.dts → nova-pdm.dtbo
  dtc-->>novaconfig: dtbo written to overlays dir
  novaconfig->>BootConfig: write_list updates user_overlays / fdtoverlays
  novaconfig->>DTB: live_status reads /proc/device-tree
  DTB-->>novaconfig: current node status
  novaconfig->>User: show updated menu
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Suggested labels

BSP

Suggested reviewers

  • JohnTheCoolingFan
  • rpardini
  • igorpecovnik
  • krachlatte
  • Tonymac32
  • pyavitz
  • amazingfate
  • SuperKali
  • HeyMeco

Poem

🐇 A Nova is born in the rockchip sky,
With UART4 console and overlays that fly,
The mics record, the PWMs hum,
GPIOs checked with a tap of a drum,
U-Boot boots true, the eMMC aligned—
Luckfox Nova leaps forth, perfectly timed! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Add board: Luckfox Nova (RK3308B)' accurately and concisely summarizes the primary change: introducing support for a new embedded board.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 the size/large PR with 250 lines or more label Jun 16, 2026
@github-actions github-actions Bot added 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jun 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for luckfox-rk3308b-nova
    • Expected: board-images/luckfox-rk3308b-nova.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck`:
- Around line 148-152: The gpiocheck function currently accepts any non-empty
value for the third parameter and does not handle failures from the sysfs
writes. Add validation to ensure the third parameter is restricted to only "0"
or "1" values, and modify the echo commands that write to the direction and
value files to fail fatally on error using the die function (similar to the
pattern used elsewhere in the script) so that the success message on the final
line is only printed when all sysfs operations have actually succeeded.

In
`@config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest`:
- Around line 30-37: Both mictest and pdmtest scripts use predictable hardcoded
/tmp paths (mictest8.wav, mictest.wav, and pdmtest.wav) that are vulnerable to
symlink-based file clobber attacks. In
config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest
at lines 30-37, replace the fixed OUT=/tmp/mictest8.wav and OUT=/tmp/mictest.wav
assignments with secure temporary file creation using mktemp before invoking
arecord. Similarly, in
config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pdmtest
at lines 22-25, replace the fixed OUT=/tmp/pdmtest.wav with a securely created
unique temp file using mktemp before invoking arecord. Ensure both fixes follow
the same secure pattern for consistency.

In
`@config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig`:
- Around line 141-150: The enabled_list function correctly filters to show only
nova-* overlays, but the code that rewrites the overlay configuration (at lines
161-169) is dropping non-Nova entries from the boot config. When rewriting
overlays after any toggle operation, the code must preserve existing non-Nova
overlays that were already present in the boot configuration. Modify the code
that reconstructs the overlay line to extract and preserve any non-Nova overlays
from the original configuration (both for armbian mode using user_overlays and
extlinux mode using fdtoverlays), then combine those with the modified Nova
overlays when writing back the complete overlay line to the configuration file.
- Around line 64-67: Replace the predictable temporary file path assignment for
the tmp variable with a secure alternative using mktemp. Instead of hardcoding
/tmp/nova-$1.dts, use mktemp with an appropriate template (such as mktemp
/tmp/nova-XXXXXX.dts or similar) to generate a random temporary filename. This
eliminates the symlink clobber attack vulnerability by ensuring the temporary
file path cannot be predicted by an attacker, even when the script runs as root.

In
`@config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pwmtest`:
- Around line 54-56: The kernel-use detection logic at line 54 uses a glob
pattern `"$c"/../*/pwm-*` that checks sibling directories rather than limiting
the scope to the current pwmchip represented by variable `c`. Replace this path
pattern with one that only checks for pwm devices within the current pwmchip
directory (change `"$c"/../*/pwm-*` to `"$c"/pwm-*`) so that the "in use
(kernel)" state is correctly set only when channels under the current pwmchip
are in use, not when any sibling pwmchip has in-use channels.
- Around line 81-96: Add a guard after computing period at line 81 to check if
period equals zero and die with an appropriate error message (e.g., "frequency
too high, period would be 0"). Then add error checking to the PWM configuration
writes at lines 93-95 by changing the redirects from "2>/dev/null" to "|| die"
to fail fast if any write fails. This ensures the success message printed at
line 96 only executes when all configurations have been successfully applied.

In
`@patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch`:
- Around line 45-54: The `dwmci_control_clken()` function returns success (0) on
Line 54 regardless of whether the CDONE bit was actually observed before the
timeout expired. Add proper timeout failure handling after the for loop: if the
loop exhausts all `timeout` iterations without finding the DWMCI_INTMSK_CDONE
bit set (i.e., the break statement was never executed), the function should
return an error code instead of 0. Only return 0 if the CDONE bit was
successfully detected and the loop exited via break.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42a48b07-3265-4a30-ac40-bd9f264a5f9b

📥 Commits

Reviewing files that changed from the base of the PR and between de8c77b and 408aedb.

📒 Files selected for processing (18)
  • config/boards/luckfox-rk3308b-nova.csc
  • config/bootscripts/boot-rockchip64-ttyS4.cmd
  • config/kernel/linux-rockchip64-current.config
  • config/kernel/linux-rockchip64-edge.config
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/etc/asound.conf
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pdmtest
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pwmtest
  • patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts
  • patch/kernel/archive/rockchip64-7.0/dt/rk3308-luckfox-nova.dts
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/add-board-luckfox-rk3308b-nova.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/boot-mode-enter-rockusb-on-download-key.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/fix-evb-rk3308-dnl-key-saradc-name.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-honor-1bit-bus-width.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-no-skip-setup-bus-same-freq.patch

Comment thread config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck Outdated
Comment thread config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest Outdated
Comment thread config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig Outdated
Comment thread config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pwmtest Outdated
@crackerjacques

Copy link
Copy Markdown
Contributor Author

The Verify assets for newly added boards check is red only because the board image lives in the companion website PR armbian/armbian.github.io#332, which is still open. That PR adds board-images/luckfox-rk3308b-nova.png (the luckfox-logo.png vendor logo already exists, so no vendor-logo change is needed).

Once #332 is merged, the asset check can be re-run and should go green. Same pattern as the recent Anbernic RG DS board (armbian.github.io#326). Thanks!

@crackerjacques crackerjacques force-pushed the board-luckfox-rk3308b-nova branch from 408aedb to d6327f7 Compare June 16, 2026 12:10
@EvilOlaf

Copy link
Copy Markdown
Member

edge was moved to 7.1, the 7.0 patchset is no longer used and will be remove at some point in the future

@igorpecovnik

Copy link
Copy Markdown
Member

which is still open

Some corrections are needed. I updated automation to tell which.

crackerjacques added 4 commits June 17, 2026 12:13
The Nova is headless and has a few board-specific bits that need poking
from userspace: enabling the PDM mic / PWM / SPI / I2C (mainline has no
runtime DT-overlay interface, so these are toggled via boot-time overlays),
capturing the on-board codec mic and the PDM mics, and inspecting GPIO/PWM
while bringing the board up. Ship the helpers in the board bsp-cli package
so they land in the image:

  - novaconfig: enable/disable interfaces by generating + compiling a DT
    overlay on the device and wiring it into armbianEnv.txt user_overlays
  - mictest: record from the RK3308 internal-codec on-board mic
  - pdmtest: record from the PDM digital mics on the P1 header
  - gpiocheck / pwmtest: GPIO and PWM inspectors
  - /etc/asound.conf: 'mic'/'mics' pcms for the channel-8 on-board mic

novaconfig compiles overlays on-device and mictest/pdmtest use arecord, so
pull in device-tree-compiler + alsa-utils via PACKAGE_LIST_BOARD.
The eMMC node only declared cap-mmc-highspeed, so mode negotiation capped
at eMMC High Speed (~52 MHz) even though max-frequency is 150 MHz - about
a third of the eMMC's real throughput. The vendor DTS and our U-Boot
already run it at HS200; only the kernel DT was missing the cap.

Add mmc-hs200-1_8v to &emmc (current 6.18 and edge 7.0). The eMMC VCCQ is
a fixed 1.8 V rail on this board and the dw_mmc controller has the tuning
clocks, so HS200 negotiates; on tuning failure the kernel falls back to
High Speed, so this is low risk. Verified on hardware: "mmc0: new HS200
MMC card", phase tuned, bus clock 52 -> 147 MHz.

The microSD slot (&sdmmc) is untouched and stays bus-width=1 (DAT1-3 are
not usable on this board); this only affects the 8-bit eMMC.
The P1 header brings out i2s_8ch_0 (the RK3308 I2S/TDM controller at
0xff300000), but rk3308.dtsi only defines its pin groups, not the
controller node, so mainline has no way to drive it. Add the controller
node (clocks/dmas/resets from the vendor BSP, modelled on the in-tree
i2s_8ch_2 binding), disabled by default since its pins are shared with the
PDM interface (mutually exclusive). novaconfig grows an i2s_tx toggle that
enables it for raw master/TX use (SCLK=GPIO2_A5 LRCK=GPIO2_A7 SDO=GPIO2_B1
SDI=GPIO2_B5).

Verified on hardware: with the overlay applied the controller binds
(rockchip-i2s-tdm), its clocks come up, and the pins are muxed to the
i2s_8ch_0 function (sclktx/lrcktx/sdo0/sdi0).
Building on the raw i2s_8ch_0 controller, add a capture path so an
external I2S master can be recorded on the Nova. A simple-audio-card
("i2s-rx-test") binds i2s_8ch_0 to a dmic-codec; both nodes are disabled
by default. novaconfig grows an i2s_rx toggle whose overlay enables the
card, switches i2s_8ch_0 to its RX clock pins (sclkrx=GPIO2_A6,
lrckrx=GPIO2_B0, sdi0=GPIO2_B5) and frees those pins from the two header
PWMs (pwm@ff160030/ff170030) that otherwise squat on them. Mutually
exclusive with pdm and i2s_tx (shared GPIO2 audio pins). The overlay uses
labelled phandles, so emit_overlay now compiles with dtc -@.

Because that overlay references base-DTB labels, novaconfig refuses to
enable i2s_rx when the running DTB has no /__symbols__ node (a kernel not
built with dtc -@), where the bootloader could not apply the overlay and
the boot would fail. The other overlays use target-path and are unaffected.

Verified on hardware: a Raspberry Pi Pico driving I2S (1 kHz sine, 48 kHz,
16-bit stereo) into GPIO2_A6/B0/B5 is captured via arecord -D hw:i2srxtest.

@EvilOlaf EvilOlaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@crackerjacques

Copy link
Copy Markdown
Contributor Author

okay, I will fix those.
I'm going out for a bit tomorrow, so if the day after tomorrow works for you, that'd be fine.
Just the parts I've finished so far

@crackerjacques crackerjacques force-pushed the board-luckfox-rk3308b-nova branch from ddbc5f3 to d313b09 Compare June 17, 2026 13:02
@EvilOlaf

Copy link
Copy Markdown
Member

take your time, no need to hurry anything

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch (1)

45-54: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Restore timeout failure handling in dwmci_control_clken().

The function now returns success even when the CDONE interrupt bit is never observed. If the loop exhausts all timeout iterations without the CDONE bit being set, Line 54 still returns 0, masking a failed clock-update command. This can cause MMC instability and data corruption.

🐛 Proposed fix
 	for (i = 0; i < timeout; i++) {
 		mask = dwmci_readl(host, DWMCI_RINTSTS);
 		if (mask & DWMCI_INTMSK_CDONE) {
 			dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_CDONE);
 			break;
 		}
 	}
+	if (i == timeout) {
+		debug("%s: Timeout!\n", __func__);
+		return -ETIMEDOUT;
+	}
 
 	return 0;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch`
around lines 45 - 54, The dwmci_control_clken() function currently returns 0
(success) unconditionally after the timeout loop completes, even if the CDONE
interrupt bit was never detected. To fix this, add a check after the loop to
determine if the CDONE bit was found during the loop iterations. If the loop
completed without detecting the DWMCI_INTMSK_CDONE bit in the mask variable
(meaning timeout was exhausted), return a non-zero error code to indicate
failure. Only return 0 if the CDONE bit was actually detected and the loop was
exited via the break statement.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts`:
- Around line 124-136: The vbus_host regulator block is using the deprecated
`gpio` property instead of the modern `gpios` property. In the
regulator-5v0-vbus-host node, replace the singular `gpio` property with `gpios`
to align with current kernel device tree conventions and maintain consistency
with other regulators like vcc_sd in the same file.
- Around line 207-208: In the i2s_8ch_0 device tree node, swap the dmas
assignment and the dma-names assignment to match the RK3308 standard binding.
Change the dmas property from <&dmac1 1>, <&dmac1 0> to <&dmac1 0>, <&dmac1 1>,
and change the dma-names property from "rx", "tx" to "tx", "rx". Both properties
must be updated together to maintain correct DMA channel mapping for the I2S
controller.

---

Duplicate comments:
In
`@patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch`:
- Around line 45-54: The dwmci_control_clken() function currently returns 0
(success) unconditionally after the timeout loop completes, even if the CDONE
interrupt bit was never detected. To fix this, add a check after the loop to
determine if the CDONE bit was found during the loop iterations. If the loop
completed without detecting the DWMCI_INTMSK_CDONE bit in the mask variable
(meaning timeout was exhausted), return a non-zero error code to indicate
failure. Only return 0 if the CDONE bit was actually detected and the loop was
exited via the break statement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43cc9d26-cf1d-4044-bbd3-0f7db3e53770

📥 Commits

Reviewing files that changed from the base of the PR and between d6327f7 and d313b09.

📒 Files selected for processing (18)
  • config/boards/luckfox-rk3308b-nova.csc
  • config/bootscripts/boot-rockchip64-ttyS4.cmd
  • config/kernel/linux-rockchip64-current.config
  • config/kernel/linux-rockchip64-edge.config
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/etc/asound.conf
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pdmtest
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pwmtest
  • patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts
  • patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/add-board-luckfox-rk3308b-nova.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/boot-mode-enter-rockusb-on-download-key.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/fix-evb-rk3308-dnl-key-saradc-name.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-fix-clken-cmd-completion.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-honor-1bit-bus-width.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-no-skip-setup-bus-same-freq.patch
✅ Files skipped from review due to trivial changes (1)
  • config/kernel/linux-rockchip64-edge.config
🚧 Files skipped from review as they are similar to previous changes (12)
  • config/kernel/linux-rockchip64-current.config
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/pdmtest
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/mictest
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/mmc-dw-mmc-no-skip-setup-bus-same-freq.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/fix-evb-rk3308-dnl-key-saradc-name.patch
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/etc/asound.conf
  • config/boards/luckfox-rk3308b-nova.csc
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/add-board-luckfox-rk3308b-nova.patch
  • patch/u-boot/v2025.04/board_luckfox-rk3308b-nova/boot-mode-enter-rockusb-on-download-key.patch
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/novaconfig
  • config/optional/boards/luckfox-rk3308b-nova/_packages/bsp-cli/usr/sbin/gpiocheck
  • patch/kernel/archive/rockchip64-6.18/dt/rk3308-luckfox-nova.dts

Comment thread patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts
Comment thread patch/kernel/archive/rockchip64-7.1/dt/rk3308-luckfox-nova.dts Outdated
@crackerjacques

Copy link
Copy Markdown
Contributor Author

Thanks! edge is now on rockchip64-7.1 (current = 6.18); the 7.0 patchset isn't used. Also pushed a small DT tidy (gpios for the vbus regulator, standard i2s_8ch_0 DMA order). Re-requesting review when you have a moment — no rush.

@crackerjacques crackerjacques requested a review from EvilOlaf June 19, 2026 10:19
@EvilOlaf EvilOlaf dismissed their stale review June 19, 2026 11:34

Resolved

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
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 Jun 19, 2026
@rpardini

Copy link
Copy Markdown
Member

Nice. I wonder why u-boot v2025.04 and not v2026.07?

@igorpecovnik igorpecovnik merged commit 0efefe1 into armbian:main Jun 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

4 participants