Skip to content

kernel/system: bringup gpio#58

Merged
greatgitsby merged 2 commits intomasterfrom
gpio
Mar 22, 2026
Merged

kernel/system: bringup gpio#58
greatgitsby merged 2 commits intomasterfrom
gpio

Conversation

@greatgitsby
Copy link
Copy Markdown
Collaborator

@greatgitsby greatgitsby commented Mar 22, 2026

split from #57

Changes

  • TLMM GPIO base is dynamic on mainline (512 vs 0 on downstream), look it up at runtime in gpio.sh, lte.sh, and power_drop_monitor.py
  • include pm8998.dtsi/pmi8998.dtsi for PMIC GPIO chips
  • enable I2C_QCOM_GENI=y, SENSORS_INA2XX=y, GPIO_SYSFS=y
  • add INA231 on i2c10 in DTS
  • dynamically discover PM8998 GPIO base, INA231 hwmon and i2c bus
  • re-add POWER ALERT pin export (PM8998_GPIO4) in gpio.sh

Testing

Validated on both tizi and mici with tools/test/test_gpio.sh.

tizi - 26/26 PASS

=== GPIO validation on: comma.ai tizi ===

[1] GPIO chip enumeration
  PASS: TLMM chip present (base=552)
  PASS: PM8998 GPIO chip present (base=512)
  PASS: PMI8998 GPIO chip present (base=538)

[2] TLMM pin exports
  PASS: gpio.ready exists
  PASS: all 11 TLMM pins exported with correct offset

[3] Power alert pin
  PASS: gpio515 (PM8998_GPIO4) exported, direction=in, edge=falling

[4] INA231 power monitor
  PASS: INA231 I2C device probed
  PASS: INA231 hwmon present (4896 mV, 157 mA)

[5] power_drop_monitor
  PASS: running (pid 2281, 68s uptime)

[6-8] LTE, USB hub, kernel health
  PASS: all checks passed

PASS: 26  FAIL: 0 - ALL TESTS PASSED

mici - 22/22 PASS

=== GPIO validation on: comma.ai mici ===

[1] GPIO chip enumeration
  PASS: TLMM chip present (base=552)
  PASS: PM8998 GPIO chip present (base=512)
  PASS: PMI8998 GPIO chip present (base=538)

[2] TLMM pin exports
  PASS: gpio.ready exists
  PASS: all 11 TLMM pins exported with correct offset

[3] Power alert pin
  PASS: gpio515 (PM8998_GPIO4) exported, direction=in, edge=falling

[4] INA231 power monitor
  PASS: INA231 I2C device probed
  WARN: INA231 hwmon not present (chip not responding)

[5] power_drop_monitor
  WARN: skipped (INA231 not available)

[6-8] LTE, USB hub, kernel health
  PASS: all checks passed

PASS: 22  FAIL: 0 - ALL TESTS PASSED

Notes

  • mici does not have an INA231 - the WARN is expected and matches old kernel behavior (also fails with ETIMEDOUT on downstream 4.9)
  • GPIO 1264 on downstream = PM8998_GPIO4 (base 1261 + offset 3). On mainline PM8998 base is 512, so it becomes gpio515
  • tizi pin 41 (PANDA_1V8_EN_N) is exported on tizi but skipped on tici (SSD_3v3 EN)

- TLMM GPIO base is dynamic on mainline (512 vs 0 on downstream),
  look it up at runtime in gpio.sh, lte.sh, and power_drop_monitor.py
- include pm8998.dtsi/pmi8998.dtsi for PMIC GPIO chips
- enable I2C_QCOM_GENI=y, SENSORS_INA2XX=y, GPIO_SYSFS=y
- add INA231 on i2c10 in DTS
- dynamically discover PM8998 GPIO base, INA231 hwmon and i2c bus
- re-add POWER ALERT pin export (PM8998_GPIO4) in gpio.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greatgitsby greatgitsby changed the title gpio: dynamic base lookup and PMIC GPIO support for mainline kernel/system: bringup gpio Mar 22, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 22, 2026

vamOS System Profile

Changes vs master

Metric Change
Used space 3442.3MB → 3442.4MB (+0MB)
Sparse image 3381.0MB → 3381.4MB (+.3MB)
Package count 517 → 517
Directory size changes (>1MB)
Directory Change

Metric Value
Used space 3442.4MB / 5959.5MB
Files 55613
Directories 4418
Symlinks 3448
Packages 517

Top 10 Directories

Directory Size

Category Breakdown

Category Size %
xbps packages 2477.7MB 71.9%
Python venv 639.3MB 18.5%
Firmware 1.2MB 0%
Other 324.0MB 9.4%

Top 10 Packages by Size

Package Size
mit-krb5-libs-1.21.3_1 270.4MB
gawk-5.3.2_1 210.3MB
llvm-21_3 148.6MB
libldns-1.9.0_1 124.3MB
pcre2-devel-10.47_1 74MB
libclang21-21.1.7_1 70.2MB
glib-2.86.1_2 67.1MB
gcc-14.2.1+20250405_4 65.4MB
libcap-progs-2.77_1 56MB
cmake-4.2.2_1 53.2MB

Top 30 Files by Size

File Size
/usr/lib/llvm/21/lib/libLLVM.so.21.1 124.3MB
/usr/lib/llvm/21/lib/libMLIR.so.21.1 89.7MB
/usr/lib/llvm/21/bin/mlir-transform-opt 82.9MB
/usr/lib/llvm/21/lib/libclang-cpp.so.21.1 56MB
/usr/lib/llvm/21/bin/mlir-translate 53.2MB
/usr/lib/llvm/21/bin/llvm-exegesis 52MB
/usr/lib/llvm/21/bin/llvm-bolt-binary-analysis 50.6MB
/usr/bin/uv 46.3MB
/usr/local/venv/lib/python3.12/site-packages/ffmpeg/install/lib/libavcodec.a 40.3MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/gnat1 40.1MB
/usr/bin/gdb 38.1MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1plus 37.3MB
/usr/lib/libgallium-25.3.3.so 35.4MB
/usr/lib/libllvm-qcom.so 35.2MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1 35.2MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/lto1 33.9MB
/usr/bin/lto-dump 33.9MB
/usr/lib/libRusticlOpenCL.so.1.0.0 32.5MB
/usr/local/venv/bin/ruff 31.8MB
/usr/share/icu/78.2/icudt78l.dat 31.5MB
/usr/lib/llvm/21/lib/libclang.so.21.1.7 30.2MB
/usr/lib/llvm/21/bin/c-index-test 28.6MB
/usr/local/venv/lib/python3.12/site-packages/gcc_arm_none_eabi/toolchain/libexec/gcc/arm-none-eabi/13.2.1/cc1 28.2MB
/usr/lib/libz3.so 27.9MB
/usr/bin/run 26.6MB
/usr/local/venv/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-71e1b124.so 23.6MB
/usr/comma/updater 23.5MB
/usr/comma/setup 23.5MB
/usr/comma/reset 23.5MB
/usr/local/uv/python/cpython-3.12.13-linux-aarch64-gnu/bin/python3.12 21.6MB

@greatgitsby greatgitsby marked this pull request as ready for review March 22, 2026 01:06
Deduplicate TLMM/PM8998 base lookup and gpio() function into
gpio_base.sh, sourced by gpio.sh and lte.sh. Fix unclosed file
handles in power_drop_monitor.py and move glob import to top level.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greatgitsby greatgitsby merged commit 2abf589 into master Mar 22, 2026
2 checks passed
@greatgitsby greatgitsby deleted the gpio branch March 22, 2026 01:18
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