diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 21c184ae87..4c4b5f511a 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -595,6 +595,37 @@ }; }; + /* + * USI3 on HSI0: the SPI of the Pixel 8 Pro's GNSS receiver (Google's + * spi_21). Same layout as USI2 above. + */ + usi3_hsi0: usi@111e00c0 { + compatible = "google,zuma-usi", "samsung,exynos850-usi"; + reg = <0x111e00c0 0x20>; + clocks = <&cmu_hsi0 CLK_GOUT_HSI0_USI3_PCLK>, + <&cmu_hsi0 CLK_GOUT_HSI0_USI3_IP>; + clock-names = "pclk", "ipclk"; + samsung,sysreg = <&sysreg_hsi0 0x1020>; + samsung,mode = ; + #address-cells = <1>; + #size-cells = <1>; + ranges; + status = "disabled"; + + spi21: spi@111e0000 { + compatible = "google,zuma-spi", "google,gs101-spi"; + /* USI control starts at 0xc0; do not claim it twice. */ + reg = <0x111e0000 0xc0>; + interrupts = ; + clocks = <&cmu_hsi0 CLK_GOUT_HSI0_USI3_PCLK>, + <&cmu_hsi0 CLK_GOUT_HSI0_USI3_IP>; + clock-names = "spi", "spi_busclk0"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + }; + /* * The DWC3 controller, in peripheral mode as on stock (which * wraps it in Google's exynos9-dwusb glue). On a normal boot diff --git a/drivers/clk/samsung/clk-zuma.c b/drivers/clk/samsung/clk-zuma.c index 833d676e8b..03648acdb1 100644 --- a/drivers/clk/samsung/clk-zuma.c +++ b/drivers/clk/samsung/clk-zuma.c @@ -220,11 +220,15 @@ static const struct samsung_mux_clock hsi0_muxes[] __initconst = { mout_hsi0_peri_user_parents, 0x680, 4, 1, 0, CLK_MUX_READ_ONLY), MUX_F(CLK_MOUT_HSI0_USI2, "zuma_mout_hsi0_usi2", mout_hsi0_usi2_parents, 0x101c, 0, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_HSI0_USI3, "zuma_mout_hsi0_usi3", mout_hsi0_usi2_parents, + 0x1020, 0, 1, 0, CLK_MUX_READ_ONLY), }; static const struct samsung_div_clock hsi0_dividers[] __initconst = { DIV(CLK_DOUT_HSI0_USI2, "zuma_dout_hsi0_usi2", "zuma_gout_hsi0_usi2_source", 0x181c, 0, 4), + DIV(CLK_DOUT_HSI0_USI3, "zuma_dout_hsi0_usi3", + "zuma_gout_hsi0_usi3_source", 0x1820, 0, 4), }; static const struct samsung_gate_clock hsi0_gates[] __initconst = { @@ -235,6 +239,13 @@ static const struct samsung_gate_clock hsi0_gates[] __initconst = { CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0), GATE(CLK_GOUT_HSI0_USI2_PCLK, "zuma_gout_hsi0_usi2_pclk", "zuma_mout_hsi0_noc_local", 0x2100, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_HSI0_USI3_SOURCE, "zuma_gout_hsi0_usi3_source", + "zuma_mout_hsi0_usi3", 0x2124, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_HSI0_USI3_IP, "zuma_gout_hsi0_usi3_ip", + "zuma_dout_hsi0_usi3", 0x2104, 21, + CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_HSI0_USI3_PCLK, "zuma_gout_hsi0_usi3_pclk", + "zuma_mout_hsi0_noc_local", 0x2108, 21, CLK_IGNORE_UNUSED, 0), }; /* Firmware-owned gates are observed, never switched. */ @@ -243,9 +254,9 @@ static const struct samsung_gate_clock hsi0_ro_gates[] __initconst = { 0x204c, 21, CLK_IGNORE_UNUSED, 0), }; -/* USI2's gates run in manual mode; the rest of HSI0 is left alone. */ +/* The USI2 and USI3 gates run in manual mode; the rest of HSI0 is left alone. */ static const unsigned long hsi0_regs[] __initconst = { - 0x2120, 0x20fc, 0x2100, + 0x2120, 0x20fc, 0x2100, 0x2124, 0x2104, 0x2108, }; static const struct samsung_cmu_info hsi0_cmu __initconst = { @@ -257,7 +268,7 @@ static const struct samsung_cmu_info hsi0_cmu __initconst = { .nr_gate_clks = ARRAY_SIZE(hsi0_gates), .ro_gate_clks = hsi0_ro_gates, .nr_ro_gate_clks = ARRAY_SIZE(hsi0_ro_gates), - .nr_clk_ids = CLK_GOUT_HSI0_USI2_PCLK + 1, + .nr_clk_ids = CLK_GOUT_HSI0_USI3_PCLK + 1, .clk_regs = hsi0_regs, .nr_clk_regs = ARRAY_SIZE(hsi0_regs), .clk_name = "bus", diff --git a/include/dt-bindings/clock/google,zuma.h b/include/dt-bindings/clock/google,zuma.h index a226cae5a7..05db2859f4 100644 --- a/include/dt-bindings/clock/google,zuma.h +++ b/include/dt-bindings/clock/google,zuma.h @@ -33,7 +33,7 @@ #define CLK_DOUT_PERIC0_NOC 26 #define CLK_DOUT_PERIC0_IP 27 -/* CMU_HSI0: USI2, the touchscreen's SPI. */ +/* CMU_HSI0: USI2, the touchscreen's SPI, and USI3, the GNSS receiver's SPI. */ #define CLK_GOUT_HSI0_ALT 1 #define CLK_MOUT_HSI0_NOC_USER 2 #define CLK_MOUT_HSI0_ALT_USER 3 @@ -44,6 +44,11 @@ #define CLK_DOUT_HSI0_USI2 8 #define CLK_GOUT_HSI0_USI2_IP 9 #define CLK_GOUT_HSI0_USI2_PCLK 10 +#define CLK_MOUT_HSI0_USI3 11 +#define CLK_GOUT_HSI0_USI3_SOURCE 12 +#define CLK_DOUT_HSI0_USI3 13 +#define CLK_GOUT_HSI0_USI3_IP 14 +#define CLK_GOUT_HSI0_USI3_PCLK 15 /* * CMU_PERIC1: USI11, the I2C bus of the battery, charger and USB-C chips, and