diff --git a/Documentation/devicetree/bindings/display/samsung/google,gs201-dsim.yaml b/Documentation/devicetree/bindings/display/samsung/google,gs201-dsim.yaml index 663c43b67f..e70bda177c 100644 --- a/Documentation/devicetree/bindings/display/samsung/google,gs201-dsim.yaml +++ b/Documentation/devicetree/bindings/display/samsung/google,gs201-dsim.yaml @@ -14,14 +14,19 @@ description: pipeline. It takes pixel data from a DECON and drives up to four data lanes through a combined D-PHY/C-PHY, in video or command mode, with DSC slice packing and TE-based command scheduling. Panels are described - as child nodes. + as child nodes. The Tensor G4 (zumapro) has the same DSIM, at the same + register layout. allOf: - $ref: /schemas/display/dsi-controller.yaml# properties: compatible: - const: google,gs201-dsim + oneOf: + - const: google,gs201-dsim + - items: + - const: google,zumapro-dsim + - const: google,gs201-dsim reg: minItems: 1 diff --git a/Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml b/Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml index fbf2b14f69..a1d4603a57 100644 --- a/Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml +++ b/Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml @@ -26,6 +26,11 @@ properties: - st,st54l - const: nxp,nxp-nci-i2c + clocks: + maxItems: 1 + description: The controller's reference clock, or the SoC clock pad + that feeds it on the controller's request + enable-gpios: description: Output GPIO pin used for enabling/disabling the controller diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml index 2f273e9e5a..e9060543b9 100644 --- a/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml @@ -63,6 +63,9 @@ properties: '#clock-cells': const: 1 + description: + On the Exynos SoCs, one clock per CLKOUT mux input. On google,zuma-pmu, + clock 0 is the NFC controller's reference clock pad. clock-names: description: diff --git a/arch/arm64/boot/dts/exynos/google/zumapro-reserved-memory.dtsi b/arch/arm64/boot/dts/exynos/google/zumapro-reserved-memory.dtsi index 66157671ca..c170f24228 100644 --- a/arch/arm64/boot/dts/exynos/google/zumapro-reserved-memory.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zumapro-reserved-memory.dtsi @@ -176,10 +176,17 @@ no-map; }; - /* Reserve only; the pstore consumer is not enabled yet. */ + /* + * Stock's ramoops region. zumapro's bootloader keeps it across + * a watchdog reset (it also writes its own log at the start of + * the console zone). + */ ramoops_reserved: ramoops@fd3ff000 { + compatible = "ramoops"; reg = <0x0 0xfd3ff000 0x00400000>; no-map; + console-size = <0x200000>; + pmsg-size = <0x200000>; }; /* Not in Google's list; kept reserved until shown unused. */ diff --git a/arch/arm64/boot/dts/exynos/google/zumapro-tegu.dts b/arch/arm64/boot/dts/exynos/google/zumapro-tegu.dts index c8e150e529..5c5dac53bc 100644 --- a/arch/arm64/boot/dts/exynos/google/zumapro-tegu.dts +++ b/arch/arm64/boot/dts/exynos/google/zumapro-tegu.dts @@ -8,8 +8,11 @@ /dts-v1/; +#include #include #include +#include +#include #include "../exynos-pinctrl.h" #include "zumapro.dtsi" #include "zumapro-reserved-memory.dtsi" @@ -73,6 +76,68 @@ }; }; + /* + * The GPU's levels: the shader rates of the Pixel 9a's GPU DVFS table + * up to 890 MHz, each with its paired L2 rate through the ACPM "gpu" + * clock; gpu-thermal throttles them from 85 C. 940 MHz, the table's + * top, is left out until it has run on the 9a. + */ + gpu_opp: opp-table-gpu { + compatible = "operating-points-v2"; + + opp-150000000 { + opp-hz = /bits/ 64 <150000000>; + }; + + opp-302000000 { + opp-hz = /bits/ 64 <302000000>; + }; + + opp-337000000 { + opp-hz = /bits/ 64 <337000000>; + }; + + opp-376000000 { + opp-hz = /bits/ 64 <376000000>; + }; + + opp-419000000 { + opp-hz = /bits/ 64 <419000000>; + }; + + opp-467000000 { + opp-hz = /bits/ 64 <467000000>; + }; + + opp-521000000 { + opp-hz = /bits/ 64 <521000000>; + }; + + opp-580000000 { + opp-hz = /bits/ 64 <580000000>; + }; + + opp-649000000 { + opp-hz = /bits/ 64 <649000000>; + }; + + opp-723000000 { + opp-hz = /bits/ 64 <723000000>; + }; + + opp-807000000 { + opp-hz = /bits/ 64 <807000000>; + }; + + opp-850000000 { + opp-hz = /bits/ 64 <850000000>; + }; + + opp-890000000 { + opp-hz = /bits/ 64 <890000000>; + }; + }; + /* UFS VCC, switched by gpp0-1 as on stock. */ ufs_vcc: regulator-ufs-vcc { compatible = "regulator-fixed"; @@ -95,6 +160,15 @@ reg = <0x0 0xfac00000 0x009fc900>; no-map; }; + + /* DECON's scanout buffers, below 4 GiB for its 32-bit DMA. */ + display_pool: display-pool { + compatible = "shared-dma-pool"; + reusable; + size = <0x04000000>; + alignment = <0x0 0x00200000>; + alloc-ranges = <0x0 0x98000000 0x06000000>; + }; }; &acpm_ipc { @@ -135,6 +209,10 @@ status = "okay"; }; +&cmu_g3d { + status = "okay"; +}; + &cmu_hsi0 { status = "okay"; }; @@ -163,6 +241,52 @@ status = "okay"; }; +/* + * DECON0 scans out to DSIM0, so gs-decon can switch the link and the + * panel between 60 and 120 Hz. + */ +&decon0 { + memory-region = <&display_pool>, <&cont_splash_mem>; + memory-region-names = "pool", "boot-framebuffer"; + status = "okay"; + + port { + decon0_out: endpoint { + remote-endpoint = <&dsi0_in>; + }; + }; +}; + +&dsi0 { + status = "okay"; + + panel@0 { + compatible = "google,tg4c"; + reg = <0>; + }; + + port { + dsi0_in: endpoint { + remote-endpoint = <&decon0_out>; + }; + }; +}; + +/* + * The ST54L's chip enable (gpa0-1) powers the whole chip, NFC and its + * secure element; stock's eSE driver raises it at probe + * (ese_chip_enable-gpio in Google's GPL zuma-tegu-ese.dtsi). Nothing here + * drives the eSE, so hold it high. + */ +&gpa0 { + nfc-chip-enable-hog { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "nfc-chip-enable"; + }; +}; + /* The keys' banks and the touchscreen's raise their own interrupts. */ &gpa4 { interrupt-controller; @@ -182,14 +306,155 @@ ; }; +/* The NFC controller's interrupt (gpa7-5). */ +&gpa7 { + interrupt-controller; + #interrupt-cells = <2>; + interrupts = , + , + , + , + , + , + , + ; +}; + +/* The USB-C port controller's interrupt (gpa8-3). */ +&gpa8 { + interrupt-controller; + #interrupt-cells = <2>; + interrupts = , + , + , + ; +}; + &gpn0 { interrupt-controller; #interrupt-cells = <2>; interrupts = ; }; +/* + * The GPU's core clock is ACPM's paired "gpu" clock, which sets the shader + * (G3D) and L2 (G3DL2) domains together; coregroup and stacks stay on + * CMU_G3D's gates. + */ +&gpu { + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_GPU>, + <&cmu_g3d CLK_GOUT_G3D_COREGROUP>, + <&cmu_g3d CLK_GOUT_G3D_STACKS>; + operating-points-v2 = <&gpu_opp>; + status = "okay"; +}; + +/* The torch: a TI LM3644 flash driver, both LED outputs on one white LED. */ +&hsi2c4 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&hsi2c4_bus>; + status = "okay"; + + led-controller@63 { + compatible = "ti,lm3644"; + reg = <0x63>; + enable-gpios = <&gpp24 1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&torch_enable>; + + led { + function = LED_FUNCTION_TORCH; + color = ; + led-sources = <1 2>; + /* A dim flashlight, far below the part's and the LED's limits. */ + led-max-microamp = <75000>; + }; + }; +}; + +/* + * The MAX77779's bus: its fuel gauge and its USB-C port controller, a sink + * with no link to the USB controller's role yet. + */ +&hsi2c6 { + clock-frequency = <950000>; + pinctrl-names = "default"; + pinctrl-0 = <&hsi2c6_bus>; + status = "okay"; + + usb_tcpc: tcpc@25 { + compatible = "maxim,max77779-tcpc"; + reg = <0x25>; + interrupt-parent = <&gpa8>; + interrupts = <3 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_pd_irq>; + + connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + power-role = "sink"; + self-powered; + op-sink-microwatt = <2600000>; + sink-pdos = ; + }; + }; + + fuel_gauge: fuel-gauge@36 { + compatible = "maxim,max77779-fg"; + reg = <0x36>; + shunt-resistor-micro-ohms = <2000>; + }; +}; + +/* The haptics: a CS40L26 on the 9a's LRA, with Google's limits for it. */ +&hsi2c9 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&hsi2c9_bus>; + status = "okay"; + + haptic-driver@43 { + compatible = "cirrus,cs40l26a"; + reg = <0x43>; + interrupt-parent = <&gpa6>; + interrupts = <3 IRQ_TYPE_LEVEL_LOW>; + reset-gpios = <&gph2 3 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&haptic_reset>; + cirrus,boost-peak-microamp = <2500000>; + cirrus,boost-ctl-microvolt = <10000000>; + cirrus,lra-f0-hz = <162>; + cirrus,lra-redc-micro-ohms = <14100007>; + cirrus,vpbr-threshold-microvolt = <3008000>; + }; + + /* + * The ST54L NFC controller: plain NCI over I2C, nxp-nci's transport. + * Its "enable" line is the chip's RST_N; the PMU's clock pad gives it + * its reference clock. + */ + nfc@8 { + compatible = "st,st54l", "nxp,nxp-nci-i2c"; + reg = <0x08>; + clocks = <&pmu_system_controller 0>; + interrupt-parent = <&gpa7>; + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; + enable-gpios = <&gph1 6 GPIO_ACTIVE_HIGH>; + }; +}; + &pinctrl_alive { status = "okay"; + + usb_pd_irq: usb-pd-irq-pins { + samsung,pins = "gpa8-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; }; &pinctrl_custom_alive { @@ -202,6 +467,13 @@ &pinctrl_hsi1 { status = "okay"; + + haptic_reset: haptic-reset-pins { + samsung,pins = "gph2-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; }; &pinctrl_hsi2 { @@ -215,6 +487,20 @@ &pinctrl_peric0 { status = "okay"; + hsi2c4_bus: hsi2c4-bus-pins { + samsung,pins = "gpp8-0", "gpp8-1"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; + + hsi2c6_bus: hsi2c6-bus-pins { + samsung,pins = "gpp12-0", "gpp12-1"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; + touch_reset_held: touch-reset-held-pins { samsung,pins = "gpp1-1"; samsung,pin-function = ; @@ -224,6 +510,39 @@ &pinctrl_peric1 { status = "okay"; + + hsi2c9_bus: hsi2c9-bus-pins { + samsung,pins = "gpp19-4", "gpp19-5"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; + + spi21_bus: spi21-bus-pins { + samsung,pins = "gpp22-0", "gpp22-1", "gpp22-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <3>; + }; + + spi21_miso: spi21-miso-pins { + samsung,pins = "gpp22-2"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <3>; + }; + + torch_enable: torch-enable-pins { + samsung,pins = "gpp24-1"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = <0>; + }; +}; + +&spi21 { + pinctrl-names = "default"; + pinctrl-0 = <&spi21_bus &spi21_miso>; }; &pmu_system_controller { @@ -321,6 +640,18 @@ status = "okay"; }; +&usi4 { + status = "okay"; +}; + +&usi6 { + status = "okay"; +}; + +&usi9 { + status = "okay"; +}; + &watchdog_cl0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi index 10b018b180..f8be1721dd 100644 --- a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi @@ -7,6 +7,7 @@ */ #include +#include #include #include @@ -104,6 +105,11 @@ compatible = "arm,cortex-a520"; reg = <0x000>; enable-method = "psci"; + capacity-dmips-mhz = <193>; + dynamic-power-coefficient = <70>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL0>; + operating-points-v2 = <&cpucl0_opp>; }; cpu1: cpu@100 { @@ -111,6 +117,11 @@ compatible = "arm,cortex-a520"; reg = <0x100>; enable-method = "psci"; + capacity-dmips-mhz = <193>; + dynamic-power-coefficient = <70>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL0>; + operating-points-v2 = <&cpucl0_opp>; }; cpu2: cpu@200 { @@ -118,6 +129,11 @@ compatible = "arm,cortex-a520"; reg = <0x200>; enable-method = "psci"; + capacity-dmips-mhz = <193>; + dynamic-power-coefficient = <70>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL0>; + operating-points-v2 = <&cpucl0_opp>; }; cpu3: cpu@300 { @@ -125,6 +141,11 @@ compatible = "arm,cortex-a520"; reg = <0x300>; enable-method = "psci"; + capacity-dmips-mhz = <193>; + dynamic-power-coefficient = <70>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL0>; + operating-points-v2 = <&cpucl0_opp>; }; cpu4: cpu@400 { @@ -132,6 +153,11 @@ compatible = "arm,cortex-a720"; reg = <0x400>; enable-method = "psci"; + capacity-dmips-mhz = <927>; + dynamic-power-coefficient = <513>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL1>; + operating-points-v2 = <&cpucl1_opp>; }; cpu5: cpu@500 { @@ -139,6 +165,11 @@ compatible = "arm,cortex-a720"; reg = <0x500>; enable-method = "psci"; + capacity-dmips-mhz = <927>; + dynamic-power-coefficient = <513>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL1>; + operating-points-v2 = <&cpucl1_opp>; }; cpu6: cpu@600 { @@ -146,6 +177,11 @@ compatible = "arm,cortex-a720"; reg = <0x600>; enable-method = "psci"; + capacity-dmips-mhz = <927>; + dynamic-power-coefficient = <513>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL1>; + operating-points-v2 = <&cpucl1_opp>; }; cpu7: cpu@700 { @@ -153,6 +189,11 @@ compatible = "arm,cortex-x4"; reg = <0x700>; enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <757>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMAPRO_CLK_ACPM_DVFS_CPUCL2>; + operating-points-v2 = <&cpucl2_opp>; }; }; @@ -214,6 +255,342 @@ mboxes = <&ap2apm_mailbox>; shmem = <&apm_sram>; status = "disabled"; + + acpm_tmu: thermal-sensor { + compatible = "google,zumapro-acpm-tmu"; + #thermal-sensor-cells = <1>; + }; + }; + }; + + /* + * CPU levels: the APM firmware's own DVFS levels, read on the Pixel 9a + * (the little cluster's 324 and 610 MHz are below stock's 820 MHz + * floor), up to the 9a's thermal headroom: the levels above each table's + * top, listed in it, are left out for that board. A board with more + * headroom can add them. The little cluster stops at 1950 MHz, Google's + * max-freq for it. + */ + cpucl0_opp: opp-table-cpucl0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-324000000 { + opp-hz = /bits/ 64 <324000000>; + }; + + opp-610000000 { + opp-hz = /bits/ 64 <610000000>; + }; + + opp-820000000 { + opp-hz = /bits/ 64 <820000000>; + }; + + opp-955000000 { + opp-hz = /bits/ 64 <955000000>; + }; + + opp-1098000000 { + opp-hz = /bits/ 64 <1098000000>; + }; + + opp-1197000000 { + opp-hz = /bits/ 64 <1197000000>; + }; + + opp-1328000000 { + opp-hz = /bits/ 64 <1328000000>; + }; + + opp-1425000000 { + opp-hz = /bits/ 64 <1425000000>; + }; + + opp-1548000000 { + opp-hz = /bits/ 64 <1548000000>; + }; + + opp-1696000000 { + opp-hz = /bits/ 64 <1696000000>; + }; + + opp-1849000000 { + opp-hz = /bits/ 64 <1849000000>; + }; + + opp-1950000000 { + opp-hz = /bits/ 64 <1950000000>; + }; + + }; + + cpucl1_opp: opp-table-cpucl1 { + compatible = "operating-points-v2"; + opp-shared; + + opp-357000000 { + opp-hz = /bits/ 64 <357000000>; + }; + + opp-578000000 { + opp-hz = /bits/ 64 <578000000>; + }; + + opp-648000000 { + opp-hz = /bits/ 64 <648000000>; + }; + + opp-787000000 { + opp-hz = /bits/ 64 <787000000>; + }; + + opp-910000000 { + opp-hz = /bits/ 64 <910000000>; + }; + + opp-1065000000 { + opp-hz = /bits/ 64 <1065000000>; + }; + + opp-1221000000 { + opp-hz = /bits/ 64 <1221000000>; + }; + + opp-1328000000 { + opp-hz = /bits/ 64 <1328000000>; + }; + + opp-1418000000 { + opp-hz = /bits/ 64 <1418000000>; + }; + + opp-1549000000 { + opp-hz = /bits/ 64 <1549000000>; + }; + + opp-1795000000 { + opp-hz = /bits/ 64 <1795000000>; + }; + + opp-1945000000 { + opp-hz = /bits/ 64 <1945000000>; + }; + + opp-2130000000 { + opp-hz = /bits/ 64 <2130000000>; + }; + + opp-2245000000 { + opp-hz = /bits/ 64 <2245000000>; + }; + + opp-2367000000 { + opp-hz = /bits/ 64 <2367000000>; + }; + + /* 2450 and 2600 MHz stay off: above the cluster's thermal headroom. */ + }; + + cpucl2_opp: opp-table-cpucl2 { + compatible = "operating-points-v2"; + opp-shared; + + opp-700000000 { + opp-hz = /bits/ 64 <700000000>; + }; + + opp-1164000000 { + opp-hz = /bits/ 64 <1164000000>; + }; + + opp-1396000000 { + opp-hz = /bits/ 64 <1396000000>; + }; + + opp-1557000000 { + opp-hz = /bits/ 64 <1557000000>; + }; + + opp-1745000000 { + opp-hz = /bits/ 64 <1745000000>; + }; + + opp-1885000000 { + opp-hz = /bits/ 64 <1885000000>; + }; + + opp-1999000000 { + opp-hz = /bits/ 64 <1999000000>; + }; + + opp-2147000000 { + opp-hz = /bits/ 64 <2147000000>; + }; + + opp-2294000000 { + opp-hz = /bits/ 64 <2294000000>; + }; + + opp-2363000000 { + opp-hz = /bits/ 64 <2363000000>; + }; + + opp-2499000000 { + opp-hz = /bits/ 64 <2499000000>; + }; + + opp-2687000000 { + opp-hz = /bits/ 64 <2687000000>; + }; + + /* + * 2802, 2914, 2943, 2970, 3015 and 3105 MHz stay off: above the + * cluster's thermal headroom. + */ + }; + + thermal-zones { + big-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 0>; + + trips { + big_alert: big-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + big_hot: big-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + big_crit: big-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&big_alert>; + cooling-device = <&cpu7 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&big_hot>; + cooling-device = <&cpu7 11 0xffffffff>; + }; + }; + }; + + mid-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 1>; + + trips { + mid_alert: mid-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + mid_hot: mid-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + mid_crit: mid-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&mid_alert>; + cooling-device = <&cpu4 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&mid_hot>; + cooling-device = <&cpu4 14 0xffffffff>; + }; + }; + }; + + little-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 2>; + + trips { + little_alert: little-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + little_hot: little-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + little_crit: little-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&little_alert>; + cooling-device = <&cpu0 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&little_hot>; + cooling-device = <&cpu0 11 0xffffffff>; + }; + }; + }; + + gpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <2000>; + thermal-sensors = <&acpm_tmu 3>; + + trips { + gpu_alert: gpu-alert { + temperature = <85000>; + hysteresis = <5000>; + type = "passive"; + }; + + gpu_crit: gpu-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + /* panthor's devfreq cooling: step_wise walks the GPU down its OPPs. */ + cooling-maps { + map0 { + trip = <&gpu_alert>; + cooling-device = <&gpu 0xffffffff 0xffffffff>; + }; + }; }; }; @@ -598,6 +975,33 @@ }; }; + usi10: usi@10ca00c0 { + compatible = "google,zumapro-usi", "samsung,exynos850-usi"; + reg = <0x0 0x10ca00c0 0x20>; + clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI10_PCLK>, + <&cmu_peric1 CLK_GOUT_PERIC1_USI10_IPCLK>; + clock-names = "pclk", "ipclk"; + samsung,sysreg = <&sysreg_peric1 0x8>; + samsung,mode = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x10ca0000 0x0 0x10ca0000 0x1000>; + status = "disabled"; + + hsi2c10: i2c@10ca0000 { + compatible = "google,zumapro-hsi2c", + "samsung,exynosautov9-hsi2c"; + reg = <0x10ca0000 0xc0>; + interrupts = ; + clocks = <&cmu_peric1 CLK_GOUT_PERIC1_USI10_IPCLK>, + <&cmu_peric1 CLK_GOUT_PERIC1_USI10_PCLK>; + clock-names = "hsi2c", "hsi2c_pclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + }; + cmu_hsi0: clock-controller@11000000 { compatible = "google,zumapro-cmu-hsi0"; reg = <0x0 0x11000000 0x8000>; @@ -938,6 +1342,7 @@ pmu_system_controller: system-controller@15460000 { compatible = "google,zumapro-pmu", "google,zuma-pmu"; reg = <0x0 0x15460000 0x10000>; + #clock-cells = <1>; status = "disabled"; reboot_mode: reboot-mode { @@ -1080,6 +1485,18 @@ }; }; + dsi0: dsi@19440000 { + compatible = "google,zumapro-dsim", "google,gs201-dsim"; + reg = <0x0 0x19440000 0x300>, + <0x0 0x19460100 0x700>, + <0x0 0x19460000 0x100>; + reg-names = "dsi", "dphy", "dphy-extra"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + /* Scans out what the bootloader set up; no panel or clock control. */ decon0: display-controller@19470000 { compatible = "google,zumapro-decon"; @@ -1115,6 +1532,7 @@ <&cmu_g3d CLK_GOUT_G3D_COREGROUP>, <&cmu_g3d CLK_GOUT_G3D_STACKS>; clock-names = "core", "coregroup", "stacks"; + #cooling-cells = <2>; status = "disabled"; }; diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index 92ce096e9b..6d81a97784 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -13,6 +13,7 @@ */ #include +#include #include #include #include @@ -277,6 +278,7 @@ static int nxp_nci_i2c_probe(struct i2c_client *client) struct device *dev = &client->dev; struct nxp_nci_i2c_phy *phy; unsigned long irqflags; + struct clk *clk; int r; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { @@ -308,6 +310,11 @@ static int nxp_nci_i2c_probe(struct i2c_client *client) return PTR_ERR(phy->gpiod_fw); } + /* a reference clock (or its pad's enable) the controller asks for */ + clk = devm_clk_get_optional_enabled(dev, NULL); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "Failed to get the clock\n"); + r = nxp_nci_probe(phy, &client->dev, &i2c_phy_ops, NXP_NCI_I2C_MAX_PAYLOAD, &phy->ndev); if (r < 0) diff --git a/drivers/soc/samsung/gs101-pmu.c b/drivers/soc/samsung/gs101-pmu.c index e357744d4a..e70ceb9c20 100644 --- a/drivers/soc/samsung/gs101-pmu.c +++ b/drivers/soc/samsung/gs101-pmu.c @@ -7,7 +7,10 @@ #include #include +#include #include +#include +#include #include #include #include @@ -343,6 +346,8 @@ const struct exynos_pmu_data gs101_pmu_data = { #define ZUMA_CLUSTER1_NONCPU_INT_EN 0x1544 #define ZUMA_HSI0_STATUS 0x2a84 #define ZUMA_PHY_CTRL_UFS 0x3ec0 +#define ZUMA_NFC_CLK_PAD 0x3e84 +#define ZUMA_NFC_CLK_PAD_EXTPAD_EN BIT(16) static const struct regmap_range zuma_pmu_registers[] = { /* reboot mode */ @@ -360,6 +365,8 @@ 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), + /* the NFC controller's clock pad: see zuma_pmu_nfc_pad_ops */ + regmap_reg_range(ZUMA_NFC_CLK_PAD, ZUMA_NFC_CLK_PAD), }; static const struct regmap_range zuma_pmu_ro_registers[] = { @@ -386,6 +393,77 @@ static const struct regmap_access_table zuma_pmu_wr_table = { * INVALID_PARAMETERS) until the kernel allows C2 in PMU_INFORM0, as Google's * exynos-cpupm does once at init. */ +/* + * The NFC controller's reference clock pad (clock 0 of the PMU): with + * EXTPAD_EN set the PMU follows the controller's CLK_REQ line and feeds it + * the pad clock, as Google's st21nfc driver sets it (pmu_clk_pad 0x3e84, + * st,extpad_control_en). Without it the Pixel 9a's ST54L answers NCI but + * never finds a card. + */ +struct zuma_pmu_clk_pad { + struct clk_hw hw; + struct regmap *regmap; +}; + +static int zuma_pmu_nfc_pad_enable(struct clk_hw *hw) +{ + struct zuma_pmu_clk_pad *pad = container_of(hw, struct zuma_pmu_clk_pad, hw); + + return regmap_set_bits(pad->regmap, ZUMA_NFC_CLK_PAD, + ZUMA_NFC_CLK_PAD_EXTPAD_EN); +} + +static void zuma_pmu_nfc_pad_disable(struct clk_hw *hw) +{ + struct zuma_pmu_clk_pad *pad = container_of(hw, struct zuma_pmu_clk_pad, hw); + + regmap_clear_bits(pad->regmap, ZUMA_NFC_CLK_PAD, + ZUMA_NFC_CLK_PAD_EXTPAD_EN); +} + +static int zuma_pmu_nfc_pad_is_enabled(struct clk_hw *hw) +{ + struct zuma_pmu_clk_pad *pad = container_of(hw, struct zuma_pmu_clk_pad, hw); + + return regmap_test_bits(pad->regmap, ZUMA_NFC_CLK_PAD, + ZUMA_NFC_CLK_PAD_EXTPAD_EN); +} + +static const struct clk_ops zuma_pmu_nfc_pad_ops = { + .enable = zuma_pmu_nfc_pad_enable, + .disable = zuma_pmu_nfc_pad_disable, + .is_enabled = zuma_pmu_nfc_pad_is_enabled, +}; + +static int zuma_pmu_register_clks(struct device *dev, struct regmap *regmap) +{ + struct clk_init_data init = { + .name = "zuma_pmu_nfc_clk_pad", + .ops = &zuma_pmu_nfc_pad_ops, + }; + struct clk_hw_onecell_data *data; + struct zuma_pmu_clk_pad *pad; + int ret; + + if (!of_property_present(dev->of_node, "#clock-cells")) + return 0; + + pad = devm_kzalloc(dev, sizeof(*pad), GFP_KERNEL); + data = devm_kzalloc(dev, struct_size(data, hws, 1), GFP_KERNEL); + if (!pad || !data) + return -ENOMEM; + + pad->regmap = regmap; + pad->hw.init = &init; + ret = devm_clk_hw_register(dev, &pad->hw); + if (ret) + return ret; + + data->num = 1; + data->hws[0] = &pad->hw; + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, data); +} + static void zuma_pmu_regmap_init(struct device *dev, struct regmap *regmap) { int ret; @@ -393,6 +471,10 @@ static void zuma_pmu_regmap_init(struct device *dev, struct regmap *regmap) ret = regmap_write(regmap, ZUMA_PMU_INFORM0, ZUMA_PMU_ALLOWED_C2); if (ret) dev_warn(dev, "failed to allow C2 in PMU_INFORM0: %d\n", ret); + + ret = zuma_pmu_register_clks(dev, regmap); + if (ret) + dev_warn(dev, "failed to register the PMU clocks: %d\n", ret); } /*