Skip to content

8822C: read_efuse_logical_map early-exit assumes logical-ordered EFUSE sections — empty map, rfe_type=0x00 on append-ordered units #385

Description

@josephnef

Found while reviewing #383 (hardware-verified there on a second, independent RTL8822CU — 2/2 units affected).

Symptom

On 8822C, HalJaguar3::read_efuse_logical_map returns a near-empty logical map: rfe_type reads 0x00, the new #383 MAC read at logical 0x157 finds 0xFF, and the TX-power-base walk is exposed to the same truncation. The physical OTP reads fine (efuse_OneByteRead works; the stability probe's id=0x8129 is correct).

Root cause

The non-EU walk has two terminations:

if (hdr == 0xFF)
  break;
...
if (base > upto + 8)
  break; /* past the byte we need */

The second one assumes EFUSE sections are burned in logical-offset order. They are append-ordered: each burn appends physically with whatever logical offset it carries. Physical dump of the affected unit (reader lambda logged inside the walk):

physdump 000: 00 29 81 00 8f ff 20 09  00 10 98 04 e4 31 10 03
physdump 010: f1 eb 0f 48 f0 94 65 d3  58 c5 2f 4e cd f0 4f 40
...
physdump 0d0: 46 46 4f 5e da 0b 4f 57  02 a8 6f 5e b5 8e 6f 5d
physdump 0e0: 6a 94 6f 5b ea 09 6f 57  03 52 8f 5e 65 61 8f 5d

At phys 0x12 sits header 0f 48 → logical offset 0x20 (logical byte 0x100). Every walk with upto ≤ 0xFA (rfe, tx-power base, the probe) hits base > upto + 8 there and exits after ~3 blocks — before ever reaching the sections that hold logical 0xCA (rfe) or 0x157 (MAC), which are further along physically (0xd2+).

Experiment (worktree, same unit)

  • Control: EU-style 0xFF-run tolerance alone (the mechanism Expose the EFUSE MAC as a per-unit adapter identity #383's description suspected) — no change; MAC still unavailable, rfe_type still 0x00. That padding bug was the 8822E's, not this.
  • Fix: remove the base > upto + 8 exit and walk to the 64-byte-0xFF-run end (as the EU branch already does):
    • MAC decodes: a8:b5:8e:6a:94:ea (stable across runs)
    • rfe_type flips 0x00 → 0x03

Why this needs its own validation, not a drive-by

The rfe_type change means append-ordered 8822C units are selecting the wrong PHY tables today, and fixing the walk changes table selection and per-channel TX-power base for every 8822C user. The fix itself is small, but it needs:

  • on-air TX A/B (before/after) on an affected unit, per rate, SDR-measured
  • a check that read_efuse_txpwr_base output changes are the intended ones (previously-missing bytes appearing, not previously-read bytes moving)
  • a re-run of the Expose the EFUSE MAC as a per-unit adapter identity #383 doctor cross-check (wlx<mac> vs devourer) on 8822C once the walk reads far enough

Note the walk-cost change is bounded: the exit's replacement is the existing 64-byte-0xFF-run end-of-map rule, so a sparse map still terminates early.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions