From 938281d9f5f361098232d554d14fe2813d0a4183 Mon Sep 17 00:00:00 2001 From: Lef Date: Sun, 1 Nov 2026 14:59:20 +0200 Subject: [PATCH 1/4] dt-bindings: clock: google,zuma-clock: add the CMU_PERIC1 USI9 clocks 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 Assisted-by: LLM --- include/dt-bindings/clock/google,zuma.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/clock/google,zuma.h b/include/dt-bindings/clock/google,zuma.h index fbbae0762b..9047729c9a 100644 --- a/include/dt-bindings/clock/google,zuma.h +++ b/include/dt-bindings/clock/google,zuma.h @@ -37,7 +37,10 @@ #define CLK_GOUT_HSI0_USI2_IP 9 #define CLK_GOUT_HSI0_USI2_PCLK 10 -/* CMU_PERIC1: USI11, the I2C bus of the battery, charger and USB-C chips. */ +/* + * CMU_PERIC1: USI11, the I2C bus of the battery, charger and USB-C chips, and + * USI9, the I2C bus of the battery pack's EEPROM. + */ #define CLK_MOUT_PERIC1_NOC_USER 1 #define CLK_GOUT_GPIO_PERIC1 2 #define CLK_GOUT_PERIC1_SYSREG 3 @@ -46,6 +49,11 @@ #define CLK_GOUT_PERIC1_USI11_IPCLK 6 #define CLK_GOUT_PERIC1_USI11_PCLK 7 #define CLK_GOUT_PERIC1_USI11_RSTNSYNC 8 +#define CLK_MOUT_PERIC1_USI9_USER 9 +#define CLK_DOUT_PERIC1_USI9 10 +#define CLK_GOUT_PERIC1_USI9_IPCLK 11 +#define CLK_GOUT_PERIC1_USI9_PCLK 12 +#define CLK_GOUT_PERIC1_USI9_RSTNSYNC 13 /* CMU_APM: the APM mailbox, its SRAM and the always-on GPIO banks. */ #define CLK_APM_PLL_ALV_DIV2 1 From 8124a2e36e936138e9075d756e3bc69b9003560a Mon Sep 17 00:00:00 2001 From: Lef Date: Sun, 1 Nov 2026 14:59:59 +0200 Subject: [PATCH 2/4] clk: samsung: clk-zuma: add the PERIC1 path to USI9 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 Assisted-by: LLM --- drivers/clk/samsung/clk-zuma.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/clk/samsung/clk-zuma.c b/drivers/clk/samsung/clk-zuma.c index 962f2ae8e3..8e7b12f591 100644 --- a/drivers/clk/samsung/clk-zuma.c +++ b/drivers/clk/samsung/clk-zuma.c @@ -242,26 +242,33 @@ static const struct samsung_cmu_info hsi0_cmu __initconst = { }; /* - * CMU_PERIC1, 0x10c00000. Firmware sets it up: the user muxes and the USI11 - * divider are read-only, and the GPIO and sysreg gates are read-only gates. - * USI11 is the I2C bus of the MAX77759 gauge, charger and Type-C controller - * and the MAX77729 PMIC. Its gates are the ones Linux turns on, as for the - * Pixel 9a's USI10; their auto/manual mode is left as firmware set it. + * CMU_PERIC1, 0x10c00000. Firmware sets it up: the user muxes and the USI9 and + * USI11 dividers are read-only, and the GPIO and sysreg gates are read-only + * gates. USI11 is the I2C bus of the MAX77759 gauge, charger and Type-C + * controller and the MAX77759 PMIC; USI9 is the I2C bus of the battery pack's + * EEPROM. Their gates are the ones Linux turns on, as for the Pixel 9a's + * USI10; their auto/manual mode is left as firmware set it. */ PNAME(mout_peric1_noc_user_parents) = { "oscclk", "zuma_dout_peric1_noc" }; PNAME(mout_peric1_usi11_user_parents) = { "oscclk", "zuma_dout_peric1_ip" }; +PNAME(mout_peric1_usi9_user_parents) = { "oscclk", "zuma_dout_peric1_ip" }; static const struct samsung_mux_clock peric1_muxes[] __initconst = { MUX_F(CLK_MOUT_PERIC1_NOC_USER, "zuma_mout_peric1_noc_user", mout_peric1_noc_user_parents, 0x610, 4, 1, 0, CLK_MUX_READ_ONLY), MUX_F(CLK_MOUT_PERIC1_USI11_USER, "zuma_mout_peric1_usi11_user", mout_peric1_usi11_user_parents, 0x640, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_PERIC1_USI9_USER, "zuma_mout_peric1_usi9_user", + mout_peric1_usi9_user_parents, 0x690, 4, 1, 0, CLK_MUX_READ_ONLY), }; static const struct samsung_div_clock peric1_dividers[] __initconst = { DIV_F(CLK_DOUT_PERIC1_USI11, "zuma_dout_peric1_usi11", "zuma_mout_peric1_usi11_user", 0x1810, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_PERIC1_USI9, "zuma_dout_peric1_usi9", + "zuma_mout_peric1_usi9_user", 0x1824, 0, 4, 0, + CLK_DIVIDER_READ_ONLY), }; static const struct samsung_gate_clock peric1_ro_gates[] __initconst = { @@ -278,6 +285,12 @@ static const struct samsung_gate_clock peric1_gates[] __initconst = { "zuma_mout_peric1_noc_user", 0x204c, 21, 0, 0), GATE(CLK_GOUT_PERIC1_USI11_RSTNSYNC, "zuma_gout_peric1_usi11_rstnsync", "zuma_dout_peric1_usi11", 0x2094, 21, 0, 0), + GATE(CLK_GOUT_PERIC1_USI9_IPCLK, "zuma_gout_peric1_usi9_ipclk", + "zuma_dout_peric1_usi9", 0x2070, 21, 0, 0), + GATE(CLK_GOUT_PERIC1_USI9_PCLK, "zuma_gout_peric1_usi9_pclk", + "zuma_mout_peric1_noc_user", 0x2074, 21, 0, 0), + GATE(CLK_GOUT_PERIC1_USI9_RSTNSYNC, "zuma_gout_peric1_usi9_rstnsync", + "zuma_dout_peric1_usi9", 0x20a0, 21, 0, 0), }; static const struct samsung_cmu_info peric1_cmu __initconst = { @@ -289,7 +302,7 @@ static const struct samsung_cmu_info peric1_cmu __initconst = { .nr_ro_gate_clks = ARRAY_SIZE(peric1_ro_gates), .gate_clks = peric1_gates, .nr_gate_clks = ARRAY_SIZE(peric1_gates), - .nr_clk_ids = CLK_GOUT_PERIC1_USI11_RSTNSYNC + 1, + .nr_clk_ids = CLK_GOUT_PERIC1_USI9_RSTNSYNC + 1, .clk_name = "bus", }; From d9d3855ca73ea9de96e0586b4386bc64efeb1317 Mon Sep 17 00:00:00 2001 From: Lef Date: Sun, 1 Nov 2026 15:00:08 +0200 Subject: [PATCH 3/4] arm64: dts: exynos: google: zuma: add USI9 and hsi2c_9 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 Assisted-by: LLM --- .../boot/dts/exynos/google/zuma-pinctrl.dtsi | 8 +++++ arch/arm64/boot/dts/exynos/google/zuma.dtsi | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi index dd84a0f1dc..2de5877971 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi @@ -459,6 +459,14 @@ samsung,pin-drv = ; }; + /* USI9, the battery pack EEPROM's bus: gpp19-4/5, no pull as in stock. */ + hsi2c9_bus: hsi2c9-bus-pins { + samsung,pins = "gpp19-4", "gpp19-5"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + /* * USI11, the battery bus: stock's board file moves it to gpp21-0/1 and * sets no pull, then zuma-typec.dtsi, applied after it, sets the diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 05f407446d..f46ad29ecc 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -377,6 +377,36 @@ status = "disabled"; }; + usi9: usi@10c900c0 { + compatible = "google,zuma-usi", "samsung,exynos850-usi"; + reg = <0x10c900c0 0x20>; + clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI9_PCLK>, + <&cmu_peric1 CLK_GOUT_PERIC1_USI9_IPCLK>; + clock-names = "pclk", "ipclk"; + samsung,sysreg = <&sysreg_peric1 0x4>; + samsung,mode = ; + #address-cells = <1>; + #size-cells = <1>; + ranges; + status = "disabled"; + + hsi2c_9: i2c@10c90000 { + compatible = "google,zuma-hsi2c", + "samsung,exynosautov9-hsi2c"; + /* USI control starts at 0xc0; do not claim it twice. */ + reg = <0x10c90000 0xc0>; + interrupts = ; + clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI9_IPCLK>, + <&cmu_peric1 CLK_GOUT_PERIC1_USI9_PCLK>; + clock-names = "hsi2c", "hsi2c_pclk"; + pinctrl-0 = <&hsi2c9_bus>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + }; + usi11: usi@10cb00c0 { compatible = "google,zuma-usi", "samsung,exynos850-usi"; reg = <0x10cb00c0 0x20>; From 006dae5266d4fe1e73904e4099d067c734802f80 Mon Sep 17 00:00:00 2001 From: Lef Date: Sun, 1 Nov 2026 15:00:12 +0200 Subject: [PATCH 4/4] arm64: dts: exynos: google: zuma-husky: describe the pack EEPROM on hsi2c_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 #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 Assisted-by: LLM --- .../boot/dts/exynos/google/zuma-husky.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index 7a520b9854..f9d30456ae 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -311,3 +311,22 @@ }; }; }; + +/* + * The battery pack's EEPROM on USI9 / hsi2c_9 (stock: "at,24c08" at 0x50 on + * a 400 kHz bus, in the pack and powered by it). Byte 0x17 is the battery ID + * that Google's driver matches against the gauge models; the rest is the + * pack's part number, dates and history, so it is read-only here. The bus + * and USI9 stay disabled; a bring-up overlay enables them. Nothing reads the + * ID into the gauge yet. + */ +&hsi2c_9 { + clock-frequency = <400000>; + + eeprom@50 { + compatible = "atmel,24c08"; + reg = <0x50>; + pagesize = <16>; + read-only; + }; +};