diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml index 9cec4a1375..63dd322735 100644 --- a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml @@ -64,9 +64,9 @@ properties: '#clock-cells': const: 1 description: - On the Exynos SoCs, one clock per CLKOUT mux input. On the Tensor G4 - PMU (google,zumapro-pmu), clock 0 is the NFC controller's reference - clock pad. + On the Exynos SoCs, one clock per CLKOUT mux input. On the Tensor G3 + and G4 PMUs (google,zuma-pmu, google,zumapro-pmu), clock 0 is the NFC + controller's reference clock pad. clock-names: description: diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index 6ed1514cba..d4c8467cb3 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -398,6 +398,20 @@ */ &pinctrl_hsi1 { status = "okay"; + + nfc_en: nfc-en-pins { + samsung,pins = "gph1-6"; + samsung,pin-pud = ; + samsung,pin-con-pdn = ; + samsung,pin-pud-pdn = ; + }; + + nfc_pidle: nfc-pidle-pins { + samsung,pins = "gph1-3"; + samsung,pin-pud = ; + samsung,pin-con-pdn = ; + samsung,pin-pud-pdn = ; + }; }; &usi0 { @@ -421,6 +435,30 @@ cirrus,lra-redc-micro-ohms = <13000000>; cirrus,vpbr-threshold-microvolt = <3008000>; }; + + /* + * The ST54L NFC controller at 0x08 on this bus: plain NCI over I2C, + * nxp-nci's transport, as on the 9a and the zumapro-tegu node. Pins + * from the stock DT: interrupt gpa7-6, enable (the chip's RST_N) + * gph1-6, power-idle gph1-3. The pin groups are stock's and set only + * the power-down state (and the power-idle pull-down), no pin + * function. The chip's reference clock is the PMU's NFC pad (stock: + * pmu_clk_pad 0x3e84), clock 0 of the PMU node; without it the 9a's + * ST54L does not ACK its I2C address (on the 8 Pro the chip did answer + * without the pad and only found no tag, in one run). The eSE half of + * the chip (spi_12, reset gph1-5) is not described. Disabled: nothing + * binds to it until a bring-up overlay enables it. + */ + nfc: nfc@8 { + compatible = "st,st54l", "nxp,nxp-nci-i2c"; + reg = <0x08>; + clocks = <&pmu_system_controller 0>; + interrupts-extended = <&gpa7 6 IRQ_TYPE_LEVEL_HIGH>; + enable-gpios = <&gph1 6 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&nfc_en &nfc_pidle>; + pinctrl-names = "default"; + status = "disabled"; + }; }; /* diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 21c184ae87..08714c3eb9 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -730,6 +730,7 @@ pmu_system_controller: system-controller@15460000 { compatible = "google,zuma-pmu"; reg = <0x15460000 0x10000>; + #clock-cells = <1>; /* * The bootloader reads the reboot reason from SYSIP_DAT0, diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index cd3d09151a..94548afcc3 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -41,12 +41,13 @@ #define GS101_CLKOUT_EN BIT(0) /* - * Tensor G4 (zumapro) feeds the NFC controller's reference clock from a PMU - * pad as well. With EXTPAD_EN set the PMU follows the controller's clock - * request line and drives the clock onto the pad, which is how Google's - * st21nfc driver runs it (pmu_clk_pad = <0x3e84>, st,extpad_control_en); - * without it the Pixel 9a's ST54L does not ACK its I2C address. Nothing - * else about this register is known, so its source field is left alone. + * Tensor G3 (zuma) and G4 (zumapro) feed the NFC controller's reference + * clock from a PMU pad as well. With EXTPAD_EN set the PMU follows the + * controller's clock request line and drives the clock onto the pad, which + * is how Google's st21nfc driver runs it (pmu_clk_pad = <0x3e84>, + * st,extpad_control_en); without it the Pixel 9a's ST54L does not ACK its + * I2C address. Nothing else about this register is known, so its source + * field is left alone. */ #define ZUMAPRO_PAD_CTRL_NFC_CLK 0x3e84 #define ZUMAPRO_CLKOUT_EXTPAD_EN BIT(16) @@ -163,6 +164,9 @@ static const struct of_device_id exynos_clkout_ids[] = { }, { .compatible = "google,gs201-pmu", .data = &exynos_clkout_gs101, + }, { + .compatible = "google,zuma-pmu", + .data = &exynos_clkout_zumapro, }, { .compatible = "google,zumapro-pmu", .data = &exynos_clkout_zumapro, @@ -264,7 +268,7 @@ static const struct clk_ops exynos_clkout_pad_ops = { }; /* - * GS101/GS201 and Tensor G4: one gate per pad, parented to mux input 0 (the + * GS101/GS201 and Tensor G3/G4: one gate per pad, parented to mux input 0 (the * TCXO, named "clkout0" in the PMU node) where the PMU node names it; a pad * whose source the node does not describe is a root clock. The pads may be * in use by devices that Linux does not describe, so leave them as the diff --git a/drivers/soc/samsung/gs101-pmu.c b/drivers/soc/samsung/gs101-pmu.c index 9ee77754d0..a587089ad2 100644 --- a/drivers/soc/samsung/gs101-pmu.c +++ b/drivers/soc/samsung/gs101-pmu.c @@ -361,7 +361,7 @@ static const struct regmap_range zuma_pmu_registers[] = { regmap_reg_range(ZUMA_PHY_CTRL_UFS, ZUMA_PHY_CTRL_UFS), /* a hint TF-A reads, not a status register: see zuma_pmu_regmap_init() */ regmap_reg_range(ZUMA_PMU_INFORM0, ZUMA_PMU_INFORM0), - /* Tensor G4's NFC reference clock pad, a clock of clk-exynos-clkout */ + /* Tensor G3 and G4's NFC reference clock pad (clk-exynos-clkout) */ regmap_reg_range(ZUMA_PAD_CTRL_NFC_CLK, ZUMA_PAD_CTRL_NFC_CLK), };