Repository navigation
ingenic: T41 pad-mux from the HDK workbook, and MIS sensor probing - #286
Conversation
detect_imagedesign_sensor() knows MIS2003, MIS2006, MIS2008, MIS4001 and MIS5001, but the Ingenic HAL never listed the vendor, so on an Ingenic camera the probe never ran and these sensors came out as no sensor. openingenic carries drivers for all of them: mis2003 for T21, mis2006/2008/4001/5001 for T31 and mis4001 for T41. They sit at 0x30 (7-bit), the address SmartSens uses.
T41 has a source T40 did not: the T41 HDK ships a GPIO Recommended Allocation Table whose "T41 IO function list" sheet gives FUNC0..FUNC3 for every pad of the SoC, named per wire like T31's GPIO spec. Not the kind of spreadsheet T40GPIO.xlsx is -- that one is a reference board's net list. The generator reads it as a fourth source kind, "sheet", and finds its columns by header text. 88 of 128 pads across four ports. Checked against the two other sources there are. Every routing in the kernel's t41-pinctrl.dtsi agrees with it -- 152 pins -- except the three vic_pa_* nodes, which put DVP on FUNCTION0 of PA00..PA14. The T41L data sheet (Pin Description, v0.9) has the static-memory bus on FUNCTION0 and DVP on FUNCTION1, as the sheet does, and those nodes would also overlap the devicetree's own i2c0_pa on PA12/PA13 at FUNCTION1: a T40 copy. The data sheet also shows what the sheet leaves out -- the static-memory function of PA06..PA19, and PA10/PA11 -- so the header says so. The six analog MIPI pins at the bottom of port A have no GPIO name in the sheet and are not in the table. The controller needs nothing: GPIO_IOBASE and the register defines in soc-t41's headers are T40's, and the kernel's pinctrl driver gives ingenic,t41-pinctrl the same data as ingenic,t40-pinctrl. reginfo dumps T40's four-port list. The spec path in the generated banner is quoted now: the workbook's name has spaces. No T41 camera, so this is host-verified only: reginfo_test's sweep and set/get round trip now include T41, plus per-wire checks on PC15 (PWM0 at FUNCTION2, EXCLK at 3) and I2C0 on PA12; all unit tests, test_pipeline.sh, and a mips32 build. ipcinfo +16 bytes.
PR Summary by QodoAdd T41 pad-mux names and enable Ingenic MIS sensor probing
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
The comment on that branch of get_cpu_id() still said T41 had no table.
Two Ingenic gaps that T41 support in OpenIPC firmware (OpenIPC/firmware#2877) runs into.
1. MIS sensors were never probed on Ingenic
detect_imagedesign_sensor()already identifies MIS2003, MIS2006, MIS2008, MIS4001 and MIS5001. But the Ingenic HAL's address list never included the ImageDesign vendor, so the probe never ran on an Ingenic camera.openingenic has drivers for all of these:
mis2003mis2006,mis2008,mis4001,mis5001mis4001The change adds ImageDesign at 0x30 (7-bit) to the Ingenic list.
2. Pad-mux for T41
Source. The table comes from the T41 HDK (
T41 HDK_20230418.zip, shipped in the Tomcat SDK release). Its GPIO Recommended Allocation Table has a sheet, "T41 IO function list", that gives FUNC0..FUNC3 for every pad, named per wire, like T31's GPIO spec. (T40GPIO.xlsxis a different kind of spreadsheet: one reference board's net list.) The generator gains a fourth source kind,sheet. 88 of 128 pads are covered, across four ports.Cross-checks:
t41-pinctrl.dtsi: every routing agrees with the sheet (152 pins), except the threevic_pa_*nodes.i2c0_pa(PA12/PA13, FUNCTION1).vic_pa_*nodes look copied from T40.Controller. No change is needed:
GPIO_IOBASEand the register defines in the soc-t41 headers are T40's.ingenic,t41-pinctrlthe same data asingenic,t40-pinctrl.reginfodumps T40's four-port register list for T41.The generated banner now quotes
--spec, because the workbook's file name has spaces.Testing
Host only; not run on a T41 camera.
reginfo_test: the table sweep and the set/get round trip now include T41. New per-wire checks cover PC15 (PWM0 at FUNCTION2, EXCLK at 3) and I2C0 on PA12, and check that unnamed pads (PA00, PA10) are absent.build/*_testpasses, as doestools/test_pipeline.sh;gen_padmux_names.py --checkis up to date.ipcinfogrows by 16 bytes.clang-formatis not installed here, soscripts/format-changeddid not run. New lines are kept within 80 columns by hand.A T41 board can settle it the way the other parts were: run
ipctool reginfo --pads, decode PxINT/PxMSK/PxPAT1/PxPAT0 independently, and diff the two.