Sensors: LSM6DSO accel/gyro, AK09918 compass, VEML3328 light (SSC island) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hardware (from Samsung
drivers/adsp_factory/): AK09918 magnetometer, LPS22HH pressure, plus accel/gyro (exact part TBD — check adsp_factory Kconfig/Makefile for the accel entry). All are behind the SLPI sensor hub — no AP-side I2C nodes in the DT; the DSP owns the bus and Android reads via QMI/SEE.Two routes:
Route 1 — reclaim the I2C bus (pragmatic, try first):
i2cdetect.Route 2 — SLPI + hexagonrpc (proper, longer):
remoteproc_slpiwith Samsung-signed firmware via the link-farm.hexagonrpcd/fastrpc SEE bridge (sdm845 precedent).Start with route 1 recon: identify the sensor QUP + addresses from the Samsung tree.
Parts identified from adsp_factory: LSM6DSO accel+gyro (mainline
st_lsm6dsxsupports it natively), AK09918 mag, LPS22HH pressure, STK3A9x/TCS3701 light (board-dependent), AK09970 digital hall. Everything on the route-1 path has a mainline IIO driver — the whole question reduces to whether the sensor QUP/I2C pins can be reclaimed from the SLPI.Recon from the Samsung tree (device-free):
pil_ssc@5c00000). The bus topology (which SSC QUP, slave addresses, IRQ/reset GPIOs, VDD rails) lives in the SLPI sensor registry on the vendor partition (/vendor/etc/sensors/config files) — which we already mount.Priority note: sensors scheduled ahead of LTE (agreed 2026-08-20).
Device recon 2026-08-20: topology found, island is unpowered (route 1 is NOT a TLMM exercise)
Populated sensors (corrected from the issue text) —
gts6l_usa_vzw_defconfig+ SLPI fw strings + persist registry all agree:CONFIG_LPS22HH_FACTORYnot set; no registry entry;sensors_list.txthas no pressure). No AK09970 (hall is a plain GPIO switch + wacom hall).Bus topology (from
/mnt/vendor/persist/sensors/registry/registry/*_platform.config, which the SEE daemon compiled from/vendor/etc/sensors/config/msmnile_*.json— hw_platform matched the QC reference set, so these are the real values):dri_irq_num7667844 (I3C IBI encoding, not a GPIO)Orientation matrices also recorded (lsm6dso
-x,+y,-z; ak0991x-y,-x,-z) — useful for IIOmount-matrixlater.Where the buses physically live — the SSC island, not the AP TLMM:
pinctrl-sm8150.c).sm8150-slpi-pinctrl.dtsi: SLPI TLMM @0x02B40000, 14 pins (qcom,slpi-pinctrl, driverpinctrl-slpi.c). 7 SEs × 2 pins fits bus_instance 0..6.sa8155-vm-qupv3.dtsi: SSC QUP wrapper qupv3_3 @0x26c0000, SEs at 0x2680000 + n·0x4000 (se20..23 = SE0..3, IRQs GIC_SPI 442+), IOMMU SID 0x4e3, clocks from SCC @0x2b10000 (scc-sm8150.c, vdd_scc_cx = pm8150_l8 level = LCX).&slpi_tlmm status=ok,&ssc_sensors disabled) — that's the precedent for route 1. Note they still bootpil_ssc.Mainline has none of it: no SCC clock driver, no SLPI pinctrl, no SSC QUP nodes. All three exist downstream as ordinary qcom drivers (clk-rcg2/branch; pinctrl is a close cousin of
pinctrl-lpass-lpi; QUP is stock geni-se with different clocks) — portable, but it's a port, not a DT tweak.Experiment + result: cross-compiled a
/dev/mempeek tool; AP TLMM/GCC read fine, first read of SCC 0x2b10000 hard-stalled the SoC. USB gadget stayed enumerated (no reset), APSS watchdog did not bite after >5 min — AHB stall blocks everything. Needs physical power cycle. Do not touch 0x26xxxxx/0x2bxxxxx from the AP until the island is powered.Why it's unpowered / what powers it: downstream
pil_ssc= LCX (pm8150_l8) + LMX (pm8150_l4) proxy votes + AOSS QMPload_state slpi on(qcom,signal-aop); mainline'sqcom,sm8150-slpi-pasdoes the same (rpmhpd LCX/LMX+qcom,qmp). Our DTS has&remoteproc_slpi status="okay"with the link-farmslpi.mdt— so either SLPI never came up (auth/fw issue → PAS drops the island again) or it's up and the stall has another cause. First thing after power cycle:cat /sys/class/remoteproc/*/{name,state}+dmesg | grep -i slpi.Revised plan:
Sensors: accelerometer, gyro, compass, barometerto Sensors: LSM6DSO accel/gyro, AK09918 compass, VEML3328 light (SSC island)2026-08-20: ACCEL + MAG + COMPASS WORKING via SLPI (route 2)
ssccli --sensor accelerometer→X=1.11 Y=0.35 Z=9.65 m/s², magnetometer in µT, compass heading in °. From a clean boot, no DSP crashes.Route 1 is dead on this silicon
Not just "island unpowered": the SLPI was already
running(island powered) on the next boot and the SCC read stalled anyway. libssc docs confirm the hypervisor forbids AP access to the sensor island on these SoCs. Don't revisit.The real bug: SM8150 SDSP SMMU interconnect quirk → kernel patch
260c328df6260x190(SNS_CLIENT) was already on QRTR node 9 — SEE was alive, but theregistrysensor waits for the AP file server (hexagonrpcd).err_qdi.c:964 EX:sensor_process … frpck_0_0fatal → SLPI crash, attach returns EPIPE.fastrpc.ko: buffer allocated at iova 0xfffff000 (mapped fine), butmsg->addr= 0x1fffff000 because fastrpc foldssid << 32into every address and expects the DSP to strip it. Samsung/QC's SM8150 SLPI doesn't — downstreamadsprpc.chas an explicit "Software workaround for SMMU interconnect HW bug" forSDSP_DOMAIN_ID:cb = sid & 3, 34-bit DMA mask, IOVA mapping window offset bycb << 32, and nocb << 32added to addresses.qcom,iova-cb-windowon the sdsp fastrpc node): 34-bit mask +bus_dma_limit = ((sid+1) << 32) - 1(IOVA allocator is top-down, so every allocation lands in bank N's window without reservations), skip thesid << 32add, use the full address for the DMA API on free/mmap. DT-sideiommu-addressesreservations were a dead end (needsdma-rangesthrough glink-edge/fastrpc nodes with#size-cells = 0).dma-coherenton the cbs (downstream has it, no effect), coherent-mask theory (already 32-bit).Userspace (on the tablet now, NOT yet packaged)
libssc 0.4.4+iio-sensor-proxyare in ALARMextra.hexagonrpcdis not: built from https://github.com/linux-msm/hexagonrpc on-device, installed to/usr/local(+/etc/ld.so.conf.d/usr-local.conf)./usr/share/qcom/sm8150/Samsung/gts6l/:sensors/config→/firmware/vendor/etc/sensors/config,sensors/sns_reg.conf→…/sns_reg_config,sensors/registry= copy ofpersist:/sensors/registry/registry(hexagonrpcd refuses writes anyway; the DSP tries to write fac_cal files — harmless),socinfo/= soc_id+revision from sysfs plus hand-writtenhw_platform=MTP,platform_subtype=Unknown,platform_subtype_id=0,platform_version=65536,dsp→/firmware/vendor/dsp.hexagonrpcd-sdsp.service(root,ExecStart=hexagonrpcd -f /dev/fastrpc-sdsp -d sdsp -s -R <tree>), enabled.fastrpcon a live system oopses inqcom_glink_send_open_req(stale endpoint) — reboot for module swaps too.Open
ambient_lightsensor. Registry entry exists (I2C SSC bus 6 @0x10, needssensor_vdd+sensor_vddio). Maybe the rail isn't up, or hw_platform/socinfo gating. Gyro: ssccli has no gyro mode; check libssc API / iio-sensor-proxy.hexagonrpcdPKGBUILD, the served tree (gts6l-device), the unit, libssc + iio-sensor-proxy deps;iio-sensor-proxyneedsAF_QIPCRTRallowed in its unit (RestrictAddressFamilies).qcom,iova-cb-window).-x,+y,-z, mag-y,-x,-z) once iio-sensor-proxy is on.2026-08-20: LIGHT WORKING too — all populated sensors now live
ssccli --sensor light→ lux readings; SEE publishesambient_light(veml3328) andlight_cct("Light CCT", Samsung-modified VEML driver).Cause: power, not config. The VEML3328's VDD is pm8150 L13A (2.8 V) with no AP consumer; Samsung's board DT keeps it
regulator-always-on(/* RGB Sensor */insm8150-sec-gts6lwifi-r02.dtsi), and the SLPI's/pmic/client/sensor_vddis effectively a dummy. Ourldo13was in bootloader-left state (off). Fix: commit65560d86946f(always-on in the DTS). Golden image updated.How it was pinned down: verbose
hexagonrpcd(-Dhexagonrpcd_verbose=true) showed SEE bulk-loading every registry file and parsing all JSONs (incl. both VEML configs — identical single source: I2C SSC bus 6 @0x10), and the SLPI firmware's registry key set for the driver matches the reference — so config was complete and the failure had to be in the DSP's device probe → rail.Bonus from a raw
ssc_sensor_new()probe (/root/sscprobeon the tablet):gyroandsensor_temperature(both lsm6dso) are published as well — ssccli just has no mode for them. Full inventory now: accel, gyro, temp, mag/compass, ambient_light, light_cct.proximity/pressure: none, as expected.Noted for the iio-sensor-proxy step: libssc warns "Mount matrix provided by firmware is all 0, falling back to identity" — the registry's
*_platform.placementis all zeros; the real orientation lives in*_platform.orient(lsm-x,+y,-z, mag-y,-x,-z). Either populate placement in our served registry copy or map orient → libssc mount-matrix.Remaining on this issue: packaging (hexagonrpcd PKGBUILD + served tree + unit + socinfo shim, libssc/iio-sensor-proxy with
AF_QIPCRTRallowed), orientation, upstreamable form of the fastrpc quirk.