diff --git a/Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml index 13e8b4e95a..ff8ceb9436 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml @@ -19,6 +19,9 @@ properties: - enum: - infineon,cyw43439-bt - const: brcm,bcm4329-bt + - items: + - const: brcm,bcm4398-bt + - const: brcm,bcm4389-bt - enum: - brcm,bcm20702a1 - brcm,bcm4329-bt @@ -57,7 +60,7 @@ properties: maxItems: 1 description: GPIO specifier for the clock of the flip-flop that holds BT_REG_ON on boards that latch it (the BCM4383 on the Google Pixel - 9a). BT_REG_ON only reaches the chip on a rising edge of this line. + 9a and the BCM4398 on the Pixel 8 Pro). BT_REG_ON only reaches the chip on a rising edge of this line. host-wakeup-gpios: maxItems: 1 diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.yaml b/Documentation/devicetree/bindings/serial/samsung_uart.yaml index e85a83e572..e07a3266e5 100644 --- a/Documentation/devicetree/bindings/serial/samsung_uart.yaml +++ b/Documentation/devicetree/bindings/serial/samsung_uart.yaml @@ -31,6 +31,7 @@ properties: - items: - enum: - google,gs201-uart + - google,zuma-uart - google,zumapro-uart - samsung,exynos2200-uart - const: google,gs101-uart diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 6c33a61945..b5a944604e 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -28,6 +28,7 @@ properties: - google,gs201-peric0-sysreg - google,gs201-peric1-sysreg - google,gs201-vgpio2ap-sysreg + - google,zuma-apm-sysreg - google,zuma-hsi0-sysreg - google,zuma-peric1-sysreg - google,zuma-ufs-sysreg @@ -118,6 +119,7 @@ allOf: - google,gs201-hsi2-sysreg - google,gs201-peric0-sysreg - google,gs201-peric1-sysreg + - google,zuma-apm-sysreg - google,zuma-peric1-sysreg - google,zumapro-apm-sysreg - google,zumapro-hsi0-sysreg diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index f9d30456ae..cd702a9580 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -330,3 +330,41 @@ read-only; }; }; + +/* + * Bluetooth, on the APM's USI1 UART (0x155d0000) as in Google's GPL zuma + * Bluetooth DT: BT_REG_ON gpn8-0, BT_DEV_WAKE gpn9-0, BT_HOST_WAKE gpn6-0, + * the UART pads gpa3-0 to gpa3-3 in function 2, and gpp24-3 clocking the + * flip-flop that latches BT_REG_ON (the 9a's BCM4383 has the same). + * + * The chip answers as a BCM4398D0, the Bluetooth half of the Wi-Fi combo. + * hci_bcm has no entry for it; the BCM4389's (30 ms after REG_ON) works. + * btbcm loads the stock firmware as brcm/BCM.google,zuma-husky.hcd, taken + * from the owner's own image, never shipped. Without the file the controller + * stays in its ROM state. + */ +&sysreg_apm { + status = "okay"; +}; + +&usi_apm1 { + status = "okay"; +}; + +&uart18 { + status = "okay"; + pinctrl-0 = <&uart18_bus>; + pinctrl-names = "default"; + + bluetooth { + compatible = "brcm,bcm4398-bt", "brcm,bcm4389-bt"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_power &bt_ble_dbo &bt_host_wake>; + max-speed = <3000000>; + shutdown-gpios = <&gpn8 0 GPIO_ACTIVE_HIGH>; + device-wakeup-gpios = <&gpn9 0 GPIO_ACTIVE_HIGH>; + brcm,ble-dbo-gpios = <&gpp24 3 GPIO_ACTIVE_HIGH>; + interrupts-extended = <&gpn6 0 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "host-wakeup"; + }; +}; diff --git a/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi index 2de5877971..69c1a19993 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma-pinctrl.dtsi @@ -138,6 +138,17 @@ ; }; + /* + * The APM USI1 UART (Bluetooth): gpa3-0..3 in function 2, as Google's + * uart18_bus. + */ + uart18_bus: uart18-bus-pins { + samsung,pins = "gpa3-0", "gpa3-1", "gpa3-2", "gpa3-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + key_power: key-power-pins { samsung,pins = "gpa4-0"; samsung,pin-function = ; @@ -273,6 +284,25 @@ interrupts = ; }; + /* + * Bluetooth: BT_REG_ON gpn8-0 and BT_DEV_WAKE gpn9-0, from Google's + * zuma-board-bluetooth.dtsi. + */ + bt_power: bt-power-pins { + samsung,pins = "gpn8-0", "gpn9-0"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + /* BT_HOST_WAKE: gpn6-0 as an interrupt, pulled down (function F in stock). */ + bt_host_wake: bt-host-wake-pins { + samsung,pins = "gpn6-0"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + ts_irq: ts-irq-pins { samsung,pins = "gpn0-0"; samsung,pin-function = ; @@ -459,6 +489,17 @@ samsung,pin-drv = ; }; + /* + * BT_BLE_DBO_LE: the clock of the flip-flop that latches BT_REG_ON + * (Google's bt_ble_dbo_le, an input at reset). + */ + bt_ble_dbo: bt-ble-dbo-pins { + samsung,pins = "gpp24-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + 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"; diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index f46ad29ecc..bd28448a3a 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -602,6 +602,41 @@ clock-names = "oscclk"; }; + sysreg_apm: syscon@154204e0 { + compatible = "google,zuma-apm-sysreg", "syscon"; + /* Only the USI mode selectors. */ + reg = <0x154204e0 0x8>; + clocks = <&cmu_apm CLK_GOUT_APM_SYSREG>; + status = "disabled"; + }; + + /* The APM's USI1, the UART of the Bluetooth chip on the 8 Pro. */ + usi_apm1: usi@155d00c0 { + compatible = "google,zuma-usi", "samsung,exynos850-usi"; + reg = <0x155d00c0 0x20>; + clocks = <&cmu_apm CLK_GOUT_APM_USI1_UART_PCLK>, + <&cmu_apm CLK_GOUT_APM_USI1_UART_IPCLK>; + clock-names = "pclk", "ipclk"; + samsung,sysreg = <&sysreg_apm 0x4>; + samsung,mode = ; + samsung,clkreq-on; + #address-cells = <1>; + #size-cells = <1>; + ranges; + status = "disabled"; + + uart18: serial@155d0000 { + compatible = "google,zuma-uart", "google,gs101-uart"; + reg = <0x155d0000 0xc0>; + interrupts = ; + clocks = <&cmu_apm CLK_GOUT_APM_USI1_UART_PCLK>, + <&cmu_apm CLK_GOUT_APM_USI1_UART_IPCLK>; + clock-names = "uart", "clk_uart_baud0"; + samsung,uart-fifosize = <256>; + status = "disabled"; + }; + }; + /* Writes go through EL3 (SMC), as on gs101. */ pmu_system_controller: system-controller@15460000 { compatible = "google,zuma-pmu"; diff --git a/drivers/clk/samsung/clk-zuma.c b/drivers/clk/samsung/clk-zuma.c index 8e7b12f591..4a831d69b4 100644 --- a/drivers/clk/samsung/clk-zuma.c +++ b/drivers/clk/samsung/clk-zuma.c @@ -143,6 +143,8 @@ static const struct samsung_mux_clock apm_muxes[] __initconst = { static const struct samsung_div_clock apm_dividers[] __initconst = { DIV_F(CLK_DOUT_APM_NOC, "zuma_dout_apm_noc", "zuma_gout_apm_func", 0x1808, 0, 3, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_APM_USI1_UART, "zuma_dout_apm_usi1_uart", + "zuma_gout_apm_func", 0x1818, 0, 7, 0, CLK_DIVIDER_READ_ONLY), }; static const struct samsung_gate_clock apm_ro_gates[] __initconst = { @@ -160,6 +162,14 @@ static const struct samsung_gate_clock apm_ro_gates[] __initconst = { "zuma_dout_apm_noc", 0x20dc, 21, CLK_IGNORE_UNUSED, 0), GATE(CLK_GOUT_APM_GPIO_CUSTOM_ALIVE, "zuma_gout_apm_gpio_custom_alive", "zuma_dout_apm_noc", 0x2000, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_APM_USI1_UART_IPCLK, "zuma_gout_apm_usi1_uart_ipclk", + "zuma_dout_apm_usi1_uart", 0x20f4, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_APM_USI1_UART_PCLK, "zuma_gout_apm_usi1_uart_pclk", + "zuma_dout_apm_noc", 0x20f8, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_APM_USI1_UART_RSTNSYNC, "zuma_gout_apm_usi1_uart_rstnsync", + "zuma_dout_apm_usi1_uart", 0x2148, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_APM_SYSREG, "zuma_gout_apm_sysreg", "zuma_dout_apm_noc", + 0x2168, 21, CLK_IGNORE_UNUSED, 0), }; static const struct samsung_cmu_info apm_cmu __initconst = { @@ -171,7 +181,7 @@ static const struct samsung_cmu_info apm_cmu __initconst = { .nr_div_clks = ARRAY_SIZE(apm_dividers), .ro_gate_clks = apm_ro_gates, .nr_ro_gate_clks = ARRAY_SIZE(apm_ro_gates), - .nr_clk_ids = CLK_GOUT_APM_GPIO_CUSTOM_ALIVE + 1, + .nr_clk_ids = CLK_GOUT_APM_SYSREG + 1, }; /* CMU_HSI0, 0x11000000. Firmware keeps the domain powered. */ diff --git a/include/dt-bindings/clock/google,zuma.h b/include/dt-bindings/clock/google,zuma.h index 9047729c9a..0f8b127ff9 100644 --- a/include/dt-bindings/clock/google,zuma.h +++ b/include/dt-bindings/clock/google,zuma.h @@ -55,7 +55,7 @@ #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. */ +/* CMU_APM: the APM mailbox, its SRAM, the always-on GPIO banks, the USI1 UART and the SYSREG. */ #define CLK_APM_PLL_ALV_DIV2 1 #define CLK_APM_PLL_ALV_DIV4 2 #define CLK_APM_PLL_ALV_DIV8 3 @@ -70,5 +70,10 @@ #define CLK_GOUT_APM_GPIO_ALIVE 12 #define CLK_GOUT_APM_GPIO_FAR_ALIVE 13 #define CLK_GOUT_APM_GPIO_CUSTOM_ALIVE 14 +#define CLK_DOUT_APM_USI1_UART 15 +#define CLK_GOUT_APM_USI1_UART_IPCLK 16 +#define CLK_GOUT_APM_USI1_UART_PCLK 17 +#define CLK_GOUT_APM_USI1_UART_RSTNSYNC 18 +#define CLK_GOUT_APM_SYSREG 19 #endif /* _DT_BINDINGS_CLOCK_GOOGLE_ZUMA_H */