Skip to content

rda5995-openipc: build the firmware into the module - #2653

Merged
dimerr merged 1 commit into
masterfrom
rda5995-firmware
Oct 21, 2026
Merged

dimerr merged 1 commit into
masterfrom
rda5995-firmware

Conversation

@dimerr

@dimerr dimerr commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

rdawfmac from #2640 has no firmware. The pinned OpenIPC/rda-wlan commit built it with the vendor's default WLAND_FIRMWARE_PATH "/var/Run/wifi/rdaw", so at load time the driver reads rda5995_usb_*.bin and power_config.txt from a directory no OpenIPC image has, and the *.bin.hex arrays in the source are never compiled. #2640's description said the firmware was compiled in; it wasn't.

OpenIPC/rda-wlan@06fd4b6 defines WLAND_DOWNLOAD_FIRMWARE_FROM_HEX instead, so the station/p2p and AP images and power_config.txt are built into the module and nothing is read from the filesystem. It leaves out the RF images, which serve only the factory RF test mode (/data/misc/wifi/rda5995_testmode or firmware_path=rf). This PR moves the pin to that commit.

Hardware tested on

No camera with an RDA5995. Built locally and loaded in the qemu-hisilicon emulator, which has no RDA chip, so firmware download itself is untested.

Evidence

Module, before and after the bump:

before: rdawfmac.ko  339572 bytes, no firmware arrays
after:  rdawfmac.ko  663632 bytes; nm: code_p2p_hex_buf code1_p2p_hex_buf data_p2p_hex_buf code_ap_hex_buf data_ap_hex_buf

Image sizes after the bump, built locally:

ak3918ev300_lite:  - uImage: [1598KB/2048KB] - rootfs.squashfs: [3620KB/5120KB]   (master: 3304KB)
ak3918av130_lite:  - uImage: [1645KB/2048KB] - rootfs.squashfs: [4608KB/5120KB]

Emulator (no chip on the bus): the module resolves and runs its init, then unloads as before:

# modprobe rdawfmac; echo rc=$?
modprobe: can't load module rdawfmac (extra/rdawfmac.ko): No such device
rc=1

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

The pinned rda-wlan built rdawfmac with the vendor's default, which reads
the firmware and power_config.txt from /var/Run/wifi/rdaw at load time;
no image has that directory, so an RDA5995 got no firmware. rda-wlan
06fd4b6 compiles them in from the driver's *.bin.hex arrays, leaving out
the RF images only the factory test mode uses.
@dimerr
dimerr marked this pull request as draft October 21, 2026 11:12
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Embed RDA5995 firmware through an upstream revision bump

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Pin rda-wlan to a revision that builds firmware and power configuration into rdawfmac.
• Remove the driver's dependency on a firmware directory absent from OpenIPC images.
• Build and emulator-load checks passed; firmware download on RDA5995 hardware remains untested.
Diagram

graph TD
  Pin["Buildroot version pin"] --> Source["rda-wlan source"] --> Arrays["Bundled firmware"] --> Module["rdawfmac module"]
Loading
High-Level Assessment

Pinning the upstream revision that embeds firmware is the most direct fix. Packaging firmware as separate files would retain a runtime filesystem dependency and require additional image integration; the diff needs no local driver changes.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
rda5995-openipc.mkPin rda-wlan revision with embedded firmware +1/-1

Pin rda-wlan revision with embedded firmware

• Changes the full upstream commit pin from 593c3184ae3f84c563b1704f6ad24879f122634b to 06fd4b61252788bc46a66c88fd2773493ab5dd2a. The new revision builds station/P2P and AP firmware and power configuration into rdawfmac instead of requiring files at the vendor-default runtime path.

general/package/rda5995-openipc/rda5995-openipc.mk

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Camera firmware change lacks testing 📘 Rule violation ≡ Correctness
Description
The package version change selects firmware-embedding driver sources without testing firmware
download on a real camera. The PR states that no camera with the affected chip was available and
that the emulator has no RDA device, so the changed camera behavior remains unverified.
Code

general/package/rda5995-openipc/rda5995-openipc.mk[7]

+RDA5995_OPENIPC_VERSION = 06fd4b61252788bc46a66c88fd2773493ab5dd2a
Evidence
The changed package version selects the firmware-embedding upstream commit, which can change camera
firmware behavior. The PR description explicitly states that no camera with an RDA5995 was tested
and that firmware download itself is untested, failing the hardware-evidence gate.

Rule 3: Hardware evidence is present and honest
general/package/rda5995-openipc/rda5995-openipc.mk[7-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The package now selects a commit that changes the firmware-loading behavior, but the PR provides no real-camera evidence and explicitly says firmware download is untested.
## Fix Focus Areas
- general/package/rda5995-openipc/rda5995-openipc.mk[7-7]
## Recommended Fix
Test the updated module on a camera containing an RDA5995, capture firmware-download and driver initialization output, and add the affected board, symptom, and before/after evidence to the PR description.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

################################################################################

RDA5995_OPENIPC_VERSION = 593c3184ae3f84c563b1704f6ad24879f122634b
RDA5995_OPENIPC_VERSION = 06fd4b61252788bc46a66c88fd2773493ab5dd2a

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Camera firmware change lacks testing 📘 Rule violation ≡ Correctness

The package version change selects firmware-embedding driver sources without testing firmware
download on a real camera. The PR states that no camera with the affected chip was available and
that the emulator has no RDA device, so the changed camera behavior remains unverified.
Agent Prompt
## Issue description
The package now selects a commit that changes the firmware-loading behavior, but the PR provides no real-camera evidence and explicitly says firmware download is untested.

## Fix Focus Areas
- general/package/rda5995-openipc/rda5995-openipc.mk[7-7]

## Recommended Fix
Test the updated module on a camera containing an RDA5995, capture firmware-download and driver initialization output, and add the affected board, symptom, and before/after evidence to the PR description.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@dimerr
dimerr marked this pull request as ready for review October 21, 2026 11:44
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit afc0bf7

@dimerr
dimerr merged commit d5eb3e8 into master Oct 21, 2026
47 of 53 checks passed
@dimerr
dimerr deleted the rda5995-firmware branch October 21, 2026 11:47
@dimerr dimerr mentioned this pull request Oct 21, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant