Skip to content

hisilicon: map dv500 IOCFG2/IOCFG3 + PMC AON pad-mux (fixes #122) - #123

Merged
widgetii merged 1 commit into
masterfrom
feat/dv500-iocfg-regbanks
Jun 27, 2026
Merged

hisilicon: map dv500 IOCFG2/IOCFG3 + PMC AON pad-mux (fixes #122)#123
widgetii merged 1 commit into
masterfrom
feat/dv500-iocfg-regbanks

Conversation

@widgetii

Copy link
Copy Markdown
Member

What

hi3519dv500/hi3516dv500 only mapped IOCFG0 (0x10260000) plus a cv6xx-leftover regbank at 0x11130000. The SoC's other pinmux controllers — IOCFG2 (0x179F0000), IOCFG3 (0x0EFF0000) and the AON pad-mux in the PMC (0x11120000) — were unmapped, so /dev/mem pinmux tools (ipctool reginfo) read 0 outside IOCFG0, and the vendor kernel's pin_mux.c writes to iocfg2/iocfg3 landed on unmapped MMIO (dropped).

Change

Add RAM-backed regbanks for the three regions (num_regbanks 4 → 7) on both dv500 configs.

Verification

Booted OpenIPC Linux on the machine and round-tripped known mux values through /dev/mem, decoded with ipctool reginfo (OpenIPC/ipctool#177):

addr written reginfo decode
0x10260000 (IOCFG0) 0x5 [I2C1_SDA]
0x179F0034 (IOCFG2) 0x6 [VI_CLK]
0x179F0044 (IOCFG2) 0x1 [SENSOR0_CLK]
0x0EFF0024 (IOCFG3) 0x2 [I2C5_SCL]
0x11120204 (PMC AON) 0x1 [GPIO9_0]

All decode to the correct function (before the fix the writes vanished and read 0). The kernel's own USB-init write to IOCFG2 0x179F0010 (USB_VBUS) also reads back now.

Fixes #122.

The hi3519dv500/hi3516dv500 machines only mapped IOCFG0 (0x10260000) plus a
cv6xx-leftover regbank at 0x11130000, leaving the SoC's other pinmux
controllers unmapped: IOCFG2 (0x179F0000), IOCFG3 (0x0EFF0000) and the AON
pad-mux in the PMC (0x11120000).  /dev/mem pinmux tools (ipctool reginfo)
read 0 for everything outside IOCFG0, and the vendor kernel's pin_mux.c
writes to iocfg2/iocfg3 landed on unmapped MMIO (dropped).

Add RAM-backed regbanks for the three regions (num_regbanks 4 -> 7) so
writes persist and reads return the configured mux selection.

Verified by booting OpenIPC Linux on the machine and round-tripping known
mux values through /dev/mem with ipctool reginfo: 0x179F0044=1 -> SENSOR0_CLK,
0x179F0034=6 -> VI_CLK, 0x0EFF0024=2 -> I2C5_SCL, 0x11120204=1 -> GPIO9_0,
0x10260000=5 -> I2C1_SDA, all decoded correctly.  Also the kernel's own USB
init write to IOCFG2 0x179F0010 (USB_VBUS) now reads back instead of 0.

Fixes #122.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@widgetii
widgetii merged commit d49f727 into master Jun 27, 2026
17 checks passed
@widgetii
widgetii deleted the feat/dv500-iocfg-regbanks branch June 27, 2026 09:12
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.

hi3519dv500/hi3516dv500: model IOCFG2 (0x179F0000), IOCFG3 (0x0EFF0000) and PMC AON pad-mux (0x11120000); iocfg1 0x11130000 is a cv6xx leftover

1 participant