Skip to content

Pixel 8 Pro: USI9 / hsi2c_9 and the battery pack's EEPROM (stacked on #163) - #175

Merged
derekross merged 4 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-pack-eeprom
Nov 1, 2026
Merged

derekross merged 4 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-pack-eeprom

Conversation

@Somnius

@Somnius Somnius commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

This is stacked on #163: it needs the bus nodes and the clock work of that one, so the branch carries #163's six commits first and only the last four are new here. I'll rebase it when #163 merges.

What it does: it describes the I2C bus of the Pixel 8 Pro's battery pack EEPROM, so Linux can read the battery ID. Google's driver reads one byte of that EEPROM (offset 0x17) and uses it to pick the fuel gauge model; the gauge needs the right model for its temperature and its percentage. The four commits:

  • the five clock ids for USI9 in google,zuma.h;
  • the USI9 path in clk-zuma.c: user mux 0x690, divider 0x1824, gates 0x2070, 0x2074 and 0x20a0 in CMU_PERIC1, each taken from Google's cmucal tables and checked next to the USI11 set from Pixel 8 Pro battery: CMU_PERIC1, USI11 and the MAX77759 bus #163 (same structure, the 0x640, 0x1810, 0x2048, 0x204c and 0x2094 ones);
  • usi9 and hsi2c_9 in zuma.dtsi (USI at 0x10c900c0, SW_CONF at offset 0x4 of the PERIC1 sysreg, bus at 0x10c90000, GIC SPI 657) and hsi2c9_bus in the pinctrl file (gpp19-4 and gpp19-5, function 2, no pull, as stock has them);
  • a read-only atmel,24c08 at 0x50 on hsi2c_9 in zuma-husky.dts (stock calls it at,24c08; the bus runs at 400 kHz in stock). It is read-only because the rest of that EEPROM is the pack's part number, dates and history.

The nodes are all disabled, like hsi2c_11; a bring-up overlay switches them on (it is in omarchy-mobile #249 as pack-eeprom-test.dtso). CONFIG_EEPROM_AT24=m was already on, so there is no config change.

Tested on a Pixel 8 Pro: I booted this on the c6 base, with the overlay: the log shows "at24 0-0050: 1024 byte 24c08 EEPROM, read-only" and the three extra addresses of the 24c08 appear. I read byte 0x17 and only that byte: it is 1, which in Google's driver and the stock husky device tree is the ATL pack (the other values are 0 default-a1-0k, 2 COS, 3 LSN, 170 Google's dummy). That agrees with the 5,022,000 uAh design capacity the gauge showed before it fell back to its power-on state (the ATL model's 0x09cf times 2 mAh). The tree I booted is @greenbrettmichael's c6 plus the commits of #163 and these four as I first wrote them (before the cherry-pick onto the omamobile base, which only needed one conflict resolved in the pinctrl comment): https://github.com/Somnius/linux-omarchy-mobile/tree/husky-pack-eeprom-booted (tip 7975b84), release 7.3.0-rc6-omamobile-push1-g7975b84a8017. Enabling the bus renumbers the I2C adapters (the EEPROM's became i2c-0 and the battery chips i2c-1), which is worth knowing for anything that hardcodes a bus number.

Checks: kernel-pr-check --build --merge is clean in the container on the whole stack, dtbs_check on zuma-husky.dtb shows only the same two eusb2-phy supply warnings as before and the new eeprom@50 node validates, and the six commits of #163 are unchanged.

Not tested: another pack or phone (only the ATL pack), writing to the EEPROM (it is read-only here on purpose), and anything that uses the ID automatically: nothing feeds the byte to the gauge yet, I loaded the matching model by hand from an overlay. Whether the ID should be read at runtime or the model just described in the board file is something I'd like your view on, now that I know this pack is ATL.

tools/phone-smoke from the booted kernel

phone-smoke: husky

Kernel 7.3.0-rc6-omamobile-push1-g7975b84a8017, tools at bb11919, 2026-11-01T13:18Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g7975b84a8017, slot b, up 284s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 215G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card0-Unknown-1 connected, 1344x2992
GPU not ok no render node
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok SALIXP Touchscreen
buttons ok gpio-keys
Wi-Fi skip no wireless interface
Bluetooth skip no controller
battery ok 59% Discharging, 35 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 35 °C

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-device-husky 0.1.1-1, omamobile-firstboot 0.1.2-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.20-1, omamobile-owl-widgets 0.1.1-1, omamobile-shell 0.2.45-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1

@derekross

Copy link
Copy Markdown
Owner

Thanks Lef, this is a tidy follow-on, and reading the pack ID one byte at a time, with the EEPROM read-only, is exactly the right amount of caution. I checked it against Google's sources:

  • Clocks (cal-if/zuma/cmucal-sfr.c and cmucal-node.c): user mux at 0x690, bit 4, with parents OSCCLK and CLKCMU_PERIC1_IP; divider at 0x1824, bits 0-3; IPCLK, PCLK and RSTNSYNC gates at 0x2070, 0x2074 and 0x20a0, bit 21. PCLK hangs off the PERIC1 NoC user mux, the other two off the divider. All as you have them.
  • USI and bus (zuma-usi.dtsi): hsi2c_9 at 0x10c90000, sysreg offset 0x4, and IRQ_USI9_USI_PERIC1 is 657.
  • Pins: gpp19-4/5, function 2, no pull. I also checked whether a later husky include overrides the pins, as the Type-C file did for hsi2c11. Only the wireless-charger files touch hsi2c_9, and they set no pins.
  • EEPROM (zuma-shusky-battery.dtsi): at,24c08 at 0x50 on a 400 kHz bus.

The four commits match husky-pack-eeprom-booted exactly, and that release isn't -dirty, which helps. kernel-pr-check --build --merge is clean on today's base, and every commit's husky DTB builds. dtbs_check gives only the existing eUSB2 warnings, including with USI9, hsi2c_9 and the EEPROM switched on.

A few things before it merges:

  1. The commit messages still say "Not tested on a phone yet", though you booted exactly these changes. Please put the test in the last commit: the tree, that the bus was enabled by an overlay, the at24 probe line, and the one-byte read of 0x17 (1, ATL). The earlier commits can say they were tested with the board commit on top.
  2. The CMU_PERIC1 comment you rewrite in clk-zuma.c still calls the chip at 0x66 "the MAX77729 PMIC". Your PMIC_ID read on Pixel 8 Pro battery: CMU_PERIC1, USI11 and the MAX77759 bus #163 shows it's the MAX77759, so please fix it in this commit.
  3. A nit: the header commit's prefix is dt-bindings: clock: google,zuma:, while Pixel 8 Pro battery: CMU_PERIC1, USI11 and the MAX77759 bus #163 uses google,zuma-clock:. Please pick one so the two series read the same.

On reading the ID at runtime versus describing the model in the board file: let's settle that in the gauge-model work. A model fixed in the board file would be wrong on a phone with a COS pack, so I lean towards something that uses the ID, but I'd like to see what mainline's gauge driver can take first. The note about the I2C adapter numbers moving is useful, thanks; nothing in our tree hard-codes them.

I've approved the CI run. Once #163 is merged, please rebase onto omamobile (rebase merges give #163's commits new ids). Alternatively, once the points above are in, I can merge this PR on its own, since it carries all ten commits.

@Somnius
Somnius force-pushed the omamobile-zuma-husky-pack-eeprom branch from 5838d76 to 524112e Compare November 1, 2026 15:54
@Somnius

Somnius commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @derekross, all three are in (force-pushed, the tree is identical, only commit messages and the one comment line changed). The last commit now records the test: the tree and bus overlay, the at24 line, and the one-byte read of 0x17 (1, ATL). The earlier ones say they were tested with the board commit on top. The comment says MAX77759 now, and the header commit uses the google,zuma-clock prefix like #163.

For the rebase: I'll rebase onto omamobile once #163 is in, or merge it alone if that's easier for you, either is fine by me. Agreed on the model question, I'll hold off until you've seen what mainline's gauge driver can take.

USI9 is the I2C bus (hsi2c_9) of the Pixel 8 Pro's battery pack EEPROM,
which holds the battery ID that picks the fuel gauge model. It sits on
CMU_PERIC1 like USI11: a user mux, a divider and the IPCLK, PCLK and
RSTNSYNC gates. Add the five ids after USI11's.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
USI9 is the I2C bus (hsi2c_9) of the Pixel 8 Pro's battery pack EEPROM,
which holds the battery ID that picks the fuel gauge model. It is on
CMU_PERIC1 like USI11, and firmware sets it up the same way: the user
mux and the divider are read-only, and Linux turns on the three gates.

The offsets are from Google's cmucal tables, each next to the USI11 one
that already works: the user mux at 0x690 (USI11: 0x640, bit 4, parents
the oscillator and the PERIC1 IP clock), the divider at 0x1824 (USI11:
0x1810, bits 0 to 3), and the IPCLK, PCLK and RSTNSYNC gates at 0x2070,
0x2074 and 0x20a0, bit 21 (USI11: 0x2048, 0x204c, 0x2094). The PCLK gate
hangs off the PERIC1 NoC like USI11's, the other two off the divider.

Tested on a Pixel 8 Pro with the board commit and the two device tree
commits on top: the bus clocks were on and the EEPROM answered.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
USI9 is at 0x10c900c0 with its SW_CONF at offset 0x4 of the PERIC1
sysreg, and the bus is hsi2c_9 at 0x10c90000 on GIC SPI 657, as in
Google's device tree. It is the I2C bus of the Pixel 8 Pro's battery
pack EEPROM (the wireless charger sits on it too). Add its pins, gpp19-4
and gpp19-5 on function 2 with no pull, as stock has them.

Both nodes are disabled: a board file or a bring-up overlay enables them.
Tested on a Pixel 8 Pro with the board commit on top; a bring-up overlay
enabled cmu_peric1, the sysreg, USI9 and hsi2c_9.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
…si2c_9

The Pixel 8 Pro's battery pack has an EEPROM on USI9 / hsi2c_9: stock
has it as "at,24c08" at 0x50 on a 400 kHz bus. Its byte 0x17 is the
battery ID that Google's driver matches against the fuel gauge models
(0 the default model, 1 ATL, 2 COS, 3 LSN, 170 Google's dummy), and
which pack the phone has is what decides the right model. The rest of
the EEPROM holds the pack's part number, dates and history, so the node
is read-only.

Mainline's at24 driver wants "atmel,24c08", not stock's alias. The bus
and USI9 stay disabled in the board file, like hsi2c_11; a bring-up
overlay enables them. Nothing feeds the ID to the gauge yet.

Tested on a Pixel 8 Pro (slot B, release 7.3.0-rc6-omamobile-push1-
g7975b84a8017: Brett's c6 tree with derekross#163 and the four commits of this
series, as the branch husky-pack-eeprom-booted). A bring-up overlay
enabled cmu_peric1, the sysreg, USI9 and hsi2c_9. The log shows

  at24 0-0050: 1024 byte 24c08 EEPROM, read-only

and a one-byte read of offset 0x17 returned 1, the ATL pack.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
@Somnius
Somnius force-pushed the omamobile-zuma-husky-pack-eeprom branch from 524112e to 006dae5 Compare November 1, 2026 19:06
@derekross
derekross merged commit 1359767 into derekross:omamobile Nov 1, 2026
1 check passed
@derekross

Copy link
Copy Markdown
Owner

Thanks Lef, all three points are in, and the rebase onto omamobile carries the same four patches, so what I checked last time still holds. The gate is clean on today's base and CI passed with dtbs_check. Merged.

@Somnius

Somnius commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@derekross thank you for merging this and #163. Next from my side is the bus-on-by-default PR you described on omarchy-mobile#1, after #250 merges.

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