Skip to content

ARM: dts: apple: ipad3: Add I2C1 and I2C2 sensor buses - #137

Merged
henrikklee merged 1 commit into
OrchardLinux:armv7from
alistairreay:ipad3-i2c-sensors
Dec 4, 2026
Merged

henrikklee merged 1 commit into
OrchardLinux:armv7from
alistairreay:ipad3-i2c-sensors

Conversation

@alistairreay

Copy link
Copy Markdown

Summary

Adds i2c1 and i2c2 (plus their GPIO pinmuxes) and their four IIO sensors to the shared iPad 3 device tree (arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi), benefiting all three iPad 3 boards (j1, j2, and j2a):

  • i2c1 (0x3300000, IRQ 19, gpio101/gpio102, PMGR 0x3f101138 = 0x2ff):
    • compass@e (asahi-kasei,ak8975) — verified WIA (0x00) = 0x48
  • i2c2 (0x3400000, IRQ 20, gpio80/gpio81, PMGR 0x3f10113c = 0x2ff):
    • accelerometer@19 (st,lis331dlh-accel) — verified WHO_AM_I (0x0f) = 0x32
    • als@39 (amstaos,tsl2581) — verified ID (0x92) = 0x93
    • gyro@68 (st,l3g4200d-gyro) — verified WHO_AM_I (0x0f) = 0xd3 (0x6a returned -ENXIO on the tested unit)

No defconfig changes are needed: orchard_applearmv7_defconfig already enables CONFIG_IIO_ST_ACCEL_3AXIS=y, CONFIG_AK8975=y, CONFIG_IIO_ST_GYRO_3AXIS=m, and CONFIG_TSL2583=m.

Hardware testing

Tested on a 64 GB iPad 3 (GSM) (iPad3,3 / j2a, A5X / S5L8945X) booted into RAM from untethered iOS 8.4.1 (12H321) via kloader + kDFU (13G37 patched iBSS/iBEC, GCC 11.4 ARMv7 zImage):

  • iio:device0 (lis331dlh): live fluctuating readings (-857, -9, -458 at scale = 0.009806 m/s² → ~9.52 m/s²)
  • iio:device1 (l3g4200d): live fluctuating angular velocity (-458, 214, -165 at scale = 0.000153 rad/s)
  • iio:device2 (tsl2581): probed cleanly (Light sensor found.), proportional raw photodiode counts across gain 1 → 16 → 111 (0 → 3 → 23 both, 0 → 1 → 5 IR in a dim room)
  • iio:device3 (1-000e / ak8975): live fluctuating magnetic field (51, 38, 37 at scale ~0.0034 G → ~0.24 G)

Build validation

Compiled all three iPad 3 DTBs against orchard_applearmv7_defconfig with W=1 (zero warnings/errors):

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- W=1 apple/s5l8945x-j1.dtb apple/s5l8945x-j2.dtb apple/s5l8945x-j2a.dtb

Describe i2c1 and i2c2 and their IIO sensors in the shared iPad 3 device
tree (s5l8945x-ipad3.dtsi, shared by J1, J2 and J2A) from the 13G37 ADT:

- i2c1 (0x3300000, IRQ 19, pins gpio101/gpio102, PMGR 0x3f101138):
  - AKM AK8975B compass at 0x0e (asahi-kasei,ak8975; WIA 0x48)
- i2c2 (0x3400000, IRQ 20, pins gpio80/gpio81, PMGR 0x3f10113c):
  - ST LIS331DLH 3-axis accelerometer at 0x19 (st,lis331dlh-accel; WHO_AM_I 0x32)
  - TAOS TSL2581 ambient light sensor at 0x39 (amstaos,tsl2581; ID 0x93)
  - ST L3G4200D 3-axis gyroscope at 0x68 (st,l3g4200d-gyro; WHO_AM_I 0xd3;
    the ADT's alternate gyro1 at 0x6a is unpopulated on the tested unit)

All four drivers are already enabled in orchard_applearmv7_defconfig
(IIO_ST_ACCEL_3AXIS=y, AK8975=y, IIO_ST_GYRO_3AXIS=m, TSL2583=m).

Tested on a 64 GB iPad 3 GSM (iPad3,3 / J2A) booted via kloader + kDFU
from iOS 8.4.1 (12H321): all four IIO devices probed cleanly with live
readings, and all three DTBs (s5l8945x-j1, -j2, -j2a) build cleanly with
W=1.

Signed-off-by: Ali Reay <alistair.reay@gmail.com>
@henrikklee
henrikklee merged commit 2164823 into OrchardLinux:armv7 Dec 4, 2026
3 checks passed
henrikklee pushed a commit to OrchardLinux/orchard that referenced this pull request Dec 4, 2026
…dings

Record hardware verification on a 64 GB iPad 3 GSM (iPad3,3 / J2A) booted
from untethered iOS 8.4.1 (12H321) via kloader + kDFU:

- Backlight, battery telemetry, net positive charging (+242 mA), speakers
  and internal microphone (39.1x loopback SNR), USB serial and USB host
  verified working on J2A.
- I2C1/I2C2 sensors (LIS331DLH accelerometer, L3G4200D gyroscope, TSL2581
  ALS, AK8975 compass) verified working on J2A (and marked untested on J1),
  depending on OrchardLinux/linux#137.
- Bluetooth (BCM4330B1 Mike Module patchram carved from 12H321 BlueTool)
  marked untested with live BLE scan verified.
- Documented 64 GB PPN 1.3 NAND geometry (read-only probe) and SGX543MP4
  rev 1.2.2 4-core microkernel boot + 2D fill benchmark in devices/j2a/README.md.
@henrikklee

Copy link
Copy Markdown

Merged as it is — thank you @alistairreay! The tilt sensor, gyroscope, light sensor and compass are now on for all three iPad 3 models through the shared file.

Follow-ups, none blocking: the sensors' mount matrix (so auto-rotate turns the right way; #63 shows the pattern), and the second possible gyroscope address 0x6a from the ADT. orchard picks this up when it next moves its 32-bit kernel lock, and the iPad 3 sensor entries in the device data follow then.

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.

2 participants