diff --git a/Documentation/devicetree/bindings/clock/google,zumapro-clock.yaml b/Documentation/devicetree/bindings/clock/google,zumapro-clock.yaml index 88938509f8..21acd90941 100644 --- a/Documentation/devicetree/bindings/clock/google,zumapro-clock.yaml +++ b/Documentation/devicetree/bindings/clock/google,zumapro-clock.yaml @@ -15,6 +15,13 @@ description: | CMU_MISC supplies the firmware-owned watchdog bus clock paths. CMU_HSI0 supplies the USB, eUSB2 PHY and touchscreen USI2 clocks; its ALT and TCXO inputs are board-level fixed clocks. + CMU_G3D supplies the GPU's core, coregroup and stacks clocks from its two + PLLs and CMU_TOP's G3D NoC, global and switch clocks. + CMU_HSI1 supplies the HSI1 GPIO bank's clock; its ALT input is a + board-level fixed clock. + CMU_PERIC1 supplies the PERIC1 GPIO bank and USI9 (the I2C bus of the + NFC controller and the haptics driver) from CMU_TOP's PERIC1 NoC and IP + clocks. The external oscillator supplies the PLL reference and oscillator mux paths. Clock identifiers are defined in dt-bindings/clock/google,zumapro.h. @@ -23,9 +30,12 @@ properties: compatible: enum: - google,zumapro-cmu-top + - google,zumapro-cmu-g3d - google,zumapro-cmu-hsi0 + - google,zumapro-cmu-hsi1 - google,zumapro-cmu-hsi2 - google,zumapro-cmu-peric0 + - google,zumapro-cmu-peric1 - google,zumapro-cmu-misc reg: @@ -85,9 +95,50 @@ allOf: - const: peri - const: alt - const: tcxo - else: + - if: + properties: + compatible: + const: google,zumapro-cmu-hsi1 + then: + properties: + clocks: + items: + - description: External oscillator reference clock + - description: HSI1 NoC clock from CMU_TOP + - description: HSI1 ALT input clock + clock-names: + items: + - const: oscclk + - const: bus + - const: alt + - if: + properties: + compatible: + not: + enum: + - google,zumapro-cmu-hsi0 + - google,zumapro-cmu-hsi1 + then: properties: power-domains: false + - if: + properties: + compatible: + const: google,zumapro-cmu-g3d + then: + properties: + clocks: + items: + - description: External oscillator reference clock + - description: G3D NoC clock from CMU_TOP + - description: G3D global clock from CMU_TOP + - description: G3D switch clock from CMU_TOP + clock-names: + items: + - const: oscclk + - const: bus + - const: glb + - const: switch - if: properties: compatible: @@ -106,6 +157,22 @@ allOf: - const: bus - const: ufs - const: pcie + - if: + properties: + compatible: + const: google,zumapro-cmu-peric1 + then: + properties: + clocks: + items: + - description: External oscillator reference clock + - description: PERIC1 NoC clock from CMU_TOP + - description: PERIC1 USI input clock from CMU_TOP + clock-names: + items: + - const: oscclk + - const: bus + - const: ip - if: properties: compatible: @@ -171,5 +238,30 @@ examples: clocks = <&oscclk>, <&cmu_top CLK_DOUT_PERIC0_NOC>; clock-names = "oscclk", "bus"; }; -... + clock-controller@12000000 { + compatible = "google,zumapro-cmu-hsi1"; + reg = <0x12000000 0x8000>; + #clock-cells = <1>; + clocks = <&oscclk>, <&cmu_top CLK_DOUT_HSI1_NOC>, <&hsi1_alt>; + clock-names = "oscclk", "bus", "alt"; + }; + + clock-controller@10c00000 { + compatible = "google,zumapro-cmu-peric1"; + reg = <0x10c00000 0x8000>; + #clock-cells = <1>; + clocks = <&oscclk>, <&cmu_top CLK_DOUT_PERIC1_NOC>, + <&cmu_top CLK_DOUT_PERIC1_IP>; + clock-names = "oscclk", "bus", "ip"; + }; + + clock-controller@1ee00000 { + compatible = "google,zumapro-cmu-g3d"; + reg = <0x1ee00000 0x8000>; + #clock-cells = <1>; + clocks = <&oscclk>, <&cmu_top CLK_DOUT_G3D_NOCD>, + <&cmu_top CLK_DOUT_G3D_GLB>, <&cmu_top CLK_DOUT_G3D_SWITCH>; + clock-names = "oscclk", "bus", "glb", "switch"; + }; +... diff --git a/drivers/clk/samsung/clk-zumapro.c b/drivers/clk/samsung/clk-zumapro.c index 4a78ccb97e..e384d60055 100644 --- a/drivers/clk/samsung/clk-zumapro.c +++ b/drivers/clk/samsung/clk-zumapro.c @@ -37,6 +37,10 @@ static const struct samsung_pll_clock top_plls[] __initconst = { }; static const struct samsung_fixed_factor_clock top_factors[] __initconst = { + FFACTOR(CLK_SHARED0_D2, "zumapro_shared0_d2", "zumapro_shared0", 1, 2, 0), + FFACTOR(CLK_SHARED0_D3, "zumapro_shared0_d3", "zumapro_shared0", 1, 3, 0), + FFACTOR(CLK_SHARED1_D2, "zumapro_shared1_d2", "zumapro_shared1", 1, 2, 0), + FFACTOR(CLK_SHARED1_D3, "zumapro_shared1_d3", "zumapro_shared1", 1, 3, 0), FFACTOR(CLK_SHARED0_D4, "zumapro_shared0_d4", "zumapro_shared0", 1, 4, 0), FFACTOR(CLK_SHARED1_D4, "zumapro_shared1_d4", "zumapro_shared1", 1, 4, 0), FFACTOR(CLK_SHARED2_D2, "zumapro_shared2_d2", "zumapro_shared2", 1, 2, 0), @@ -60,6 +64,18 @@ PNAME(peric0_noc_parents) = { "zumapro_spare", }; +PNAME(g3d_glb_parents) = { + "zumapro_shared0_d2", "zumapro_shared1_d2", "zumapro_shared2", + "zumapro_shared3", "zumapro_shared0_d3", "zumapro_shared1_d3", + "zumapro_shared0_d4", "zumapro_spare", +}; + +PNAME(g3d_switch_parents) = { + "zumapro_shared2", "zumapro_shared0_d3", "zumapro_shared3", + "zumapro_shared1_d3", "zumapro_shared0_d4", "zumapro_shared1_d4", + "zumapro_spare", "zumapro_spare", +}; + static const struct samsung_mux_clock top_muxes[] __initconst = { MUX_F(CLK_MOUT_HSI2_NOC, "zumapro_mout_hsi2_noc", hsi2_noc_parents, 0x10b0, 0, 3, 0, CLK_MUX_READ_ONLY), @@ -75,6 +91,18 @@ static const struct samsung_mux_clock top_muxes[] __initconst = { 0x10b4, 0, 1, 0, CLK_MUX_READ_ONLY), MUX_F(CLK_MOUT_MISC_NOC, "zumapro_mout_misc_noc", peric0_noc_parents, 0x10d0, 0, 2, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_GLB, "zumapro_mout_g3d_glb", g3d_glb_parents, + 0x106c, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_NOCD, "zumapro_mout_g3d_nocd", g3d_glb_parents, + 0x1070, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_SWITCH, "zumapro_mout_g3d_switch", g3d_switch_parents, + 0x1074, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_HSI1_NOC, "zumapro_mout_hsi1_noc", hsi2_noc_parents, + 0x10a4, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_PERIC1_NOC, "zumapro_mout_peric1_noc", peric0_noc_parents, + 0x10f8, 0, 2, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_PERIC1_IP, "zumapro_mout_peric1_ip", peric0_noc_parents, + 0x10f4, 0, 2, 0, CLK_MUX_READ_ONLY), }; /* The hardware order is mux -> gate -> divider. */ @@ -97,6 +125,18 @@ static const struct samsung_gate_clock top_ro_gates[] __initconst = { 0x20bc, 21, CLK_IGNORE_UNUSED, 0), GATE(CLK_GOUT_HSI0_PERI, "zumapro_gout_hsi0_peri", "zumapro_mout_hsi0_peri", 0x20c0, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_GLB, "zumapro_gout_g3d_glb", "zumapro_mout_g3d_glb", + 0x2094, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_NOCD, "zumapro_gout_g3d_nocd", "zumapro_mout_g3d_nocd", + 0x2098, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_SWITCH, "zumapro_gout_g3d_switch", + "zumapro_mout_g3d_switch", 0x209c, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_HSI1_NOC, "zumapro_gout_hsi1_noc", "zumapro_mout_hsi1_noc", + 0x20cc, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_NOC, "zumapro_gout_peric1_noc", + "zumapro_mout_peric1_noc", 0x211c, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_IP, "zumapro_gout_peric1_ip", "zumapro_mout_peric1_ip", + 0x2118, 21, CLK_IGNORE_UNUSED, 0), }; static const struct samsung_div_clock top_dividers[] __initconst = { @@ -114,6 +154,18 @@ static const struct samsung_div_clock top_dividers[] __initconst = { 0x18ac, 0, 3, 0, CLK_DIVIDER_READ_ONLY), DIV_F(CLK_DOUT_MISC_NOC, "zumapro_dout_misc_noc", "zumapro_gout_misc_noc", 0x18c4, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_GLB, "zumapro_dout_g3d_glb", "zumapro_gout_g3d_glb", + 0x1864, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_NOCD, "zumapro_dout_g3d_nocd", "zumapro_gout_g3d_nocd", + 0x1868, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_SWITCH, "zumapro_dout_g3d_switch", + "zumapro_gout_g3d_switch", 0x186c, 0, 3, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_HSI1_NOC, "zumapro_dout_hsi1_noc", "zumapro_gout_hsi1_noc", + 0x189c, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_PERIC1_NOC, "zumapro_dout_peric1_noc", + "zumapro_gout_peric1_noc", 0x18f0, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_PERIC1_IP, "zumapro_dout_peric1_ip", "zumapro_gout_peric1_ip", + 0x18ec, 0, 4, 0, CLK_DIVIDER_READ_ONLY), }; /* Only these branch gates are put under manual CCF control. */ @@ -134,7 +186,7 @@ static const struct samsung_cmu_info top_cmu __initconst = { .nr_ro_gate_clks = ARRAY_SIZE(top_ro_gates), .div_clks = top_dividers, .nr_div_clks = ARRAY_SIZE(top_dividers), - .nr_clk_ids = CLK_GOUT_HSI0_PERI + 1, + .nr_clk_ids = CLK_DOUT_PERIC1_IP + 1, .clk_regs = top_regs, .nr_clk_regs = ARRAY_SIZE(top_regs), }; @@ -231,6 +283,183 @@ static const struct samsung_cmu_info hsi2_cmu __initconst = { .clk_name = "bus", }; +/* + * CMU_G3D. Firmware sets it up and keeps its domain on: the PLLs, muxes and + * dividers are read-only (the PLLs use the PLL0822x M/P/S layout, with no + * rate table), and the GPU's gates are read-only gates. The GPU's own rate + * changes go through the ACPM firmware, not this CMU. + */ +PNAME(g3d_switch_user_parents) = { "oscclk", "zumapro_dout_g3d_switch" }; +PNAME(g3d_glb_user_parents) = { "oscclk", "zumapro_dout_g3d_glb" }; +PNAME(g3d_nocd_user_parents) = { "oscclk", "zumapro_dout_g3d_nocd" }; +PNAME(g3d_l2_glb_parents) = { "zumapro_fout_g3d_l2", "zumapro_mout_g3d_glb_user" }; +PNAME(g3d_stacks_parents) = { "zumapro_fout_g3d", "zumapro_mout_g3d_switch_user" }; +PNAME(g3d_top_parents) = { + "zumapro_mout_g3d_stacks", "zumapro_mout_g3d_nocd_user", + "zumapro_mout_g3d_l2_glb", "oscclk", +}; + +PNAME(g3d_coregroup_user_parents) = { "oscclk", "zumapro_dout_g3d_l2_glb" }; +PNAME(g3d_stacks_user_parents) = { "oscclk", "zumapro_dout_g3d_stacks" }; +PNAME(g3d_top_user_parents) = { "oscclk", "zumapro_dout_g3d_top" }; + +static const struct samsung_pll_clock g3d_plls[] __initconst = { + PLL(pll_0822x, CLK_FOUT_G3D, "zumapro_fout_g3d", "oscclk", + 0x000, 0x10c, NULL), + PLL(pll_0822x, CLK_FOUT_G3D_L2, "zumapro_fout_g3d_l2", "oscclk", + 0x008, 0x18c, NULL), +}; + +static const struct samsung_mux_clock g3d_muxes[] __initconst = { + MUX_F(CLK_MOUT_G3D_SWITCH_USER, "zumapro_mout_g3d_switch_user", + g3d_switch_user_parents, 0x620, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_GLB_USER, "zumapro_mout_g3d_glb_user", + g3d_glb_user_parents, 0x600, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_NOCD_USER, "zumapro_mout_g3d_nocd_user", + g3d_nocd_user_parents, 0x610, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_L2_GLB, "zumapro_mout_g3d_l2_glb", + g3d_l2_glb_parents, 0x1000, 0, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_STACKS, "zumapro_mout_g3d_stacks", + g3d_stacks_parents, 0x1004, 0, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_TOP, "zumapro_mout_g3d_top", + g3d_top_parents, 0x1008, 0, 2, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_COREGROUP_USER, "zumapro_mout_g3d_coregroup_user", + g3d_coregroup_user_parents, 0x630, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_STACKS_USER, "zumapro_mout_g3d_stacks_user", + g3d_stacks_user_parents, 0x640, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_TOP_USER, "zumapro_mout_g3d_top_user", + g3d_top_user_parents, 0x650, 4, 1, 0, CLK_MUX_READ_ONLY), +}; + +/* CAL exposes no ratio field for these two paths: they are pass-through. */ +static const struct samsung_fixed_factor_clock g3d_factors[] __initconst = { + FFACTOR(CLK_DOUT_G3D_L2_GLB, "zumapro_dout_g3d_l2_glb", + "zumapro_mout_g3d_l2_glb", 1, 1, 0), + FFACTOR(CLK_DOUT_G3D_STACKS, "zumapro_dout_g3d_stacks", + "zumapro_mout_g3d_stacks", 1, 1, 0), +}; + +static const struct samsung_div_clock g3d_dividers[] __initconst = { + DIV_F(CLK_DOUT_G3D_TOP, "zumapro_dout_g3d_top", "zumapro_mout_g3d_top", + 0x1814, 0, 3, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_NOCP, "zumapro_dout_g3d_nocp", "zumapro_dout_g3d_l2_glb", + 0x1808, 0, 3, 0, CLK_DIVIDER_READ_ONLY), +}; + +static const struct samsung_gate_clock g3d_ro_gates[] __initconst = { + GATE(CLK_GOUT_G3D_CMU, "zumapro_gout_g3d_cmu", "zumapro_dout_g3d_nocp", + 0x2018, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_CORE, "zumapro_gout_g3d_core", "zumapro_mout_g3d_top_user", + 0x201c, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_COREGROUP, "zumapro_gout_g3d_coregroup", + "zumapro_mout_g3d_coregroup_user", 0x2020, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_STACKS, "zumapro_gout_g3d_stacks", + "zumapro_mout_g3d_stacks_user", 0x2024, 21, CLK_IGNORE_UNUSED, 0), +}; + +static const struct samsung_cmu_info g3d_cmu __initconst = { + .pll_clks = g3d_plls, + .nr_pll_clks = ARRAY_SIZE(g3d_plls), + .mux_clks = g3d_muxes, + .nr_mux_clks = ARRAY_SIZE(g3d_muxes), + .fixed_factor_clks = g3d_factors, + .nr_fixed_factor_clks = ARRAY_SIZE(g3d_factors), + .div_clks = g3d_dividers, + .nr_div_clks = ARRAY_SIZE(g3d_dividers), + .ro_gate_clks = g3d_ro_gates, + .nr_ro_gate_clks = ARRAY_SIZE(g3d_ro_gates), + .nr_clk_ids = CLK_GOUT_G3D_STACKS + 1, + .clk_name = "bus", +}; + +/* + * CMU_HSI1. Firmware keeps the domain powered and owns its setup: the muxes + * and the ALT divider are read-only, the gates read-only gates. Only the + * GPIO bank's clock is described; the PCIe channel 0 clocks are not. + */ +PNAME(mout_hsi1_noc_user_parents) = { "oscclk", "zumapro_dout_hsi1_noc" }; +PNAME(mout_hsi1_alt_user_parents) = { "oscclk", "zumapro_dout_hsi1_alt" }; +PNAME(mout_hsi1_noc_local_parents) = { "zumapro_mout_hsi1_noc_user", + "zumapro_mout_hsi1_alt_user" }; + +static const struct samsung_mux_clock hsi1_muxes[] __initconst = { + MUX_F(CLK_MOUT_HSI1_NOC_USER, "zumapro_mout_hsi1_noc_user", + mout_hsi1_noc_user_parents, 0x600, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_HSI1_ALT_USER, "zumapro_mout_hsi1_alt_user", + mout_hsi1_alt_user_parents, 0x620, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_HSI1_NOC_LOCAL, "zumapro_mout_hsi1_noc_local", + mout_hsi1_noc_local_parents, 0x1000, 0, 1, 0, CLK_MUX_READ_ONLY), +}; + +static const struct samsung_div_clock hsi1_dividers[] __initconst = { + DIV_F(CLK_DOUT_HSI1_ALT, "zumapro_dout_hsi1_alt", "zumapro_gout_hsi1_alt", + 0x1808, 0, 4, 0, CLK_DIVIDER_READ_ONLY), +}; + +static const struct samsung_gate_clock hsi1_ro_gates[] __initconst = { + GATE(CLK_GOUT_HSI1_ALT, "zumapro_gout_hsi1_alt", "hsi1-alt", + 0x2080, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_GPIO_HSI1, "zumapro_gout_gpio_hsi1", "zumapro_mout_hsi1_noc_local", + 0x205c, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_HSI1_CMU, "zumapro_gout_hsi1_cmu", "zumapro_mout_hsi1_noc_local", + 0x2004, 21, CLK_IGNORE_UNUSED, 0), +}; + +static const struct samsung_cmu_info hsi1_cmu __initconst = { + .mux_clks = hsi1_muxes, + .nr_mux_clks = ARRAY_SIZE(hsi1_muxes), + .div_clks = hsi1_dividers, + .nr_div_clks = ARRAY_SIZE(hsi1_dividers), + .ro_gate_clks = hsi1_ro_gates, + .nr_ro_gate_clks = ARRAY_SIZE(hsi1_ro_gates), + .nr_clk_ids = CLK_GOUT_HSI1_CMU + 1, + .clk_name = "bus", +}; + +/* + * CMU_PERIC1. Firmware sets it up: the user muxes and the USI9 divider are + * read-only, and the GPIO, sysreg and USI9 gates are read-only gates. USI9 + * is the I2C bus of the NFC controller and the haptics driver. + */ +PNAME(mout_peric1_noc_user_parents) = { "oscclk", "zumapro_dout_peric1_noc" }; +PNAME(mout_peric1_usi9_user_parents) = { "oscclk", "zumapro_dout_peric1_ip" }; + +static const struct samsung_mux_clock peric1_muxes[] __initconst = { + MUX_F(CLK_MOUT_PERIC1_NOC_USER, "zumapro_mout_peric1_noc_user", + mout_peric1_noc_user_parents, 0x610, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_PERIC1_USI9_USER, "zumapro_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_USI9, "zumapro_dout_peric1_usi9", + "zumapro_mout_peric1_usi9_user", 0x1824, 0, 4, 0, CLK_DIVIDER_READ_ONLY), +}; + +static const struct samsung_gate_clock peric1_ro_gates[] __initconst = { + GATE(CLK_GOUT_GPIO_PERIC1, "zumapro_gout_gpio_peric1", + "zumapro_mout_peric1_noc_user", 0x2080, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_SYSREG, "zumapro_gout_peric1_sysreg", + "zumapro_mout_peric1_noc_user", 0x20a4, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_USI9_IPCLK, "zumapro_gout_peric1_usi9_ipclk", + "zumapro_dout_peric1_usi9", 0x2070, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_USI9_PCLK, "zumapro_gout_peric1_usi9_pclk", + "zumapro_mout_peric1_noc_user", 0x2074, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_PERIC1_USI9_RSTNSYNC, "zumapro_gout_peric1_usi9_rstnsync", + "zumapro_dout_peric1_usi9", 0x20a0, 21, CLK_IGNORE_UNUSED, 0), +}; + +static const struct samsung_cmu_info peric1_cmu __initconst = { + .mux_clks = peric1_muxes, + .nr_mux_clks = ARRAY_SIZE(peric1_muxes), + .div_clks = peric1_dividers, + .nr_div_clks = ARRAY_SIZE(peric1_dividers), + .ro_gate_clks = peric1_ro_gates, + .nr_ro_gate_clks = ARRAY_SIZE(peric1_ro_gates), + .nr_clk_ids = CLK_GOUT_PERIC1_USI9_RSTNSYNC + 1, + .clk_name = "bus", +}; + /* CMU_HSI0. Firmware keeps the domain powered; there is no local PM. */ PNAME(mout_hsi0_tcxo_user_parents) = { "oscclk", "hsi0-tcxo" }; PNAME(mout_hsi0_usb20_ref_parents) = { "zumapro_dout_hsi0_usb", "zumapro_mout_hsi0_tcxo_user" }; @@ -393,9 +622,12 @@ static int __init zumapro_cmu_probe(struct platform_device *pdev) } static const struct of_device_id zumapro_cmu_match[] = { + { .compatible = "google,zumapro-cmu-g3d", .data = &g3d_cmu }, { .compatible = "google,zumapro-cmu-hsi0", .data = &hsi0_cmu }, + { .compatible = "google,zumapro-cmu-hsi1", .data = &hsi1_cmu }, { .compatible = "google,zumapro-cmu-hsi2", .data = &hsi2_cmu }, { .compatible = "google,zumapro-cmu-peric0", .data = &peric0_cmu }, + { .compatible = "google,zumapro-cmu-peric1", .data = &peric1_cmu }, { } }; diff --git a/include/dt-bindings/clock/google,zumapro.h b/include/dt-bindings/clock/google,zumapro.h index 875b3ed744..2b62e2dc75 100644 --- a/include/dt-bindings/clock/google,zumapro.h +++ b/include/dt-bindings/clock/google,zumapro.h @@ -34,6 +34,28 @@ #define CLK_DOUT_MISC_NOC 28 #define CLK_GOUT_HSI0_NOC 29 #define CLK_GOUT_HSI0_PERI 30 +#define CLK_MOUT_G3D_GLB 31 +#define CLK_MOUT_G3D_NOCD 32 +#define CLK_MOUT_G3D_SWITCH 33 +#define CLK_GOUT_G3D_GLB 34 +#define CLK_GOUT_G3D_NOCD 35 +#define CLK_GOUT_G3D_SWITCH 36 +#define CLK_DOUT_G3D_GLB 37 +#define CLK_DOUT_G3D_NOCD 38 +#define CLK_DOUT_G3D_SWITCH 39 +#define CLK_SHARED0_D2 40 +#define CLK_SHARED0_D3 41 +#define CLK_SHARED1_D2 42 +#define CLK_SHARED1_D3 43 +#define CLK_MOUT_HSI1_NOC 44 +#define CLK_GOUT_HSI1_NOC 45 +#define CLK_DOUT_HSI1_NOC 46 +#define CLK_MOUT_PERIC1_NOC 47 +#define CLK_MOUT_PERIC1_IP 48 +#define CLK_GOUT_PERIC1_NOC 49 +#define CLK_GOUT_PERIC1_IP 50 +#define CLK_DOUT_PERIC1_NOC 51 +#define CLK_DOUT_PERIC1_IP 52 /* CMU_HSI0. */ #define CLK_FOUT_HSI0_USB 1 @@ -59,6 +81,36 @@ #define CLK_GOUT_HSI0_USB_LINK 21 #define CLK_GOUT_HSI0_USB_SUSPEND 22 +/* CMU_G3D. */ +#define CLK_FOUT_G3D 1 +#define CLK_FOUT_G3D_L2 2 +#define CLK_MOUT_G3D_SWITCH_USER 3 +#define CLK_MOUT_G3D_GLB_USER 4 +#define CLK_MOUT_G3D_NOCD_USER 5 +#define CLK_MOUT_G3D_L2_GLB 6 +#define CLK_MOUT_G3D_STACKS 7 +#define CLK_MOUT_G3D_TOP 8 +#define CLK_DOUT_G3D_L2_GLB 9 +#define CLK_DOUT_G3D_STACKS 10 +#define CLK_DOUT_G3D_TOP 11 +#define CLK_MOUT_G3D_COREGROUP_USER 12 +#define CLK_MOUT_G3D_STACKS_USER 13 +#define CLK_MOUT_G3D_TOP_USER 14 +#define CLK_DOUT_G3D_NOCP 15 +#define CLK_GOUT_G3D_CMU 16 +#define CLK_GOUT_G3D_CORE 17 +#define CLK_GOUT_G3D_COREGROUP 18 +#define CLK_GOUT_G3D_STACKS 19 + +/* CMU_HSI1. */ +#define CLK_MOUT_HSI1_NOC_USER 1 +#define CLK_MOUT_HSI1_ALT_USER 2 +#define CLK_MOUT_HSI1_NOC_LOCAL 3 +#define CLK_GOUT_HSI1_ALT 4 +#define CLK_DOUT_HSI1_ALT 5 +#define CLK_GOUT_GPIO_HSI1 6 +#define CLK_GOUT_HSI1_CMU 7 + /* CMU_HSI2. */ #define CLK_MOUT_HSI2_NOC_USER 1 #define CLK_MOUT_HSI2_UFS_USER 2 @@ -91,6 +143,16 @@ #define CLK_MOUT_PERIC0_NOC_USER 1 #define CLK_GOUT_GPIO_PERIC0 2 +/* CMU_PERIC1. */ +#define CLK_MOUT_PERIC1_NOC_USER 1 +#define CLK_GOUT_GPIO_PERIC1 2 +#define CLK_GOUT_PERIC1_SYSREG 3 +#define CLK_MOUT_PERIC1_USI9_USER 4 +#define CLK_DOUT_PERIC1_USI9 5 +#define CLK_GOUT_PERIC1_USI9_IPCLK 6 +#define CLK_GOUT_PERIC1_USI9_PCLK 7 +#define CLK_GOUT_PERIC1_USI9_RSTNSYNC 8 + /* CMU_MISC. */ #define CLK_MOUT_MISC_NOC_USER 1 #define CLK_DOUT_MISC_NOCP 2