hisilicon: map dv500 IOCFG2/IOCFG3 + PMC AON pad-mux (fixes #122) - #123
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
hi3519dv500/hi3516dv500only mapped IOCFG0 (0x10260000) plus a cv6xx-leftover regbank at0x11130000. The SoC's other pinmux controllers — IOCFG2 (0x179F0000), IOCFG3 (0x0EFF0000) and the AON pad-mux in the PMC (0x11120000) — were unmapped, so/dev/mempinmux tools (ipctool reginfo) read0outside IOCFG0, and the vendor kernel'spin_mux.cwrites to iocfg2/iocfg3 landed on unmapped MMIO (dropped).Change
Add RAM-backed regbanks for the three regions (
num_regbanks4 → 7) on both dv500 configs.Verification
Booted OpenIPC Linux on the machine and round-tripped known mux values through
/dev/mem, decoded withipctool reginfo(OpenIPC/ipctool#177):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 IOCFG20x179F0010(USB_VBUS) also reads back now.Fixes #122.