| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/12 02:57 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"SUN60I_A733_CCU",
"SUN60I_A733_R_CCU"
],
"FocusSymbols": [
"sun60i_a733_ccu_probe",
"sun60i_a733_r_ccu_probe",
"ccu_sdm_helper_is_enabled",
"ccu_sdm_helper_enable",
"ccu_sdm_helper_disable",
"ccu_sdm_helper_read_rate"
],
"Reasoning": "The patch introduces new clock control unit drivers for the Allwinner A733 SoC and modifies the core sunxi-ng Sigma-Delta Modulation (SDM) helper functions to support dual pattern registers. These changes include functional logic in `ccu_sdm.c` and new probe functions that can be reached via device tree overlays in a virtualized environment.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/12 02:57 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 9d505a2663adacff9e2d18c0e757fcba364b5be7\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Jul 12 02:57:20 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml b/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml\nnew file mode 100644\nindex 00000000000000..5a831b5c4029ab\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml\n@@ -0,0 +1,107 @@\n+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+%YAML 1.2\n+---\n+$id: http://devicetree.org/schemas/clock/allwinner,sun60i-a733-ccu.yaml#\n+$schema: http://devicetree.org/meta-schemas/core.yaml#\n+\n+title: Allwinner A733 Clock Control Unit\n+\n+maintainers:\n+ - Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+\n+properties:\n+ \"#clock-cells\":\n+ const: 1\n+\n+ \"#reset-cells\":\n+ const: 1\n+\n+ compatible:\n+ enum:\n+ - allwinner,sun60i-a733-ccu\n+ - allwinner,sun60i-a733-r-ccu\n+\n+ reg:\n+ maxItems: 1\n+\n+ clocks:\n+ minItems: 4\n+ maxItems: 7\n+\n+ clock-names:\n+ minItems: 4\n+ maxItems: 7\n+\n+required:\n+ - \"#clock-cells\"\n+ - \"#reset-cells\"\n+ - compatible\n+ - reg\n+ - clocks\n+ - clock-names\n+\n+allOf:\n+ - if:\n+ properties:\n+ compatible:\n+ enum:\n+ - allwinner,sun60i-a733-ccu\n+\n+ then:\n+ properties:\n+ clocks:\n+ items:\n+ - description: High Frequency Oscillator (19.2MHz, 24MHz, or 26MHz)\n+ - description: Low Frequency Oscillator (usually at 32kHz)\n+ - description: Internal Oscillator\n+ - description: Low Frequency Oscillator fanout\n+\n+ clock-names:\n+ items:\n+ - const: hosc\n+ - const: losc\n+ - const: iosc\n+ - const: losc-fanout\n+\n+ - if:\n+ properties:\n+ compatible:\n+ enum:\n+ - allwinner,sun60i-a733-r-ccu\n+\n+ then:\n+ properties:\n+ clocks:\n+ items:\n+ - description: High Frequency Oscillator (19.2MHz, 24MHz, or 26MHz)\n+ - description: Low Frequency Oscillator (usually at 32kHz)\n+ - description: Internal Oscillator\n+ - description: System 24MHz Clock\n+ - description: Peripherals PLL 0 (200 MHz output)\n+ - description: Peripherals PLL 0 (300 MHz output)\n+ - description: Peripherals PLL 1 (300 MHz output)\n+\n+ clock-names:\n+ items:\n+ - const: hosc\n+ - const: losc\n+ - const: iosc\n+ - const: sys-24m\n+ - const: pll-periph0-200m\n+ - const: pll-periph0-300m\n+ - const: pll-periph1-300m\n+\n+additionalProperties: false\n+\n+examples:\n+ - |\n+ clock-controller@2002000 {\n+ compatible = \"allwinner,sun60i-a733-ccu\";\n+ reg = \u003c0x02002000 0x2000\u003e;\n+ clocks = \u003c\u0026osc\u003e, \u003c\u0026rtc 0\u003e, \u003c\u0026rtc 2\u003e, \u003c\u0026rtc 1\u003e;\n+ clock-names = \"hosc\", \"losc\", \"iosc\", \"losc-fanout\";\n+ #clock-cells = \u003c1\u003e;\n+ #reset-cells = \u003c1\u003e;\n+ };\n+\n+...\ndiff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig\nindex 6af2d020e03e9f..cffa83056934ad 100644\n--- a/drivers/clk/sunxi-ng/Kconfig\n+++ b/drivers/clk/sunxi-ng/Kconfig\n@@ -67,6 +67,16 @@ config SUN55I_A523_R_CCU\n \tdefault ARCH_SUNXI\n \tdepends on ARM64 || COMPILE_TEST\n \n+config SUN60I_A733_CCU\n+\ttristate \"Support for the Allwinner A733 CCU\"\n+\tdefault ARCH_SUNXI\n+\tdepends on ARM64 || COMPILE_TEST\n+\n+config SUN60I_A733_R_CCU\n+\ttristate \"Support for the Allwinner A733 PRCM CCU\"\n+\tdefault ARCH_SUNXI\n+\tdepends on ARM64 || COMPILE_TEST\n+\n config SUN4I_A10_CCU\n \ttristate \"Support for the Allwinner A10/A20 CCU\"\n \tdefault ARCH_SUNXI\ndiff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile\nindex a1c4087d724173..3a39eb9287da03 100644\n--- a/drivers/clk/sunxi-ng/Makefile\n+++ b/drivers/clk/sunxi-ng/Makefile\n@@ -36,6 +36,8 @@ obj-$(CONFIG_SUN50I_H616_CCU)\t+= sun50i-h616-ccu.o\n obj-$(CONFIG_SUN55I_A523_CCU)\t+= sun55i-a523-ccu.o\n obj-$(CONFIG_SUN55I_A523_MCU_CCU)\t+= sun55i-a523-mcu-ccu.o\n obj-$(CONFIG_SUN55I_A523_R_CCU)\t+= sun55i-a523-r-ccu.o\n+obj-$(CONFIG_SUN60I_A733_CCU)\t+= sun60i-a733-ccu.o\n+obj-$(CONFIG_SUN60I_A733_R_CCU)\t+= sun60i-a733-r-ccu.o\n obj-$(CONFIG_SUN4I_A10_CCU)\t+= sun4i-a10-ccu.o\n obj-$(CONFIG_SUN5I_CCU)\t\t+= sun5i-ccu.o\n obj-$(CONFIG_SUN6I_A31_CCU)\t+= sun6i-a31-ccu.o\n@@ -64,6 +66,8 @@ sun50i-h616-ccu-y\t\t+= ccu-sun50i-h616.o\n sun55i-a523-ccu-y\t\t+= ccu-sun55i-a523.o\n sun55i-a523-mcu-ccu-y\t\t+= ccu-sun55i-a523-mcu.o\n sun55i-a523-r-ccu-y\t\t+= ccu-sun55i-a523-r.o\n+sun60i-a733-ccu-y\t\t+= ccu-sun60i-a733.o\n+sun60i-a733-r-ccu-y\t\t+= ccu-sun60i-a733-r.o\n sun4i-a10-ccu-y\t\t\t+= ccu-sun4i-a10.o\n sun5i-ccu-y\t\t\t+= ccu-sun5i.o\n sun6i-a31-ccu-y\t\t\t+= ccu-sun6i-a31.o\ndiff --git a/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c b/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c\nnew file mode 100644\nindex 00000000000000..a56cd3edff5fe9\n--- /dev/null\n+++ b/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c\n@@ -0,0 +1,273 @@\n+// SPDX-License-Identifier: GPL-2.0-only\n+/*\n+ * Copyright (C) 2023 rengaomin@allwinnertech.com\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ * Based on the A523 CCU driver:\n+ * Copyright (C) 2024 Arm Ltd.\n+ */\n+\n+#include \u003clinux/clk-provider.h\u003e\n+#include \u003clinux/module.h\u003e\n+#include \u003clinux/platform_device.h\u003e\n+\n+#include \u003cdt-bindings/clock/sun60i-a733-r-ccu.h\u003e\n+#include \u003cdt-bindings/reset/sun60i-a733-r-ccu.h\u003e\n+\n+#include \"ccu_common.h\"\n+#include \"ccu_reset.h\"\n+\n+#include \"ccu_div.h\"\n+#include \"ccu_gate.h\"\n+#include \"ccu_mp.h\"\n+\n+static const struct clk_parent_data r_ahb_parents[] = {\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .fw_name = \"pll-periph0-200m\" },\n+\t{ .fw_name = \"pll-periph0-300m\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX(r_ahb_clk, \"r-ahb\", r_ahb_parents, 0x000,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data r_apb_parents[] = {\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .fw_name = \"pll-periph0-200m\" },\n+\t{ .fw_name = \"sys-24m\" },\n+};\n+\n+static SUNXI_CCU_M_DATA_WITH_MUX(r_apb0_clk, \"r-apb0\", r_apb_parents, 0x00c,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_M_DATA_WITH_MUX(r_apb1_clk, \"r-apb1\", r_apb_parents, 0x010,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer0, \"r-timer0\", r_apb_parents, 0x100,\n+\t\t\t\t 1, 3,\t/* P */\n+\t\t\t\t 4, 3,\t/* mux */\n+\t\t\t\t BIT(0),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer1, \"r-timer1\", r_apb_parents, 0x104,\n+\t\t\t\t 1, 3,\t/* P */\n+\t\t\t\t 4, 3,\t/* mux */\n+\t\t\t\t BIT(0),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer2, \"r-timer2\", r_apb_parents, 0x108,\n+\t\t\t\t 1, 3,\t/* P */\n+\t\t\t\t 4, 3,\t/* mux */\n+\t\t\t\t BIT(0),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer3, \"r-timer3\", r_apb_parents, 0x10c,\n+\t\t\t\t 1, 3,\t/* P */\n+\t\t\t\t 4, 3,\t/* mux */\n+\t\t\t\t BIT(0),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_timer_clk, \"bus-r-timer\", \u0026r_ahb_clk.common.hw, 0x11c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_twd_clk, \"bus-r-twd\", \u0026r_apb0_clk.common.hw, 0x12c, BIT(0), 0);\n+\n+static const struct clk_parent_data r_pwm_parents[] = {\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .fw_name = \"sys-24m\" },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(r_pwm_clk, \"r-pwm\", r_pwm_parents, 0x130,\n+\t\t\t\t 24, 2,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HW(bus_r_pwm_clk, \"bus-r-pwm\",\n+\t\t\t \u0026r_apb0_clk.common.hw, 0x13c, BIT(0), 0);\n+\n+static const struct clk_parent_data r_spi_parents[] = {\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"pll-periph0-200m\" },\n+\t{ .fw_name = \"pll-periph0-300m\" },\n+\t{ .fw_name = \"pll-periph1-300m\" },\n+\t{ .fw_name = \"sys-24m\" },\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(r_spi_clk, \"r-spi\", r_spi_parents, 0x150,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HW(bus_r_spi_clk, \"bus-r-spi\", \u0026r_ahb_clk.common.hw, 0x15c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_msgbox_clk, \"bus-r-msgbox\", \u0026r_ahb_clk.common.hw, 0x17c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_uart0_clk, \"bus-r-uart0\", \u0026r_apb1_clk.common.hw, 0x18c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_uart1_clk, \"bus-r-uart1\", \u0026r_apb1_clk.common.hw, 0x18c, BIT(1), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_i2c0_clk, \"bus-r-i2c0\", \u0026r_apb1_clk.common.hw, 0x19c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_i2c1_clk, \"bus-r-i2c1\", \u0026r_apb1_clk.common.hw, 0x19c, BIT(1), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_i2c2_clk, \"bus-r-i2c2\", \u0026r_apb1_clk.common.hw, 0x19c, BIT(2), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_ppu_clk, \"bus-r-ppu\", \u0026r_apb0_clk.common.hw, 0x1ac, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_tzma_clk, \"bus-r-tzma\", \u0026r_apb0_clk.common.hw, 0x1b0, BIT(0), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_cpu_bist_clk, \"bus-r-cpu-bist\", \u0026r_apb0_clk.common.hw,\n+\t\t\t 0x1bc, BIT(0), 0);\n+\n+static const struct clk_parent_data r_ir_rx_parents[] = {\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"sys-24m\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(r_ir_rx_clk, \"r-ir-rx\", r_ir_rx_parents, 0x1c0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 2,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HW(bus_r_ir_rx_clk, \"bus-r-ir-rx\", \u0026r_apb0_clk.common.hw, 0x1cc, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, \"bus-r-rtc\", \u0026r_ahb_clk.common.hw, 0x20c, BIT(0), 0);\n+\n+static const struct clk_parent_data r_riscv_parents[] = {\n+\t{ .fw_name = \"hosc\" },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(r_riscv_clk, \"r-riscv\", r_riscv_parents, 0x210,\n+\t\t\t\t 24, 2,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HW(bus_r_riscv_clk, \"bus-r-riscv\", \u0026r_apb0_clk.common.hw,\n+\t\t\t 0x21c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HW(bus_r_riscv_cfg_clk, \"bus-r-riscv-cfg\", \u0026r_apb0_clk.common.hw,\n+\t\t\t 0x21c, BIT(1), 0);\n+\n+static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, \"bus-r-cpucfg\", \u0026r_apb0_clk.common.hw,\n+\t\t\t 0x22c, BIT(0), CLK_IS_CRITICAL);\n+\n+static struct ccu_common *sun60i_a733_r_ccu_clks[] = {\n+\t\u0026r_ahb_clk.common,\n+\t\u0026r_apb0_clk.common,\n+\t\u0026r_apb1_clk.common,\n+\t\u0026r_cpu_timer0.common,\n+\t\u0026r_cpu_timer1.common,\n+\t\u0026r_cpu_timer2.common,\n+\t\u0026r_cpu_timer3.common,\n+\t\u0026bus_r_timer_clk.common,\n+\t\u0026bus_r_twd_clk.common,\n+\t\u0026r_pwm_clk.common,\n+\t\u0026bus_r_pwm_clk.common,\n+\t\u0026r_spi_clk.common,\n+\t\u0026bus_r_spi_clk.common,\n+\t\u0026bus_r_msgbox_clk.common,\n+\t\u0026bus_r_uart0_clk.common,\n+\t\u0026bus_r_uart1_clk.common,\n+\t\u0026bus_r_i2c0_clk.common,\n+\t\u0026bus_r_i2c1_clk.common,\n+\t\u0026bus_r_i2c2_clk.common,\n+\t\u0026bus_r_ppu_clk.common,\n+\t\u0026bus_r_tzma_clk.common,\n+\t\u0026bus_r_cpu_bist_clk.common,\n+\t\u0026r_ir_rx_clk.common,\n+\t\u0026bus_r_ir_rx_clk.common,\n+\t\u0026bus_r_rtc_clk.common,\n+\t\u0026r_riscv_clk.common,\n+\t\u0026bus_r_riscv_clk.common,\n+\t\u0026bus_r_riscv_cfg_clk.common,\n+\t\u0026bus_r_cpucfg_clk.common,\n+};\n+\n+static struct clk_hw_onecell_data sun60i_a733_r_hw_clks = {\n+\t.hws = {\n+\t\t[CLK_R_AHB]\t\t= \u0026r_ahb_clk.common.hw,\n+\t\t[CLK_R_APB0]\t\t= \u0026r_apb0_clk.common.hw,\n+\t\t[CLK_R_APB1]\t\t= \u0026r_apb1_clk.common.hw,\n+\t\t[CLK_R_TIMER0]\t\t= \u0026r_cpu_timer0.common.hw,\n+\t\t[CLK_R_TIMER1]\t\t= \u0026r_cpu_timer1.common.hw,\n+\t\t[CLK_R_TIMER2]\t\t= \u0026r_cpu_timer2.common.hw,\n+\t\t[CLK_R_TIMER3]\t\t= \u0026r_cpu_timer3.common.hw,\n+\t\t[CLK_BUS_R_TIMER]\t= \u0026bus_r_timer_clk.common.hw,\n+\t\t[CLK_BUS_R_TWD]\t\t= \u0026bus_r_twd_clk.common.hw,\n+\t\t[CLK_R_PWM]\t\t= \u0026r_pwm_clk.common.hw,\n+\t\t[CLK_BUS_R_PWM]\t\t= \u0026bus_r_pwm_clk.common.hw,\n+\t\t[CLK_R_SPI]\t\t= \u0026r_spi_clk.common.hw,\n+\t\t[CLK_BUS_R_SPI]\t\t= \u0026bus_r_spi_clk.common.hw,\n+\t\t[CLK_BUS_R_MSGBOX]\t= \u0026bus_r_msgbox_clk.common.hw,\n+\t\t[CLK_BUS_R_UART0]\t= \u0026bus_r_uart0_clk.common.hw,\n+\t\t[CLK_BUS_R_UART1]\t= \u0026bus_r_uart1_clk.common.hw,\n+\t\t[CLK_BUS_R_I2C0]\t= \u0026bus_r_i2c0_clk.common.hw,\n+\t\t[CLK_BUS_R_I2C1]\t= \u0026bus_r_i2c1_clk.common.hw,\n+\t\t[CLK_BUS_R_I2C2]\t= \u0026bus_r_i2c2_clk.common.hw,\n+\t\t[CLK_BUS_R_PPU]\t\t= \u0026bus_r_ppu_clk.common.hw,\n+\t\t[CLK_BUS_R_TZMA]\t= \u0026bus_r_tzma_clk.common.hw,\n+\t\t[CLK_BUS_R_CPU_BIST]\t= \u0026bus_r_cpu_bist_clk.common.hw,\n+\t\t[CLK_R_IR_RX]\t\t= \u0026r_ir_rx_clk.common.hw,\n+\t\t[CLK_BUS_R_IR_RX]\t= \u0026bus_r_ir_rx_clk.common.hw,\n+\t\t[CLK_BUS_R_RTC]\t\t= \u0026bus_r_rtc_clk.common.hw,\n+\t\t[CLK_R_RISCV]\t\t= \u0026r_riscv_clk.common.hw,\n+\t\t[CLK_BUS_R_RISCV]\t= \u0026bus_r_riscv_clk.common.hw,\n+\t\t[CLK_BUS_R_RISCV_CFG]\t= \u0026bus_r_riscv_cfg_clk.common.hw,\n+\t\t[CLK_BUS_R_CPUCFG]\t= \u0026bus_r_cpucfg_clk.common.hw,\n+\t},\n+\t.num = CLK_BUS_R_CPUCFG + 1,\n+};\n+\n+static struct ccu_reset_map sun60i_a733_r_ccu_resets[] = {\n+\t[RST_BUS_R_TIMER]\t= { 0x11c, BIT(16) },\n+\t[RST_BUS_R_PWM]\t\t= { 0x13c, BIT(16) },\n+\t[RST_BUS_R_SPI]\t\t= { 0x15c, BIT(16) },\n+\t[RST_BUS_R_MSGBOX]\t= { 0x17c, BIT(16) },\n+\t[RST_BUS_R_UART0]\t= { 0x18c, BIT(16) },\n+\t[RST_BUS_R_UART1]\t= { 0x18c, BIT(17) },\n+\t[RST_BUS_R_I2C0]\t= { 0x19c, BIT(16) },\n+\t[RST_BUS_R_I2C1]\t= { 0x19c, BIT(17) },\n+\t[RST_BUS_R_I2C2]\t= { 0x19c, BIT(18) },\n+\t[RST_BUS_R_IR_RX]\t= { 0x1cc, BIT(16) },\n+\t[RST_BUS_R_RTC]\t\t= { 0x20c, BIT(16) },\n+\t[RST_BUS_R_RISCV_CFG]\t= { 0x21c, BIT(16) },\n+\t[RST_BUS_R_CPUCFG]\t= { 0x22c, BIT(16) },\n+};\n+\n+static const struct sunxi_ccu_desc sun60i_a733_r_ccu_desc = {\n+\t.ccu_clks\t= sun60i_a733_r_ccu_clks,\n+\t.num_ccu_clks\t= ARRAY_SIZE(sun60i_a733_r_ccu_clks),\n+\n+\t.hw_clks\t= \u0026sun60i_a733_r_hw_clks,\n+\n+\t.resets\t\t= sun60i_a733_r_ccu_resets,\n+\t.num_resets\t= ARRAY_SIZE(sun60i_a733_r_ccu_resets),\n+};\n+\n+static int sun60i_a733_r_ccu_probe(struct platform_device *pdev)\n+{\n+\tvoid __iomem *reg;\n+\n+\treg = devm_platform_ioremap_resource(pdev, 0);\n+\tif (IS_ERR(reg))\n+\t\treturn PTR_ERR(reg);\n+\n+\treturn devm_sunxi_ccu_probe(\u0026pdev-\u003edev, reg, \u0026sun60i_a733_r_ccu_desc);\n+}\n+\n+static const struct of_device_id sun60i_a733_r_ccu_ids[] = {\n+\t{ .compatible = \"allwinner,sun60i-a733-r-ccu\" },\n+\t{ /* sentinel */ }\n+};\n+MODULE_DEVICE_TABLE(of, sun60i_a733_r_ccu_ids);\n+\n+static struct platform_driver sun60i_a733_r_ccu_driver = {\n+\t.probe\t= sun60i_a733_r_ccu_probe,\n+\t.driver\t= {\n+\t\t.name\t\t\t= \"sun60i-a733-r-ccu\",\n+\t\t.suppress_bind_attrs\t= true,\n+\t\t.of_match_table\t\t= sun60i_a733_r_ccu_ids,\n+\t},\n+};\n+module_platform_driver(sun60i_a733_r_ccu_driver);\n+\n+MODULE_IMPORT_NS(\"SUNXI_CCU\");\n+MODULE_DESCRIPTION(\"Support for the Allwinner A733 PRCM CCU\");\n+MODULE_LICENSE(\"GPL\");\ndiff --git a/drivers/clk/sunxi-ng/ccu-sun60i-a733.c b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c\nnew file mode 100644\nindex 00000000000000..ff64c35206d2d5\n--- /dev/null\n+++ b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c\n@@ -0,0 +1,2360 @@\n+// SPDX-License-Identifier: GPL-2.0-only\n+/*\n+ * Copyright (C) 2023 rengaomin@allwinnertech.com\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ * Based on the A523 CCU driver:\n+ * Copyright (C) 2023-2024 Arm Ltd.\n+ */\n+\n+#include \u003clinux/clk-provider.h\u003e\n+#include \u003clinux/io.h\u003e\n+#include \u003clinux/module.h\u003e\n+#include \u003clinux/platform_device.h\u003e\n+\n+#include \u003cdt-bindings/clock/sun60i-a733-ccu.h\u003e\n+#include \u003cdt-bindings/reset/sun60i-a733-ccu.h\u003e\n+\n+#include \"../clk.h\"\n+\n+#include \"ccu_common.h\"\n+#include \"ccu_reset.h\"\n+\n+#include \"ccu_div.h\"\n+#include \"ccu_gate.h\"\n+#include \"ccu_mp.h\"\n+#include \"ccu_mult.h\"\n+#include \"ccu_mux.h\"\n+#include \"ccu_nkmp.h\"\n+#include \"ccu_nm.h\"\n+\n+/*\n+ * The DCXO oscillator, the root of most of the clock tree, which may be\n+ * 19.2MHz, 24MHz, or 26MHz.\n+ */\n+static const struct clk_parent_data hosc[] = {\n+\t{ .fw_name = \"hosc\" }\n+};\n+\n+/**************************************************************************\n+ * PLLs *\n+ **************************************************************************/\n+\n+/*\n+ * Undocumented, taken from the vendor kernel.\n+ * PLL_REF normalizes the DCXO frequency to a 24MHz reference for downstream\n+ * PLLs.\n+ */\n+#define SUN60I_A733_PLL_REF_REG\t\t0x000\n+static struct ccu_nkmp pll_ref_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT(8, 8),\n+\t.m\t\t= _SUNXI_CCU_DIV(16, 7), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_REF_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_DATA(\"pll-ref\", hosc,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+/*\n+ * Most clock-defining macros expect an *array* of parent clocks, even if\n+ * they do not contain a muxer to select between different parents.\n+ * The macros ending in just _HW take a simple clock pointer, but then create\n+ * a single-entry array out of that. The macros using _HWS take such an\n+ * array (even when it is a single entry one), this avoids having those\n+ * helper arrays created inside *every* clock definition.\n+ * This means for every clock that is referenced more than once it is\n+ * useful to create such a dummy array and use _HWS.\n+ */\n+static const struct clk_hw *pll_ref_hws[] = {\n+\t\u0026pll_ref_clk.common.hw\n+};\n+\n+/*\n+ * There is a non-software-configurable mux selecting between the DCXO and the\n+ * PLL_REF in hardware, whose output is fed to the sys-24M clock. Although both\n+ * sys-24M and pll-ref are fixed at 24 MHz, define a 1:1 fixed factor clock to\n+ * provide logical separation:\n+ * - pll-ref is dedicated to feeding other PLLs\n+ * - sys-24M serves as reference clock for downstream functional modules\n+ */\n+static CLK_FIXED_FACTOR_HWS(sys_24M_clk, \"sys-24M\", pll_ref_hws, 1, 1, 0);\n+static const struct clk_hw *sys_24M_hws[] = {\n+\t\u0026sys_24M_clk.hw\n+};\n+\n+#define SUN60I_A733_PLL_DDR_REG\t\t0x020\n+static struct ccu_nkmp pll_ddr_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(20, 3), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_DDR_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-ddr\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE |\n+\t\t\t\t\t\t\t CLK_IS_CRITICAL),\n+\t},\n+};\n+\n+/*\n+ * There is no actual clock output with that frequency (2.4 GHz), instead it\n+ * has multiple outputs with adjustable dividers from that base frequency.\n+ * Model them separately as divider clocks based on that parent here.\n+ */\n+#define SUN60I_A733_PLL_PERIPH0_REG\t0x0a0\n+static struct ccu_nm pll_periph0_4x_clk = {\n+\t.enable\t\t= BIT(25) | BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_PERIPH0_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-periph0-4x\",\n+\t\t\t\t\t\t\t pll_ref_hws, \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_periph0_4x_hws[] = {\n+\t\u0026pll_periph0_4x_clk.common.hw\n+};\n+\n+static SUNXI_CCU_M_HWS(pll_periph0_2x_clk, \"pll-periph0-2x\", pll_periph0_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH0_REG, 20, 3, 0);\n+static const struct clk_hw *pll_periph0_2x_hws[] = {\n+\t\u0026pll_periph0_2x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_periph0_800M_clk, \"pll-periph0-800M\", pll_periph0_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH0_REG, 16, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_periph0_480M_clk, \"pll-periph0-480M\", pll_periph0_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH0_REG, 2, 3, 0);\n+static const struct clk_hw *pll_periph0_480M_hws[] = {\n+\t\u0026pll_periph0_480M_clk.common.hw\n+};\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_600M_clk, \"pll-periph0-600M\",\n+\t\t\t pll_periph0_2x_hws, 2, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_400M_clk, \"pll-periph0-400M\",\n+\t\t\t pll_periph0_2x_hws, 3, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_300M_clk, \"pll-periph0-300M\",\n+\t\t\t pll_periph0_2x_hws, 4, 1, 0);\n+static const struct clk_hw *pll_periph0_300M_hws[] = {\n+\t\u0026pll_periph0_300M_clk.hw\n+};\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_200M_clk, \"pll-periph0-200M\",\n+\t\t\t pll_periph0_2x_hws, 6, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_150M_clk, \"pll-periph0-150M\",\n+\t\t\t pll_periph0_2x_hws, 8, 1, 0);\n+static const struct clk_hw *pll_periph0_150M_hws[] = {\n+\t\u0026pll_periph0_150M_clk.hw\n+};\n+static CLK_FIXED_FACTOR_HWS(pll_periph0_160M_clk, \"pll-periph0-160M\",\n+\t\t\t pll_periph0_480M_hws, 3, 1, 0);\n+\n+#define SUN60I_A733_PLL_PERIPH1_REG\t0x0c0\n+static struct ccu_nm pll_periph1_4x_clk = {\n+\t.enable\t\t= BIT(25) | BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_PERIPH1_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-periph1-4x\",\n+\t\t\t\t\t\t\t pll_ref_hws, \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_periph1_4x_hws[] = {\n+\t\u0026pll_periph1_4x_clk.common.hw\n+};\n+\n+static SUNXI_CCU_M_HWS(pll_periph1_2x_clk, \"pll-periph1-2x\", pll_periph1_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH1_REG, 20, 3, 0);\n+static const struct clk_hw *pll_periph1_2x_hws[] = {\n+\t\u0026pll_periph1_2x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_periph1_800M_clk, \"pll-periph1-800M\", pll_periph1_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH1_REG, 16, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_periph1_480M_clk, \"pll-periph1-480M\", pll_periph1_4x_hws,\n+\t\t SUN60I_A733_PLL_PERIPH1_REG, 2, 3, 0);\n+static const struct clk_hw *pll_periph1_480M_hws[] = {\n+\t\u0026pll_periph1_480M_clk.common.hw\n+};\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_600M_clk, \"pll-periph1-600M\",\n+\t\t\t pll_periph1_2x_hws, 2, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_400M_clk, \"pll-periph1-400M\",\n+\t\t\t pll_periph1_2x_hws, 3, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_300M_clk, \"pll-periph1-300M\",\n+\t\t\t pll_periph1_2x_hws, 4, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_200M_clk, \"pll-periph1-200M\",\n+\t\t\t pll_periph1_2x_hws, 6, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_150M_clk, \"pll-periph1-150M\",\n+\t\t\t pll_periph1_2x_hws, 8, 1, 0);\n+static CLK_FIXED_FACTOR_HWS(pll_periph1_160M_clk, \"pll-periph1-160M\",\n+\t\t\t pll_periph1_480M_hws, 3, 1, 0);\n+\n+#define SUN60I_A733_PLL_GPU_REG\t\t0x0e0\n+static struct ccu_nkmp pll_gpu0_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(20, 3), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_GPU_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-gpu0\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+#define SUN60I_A733_PLL_VIDEO0_REG\t0x120\n+static struct ccu_nm pll_video0_12x_clk = {\n+\t.enable\t\t= BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_VIDEO0_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-video0-12x\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_video0_12x_hws[] = {\n+\t\u0026pll_video0_12x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_video0_4x_clk, \"pll-video0-4x\", pll_video0_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO0_REG, 20, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_video0_3x_clk, \"pll-video0-3x\", pll_video0_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO0_REG, 16, 3, 0);\n+\n+#define SUN60I_A733_PLL_VIDEO1_REG\t0x140\n+static struct ccu_nm pll_video1_12x_clk = {\n+\t.enable\t\t= BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_VIDEO1_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-video1-12x\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_video1_12x_hws[] = {\n+\t\u0026pll_video1_12x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_video1_4x_clk, \"pll-video1-4x\", pll_video1_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO1_REG, 20, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_video1_3x_clk, \"pll-video1-3x\", pll_video1_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO1_REG, 16, 3, 0);\n+\n+#define SUN60I_A733_PLL_VIDEO2_REG\t0x160\n+static struct ccu_nm pll_video2_12x_clk = {\n+\t.enable\t\t= BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_VIDEO2_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-video2-12x\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_video2_12x_hws[] = {\n+\t\u0026pll_video2_12x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_video2_4x_clk, \"pll-video2-4x\", pll_video2_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO2_REG, 20, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_video2_3x_clk, \"pll-video2-3x\", pll_video2_12x_hws,\n+\t\t SUN60I_A733_PLL_VIDEO2_REG, 16, 3, 0);\n+\n+#define SUN60I_A733_PLL_VE0_REG\t\t0x220\n+static struct ccu_nkmp pll_ve0_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(20, 3), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_VE0_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-ve0\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+#define SUN60I_A733_PLL_VE1_REG\t\t0x240\n+static struct ccu_nkmp pll_ve1_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(20, 3), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_VE1_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-ve1\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+/*\n+ * PLL_AUDIO0 has a m1 divider in addition to the usual N, M factors.\n+ * Since we only need some fixed frequency from this PLL (22.5792MHz x 4),\n+ * ignore the divider and force it to 1 (encoded as 0), in the probe function\n+ * below.\n+ * The M factor must be an even number to produce a 50% duty cycle output.\n+ */\n+#define SUN60I_A733_PLL_AUDIO0_REG\t0x260\n+static struct ccu_sdm_setting pll_audio0_sdm_table[] = {\n+\t{ .rate = 90316800, .pattern = 0xa002872b, .m = 20, .n = 75 }, /* 22.5792 * 4 */\n+};\n+\n+static struct ccu_nm pll_audio0_4x_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(16, 7),\n+\t.sdm\t\t= _SUNXI_CCU_SDM_DUAL_PAT(pll_audio0_sdm_table, 0,\n+\t\t\t\t\t\t 0x268, BIT(31),\n+\t\t\t\t\t\t 0x26c, BIT(27) | BIT(31)),\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_AUDIO0_REG,\n+\t\t.features\t= CCU_FEATURE_SIGMA_DELTA_MOD,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-audio0-4x\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+#define SUN60I_A733_PLL_AUDIO1_REG\t0x280\n+static struct ccu_nm pll_audio1_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1),\t/* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_AUDIO1_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-audio1\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_audio1_hws[] = {\n+\t\u0026pll_audio1_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_audio1_div2_clk, \"pll-audio1-div2\", pll_audio1_hws,\n+\t\t SUN60I_A733_PLL_AUDIO1_REG, 20, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_audio1_div5_clk, \"pll-audio1-div5\", pll_audio1_hws,\n+\t\t SUN60I_A733_PLL_AUDIO1_REG, 16, 3, 0);\n+\n+#define SUN60I_A733_PLL_NPU_REG\t\t0x2a0\n+static struct ccu_nkmp pll_npu_clk = {\n+\t.enable\t\t= BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(20, 3), /* output divider */\n+\t.p\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_NPU_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-npu\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nkmp_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+#define SUN60I_A733_PLL_DE_REG\t\t0x2e0\n+static struct ccu_nm pll_de_12x_clk = {\n+\t.enable\t\t= BIT(26) | BIT(27),\n+\t.lock\t\t= BIT(28),\n+\t.n\t\t= _SUNXI_CCU_MULT_MIN(8, 8, 11),\n+\t.m\t\t= _SUNXI_CCU_DIV(1, 1), /* input divider */\n+\t.common\t\t= {\n+\t\t.reg\t\t= SUN60I_A733_PLL_DE_REG,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_HW(\"pll-de-12x\", pll_ref_hws,\n+\t\t\t\t\t\t\t \u0026ccu_nm_ops,\n+\t\t\t\t\t\t\t CLK_SET_RATE_GATE),\n+\t},\n+};\n+\n+static const struct clk_hw *pll_de_hws[] = {\n+\t\u0026pll_de_12x_clk.common.hw\n+};\n+static SUNXI_CCU_M_HWS(pll_de_4x_clk, \"pll-de-4x\", pll_de_hws,\n+\t\t SUN60I_A733_PLL_DE_REG, 20, 3, 0);\n+static SUNXI_CCU_M_HWS(pll_de_3x_clk, \"pll-de-3x\", pll_de_hws,\n+\t\t SUN60I_A733_PLL_DE_REG, 16, 3, 0);\n+\n+/**************************************************************************\n+ * bus clocks *\n+ **************************************************************************/\n+\n+static const struct clk_parent_data ahb_apb_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw },\n+};\n+\n+static SUNXI_CCU_M_DATA_WITH_MUX(ahb_clk, \"ahb\", ahb_apb_parents, 0x500,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 24, 2,\t\t/* mux */\n+\t\t\t\t 0);\n+static const struct clk_hw *ahb_hws[] = { \u0026ahb_clk.common.hw };\n+\n+static SUNXI_CCU_M_DATA_WITH_MUX(apb0_clk, \"apb0\", ahb_apb_parents, 0x510,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 24, 2,\t\t/* mux */\n+\t\t\t\t 0);\n+static const struct clk_hw *apb0_hws[] = { \u0026apb0_clk.common.hw };\n+\n+static SUNXI_CCU_M_DATA_WITH_MUX(apb1_clk, \"apb1\", ahb_apb_parents, 0x518,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 24, 2,\t\t/* mux */\n+\t\t\t\t 0);\n+static const struct clk_hw *apb1_hws[] = { \u0026apb1_clk.common.hw };\n+\n+static const struct clk_parent_data apb_uart_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_480M_clk.common.hw },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX(apb_uart_clk, \"apb-uart\", apb_uart_parents, 0x538,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t 0);\n+static const struct clk_hw *apb_uart_hws[] = {\n+\t\u0026apb_uart_clk.common.hw\n+};\n+\n+static const struct clk_parent_data trace_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_400M_clk.hw },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(trace_clk, \"trace\", trace_parents, 0x540,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_DATA(bus_its_pcie0_aclk_clk, \"bus-its-pcie0-aclk\", hosc, 0x574, BIT(1), 0);\n+\n+static const struct clk_parent_data mbus_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_600M_clk.hw },\n+\t{ .hw = \u0026pll_ddr_clk.common.hw },\n+\t{ .hw = \u0026pll_periph1_480M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph1_400M_clk.hw },\n+\t{ .hw = \u0026pll_npu_clk.common.hw },\n+};\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT(mbus_clk, \"mbus\", mbus_parents, 0x588,\n+\t\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t\t 0, 0,\t/* no P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t CLK_IS_CRITICAL,\n+\t\t\t\t\t CCU_FEATURE_UPDATE_BIT);\n+static const struct clk_hw *mbus_hws[] = { \u0026mbus_clk.common.hw };\n+\n+static SUNXI_CCU_GATE_HWS(mbus_iommu0_sys_clk, \"mbus-iommu0-sys\", mbus_hws, 0x58c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(apb_iommu0_sys_clk, \"apb-iommu0-sys\", apb0_hws, 0x58c, BIT(1), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_iommu0_sys_clk, \"ahb-iommu0-sys\", ahb_hws, 0x58c, BIT(2), 0);\n+\n+static SUNXI_CCU_GATE_DATA(bus_msi_lite0_clk, \"bus-msi-lite0\", hosc, 0x594, BIT(0), 0);\n+static SUNXI_CCU_GATE_DATA(bus_msi_lite1_clk, \"bus-msi-lite1\", hosc, 0x59c, BIT(0), 0);\n+static SUNXI_CCU_GATE_DATA(bus_msi_lite2_clk, \"bus-msi-lite2\", hosc, 0x5a4, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(mbus_iommu1_sys_clk, \"mbus-iommu1-sys\", mbus_hws, 0x5b4, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(apb_iommu1_sys_clk, \"apb_iommu1-sys\", apb0_hws, 0x5b4, BIT(1), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_iommu1_sys_clk, \"ahb_iommu1-sys\", ahb_hws, 0x5b4, BIT(2), 0);\n+\n+static SUNXI_CCU_GATE_HWS(ahb_ve_dec_clk, \"ahb-ve-dec\", ahb_hws,\n+\t\t\t 0x5c0, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_ve_enc_clk, \"ahb-ve-enc\", ahb_hws,\n+\t\t\t 0x5c0, BIT(1), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_vid_in_clk, \"ahb-vid-in\", ahb_hws,\n+\t\t\t 0x5c0, BIT(2), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_vid_cout0_clk, \"ahb-vid-cout0\", ahb_hws,\n+\t\t\t 0x5c0, BIT(3), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_vid_cout1_clk, \"ahb-vid-cout1\", ahb_hws,\n+\t\t\t 0x5c0, BIT(4), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_de_clk, \"ahb-de\", ahb_hws,\n+\t\t\t 0x5c0, BIT(5), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_npu_clk, \"ahb-npu\", ahb_hws,\n+\t\t\t 0x5c0, BIT(6), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_gpu0_clk, \"ahb-gpu0\", ahb_hws,\n+\t\t\t 0x5c0, BIT(7), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_serdes_clk, \"ahb-serdes\", ahb_hws,\n+\t\t\t 0x5c0, BIT(8), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_usb_sys_clk, \"ahb-usb-sys\", ahb_hws,\n+\t\t\t 0x5c0, BIT(9), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_msi_lite0_clk, \"ahb-msi-lite0\", ahb_hws,\n+\t\t\t 0x5c0, BIT(16), 0);\n+static SUNXI_CCU_GATE_HWS(ahb_store_clk, \"ahb-store\", ahb_hws,\n+\t\t\t 0x5c0, BIT(24), CLK_IS_CRITICAL);\n+static SUNXI_CCU_GATE_HWS(ahb_cpus_clk, \"ahb-cpus\", ahb_hws,\n+\t\t\t 0x5c0, BIT(28), 0);\n+\n+static SUNXI_CCU_GATE_HWS(mbus_iommu0_clk, \"mbus-iommu0\", mbus_hws,\n+\t\t\t 0x5e0, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_iommu1_clk, \"mbus-iommu1\", mbus_hws,\n+\t\t\t 0x5e0, BIT(1), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_desys_clk, \"mbus-desys\", mbus_hws,\n+\t\t\t 0x5e0, BIT(11), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_ve_enc0_gate_clk, \"mbus-ve-enc0-gate\", mbus_hws,\n+\t\t\t 0x5e0, BIT(12), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_ve_dec0_gate_clk, \"mbus-ve-dec0-gate\", mbus_hws,\n+\t\t\t 0x5e0, BIT(14), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_gpu0_clk, \"mbus-gpu0\", mbus_hws,\n+\t\t\t 0x5e0, BIT(16), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_npu_clk, \"mbus-npu\", mbus_hws,\n+\t\t\t 0x5e0, BIT(18), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_vid_in_clk, \"mbus-vid-in\", mbus_hws,\n+\t\t\t 0x5e0, BIT(24), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_serdes_clk, \"mbus-serdes\", mbus_hws,\n+\t\t\t 0x5e0, BIT(28), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_msi_lite0_clk, \"mbus-msi-lite0\", mbus_hws,\n+\t\t\t 0x5e0, BIT(29), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_store_clk, \"mbus-store\", mbus_hws,\n+\t\t\t 0x5e0, BIT(30), CLK_IS_CRITICAL);\n+static SUNXI_CCU_GATE_HWS(mbus_msi_lite2_clk, \"mbus-msi-lite2\", mbus_hws,\n+\t\t\t 0x5e0, BIT(31), 0);\n+\n+static SUNXI_CCU_GATE_HWS(mbus_dma0_clk, \"mbus-dma0\", mbus_hws,\n+\t\t\t 0x5e4, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_ve_enc0_clk, \"mbus-ve-enc0\", mbus_hws,\n+\t\t\t 0x5e4, BIT(1), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_ce_clk, \"mbus-ce\", mbus_hws,\n+\t\t\t 0x5e4, BIT(2), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_dma1_clk, \"mbus-dma1\", mbus_hws,\n+\t\t\t 0x5e4, BIT(3), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_nand_clk, \"mbus-nand\", mbus_hws,\n+\t\t\t 0x5e4, BIT(5), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_csi_clk, \"mbus-csi\", mbus_hws,\n+\t\t\t 0x5e4, BIT(8), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_isp_clk, \"mbus-isp\", mbus_hws,\n+\t\t\t 0x5e4, BIT(9), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_gmac0_clk, \"mbus-gmac0\", mbus_hws,\n+\t\t\t 0x5e4, BIT(11), 0);\n+/* Undocumented, taken from the vendor kernel. */\n+static SUNXI_CCU_GATE_HWS(mbus_gmac1_clk, \"mbus-gmac1\", mbus_hws,\n+\t\t\t 0x5e4, BIT(12), 0);\n+static SUNXI_CCU_GATE_HWS(mbus_ve_dec0_clk, \"mbus-ve-dec0\", mbus_hws,\n+\t\t\t 0x5e4, BIT(18), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_dma0_clk, \"bus-dma0\", ahb_hws,\n+\t\t\t 0x704, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_dma1_clk, \"bus-dma1\", ahb_hws,\n+\t\t\t 0x70c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_spinlock_clk, \"bus-spinlock\", ahb_hws,\n+\t\t\t 0x724, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_msgbox0_clk, \"bus-msgbox0\", ahb_hws,\n+\t\t\t 0x744, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_pwm0_clk, \"bus-pwm0\", apb0_hws,\n+\t\t\t 0x784, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_pwm1_clk, \"bus-pwm1\", apb0_hws,\n+\t\t\t 0x78c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_dbg_clk, \"bus-dbg\", sys_24M_hws,\n+\t\t\t 0x7a4, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_sysdap_clk, \"bus-sysdap\", apb1_hws,\n+\t\t\t 0x7ac, BIT(0), 0);\n+\n+/**************************************************************************\n+ * mod clocks with gates *\n+ **************************************************************************/\n+\n+static const struct clk_parent_data timer_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .fw_name = \"losc\" },\n+\t{ .hw = \u0026pll_periph0_200M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer0_clk, \"timer0\", timer_parents, 0x800,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer1_clk, \"timer1\", timer_parents, 0x804,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer2_clk, \"timer2\", timer_parents, 0x808,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer3_clk, \"timer3\", timer_parents, 0x80c,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer4_clk, \"timer4\", timer_parents, 0x810,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer5_clk, \"timer5\", timer_parents, 0x814,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer6_clk, \"timer6\", timer_parents, 0x818,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer7_clk, \"timer7\", timer_parents, 0x81c,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer8_clk, \"timer8\", timer_parents, 0x820,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer9_clk, \"timer9\", timer_parents, 0x824,\n+\t\t\t\t 0, 0,\t\t/* no M */\n+\t\t\t\t 0, 3,\t\t/* P */\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_timer_clk, \"bus-timer\", ahb_hws, 0x850, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static const struct clk_parent_data avs_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(avs_clk, \"avs-clk\", avs_parents, 0x880,\n+\t\t\t\t 24, 3,\t\t/* mux */\n+\t\t\t\t BIT(31),\t\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *de_parents[] = {\n+\t\u0026pll_de_3x_clk.common.hw,\n+\t\u0026pll_de_4x_clk.common.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video2_4x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(de0_clk, \"de0\", de_parents, 0xa00,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+static SUNXI_CCU_GATE_HWS(bus_de0_clk, \"bus-de0\", ahb_hws, 0xa04, BIT(0), 0);\n+\n+static const struct clk_hw *di_parents[] = {\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video2_4x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(di_clk, \"di\", di_parents, 0xa20,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+static SUNXI_CCU_GATE_HWS(bus_di_clk, \"bus-di\", ahb_hws, 0xa24, BIT(0), 0);\n+\n+static const struct clk_hw *g2d_parents[] = {\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(g2d_clk, \"g2d\", g2d_parents, 0xa40,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+static SUNXI_CCU_GATE_HWS(bus_g2d_clk, \"bus-g2d\", ahb_hws, 0xa44, BIT(0), 0);\n+\n+static const struct clk_hw *eink_parents[] = {\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(eink_clk, \"eink\", eink_parents, 0xa60,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+\n+static const struct clk_hw *eink_panel_parents[] = {\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video0_3x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+\t\u0026pll_video1_3x_clk.common.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(eink_panel_clk, \"eink-panel\", eink_panel_parents, 0xa64,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+static SUNXI_CCU_GATE_HWS(bus_eink_clk, \"bus-eink\", ahb_hws, 0xa6c, BIT(0), 0);\n+\n+static const struct clk_hw *ve_enc_parents[] = {\n+\t\u0026pll_ve0_clk.common.hw,\n+\t\u0026pll_ve1_clk.common.hw,\n+\t\u0026pll_periph0_800M_clk.common.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_de_3x_clk.common.hw,\n+\t\u0026pll_npu_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ve_enc0_clk, \"ve-enc0\", ve_enc_parents, 0xa80,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+\n+static const struct clk_hw *ve_dec_parents[] = {\n+\t\u0026pll_ve1_clk.common.hw,\n+\t\u0026pll_ve0_clk.common.hw,\n+\t\u0026pll_periph0_800M_clk.common.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_de_3x_clk.common.hw,\n+\t\u0026pll_npu_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ve_dec0_clk, \"ve-dec0\", ve_dec_parents, 0xa88,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t CLK_SET_RATE_PARENT);\n+\n+static SUNXI_CCU_GATE_HWS(bus_ve_enc0_clk, \"bus-ve-enc0\", ahb_hws, 0xa8c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_ve_dec0_clk, \"bus-ve-dec0\", ahb_hws, 0xa8c, BIT(2), 0);\n+\n+static const struct clk_hw *ce_parents[] = {\n+\t\u0026sys_24M_clk.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ce_clk, \"ce\", ce_parents, 0xac0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_ce_clk, \"bus-ce\", ahb_hws, 0xac4, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_ce_sys_clk, \"bus-ce-sys\", ahb_hws, 0xac4, BIT(1), 0);\n+\n+static const struct clk_hw *npu_parents[] = {\n+\t\u0026pll_npu_clk.common.hw,\n+\t\u0026pll_periph0_800M_clk.common.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_ve0_clk.common.hw,\n+\t\u0026pll_ve1_clk.common.hw,\n+\t\u0026pll_de_3x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(npu_clk, \"npu\", npu_parents, 0xb00,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_npu_clk, \"bus-npu\", hosc, 0xb04, BIT(0), 0);\n+\n+/*\n+ * GPU_CLK = ClockSource * ((16 - M) / 16)\n+ * Here we use a div_table to select M values that result in integer divisors.\n+ */\n+static struct clk_div_table gpu_div_table[] = {\n+\t{ .val = 0, .div = 1 },\n+\t{ .val = 8, .div = 2 },\n+\t{ .val = 12, .div = 4 },\n+\t{ .val = 14, .div = 8 },\n+\t{ .val = 15, .div = 16 },\n+\t{ /* sentinel */ },\n+};\n+static const struct clk_parent_data gpu_parents[] = {\n+\t{ .hw = \u0026pll_gpu0_clk.common.hw, },\n+\t{ .hw = \u0026pll_periph0_800M_clk.common.hw, },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_400M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_200M_clk.hw, },\n+};\n+static struct ccu_div gpu0_clk = {\n+\t.enable\t\t= BIT(31),\n+\t.div\t\t= _SUNXI_CCU_DIV_TABLE(0, 4, gpu_div_table),\n+\t.mux\t\t= _SUNXI_CCU_MUX(24, 3),\n+\t.common\t\t= {\n+\t\t.reg\t\t= 0xb20,\n+\t\t.features\t= CCU_FEATURE_UPDATE_BIT,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_DATA(\"gpu0\", gpu_parents,\n+\t\t\t\t\t\t\t \u0026ccu_div_ops, 0),\n+\t}\n+};\n+static SUNXI_CCU_GATE_HWS(bus_gpu0_clk, \"bus-gpu0\", ahb_hws, 0xb24, BIT(0), 0);\n+\n+static const struct clk_parent_data dram_parents[] = {\n+\t{ .hw = \u0026pll_ddr_clk.common.hw, },\n+\t{ .hw = \u0026pll_periph0_800M_clk.common.hw, },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw, },\n+\t{ .hw = \u0026pll_de_12x_clk.common.hw, },\n+\t{ .hw = \u0026pll_npu_clk.common.hw, },\n+};\n+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT(dram0_clk, \"dram0\", dram_parents, 0xc00,\n+\t\t\t\t\t 0, 4,\t/* M */\n+\t\t\t\t\t 0, 0,\t/* no P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t CLK_IS_CRITICAL,\n+\t\t\t\t\t CCU_FEATURE_UPDATE_BIT);\n+static SUNXI_CCU_GATE_HWS(bus_dram0_clk, \"bus-dram0\", ahb_hws, 0xc0c,\n+\t\t\t BIT(0), CLK_IS_CRITICAL);\n+\n+static const struct clk_parent_data nand_mmc_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_400M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw, },\n+\t{ .hw = \u0026pll_periph1_400M_clk.hw, },\n+\t{ .hw = \u0026pll_periph1_300M_clk.hw, },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(nand0_clk0_clk, \"nand0-clk0\", nand_mmc_parents, 0xc80,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(nand0_clk1_clk, \"nand0-clk1\", nand_mmc_parents, 0xc84,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_nand0_clk, \"bus-nand0\", ahb_hws, 0xc8c, BIT(0), 0);\n+\n+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc0_clk, \"mmc0\", nand_mmc_parents, 0xd00,\n+\t\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t\t 8, 5,\t/* P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t 2,\t\t/* post div */\n+\t\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, \"bus-mmc0\", ahb_hws, 0xd0c, BIT(0), 0);\n+\n+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc1_clk, \"mmc1\", nand_mmc_parents, 0xd10,\n+\t\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t\t 8, 5,\t/* P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t 2,\t\t/* post div */\n+\t\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_mmc1_clk, \"bus-mmc1\", ahb_hws, 0xd1c, BIT(0), 0);\n+\n+static const struct clk_parent_data mmc2_mmc3_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw, },\n+\t{ .hw = \u0026pll_periph0_800M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_800M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph1_600M_clk.hw },\n+};\n+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc2_clk, \"mmc2\", mmc2_mmc3_parents, 0xd20,\n+\t\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t\t 8, 5,\t/* P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t 2,\t\t/* post div */\n+\t\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_mmc2_clk, \"bus-mmc2\", ahb_hws, 0xd2c, BIT(0), 0);\n+\n+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc3_clk, \"mmc3\", mmc2_mmc3_parents, 0xd30,\n+\t\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t\t 8, 5,\t/* P */\n+\t\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t\t 2,\t\t/* post div */\n+\t\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_mmc3_clk, \"bus-mmc3\", ahb_hws, 0xd3c, BIT(0), 0);\n+\n+static const struct clk_hw *ufs_axi_parents[] = {\n+\t\u0026pll_periph0_300M_clk.hw,\n+\t\u0026pll_periph0_200M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ufs_axi_clk, \"ufs-axi\", ufs_axi_parents, 0xd80,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data ufs_cfg_parents[] = {\n+\t{ .hw = \u0026pll_periph0_480M_clk.common.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(ufs_cfg_clk, \"ufs-cfg\", ufs_cfg_parents, 0xd84,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_ufs_clk, \"bus-ufs\", hosc, 0xd8c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_uart0_clk, \"bus-uart0\", apb_uart_hws, 0xe00, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart1_clk, \"bus-uart1\", apb_uart_hws, 0xe04, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart2_clk, \"bus-uart2\", apb_uart_hws, 0xe08, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart3_clk, \"bus-uart3\", apb_uart_hws, 0xe0c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart4_clk, \"bus-uart4\", apb_uart_hws, 0xe10, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart5_clk, \"bus-uart5\", apb_uart_hws, 0xe14, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_uart6_clk, \"bus-uart6\", apb_uart_hws, 0xe18, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_i2c0_clk, \"bus-i2c0\", apb1_hws, 0xe80, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c1_clk, \"bus-i2c1\", apb1_hws, 0xe84, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c2_clk, \"bus-i2c2\", apb1_hws, 0xe88, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c3_clk, \"bus-i2c3\", apb1_hws, 0xe8c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c4_clk, \"bus-i2c4\", apb1_hws, 0xe90, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c5_clk, \"bus-i2c5\", apb1_hws, 0xe94, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c6_clk, \"bus-i2c6\", apb1_hws, 0xe98, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c7_clk, \"bus-i2c7\", apb1_hws, 0xe9c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c8_clk, \"bus-i2c8\", apb1_hws, 0xea0, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c9_clk, \"bus-i2c9\", apb1_hws, 0xea4, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c10_clk, \"bus-i2c10\", apb1_hws, 0xea8, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c11_clk, \"bus-i2c11\", apb1_hws, 0xeac, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_i2c12_clk, \"bus-i2c12\", apb1_hws, 0xeb0, BIT(0), 0);\n+\n+static const struct clk_parent_data spi_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_200M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_300M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_200M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_480M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph1_480M_clk.common.hw },\n+\t{ .fw_name = \"hosc\"},\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spi0_clk, \"spi0\", spi_parents, 0xf00,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spi0_clk, \"bus-spi0\", ahb_hws, 0xf04, BIT(0), 0);\n+\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spi1_clk, \"spi1\", spi_parents, 0xf08,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spi1_clk, \"bus-spi1\", ahb_hws, 0xf0c, BIT(0), 0);\n+\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spi2_clk, \"spi2\", spi_parents, 0xf10,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spi2_clk, \"bus-spi2\", ahb_hws, 0xf14, BIT(0), 0);\n+\n+static const struct clk_parent_data spif_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_400M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_400M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_300M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_160M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_160M_clk.hw },\n+\t{ .fw_name = \"hosc\"},\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spif_clk, \"spif\", spif_parents, 0xf18,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* P */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spif_clk, \"bus-spif\", ahb_hws, 0xf1c, BIT(0), 0);\n+\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spi3_clk, \"spi3\", spi_parents, 0xf20,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spi3_clk, \"bus-spi3\", ahb_hws, 0xf24, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static SUNXI_CCU_DUALDIV_MUX_GATE(spi4_clk, \"spi4\", spi_parents, 0xf28,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_spi4_clk, \"bus-spi4\", ahb_hws, 0xf2c, BIT(0), 0);\n+\n+static const struct clk_parent_data gpadc0_24m_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"hosc\"},\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(gpadc0_24m_clk, \"gpadc0-24m\", gpadc0_24m_parents, 0xfc0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_gpadc0_clk, \"bus-gpadc0\", ahb_hws, 0xfc4, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_ths0_clk, \"bus-ths0\", apb0_hws, 0xfe4, BIT(0), 0);\n+\n+static const struct clk_parent_data irrx_parents[] = {\n+\t{ .fw_name = \"losc\"},\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"hosc\"},\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(irrx_clk, \"irrx\", irrx_parents, 0x1000,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_irrx_clk, \"bus-irrx\", apb0_hws, 0x1004, BIT(0), 0);\n+\n+static const struct clk_parent_data irtx_parents[] = {\n+\t{ .fw_name = \"losc\"},\n+\t{ .hw = \u0026pll_periph1_600M_clk.hw },\n+\t{ .fw_name = \"hosc\"},\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(irtx_clk, \"irtx\", irtx_parents, 0x1008,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_irtx_clk, \"bus-irtx\", apb0_hws, 0x100c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_lradc_clk, \"bus-lradc\", apb0_hws, 0x1024, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static const struct clk_parent_data sgpio_parents[] = {\n+\t{ .fw_name = \"losc\"},\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(sgpio_clk, \"sgpio\", sgpio_parents, 0x1060,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_sgpio_clk, \"bus-sgpio\", hosc, 0x1064, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static const struct clk_hw *lpc_parents[] = {\n+\t\u0026pll_video0_3x_clk.common.hw,\n+\t\u0026pll_video1_3x_clk.common.hw,\n+\t\u0026pll_video2_3x_clk.common.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(lpc_clk, \"lpc\", lpc_parents, 0x1080,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_lpc_clk, \"bus-lpc\", hosc, 0x1084, BIT(0), 0);\n+\n+static const struct clk_hw *i2spcm_parents[] = {\n+\t\u0026pll_audio0_4x_clk.common.hw,\n+\t\u0026pll_audio1_div2_clk.common.hw,\n+\t\u0026pll_audio1_div5_clk.common.hw,\n+\t\u0026pll_periph0_200M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm0_clk, \"i2spcm0\", i2spcm_parents, 0x1200,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_i2spcm0_clk, \"bus-i2spcm0\", hosc, 0x120c, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm1_clk, \"i2spcm1\", i2spcm_parents, 0x1210,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_i2spcm1_clk, \"bus-i2spcm1\", hosc, 0x121c, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm2_clk, \"i2spcm2\", i2spcm_parents, 0x1220,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *i2spcm2_asrc_parents[] = {\n+\t\u0026pll_audio0_4x_clk.common.hw,\n+\t\u0026pll_audio1_div2_clk.common.hw,\n+\t\u0026pll_audio1_div5_clk.common.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+\t\u0026pll_periph1_300M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm2_asrc_clk, \"i2spcm2_asrc\", i2spcm2_asrc_parents, 0x1224,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_DATA(bus_i2spcm2_clk, \"bus-i2spcm2\", hosc, 0x122c, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm3_clk, \"i2spcm3\", i2spcm_parents, 0x1230,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_i2spcm3_clk, \"bus-i2spcm3\", hosc, 0x123c, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm4_clk, \"i2spcm4\", i2spcm_parents, 0x1240,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_DATA(bus_i2spcm4_clk, \"bus-i2spcm4\", hosc, 0x124c, BIT(0), 0);\n+\n+static const struct clk_hw *spdif_tx_parents[] = {\n+\t\u0026pll_audio0_4x_clk.common.hw,\n+\t\u0026pll_audio1_div2_clk.common.hw,\n+\t\u0026pll_audio1_div5_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(spdif_tx_clk, \"spdif-tx\", spdif_tx_parents, 0x1280,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *spdif_rx_parents[] = {\n+\t\u0026pll_periph0_200M_clk.hw,\n+\t\u0026pll_periph0_300M_clk.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(spdif_rx_clk, \"spdif-rx\", spdif_rx_parents, 0x1284,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_spdif_clk, \"bus-spdif\", apb1_hws, 0x128c, BIT(0), 0);\n+\n+static const struct clk_hw *dmic_parents[] = {\n+\t\u0026pll_audio0_4x_clk.common.hw,\n+\t\u0026pll_audio1_div2_clk.common.hw,\n+\t\u0026pll_audio1_div5_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dmic_clk, \"dmic\", dmic_parents, 0x12c0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_dmic_clk, \"bus-dmic\", apb1_hws, 0x12cc, BIT(0), 0);\n+\n+/*\n+ * The first parent is a 48 MHz input clock divided by 4. That 48 MHz clock is\n+ * a 2x multiplier from pll-ref synchronized by pll-periph0, and is also used by\n+ * the OHCI module.\n+ */\n+static const struct clk_parent_data usb_ohci_parents[] = {\n+\t{ .hw = \u0026pll_periph0_4x_clk.common.hw },\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+};\n+static const struct ccu_mux_fixed_prediv usb_ohci_predivs[] = {\n+\t{ .index = 0, .div = 200 },\n+\t{ .index = 1, .div = 2 },\n+};\n+\n+static struct ccu_mux usb_ohci0_clk = {\n+\t.enable\t\t= BIT(31),\n+\t.mux\t\t= {\n+\t\t.shift\t\t= 24,\n+\t\t.width\t\t= 2,\n+\t\t.fixed_predivs\t= usb_ohci_predivs,\n+\t\t.n_predivs\t= ARRAY_SIZE(usb_ohci_predivs),\n+\t},\n+\t.common\t\t= {\n+\t\t.reg\t\t= 0x1300,\n+\t\t.features\t= CCU_FEATURE_FIXED_PREDIV,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_DATA(\"usb-ohci0\", usb_ohci_parents,\n+\t\t\t\t\t\t\t \u0026ccu_mux_ops, 0),\n+\t},\n+};\n+static SUNXI_CCU_GATE_HWS(bus_ohci0_clk, \"bus-ohci0\", ahb_hws, 0x1304, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_ehci0_clk, \"bus-ehci0\", ahb_hws, 0x1304, BIT(4), 0);\n+static SUNXI_CCU_GATE_HWS(bus_otg_clk, \"bus-otg\", ahb_hws, 0x1304, BIT(8), 0);\n+\n+static struct ccu_mux usb_ohci1_clk = {\n+\t.enable\t\t= BIT(31),\n+\t.mux\t\t= {\n+\t\t.shift\t\t= 24,\n+\t\t.width\t\t= 2,\n+\t\t.fixed_predivs\t= usb_ohci_predivs,\n+\t\t.n_predivs\t= ARRAY_SIZE(usb_ohci_predivs),\n+\t},\n+\t.common\t\t= {\n+\t\t.reg\t\t= 0x1308,\n+\t\t.features\t= CCU_FEATURE_FIXED_PREDIV,\n+\t\t.hw.init\t= CLK_HW_INIT_PARENTS_DATA(\"usb-ohci1\", usb_ohci_parents,\n+\t\t\t\t\t\t\t \u0026ccu_mux_ops, 0),\n+\t},\n+};\n+static SUNXI_CCU_GATE_HWS(bus_ohci1_clk, \"bus-ohci1\", ahb_hws, 0x130c, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_ehci1_clk, \"bus-ehci1\", ahb_hws, 0x130c, BIT(4), 0);\n+\n+static const struct clk_parent_data usb01_ref_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_MUX_DATA(usb01_ref_clk, \"usb01-ref\", usb01_ref_parents, 0x1340, 24, 3, 0);\n+\n+static SUNXI_CCU_MUX_DATA(usb2_u2_ref_clk, \"usb2-u2-ref\", usb01_ref_parents, 0x1348, 24, 3, 0);\n+\n+static const struct clk_parent_data usb2_suspend_parents[] = {\n+\t{ .fw_name = \"losc\" },\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_suspend_clk, \"usb2-suspend\", usb2_suspend_parents,\n+\t\t\t\t 0x1350,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 1,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data usb2_mf_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_mf_clk, \"usb2-mf\", usb2_mf_parents,\n+\t\t\t\t 0x1354,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data usb2_u3_utmi_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_300M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_u3_utmi_clk, \"usb2-u3-utmi\", usb2_u3_utmi_parents,\n+\t\t\t\t 0x1360,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data usb2_u2_pipe_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_480M_clk.common.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_u2_pipe_clk, \"usb2-u2-pipe\", usb2_u2_pipe_parents,\n+\t\t\t\t 0x1364,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data pcie_aux_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(pcie_aux_clk, \"pcie-aux\", pcie_aux_parents, 0x1380,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 1,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *pcie_axi_slv_parents[] = {\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(pcie_axi_slv_clk, \"pcie-axi-slv\", pcie_axi_slv_parents, 0x1384,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *serdes_phy_parents[] = {\n+\t\u0026sys_24M_clk.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(serdes_phy_clk, \"serdes-phy\", serdes_phy_parents, 0x13c0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data gmac_ptp_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_200M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(gmac_ptp_clk, \"gmac-ptp\", gmac_ptp_parents, 0x1400,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_M_HWS_WITH_GATE(gmac0_phy_clk, \"gmac0-phy\", pll_periph0_150M_hws, 0x1410,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_gmac0_clk, \"bus-gmac0\", ahb_hws, 0x141c, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static SUNXI_CCU_M_HWS_WITH_GATE(gmac1_phy_clk, \"gmac1-phy\", pll_periph0_150M_hws, 0x1420,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_gmac1_clk, \"bus-gmac1\", ahb_hws, 0x142c, BIT(0), 0);\n+\n+static const struct clk_hw *tcon_lcd_parents[] = {\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+\t\u0026pll_video2_4x_clk.common.hw,\n+\t\u0026pll_periph0_2x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd0_clk, \"tcon-lcd0\", tcon_lcd_parents, 0x1500,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd0_clk, \"bus-tcon-lcd0\", ahb_hws, 0x1504, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd1_clk, \"tcon-lcd1\", tcon_lcd_parents, 0x1508,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd1_clk, \"bus-tcon-lcd1\", ahb_hws, 0x150c, BIT(0), 0);\n+\n+/* Undocumented, taken from the vendor kernel. */\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd2_clk, \"tcon-lcd2\", tcon_lcd_parents, 0x1510,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd2_clk, \"bus-tcon-lcd2\", ahb_hws, 0x1514, BIT(0), 0);\n+\n+static const struct clk_hw *dsi_parents[] = {\n+\t\u0026sys_24M_clk.hw,\n+\t\u0026pll_periph0_200M_clk.hw,\n+\t\u0026pll_periph0_150M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dsi0_clk, \"dsi0\", dsi_parents, 0x1580,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_dsi0_clk, \"bus-dsi0\", ahb_hws, 0x1584, BIT(0), 0);\n+\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dsi1_clk, \"dsi1\", dsi_parents, 0x1588,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_dsi1_clk, \"bus-dsi1\", ahb_hws, 0x158c, BIT(0), 0);\n+\n+static const struct clk_hw *combphy_parents[] = {\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+\t\u0026pll_video2_4x_clk.common.hw,\n+\t\u0026pll_periph0_2x_clk.common.hw,\n+\t\u0026pll_video0_3x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(combphy0_clk, \"combphy0\", combphy_parents, 0x15c0,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(combphy1_clk, \"combphy1\", combphy_parents, 0x15c4,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_tcon_tv0_clk, \"bus-tcon-tv0\", ahb_hws, 0x1604, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_tcon_tv1_clk, \"bus-tcon-tv1\", ahb_hws, 0x160c, BIT(0), 0);\n+\n+static const struct clk_hw *edp_tv_parents[] = {\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+\t\u0026pll_video2_4x_clk.common.hw,\n+\t\u0026pll_periph0_2x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(edp_tv_clk, \"edp-tv\", edp_tv_parents, 0x1640,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_edp_tv_clk, \"bus-edp-tv\", ahb_hws, 0x164c, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(hdmi_cec_32k_clk, \"hdmi-cec-32k\", pll_periph0_2x_hws, 0x1680,\n+\t\t\t\t BIT(30),\t/* gate */\n+\t\t\t\t 36621,\t/* pre div */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data hdmi_cec_parents[] = {\n+\t{ .fw_name = \"losc\" },\n+\t{ .hw = \u0026hdmi_cec_32k_clk.common.hw },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(hdmi_cec_clk, \"hdmi-cec\", hdmi_cec_parents, 0x1680,\n+\t\t\t\t 24, 1,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data hdmi_tv_parents[] = {\n+\t{ .hw = \u0026pll_video0_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video1_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video2_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_periph0_2x_clk.common.hw },\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(hdmi_tv_clk, \"hdmi-tv\", hdmi_tv_parents, 0x1684,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_hdmi_tv_clk, \"bus-hdmi-tv\", ahb_hws, 0x168c, BIT(0), 0);\n+\n+static const struct clk_parent_data hdmi_sfr_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(hdmi_sfr_clk, \"hdmi-sfr\", hdmi_sfr_parents, 0x1690,\n+\t\t\t\t 24, 1,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HWS(hdcp_esm_clk, \"hdcp-esm\", pll_periph0_300M_hws, 0x1694, BIT(31), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_dpss_top0_clk, \"bus-dpss-top0\", ahb_hws, 0x16c4, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS(bus_dpss_top1_clk, \"bus-dpss-top1\", ahb_hws, 0x16cc, BIT(0), 0);\n+\n+static const struct clk_parent_data ledc_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_periph0_600M_clk.hw },\n+\t{ .fw_name = \"hosc\" },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(ledc_clk, \"ledc\", ledc_parents, 0x1700,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_ledc_clk, \"bus-ledc\", apb0_hws, 0x1704, BIT(0), 0);\n+\n+static SUNXI_CCU_GATE_HWS(bus_dsc_clk, \"bus-dsc\", ahb_hws, 0x1744, BIT(0), 0);\n+\n+static const struct clk_parent_data csi_master_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .hw = \u0026pll_video0_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video0_3x_clk.common.hw },\n+\t{ .hw = \u0026pll_video1_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video1_3x_clk.common.hw },\n+\t{ .hw = \u0026pll_video2_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video2_3x_clk.common.hw },\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master0_clk, \"csi_master0\", csi_master_parents, 0x1800,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master1_clk, \"csi_master1\", csi_master_parents, 0x1804,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master2_clk, \"csi_master2\", csi_master_parents, 0x1808,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_hw *csi_parents[] = {\n+\t\u0026pll_video2_4x_clk.common.hw,\n+\t\u0026pll_de_4x_clk.common.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(csi_clk, \"csi\", csi_parents, 0x1840,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_GATE_HWS(bus_csi_clk, \"bus-csi\", ahb_hws, 0x1844, BIT(0), 0);\n+\n+static const struct clk_hw *isp_parents[] = {\n+\t\u0026pll_video2_4x_clk.common.hw,\n+\t\u0026pll_periph0_480M_clk.common.hw,\n+\t\u0026pll_periph0_400M_clk.hw,\n+\t\u0026pll_periph0_600M_clk.hw,\n+\t\u0026pll_video0_4x_clk.common.hw,\n+\t\u0026pll_video1_4x_clk.common.hw,\n+};\n+static SUNXI_CCU_M_HW_WITH_MUX_GATE(isp_clk, \"isp\", isp_parents, 0x1860,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_DATA(res_dcap_24m_clk, \"res-dcap-24m\", hosc, 0x1a00, BIT(3), 0);\n+\n+static const struct clk_parent_data apb2jtag_parents[] = {\n+\t{ .hw = \u0026sys_24M_clk.hw },\n+\t{ .fw_name = \"losc\" },\n+\t{ .fw_name = \"iosc\" },\n+\t{ .hw = \u0026pll_periph0_480M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph1_480M_clk.common.hw },\n+\t{ .hw = \u0026pll_periph0_200M_clk.hw },\n+\t{ .hw = \u0026pll_periph1_200M_clk.hw },\n+};\n+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(apb2jtag_clk, \"apb2jtag\", apb2jtag_parents, 0x1c00,\n+\t\t\t\t 0, 5,\t/* M */\n+\t\t\t\t 24, 3,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static SUNXI_CCU_GATE_HWS(fanout_24M_clk, \"fanout-24M\", sys_24M_hws, 0x1f30, BIT(0), 0);\n+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_12M_clk, \"fanout-12M\", sys_24M_hws, 0x1f30,\n+\t\t\t\t BIT(1), 2, 0);\n+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_16M_clk, \"fanout-16M\", pll_periph0_480M_hws, 0x1f30,\n+\t\t\t\t BIT(2), 30, 0);\n+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_25M_clk, \"fanout-25M\", pll_periph0_2x_hws, 0x1f30,\n+\t\t\t\t BIT(3), 48, 0);\n+\n+static const struct clk_parent_data fanout_27M_parents[] = {\n+\t{ .hw = \u0026pll_video0_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video1_4x_clk.common.hw },\n+\t{ .hw = \u0026pll_video2_4x_clk.common.hw },\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(fanout_27M_clk, \"fanout-27M\", fanout_27M_parents, 0x1f34,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 8, 5,\t\t/* N */\n+\t\t\t\t 24, 2,\t/* mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data fanout_pclk_parents[] = {\n+\t{ .hw = \u0026apb0_clk.common.hw }\n+};\n+static SUNXI_CCU_DUALDIV_MUX_GATE(fanout_pclk_clk, \"fanout-pclk\", fanout_pclk_parents, 0x1f38,\n+\t\t\t\t 0, 5,\t\t/* M */\n+\t\t\t\t 5, 5,\t\t/* N */\n+\t\t\t\t 0, 0,\t\t/* no mux */\n+\t\t\t\t BIT(31),\t/* gate */\n+\t\t\t\t 0);\n+\n+static const struct clk_parent_data fanout_parents[] = {\n+\t{ .fw_name = \"losc-fanout\" },\n+\t{ .hw = \u0026fanout_12M_clk.common.hw, },\n+\t{ .hw = \u0026fanout_16M_clk.common.hw, },\n+\t{ .hw = \u0026fanout_24M_clk.common.hw, },\n+\t{ .hw = \u0026fanout_25M_clk.common.hw, },\n+\t{ .hw = \u0026fanout_27M_clk.common.hw, },\n+\t{ .hw = \u0026fanout_pclk_clk.common.hw, },\n+};\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout0_clk, \"fanout0\", fanout_parents, 0x1f3c,\n+\t\t\t\t 0, 3,\t/* mux */\n+\t\t\t\t BIT(21),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout1_clk, \"fanout1\", fanout_parents, 0x1f3c,\n+\t\t\t\t 3, 3,\t/* mux */\n+\t\t\t\t BIT(22),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout2_clk, \"fanout2\", fanout_parents, 0x1f3c,\n+\t\t\t\t 6, 3,\t/* mux */\n+\t\t\t\t BIT(23),\t/* gate */\n+\t\t\t\t 0);\n+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout3_clk, \"fanout3\", fanout_parents, 0x1f3c,\n+\t\t\t\t 9, 3,\t/* mux */\n+\t\t\t\t BIT(24),\t/* gate */\n+\t\t\t\t 0);\n+\n+/*\n+ * Contains all clocks that are controlled by a hardware register. They\n+ * have a (sunxi) .common member, which needs to be initialised by the common\n+ * sunxi CCU code, to be filled with the MMIO base address and the shared lock.\n+ */\n+static struct ccu_common *sun60i_a733_ccu_clks[] = {\n+\t\u0026pll_ref_clk.common,\n+\t\u0026pll_ddr_clk.common,\n+\t\u0026pll_periph0_4x_clk.common,\n+\t\u0026pll_periph0_2x_clk.common,\n+\t\u0026pll_periph0_800M_clk.common,\n+\t\u0026pll_periph0_480M_clk.common,\n+\t\u0026pll_periph1_4x_clk.common,\n+\t\u0026pll_periph1_2x_clk.common,\n+\t\u0026pll_periph1_800M_clk.common,\n+\t\u0026pll_periph1_480M_clk.common,\n+\t\u0026pll_gpu0_clk.common,\n+\t\u0026pll_video0_12x_clk.common,\n+\t\u0026pll_video0_4x_clk.common,\n+\t\u0026pll_video0_3x_clk.common,\n+\t\u0026pll_video1_12x_clk.common,\n+\t\u0026pll_video1_4x_clk.common,\n+\t\u0026pll_video1_3x_clk.common,\n+\t\u0026pll_video2_12x_clk.common,\n+\t\u0026pll_video2_4x_clk.common,\n+\t\u0026pll_video2_3x_clk.common,\n+\t\u0026pll_ve0_clk.common,\n+\t\u0026pll_ve1_clk.common,\n+\t\u0026pll_audio0_4x_clk.common,\n+\t\u0026pll_audio1_clk.common,\n+\t\u0026pll_audio1_div2_clk.common,\n+\t\u0026pll_audio1_div5_clk.common,\n+\t\u0026pll_npu_clk.common,\n+\t\u0026pll_de_12x_clk.common,\n+\t\u0026pll_de_4x_clk.common,\n+\t\u0026pll_de_3x_clk.common,\n+\t\u0026ahb_clk.common,\n+\t\u0026apb0_clk.common,\n+\t\u0026apb1_clk.common,\n+\t\u0026apb_uart_clk.common,\n+\t\u0026trace_clk.common,\n+\t\u0026bus_its_pcie0_aclk_clk.common,\n+\t\u0026mbus_clk.common,\n+\t\u0026mbus_iommu0_sys_clk.common,\n+\t\u0026apb_iommu0_sys_clk.common,\n+\t\u0026ahb_iommu0_sys_clk.common,\n+\t\u0026bus_msi_lite0_clk.common,\n+\t\u0026bus_msi_lite1_clk.common,\n+\t\u0026bus_msi_lite2_clk.common,\n+\t\u0026mbus_iommu1_sys_clk.common,\n+\t\u0026apb_iommu1_sys_clk.common,\n+\t\u0026ahb_iommu1_sys_clk.common,\n+\t\u0026ahb_ve_dec_clk.common,\n+\t\u0026ahb_ve_enc_clk.common,\n+\t\u0026ahb_vid_in_clk.common,\n+\t\u0026ahb_vid_cout0_clk.common,\n+\t\u0026ahb_vid_cout1_clk.common,\n+\t\u0026ahb_de_clk.common,\n+\t\u0026ahb_npu_clk.common,\n+\t\u0026ahb_gpu0_clk.common,\n+\t\u0026ahb_serdes_clk.common,\n+\t\u0026ahb_usb_sys_clk.common,\n+\t\u0026ahb_msi_lite0_clk.common,\n+\t\u0026ahb_store_clk.common,\n+\t\u0026ahb_cpus_clk.common,\n+\t\u0026mbus_iommu0_clk.common,\n+\t\u0026mbus_iommu1_clk.common,\n+\t\u0026mbus_desys_clk.common,\n+\t\u0026mbus_ve_enc0_gate_clk.common,\n+\t\u0026mbus_ve_dec0_gate_clk.common,\n+\t\u0026mbus_gpu0_clk.common,\n+\t\u0026mbus_npu_clk.common,\n+\t\u0026mbus_vid_in_clk.common,\n+\t\u0026mbus_serdes_clk.common,\n+\t\u0026mbus_msi_lite0_clk.common,\n+\t\u0026mbus_store_clk.common,\n+\t\u0026mbus_msi_lite2_clk.common,\n+\t\u0026mbus_dma0_clk.common,\n+\t\u0026mbus_ve_enc0_clk.common,\n+\t\u0026mbus_ce_clk.common,\n+\t\u0026mbus_dma1_clk.common,\n+\t\u0026mbus_nand_clk.common,\n+\t\u0026mbus_csi_clk.common,\n+\t\u0026mbus_isp_clk.common,\n+\t\u0026mbus_gmac0_clk.common,\n+\t\u0026mbus_gmac1_clk.common,\n+\t\u0026mbus_ve_dec0_clk.common,\n+\t\u0026bus_dma0_clk.common,\n+\t\u0026bus_dma1_clk.common,\n+\t\u0026bus_spinlock_clk.common,\n+\t\u0026bus_msgbox0_clk.common,\n+\t\u0026bus_pwm0_clk.common,\n+\t\u0026bus_pwm1_clk.common,\n+\t\u0026bus_dbg_clk.common,\n+\t\u0026bus_sysdap_clk.common,\n+\t\u0026timer0_clk.common,\n+\t\u0026timer1_clk.common,\n+\t\u0026timer2_clk.common,\n+\t\u0026timer3_clk.common,\n+\t\u0026timer4_clk.common,\n+\t\u0026timer5_clk.common,\n+\t\u0026timer6_clk.common,\n+\t\u0026timer7_clk.common,\n+\t\u0026timer8_clk.common,\n+\t\u0026timer9_clk.common,\n+\t\u0026bus_timer_clk.common,\n+\t\u0026avs_clk.common,\n+\t\u0026de0_clk.common,\n+\t\u0026bus_de0_clk.common,\n+\t\u0026di_clk.common,\n+\t\u0026bus_di_clk.common,\n+\t\u0026g2d_clk.common,\n+\t\u0026bus_g2d_clk.common,\n+\t\u0026eink_clk.common,\n+\t\u0026eink_panel_clk.common,\n+\t\u0026bus_eink_clk.common,\n+\t\u0026ve_enc0_clk.common,\n+\t\u0026ve_dec0_clk.common,\n+\t\u0026bus_ve_enc0_clk.common,\n+\t\u0026bus_ve_dec0_clk.common,\n+\t\u0026ce_clk.common,\n+\t\u0026bus_ce_clk.common,\n+\t\u0026bus_ce_sys_clk.common,\n+\t\u0026npu_clk.common,\n+\t\u0026bus_npu_clk.common,\n+\t\u0026gpu0_clk.common,\n+\t\u0026bus_gpu0_clk.common,\n+\t\u0026dram0_clk.common,\n+\t\u0026bus_dram0_clk.common,\n+\t\u0026nand0_clk0_clk.common,\n+\t\u0026nand0_clk1_clk.common,\n+\t\u0026bus_nand0_clk.common,\n+\t\u0026mmc0_clk.common,\n+\t\u0026bus_mmc0_clk.common,\n+\t\u0026mmc1_clk.common,\n+\t\u0026bus_mmc1_clk.common,\n+\t\u0026mmc2_clk.common,\n+\t\u0026bus_mmc2_clk.common,\n+\t\u0026mmc3_clk.common,\n+\t\u0026bus_mmc3_clk.common,\n+\t\u0026ufs_axi_clk.common,\n+\t\u0026ufs_cfg_clk.common,\n+\t\u0026bus_ufs_clk.common,\n+\t\u0026bus_uart0_clk.common,\n+\t\u0026bus_uart1_clk.common,\n+\t\u0026bus_uart2_clk.common,\n+\t\u0026bus_uart3_clk.common,\n+\t\u0026bus_uart4_clk.common,\n+\t\u0026bus_uart5_clk.common,\n+\t\u0026bus_uart6_clk.common,\n+\t\u0026bus_i2c0_clk.common,\n+\t\u0026bus_i2c1_clk.common,\n+\t\u0026bus_i2c2_clk.common,\n+\t\u0026bus_i2c3_clk.common,\n+\t\u0026bus_i2c4_clk.common,\n+\t\u0026bus_i2c5_clk.common,\n+\t\u0026bus_i2c6_clk.common,\n+\t\u0026bus_i2c7_clk.common,\n+\t\u0026bus_i2c8_clk.common,\n+\t\u0026bus_i2c9_clk.common,\n+\t\u0026bus_i2c10_clk.common,\n+\t\u0026bus_i2c11_clk.common,\n+\t\u0026bus_i2c12_clk.common,\n+\t\u0026spi0_clk.common,\n+\t\u0026bus_spi0_clk.common,\n+\t\u0026spi1_clk.common,\n+\t\u0026bus_spi1_clk.common,\n+\t\u0026spi2_clk.common,\n+\t\u0026bus_spi2_clk.common,\n+\t\u0026spif_clk.common,\n+\t\u0026bus_spif_clk.common,\n+\t\u0026spi3_clk.common,\n+\t\u0026bus_spi3_clk.common,\n+\t\u0026spi4_clk.common,\n+\t\u0026bus_spi4_clk.common,\n+\t\u0026gpadc0_24m_clk.common,\n+\t\u0026bus_gpadc0_clk.common,\n+\t\u0026bus_ths0_clk.common,\n+\t\u0026irrx_clk.common,\n+\t\u0026bus_irrx_clk.common,\n+\t\u0026irtx_clk.common,\n+\t\u0026bus_irtx_clk.common,\n+\t\u0026bus_lradc_clk.common,\n+\t\u0026sgpio_clk.common,\n+\t\u0026bus_sgpio_clk.common,\n+\t\u0026lpc_clk.common,\n+\t\u0026bus_lpc_clk.common,\n+\t\u0026i2spcm0_clk.common,\n+\t\u0026bus_i2spcm0_clk.common,\n+\t\u0026i2spcm1_clk.common,\n+\t\u0026bus_i2spcm1_clk.common,\n+\t\u0026i2spcm2_clk.common,\n+\t\u0026i2spcm2_asrc_clk.common,\n+\t\u0026bus_i2spcm2_clk.common,\n+\t\u0026i2spcm3_clk.common,\n+\t\u0026bus_i2spcm3_clk.common,\n+\t\u0026i2spcm4_clk.common,\n+\t\u0026bus_i2spcm4_clk.common,\n+\t\u0026spdif_tx_clk.common,\n+\t\u0026spdif_rx_clk.common,\n+\t\u0026bus_spdif_clk.common,\n+\t\u0026dmic_clk.common,\n+\t\u0026bus_dmic_clk.common,\n+\t\u0026usb_ohci0_clk.common,\n+\t\u0026bus_ohci0_clk.common,\n+\t\u0026bus_ehci0_clk.common,\n+\t\u0026bus_otg_clk.common,\n+\t\u0026usb_ohci1_clk.common,\n+\t\u0026bus_ohci1_clk.common,\n+\t\u0026bus_ehci1_clk.common,\n+\t\u0026usb01_ref_clk.common,\n+\t\u0026usb2_u2_ref_clk.common,\n+\t\u0026usb2_suspend_clk.common,\n+\t\u0026usb2_mf_clk.common,\n+\t\u0026usb2_u3_utmi_clk.common,\n+\t\u0026usb2_u2_pipe_clk.common,\n+\t\u0026pcie_aux_clk.common,\n+\t\u0026pcie_axi_slv_clk.common,\n+\t\u0026serdes_phy_clk.common,\n+\t\u0026gmac_ptp_clk.common,\n+\t\u0026gmac0_phy_clk.common,\n+\t\u0026bus_gmac0_clk.common,\n+\t\u0026gmac1_phy_clk.common,\n+\t\u0026bus_gmac1_clk.common,\n+\t\u0026tcon_lcd0_clk.common,\n+\t\u0026bus_tcon_lcd0_clk.common,\n+\t\u0026tcon_lcd1_clk.common,\n+\t\u0026bus_tcon_lcd1_clk.common,\n+\t\u0026tcon_lcd2_clk.common,\n+\t\u0026bus_tcon_lcd2_clk.common,\n+\t\u0026dsi0_clk.common,\n+\t\u0026bus_dsi0_clk.common,\n+\t\u0026dsi1_clk.common,\n+\t\u0026bus_dsi1_clk.common,\n+\t\u0026combphy0_clk.common,\n+\t\u0026combphy1_clk.common,\n+\t\u0026bus_tcon_tv0_clk.common,\n+\t\u0026bus_tcon_tv1_clk.common,\n+\t\u0026edp_tv_clk.common,\n+\t\u0026bus_edp_tv_clk.common,\n+\t\u0026hdmi_cec_32k_clk.common,\n+\t\u0026hdmi_cec_clk.common,\n+\t\u0026hdmi_tv_clk.common,\n+\t\u0026bus_hdmi_tv_clk.common,\n+\t\u0026hdmi_sfr_clk.common,\n+\t\u0026hdcp_esm_clk.common,\n+\t\u0026bus_dpss_top0_clk.common,\n+\t\u0026bus_dpss_top1_clk.common,\n+\t\u0026ledc_clk.common,\n+\t\u0026bus_ledc_clk.common,\n+\t\u0026bus_dsc_clk.common,\n+\t\u0026csi_master0_clk.common,\n+\t\u0026csi_master1_clk.common,\n+\t\u0026csi_master2_clk.common,\n+\t\u0026csi_clk.common,\n+\t\u0026bus_csi_clk.common,\n+\t\u0026isp_clk.common,\n+\t\u0026res_dcap_24m_clk.common,\n+\t\u0026apb2jtag_clk.common,\n+\t\u0026fanout_24M_clk.common,\n+\t\u0026fanout_12M_clk.common,\n+\t\u0026fanout_16M_clk.common,\n+\t\u0026fanout_25M_clk.common,\n+\t\u0026fanout_27M_clk.common,\n+\t\u0026fanout_pclk_clk.common,\n+\t\u0026fanout0_clk.common,\n+\t\u0026fanout1_clk.common,\n+\t\u0026fanout2_clk.common,\n+\t\u0026fanout3_clk.common,\n+};\n+\n+static struct clk_hw_onecell_data sun60i_a733_hw_clks = {\n+\t.hws\t= {\n+\t\t[CLK_PLL_REF]\t\t= \u0026pll_ref_clk.common.hw,\n+\t\t[CLK_SYS_24M]\t\t= \u0026sys_24M_clk.hw,\n+\t\t[CLK_PLL_DDR]\t\t= \u0026pll_ddr_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH0_4X]\t= \u0026pll_periph0_4x_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH0_2X]\t= \u0026pll_periph0_2x_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH0_800M]\t= \u0026pll_periph0_800M_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH0_480M]\t= \u0026pll_periph0_480M_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH0_600M]\t= \u0026pll_periph0_600M_clk.hw,\n+\t\t[CLK_PLL_PERIPH0_400M]\t= \u0026pll_periph0_400M_clk.hw,\n+\t\t[CLK_PLL_PERIPH0_300M]\t= \u0026pll_periph0_300M_clk.hw,\n+\t\t[CLK_PLL_PERIPH0_200M]\t= \u0026pll_periph0_200M_clk.hw,\n+\t\t[CLK_PLL_PERIPH0_160M]\t= \u0026pll_periph0_160M_clk.hw,\n+\t\t[CLK_PLL_PERIPH0_150M]\t= \u0026pll_periph0_150M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_4X]\t= \u0026pll_periph1_4x_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH1_2X]\t= \u0026pll_periph1_2x_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH1_800M]\t= \u0026pll_periph1_800M_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH1_480M]\t= \u0026pll_periph1_480M_clk.common.hw,\n+\t\t[CLK_PLL_PERIPH1_600M]\t= \u0026pll_periph1_600M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_400M]\t= \u0026pll_periph1_400M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_300M]\t= \u0026pll_periph1_300M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_200M]\t= \u0026pll_periph1_200M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_160M]\t= \u0026pll_periph1_160M_clk.hw,\n+\t\t[CLK_PLL_PERIPH1_150M]\t= \u0026pll_periph1_150M_clk.hw,\n+\t\t[CLK_PLL_GPU0]\t\t= \u0026pll_gpu0_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO0_12X]\t= \u0026pll_video0_12x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO0_4X]\t= \u0026pll_video0_4x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO0_3X]\t= \u0026pll_video0_3x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO1_12X]\t= \u0026pll_video1_12x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO1_4X]\t= \u0026pll_video1_4x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO1_3X]\t= \u0026pll_video1_3x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO2_12X]\t= \u0026pll_video2_12x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO2_4X]\t= \u0026pll_video2_4x_clk.common.hw,\n+\t\t[CLK_PLL_VIDEO2_3X]\t= \u0026pll_video2_3x_clk.common.hw,\n+\t\t[CLK_PLL_VE0]\t\t= \u0026pll_ve0_clk.common.hw,\n+\t\t[CLK_PLL_VE1]\t\t= \u0026pll_ve1_clk.common.hw,\n+\t\t[CLK_PLL_AUDIO0_4X]\t= \u0026pll_audio0_4x_clk.common.hw,\n+\t\t[CLK_PLL_AUDIO1]\t= \u0026pll_audio1_clk.common.hw,\n+\t\t[CLK_PLL_AUDIO1_DIV2]\t= \u0026pll_audio1_div2_clk.common.hw,\n+\t\t[CLK_PLL_AUDIO1_DIV5]\t= \u0026pll_audio1_div5_clk.common.hw,\n+\t\t[CLK_PLL_NPU]\t\t= \u0026pll_npu_clk.common.hw,\n+\t\t[CLK_PLL_DE_12X]\t= \u0026pll_de_12x_clk.common.hw,\n+\t\t[CLK_PLL_DE_4X]\t\t= \u0026pll_de_4x_clk.common.hw,\n+\t\t[CLK_PLL_DE_3X]\t\t= \u0026pll_de_3x_clk.common.hw,\n+\t\t[CLK_AHB]\t\t= \u0026ahb_clk.common.hw,\n+\t\t[CLK_APB0]\t\t= \u0026apb0_clk.common.hw,\n+\t\t[CLK_APB1]\t\t= \u0026apb1_clk.common.hw,\n+\t\t[CLK_APB_UART]\t\t= \u0026apb_uart_clk.common.hw,\n+\t\t[CLK_TRACE]\t\t= \u0026trace_clk.common.hw,\n+\t\t[CLK_BUS_ITS_PCIE0_ACLK] = \u0026bus_its_pcie0_aclk_clk.common.hw,\n+\t\t[CLK_MBUS]\t\t= \u0026mbus_clk.common.hw,\n+\t\t[CLK_MBUS_IOMMU0_SYS]\t= \u0026mbus_iommu0_sys_clk.common.hw,\n+\t\t[CLK_APB_IOMMU0_SYS]\t= \u0026apb_iommu0_sys_clk.common.hw,\n+\t\t[CLK_AHB_IOMMU0_SYS]\t= \u0026ahb_iommu0_sys_clk.common.hw,\n+\t\t[CLK_BUS_MSI_LITE0]\t= \u0026bus_msi_lite0_clk.common.hw,\n+\t\t[CLK_BUS_MSI_LITE1]\t= \u0026bus_msi_lite1_clk.common.hw,\n+\t\t[CLK_BUS_MSI_LITE2]\t= \u0026bus_msi_lite2_clk.common.hw,\n+\t\t[CLK_MBUS_IOMMU1_SYS]\t= \u0026mbus_iommu1_sys_clk.common.hw,\n+\t\t[CLK_APB_IOMMU1_SYS]\t= \u0026apb_iommu1_sys_clk.common.hw,\n+\t\t[CLK_AHB_IOMMU1_SYS]\t= \u0026ahb_iommu1_sys_clk.common.hw,\n+\t\t[CLK_AHB_VE_DEC]\t= \u0026ahb_ve_dec_clk.common.hw,\n+\t\t[CLK_AHB_VE_ENC]\t= \u0026ahb_ve_enc_clk.common.hw,\n+\t\t[CLK_AHB_VID_IN]\t= \u0026ahb_vid_in_clk.common.hw,\n+\t\t[CLK_AHB_VID_COUT0]\t= \u0026ahb_vid_cout0_clk.common.hw,\n+\t\t[CLK_AHB_VID_COUT1]\t= \u0026ahb_vid_cout1_clk.common.hw,\n+\t\t[CLK_AHB_DE]\t\t= \u0026ahb_de_clk.common.hw,\n+\t\t[CLK_AHB_NPU]\t\t= \u0026ahb_npu_clk.common.hw,\n+\t\t[CLK_AHB_GPU0]\t\t= \u0026ahb_gpu0_clk.common.hw,\n+\t\t[CLK_AHB_SERDES]\t= \u0026ahb_serdes_clk.common.hw,\n+\t\t[CLK_AHB_USB_SYS]\t= \u0026ahb_usb_sys_clk.common.hw,\n+\t\t[CLK_AHB_MSI_LITE0]\t= \u0026ahb_msi_lite0_clk.common.hw,\n+\t\t[CLK_AHB_STORE]\t\t= \u0026ahb_store_clk.common.hw,\n+\t\t[CLK_AHB_CPUS]\t\t= \u0026ahb_cpus_clk.common.hw,\n+\t\t[CLK_MBUS_IOMMU0]\t= \u0026mbus_iommu0_clk.common.hw,\n+\t\t[CLK_MBUS_IOMMU1]\t= \u0026mbus_iommu1_clk.common.hw,\n+\t\t[CLK_MBUS_DESYS]\t= \u0026mbus_desys_clk.common.hw,\n+\t\t[CLK_MBUS_VE_ENC0_GATE]\t= \u0026mbus_ve_enc0_gate_clk.common.hw,\n+\t\t[CLK_MBUS_VE_DEC0_GATE]\t= \u0026mbus_ve_dec0_gate_clk.common.hw,\n+\t\t[CLK_MBUS_GPU0]\t\t= \u0026mbus_gpu0_clk.common.hw,\n+\t\t[CLK_MBUS_NPU]\t\t= \u0026mbus_npu_clk.common.hw,\n+\t\t[CLK_MBUS_VID_IN]\t= \u0026mbus_vid_in_clk.common.hw,\n+\t\t[CLK_MBUS_SERDES]\t= \u0026mbus_serdes_clk.common.hw,\n+\t\t[CLK_MBUS_MSI_LITE0]\t= \u0026mbus_msi_lite0_clk.common.hw,\n+\t\t[CLK_MBUS_STORE]\t= \u0026mbus_store_clk.common.hw,\n+\t\t[CLK_MBUS_MSI_LITE2]\t= \u0026mbus_msi_lite2_clk.common.hw,\n+\t\t[CLK_MBUS_DMA0]\t\t= \u0026mbus_dma0_clk.common.hw,\n+\t\t[CLK_MBUS_VE_ENC0]\t= \u0026mbus_ve_enc0_clk.common.hw,\n+\t\t[CLK_MBUS_CE]\t\t= \u0026mbus_ce_clk.common.hw,\n+\t\t[CLK_MBUS_DMA1]\t\t= \u0026mbus_dma1_clk.common.hw,\n+\t\t[CLK_MBUS_NAND]\t\t= \u0026mbus_nand_clk.common.hw,\n+\t\t[CLK_MBUS_CSI]\t\t= \u0026mbus_csi_clk.common.hw,\n+\t\t[CLK_MBUS_ISP]\t\t= \u0026mbus_isp_clk.common.hw,\n+\t\t[CLK_MBUS_GMAC0]\t= \u0026mbus_gmac0_clk.common.hw,\n+\t\t[CLK_MBUS_GMAC1]\t= \u0026mbus_gmac1_clk.common.hw,\n+\t\t[CLK_MBUS_VE_DEC0]\t= \u0026mbus_ve_dec0_clk.common.hw,\n+\t\t[CLK_BUS_DMA0]\t\t= \u0026bus_dma0_clk.common.hw,\n+\t\t[CLK_BUS_DMA1]\t\t= \u0026bus_dma1_clk.common.hw,\n+\t\t[CLK_BUS_SPINLOCK]\t= \u0026bus_spinlock_clk.common.hw,\n+\t\t[CLK_BUS_MSGBOX0]\t= \u0026bus_msgbox0_clk.common.hw,\n+\t\t[CLK_BUS_PWM0]\t\t= \u0026bus_pwm0_clk.common.hw,\n+\t\t[CLK_BUS_PWM1]\t\t= \u0026bus_pwm1_clk.common.hw,\n+\t\t[CLK_BUS_DBG]\t\t= \u0026bus_dbg_clk.common.hw,\n+\t\t[CLK_BUS_SYSDAP]\t= \u0026bus_sysdap_clk.common.hw,\n+\t\t[CLK_TIMER0]\t\t= \u0026timer0_clk.common.hw,\n+\t\t[CLK_TIMER1]\t\t= \u0026timer1_clk.common.hw,\n+\t\t[CLK_TIMER2]\t\t= \u0026timer2_clk.common.hw,\n+\t\t[CLK_TIMER3]\t\t= \u0026timer3_clk.common.hw,\n+\t\t[CLK_TIMER4]\t\t= \u0026timer4_clk.common.hw,\n+\t\t[CLK_TIMER5]\t\t= \u0026timer5_clk.common.hw,\n+\t\t[CLK_TIMER6]\t\t= \u0026timer6_clk.common.hw,\n+\t\t[CLK_TIMER7]\t\t= \u0026timer7_clk.common.hw,\n+\t\t[CLK_TIMER8]\t\t= \u0026timer8_clk.common.hw,\n+\t\t[CLK_TIMER9]\t\t= \u0026timer9_clk.common.hw,\n+\t\t[CLK_BUS_TIMER]\t\t= \u0026bus_timer_clk.common.hw,\n+\t\t[CLK_AVS]\t\t= \u0026avs_clk.common.hw,\n+\t\t[CLK_DE0]\t\t= \u0026de0_clk.common.hw,\n+\t\t[CLK_BUS_DE0]\t\t= \u0026bus_de0_clk.common.hw,\n+\t\t[CLK_DI]\t\t= \u0026di_clk.common.hw,\n+\t\t[CLK_BUS_DI]\t\t= \u0026bus_di_clk.common.hw,\n+\t\t[CLK_G2D]\t\t= \u0026g2d_clk.common.hw,\n+\t\t[CLK_BUS_G2D]\t\t= \u0026bus_g2d_clk.common.hw,\n+\t\t[CLK_EINK]\t\t= \u0026eink_clk.common.hw,\n+\t\t[CLK_EINK_PANEL]\t= \u0026eink_panel_clk.common.hw,\n+\t\t[CLK_BUS_EINK]\t\t= \u0026bus_eink_clk.common.hw,\n+\t\t[CLK_VE_ENC0]\t\t= \u0026ve_enc0_clk.common.hw,\n+\t\t[CLK_VE_DEC0]\t\t= \u0026ve_dec0_clk.common.hw,\n+\t\t[CLK_BUS_VE_ENC0]\t= \u0026bus_ve_enc0_clk.common.hw,\n+\t\t[CLK_BUS_VE_DEC0]\t= \u0026bus_ve_dec0_clk.common.hw,\n+\t\t[CLK_CE]\t\t= \u0026ce_clk.common.hw,\n+\t\t[CLK_BUS_CE]\t\t= \u0026bus_ce_clk.common.hw,\n+\t\t[CLK_BUS_CE_SYS]\t= \u0026bus_ce_sys_clk.common.hw,\n+\t\t[CLK_NPU]\t\t= \u0026npu_clk.common.hw,\n+\t\t[CLK_BUS_NPU]\t\t= \u0026bus_npu_clk.common.hw,\n+\t\t[CLK_GPU0]\t\t= \u0026gpu0_clk.common.hw,\n+\t\t[CLK_BUS_GPU0]\t\t= \u0026bus_gpu0_clk.common.hw,\n+\t\t[CLK_DRAM0]\t\t= \u0026dram0_clk.common.hw,\n+\t\t[CLK_BUS_DRAM0]\t\t= \u0026bus_dram0_clk.common.hw,\n+\t\t[CLK_NAND0_CLK0]\t= \u0026nand0_clk0_clk.common.hw,\n+\t\t[CLK_NAND0_CLK1]\t= \u0026nand0_clk1_clk.common.hw,\n+\t\t[CLK_BUS_NAND0]\t\t= \u0026bus_nand0_clk.common.hw,\n+\t\t[CLK_MMC0]\t\t= \u0026mmc0_clk.common.hw,\n+\t\t[CLK_BUS_MMC0]\t\t= \u0026bus_mmc0_clk.common.hw,\n+\t\t[CLK_MMC1]\t\t= \u0026mmc1_clk.common.hw,\n+\t\t[CLK_BUS_MMC1]\t\t= \u0026bus_mmc1_clk.common.hw,\n+\t\t[CLK_MMC2]\t\t= \u0026mmc2_clk.common.hw,\n+\t\t[CLK_BUS_MMC2]\t\t= \u0026bus_mmc2_clk.common.hw,\n+\t\t[CLK_MMC3]\t\t= \u0026mmc3_clk.common.hw,\n+\t\t[CLK_BUS_MMC3]\t\t= \u0026bus_mmc3_clk.common.hw,\n+\t\t[CLK_UFS_AXI]\t\t= \u0026ufs_axi_clk.common.hw,\n+\t\t[CLK_UFS_CFG]\t\t= \u0026ufs_cfg_clk.common.hw,\n+\t\t[CLK_BUS_UFS]\t\t= \u0026bus_ufs_clk.common.hw,\n+\t\t[CLK_BUS_UART0]\t\t= \u0026bus_uart0_clk.common.hw,\n+\t\t[CLK_BUS_UART1]\t\t= \u0026bus_uart1_clk.common.hw,\n+\t\t[CLK_BUS_UART2]\t\t= \u0026bus_uart2_clk.common.hw,\n+\t\t[CLK_BUS_UART3]\t\t= \u0026bus_uart3_clk.common.hw,\n+\t\t[CLK_BUS_UART4]\t\t= \u0026bus_uart4_clk.common.hw,\n+\t\t[CLK_BUS_UART5]\t\t= \u0026bus_uart5_clk.common.hw,\n+\t\t[CLK_BUS_UART6]\t\t= \u0026bus_uart6_clk.common.hw,\n+\t\t[CLK_BUS_I2C0]\t\t= \u0026bus_i2c0_clk.common.hw,\n+\t\t[CLK_BUS_I2C1]\t\t= \u0026bus_i2c1_clk.common.hw,\n+\t\t[CLK_BUS_I2C2]\t\t= \u0026bus_i2c2_clk.common.hw,\n+\t\t[CLK_BUS_I2C3]\t\t= \u0026bus_i2c3_clk.common.hw,\n+\t\t[CLK_BUS_I2C4]\t\t= \u0026bus_i2c4_clk.common.hw,\n+\t\t[CLK_BUS_I2C5]\t\t= \u0026bus_i2c5_clk.common.hw,\n+\t\t[CLK_BUS_I2C6]\t\t= \u0026bus_i2c6_clk.common.hw,\n+\t\t[CLK_BUS_I2C7]\t\t= \u0026bus_i2c7_clk.common.hw,\n+\t\t[CLK_BUS_I2C8]\t\t= \u0026bus_i2c8_clk.common.hw,\n+\t\t[CLK_BUS_I2C9]\t\t= \u0026bus_i2c9_clk.common.hw,\n+\t\t[CLK_BUS_I2C10]\t\t= \u0026bus_i2c10_clk.common.hw,\n+\t\t[CLK_BUS_I2C11]\t\t= \u0026bus_i2c11_clk.common.hw,\n+\t\t[CLK_BUS_I2C12]\t\t= \u0026bus_i2c12_clk.common.hw,\n+\t\t[CLK_SPI0]\t\t= \u0026spi0_clk.common.hw,\n+\t\t[CLK_BUS_SPI0]\t\t= \u0026bus_spi0_clk.common.hw,\n+\t\t[CLK_SPI1]\t\t= \u0026spi1_clk.common.hw,\n+\t\t[CLK_BUS_SPI1]\t\t= \u0026bus_spi1_clk.common.hw,\n+\t\t[CLK_SPI2]\t\t= \u0026spi2_clk.common.hw,\n+\t\t[CLK_BUS_SPI2]\t\t= \u0026bus_spi2_clk.common.hw,\n+\t\t[CLK_SPIF]\t\t= \u0026spif_clk.common.hw,\n+\t\t[CLK_BUS_SPIF]\t\t= \u0026bus_spif_clk.common.hw,\n+\t\t[CLK_SPI3]\t\t= \u0026spi3_clk.common.hw,\n+\t\t[CLK_BUS_SPI3]\t\t= \u0026bus_spi3_clk.common.hw,\n+\t\t[CLK_SPI4]\t\t= \u0026spi4_clk.common.hw,\n+\t\t[CLK_BUS_SPI4]\t\t= \u0026bus_spi4_clk.common.hw,\n+\t\t[CLK_GPADC0_24M]\t= \u0026gpadc0_24m_clk.common.hw,\n+\t\t[CLK_BUS_GPADC0]\t= \u0026bus_gpadc0_clk.common.hw,\n+\t\t[CLK_BUS_THS0]\t\t= \u0026bus_ths0_clk.common.hw,\n+\t\t[CLK_IRRX]\t\t= \u0026irrx_clk.common.hw,\n+\t\t[CLK_BUS_IRRX]\t\t= \u0026bus_irrx_clk.common.hw,\n+\t\t[CLK_IRTX]\t\t= \u0026irtx_clk.common.hw,\n+\t\t[CLK_BUS_IRTX]\t\t= \u0026bus_irtx_clk.common.hw,\n+\t\t[CLK_BUS_LRADC]\t\t= \u0026bus_lradc_clk.common.hw,\n+\t\t[CLK_SGPIO]\t\t= \u0026sgpio_clk.common.hw,\n+\t\t[CLK_BUS_SGPIO]\t\t= \u0026bus_sgpio_clk.common.hw,\n+\t\t[CLK_LPC]\t\t= \u0026lpc_clk.common.hw,\n+\t\t[CLK_BUS_LPC]\t\t= \u0026bus_lpc_clk.common.hw,\n+\t\t[CLK_I2SPCM0]\t\t= \u0026i2spcm0_clk.common.hw,\n+\t\t[CLK_BUS_I2SPCM0]\t= \u0026bus_i2spcm0_clk.common.hw,\n+\t\t[CLK_I2SPCM1]\t\t= \u0026i2spcm1_clk.common.hw,\n+\t\t[CLK_BUS_I2SPCM1]\t= \u0026bus_i2spcm1_clk.common.hw,\n+\t\t[CLK_I2SPCM2]\t\t= \u0026i2spcm2_clk.common.hw,\n+\t\t[CLK_I2SPCM2_ASRC]\t= \u0026i2spcm2_asrc_clk.common.hw,\n+\t\t[CLK_BUS_I2SPCM2]\t= \u0026bus_i2spcm2_clk.common.hw,\n+\t\t[CLK_I2SPCM3]\t\t= \u0026i2spcm3_clk.common.hw,\n+\t\t[CLK_BUS_I2SPCM3]\t= \u0026bus_i2spcm3_clk.common.hw,\n+\t\t[CLK_I2SPCM4]\t\t= \u0026i2spcm4_clk.common.hw,\n+\t\t[CLK_BUS_I2SPCM4]\t= \u0026bus_i2spcm4_clk.common.hw,\n+\t\t[CLK_SPDIF_TX]\t\t= \u0026spdif_tx_clk.common.hw,\n+\t\t[CLK_SPDIF_RX]\t\t= \u0026spdif_rx_clk.common.hw,\n+\t\t[CLK_BUS_SPDIF]\t\t= \u0026bus_spdif_clk.common.hw,\n+\t\t[CLK_DMIC]\t\t= \u0026dmic_clk.common.hw,\n+\t\t[CLK_BUS_DMIC]\t\t= \u0026bus_dmic_clk.common.hw,\n+\t\t[CLK_USB_OHCI0]\t\t= \u0026usb_ohci0_clk.common.hw,\n+\t\t[CLK_BUS_OHCI0]\t\t= \u0026bus_ohci0_clk.common.hw,\n+\t\t[CLK_BUS_EHCI0]\t\t= \u0026bus_ehci0_clk.common.hw,\n+\t\t[CLK_BUS_OTG]\t\t= \u0026bus_otg_clk.common.hw,\n+\t\t[CLK_USB_OHCI1]\t\t= \u0026usb_ohci1_clk.common.hw,\n+\t\t[CLK_BUS_OHCI1]\t\t= \u0026bus_ohci1_clk.common.hw,\n+\t\t[CLK_BUS_EHCI1]\t\t= \u0026bus_ehci1_clk.common.hw,\n+\t\t[CLK_USB01_REF]\t\t= \u0026usb01_ref_clk.common.hw,\n+\t\t[CLK_USB2_U2_REF]\t= \u0026usb2_u2_ref_clk.common.hw,\n+\t\t[CLK_USB2_SUSPEND]\t= \u0026usb2_suspend_clk.common.hw,\n+\t\t[CLK_USB2_MF]\t\t= \u0026usb2_mf_clk.common.hw,\n+\t\t[CLK_USB2_U3_UTMI]\t= \u0026usb2_u3_utmi_clk.common.hw,\n+\t\t[CLK_USB2_U2_PIPE]\t= \u0026usb2_u2_pipe_clk.common.hw,\n+\t\t[CLK_PCIE_AUX]\t\t= \u0026pcie_aux_clk.common.hw,\n+\t\t[CLK_PCIE_AXI_SLV]\t= \u0026pcie_axi_slv_clk.common.hw,\n+\t\t[CLK_SERDES_PHY]\t= \u0026serdes_phy_clk.common.hw,\n+\t\t[CLK_GMAC_PTP]\t\t= \u0026gmac_ptp_clk.common.hw,\n+\t\t[CLK_GMAC0_PHY]\t\t= \u0026gmac0_phy_clk.common.hw,\n+\t\t[CLK_BUS_GMAC0]\t\t= \u0026bus_gmac0_clk.common.hw,\n+\t\t[CLK_GMAC1_PHY]\t\t= \u0026gmac1_phy_clk.common.hw,\n+\t\t[CLK_BUS_GMAC1]\t\t= \u0026bus_gmac1_clk.common.hw,\n+\t\t[CLK_TCON_LCD0]\t\t= \u0026tcon_lcd0_clk.common.hw,\n+\t\t[CLK_BUS_TCON_LCD0]\t= \u0026bus_tcon_lcd0_clk.common.hw,\n+\t\t[CLK_TCON_LCD1]\t\t= \u0026tcon_lcd1_clk.common.hw,\n+\t\t[CLK_BUS_TCON_LCD1]\t= \u0026bus_tcon_lcd1_clk.common.hw,\n+\t\t[CLK_TCON_LCD2]\t\t= \u0026tcon_lcd2_clk.common.hw,\n+\t\t[CLK_BUS_TCON_LCD2]\t= \u0026bus_tcon_lcd2_clk.common.hw,\n+\t\t[CLK_DSI0]\t\t= \u0026dsi0_clk.common.hw,\n+\t\t[CLK_BUS_DSI0]\t\t= \u0026bus_dsi0_clk.common.hw,\n+\t\t[CLK_DSI1]\t\t= \u0026dsi1_clk.common.hw,\n+\t\t[CLK_BUS_DSI1]\t\t= \u0026bus_dsi1_clk.common.hw,\n+\t\t[CLK_COMBPHY0]\t\t= \u0026combphy0_clk.common.hw,\n+\t\t[CLK_COMBPHY1]\t\t= \u0026combphy1_clk.common.hw,\n+\t\t[CLK_BUS_TCON_TV0]\t= \u0026bus_tcon_tv0_clk.common.hw,\n+\t\t[CLK_BUS_TCON_TV1]\t= \u0026bus_tcon_tv1_clk.common.hw,\n+\t\t[CLK_EDP_TV]\t\t= \u0026edp_tv_clk.common.hw,\n+\t\t[CLK_BUS_EDP_TV]\t= \u0026bus_edp_tv_clk.common.hw,\n+\t\t[CLK_HDMI_CEC_32K]\t= \u0026hdmi_cec_32k_clk.common.hw,\n+\t\t[CLK_HDMI_CEC]\t\t= \u0026hdmi_cec_clk.common.hw,\n+\t\t[CLK_HDMI_TV]\t\t= \u0026hdmi_tv_clk.common.hw,\n+\t\t[CLK_BUS_HDMI_TV]\t= \u0026bus_hdmi_tv_clk.common.hw,\n+\t\t[CLK_HDMI_SFR]\t\t= \u0026hdmi_sfr_clk.common.hw,\n+\t\t[CLK_HDCP_ESM]\t\t= \u0026hdcp_esm_clk.common.hw,\n+\t\t[CLK_BUS_DPSS_TOP0]\t= \u0026bus_dpss_top0_clk.common.hw,\n+\t\t[CLK_BUS_DPSS_TOP1]\t= \u0026bus_dpss_top1_clk.common.hw,\n+\t\t[CLK_LEDC]\t\t= \u0026ledc_clk.common.hw,\n+\t\t[CLK_BUS_LEDC]\t\t= \u0026bus_ledc_clk.common.hw,\n+\t\t[CLK_BUS_DSC]\t\t= \u0026bus_dsc_clk.common.hw,\n+\t\t[CLK_CSI_MASTER0]\t= \u0026csi_master0_clk.common.hw,\n+\t\t[CLK_CSI_MASTER1]\t= \u0026csi_master1_clk.common.hw,\n+\t\t[CLK_CSI_MASTER2]\t= \u0026csi_master2_clk.common.hw,\n+\t\t[CLK_CSI]\t\t= \u0026csi_clk.common.hw,\n+\t\t[CLK_BUS_CSI]\t\t= \u0026bus_csi_clk.common.hw,\n+\t\t[CLK_ISP]\t\t= \u0026isp_clk.common.hw,\n+\t\t[CLK_RES_DCAP_24M]\t= \u0026res_dcap_24m_clk.common.hw,\n+\t\t[CLK_APB2JTAG]\t\t= \u0026apb2jtag_clk.common.hw,\n+\t\t[CLK_FANOUT_24M]\t= \u0026fanout_24M_clk.common.hw,\n+\t\t[CLK_FANOUT_12M]\t= \u0026fanout_12M_clk.common.hw,\n+\t\t[CLK_FANOUT_16M]\t= \u0026fanout_16M_clk.common.hw,\n+\t\t[CLK_FANOUT_25M]\t= \u0026fanout_25M_clk.common.hw,\n+\t\t[CLK_FANOUT_27M]\t= \u0026fanout_27M_clk.common.hw,\n+\t\t[CLK_FANOUT_PCLK]\t= \u0026fanout_pclk_clk.common.hw,\n+\t\t[CLK_FANOUT0]\t\t= \u0026fanout0_clk.common.hw,\n+\t\t[CLK_FANOUT1]\t\t= \u0026fanout1_clk.common.hw,\n+\t\t[CLK_FANOUT2]\t\t= \u0026fanout2_clk.common.hw,\n+\t\t[CLK_FANOUT3]\t\t= \u0026fanout3_clk.common.hw,\n+\t},\n+\t.num\t= CLK_FANOUT3 + 1,\n+};\n+\n+static struct ccu_reset_map sun60i_a733_ccu_resets[] = {\n+\t[RST_BUS_ITS_PCIE0]\t\t= { 0x574, BIT(16) },\n+\t[RST_BUS_IOMMU0_SYS]\t\t= { 0x58c, BIT(16) },\n+\t[RST_BUS_MSI_LITE0_AHB]\t\t= { 0x594, BIT(16) },\n+\t[RST_BUS_MSI_LITE0_MBUS]\t= { 0x594, BIT(17) },\n+\t[RST_BUS_MSI_LITE1_AHB]\t\t= { 0x59c, BIT(16) },\n+\t[RST_BUS_MSI_LITE1_MBUS]\t= { 0x59c, BIT(17) },\n+\t[RST_BUS_MSI_LITE2_AHB]\t\t= { 0x5a4, BIT(16) },\n+\t[RST_BUS_MSI_LITE2_MBUS]\t= { 0x5a4, BIT(17) },\n+\t[RST_BUS_IOMMU1_SYS]\t\t= { 0x5b4, BIT(16) },\n+\t[RST_BUS_DMA0]\t\t\t= { 0x704, BIT(16) },\n+\t[RST_BUS_DMA1]\t\t\t= { 0x70c, BIT(16) },\n+\t[RST_BUS_SPINLOCK]\t\t= { 0x724, BIT(16) },\n+\t[RST_BUS_MSGBOX]\t\t= { 0x744, BIT(16) },\n+\t[RST_BUS_PWM0]\t\t\t= { 0x784, BIT(16) },\n+\t[RST_BUS_PWM1]\t\t\t= { 0x78c, BIT(16) },\n+\t[RST_BUS_DBG]\t\t\t= { 0x7a4, BIT(16) },\n+\t[RST_BUS_SYSDAP]\t\t= { 0x7ac, BIT(16) },\n+\t[RST_BUS_TIMER0]\t\t= { 0x850, BIT(16) },\n+\t[RST_BUS_DE0]\t\t\t= { 0xa04, BIT(16) },\n+\t[RST_BUS_DI]\t\t\t= { 0xa24, BIT(16) },\n+\t[RST_BUS_G2D]\t\t\t= { 0xa44, BIT(16) },\n+\t[RST_BUS_EINK]\t\t\t= { 0xa6c, BIT(16) },\n+\t[RST_BUS_DE_SYS]\t\t= { 0xa74, BIT(16) },\n+\t[RST_BUS_VE_ENC0]\t\t= { 0xa8c, BIT(16) },\n+\t[RST_BUS_VE_DEC0]\t\t= { 0xa8c, BIT(18) },\n+\t[RST_BUS_CE]\t\t\t= { 0xac4, BIT(16) },\n+\t[RST_BUS_CE_SYS]\t\t= { 0xac4, BIT(17) },\n+\t[RST_BUS_NPU_CORE]\t\t= { 0xb04, BIT(16) },\n+\t[RST_BUS_NPU_AXI]\t\t= { 0xb04, BIT(17) },\n+\t[RST_BUS_NPU_AHB]\t\t= { 0xb04, BIT(18) },\n+\t[RST_BUS_NPU_SRAM]\t\t= { 0xb04, BIT(19) },\n+\t[RST_BUS_GPU0]\t\t\t= { 0xb24, BIT(16) },\n+\t[RST_BUS_DRAM0]\t\t\t= { 0xc0c, BIT(16) },\n+\t[RST_BUS_NAND0]\t\t\t= { 0xc8c, BIT(16) },\n+\t[RST_BUS_MMC0]\t\t\t= { 0xd0c, BIT(16) },\n+\t[RST_BUS_MMC1]\t\t\t= { 0xd1c, BIT(16) },\n+\t[RST_BUS_MMC2]\t\t\t= { 0xd2c, BIT(16) },\n+\t[RST_BUS_MMC3]\t\t\t= { 0xd3c, BIT(16) },\n+\t[RST_BUS_UFS_AHB]\t\t= { 0xd8c, BIT(16) },\n+\t[RST_BUS_UFS_AXI]\t\t= { 0xd8c, BIT(17) },\n+\t[RST_BUS_UFS_PHY]\t\t= { 0xd8c, BIT(18) },\n+\t[RST_BUS_UFS_CORE]\t\t= { 0xd8c, BIT(19) },\n+\t[RST_BUS_UART0]\t\t\t= { 0xe00, BIT(16) },\n+\t[RST_BUS_UART1]\t\t\t= { 0xe04, BIT(16) },\n+\t[RST_BUS_UART2]\t\t\t= { 0xe08, BIT(16) },\n+\t[RST_BUS_UART3]\t\t\t= { 0xe0c, BIT(16) },\n+\t[RST_BUS_UART4]\t\t\t= { 0xe10, BIT(16) },\n+\t[RST_BUS_UART5]\t\t\t= { 0xe14, BIT(16) },\n+\t[RST_BUS_UART6]\t\t\t= { 0xe18, BIT(16) },\n+\t[RST_BUS_I2C0]\t\t\t= { 0xe80, BIT(16) },\n+\t[RST_BUS_I2C1]\t\t\t= { 0xe84, BIT(16) },\n+\t[RST_BUS_I2C2]\t\t\t= { 0xe88, BIT(16) },\n+\t[RST_BUS_I2C3]\t\t\t= { 0xe8c, BIT(16) },\n+\t[RST_BUS_I2C4]\t\t\t= { 0xe90, BIT(16) },\n+\t[RST_BUS_I2C5]\t\t\t= { 0xe94, BIT(16) },\n+\t[RST_BUS_I2C6]\t\t\t= { 0xe98, BIT(16) },\n+\t[RST_BUS_I2C7]\t\t\t= { 0xe9c, BIT(16) },\n+\t[RST_BUS_I2C8]\t\t\t= { 0xea0, BIT(16) },\n+\t[RST_BUS_I2C9]\t\t\t= { 0xea4, BIT(16) },\n+\t[RST_BUS_I2C10]\t\t\t= { 0xea8, BIT(16) },\n+\t[RST_BUS_I2C11]\t\t\t= { 0xeac, BIT(16) },\n+\t[RST_BUS_I2C12]\t\t\t= { 0xeb0, BIT(16) },\n+\t[RST_BUS_SPI0]\t\t\t= { 0xf04, BIT(16) },\n+\t[RST_BUS_SPI1]\t\t\t= { 0xf0c, BIT(16) },\n+\t[RST_BUS_SPI2]\t\t\t= { 0xf14, BIT(16) },\n+\t[RST_BUS_SPIF]\t\t\t= { 0xf1c, BIT(16) },\n+\t[RST_BUS_SPI3]\t\t\t= { 0xf24, BIT(16) },\n+\t[RST_BUS_SPI4]\t\t\t= { 0xf2c, BIT(16) }, /* From the vendor kernel. */\n+\t[RST_BUS_GPADC0]\t\t= { 0xfc4, BIT(16) },\n+\t[RST_BUS_THS0]\t\t\t= { 0xfe4, BIT(16) },\n+\t[RST_BUS_IRRX]\t\t\t= { 0x1004, BIT(16) },\n+\t[RST_BUS_IRTX]\t\t\t= { 0x100c, BIT(16) },\n+\t[RST_BUS_LRADC]\t\t\t= { 0x1024, BIT(16) },\n+\t[RST_BUS_SGPIO]\t\t\t= { 0x1064, BIT(16) }, /* From the vendor kernel. */\n+\t[RST_BUS_LPC]\t\t\t= { 0x1084, BIT(16) }, /* From the vendor kernel. */\n+\t[RST_BUS_I2SPCM0]\t\t= { 0x120c, BIT(16) },\n+\t[RST_BUS_I2SPCM1]\t\t= { 0x121c, BIT(16) },\n+\t[RST_BUS_I2SPCM2]\t\t= { 0x122c, BIT(16) },\n+\t[RST_BUS_I2SPCM3]\t\t= { 0x123c, BIT(16) },\n+\t[RST_BUS_I2SPCM4]\t\t= { 0x124c, BIT(16) },\n+\t[RST_BUS_SPDIF]\t\t\t= { 0x128c, BIT(16) },\n+\t[RST_BUS_DMIC]\t\t\t= { 0x12cc, BIT(16) },\n+\t[RST_USB_PHY0]\t\t\t= { 0x1300, BIT(30) },\n+\t[RST_BUS_OHCI0]\t\t\t= { 0x1304, BIT(16) },\n+\t[RST_BUS_EHCI0]\t\t\t= { 0x1304, BIT(20) },\n+\t[RST_BUS_OTG]\t\t\t= { 0x1304, BIT(24) },\n+\t[RST_USB_PHY1]\t\t\t= { 0x1308, BIT(30) },\n+\t[RST_BUS_OHCI1]\t\t\t= { 0x130c, BIT(16) },\n+\t[RST_BUS_EHCI1]\t\t\t= { 0x130c, BIT(20) },\n+\t[RST_BUS_USB2]\t\t\t= { 0x135c, BIT(16) },\n+\t[RST_BUS_PCIE_PWRUP]\t\t= { 0x138c, BIT(16) },\n+\t[RST_BUS_PCIE]\t\t\t= { 0x138c, BIT(17) },\n+\t[RST_BUS_SERDES]\t\t= { 0x13c4, BIT(16) },\n+\t[RST_BUS_GMAC0]\t\t\t= { 0x141c, BIT(16) },\n+\t[RST_BUS_GMAC0_AXI]\t\t= { 0x141c, BIT(17) },\n+\t[RST_BUS_GMAC1]\t\t\t= { 0x142c, BIT(16) }, /* From the vendor kernel. */\n+\t[RST_BUS_GMAC1_AXI]\t\t= { 0x142c, BIT(17) }, /* From the vendor kernel. */\n+\t[RST_BUS_TCON_LCD0]\t\t= { 0x1504, BIT(16) },\n+\t[RST_BUS_TCON_LCD1]\t\t= { 0x150c, BIT(16) },\n+\t[RST_BUS_TCON_LCD2]\t\t= { 0x1514, BIT(16) }, /* From the vendor kernel. */\n+\t[RST_BUS_LVDS0]\t\t\t= { 0x1544, BIT(16) },\n+\t[RST_BUS_LVDS1]\t\t\t= { 0x154c, BIT(16) },\n+\t[RST_BUS_DSI0]\t\t\t= { 0x1584, BIT(16) },\n+\t[RST_BUS_DSI1]\t\t\t= { 0x158c, BIT(16) },\n+\t[RST_BUS_TCON_TV0]\t\t= { 0x1604, BIT(16) },\n+\t[RST_BUS_TCON_TV1]\t\t= { 0x160c, BIT(16) },\n+\t[RST_BUS_EDP]\t\t\t= { 0x164c, BIT(16) },\n+\t[RST_BUS_HDMI_MAIN]\t\t= { 0x168c, BIT(16) },\n+\t[RST_BUS_HDMI_SUB]\t\t= { 0x168c, BIT(17) },\n+\t[RST_BUS_HDMI_HDCP]\t\t= { 0x168c, BIT(18) },\n+\t[RST_BUS_DPSS_TOP0]\t\t= { 0x16c4, BIT(16) },\n+\t[RST_BUS_DPSS_TOP1]\t\t= { 0x16cc, BIT(16) },\n+\t[RST_BUS_VIDEO_OUT0]\t\t= { 0x16e4, BIT(16) },\n+\t[RST_BUS_VIDEO_OUT1]\t\t= { 0x16ec, BIT(16) },\n+\t[RST_BUS_LEDC]\t\t\t= { 0x1704, BIT(16) },\n+\t[RST_BUS_DSC]\t\t\t= { 0x1744, BIT(16) },\n+\t[RST_BUS_CSI]\t\t\t= { 0x1844, BIT(16) },\n+\t[RST_BUS_VIDEO_IN]\t\t= { 0x1884, BIT(16) },\n+\t[RST_BUS_APB2JTAG]\t\t= { 0x1c04, BIT(16) },\n+};\n+\n+static const struct sunxi_ccu_desc sun60i_a733_ccu_desc = {\n+\t.ccu_clks\t= sun60i_a733_ccu_clks,\n+\t.num_ccu_clks\t= ARRAY_SIZE(sun60i_a733_ccu_clks),\n+\n+\t.hw_clks\t= \u0026sun60i_a733_hw_clks,\n+\n+\t.resets\t\t= sun60i_a733_ccu_resets,\n+\t.num_resets\t= ARRAY_SIZE(sun60i_a733_ccu_resets),\n+};\n+\n+static const u32 pll_regs[] = {\n+\tSUN60I_A733_PLL_REF_REG,\n+\tSUN60I_A733_PLL_DDR_REG,\n+\tSUN60I_A733_PLL_PERIPH0_REG,\n+\tSUN60I_A733_PLL_PERIPH1_REG,\n+\tSUN60I_A733_PLL_GPU_REG,\n+\tSUN60I_A733_PLL_VIDEO0_REG,\n+\tSUN60I_A733_PLL_VIDEO1_REG,\n+\tSUN60I_A733_PLL_VIDEO2_REG,\n+\tSUN60I_A733_PLL_VE0_REG,\n+\tSUN60I_A733_PLL_VE1_REG,\n+\tSUN60I_A733_PLL_AUDIO0_REG,\n+\tSUN60I_A733_PLL_AUDIO1_REG,\n+\tSUN60I_A733_PLL_NPU_REG,\n+\tSUN60I_A733_PLL_DE_REG,\n+};\n+\n+static int sun60i_a733_ccu_probe(struct platform_device *pdev)\n+{\n+\tvoid __iomem *reg;\n+\tu32 val;\n+\tint i, ret;\n+\n+\treg = devm_platform_ioremap_resource(pdev, 0);\n+\tif (IS_ERR(reg))\n+\t\treturn PTR_ERR(reg);\n+\n+\t/*\n+\t * The PLL clock code does not model all bits, for instance it does\n+\t * not support a separate enable and gate bit. We present the\n+\t * gate bit(27) as the enable bit, but then have to set the\n+\t * PLL Enable, LDO Enable, and Lock Enable bits on all PLLs here.\n+\t */\n+\tfor (i = 0; i \u003c ARRAY_SIZE(pll_regs); i++) {\n+\t\tval = readl(reg + pll_regs[i]);\n+\t\tval |= BIT(31) | BIT(30) | BIT(29);\n+\t\twritel(val, reg + pll_regs[i]);\n+\t}\n+\n+\t/* Enforce m1 = 0 for PLL_AUDIO0 */\n+\tval = readl(reg + SUN60I_A733_PLL_AUDIO0_REG);\n+\tval \u0026= ~BIT(1);\n+\twritel(val, reg + SUN60I_A733_PLL_AUDIO0_REG);\n+\n+\tret = devm_sunxi_ccu_probe(\u0026pdev-\u003edev, reg, \u0026sun60i_a733_ccu_desc);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn 0;\n+}\n+\n+static const struct of_device_id sun60i_a733_ccu_ids[] = {\n+\t{ .compatible = \"allwinner,sun60i-a733-ccu\" },\n+\t{ /* sentinel */ }\n+};\n+\n+static struct platform_driver sun60i_a733_ccu_driver = {\n+\t.probe\t= sun60i_a733_ccu_probe,\n+\t.driver\t= {\n+\t\t.name\t\t\t= \"sun60i-a733-ccu\",\n+\t\t.suppress_bind_attrs\t= true,\n+\t\t.of_match_table\t\t= sun60i_a733_ccu_ids,\n+\t},\n+};\n+module_platform_driver(sun60i_a733_ccu_driver);\n+\n+MODULE_IMPORT_NS(\"SUNXI_CCU\");\n+MODULE_DESCRIPTION(\"Support for the Allwinner A733 CCU\");\n+MODULE_LICENSE(\"GPL\");\ndiff --git a/drivers/clk/sunxi-ng/ccu_sdm.c b/drivers/clk/sunxi-ng/ccu_sdm.c\nindex c564e5f9e61040..204e25feaa3652 100644\n--- a/drivers/clk/sunxi-ng/ccu_sdm.c\n+++ b/drivers/clk/sunxi-ng/ccu_sdm.c\n@@ -18,7 +18,10 @@ bool ccu_sdm_helper_is_enabled(struct ccu_common *common,\n \tif (sdm-\u003eenable \u0026\u0026 !(readl(common-\u003ebase + common-\u003ereg) \u0026 sdm-\u003eenable))\n \t\treturn false;\n \n-\treturn !!(readl(common-\u003ebase + sdm-\u003etuning_reg) \u0026 sdm-\u003etuning_enable);\n+\tif (sdm-\u003epat1_enable \u0026\u0026 !(readl(common-\u003ebase + sdm-\u003epat1_reg) \u0026 sdm-\u003epat1_enable))\n+\t\treturn false;\n+\n+\treturn !!(readl(common-\u003ebase + sdm-\u003epat0_reg) \u0026 sdm-\u003epat0_enable);\n }\n EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_is_enabled, \"SUNXI_CCU\");\n \n@@ -37,18 +40,27 @@ void ccu_sdm_helper_enable(struct ccu_common *common,\n \tfor (i = 0; i \u003c sdm-\u003etable_size; i++)\n \t\tif (sdm-\u003etable[i].rate == rate)\n \t\t\twritel(sdm-\u003etable[i].pattern,\n-\t\t\t common-\u003ebase + sdm-\u003etuning_reg);\n+\t\t\t common-\u003ebase + sdm-\u003epat0_reg);\n \n \t/* Make sure SDM is enabled */\n \tspin_lock_irqsave(common-\u003elock, flags);\n-\treg = readl(common-\u003ebase + sdm-\u003etuning_reg);\n-\twritel(reg | sdm-\u003etuning_enable, common-\u003ebase + sdm-\u003etuning_reg);\n+\treg = readl(common-\u003ebase + sdm-\u003epat0_reg);\n+\twritel(reg | sdm-\u003epat0_enable, common-\u003ebase + sdm-\u003epat0_reg);\n \tspin_unlock_irqrestore(common-\u003elock, flags);\n \n-\tspin_lock_irqsave(common-\u003elock, flags);\n-\treg = readl(common-\u003ebase + common-\u003ereg);\n-\twritel(reg | sdm-\u003eenable, common-\u003ebase + common-\u003ereg);\n-\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\tif (sdm-\u003eenable) {\n+\t\tspin_lock_irqsave(common-\u003elock, flags);\n+\t\treg = readl(common-\u003ebase + common-\u003ereg);\n+\t\twritel(reg | sdm-\u003eenable, common-\u003ebase + common-\u003ereg);\n+\t\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\t}\n+\n+\tif (sdm-\u003epat1_enable) {\n+\t\tspin_lock_irqsave(common-\u003elock, flags);\n+\t\treg = readl(common-\u003ebase + sdm-\u003epat1_reg);\n+\t\twritel(reg | sdm-\u003epat1_enable, common-\u003ebase + sdm-\u003epat1_reg);\n+\t\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\t}\n }\n EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_enable, \"SUNXI_CCU\");\n \n@@ -61,14 +73,23 @@ void ccu_sdm_helper_disable(struct ccu_common *common,\n \tif (!(common-\u003efeatures \u0026 CCU_FEATURE_SIGMA_DELTA_MOD))\n \t\treturn;\n \n-\tspin_lock_irqsave(common-\u003elock, flags);\n-\treg = readl(common-\u003ebase + common-\u003ereg);\n-\twritel(reg \u0026 ~sdm-\u003eenable, common-\u003ebase + common-\u003ereg);\n-\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\tif (sdm-\u003eenable) {\n+\t\tspin_lock_irqsave(common-\u003elock, flags);\n+\t\treg = readl(common-\u003ebase + common-\u003ereg);\n+\t\twritel(reg \u0026 ~sdm-\u003eenable, common-\u003ebase + common-\u003ereg);\n+\t\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\t}\n+\n+\tif (sdm-\u003epat1_enable) {\n+\t\tspin_lock_irqsave(common-\u003elock, flags);\n+\t\treg = readl(common-\u003ebase + sdm-\u003epat1_reg);\n+\t\twritel(reg \u0026 ~sdm-\u003epat1_enable, common-\u003ebase + sdm-\u003epat1_reg);\n+\t\tspin_unlock_irqrestore(common-\u003elock, flags);\n+\t}\n \n \tspin_lock_irqsave(common-\u003elock, flags);\n-\treg = readl(common-\u003ebase + sdm-\u003etuning_reg);\n-\twritel(reg \u0026 ~sdm-\u003etuning_enable, common-\u003ebase + sdm-\u003etuning_reg);\n+\treg = readl(common-\u003ebase + sdm-\u003epat0_reg);\n+\twritel(reg \u0026 ~sdm-\u003epat0_enable, common-\u003ebase + sdm-\u003epat0_reg);\n \tspin_unlock_irqrestore(common-\u003elock, flags);\n }\n EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_disable, \"SUNXI_CCU\");\n@@ -123,7 +144,7 @@ unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common,\n \tpr_debug(\"%s: clock is sigma-delta modulated\\n\",\n \t\t clk_hw_get_name(\u0026common-\u003ehw));\n \n-\treg = readl(common-\u003ebase + sdm-\u003etuning_reg);\n+\treg = readl(common-\u003ebase + sdm-\u003epat0_reg);\n \n \tpr_debug(\"%s: pattern reg is 0x%x\",\n \t\t clk_hw_get_name(\u0026common-\u003ehw), reg);\ndiff --git a/drivers/clk/sunxi-ng/ccu_sdm.h b/drivers/clk/sunxi-ng/ccu_sdm.h\nindex c1a7159b89c31d..e94cef141c7de8 100644\n--- a/drivers/clk/sunxi-ng/ccu_sdm.h\n+++ b/drivers/clk/sunxi-ng/ccu_sdm.h\n@@ -33,21 +33,28 @@ struct ccu_sdm_internal {\n \tu32\t\ttable_size;\n \t/* early SoCs don't have the SDM enable bit in the PLL register */\n \tu32\t\tenable;\n-\t/* second enable bit in tuning register */\n-\tu32\t\ttuning_enable;\n-\tu16\t\ttuning_reg;\n+\t/* second enable bit in pattern0 register */\n+\tu32\t\tpat0_enable;\n+\tu16\t\tpat0_reg;\n+\t/* on some platforms, the sdm enable bit in pattern1 register */\n+\tu32\t\tpat1_enable;\n+\tu16\t\tpat1_reg;\n };\n \n-#define _SUNXI_CCU_SDM(_table, _enable,\t\t\t\\\n-\t\t _reg, _reg_enable)\t\t\\\n-\t{\t\t\t\t\t\t\\\n-\t\t.table\t\t= _table,\t\t\\\n-\t\t.table_size\t= ARRAY_SIZE(_table),\t\\\n-\t\t.enable\t\t= _enable,\t\t\\\n-\t\t.tuning_enable\t= _reg_enable,\t\t\\\n-\t\t.tuning_reg\t= _reg,\t\t\t\\\n+#define _SUNXI_CCU_SDM_DUAL_PAT(_table, _enable, _pat0, _pat0_enable, _pat1, _pat1_enable) \\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\t.table\t\t\t= _table,\t\t\t\\\n+\t\t.table_size\t\t= ARRAY_SIZE(_table),\t\t\\\n+\t\t.enable\t\t\t= _enable,\t\t\t\\\n+\t\t.pat0_enable\t\t= _pat0_enable,\t\t\t\\\n+\t\t.pat0_reg\t\t= _pat0,\t\t\t\\\n+\t\t.pat1_enable\t\t= _pat1_enable,\t\t\t\\\n+\t\t.pat1_reg\t\t= _pat1,\t\t\t\\\n \t}\n \n+#define _SUNXI_CCU_SDM(_table, _enable, _pat0, _pat0_enable)\t\\\n+\t_SUNXI_CCU_SDM_DUAL_PAT(_table, _enable, _pat0, _pat0_enable, 0, 0)\n+\n bool ccu_sdm_helper_is_enabled(struct ccu_common *common,\n \t\t\t struct ccu_sdm_internal *sdm);\n void ccu_sdm_helper_enable(struct ccu_common *common,\ndiff --git a/include/dt-bindings/clock/sun60i-a733-ccu.h b/include/dt-bindings/clock/sun60i-a733-ccu.h\nnew file mode 100644\nindex 00000000000000..6742070e3086fa\n--- /dev/null\n+++ b/include/dt-bindings/clock/sun60i-a733-ccu.h\n@@ -0,0 +1,290 @@\n+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */\n+/*\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ *\n+ * The user manual uses PCLK, HCLK, and MCLK suffixes for some bus clocks.\n+ * These are represented here as APB, AHB, and MBUS prefixes respectively,\n+ * with the bus type moved to the front of the clock name.\n+ */\n+\n+#ifndef _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_\n+#define _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_\n+\n+#define CLK_PLL_REF\t\t0\n+#define CLK_SYS_24M\t\t1\n+#define CLK_PLL_DDR\t\t2\n+#define CLK_PLL_PERIPH0_4X\t3\n+#define CLK_PLL_PERIPH0_2X\t4\n+#define CLK_PLL_PERIPH0_800M\t5\n+#define CLK_PLL_PERIPH0_480M\t6\n+#define CLK_PLL_PERIPH0_600M\t7\n+#define CLK_PLL_PERIPH0_400M\t8\n+#define CLK_PLL_PERIPH0_300M\t9\n+#define CLK_PLL_PERIPH0_200M\t10\n+#define CLK_PLL_PERIPH0_160M\t11\n+#define CLK_PLL_PERIPH0_150M\t12\n+#define CLK_PLL_PERIPH1_4X\t13\n+#define CLK_PLL_PERIPH1_2X\t14\n+#define CLK_PLL_PERIPH1_800M\t15\n+#define CLK_PLL_PERIPH1_480M\t16\n+#define CLK_PLL_PERIPH1_600M\t17\n+#define CLK_PLL_PERIPH1_400M\t18\n+#define CLK_PLL_PERIPH1_300M\t19\n+#define CLK_PLL_PERIPH1_200M\t20\n+#define CLK_PLL_PERIPH1_160M\t21\n+#define CLK_PLL_PERIPH1_150M\t22\n+#define CLK_PLL_GPU0\t\t23\n+#define CLK_PLL_VIDEO0_12X\t24\n+#define CLK_PLL_VIDEO0_4X\t25\n+#define CLK_PLL_VIDEO0_3X\t26\n+#define CLK_PLL_VIDEO1_12X\t27\n+#define CLK_PLL_VIDEO1_4X\t28\n+#define CLK_PLL_VIDEO1_3X\t29\n+#define CLK_PLL_VIDEO2_12X\t30\n+#define CLK_PLL_VIDEO2_4X\t31\n+#define CLK_PLL_VIDEO2_3X\t32\n+#define CLK_PLL_VE0\t\t33\n+#define CLK_PLL_VE1\t\t34\n+#define CLK_PLL_AUDIO0_4X\t35\n+#define CLK_PLL_AUDIO1\t\t36\n+#define CLK_PLL_AUDIO1_DIV2\t37\n+#define CLK_PLL_AUDIO1_DIV5\t38\n+#define CLK_PLL_NPU\t\t39\n+#define CLK_PLL_DE_12X\t\t40\n+#define CLK_PLL_DE_4X\t\t41\n+#define CLK_PLL_DE_3X\t\t42\n+#define CLK_AHB\t\t\t43\n+#define CLK_APB0\t\t44\n+#define CLK_APB1\t\t45\n+#define CLK_APB_UART\t\t46\n+#define CLK_TRACE\t\t47\n+#define CLK_BUS_ITS_PCIE0_ACLK\t48\n+#define CLK_MBUS\t\t49\n+#define CLK_MBUS_IOMMU0_SYS\t50\n+#define CLK_APB_IOMMU0_SYS\t51\n+#define CLK_AHB_IOMMU0_SYS\t52\n+#define CLK_BUS_MSI_LITE0\t53\n+#define CLK_BUS_MSI_LITE1\t54\n+#define CLK_BUS_MSI_LITE2\t55\n+#define CLK_MBUS_IOMMU1_SYS\t56\n+#define CLK_APB_IOMMU1_SYS\t57\n+#define CLK_AHB_IOMMU1_SYS\t58\n+#define CLK_AHB_VE_DEC\t\t59\n+#define CLK_AHB_VE_ENC\t\t60\n+#define CLK_AHB_VID_IN\t\t61\n+#define CLK_AHB_VID_COUT0\t62\n+#define CLK_AHB_VID_COUT1\t63\n+#define CLK_AHB_DE\t\t64\n+#define CLK_AHB_NPU\t\t65\n+#define CLK_AHB_GPU0\t\t66\n+#define CLK_AHB_SERDES\t\t67\n+#define CLK_AHB_USB_SYS\t\t68\n+#define CLK_AHB_MSI_LITE0\t69\n+#define CLK_AHB_STORE\t\t70\n+#define CLK_AHB_CPUS\t\t71\n+#define CLK_MBUS_IOMMU0\t\t72\n+#define CLK_MBUS_IOMMU1\t\t73\n+#define CLK_MBUS_DESYS\t\t74\n+#define CLK_MBUS_VE_ENC0_GATE\t75\n+#define CLK_MBUS_VE_DEC0_GATE\t76\n+#define CLK_MBUS_GPU0\t\t77\n+#define CLK_MBUS_NPU\t\t78\n+#define CLK_MBUS_VID_IN\t\t79\n+#define CLK_MBUS_SERDES\t\t80\n+#define CLK_MBUS_MSI_LITE0\t81\n+#define CLK_MBUS_STORE\t\t82\n+#define CLK_MBUS_MSI_LITE2\t83\n+#define CLK_MBUS_DMA0\t\t84\n+#define CLK_MBUS_VE_ENC0\t85\n+#define CLK_MBUS_CE\t\t86\n+#define CLK_MBUS_DMA1\t\t87\n+#define CLK_MBUS_NAND\t\t88\n+#define CLK_MBUS_CSI\t\t89\n+#define CLK_MBUS_ISP\t\t90\n+#define CLK_MBUS_GMAC0\t\t91\n+#define CLK_MBUS_GMAC1\t\t92\n+#define CLK_MBUS_VE_DEC0\t93\n+#define CLK_BUS_DMA0\t\t94\n+#define CLK_BUS_DMA1\t\t95\n+#define CLK_BUS_SPINLOCK\t96\n+#define CLK_BUS_MSGBOX0\t\t97\n+#define CLK_BUS_PWM0\t\t98\n+#define CLK_BUS_PWM1\t\t99\n+#define CLK_BUS_DBG\t\t100\n+#define CLK_BUS_SYSDAP\t\t101\n+#define CLK_TIMER0\t\t102\n+#define CLK_TIMER1\t\t103\n+#define CLK_TIMER2\t\t104\n+#define CLK_TIMER3\t\t105\n+#define CLK_TIMER4\t\t106\n+#define CLK_TIMER5\t\t107\n+#define CLK_TIMER6\t\t108\n+#define CLK_TIMER7\t\t109\n+#define CLK_TIMER8\t\t110\n+#define CLK_TIMER9\t\t111\n+#define CLK_BUS_TIMER\t\t112\n+#define CLK_AVS\t\t\t113\n+#define CLK_DE0\t\t\t114\n+#define CLK_BUS_DE0\t\t115\n+#define CLK_DI\t\t\t116\n+#define CLK_BUS_DI\t\t117\n+#define CLK_G2D\t\t\t118\n+#define CLK_BUS_G2D\t\t119\n+#define CLK_EINK\t\t120\n+#define CLK_EINK_PANEL\t\t121\n+#define CLK_BUS_EINK\t\t122\n+#define CLK_VE_ENC0\t\t123\n+#define CLK_VE_DEC0\t\t124\n+#define CLK_BUS_VE_ENC0\t\t125\n+#define CLK_BUS_VE_DEC0\t\t126\n+#define CLK_CE\t\t\t127\n+#define CLK_BUS_CE\t\t128\n+#define CLK_BUS_CE_SYS\t\t129\n+#define CLK_NPU\t\t\t130\n+#define CLK_BUS_NPU\t\t131\n+#define CLK_GPU0\t\t132\n+#define CLK_BUS_GPU0\t\t133\n+#define CLK_DRAM0\t\t134\n+#define CLK_BUS_DRAM0\t\t135\n+#define CLK_NAND0_CLK0\t\t136\n+#define CLK_NAND0_CLK1\t\t137\n+#define CLK_BUS_NAND0\t\t138\n+#define CLK_MMC0\t\t139\n+#define CLK_BUS_MMC0\t\t140\n+#define CLK_MMC1\t\t141\n+#define CLK_BUS_MMC1\t\t142\n+#define CLK_MMC2\t\t143\n+#define CLK_BUS_MMC2\t\t144\n+#define CLK_MMC3\t\t145\n+#define CLK_BUS_MMC3\t\t146\n+#define CLK_UFS_AXI\t\t147\n+#define CLK_UFS_CFG\t\t148\n+#define CLK_BUS_UFS\t\t149\n+#define CLK_BUS_UART0\t\t150\n+#define CLK_BUS_UART1\t\t151\n+#define CLK_BUS_UART2\t\t152\n+#define CLK_BUS_UART3\t\t153\n+#define CLK_BUS_UART4\t\t154\n+#define CLK_BUS_UART5\t\t155\n+#define CLK_BUS_UART6\t\t156\n+#define CLK_BUS_I2C0\t\t157\n+#define CLK_BUS_I2C1\t\t158\n+#define CLK_BUS_I2C2\t\t159\n+#define CLK_BUS_I2C3\t\t160\n+#define CLK_BUS_I2C4\t\t161\n+#define CLK_BUS_I2C5\t\t162\n+#define CLK_BUS_I2C6\t\t163\n+#define CLK_BUS_I2C7\t\t164\n+#define CLK_BUS_I2C8\t\t165\n+#define CLK_BUS_I2C9\t\t166\n+#define CLK_BUS_I2C10\t\t167\n+#define CLK_BUS_I2C11\t\t168\n+#define CLK_BUS_I2C12\t\t169\n+#define CLK_SPI0\t\t170\n+#define CLK_BUS_SPI0\t\t171\n+#define CLK_SPI1\t\t172\n+#define CLK_BUS_SPI1\t\t173\n+#define CLK_SPI2\t\t174\n+#define CLK_BUS_SPI2\t\t175\n+#define CLK_SPIF\t\t176\n+#define CLK_BUS_SPIF\t\t177\n+#define CLK_SPI3\t\t178\n+#define CLK_BUS_SPI3\t\t179\n+#define CLK_SPI4\t\t180\n+#define CLK_BUS_SPI4\t\t181\n+#define CLK_GPADC0_24M\t\t182\n+#define CLK_BUS_GPADC0\t\t183\n+#define CLK_BUS_THS0\t\t184\n+#define CLK_IRRX\t\t185\n+#define CLK_BUS_IRRX\t\t186\n+#define CLK_IRTX\t\t187\n+#define CLK_BUS_IRTX\t\t188\n+#define CLK_BUS_LRADC\t\t189\n+#define CLK_SGPIO\t\t190\n+#define CLK_BUS_SGPIO\t\t191\n+#define CLK_LPC\t\t\t192\n+#define CLK_BUS_LPC\t\t193\n+#define CLK_I2SPCM0\t\t194\n+#define CLK_BUS_I2SPCM0\t\t195\n+#define CLK_I2SPCM1\t\t196\n+#define CLK_BUS_I2SPCM1\t\t197\n+#define CLK_I2SPCM2\t\t198\n+#define CLK_I2SPCM2_ASRC\t199\n+#define CLK_BUS_I2SPCM2\t\t200\n+#define CLK_I2SPCM3\t\t201\n+#define CLK_BUS_I2SPCM3\t\t202\n+#define CLK_I2SPCM4\t\t203\n+#define CLK_BUS_I2SPCM4\t\t204\n+#define CLK_SPDIF_TX\t\t205\n+#define CLK_SPDIF_RX\t\t206\n+#define CLK_BUS_SPDIF\t\t207\n+#define CLK_DMIC\t\t208\n+#define CLK_BUS_DMIC\t\t209\n+#define CLK_USB_OHCI0\t\t210\n+#define CLK_BUS_OHCI0\t\t211\n+#define CLK_BUS_EHCI0\t\t212\n+#define CLK_BUS_OTG\t\t213\n+#define CLK_USB_OHCI1\t\t214\n+#define CLK_BUS_OHCI1\t\t215\n+#define CLK_BUS_EHCI1\t\t216\n+#define CLK_USB01_REF\t\t217\n+#define CLK_USB2_U2_REF\t\t218\n+#define CLK_USB2_SUSPEND\t219\n+#define CLK_USB2_MF\t\t220\n+#define CLK_USB2_U3_UTMI\t221\n+#define CLK_USB2_U2_PIPE\t222\n+#define CLK_PCIE_AUX\t\t223\n+#define CLK_PCIE_AXI_SLV\t224\n+#define CLK_SERDES_PHY\t\t225\n+#define CLK_GMAC_PTP\t\t226\n+#define CLK_GMAC0_PHY\t\t227\n+#define CLK_BUS_GMAC0\t\t228\n+#define CLK_GMAC1_PHY\t\t229\n+#define CLK_BUS_GMAC1\t\t230\n+#define CLK_TCON_LCD0\t\t231\n+#define CLK_BUS_TCON_LCD0\t232\n+#define CLK_TCON_LCD1\t\t233\n+#define CLK_BUS_TCON_LCD1\t234\n+#define CLK_TCON_LCD2\t\t235\n+#define CLK_BUS_TCON_LCD2\t236\n+#define CLK_DSI0\t\t237\n+#define CLK_BUS_DSI0\t\t238\n+#define CLK_DSI1\t\t239\n+#define CLK_BUS_DSI1\t\t240\n+#define CLK_COMBPHY0\t\t241\n+#define CLK_COMBPHY1\t\t242\n+#define CLK_BUS_TCON_TV0\t243\n+#define CLK_BUS_TCON_TV1\t244\n+#define CLK_EDP_TV\t\t245\n+#define CLK_BUS_EDP_TV\t\t246\n+#define CLK_HDMI_CEC_32K\t247\n+#define CLK_HDMI_CEC\t\t248\n+#define CLK_HDMI_TV\t\t249\n+#define CLK_BUS_HDMI_TV\t\t250\n+#define CLK_HDMI_SFR\t\t251\n+#define CLK_HDCP_ESM\t\t252\n+#define CLK_BUS_DPSS_TOP0\t253\n+#define CLK_BUS_DPSS_TOP1\t254\n+#define CLK_LEDC\t\t255\n+#define CLK_BUS_LEDC\t\t256\n+#define CLK_BUS_DSC\t\t257\n+#define CLK_CSI_MASTER0\t\t258\n+#define CLK_CSI_MASTER1\t\t259\n+#define CLK_CSI_MASTER2\t\t260\n+#define CLK_CSI\t\t\t261\n+#define CLK_BUS_CSI\t\t262\n+#define CLK_ISP\t\t\t263\n+#define CLK_RES_DCAP_24M\t264\n+#define CLK_APB2JTAG\t\t265\n+#define CLK_FANOUT_24M\t\t266\n+#define CLK_FANOUT_12M\t\t267\n+#define CLK_FANOUT_16M\t\t268\n+#define CLK_FANOUT_25M\t\t269\n+#define CLK_FANOUT_27M\t\t270\n+#define CLK_FANOUT_PCLK\t\t271\n+#define CLK_FANOUT0\t\t272\n+#define CLK_FANOUT1\t\t273\n+#define CLK_FANOUT2\t\t274\n+#define CLK_FANOUT3\t\t275\n+\n+#endif /* _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_ */\ndiff --git a/include/dt-bindings/clock/sun60i-a733-r-ccu.h b/include/dt-bindings/clock/sun60i-a733-r-ccu.h\nnew file mode 100644\nindex 00000000000000..1d3845b483bf0f\n--- /dev/null\n+++ b/include/dt-bindings/clock/sun60i-a733-r-ccu.h\n@@ -0,0 +1,39 @@\n+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */\n+/*\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ */\n+\n+#ifndef _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_\n+#define _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_\n+\n+#define CLK_R_AHB\t\t0\n+#define CLK_R_APB0\t\t1\n+#define CLK_R_APB1\t\t2\n+#define CLK_R_TIMER0\t\t3\n+#define CLK_R_TIMER1\t\t4\n+#define CLK_R_TIMER2\t\t5\n+#define CLK_R_TIMER3\t\t6\n+#define CLK_BUS_R_TIMER\t\t7\n+#define CLK_BUS_R_TWD\t\t8\n+#define CLK_R_PWM\t\t9\n+#define CLK_BUS_R_PWM\t\t10\n+#define CLK_R_SPI\t\t11\n+#define CLK_BUS_R_SPI\t\t12\n+#define CLK_BUS_R_MSGBOX\t13\n+#define CLK_BUS_R_UART0\t\t14\n+#define CLK_BUS_R_UART1\t\t15\n+#define CLK_BUS_R_I2C0\t\t16\n+#define CLK_BUS_R_I2C1\t\t17\n+#define CLK_BUS_R_I2C2\t\t18\n+#define CLK_BUS_R_PPU\t\t19\n+#define CLK_BUS_R_TZMA\t\t20\n+#define CLK_BUS_R_CPU_BIST\t21\n+#define CLK_R_IR_RX\t\t22\n+#define CLK_BUS_R_IR_RX\t\t23\n+#define CLK_BUS_R_RTC\t\t24\n+#define CLK_R_RISCV\t\t25\n+#define CLK_BUS_R_RISCV\t\t26\n+#define CLK_BUS_R_RISCV_CFG\t27\n+#define CLK_BUS_R_CPUCFG\t28\n+\n+#endif /* _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_ */\ndiff --git a/include/dt-bindings/reset/sun60i-a733-ccu.h b/include/dt-bindings/reset/sun60i-a733-ccu.h\nnew file mode 100644\nindex 00000000000000..8946f08925dc72\n--- /dev/null\n+++ b/include/dt-bindings/reset/sun60i-a733-ccu.h\n@@ -0,0 +1,129 @@\n+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */\n+/*\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ */\n+\n+#ifndef _DT_BINDINGS_RST_SUN60I_A733_CCU_H_\n+#define _DT_BINDINGS_RST_SUN60I_A733_CCU_H_\n+\n+#define RST_BUS_ITS_PCIE0\t0\n+#define RST_BUS_IOMMU0_SYS\t1\n+#define RST_BUS_MSI_LITE0_AHB\t2\n+#define RST_BUS_MSI_LITE0_MBUS\t3\n+#define RST_BUS_MSI_LITE1_AHB\t4\n+#define RST_BUS_MSI_LITE1_MBUS\t5\n+#define RST_BUS_MSI_LITE2_AHB\t6\n+#define RST_BUS_MSI_LITE2_MBUS\t7\n+#define RST_BUS_IOMMU1_SYS\t8\n+#define RST_BUS_DMA0\t\t9\n+#define RST_BUS_DMA1\t\t10\n+#define RST_BUS_SPINLOCK\t11\n+#define RST_BUS_MSGBOX\t\t12\n+#define RST_BUS_PWM0\t\t13\n+#define RST_BUS_PWM1\t\t14\n+#define RST_BUS_DBG\t\t15\n+#define RST_BUS_SYSDAP\t\t16\n+#define RST_BUS_TIMER0\t\t17\n+#define RST_BUS_DE0\t\t18\n+#define RST_BUS_DI\t\t19\n+#define RST_BUS_G2D\t\t20\n+#define RST_BUS_EINK\t\t21\n+#define RST_BUS_DE_SYS\t\t22\n+#define RST_BUS_VE_ENC0\t\t23\n+#define RST_BUS_VE_DEC0\t\t24\n+#define RST_BUS_CE\t\t25\n+#define RST_BUS_CE_SYS\t\t26\n+#define RST_BUS_NPU_CORE\t27\n+#define RST_BUS_NPU_AXI\t\t28\n+#define RST_BUS_NPU_AHB\t\t29\n+#define RST_BUS_NPU_SRAM\t30\n+#define RST_BUS_GPU0\t\t31\n+#define RST_BUS_DRAM0\t\t32\n+#define RST_BUS_NAND0\t\t33\n+#define RST_BUS_MMC0\t\t34\n+#define RST_BUS_MMC1\t\t35\n+#define RST_BUS_MMC2\t\t36\n+#define RST_BUS_MMC3\t\t37\n+#define RST_BUS_UFS_AHB\t\t38\n+#define RST_BUS_UFS_AXI\t\t39\n+#define RST_BUS_UFS_PHY\t\t40\n+#define RST_BUS_UFS_CORE\t41\n+#define RST_BUS_UART0\t\t42\n+#define RST_BUS_UART1\t\t43\n+#define RST_BUS_UART2\t\t44\n+#define RST_BUS_UART3\t\t45\n+#define RST_BUS_UART4\t\t46\n+#define RST_BUS_UART5\t\t47\n+#define RST_BUS_UART6\t\t48\n+#define RST_BUS_I2C0\t\t49\n+#define RST_BUS_I2C1\t\t50\n+#define RST_BUS_I2C2\t\t51\n+#define RST_BUS_I2C3\t\t52\n+#define RST_BUS_I2C4\t\t53\n+#define RST_BUS_I2C5\t\t54\n+#define RST_BUS_I2C6\t\t55\n+#define RST_BUS_I2C7\t\t56\n+#define RST_BUS_I2C8\t\t57\n+#define RST_BUS_I2C9\t\t58\n+#define RST_BUS_I2C10\t\t59\n+#define RST_BUS_I2C11\t\t60\n+#define RST_BUS_I2C12\t\t61\n+#define RST_BUS_SPI0\t\t62\n+#define RST_BUS_SPI1\t\t63\n+#define RST_BUS_SPI2\t\t64\n+#define RST_BUS_SPIF\t\t65\n+#define RST_BUS_SPI3\t\t66\n+#define RST_BUS_SPI4\t\t67\n+#define RST_BUS_GPADC0\t\t68\n+#define RST_BUS_THS0\t\t69\n+#define RST_BUS_IRRX\t\t70\n+#define RST_BUS_IRTX\t\t71\n+#define RST_BUS_LRADC\t\t72\n+#define RST_BUS_SGPIO\t\t73\n+#define RST_BUS_LPC\t\t74\n+#define RST_BUS_I2SPCM0\t\t75\n+#define RST_BUS_I2SPCM1\t\t76\n+#define RST_BUS_I2SPCM2\t\t77\n+#define RST_BUS_I2SPCM3\t\t78\n+#define RST_BUS_I2SPCM4\t\t79\n+#define RST_BUS_SPDIF\t\t80\n+#define RST_BUS_DMIC\t\t81\n+#define RST_USB_PHY0\t\t82\n+#define RST_BUS_OHCI0\t\t83\n+#define RST_BUS_EHCI0\t\t84\n+#define RST_BUS_OTG\t\t85\n+#define RST_USB_PHY1\t\t86\n+#define RST_BUS_OHCI1\t\t87\n+#define RST_BUS_EHCI1\t\t88\n+#define RST_BUS_USB2\t\t89\n+#define RST_BUS_PCIE_PWRUP\t90\n+#define RST_BUS_PCIE\t\t91\n+#define RST_BUS_SERDES\t\t92\n+#define RST_BUS_GMAC0\t\t93\n+#define RST_BUS_GMAC0_AXI\t94\n+#define RST_BUS_GMAC1\t\t95\n+#define RST_BUS_GMAC1_AXI\t96\n+#define RST_BUS_TCON_LCD0\t97\n+#define RST_BUS_TCON_LCD1\t98\n+#define RST_BUS_TCON_LCD2\t99\n+#define RST_BUS_LVDS0\t\t100\n+#define RST_BUS_LVDS1\t\t101\n+#define RST_BUS_DSI0\t\t102\n+#define RST_BUS_DSI1\t\t103\n+#define RST_BUS_TCON_TV0\t104\n+#define RST_BUS_TCON_TV1\t105\n+#define RST_BUS_EDP\t\t106\n+#define RST_BUS_HDMI_MAIN\t107\n+#define RST_BUS_HDMI_SUB\t108\n+#define RST_BUS_HDMI_HDCP\t109\n+#define RST_BUS_DPSS_TOP0\t110\n+#define RST_BUS_DPSS_TOP1\t111\n+#define RST_BUS_VIDEO_OUT0\t112\n+#define RST_BUS_VIDEO_OUT1\t113\n+#define RST_BUS_LEDC\t\t114\n+#define RST_BUS_DSC\t\t115\n+#define RST_BUS_CSI\t\t116\n+#define RST_BUS_VIDEO_IN\t117\n+#define RST_BUS_APB2JTAG\t118\n+\n+#endif /* _DT_BINDINGS_RST_SUN60I_A733_CCU_H_ */\ndiff --git a/include/dt-bindings/reset/sun60i-a733-r-ccu.h b/include/dt-bindings/reset/sun60i-a733-r-ccu.h\nnew file mode 100644\nindex 00000000000000..629e546d19984b\n--- /dev/null\n+++ b/include/dt-bindings/reset/sun60i-a733-r-ccu.h\n@@ -0,0 +1,23 @@\n+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */\n+/*\n+ * Copyright (C) 2026 Junhui Liu \u003cjunhui.liu@pigmoral.tech\u003e\n+ */\n+\n+#ifndef _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_\n+#define _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_\n+\n+#define RST_BUS_R_TIMER\t\t0\n+#define RST_BUS_R_PWM\t\t1\n+#define RST_BUS_R_SPI\t\t2\n+#define RST_BUS_R_MSGBOX\t3\n+#define RST_BUS_R_UART0\t\t4\n+#define RST_BUS_R_UART1\t\t5\n+#define RST_BUS_R_I2C0\t\t6\n+#define RST_BUS_R_I2C1\t\t7\n+#define RST_BUS_R_I2C2\t\t8\n+#define RST_BUS_R_IR_RX\t\t9\n+#define RST_BUS_R_RTC\t\t10\n+#define RST_BUS_R_RISCV_CFG\t11\n+#define RST_BUS_R_CPUCFG\t12\n+\n+#endif /* _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_ */\n"
} |
| 2/1 | 2026/07/12 02:57 | agent | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"SUN60I_A733_CCU",
"SUN60I_A733_R_CCU"
],
"FocusSymbols": [
"sun60i_a733_ccu_probe",
"sun60i_a733_r_ccu_probe",
"ccu_sdm_helper_is_enabled",
"ccu_sdm_helper_enable",
"ccu_sdm_helper_disable",
"ccu_sdm_helper_read_rate"
],
"Reasoning": "The patch introduces new clock control unit drivers for the Allwinner A733 SoC and modifies the core sunxi-ng Sigma-Delta Modulation (SDM) helper functions to support dual pattern registers. These changes include functional logic in `ccu_sdm.c` and new probe functions that can be reached via device tree overlays in a virtualized environment.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 9d505a2663adacff9e2d18c0e757fcba364b5be7
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Jul 12 02:57:20 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml b/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml
new file mode 100644
index 00000000000000..5a831b5c4029ab
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/allwinner,sun60i-a733-ccu.yaml
@@ -0,0 +1,107 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/allwinner,sun60i-a733-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner A733 Clock Control Unit
+
+maintainers:
+ - Junhui Liu <junhui.liu@pigmoral.tech>
+
+properties:
+ "#clock-cells":
+ const: 1
+
+ "#reset-cells":
+ const: 1
+
+ compatible:
+ enum:
+ - allwinner,sun60i-a733-ccu
+ - allwinner,sun60i-a733-r-ccu
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ minItems: 4
+ maxItems: 7
+
+ clock-names:
+ minItems: 4
+ maxItems: 7
+
+required:
+ - "#clock-cells"
+ - "#reset-cells"
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ enum:
+ - allwinner,sun60i-a733-ccu
+
+ then:
+ properties:
+ clocks:
+ items:
+ - description: High Frequency Oscillator (19.2MHz, 24MHz, or 26MHz)
+ - description: Low Frequency Oscillator (usually at 32kHz)
+ - description: Internal Oscillator
+ - description: Low Frequency Oscillator fanout
+
+ clock-names:
+ items:
+ - const: hosc
+ - const: losc
+ - const: iosc
+ - const: losc-fanout
+
+ - if:
+ properties:
+ compatible:
+ enum:
+ - allwinner,sun60i-a733-r-ccu
+
+ then:
+ properties:
+ clocks:
+ items:
+ - description: High Frequency Oscillator (19.2MHz, 24MHz, or 26MHz)
+ - description: Low Frequency Oscillator (usually at 32kHz)
+ - description: Internal Oscillator
+ - description: System 24MHz Clock
+ - description: Peripherals PLL 0 (200 MHz output)
+ - description: Peripherals PLL 0 (300 MHz output)
+ - description: Peripherals PLL 1 (300 MHz output)
+
+ clock-names:
+ items:
+ - const: hosc
+ - const: losc
+ - const: iosc
+ - const: sys-24m
+ - const: pll-periph0-200m
+ - const: pll-periph0-300m
+ - const: pll-periph1-300m
+
+additionalProperties: false
+
+examples:
+ - |
+ clock-controller@2002000 {
+ compatible = "allwinner,sun60i-a733-ccu";
+ reg = <0x02002000 0x2000>;
+ clocks = <&osc>, <&rtc 0>, <&rtc 2>, <&rtc 1>;
+ clock-names = "hosc", "losc", "iosc", "losc-fanout";
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
+...
diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
index 6af2d020e03e9f..cffa83056934ad 100644
--- a/drivers/clk/sunxi-ng/Kconfig
+++ b/drivers/clk/sunxi-ng/Kconfig
@@ -67,6 +67,16 @@ config SUN55I_A523_R_CCU
default ARCH_SUNXI
depends on ARM64 || COMPILE_TEST
+config SUN60I_A733_CCU
+ tristate "Support for the Allwinner A733 CCU"
+ default ARCH_SUNXI
+ depends on ARM64 || COMPILE_TEST
+
+config SUN60I_A733_R_CCU
+ tristate "Support for the Allwinner A733 PRCM CCU"
+ default ARCH_SUNXI
+ depends on ARM64 || COMPILE_TEST
+
config SUN4I_A10_CCU
tristate "Support for the Allwinner A10/A20 CCU"
default ARCH_SUNXI
diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
index a1c4087d724173..3a39eb9287da03 100644
--- a/drivers/clk/sunxi-ng/Makefile
+++ b/drivers/clk/sunxi-ng/Makefile
@@ -36,6 +36,8 @@ obj-$(CONFIG_SUN50I_H616_CCU) += sun50i-h616-ccu.o
obj-$(CONFIG_SUN55I_A523_CCU) += sun55i-a523-ccu.o
obj-$(CONFIG_SUN55I_A523_MCU_CCU) += sun55i-a523-mcu-ccu.o
obj-$(CONFIG_SUN55I_A523_R_CCU) += sun55i-a523-r-ccu.o
+obj-$(CONFIG_SUN60I_A733_CCU) += sun60i-a733-ccu.o
+obj-$(CONFIG_SUN60I_A733_R_CCU) += sun60i-a733-r-ccu.o
obj-$(CONFIG_SUN4I_A10_CCU) += sun4i-a10-ccu.o
obj-$(CONFIG_SUN5I_CCU) += sun5i-ccu.o
obj-$(CONFIG_SUN6I_A31_CCU) += sun6i-a31-ccu.o
@@ -64,6 +66,8 @@ sun50i-h616-ccu-y += ccu-sun50i-h616.o
sun55i-a523-ccu-y += ccu-sun55i-a523.o
sun55i-a523-mcu-ccu-y += ccu-sun55i-a523-mcu.o
sun55i-a523-r-ccu-y += ccu-sun55i-a523-r.o
+sun60i-a733-ccu-y += ccu-sun60i-a733.o
+sun60i-a733-r-ccu-y += ccu-sun60i-a733-r.o
sun4i-a10-ccu-y += ccu-sun4i-a10.o
sun5i-ccu-y += ccu-sun5i.o
sun6i-a31-ccu-y += ccu-sun6i-a31.o
diff --git a/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c b/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c
new file mode 100644
index 00000000000000..a56cd3edff5fe9
--- /dev/null
+++ b/drivers/clk/sunxi-ng/ccu-sun60i-a733-r.c
@@ -0,0 +1,273 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2023 rengaomin@allwinnertech.com
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ * Based on the A523 CCU driver:
+ * Copyright (C) 2024 Arm Ltd.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <dt-bindings/clock/sun60i-a733-r-ccu.h>
+#include <dt-bindings/reset/sun60i-a733-r-ccu.h>
+
+#include "ccu_common.h"
+#include "ccu_reset.h"
+
+#include "ccu_div.h"
+#include "ccu_gate.h"
+#include "ccu_mp.h"
+
+static const struct clk_parent_data r_ahb_parents[] = {
+ { .fw_name = "hosc" },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .fw_name = "pll-periph0-200m" },
+ { .fw_name = "pll-periph0-300m" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX(r_ahb_clk, "r-ahb", r_ahb_parents, 0x000,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ 0);
+
+static const struct clk_parent_data r_apb_parents[] = {
+ { .fw_name = "hosc" },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .fw_name = "pll-periph0-200m" },
+ { .fw_name = "sys-24m" },
+};
+
+static SUNXI_CCU_M_DATA_WITH_MUX(r_apb0_clk, "r-apb0", r_apb_parents, 0x00c,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ 0);
+
+static SUNXI_CCU_M_DATA_WITH_MUX(r_apb1_clk, "r-apb1", r_apb_parents, 0x010,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ 0);
+
+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer0, "r-timer0", r_apb_parents, 0x100,
+ 1, 3, /* P */
+ 4, 3, /* mux */
+ BIT(0), /* gate */
+ 0);
+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer1, "r-timer1", r_apb_parents, 0x104,
+ 1, 3, /* P */
+ 4, 3, /* mux */
+ BIT(0), /* gate */
+ 0);
+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer2, "r-timer2", r_apb_parents, 0x108,
+ 1, 3, /* P */
+ 4, 3, /* mux */
+ BIT(0), /* gate */
+ 0);
+static SUNXI_CCU_P_DATA_WITH_MUX_GATE(r_cpu_timer3, "r-timer3", r_apb_parents, 0x10c,
+ 1, 3, /* P */
+ 4, 3, /* mux */
+ BIT(0), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_timer_clk, "bus-r-timer", &r_ahb_clk.common.hw, 0x11c, BIT(0), 0);
+static SUNXI_CCU_GATE_HW(bus_r_twd_clk, "bus-r-twd", &r_apb0_clk.common.hw, 0x12c, BIT(0), 0);
+
+static const struct clk_parent_data r_pwm_parents[] = {
+ { .fw_name = "hosc" },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .fw_name = "sys-24m" },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(r_pwm_clk, "r-pwm", r_pwm_parents, 0x130,
+ 24, 2, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HW(bus_r_pwm_clk, "bus-r-pwm",
+ &r_apb0_clk.common.hw, 0x13c, BIT(0), 0);
+
+static const struct clk_parent_data r_spi_parents[] = {
+ { .fw_name = "hosc" },
+ { .fw_name = "pll-periph0-200m" },
+ { .fw_name = "pll-periph0-300m" },
+ { .fw_name = "pll-periph1-300m" },
+ { .fw_name = "sys-24m" },
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(r_spi_clk, "r-spi", r_spi_parents, 0x150,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HW(bus_r_spi_clk, "bus-r-spi", &r_ahb_clk.common.hw, 0x15c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_msgbox_clk, "bus-r-msgbox", &r_ahb_clk.common.hw, 0x17c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_uart0_clk, "bus-r-uart0", &r_apb1_clk.common.hw, 0x18c, BIT(0), 0);
+static SUNXI_CCU_GATE_HW(bus_r_uart1_clk, "bus-r-uart1", &r_apb1_clk.common.hw, 0x18c, BIT(1), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_i2c0_clk, "bus-r-i2c0", &r_apb1_clk.common.hw, 0x19c, BIT(0), 0);
+static SUNXI_CCU_GATE_HW(bus_r_i2c1_clk, "bus-r-i2c1", &r_apb1_clk.common.hw, 0x19c, BIT(1), 0);
+static SUNXI_CCU_GATE_HW(bus_r_i2c2_clk, "bus-r-i2c2", &r_apb1_clk.common.hw, 0x19c, BIT(2), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_ppu_clk, "bus-r-ppu", &r_apb0_clk.common.hw, 0x1ac, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_tzma_clk, "bus-r-tzma", &r_apb0_clk.common.hw, 0x1b0, BIT(0), 0);
+static SUNXI_CCU_GATE_HW(bus_r_cpu_bist_clk, "bus-r-cpu-bist", &r_apb0_clk.common.hw,
+ 0x1bc, BIT(0), 0);
+
+static const struct clk_parent_data r_ir_rx_parents[] = {
+ { .fw_name = "losc" },
+ { .fw_name = "hosc" },
+ { .fw_name = "sys-24m" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(r_ir_rx_clk, "r-ir-rx", r_ir_rx_parents, 0x1c0,
+ 0, 5, /* M */
+ 24, 2, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HW(bus_r_ir_rx_clk, "bus-r-ir-rx", &r_apb0_clk.common.hw, 0x1cc, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc", &r_ahb_clk.common.hw, 0x20c, BIT(0), 0);
+
+static const struct clk_parent_data r_riscv_parents[] = {
+ { .fw_name = "hosc" },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(r_riscv_clk, "r-riscv", r_riscv_parents, 0x210,
+ 24, 2, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HW(bus_r_riscv_clk, "bus-r-riscv", &r_apb0_clk.common.hw,
+ 0x21c, BIT(0), 0);
+static SUNXI_CCU_GATE_HW(bus_r_riscv_cfg_clk, "bus-r-riscv-cfg", &r_apb0_clk.common.hw,
+ 0x21c, BIT(1), 0);
+
+static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg", &r_apb0_clk.common.hw,
+ 0x22c, BIT(0), CLK_IS_CRITICAL);
+
+static struct ccu_common *sun60i_a733_r_ccu_clks[] = {
+ &r_ahb_clk.common,
+ &r_apb0_clk.common,
+ &r_apb1_clk.common,
+ &r_cpu_timer0.common,
+ &r_cpu_timer1.common,
+ &r_cpu_timer2.common,
+ &r_cpu_timer3.common,
+ &bus_r_timer_clk.common,
+ &bus_r_twd_clk.common,
+ &r_pwm_clk.common,
+ &bus_r_pwm_clk.common,
+ &r_spi_clk.common,
+ &bus_r_spi_clk.common,
+ &bus_r_msgbox_clk.common,
+ &bus_r_uart0_clk.common,
+ &bus_r_uart1_clk.common,
+ &bus_r_i2c0_clk.common,
+ &bus_r_i2c1_clk.common,
+ &bus_r_i2c2_clk.common,
+ &bus_r_ppu_clk.common,
+ &bus_r_tzma_clk.common,
+ &bus_r_cpu_bist_clk.common,
+ &r_ir_rx_clk.common,
+ &bus_r_ir_rx_clk.common,
+ &bus_r_rtc_clk.common,
+ &r_riscv_clk.common,
+ &bus_r_riscv_clk.common,
+ &bus_r_riscv_cfg_clk.common,
+ &bus_r_cpucfg_clk.common,
+};
+
+static struct clk_hw_onecell_data sun60i_a733_r_hw_clks = {
+ .hws = {
+ [CLK_R_AHB] = &r_ahb_clk.common.hw,
+ [CLK_R_APB0] = &r_apb0_clk.common.hw,
+ [CLK_R_APB1] = &r_apb1_clk.common.hw,
+ [CLK_R_TIMER0] = &r_cpu_timer0.common.hw,
+ [CLK_R_TIMER1] = &r_cpu_timer1.common.hw,
+ [CLK_R_TIMER2] = &r_cpu_timer2.common.hw,
+ [CLK_R_TIMER3] = &r_cpu_timer3.common.hw,
+ [CLK_BUS_R_TIMER] = &bus_r_timer_clk.common.hw,
+ [CLK_BUS_R_TWD] = &bus_r_twd_clk.common.hw,
+ [CLK_R_PWM] = &r_pwm_clk.common.hw,
+ [CLK_BUS_R_PWM] = &bus_r_pwm_clk.common.hw,
+ [CLK_R_SPI] = &r_spi_clk.common.hw,
+ [CLK_BUS_R_SPI] = &bus_r_spi_clk.common.hw,
+ [CLK_BUS_R_MSGBOX] = &bus_r_msgbox_clk.common.hw,
+ [CLK_BUS_R_UART0] = &bus_r_uart0_clk.common.hw,
+ [CLK_BUS_R_UART1] = &bus_r_uart1_clk.common.hw,
+ [CLK_BUS_R_I2C0] = &bus_r_i2c0_clk.common.hw,
+ [CLK_BUS_R_I2C1] = &bus_r_i2c1_clk.common.hw,
+ [CLK_BUS_R_I2C2] = &bus_r_i2c2_clk.common.hw,
+ [CLK_BUS_R_PPU] = &bus_r_ppu_clk.common.hw,
+ [CLK_BUS_R_TZMA] = &bus_r_tzma_clk.common.hw,
+ [CLK_BUS_R_CPU_BIST] = &bus_r_cpu_bist_clk.common.hw,
+ [CLK_R_IR_RX] = &r_ir_rx_clk.common.hw,
+ [CLK_BUS_R_IR_RX] = &bus_r_ir_rx_clk.common.hw,
+ [CLK_BUS_R_RTC] = &bus_r_rtc_clk.common.hw,
+ [CLK_R_RISCV] = &r_riscv_clk.common.hw,
+ [CLK_BUS_R_RISCV] = &bus_r_riscv_clk.common.hw,
+ [CLK_BUS_R_RISCV_CFG] = &bus_r_riscv_cfg_clk.common.hw,
+ [CLK_BUS_R_CPUCFG] = &bus_r_cpucfg_clk.common.hw,
+ },
+ .num = CLK_BUS_R_CPUCFG + 1,
+};
+
+static struct ccu_reset_map sun60i_a733_r_ccu_resets[] = {
+ [RST_BUS_R_TIMER] = { 0x11c, BIT(16) },
+ [RST_BUS_R_PWM] = { 0x13c, BIT(16) },
+ [RST_BUS_R_SPI] = { 0x15c, BIT(16) },
+ [RST_BUS_R_MSGBOX] = { 0x17c, BIT(16) },
+ [RST_BUS_R_UART0] = { 0x18c, BIT(16) },
+ [RST_BUS_R_UART1] = { 0x18c, BIT(17) },
+ [RST_BUS_R_I2C0] = { 0x19c, BIT(16) },
+ [RST_BUS_R_I2C1] = { 0x19c, BIT(17) },
+ [RST_BUS_R_I2C2] = { 0x19c, BIT(18) },
+ [RST_BUS_R_IR_RX] = { 0x1cc, BIT(16) },
+ [RST_BUS_R_RTC] = { 0x20c, BIT(16) },
+ [RST_BUS_R_RISCV_CFG] = { 0x21c, BIT(16) },
+ [RST_BUS_R_CPUCFG] = { 0x22c, BIT(16) },
+};
+
+static const struct sunxi_ccu_desc sun60i_a733_r_ccu_desc = {
+ .ccu_clks = sun60i_a733_r_ccu_clks,
+ .num_ccu_clks = ARRAY_SIZE(sun60i_a733_r_ccu_clks),
+
+ .hw_clks = &sun60i_a733_r_hw_clks,
+
+ .resets = sun60i_a733_r_ccu_resets,
+ .num_resets = ARRAY_SIZE(sun60i_a733_r_ccu_resets),
+};
+
+static int sun60i_a733_r_ccu_probe(struct platform_device *pdev)
+{
+ void __iomem *reg;
+
+ reg = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(reg))
+ return PTR_ERR(reg);
+
+ return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun60i_a733_r_ccu_desc);
+}
+
+static const struct of_device_id sun60i_a733_r_ccu_ids[] = {
+ { .compatible = "allwinner,sun60i-a733-r-ccu" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sun60i_a733_r_ccu_ids);
+
+static struct platform_driver sun60i_a733_r_ccu_driver = {
+ .probe = sun60i_a733_r_ccu_probe,
+ .driver = {
+ .name = "sun60i-a733-r-ccu",
+ .suppress_bind_attrs = true,
+ .of_match_table = sun60i_a733_r_ccu_ids,
+ },
+};
+module_platform_driver(sun60i_a733_r_ccu_driver);
+
+MODULE_IMPORT_NS("SUNXI_CCU");
+MODULE_DESCRIPTION("Support for the Allwinner A733 PRCM CCU");
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/sunxi-ng/ccu-sun60i-a733.c b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c
new file mode 100644
index 00000000000000..ff64c35206d2d5
--- /dev/null
+++ b/drivers/clk/sunxi-ng/ccu-sun60i-a733.c
@@ -0,0 +1,2360 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2023 rengaomin@allwinnertech.com
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ * Based on the A523 CCU driver:
+ * Copyright (C) 2023-2024 Arm Ltd.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <dt-bindings/clock/sun60i-a733-ccu.h>
+#include <dt-bindings/reset/sun60i-a733-ccu.h>
+
+#include "../clk.h"
+
+#include "ccu_common.h"
+#include "ccu_reset.h"
+
+#include "ccu_div.h"
+#include "ccu_gate.h"
+#include "ccu_mp.h"
+#include "ccu_mult.h"
+#include "ccu_mux.h"
+#include "ccu_nkmp.h"
+#include "ccu_nm.h"
+
+/*
+ * The DCXO oscillator, the root of most of the clock tree, which may be
+ * 19.2MHz, 24MHz, or 26MHz.
+ */
+static const struct clk_parent_data hosc[] = {
+ { .fw_name = "hosc" }
+};
+
+/**************************************************************************
+ * PLLs *
+ **************************************************************************/
+
+/*
+ * Undocumented, taken from the vendor kernel.
+ * PLL_REF normalizes the DCXO frequency to a 24MHz reference for downstream
+ * PLLs.
+ */
+#define SUN60I_A733_PLL_REF_REG 0x000
+static struct ccu_nkmp pll_ref_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT(8, 8),
+ .m = _SUNXI_CCU_DIV(16, 7), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_REF_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-ref", hosc,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+/*
+ * Most clock-defining macros expect an *array* of parent clocks, even if
+ * they do not contain a muxer to select between different parents.
+ * The macros ending in just _HW take a simple clock pointer, but then create
+ * a single-entry array out of that. The macros using _HWS take such an
+ * array (even when it is a single entry one), this avoids having those
+ * helper arrays created inside *every* clock definition.
+ * This means for every clock that is referenced more than once it is
+ * useful to create such a dummy array and use _HWS.
+ */
+static const struct clk_hw *pll_ref_hws[] = {
+ &pll_ref_clk.common.hw
+};
+
+/*
+ * There is a non-software-configurable mux selecting between the DCXO and the
+ * PLL_REF in hardware, whose output is fed to the sys-24M clock. Although both
+ * sys-24M and pll-ref are fixed at 24 MHz, define a 1:1 fixed factor clock to
+ * provide logical separation:
+ * - pll-ref is dedicated to feeding other PLLs
+ * - sys-24M serves as reference clock for downstream functional modules
+ */
+static CLK_FIXED_FACTOR_HWS(sys_24M_clk, "sys-24M", pll_ref_hws, 1, 1, 0);
+static const struct clk_hw *sys_24M_hws[] = {
+ &sys_24M_clk.hw
+};
+
+#define SUN60I_A733_PLL_DDR_REG 0x020
+static struct ccu_nkmp pll_ddr_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(20, 3), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_DDR_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-ddr", pll_ref_hws,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE |
+ CLK_IS_CRITICAL),
+ },
+};
+
+/*
+ * There is no actual clock output with that frequency (2.4 GHz), instead it
+ * has multiple outputs with adjustable dividers from that base frequency.
+ * Model them separately as divider clocks based on that parent here.
+ */
+#define SUN60I_A733_PLL_PERIPH0_REG 0x0a0
+static struct ccu_nm pll_periph0_4x_clk = {
+ .enable = BIT(25) | BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_PERIPH0_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-periph0-4x",
+ pll_ref_hws, &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_periph0_4x_hws[] = {
+ &pll_periph0_4x_clk.common.hw
+};
+
+static SUNXI_CCU_M_HWS(pll_periph0_2x_clk, "pll-periph0-2x", pll_periph0_4x_hws,
+ SUN60I_A733_PLL_PERIPH0_REG, 20, 3, 0);
+static const struct clk_hw *pll_periph0_2x_hws[] = {
+ &pll_periph0_2x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_periph0_800M_clk, "pll-periph0-800M", pll_periph0_4x_hws,
+ SUN60I_A733_PLL_PERIPH0_REG, 16, 3, 0);
+static SUNXI_CCU_M_HWS(pll_periph0_480M_clk, "pll-periph0-480M", pll_periph0_4x_hws,
+ SUN60I_A733_PLL_PERIPH0_REG, 2, 3, 0);
+static const struct clk_hw *pll_periph0_480M_hws[] = {
+ &pll_periph0_480M_clk.common.hw
+};
+static CLK_FIXED_FACTOR_HWS(pll_periph0_600M_clk, "pll-periph0-600M",
+ pll_periph0_2x_hws, 2, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph0_400M_clk, "pll-periph0-400M",
+ pll_periph0_2x_hws, 3, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph0_300M_clk, "pll-periph0-300M",
+ pll_periph0_2x_hws, 4, 1, 0);
+static const struct clk_hw *pll_periph0_300M_hws[] = {
+ &pll_periph0_300M_clk.hw
+};
+static CLK_FIXED_FACTOR_HWS(pll_periph0_200M_clk, "pll-periph0-200M",
+ pll_periph0_2x_hws, 6, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph0_150M_clk, "pll-periph0-150M",
+ pll_periph0_2x_hws, 8, 1, 0);
+static const struct clk_hw *pll_periph0_150M_hws[] = {
+ &pll_periph0_150M_clk.hw
+};
+static CLK_FIXED_FACTOR_HWS(pll_periph0_160M_clk, "pll-periph0-160M",
+ pll_periph0_480M_hws, 3, 1, 0);
+
+#define SUN60I_A733_PLL_PERIPH1_REG 0x0c0
+static struct ccu_nm pll_periph1_4x_clk = {
+ .enable = BIT(25) | BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_PERIPH1_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-periph1-4x",
+ pll_ref_hws, &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_periph1_4x_hws[] = {
+ &pll_periph1_4x_clk.common.hw
+};
+
+static SUNXI_CCU_M_HWS(pll_periph1_2x_clk, "pll-periph1-2x", pll_periph1_4x_hws,
+ SUN60I_A733_PLL_PERIPH1_REG, 20, 3, 0);
+static const struct clk_hw *pll_periph1_2x_hws[] = {
+ &pll_periph1_2x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_periph1_800M_clk, "pll-periph1-800M", pll_periph1_4x_hws,
+ SUN60I_A733_PLL_PERIPH1_REG, 16, 3, 0);
+static SUNXI_CCU_M_HWS(pll_periph1_480M_clk, "pll-periph1-480M", pll_periph1_4x_hws,
+ SUN60I_A733_PLL_PERIPH1_REG, 2, 3, 0);
+static const struct clk_hw *pll_periph1_480M_hws[] = {
+ &pll_periph1_480M_clk.common.hw
+};
+static CLK_FIXED_FACTOR_HWS(pll_periph1_600M_clk, "pll-periph1-600M",
+ pll_periph1_2x_hws, 2, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph1_400M_clk, "pll-periph1-400M",
+ pll_periph1_2x_hws, 3, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph1_300M_clk, "pll-periph1-300M",
+ pll_periph1_2x_hws, 4, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph1_200M_clk, "pll-periph1-200M",
+ pll_periph1_2x_hws, 6, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph1_150M_clk, "pll-periph1-150M",
+ pll_periph1_2x_hws, 8, 1, 0);
+static CLK_FIXED_FACTOR_HWS(pll_periph1_160M_clk, "pll-periph1-160M",
+ pll_periph1_480M_hws, 3, 1, 0);
+
+#define SUN60I_A733_PLL_GPU_REG 0x0e0
+static struct ccu_nkmp pll_gpu0_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(20, 3), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_GPU_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-gpu0", pll_ref_hws,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+#define SUN60I_A733_PLL_VIDEO0_REG 0x120
+static struct ccu_nm pll_video0_12x_clk = {
+ .enable = BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_VIDEO0_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-video0-12x", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_video0_12x_hws[] = {
+ &pll_video0_12x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_video0_4x_clk, "pll-video0-4x", pll_video0_12x_hws,
+ SUN60I_A733_PLL_VIDEO0_REG, 20, 3, 0);
+static SUNXI_CCU_M_HWS(pll_video0_3x_clk, "pll-video0-3x", pll_video0_12x_hws,
+ SUN60I_A733_PLL_VIDEO0_REG, 16, 3, 0);
+
+#define SUN60I_A733_PLL_VIDEO1_REG 0x140
+static struct ccu_nm pll_video1_12x_clk = {
+ .enable = BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_VIDEO1_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-video1-12x", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_video1_12x_hws[] = {
+ &pll_video1_12x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_video1_4x_clk, "pll-video1-4x", pll_video1_12x_hws,
+ SUN60I_A733_PLL_VIDEO1_REG, 20, 3, 0);
+static SUNXI_CCU_M_HWS(pll_video1_3x_clk, "pll-video1-3x", pll_video1_12x_hws,
+ SUN60I_A733_PLL_VIDEO1_REG, 16, 3, 0);
+
+#define SUN60I_A733_PLL_VIDEO2_REG 0x160
+static struct ccu_nm pll_video2_12x_clk = {
+ .enable = BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_VIDEO2_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-video2-12x", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_video2_12x_hws[] = {
+ &pll_video2_12x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_video2_4x_clk, "pll-video2-4x", pll_video2_12x_hws,
+ SUN60I_A733_PLL_VIDEO2_REG, 20, 3, 0);
+static SUNXI_CCU_M_HWS(pll_video2_3x_clk, "pll-video2-3x", pll_video2_12x_hws,
+ SUN60I_A733_PLL_VIDEO2_REG, 16, 3, 0);
+
+#define SUN60I_A733_PLL_VE0_REG 0x220
+static struct ccu_nkmp pll_ve0_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(20, 3), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_VE0_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-ve0", pll_ref_hws,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+#define SUN60I_A733_PLL_VE1_REG 0x240
+static struct ccu_nkmp pll_ve1_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(20, 3), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_VE1_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-ve1", pll_ref_hws,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+/*
+ * PLL_AUDIO0 has a m1 divider in addition to the usual N, M factors.
+ * Since we only need some fixed frequency from this PLL (22.5792MHz x 4),
+ * ignore the divider and force it to 1 (encoded as 0), in the probe function
+ * below.
+ * The M factor must be an even number to produce a 50% duty cycle output.
+ */
+#define SUN60I_A733_PLL_AUDIO0_REG 0x260
+static struct ccu_sdm_setting pll_audio0_sdm_table[] = {
+ { .rate = 90316800, .pattern = 0xa002872b, .m = 20, .n = 75 }, /* 22.5792 * 4 */
+};
+
+static struct ccu_nm pll_audio0_4x_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(16, 7),
+ .sdm = _SUNXI_CCU_SDM_DUAL_PAT(pll_audio0_sdm_table, 0,
+ 0x268, BIT(31),
+ 0x26c, BIT(27) | BIT(31)),
+ .common = {
+ .reg = SUN60I_A733_PLL_AUDIO0_REG,
+ .features = CCU_FEATURE_SIGMA_DELTA_MOD,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-audio0-4x", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+#define SUN60I_A733_PLL_AUDIO1_REG 0x280
+static struct ccu_nm pll_audio1_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_AUDIO1_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-audio1", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_audio1_hws[] = {
+ &pll_audio1_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_audio1_div2_clk, "pll-audio1-div2", pll_audio1_hws,
+ SUN60I_A733_PLL_AUDIO1_REG, 20, 3, 0);
+static SUNXI_CCU_M_HWS(pll_audio1_div5_clk, "pll-audio1-div5", pll_audio1_hws,
+ SUN60I_A733_PLL_AUDIO1_REG, 16, 3, 0);
+
+#define SUN60I_A733_PLL_NPU_REG 0x2a0
+static struct ccu_nkmp pll_npu_clk = {
+ .enable = BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(20, 3), /* output divider */
+ .p = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_NPU_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-npu", pll_ref_hws,
+ &ccu_nkmp_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+#define SUN60I_A733_PLL_DE_REG 0x2e0
+static struct ccu_nm pll_de_12x_clk = {
+ .enable = BIT(26) | BIT(27),
+ .lock = BIT(28),
+ .n = _SUNXI_CCU_MULT_MIN(8, 8, 11),
+ .m = _SUNXI_CCU_DIV(1, 1), /* input divider */
+ .common = {
+ .reg = SUN60I_A733_PLL_DE_REG,
+ .hw.init = CLK_HW_INIT_PARENTS_HW("pll-de-12x", pll_ref_hws,
+ &ccu_nm_ops,
+ CLK_SET_RATE_GATE),
+ },
+};
+
+static const struct clk_hw *pll_de_hws[] = {
+ &pll_de_12x_clk.common.hw
+};
+static SUNXI_CCU_M_HWS(pll_de_4x_clk, "pll-de-4x", pll_de_hws,
+ SUN60I_A733_PLL_DE_REG, 20, 3, 0);
+static SUNXI_CCU_M_HWS(pll_de_3x_clk, "pll-de-3x", pll_de_hws,
+ SUN60I_A733_PLL_DE_REG, 16, 3, 0);
+
+/**************************************************************************
+ * bus clocks *
+ **************************************************************************/
+
+static const struct clk_parent_data ahb_apb_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .hw = &pll_periph0_600M_clk.hw },
+};
+
+static SUNXI_CCU_M_DATA_WITH_MUX(ahb_clk, "ahb", ahb_apb_parents, 0x500,
+ 0, 5, /* M */
+ 24, 2, /* mux */
+ 0);
+static const struct clk_hw *ahb_hws[] = { &ahb_clk.common.hw };
+
+static SUNXI_CCU_M_DATA_WITH_MUX(apb0_clk, "apb0", ahb_apb_parents, 0x510,
+ 0, 5, /* M */
+ 24, 2, /* mux */
+ 0);
+static const struct clk_hw *apb0_hws[] = { &apb0_clk.common.hw };
+
+static SUNXI_CCU_M_DATA_WITH_MUX(apb1_clk, "apb1", ahb_apb_parents, 0x518,
+ 0, 5, /* M */
+ 24, 2, /* mux */
+ 0);
+static const struct clk_hw *apb1_hws[] = { &apb1_clk.common.hw };
+
+static const struct clk_parent_data apb_uart_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .hw = &pll_periph0_600M_clk.hw },
+ { .hw = &pll_periph0_480M_clk.common.hw },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX(apb_uart_clk, "apb-uart", apb_uart_parents, 0x538,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ 0);
+static const struct clk_hw *apb_uart_hws[] = {
+ &apb_uart_clk.common.hw
+};
+
+static const struct clk_parent_data trace_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .hw = &pll_periph0_300M_clk.hw },
+ { .hw = &pll_periph0_400M_clk.hw },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(trace_clk, "trace", trace_parents, 0x540,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_DATA(bus_its_pcie0_aclk_clk, "bus-its-pcie0-aclk", hosc, 0x574, BIT(1), 0);
+
+static const struct clk_parent_data mbus_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph1_600M_clk.hw },
+ { .hw = &pll_ddr_clk.common.hw },
+ { .hw = &pll_periph1_480M_clk.common.hw },
+ { .hw = &pll_periph1_400M_clk.hw },
+ { .hw = &pll_npu_clk.common.hw },
+};
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT(mbus_clk, "mbus", mbus_parents, 0x588,
+ 0, 5, /* M */
+ 0, 0, /* no P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_IS_CRITICAL,
+ CCU_FEATURE_UPDATE_BIT);
+static const struct clk_hw *mbus_hws[] = { &mbus_clk.common.hw };
+
+static SUNXI_CCU_GATE_HWS(mbus_iommu0_sys_clk, "mbus-iommu0-sys", mbus_hws, 0x58c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(apb_iommu0_sys_clk, "apb-iommu0-sys", apb0_hws, 0x58c, BIT(1), 0);
+static SUNXI_CCU_GATE_HWS(ahb_iommu0_sys_clk, "ahb-iommu0-sys", ahb_hws, 0x58c, BIT(2), 0);
+
+static SUNXI_CCU_GATE_DATA(bus_msi_lite0_clk, "bus-msi-lite0", hosc, 0x594, BIT(0), 0);
+static SUNXI_CCU_GATE_DATA(bus_msi_lite1_clk, "bus-msi-lite1", hosc, 0x59c, BIT(0), 0);
+static SUNXI_CCU_GATE_DATA(bus_msi_lite2_clk, "bus-msi-lite2", hosc, 0x5a4, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(mbus_iommu1_sys_clk, "mbus-iommu1-sys", mbus_hws, 0x5b4, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(apb_iommu1_sys_clk, "apb_iommu1-sys", apb0_hws, 0x5b4, BIT(1), 0);
+static SUNXI_CCU_GATE_HWS(ahb_iommu1_sys_clk, "ahb_iommu1-sys", ahb_hws, 0x5b4, BIT(2), 0);
+
+static SUNXI_CCU_GATE_HWS(ahb_ve_dec_clk, "ahb-ve-dec", ahb_hws,
+ 0x5c0, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(ahb_ve_enc_clk, "ahb-ve-enc", ahb_hws,
+ 0x5c0, BIT(1), 0);
+static SUNXI_CCU_GATE_HWS(ahb_vid_in_clk, "ahb-vid-in", ahb_hws,
+ 0x5c0, BIT(2), 0);
+static SUNXI_CCU_GATE_HWS(ahb_vid_cout0_clk, "ahb-vid-cout0", ahb_hws,
+ 0x5c0, BIT(3), 0);
+static SUNXI_CCU_GATE_HWS(ahb_vid_cout1_clk, "ahb-vid-cout1", ahb_hws,
+ 0x5c0, BIT(4), 0);
+static SUNXI_CCU_GATE_HWS(ahb_de_clk, "ahb-de", ahb_hws,
+ 0x5c0, BIT(5), 0);
+static SUNXI_CCU_GATE_HWS(ahb_npu_clk, "ahb-npu", ahb_hws,
+ 0x5c0, BIT(6), 0);
+static SUNXI_CCU_GATE_HWS(ahb_gpu0_clk, "ahb-gpu0", ahb_hws,
+ 0x5c0, BIT(7), 0);
+static SUNXI_CCU_GATE_HWS(ahb_serdes_clk, "ahb-serdes", ahb_hws,
+ 0x5c0, BIT(8), 0);
+static SUNXI_CCU_GATE_HWS(ahb_usb_sys_clk, "ahb-usb-sys", ahb_hws,
+ 0x5c0, BIT(9), 0);
+static SUNXI_CCU_GATE_HWS(ahb_msi_lite0_clk, "ahb-msi-lite0", ahb_hws,
+ 0x5c0, BIT(16), 0);
+static SUNXI_CCU_GATE_HWS(ahb_store_clk, "ahb-store", ahb_hws,
+ 0x5c0, BIT(24), CLK_IS_CRITICAL);
+static SUNXI_CCU_GATE_HWS(ahb_cpus_clk, "ahb-cpus", ahb_hws,
+ 0x5c0, BIT(28), 0);
+
+static SUNXI_CCU_GATE_HWS(mbus_iommu0_clk, "mbus-iommu0", mbus_hws,
+ 0x5e0, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(mbus_iommu1_clk, "mbus-iommu1", mbus_hws,
+ 0x5e0, BIT(1), 0);
+static SUNXI_CCU_GATE_HWS(mbus_desys_clk, "mbus-desys", mbus_hws,
+ 0x5e0, BIT(11), 0);
+static SUNXI_CCU_GATE_HWS(mbus_ve_enc0_gate_clk, "mbus-ve-enc0-gate", mbus_hws,
+ 0x5e0, BIT(12), 0);
+static SUNXI_CCU_GATE_HWS(mbus_ve_dec0_gate_clk, "mbus-ve-dec0-gate", mbus_hws,
+ 0x5e0, BIT(14), 0);
+static SUNXI_CCU_GATE_HWS(mbus_gpu0_clk, "mbus-gpu0", mbus_hws,
+ 0x5e0, BIT(16), 0);
+static SUNXI_CCU_GATE_HWS(mbus_npu_clk, "mbus-npu", mbus_hws,
+ 0x5e0, BIT(18), 0);
+static SUNXI_CCU_GATE_HWS(mbus_vid_in_clk, "mbus-vid-in", mbus_hws,
+ 0x5e0, BIT(24), 0);
+static SUNXI_CCU_GATE_HWS(mbus_serdes_clk, "mbus-serdes", mbus_hws,
+ 0x5e0, BIT(28), 0);
+static SUNXI_CCU_GATE_HWS(mbus_msi_lite0_clk, "mbus-msi-lite0", mbus_hws,
+ 0x5e0, BIT(29), 0);
+static SUNXI_CCU_GATE_HWS(mbus_store_clk, "mbus-store", mbus_hws,
+ 0x5e0, BIT(30), CLK_IS_CRITICAL);
+static SUNXI_CCU_GATE_HWS(mbus_msi_lite2_clk, "mbus-msi-lite2", mbus_hws,
+ 0x5e0, BIT(31), 0);
+
+static SUNXI_CCU_GATE_HWS(mbus_dma0_clk, "mbus-dma0", mbus_hws,
+ 0x5e4, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(mbus_ve_enc0_clk, "mbus-ve-enc0", mbus_hws,
+ 0x5e4, BIT(1), 0);
+static SUNXI_CCU_GATE_HWS(mbus_ce_clk, "mbus-ce", mbus_hws,
+ 0x5e4, BIT(2), 0);
+static SUNXI_CCU_GATE_HWS(mbus_dma1_clk, "mbus-dma1", mbus_hws,
+ 0x5e4, BIT(3), 0);
+static SUNXI_CCU_GATE_HWS(mbus_nand_clk, "mbus-nand", mbus_hws,
+ 0x5e4, BIT(5), 0);
+static SUNXI_CCU_GATE_HWS(mbus_csi_clk, "mbus-csi", mbus_hws,
+ 0x5e4, BIT(8), 0);
+static SUNXI_CCU_GATE_HWS(mbus_isp_clk, "mbus-isp", mbus_hws,
+ 0x5e4, BIT(9), 0);
+static SUNXI_CCU_GATE_HWS(mbus_gmac0_clk, "mbus-gmac0", mbus_hws,
+ 0x5e4, BIT(11), 0);
+/* Undocumented, taken from the vendor kernel. */
+static SUNXI_CCU_GATE_HWS(mbus_gmac1_clk, "mbus-gmac1", mbus_hws,
+ 0x5e4, BIT(12), 0);
+static SUNXI_CCU_GATE_HWS(mbus_ve_dec0_clk, "mbus-ve-dec0", mbus_hws,
+ 0x5e4, BIT(18), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_dma0_clk, "bus-dma0", ahb_hws,
+ 0x704, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_dma1_clk, "bus-dma1", ahb_hws,
+ 0x70c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_spinlock_clk, "bus-spinlock", ahb_hws,
+ 0x724, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_msgbox0_clk, "bus-msgbox0", ahb_hws,
+ 0x744, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_pwm0_clk, "bus-pwm0", apb0_hws,
+ 0x784, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_pwm1_clk, "bus-pwm1", apb0_hws,
+ 0x78c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_dbg_clk, "bus-dbg", sys_24M_hws,
+ 0x7a4, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_sysdap_clk, "bus-sysdap", apb1_hws,
+ 0x7ac, BIT(0), 0);
+
+/**************************************************************************
+ * mod clocks with gates *
+ **************************************************************************/
+
+static const struct clk_parent_data timer_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "iosc" },
+ { .fw_name = "losc" },
+ { .hw = &pll_periph0_200M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer0_clk, "timer0", timer_parents, 0x800,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer1_clk, "timer1", timer_parents, 0x804,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer2_clk, "timer2", timer_parents, 0x808,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer3_clk, "timer3", timer_parents, 0x80c,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer4_clk, "timer4", timer_parents, 0x810,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer5_clk, "timer5", timer_parents, 0x814,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer6_clk, "timer6", timer_parents, 0x818,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer7_clk, "timer7", timer_parents, 0x81c,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer8_clk, "timer8", timer_parents, 0x820,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(timer9_clk, "timer9", timer_parents, 0x824,
+ 0, 0, /* no M */
+ 0, 3, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_timer_clk, "bus-timer", ahb_hws, 0x850, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static const struct clk_parent_data avs_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(avs_clk, "avs-clk", avs_parents, 0x880,
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *de_parents[] = {
+ &pll_de_3x_clk.common.hw,
+ &pll_de_4x_clk.common.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+ &pll_periph0_300M_clk.hw,
+ &pll_video0_4x_clk.common.hw,
+ &pll_video2_4x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(de0_clk, "de0", de_parents, 0xa00,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+static SUNXI_CCU_GATE_HWS(bus_de0_clk, "bus-de0", ahb_hws, 0xa04, BIT(0), 0);
+
+static const struct clk_hw *di_parents[] = {
+ &pll_periph0_600M_clk.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+ &pll_video0_4x_clk.common.hw,
+ &pll_video2_4x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(di_clk, "di", di_parents, 0xa20,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+static SUNXI_CCU_GATE_HWS(bus_di_clk, "bus-di", ahb_hws, 0xa24, BIT(0), 0);
+
+static const struct clk_hw *g2d_parents[] = {
+ &pll_periph0_400M_clk.hw,
+ &pll_periph0_300M_clk.hw,
+ &pll_video0_4x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(g2d_clk, "g2d", g2d_parents, 0xa40,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+static SUNXI_CCU_GATE_HWS(bus_g2d_clk, "bus-g2d", ahb_hws, 0xa44, BIT(0), 0);
+
+static const struct clk_hw *eink_parents[] = {
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(eink_clk, "eink", eink_parents, 0xa60,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+
+static const struct clk_hw *eink_panel_parents[] = {
+ &pll_video0_4x_clk.common.hw,
+ &pll_video0_3x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+ &pll_video1_3x_clk.common.hw,
+ &pll_periph0_300M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(eink_panel_clk, "eink-panel", eink_panel_parents, 0xa64,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+static SUNXI_CCU_GATE_HWS(bus_eink_clk, "bus-eink", ahb_hws, 0xa6c, BIT(0), 0);
+
+static const struct clk_hw *ve_enc_parents[] = {
+ &pll_ve0_clk.common.hw,
+ &pll_ve1_clk.common.hw,
+ &pll_periph0_800M_clk.common.hw,
+ &pll_periph0_600M_clk.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_de_3x_clk.common.hw,
+ &pll_npu_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ve_enc0_clk, "ve-enc0", ve_enc_parents, 0xa80,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+
+static const struct clk_hw *ve_dec_parents[] = {
+ &pll_ve1_clk.common.hw,
+ &pll_ve0_clk.common.hw,
+ &pll_periph0_800M_clk.common.hw,
+ &pll_periph0_600M_clk.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_de_3x_clk.common.hw,
+ &pll_npu_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ve_dec0_clk, "ve-dec0", ve_dec_parents, 0xa88,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_SET_RATE_PARENT);
+
+static SUNXI_CCU_GATE_HWS(bus_ve_enc0_clk, "bus-ve-enc0", ahb_hws, 0xa8c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_ve_dec0_clk, "bus-ve-dec0", ahb_hws, 0xa8c, BIT(2), 0);
+
+static const struct clk_hw *ce_parents[] = {
+ &sys_24M_clk.hw,
+ &pll_periph0_400M_clk.hw,
+ &pll_periph0_600M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ce_clk, "ce", ce_parents, 0xac0,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_ce_clk, "bus-ce", ahb_hws, 0xac4, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_ce_sys_clk, "bus-ce-sys", ahb_hws, 0xac4, BIT(1), 0);
+
+static const struct clk_hw *npu_parents[] = {
+ &pll_npu_clk.common.hw,
+ &pll_periph0_800M_clk.common.hw,
+ &pll_periph0_600M_clk.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_ve0_clk.common.hw,
+ &pll_ve1_clk.common.hw,
+ &pll_de_3x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(npu_clk, "npu", npu_parents, 0xb00,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_npu_clk, "bus-npu", hosc, 0xb04, BIT(0), 0);
+
+/*
+ * GPU_CLK = ClockSource * ((16 - M) / 16)
+ * Here we use a div_table to select M values that result in integer divisors.
+ */
+static struct clk_div_table gpu_div_table[] = {
+ { .val = 0, .div = 1 },
+ { .val = 8, .div = 2 },
+ { .val = 12, .div = 4 },
+ { .val = 14, .div = 8 },
+ { .val = 15, .div = 16 },
+ { /* sentinel */ },
+};
+static const struct clk_parent_data gpu_parents[] = {
+ { .hw = &pll_gpu0_clk.common.hw, },
+ { .hw = &pll_periph0_800M_clk.common.hw, },
+ { .hw = &pll_periph0_600M_clk.hw, },
+ { .hw = &pll_periph0_400M_clk.hw, },
+ { .hw = &pll_periph0_300M_clk.hw, },
+ { .hw = &pll_periph0_200M_clk.hw, },
+};
+static struct ccu_div gpu0_clk = {
+ .enable = BIT(31),
+ .div = _SUNXI_CCU_DIV_TABLE(0, 4, gpu_div_table),
+ .mux = _SUNXI_CCU_MUX(24, 3),
+ .common = {
+ .reg = 0xb20,
+ .features = CCU_FEATURE_UPDATE_BIT,
+ .hw.init = CLK_HW_INIT_PARENTS_DATA("gpu0", gpu_parents,
+ &ccu_div_ops, 0),
+ }
+};
+static SUNXI_CCU_GATE_HWS(bus_gpu0_clk, "bus-gpu0", ahb_hws, 0xb24, BIT(0), 0);
+
+static const struct clk_parent_data dram_parents[] = {
+ { .hw = &pll_ddr_clk.common.hw, },
+ { .hw = &pll_periph0_800M_clk.common.hw, },
+ { .hw = &pll_periph0_600M_clk.hw, },
+ { .hw = &pll_de_12x_clk.common.hw, },
+ { .hw = &pll_npu_clk.common.hw, },
+};
+static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT(dram0_clk, "dram0", dram_parents, 0xc00,
+ 0, 4, /* M */
+ 0, 0, /* no P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ CLK_IS_CRITICAL,
+ CCU_FEATURE_UPDATE_BIT);
+static SUNXI_CCU_GATE_HWS(bus_dram0_clk, "bus-dram0", ahb_hws, 0xc0c,
+ BIT(0), CLK_IS_CRITICAL);
+
+static const struct clk_parent_data nand_mmc_parents[] = {
+ { .hw = &sys_24M_clk.hw, },
+ { .hw = &pll_periph0_400M_clk.hw, },
+ { .hw = &pll_periph0_300M_clk.hw, },
+ { .hw = &pll_periph1_400M_clk.hw, },
+ { .hw = &pll_periph1_300M_clk.hw, },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(nand0_clk0_clk, "nand0-clk0", nand_mmc_parents, 0xc80,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(nand0_clk1_clk, "nand0-clk1", nand_mmc_parents, 0xc84,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_nand0_clk, "bus-nand0", ahb_hws, 0xc8c, BIT(0), 0);
+
+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc0_clk, "mmc0", nand_mmc_parents, 0xd00,
+ 0, 5, /* M */
+ 8, 5, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 2, /* post div */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, "bus-mmc0", ahb_hws, 0xd0c, BIT(0), 0);
+
+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc1_clk, "mmc1", nand_mmc_parents, 0xd10,
+ 0, 5, /* M */
+ 8, 5, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 2, /* post div */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_mmc1_clk, "bus-mmc1", ahb_hws, 0xd1c, BIT(0), 0);
+
+static const struct clk_parent_data mmc2_mmc3_parents[] = {
+ { .hw = &sys_24M_clk.hw, },
+ { .hw = &pll_periph0_800M_clk.common.hw },
+ { .hw = &pll_periph0_600M_clk.hw },
+ { .hw = &pll_periph1_800M_clk.common.hw },
+ { .hw = &pll_periph1_600M_clk.hw },
+};
+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc2_clk, "mmc2", mmc2_mmc3_parents, 0xd20,
+ 0, 5, /* M */
+ 8, 5, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 2, /* post div */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_mmc2_clk, "bus-mmc2", ahb_hws, 0xd2c, BIT(0), 0);
+
+static SUNXI_CCU_MP_MUX_GATE_POSTDIV_DUALDIV(mmc3_clk, "mmc3", mmc2_mmc3_parents, 0xd30,
+ 0, 5, /* M */
+ 8, 5, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 2, /* post div */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_mmc3_clk, "bus-mmc3", ahb_hws, 0xd3c, BIT(0), 0);
+
+static const struct clk_hw *ufs_axi_parents[] = {
+ &pll_periph0_300M_clk.hw,
+ &pll_periph0_200M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(ufs_axi_clk, "ufs-axi", ufs_axi_parents, 0xd80,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data ufs_cfg_parents[] = {
+ { .hw = &pll_periph0_480M_clk.common.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(ufs_cfg_clk, "ufs-cfg", ufs_cfg_parents, 0xd84,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_ufs_clk, "bus-ufs", hosc, 0xd8c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_uart0_clk, "bus-uart0", apb_uart_hws, 0xe00, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart1_clk, "bus-uart1", apb_uart_hws, 0xe04, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart2_clk, "bus-uart2", apb_uart_hws, 0xe08, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart3_clk, "bus-uart3", apb_uart_hws, 0xe0c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart4_clk, "bus-uart4", apb_uart_hws, 0xe10, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart5_clk, "bus-uart5", apb_uart_hws, 0xe14, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_uart6_clk, "bus-uart6", apb_uart_hws, 0xe18, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_i2c0_clk, "bus-i2c0", apb1_hws, 0xe80, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c1_clk, "bus-i2c1", apb1_hws, 0xe84, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c2_clk, "bus-i2c2", apb1_hws, 0xe88, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c3_clk, "bus-i2c3", apb1_hws, 0xe8c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c4_clk, "bus-i2c4", apb1_hws, 0xe90, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c5_clk, "bus-i2c5", apb1_hws, 0xe94, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c6_clk, "bus-i2c6", apb1_hws, 0xe98, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c7_clk, "bus-i2c7", apb1_hws, 0xe9c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c8_clk, "bus-i2c8", apb1_hws, 0xea0, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c9_clk, "bus-i2c9", apb1_hws, 0xea4, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c10_clk, "bus-i2c10", apb1_hws, 0xea8, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c11_clk, "bus-i2c11", apb1_hws, 0xeac, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_i2c12_clk, "bus-i2c12", apb1_hws, 0xeb0, BIT(0), 0);
+
+static const struct clk_parent_data spi_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_300M_clk.hw },
+ { .hw = &pll_periph0_200M_clk.hw },
+ { .hw = &pll_periph1_300M_clk.hw },
+ { .hw = &pll_periph1_200M_clk.hw },
+ { .hw = &pll_periph0_480M_clk.common.hw },
+ { .hw = &pll_periph1_480M_clk.common.hw },
+ { .fw_name = "hosc"},
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(spi0_clk, "spi0", spi_parents, 0xf00,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spi0_clk, "bus-spi0", ahb_hws, 0xf04, BIT(0), 0);
+
+static SUNXI_CCU_DUALDIV_MUX_GATE(spi1_clk, "spi1", spi_parents, 0xf08,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spi1_clk, "bus-spi1", ahb_hws, 0xf0c, BIT(0), 0);
+
+static SUNXI_CCU_DUALDIV_MUX_GATE(spi2_clk, "spi2", spi_parents, 0xf10,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spi2_clk, "bus-spi2", ahb_hws, 0xf14, BIT(0), 0);
+
+static const struct clk_parent_data spif_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_400M_clk.hw },
+ { .hw = &pll_periph0_300M_clk.hw },
+ { .hw = &pll_periph1_400M_clk.hw },
+ { .hw = &pll_periph1_300M_clk.hw },
+ { .hw = &pll_periph0_160M_clk.hw },
+ { .hw = &pll_periph1_160M_clk.hw },
+ { .fw_name = "hosc"},
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(spif_clk, "spif", spif_parents, 0xf18,
+ 0, 5, /* M */
+ 8, 5, /* P */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spif_clk, "bus-spif", ahb_hws, 0xf1c, BIT(0), 0);
+
+static SUNXI_CCU_DUALDIV_MUX_GATE(spi3_clk, "spi3", spi_parents, 0xf20,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spi3_clk, "bus-spi3", ahb_hws, 0xf24, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static SUNXI_CCU_DUALDIV_MUX_GATE(spi4_clk, "spi4", spi_parents, 0xf28,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_spi4_clk, "bus-spi4", ahb_hws, 0xf2c, BIT(0), 0);
+
+static const struct clk_parent_data gpadc0_24m_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "hosc"},
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(gpadc0_24m_clk, "gpadc0-24m", gpadc0_24m_parents, 0xfc0,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_gpadc0_clk, "bus-gpadc0", ahb_hws, 0xfc4, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_ths0_clk, "bus-ths0", apb0_hws, 0xfe4, BIT(0), 0);
+
+static const struct clk_parent_data irrx_parents[] = {
+ { .fw_name = "losc"},
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "hosc"},
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(irrx_clk, "irrx", irrx_parents, 0x1000,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_irrx_clk, "bus-irrx", apb0_hws, 0x1004, BIT(0), 0);
+
+static const struct clk_parent_data irtx_parents[] = {
+ { .fw_name = "losc"},
+ { .hw = &pll_periph1_600M_clk.hw },
+ { .fw_name = "hosc"},
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(irtx_clk, "irtx", irtx_parents, 0x1008,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_irtx_clk, "bus-irtx", apb0_hws, 0x100c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_lradc_clk, "bus-lradc", apb0_hws, 0x1024, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static const struct clk_parent_data sgpio_parents[] = {
+ { .fw_name = "losc"},
+ { .hw = &sys_24M_clk.hw },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(sgpio_clk, "sgpio", sgpio_parents, 0x1060,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_sgpio_clk, "bus-sgpio", hosc, 0x1064, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static const struct clk_hw *lpc_parents[] = {
+ &pll_video0_3x_clk.common.hw,
+ &pll_video1_3x_clk.common.hw,
+ &pll_video2_3x_clk.common.hw,
+ &pll_periph0_300M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(lpc_clk, "lpc", lpc_parents, 0x1080,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_lpc_clk, "bus-lpc", hosc, 0x1084, BIT(0), 0);
+
+static const struct clk_hw *i2spcm_parents[] = {
+ &pll_audio0_4x_clk.common.hw,
+ &pll_audio1_div2_clk.common.hw,
+ &pll_audio1_div5_clk.common.hw,
+ &pll_periph0_200M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm0_clk, "i2spcm0", i2spcm_parents, 0x1200,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_i2spcm0_clk, "bus-i2spcm0", hosc, 0x120c, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm1_clk, "i2spcm1", i2spcm_parents, 0x1210,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_i2spcm1_clk, "bus-i2spcm1", hosc, 0x121c, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm2_clk, "i2spcm2", i2spcm_parents, 0x1220,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *i2spcm2_asrc_parents[] = {
+ &pll_audio0_4x_clk.common.hw,
+ &pll_audio1_div2_clk.common.hw,
+ &pll_audio1_div5_clk.common.hw,
+ &pll_periph0_300M_clk.hw,
+ &pll_periph1_300M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm2_asrc_clk, "i2spcm2_asrc", i2spcm2_asrc_parents, 0x1224,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_DATA(bus_i2spcm2_clk, "bus-i2spcm2", hosc, 0x122c, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm3_clk, "i2spcm3", i2spcm_parents, 0x1230,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_i2spcm3_clk, "bus-i2spcm3", hosc, 0x123c, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2spcm4_clk, "i2spcm4", i2spcm_parents, 0x1240,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_DATA(bus_i2spcm4_clk, "bus-i2spcm4", hosc, 0x124c, BIT(0), 0);
+
+static const struct clk_hw *spdif_tx_parents[] = {
+ &pll_audio0_4x_clk.common.hw,
+ &pll_audio1_div2_clk.common.hw,
+ &pll_audio1_div5_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(spdif_tx_clk, "spdif-tx", spdif_tx_parents, 0x1280,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *spdif_rx_parents[] = {
+ &pll_periph0_200M_clk.hw,
+ &pll_periph0_300M_clk.hw,
+ &pll_periph0_400M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(spdif_rx_clk, "spdif-rx", spdif_rx_parents, 0x1284,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HWS(bus_spdif_clk, "bus-spdif", apb1_hws, 0x128c, BIT(0), 0);
+
+static const struct clk_hw *dmic_parents[] = {
+ &pll_audio0_4x_clk.common.hw,
+ &pll_audio1_div2_clk.common.hw,
+ &pll_audio1_div5_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dmic_clk, "dmic", dmic_parents, 0x12c0,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HWS(bus_dmic_clk, "bus-dmic", apb1_hws, 0x12cc, BIT(0), 0);
+
+/*
+ * The first parent is a 48 MHz input clock divided by 4. That 48 MHz clock is
+ * a 2x multiplier from pll-ref synchronized by pll-periph0, and is also used by
+ * the OHCI module.
+ */
+static const struct clk_parent_data usb_ohci_parents[] = {
+ { .hw = &pll_periph0_4x_clk.common.hw },
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+};
+static const struct ccu_mux_fixed_prediv usb_ohci_predivs[] = {
+ { .index = 0, .div = 200 },
+ { .index = 1, .div = 2 },
+};
+
+static struct ccu_mux usb_ohci0_clk = {
+ .enable = BIT(31),
+ .mux = {
+ .shift = 24,
+ .width = 2,
+ .fixed_predivs = usb_ohci_predivs,
+ .n_predivs = ARRAY_SIZE(usb_ohci_predivs),
+ },
+ .common = {
+ .reg = 0x1300,
+ .features = CCU_FEATURE_FIXED_PREDIV,
+ .hw.init = CLK_HW_INIT_PARENTS_DATA("usb-ohci0", usb_ohci_parents,
+ &ccu_mux_ops, 0),
+ },
+};
+static SUNXI_CCU_GATE_HWS(bus_ohci0_clk, "bus-ohci0", ahb_hws, 0x1304, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_ehci0_clk, "bus-ehci0", ahb_hws, 0x1304, BIT(4), 0);
+static SUNXI_CCU_GATE_HWS(bus_otg_clk, "bus-otg", ahb_hws, 0x1304, BIT(8), 0);
+
+static struct ccu_mux usb_ohci1_clk = {
+ .enable = BIT(31),
+ .mux = {
+ .shift = 24,
+ .width = 2,
+ .fixed_predivs = usb_ohci_predivs,
+ .n_predivs = ARRAY_SIZE(usb_ohci_predivs),
+ },
+ .common = {
+ .reg = 0x1308,
+ .features = CCU_FEATURE_FIXED_PREDIV,
+ .hw.init = CLK_HW_INIT_PARENTS_DATA("usb-ohci1", usb_ohci_parents,
+ &ccu_mux_ops, 0),
+ },
+};
+static SUNXI_CCU_GATE_HWS(bus_ohci1_clk, "bus-ohci1", ahb_hws, 0x130c, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_ehci1_clk, "bus-ehci1", ahb_hws, 0x130c, BIT(4), 0);
+
+static const struct clk_parent_data usb01_ref_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_MUX_DATA(usb01_ref_clk, "usb01-ref", usb01_ref_parents, 0x1340, 24, 3, 0);
+
+static SUNXI_CCU_MUX_DATA(usb2_u2_ref_clk, "usb2-u2-ref", usb01_ref_parents, 0x1348, 24, 3, 0);
+
+static const struct clk_parent_data usb2_suspend_parents[] = {
+ { .fw_name = "losc" },
+ { .hw = &sys_24M_clk.hw },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_suspend_clk, "usb2-suspend", usb2_suspend_parents,
+ 0x1350,
+ 0, 5, /* M */
+ 24, 1, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data usb2_mf_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_300M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_mf_clk, "usb2-mf", usb2_mf_parents,
+ 0x1354,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data usb2_u3_utmi_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_300M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_u3_utmi_clk, "usb2-u3-utmi", usb2_u3_utmi_parents,
+ 0x1360,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data usb2_u2_pipe_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_480M_clk.common.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(usb2_u2_pipe_clk, "usb2-u2-pipe", usb2_u2_pipe_parents,
+ 0x1364,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data pcie_aux_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(pcie_aux_clk, "pcie-aux", pcie_aux_parents, 0x1380,
+ 0, 5, /* M */
+ 24, 1, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *pcie_axi_slv_parents[] = {
+ &pll_periph0_600M_clk.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(pcie_axi_slv_clk, "pcie-axi-slv", pcie_axi_slv_parents, 0x1384,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *serdes_phy_parents[] = {
+ &sys_24M_clk.hw,
+ &pll_periph0_600M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(serdes_phy_clk, "serdes-phy", serdes_phy_parents, 0x13c0,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data gmac_ptp_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_200M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(gmac_ptp_clk, "gmac-ptp", gmac_ptp_parents, 0x1400,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_M_HWS_WITH_GATE(gmac0_phy_clk, "gmac0-phy", pll_periph0_150M_hws, 0x1410,
+ 0, 5, /* M */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_gmac0_clk, "bus-gmac0", ahb_hws, 0x141c, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static SUNXI_CCU_M_HWS_WITH_GATE(gmac1_phy_clk, "gmac1-phy", pll_periph0_150M_hws, 0x1420,
+ 0, 5, /* M */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_gmac1_clk, "bus-gmac1", ahb_hws, 0x142c, BIT(0), 0);
+
+static const struct clk_hw *tcon_lcd_parents[] = {
+ &pll_video0_4x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+ &pll_video2_4x_clk.common.hw,
+ &pll_periph0_2x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd0_clk, "tcon-lcd0", tcon_lcd_parents, 0x1500,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd0_clk, "bus-tcon-lcd0", ahb_hws, 0x1504, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd1_clk, "tcon-lcd1", tcon_lcd_parents, 0x1508,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd1_clk, "bus-tcon-lcd1", ahb_hws, 0x150c, BIT(0), 0);
+
+/* Undocumented, taken from the vendor kernel. */
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(tcon_lcd2_clk, "tcon-lcd2", tcon_lcd_parents, 0x1510,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_tcon_lcd2_clk, "bus-tcon-lcd2", ahb_hws, 0x1514, BIT(0), 0);
+
+static const struct clk_hw *dsi_parents[] = {
+ &sys_24M_clk.hw,
+ &pll_periph0_200M_clk.hw,
+ &pll_periph0_150M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dsi0_clk, "dsi0", dsi_parents, 0x1580,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_dsi0_clk, "bus-dsi0", ahb_hws, 0x1584, BIT(0), 0);
+
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(dsi1_clk, "dsi1", dsi_parents, 0x1588,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_dsi1_clk, "bus-dsi1", ahb_hws, 0x158c, BIT(0), 0);
+
+static const struct clk_hw *combphy_parents[] = {
+ &pll_video0_4x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+ &pll_video2_4x_clk.common.hw,
+ &pll_periph0_2x_clk.common.hw,
+ &pll_video0_3x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(combphy0_clk, "combphy0", combphy_parents, 0x15c0,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(combphy1_clk, "combphy1", combphy_parents, 0x15c4,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HWS(bus_tcon_tv0_clk, "bus-tcon-tv0", ahb_hws, 0x1604, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_tcon_tv1_clk, "bus-tcon-tv1", ahb_hws, 0x160c, BIT(0), 0);
+
+static const struct clk_hw *edp_tv_parents[] = {
+ &pll_video0_4x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+ &pll_video2_4x_clk.common.hw,
+ &pll_periph0_2x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(edp_tv_clk, "edp-tv", edp_tv_parents, 0x1640,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_edp_tv_clk, "bus-edp-tv", ahb_hws, 0x164c, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(hdmi_cec_32k_clk, "hdmi-cec-32k", pll_periph0_2x_hws, 0x1680,
+ BIT(30), /* gate */
+ 36621, /* pre div */
+ 0);
+
+static const struct clk_parent_data hdmi_cec_parents[] = {
+ { .fw_name = "losc" },
+ { .hw = &hdmi_cec_32k_clk.common.hw },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(hdmi_cec_clk, "hdmi-cec", hdmi_cec_parents, 0x1680,
+ 24, 1, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data hdmi_tv_parents[] = {
+ { .hw = &pll_video0_4x_clk.common.hw },
+ { .hw = &pll_video1_4x_clk.common.hw },
+ { .hw = &pll_video2_4x_clk.common.hw },
+ { .hw = &pll_periph0_2x_clk.common.hw },
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(hdmi_tv_clk, "hdmi-tv", hdmi_tv_parents, 0x1684,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_hdmi_tv_clk, "bus-hdmi-tv", ahb_hws, 0x168c, BIT(0), 0);
+
+static const struct clk_parent_data hdmi_sfr_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(hdmi_sfr_clk, "hdmi-sfr", hdmi_sfr_parents, 0x1690,
+ 24, 1, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HWS(hdcp_esm_clk, "hdcp-esm", pll_periph0_300M_hws, 0x1694, BIT(31), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_dpss_top0_clk, "bus-dpss-top0", ahb_hws, 0x16c4, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS(bus_dpss_top1_clk, "bus-dpss-top1", ahb_hws, 0x16cc, BIT(0), 0);
+
+static const struct clk_parent_data ledc_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_periph0_600M_clk.hw },
+ { .fw_name = "hosc" },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(ledc_clk, "ledc", ledc_parents, 0x1700,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_ledc_clk, "bus-ledc", apb0_hws, 0x1704, BIT(0), 0);
+
+static SUNXI_CCU_GATE_HWS(bus_dsc_clk, "bus-dsc", ahb_hws, 0x1744, BIT(0), 0);
+
+static const struct clk_parent_data csi_master_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .hw = &pll_video0_4x_clk.common.hw },
+ { .hw = &pll_video0_3x_clk.common.hw },
+ { .hw = &pll_video1_4x_clk.common.hw },
+ { .hw = &pll_video1_3x_clk.common.hw },
+ { .hw = &pll_video2_4x_clk.common.hw },
+ { .hw = &pll_video2_3x_clk.common.hw },
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master0_clk, "csi_master0", csi_master_parents, 0x1800,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master1_clk, "csi_master1", csi_master_parents, 0x1804,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_DUALDIV_MUX_GATE(csi_master2_clk, "csi_master2", csi_master_parents, 0x1808,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_hw *csi_parents[] = {
+ &pll_video2_4x_clk.common.hw,
+ &pll_de_4x_clk.common.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+ &pll_periph0_600M_clk.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(csi_clk, "csi", csi_parents, 0x1840,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+static SUNXI_CCU_GATE_HWS(bus_csi_clk, "bus-csi", ahb_hws, 0x1844, BIT(0), 0);
+
+static const struct clk_hw *isp_parents[] = {
+ &pll_video2_4x_clk.common.hw,
+ &pll_periph0_480M_clk.common.hw,
+ &pll_periph0_400M_clk.hw,
+ &pll_periph0_600M_clk.hw,
+ &pll_video0_4x_clk.common.hw,
+ &pll_video1_4x_clk.common.hw,
+};
+static SUNXI_CCU_M_HW_WITH_MUX_GATE(isp_clk, "isp", isp_parents, 0x1860,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_DATA(res_dcap_24m_clk, "res-dcap-24m", hosc, 0x1a00, BIT(3), 0);
+
+static const struct clk_parent_data apb2jtag_parents[] = {
+ { .hw = &sys_24M_clk.hw },
+ { .fw_name = "losc" },
+ { .fw_name = "iosc" },
+ { .hw = &pll_periph0_480M_clk.common.hw },
+ { .hw = &pll_periph1_480M_clk.common.hw },
+ { .hw = &pll_periph0_200M_clk.hw },
+ { .hw = &pll_periph1_200M_clk.hw },
+};
+static SUNXI_CCU_M_DATA_WITH_MUX_GATE(apb2jtag_clk, "apb2jtag", apb2jtag_parents, 0x1c00,
+ 0, 5, /* M */
+ 24, 3, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static SUNXI_CCU_GATE_HWS(fanout_24M_clk, "fanout-24M", sys_24M_hws, 0x1f30, BIT(0), 0);
+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_12M_clk, "fanout-12M", sys_24M_hws, 0x1f30,
+ BIT(1), 2, 0);
+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_16M_clk, "fanout-16M", pll_periph0_480M_hws, 0x1f30,
+ BIT(2), 30, 0);
+static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_25M_clk, "fanout-25M", pll_periph0_2x_hws, 0x1f30,
+ BIT(3), 48, 0);
+
+static const struct clk_parent_data fanout_27M_parents[] = {
+ { .hw = &pll_video0_4x_clk.common.hw },
+ { .hw = &pll_video1_4x_clk.common.hw },
+ { .hw = &pll_video2_4x_clk.common.hw },
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(fanout_27M_clk, "fanout-27M", fanout_27M_parents, 0x1f34,
+ 0, 5, /* M */
+ 8, 5, /* N */
+ 24, 2, /* mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data fanout_pclk_parents[] = {
+ { .hw = &apb0_clk.common.hw }
+};
+static SUNXI_CCU_DUALDIV_MUX_GATE(fanout_pclk_clk, "fanout-pclk", fanout_pclk_parents, 0x1f38,
+ 0, 5, /* M */
+ 5, 5, /* N */
+ 0, 0, /* no mux */
+ BIT(31), /* gate */
+ 0);
+
+static const struct clk_parent_data fanout_parents[] = {
+ { .fw_name = "losc-fanout" },
+ { .hw = &fanout_12M_clk.common.hw, },
+ { .hw = &fanout_16M_clk.common.hw, },
+ { .hw = &fanout_24M_clk.common.hw, },
+ { .hw = &fanout_25M_clk.common.hw, },
+ { .hw = &fanout_27M_clk.common.hw, },
+ { .hw = &fanout_pclk_clk.common.hw, },
+};
+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout0_clk, "fanout0", fanout_parents, 0x1f3c,
+ 0, 3, /* mux */
+ BIT(21), /* gate */
+ 0);
+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout1_clk, "fanout1", fanout_parents, 0x1f3c,
+ 3, 3, /* mux */
+ BIT(22), /* gate */
+ 0);
+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout2_clk, "fanout2", fanout_parents, 0x1f3c,
+ 6, 3, /* mux */
+ BIT(23), /* gate */
+ 0);
+static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout3_clk, "fanout3", fanout_parents, 0x1f3c,
+ 9, 3, /* mux */
+ BIT(24), /* gate */
+ 0);
+
+/*
+ * Contains all clocks that are controlled by a hardware register. They
+ * have a (sunxi) .common member, which needs to be initialised by the common
+ * sunxi CCU code, to be filled with the MMIO base address and the shared lock.
+ */
+static struct ccu_common *sun60i_a733_ccu_clks[] = {
+ &pll_ref_clk.common,
+ &pll_ddr_clk.common,
+ &pll_periph0_4x_clk.common,
+ &pll_periph0_2x_clk.common,
+ &pll_periph0_800M_clk.common,
+ &pll_periph0_480M_clk.common,
+ &pll_periph1_4x_clk.common,
+ &pll_periph1_2x_clk.common,
+ &pll_periph1_800M_clk.common,
+ &pll_periph1_480M_clk.common,
+ &pll_gpu0_clk.common,
+ &pll_video0_12x_clk.common,
+ &pll_video0_4x_clk.common,
+ &pll_video0_3x_clk.common,
+ &pll_video1_12x_clk.common,
+ &pll_video1_4x_clk.common,
+ &pll_video1_3x_clk.common,
+ &pll_video2_12x_clk.common,
+ &pll_video2_4x_clk.common,
+ &pll_video2_3x_clk.common,
+ &pll_ve0_clk.common,
+ &pll_ve1_clk.common,
+ &pll_audio0_4x_clk.common,
+ &pll_audio1_clk.common,
+ &pll_audio1_div2_clk.common,
+ &pll_audio1_div5_clk.common,
+ &pll_npu_clk.common,
+ &pll_de_12x_clk.common,
+ &pll_de_4x_clk.common,
+ &pll_de_3x_clk.common,
+ &ahb_clk.common,
+ &apb0_clk.common,
+ &apb1_clk.common,
+ &apb_uart_clk.common,
+ &trace_clk.common,
+ &bus_its_pcie0_aclk_clk.common,
+ &mbus_clk.common,
+ &mbus_iommu0_sys_clk.common,
+ &apb_iommu0_sys_clk.common,
+ &ahb_iommu0_sys_clk.common,
+ &bus_msi_lite0_clk.common,
+ &bus_msi_lite1_clk.common,
+ &bus_msi_lite2_clk.common,
+ &mbus_iommu1_sys_clk.common,
+ &apb_iommu1_sys_clk.common,
+ &ahb_iommu1_sys_clk.common,
+ &ahb_ve_dec_clk.common,
+ &ahb_ve_enc_clk.common,
+ &ahb_vid_in_clk.common,
+ &ahb_vid_cout0_clk.common,
+ &ahb_vid_cout1_clk.common,
+ &ahb_de_clk.common,
+ &ahb_npu_clk.common,
+ &ahb_gpu0_clk.common,
+ &ahb_serdes_clk.common,
+ &ahb_usb_sys_clk.common,
+ &ahb_msi_lite0_clk.common,
+ &ahb_store_clk.common,
+ &ahb_cpus_clk.common,
+ &mbus_iommu0_clk.common,
+ &mbus_iommu1_clk.common,
+ &mbus_desys_clk.common,
+ &mbus_ve_enc0_gate_clk.common,
+ &mbus_ve_dec0_gate_clk.common,
+ &mbus_gpu0_clk.common,
+ &mbus_npu_clk.common,
+ &mbus_vid_in_clk.common,
+ &mbus_serdes_clk.common,
+ &mbus_msi_lite0_clk.common,
+ &mbus_store_clk.common,
+ &mbus_msi_lite2_clk.common,
+ &mbus_dma0_clk.common,
+ &mbus_ve_enc0_clk.common,
+ &mbus_ce_clk.common,
+ &mbus_dma1_clk.common,
+ &mbus_nand_clk.common,
+ &mbus_csi_clk.common,
+ &mbus_isp_clk.common,
+ &mbus_gmac0_clk.common,
+ &mbus_gmac1_clk.common,
+ &mbus_ve_dec0_clk.common,
+ &bus_dma0_clk.common,
+ &bus_dma1_clk.common,
+ &bus_spinlock_clk.common,
+ &bus_msgbox0_clk.common,
+ &bus_pwm0_clk.common,
+ &bus_pwm1_clk.common,
+ &bus_dbg_clk.common,
+ &bus_sysdap_clk.common,
+ &timer0_clk.common,
+ &timer1_clk.common,
+ &timer2_clk.common,
+ &timer3_clk.common,
+ &timer4_clk.common,
+ &timer5_clk.common,
+ &timer6_clk.common,
+ &timer7_clk.common,
+ &timer8_clk.common,
+ &timer9_clk.common,
+ &bus_timer_clk.common,
+ &avs_clk.common,
+ &de0_clk.common,
+ &bus_de0_clk.common,
+ &di_clk.common,
+ &bus_di_clk.common,
+ &g2d_clk.common,
+ &bus_g2d_clk.common,
+ &eink_clk.common,
+ &eink_panel_clk.common,
+ &bus_eink_clk.common,
+ &ve_enc0_clk.common,
+ &ve_dec0_clk.common,
+ &bus_ve_enc0_clk.common,
+ &bus_ve_dec0_clk.common,
+ &ce_clk.common,
+ &bus_ce_clk.common,
+ &bus_ce_sys_clk.common,
+ &npu_clk.common,
+ &bus_npu_clk.common,
+ &gpu0_clk.common,
+ &bus_gpu0_clk.common,
+ &dram0_clk.common,
+ &bus_dram0_clk.common,
+ &nand0_clk0_clk.common,
+ &nand0_clk1_clk.common,
+ &bus_nand0_clk.common,
+ &mmc0_clk.common,
+ &bus_mmc0_clk.common,
+ &mmc1_clk.common,
+ &bus_mmc1_clk.common,
+ &mmc2_clk.common,
+ &bus_mmc2_clk.common,
+ &mmc3_clk.common,
+ &bus_mmc3_clk.common,
+ &ufs_axi_clk.common,
+ &ufs_cfg_clk.common,
+ &bus_ufs_clk.common,
+ &bus_uart0_clk.common,
+ &bus_uart1_clk.common,
+ &bus_uart2_clk.common,
+ &bus_uart3_clk.common,
+ &bus_uart4_clk.common,
+ &bus_uart5_clk.common,
+ &bus_uart6_clk.common,
+ &bus_i2c0_clk.common,
+ &bus_i2c1_clk.common,
+ &bus_i2c2_clk.common,
+ &bus_i2c3_clk.common,
+ &bus_i2c4_clk.common,
+ &bus_i2c5_clk.common,
+ &bus_i2c6_clk.common,
+ &bus_i2c7_clk.common,
+ &bus_i2c8_clk.common,
+ &bus_i2c9_clk.common,
+ &bus_i2c10_clk.common,
+ &bus_i2c11_clk.common,
+ &bus_i2c12_clk.common,
+ &spi0_clk.common,
+ &bus_spi0_clk.common,
+ &spi1_clk.common,
+ &bus_spi1_clk.common,
+ &spi2_clk.common,
+ &bus_spi2_clk.common,
+ &spif_clk.common,
+ &bus_spif_clk.common,
+ &spi3_clk.common,
+ &bus_spi3_clk.common,
+ &spi4_clk.common,
+ &bus_spi4_clk.common,
+ &gpadc0_24m_clk.common,
+ &bus_gpadc0_clk.common,
+ &bus_ths0_clk.common,
+ &irrx_clk.common,
+ &bus_irrx_clk.common,
+ &irtx_clk.common,
+ &bus_irtx_clk.common,
+ &bus_lradc_clk.common,
+ &sgpio_clk.common,
+ &bus_sgpio_clk.common,
+ &lpc_clk.common,
+ &bus_lpc_clk.common,
+ &i2spcm0_clk.common,
+ &bus_i2spcm0_clk.common,
+ &i2spcm1_clk.common,
+ &bus_i2spcm1_clk.common,
+ &i2spcm2_clk.common,
+ &i2spcm2_asrc_clk.common,
+ &bus_i2spcm2_clk.common,
+ &i2spcm3_clk.common,
+ &bus_i2spcm3_clk.common,
+ &i2spcm4_clk.common,
+ &bus_i2spcm4_clk.common,
+ &spdif_tx_clk.common,
+ &spdif_rx_clk.common,
+ &bus_spdif_clk.common,
+ &dmic_clk.common,
+ &bus_dmic_clk.common,
+ &usb_ohci0_clk.common,
+ &bus_ohci0_clk.common,
+ &bus_ehci0_clk.common,
+ &bus_otg_clk.common,
+ &usb_ohci1_clk.common,
+ &bus_ohci1_clk.common,
+ &bus_ehci1_clk.common,
+ &usb01_ref_clk.common,
+ &usb2_u2_ref_clk.common,
+ &usb2_suspend_clk.common,
+ &usb2_mf_clk.common,
+ &usb2_u3_utmi_clk.common,
+ &usb2_u2_pipe_clk.common,
+ &pcie_aux_clk.common,
+ &pcie_axi_slv_clk.common,
+ &serdes_phy_clk.common,
+ &gmac_ptp_clk.common,
+ &gmac0_phy_clk.common,
+ &bus_gmac0_clk.common,
+ &gmac1_phy_clk.common,
+ &bus_gmac1_clk.common,
+ &tcon_lcd0_clk.common,
+ &bus_tcon_lcd0_clk.common,
+ &tcon_lcd1_clk.common,
+ &bus_tcon_lcd1_clk.common,
+ &tcon_lcd2_clk.common,
+ &bus_tcon_lcd2_clk.common,
+ &dsi0_clk.common,
+ &bus_dsi0_clk.common,
+ &dsi1_clk.common,
+ &bus_dsi1_clk.common,
+ &combphy0_clk.common,
+ &combphy1_clk.common,
+ &bus_tcon_tv0_clk.common,
+ &bus_tcon_tv1_clk.common,
+ &edp_tv_clk.common,
+ &bus_edp_tv_clk.common,
+ &hdmi_cec_32k_clk.common,
+ &hdmi_cec_clk.common,
+ &hdmi_tv_clk.common,
+ &bus_hdmi_tv_clk.common,
+ &hdmi_sfr_clk.common,
+ &hdcp_esm_clk.common,
+ &bus_dpss_top0_clk.common,
+ &bus_dpss_top1_clk.common,
+ &ledc_clk.common,
+ &bus_ledc_clk.common,
+ &bus_dsc_clk.common,
+ &csi_master0_clk.common,
+ &csi_master1_clk.common,
+ &csi_master2_clk.common,
+ &csi_clk.common,
+ &bus_csi_clk.common,
+ &isp_clk.common,
+ &res_dcap_24m_clk.common,
+ &apb2jtag_clk.common,
+ &fanout_24M_clk.common,
+ &fanout_12M_clk.common,
+ &fanout_16M_clk.common,
+ &fanout_25M_clk.common,
+ &fanout_27M_clk.common,
+ &fanout_pclk_clk.common,
+ &fanout0_clk.common,
+ &fanout1_clk.common,
+ &fanout2_clk.common,
+ &fanout3_clk.common,
+};
+
+static struct clk_hw_onecell_data sun60i_a733_hw_clks = {
+ .hws = {
+ [CLK_PLL_REF] = &pll_ref_clk.common.hw,
+ [CLK_SYS_24M] = &sys_24M_clk.hw,
+ [CLK_PLL_DDR] = &pll_ddr_clk.common.hw,
+ [CLK_PLL_PERIPH0_4X] = &pll_periph0_4x_clk.common.hw,
+ [CLK_PLL_PERIPH0_2X] = &pll_periph0_2x_clk.common.hw,
+ [CLK_PLL_PERIPH0_800M] = &pll_periph0_800M_clk.common.hw,
+ [CLK_PLL_PERIPH0_480M] = &pll_periph0_480M_clk.common.hw,
+ [CLK_PLL_PERIPH0_600M] = &pll_periph0_600M_clk.hw,
+ [CLK_PLL_PERIPH0_400M] = &pll_periph0_400M_clk.hw,
+ [CLK_PLL_PERIPH0_300M] = &pll_periph0_300M_clk.hw,
+ [CLK_PLL_PERIPH0_200M] = &pll_periph0_200M_clk.hw,
+ [CLK_PLL_PERIPH0_160M] = &pll_periph0_160M_clk.hw,
+ [CLK_PLL_PERIPH0_150M] = &pll_periph0_150M_clk.hw,
+ [CLK_PLL_PERIPH1_4X] = &pll_periph1_4x_clk.common.hw,
+ [CLK_PLL_PERIPH1_2X] = &pll_periph1_2x_clk.common.hw,
+ [CLK_PLL_PERIPH1_800M] = &pll_periph1_800M_clk.common.hw,
+ [CLK_PLL_PERIPH1_480M] = &pll_periph1_480M_clk.common.hw,
+ [CLK_PLL_PERIPH1_600M] = &pll_periph1_600M_clk.hw,
+ [CLK_PLL_PERIPH1_400M] = &pll_periph1_400M_clk.hw,
+ [CLK_PLL_PERIPH1_300M] = &pll_periph1_300M_clk.hw,
+ [CLK_PLL_PERIPH1_200M] = &pll_periph1_200M_clk.hw,
+ [CLK_PLL_PERIPH1_160M] = &pll_periph1_160M_clk.hw,
+ [CLK_PLL_PERIPH1_150M] = &pll_periph1_150M_clk.hw,
+ [CLK_PLL_GPU0] = &pll_gpu0_clk.common.hw,
+ [CLK_PLL_VIDEO0_12X] = &pll_video0_12x_clk.common.hw,
+ [CLK_PLL_VIDEO0_4X] = &pll_video0_4x_clk.common.hw,
+ [CLK_PLL_VIDEO0_3X] = &pll_video0_3x_clk.common.hw,
+ [CLK_PLL_VIDEO1_12X] = &pll_video1_12x_clk.common.hw,
+ [CLK_PLL_VIDEO1_4X] = &pll_video1_4x_clk.common.hw,
+ [CLK_PLL_VIDEO1_3X] = &pll_video1_3x_clk.common.hw,
+ [CLK_PLL_VIDEO2_12X] = &pll_video2_12x_clk.common.hw,
+ [CLK_PLL_VIDEO2_4X] = &pll_video2_4x_clk.common.hw,
+ [CLK_PLL_VIDEO2_3X] = &pll_video2_3x_clk.common.hw,
+ [CLK_PLL_VE0] = &pll_ve0_clk.common.hw,
+ [CLK_PLL_VE1] = &pll_ve1_clk.common.hw,
+ [CLK_PLL_AUDIO0_4X] = &pll_audio0_4x_clk.common.hw,
+ [CLK_PLL_AUDIO1] = &pll_audio1_clk.common.hw,
+ [CLK_PLL_AUDIO1_DIV2] = &pll_audio1_div2_clk.common.hw,
+ [CLK_PLL_AUDIO1_DIV5] = &pll_audio1_div5_clk.common.hw,
+ [CLK_PLL_NPU] = &pll_npu_clk.common.hw,
+ [CLK_PLL_DE_12X] = &pll_de_12x_clk.common.hw,
+ [CLK_PLL_DE_4X] = &pll_de_4x_clk.common.hw,
+ [CLK_PLL_DE_3X] = &pll_de_3x_clk.common.hw,
+ [CLK_AHB] = &ahb_clk.common.hw,
+ [CLK_APB0] = &apb0_clk.common.hw,
+ [CLK_APB1] = &apb1_clk.common.hw,
+ [CLK_APB_UART] = &apb_uart_clk.common.hw,
+ [CLK_TRACE] = &trace_clk.common.hw,
+ [CLK_BUS_ITS_PCIE0_ACLK] = &bus_its_pcie0_aclk_clk.common.hw,
+ [CLK_MBUS] = &mbus_clk.common.hw,
+ [CLK_MBUS_IOMMU0_SYS] = &mbus_iommu0_sys_clk.common.hw,
+ [CLK_APB_IOMMU0_SYS] = &apb_iommu0_sys_clk.common.hw,
+ [CLK_AHB_IOMMU0_SYS] = &ahb_iommu0_sys_clk.common.hw,
+ [CLK_BUS_MSI_LITE0] = &bus_msi_lite0_clk.common.hw,
+ [CLK_BUS_MSI_LITE1] = &bus_msi_lite1_clk.common.hw,
+ [CLK_BUS_MSI_LITE2] = &bus_msi_lite2_clk.common.hw,
+ [CLK_MBUS_IOMMU1_SYS] = &mbus_iommu1_sys_clk.common.hw,
+ [CLK_APB_IOMMU1_SYS] = &apb_iommu1_sys_clk.common.hw,
+ [CLK_AHB_IOMMU1_SYS] = &ahb_iommu1_sys_clk.common.hw,
+ [CLK_AHB_VE_DEC] = &ahb_ve_dec_clk.common.hw,
+ [CLK_AHB_VE_ENC] = &ahb_ve_enc_clk.common.hw,
+ [CLK_AHB_VID_IN] = &ahb_vid_in_clk.common.hw,
+ [CLK_AHB_VID_COUT0] = &ahb_vid_cout0_clk.common.hw,
+ [CLK_AHB_VID_COUT1] = &ahb_vid_cout1_clk.common.hw,
+ [CLK_AHB_DE] = &ahb_de_clk.common.hw,
+ [CLK_AHB_NPU] = &ahb_npu_clk.common.hw,
+ [CLK_AHB_GPU0] = &ahb_gpu0_clk.common.hw,
+ [CLK_AHB_SERDES] = &ahb_serdes_clk.common.hw,
+ [CLK_AHB_USB_SYS] = &ahb_usb_sys_clk.common.hw,
+ [CLK_AHB_MSI_LITE0] = &ahb_msi_lite0_clk.common.hw,
+ [CLK_AHB_STORE] = &ahb_store_clk.common.hw,
+ [CLK_AHB_CPUS] = &ahb_cpus_clk.common.hw,
+ [CLK_MBUS_IOMMU0] = &mbus_iommu0_clk.common.hw,
+ [CLK_MBUS_IOMMU1] = &mbus_iommu1_clk.common.hw,
+ [CLK_MBUS_DESYS] = &mbus_desys_clk.common.hw,
+ [CLK_MBUS_VE_ENC0_GATE] = &mbus_ve_enc0_gate_clk.common.hw,
+ [CLK_MBUS_VE_DEC0_GATE] = &mbus_ve_dec0_gate_clk.common.hw,
+ [CLK_MBUS_GPU0] = &mbus_gpu0_clk.common.hw,
+ [CLK_MBUS_NPU] = &mbus_npu_clk.common.hw,
+ [CLK_MBUS_VID_IN] = &mbus_vid_in_clk.common.hw,
+ [CLK_MBUS_SERDES] = &mbus_serdes_clk.common.hw,
+ [CLK_MBUS_MSI_LITE0] = &mbus_msi_lite0_clk.common.hw,
+ [CLK_MBUS_STORE] = &mbus_store_clk.common.hw,
+ [CLK_MBUS_MSI_LITE2] = &mbus_msi_lite2_clk.common.hw,
+ [CLK_MBUS_DMA0] = &mbus_dma0_clk.common.hw,
+ [CLK_MBUS_VE_ENC0] = &mbus_ve_enc0_clk.common.hw,
+ [CLK_MBUS_CE] = &mbus_ce_clk.common.hw,
+ [CLK_MBUS_DMA1] = &mbus_dma1_clk.common.hw,
+ [CLK_MBUS_NAND] = &mbus_nand_clk.common.hw,
+ [CLK_MBUS_CSI] = &mbus_csi_clk.common.hw,
+ [CLK_MBUS_ISP] = &mbus_isp_clk.common.hw,
+ [CLK_MBUS_GMAC0] = &mbus_gmac0_clk.common.hw,
+ [CLK_MBUS_GMAC1] = &mbus_gmac1_clk.common.hw,
+ [CLK_MBUS_VE_DEC0] = &mbus_ve_dec0_clk.common.hw,
+ [CLK_BUS_DMA0] = &bus_dma0_clk.common.hw,
+ [CLK_BUS_DMA1] = &bus_dma1_clk.common.hw,
+ [CLK_BUS_SPINLOCK] = &bus_spinlock_clk.common.hw,
+ [CLK_BUS_MSGBOX0] = &bus_msgbox0_clk.common.hw,
+ [CLK_BUS_PWM0] = &bus_pwm0_clk.common.hw,
+ [CLK_BUS_PWM1] = &bus_pwm1_clk.common.hw,
+ [CLK_BUS_DBG] = &bus_dbg_clk.common.hw,
+ [CLK_BUS_SYSDAP] = &bus_sysdap_clk.common.hw,
+ [CLK_TIMER0] = &timer0_clk.common.hw,
+ [CLK_TIMER1] = &timer1_clk.common.hw,
+ [CLK_TIMER2] = &timer2_clk.common.hw,
+ [CLK_TIMER3] = &timer3_clk.common.hw,
+ [CLK_TIMER4] = &timer4_clk.common.hw,
+ [CLK_TIMER5] = &timer5_clk.common.hw,
+ [CLK_TIMER6] = &timer6_clk.common.hw,
+ [CLK_TIMER7] = &timer7_clk.common.hw,
+ [CLK_TIMER8] = &timer8_clk.common.hw,
+ [CLK_TIMER9] = &timer9_clk.common.hw,
+ [CLK_BUS_TIMER] = &bus_timer_clk.common.hw,
+ [CLK_AVS] = &avs_clk.common.hw,
+ [CLK_DE0] = &de0_clk.common.hw,
+ [CLK_BUS_DE0] = &bus_de0_clk.common.hw,
+ [CLK_DI] = &di_clk.common.hw,
+ [CLK_BUS_DI] = &bus_di_clk.common.hw,
+ [CLK_G2D] = &g2d_clk.common.hw,
+ [CLK_BUS_G2D] = &bus_g2d_clk.common.hw,
+ [CLK_EINK] = &eink_clk.common.hw,
+ [CLK_EINK_PANEL] = &eink_panel_clk.common.hw,
+ [CLK_BUS_EINK] = &bus_eink_clk.common.hw,
+ [CLK_VE_ENC0] = &ve_enc0_clk.common.hw,
+ [CLK_VE_DEC0] = &ve_dec0_clk.common.hw,
+ [CLK_BUS_VE_ENC0] = &bus_ve_enc0_clk.common.hw,
+ [CLK_BUS_VE_DEC0] = &bus_ve_dec0_clk.common.hw,
+ [CLK_CE] = &ce_clk.common.hw,
+ [CLK_BUS_CE] = &bus_ce_clk.common.hw,
+ [CLK_BUS_CE_SYS] = &bus_ce_sys_clk.common.hw,
+ [CLK_NPU] = &npu_clk.common.hw,
+ [CLK_BUS_NPU] = &bus_npu_clk.common.hw,
+ [CLK_GPU0] = &gpu0_clk.common.hw,
+ [CLK_BUS_GPU0] = &bus_gpu0_clk.common.hw,
+ [CLK_DRAM0] = &dram0_clk.common.hw,
+ [CLK_BUS_DRAM0] = &bus_dram0_clk.common.hw,
+ [CLK_NAND0_CLK0] = &nand0_clk0_clk.common.hw,
+ [CLK_NAND0_CLK1] = &nand0_clk1_clk.common.hw,
+ [CLK_BUS_NAND0] = &bus_nand0_clk.common.hw,
+ [CLK_MMC0] = &mmc0_clk.common.hw,
+ [CLK_BUS_MMC0] = &bus_mmc0_clk.common.hw,
+ [CLK_MMC1] = &mmc1_clk.common.hw,
+ [CLK_BUS_MMC1] = &bus_mmc1_clk.common.hw,
+ [CLK_MMC2] = &mmc2_clk.common.hw,
+ [CLK_BUS_MMC2] = &bus_mmc2_clk.common.hw,
+ [CLK_MMC3] = &mmc3_clk.common.hw,
+ [CLK_BUS_MMC3] = &bus_mmc3_clk.common.hw,
+ [CLK_UFS_AXI] = &ufs_axi_clk.common.hw,
+ [CLK_UFS_CFG] = &ufs_cfg_clk.common.hw,
+ [CLK_BUS_UFS] = &bus_ufs_clk.common.hw,
+ [CLK_BUS_UART0] = &bus_uart0_clk.common.hw,
+ [CLK_BUS_UART1] = &bus_uart1_clk.common.hw,
+ [CLK_BUS_UART2] = &bus_uart2_clk.common.hw,
+ [CLK_BUS_UART3] = &bus_uart3_clk.common.hw,
+ [CLK_BUS_UART4] = &bus_uart4_clk.common.hw,
+ [CLK_BUS_UART5] = &bus_uart5_clk.common.hw,
+ [CLK_BUS_UART6] = &bus_uart6_clk.common.hw,
+ [CLK_BUS_I2C0] = &bus_i2c0_clk.common.hw,
+ [CLK_BUS_I2C1] = &bus_i2c1_clk.common.hw,
+ [CLK_BUS_I2C2] = &bus_i2c2_clk.common.hw,
+ [CLK_BUS_I2C3] = &bus_i2c3_clk.common.hw,
+ [CLK_BUS_I2C4] = &bus_i2c4_clk.common.hw,
+ [CLK_BUS_I2C5] = &bus_i2c5_clk.common.hw,
+ [CLK_BUS_I2C6] = &bus_i2c6_clk.common.hw,
+ [CLK_BUS_I2C7] = &bus_i2c7_clk.common.hw,
+ [CLK_BUS_I2C8] = &bus_i2c8_clk.common.hw,
+ [CLK_BUS_I2C9] = &bus_i2c9_clk.common.hw,
+ [CLK_BUS_I2C10] = &bus_i2c10_clk.common.hw,
+ [CLK_BUS_I2C11] = &bus_i2c11_clk.common.hw,
+ [CLK_BUS_I2C12] = &bus_i2c12_clk.common.hw,
+ [CLK_SPI0] = &spi0_clk.common.hw,
+ [CLK_BUS_SPI0] = &bus_spi0_clk.common.hw,
+ [CLK_SPI1] = &spi1_clk.common.hw,
+ [CLK_BUS_SPI1] = &bus_spi1_clk.common.hw,
+ [CLK_SPI2] = &spi2_clk.common.hw,
+ [CLK_BUS_SPI2] = &bus_spi2_clk.common.hw,
+ [CLK_SPIF] = &spif_clk.common.hw,
+ [CLK_BUS_SPIF] = &bus_spif_clk.common.hw,
+ [CLK_SPI3] = &spi3_clk.common.hw,
+ [CLK_BUS_SPI3] = &bus_spi3_clk.common.hw,
+ [CLK_SPI4] = &spi4_clk.common.hw,
+ [CLK_BUS_SPI4] = &bus_spi4_clk.common.hw,
+ [CLK_GPADC0_24M] = &gpadc0_24m_clk.common.hw,
+ [CLK_BUS_GPADC0] = &bus_gpadc0_clk.common.hw,
+ [CLK_BUS_THS0] = &bus_ths0_clk.common.hw,
+ [CLK_IRRX] = &irrx_clk.common.hw,
+ [CLK_BUS_IRRX] = &bus_irrx_clk.common.hw,
+ [CLK_IRTX] = &irtx_clk.common.hw,
+ [CLK_BUS_IRTX] = &bus_irtx_clk.common.hw,
+ [CLK_BUS_LRADC] = &bus_lradc_clk.common.hw,
+ [CLK_SGPIO] = &sgpio_clk.common.hw,
+ [CLK_BUS_SGPIO] = &bus_sgpio_clk.common.hw,
+ [CLK_LPC] = &lpc_clk.common.hw,
+ [CLK_BUS_LPC] = &bus_lpc_clk.common.hw,
+ [CLK_I2SPCM0] = &i2spcm0_clk.common.hw,
+ [CLK_BUS_I2SPCM0] = &bus_i2spcm0_clk.common.hw,
+ [CLK_I2SPCM1] = &i2spcm1_clk.common.hw,
+ [CLK_BUS_I2SPCM1] = &bus_i2spcm1_clk.common.hw,
+ [CLK_I2SPCM2] = &i2spcm2_clk.common.hw,
+ [CLK_I2SPCM2_ASRC] = &i2spcm2_asrc_clk.common.hw,
+ [CLK_BUS_I2SPCM2] = &bus_i2spcm2_clk.common.hw,
+ [CLK_I2SPCM3] = &i2spcm3_clk.common.hw,
+ [CLK_BUS_I2SPCM3] = &bus_i2spcm3_clk.common.hw,
+ [CLK_I2SPCM4] = &i2spcm4_clk.common.hw,
+ [CLK_BUS_I2SPCM4] = &bus_i2spcm4_clk.common.hw,
+ [CLK_SPDIF_TX] = &spdif_tx_clk.common.hw,
+ [CLK_SPDIF_RX] = &spdif_rx_clk.common.hw,
+ [CLK_BUS_SPDIF] = &bus_spdif_clk.common.hw,
+ [CLK_DMIC] = &dmic_clk.common.hw,
+ [CLK_BUS_DMIC] = &bus_dmic_clk.common.hw,
+ [CLK_USB_OHCI0] = &usb_ohci0_clk.common.hw,
+ [CLK_BUS_OHCI0] = &bus_ohci0_clk.common.hw,
+ [CLK_BUS_EHCI0] = &bus_ehci0_clk.common.hw,
+ [CLK_BUS_OTG] = &bus_otg_clk.common.hw,
+ [CLK_USB_OHCI1] = &usb_ohci1_clk.common.hw,
+ [CLK_BUS_OHCI1] = &bus_ohci1_clk.common.hw,
+ [CLK_BUS_EHCI1] = &bus_ehci1_clk.common.hw,
+ [CLK_USB01_REF] = &usb01_ref_clk.common.hw,
+ [CLK_USB2_U2_REF] = &usb2_u2_ref_clk.common.hw,
+ [CLK_USB2_SUSPEND] = &usb2_suspend_clk.common.hw,
+ [CLK_USB2_MF] = &usb2_mf_clk.common.hw,
+ [CLK_USB2_U3_UTMI] = &usb2_u3_utmi_clk.common.hw,
+ [CLK_USB2_U2_PIPE] = &usb2_u2_pipe_clk.common.hw,
+ [CLK_PCIE_AUX] = &pcie_aux_clk.common.hw,
+ [CLK_PCIE_AXI_SLV] = &pcie_axi_slv_clk.common.hw,
+ [CLK_SERDES_PHY] = &serdes_phy_clk.common.hw,
+ [CLK_GMAC_PTP] = &gmac_ptp_clk.common.hw,
+ [CLK_GMAC0_PHY] = &gmac0_phy_clk.common.hw,
+ [CLK_BUS_GMAC0] = &bus_gmac0_clk.common.hw,
+ [CLK_GMAC1_PHY] = &gmac1_phy_clk.common.hw,
+ [CLK_BUS_GMAC1] = &bus_gmac1_clk.common.hw,
+ [CLK_TCON_LCD0] = &tcon_lcd0_clk.common.hw,
+ [CLK_BUS_TCON_LCD0] = &bus_tcon_lcd0_clk.common.hw,
+ [CLK_TCON_LCD1] = &tcon_lcd1_clk.common.hw,
+ [CLK_BUS_TCON_LCD1] = &bus_tcon_lcd1_clk.common.hw,
+ [CLK_TCON_LCD2] = &tcon_lcd2_clk.common.hw,
+ [CLK_BUS_TCON_LCD2] = &bus_tcon_lcd2_clk.common.hw,
+ [CLK_DSI0] = &dsi0_clk.common.hw,
+ [CLK_BUS_DSI0] = &bus_dsi0_clk.common.hw,
+ [CLK_DSI1] = &dsi1_clk.common.hw,
+ [CLK_BUS_DSI1] = &bus_dsi1_clk.common.hw,
+ [CLK_COMBPHY0] = &combphy0_clk.common.hw,
+ [CLK_COMBPHY1] = &combphy1_clk.common.hw,
+ [CLK_BUS_TCON_TV0] = &bus_tcon_tv0_clk.common.hw,
+ [CLK_BUS_TCON_TV1] = &bus_tcon_tv1_clk.common.hw,
+ [CLK_EDP_TV] = &edp_tv_clk.common.hw,
+ [CLK_BUS_EDP_TV] = &bus_edp_tv_clk.common.hw,
+ [CLK_HDMI_CEC_32K] = &hdmi_cec_32k_clk.common.hw,
+ [CLK_HDMI_CEC] = &hdmi_cec_clk.common.hw,
+ [CLK_HDMI_TV] = &hdmi_tv_clk.common.hw,
+ [CLK_BUS_HDMI_TV] = &bus_hdmi_tv_clk.common.hw,
+ [CLK_HDMI_SFR] = &hdmi_sfr_clk.common.hw,
+ [CLK_HDCP_ESM] = &hdcp_esm_clk.common.hw,
+ [CLK_BUS_DPSS_TOP0] = &bus_dpss_top0_clk.common.hw,
+ [CLK_BUS_DPSS_TOP1] = &bus_dpss_top1_clk.common.hw,
+ [CLK_LEDC] = &ledc_clk.common.hw,
+ [CLK_BUS_LEDC] = &bus_ledc_clk.common.hw,
+ [CLK_BUS_DSC] = &bus_dsc_clk.common.hw,
+ [CLK_CSI_MASTER0] = &csi_master0_clk.common.hw,
+ [CLK_CSI_MASTER1] = &csi_master1_clk.common.hw,
+ [CLK_CSI_MASTER2] = &csi_master2_clk.common.hw,
+ [CLK_CSI] = &csi_clk.common.hw,
+ [CLK_BUS_CSI] = &bus_csi_clk.common.hw,
+ [CLK_ISP] = &isp_clk.common.hw,
+ [CLK_RES_DCAP_24M] = &res_dcap_24m_clk.common.hw,
+ [CLK_APB2JTAG] = &apb2jtag_clk.common.hw,
+ [CLK_FANOUT_24M] = &fanout_24M_clk.common.hw,
+ [CLK_FANOUT_12M] = &fanout_12M_clk.common.hw,
+ [CLK_FANOUT_16M] = &fanout_16M_clk.common.hw,
+ [CLK_FANOUT_25M] = &fanout_25M_clk.common.hw,
+ [CLK_FANOUT_27M] = &fanout_27M_clk.common.hw,
+ [CLK_FANOUT_PCLK] = &fanout_pclk_clk.common.hw,
+ [CLK_FANOUT0] = &fanout0_clk.common.hw,
+ [CLK_FANOUT1] = &fanout1_clk.common.hw,
+ [CLK_FANOUT2] = &fanout2_clk.common.hw,
+ [CLK_FANOUT3] = &fanout3_clk.common.hw,
+ },
+ .num = CLK_FANOUT3 + 1,
+};
+
+static struct ccu_reset_map sun60i_a733_ccu_resets[] = {
+ [RST_BUS_ITS_PCIE0] = { 0x574, BIT(16) },
+ [RST_BUS_IOMMU0_SYS] = { 0x58c, BIT(16) },
+ [RST_BUS_MSI_LITE0_AHB] = { 0x594, BIT(16) },
+ [RST_BUS_MSI_LITE0_MBUS] = { 0x594, BIT(17) },
+ [RST_BUS_MSI_LITE1_AHB] = { 0x59c, BIT(16) },
+ [RST_BUS_MSI_LITE1_MBUS] = { 0x59c, BIT(17) },
+ [RST_BUS_MSI_LITE2_AHB] = { 0x5a4, BIT(16) },
+ [RST_BUS_MSI_LITE2_MBUS] = { 0x5a4, BIT(17) },
+ [RST_BUS_IOMMU1_SYS] = { 0x5b4, BIT(16) },
+ [RST_BUS_DMA0] = { 0x704, BIT(16) },
+ [RST_BUS_DMA1] = { 0x70c, BIT(16) },
+ [RST_BUS_SPINLOCK] = { 0x724, BIT(16) },
+ [RST_BUS_MSGBOX] = { 0x744, BIT(16) },
+ [RST_BUS_PWM0] = { 0x784, BIT(16) },
+ [RST_BUS_PWM1] = { 0x78c, BIT(16) },
+ [RST_BUS_DBG] = { 0x7a4, BIT(16) },
+ [RST_BUS_SYSDAP] = { 0x7ac, BIT(16) },
+ [RST_BUS_TIMER0] = { 0x850, BIT(16) },
+ [RST_BUS_DE0] = { 0xa04, BIT(16) },
+ [RST_BUS_DI] = { 0xa24, BIT(16) },
+ [RST_BUS_G2D] = { 0xa44, BIT(16) },
+ [RST_BUS_EINK] = { 0xa6c, BIT(16) },
+ [RST_BUS_DE_SYS] = { 0xa74, BIT(16) },
+ [RST_BUS_VE_ENC0] = { 0xa8c, BIT(16) },
+ [RST_BUS_VE_DEC0] = { 0xa8c, BIT(18) },
+ [RST_BUS_CE] = { 0xac4, BIT(16) },
+ [RST_BUS_CE_SYS] = { 0xac4, BIT(17) },
+ [RST_BUS_NPU_CORE] = { 0xb04, BIT(16) },
+ [RST_BUS_NPU_AXI] = { 0xb04, BIT(17) },
+ [RST_BUS_NPU_AHB] = { 0xb04, BIT(18) },
+ [RST_BUS_NPU_SRAM] = { 0xb04, BIT(19) },
+ [RST_BUS_GPU0] = { 0xb24, BIT(16) },
+ [RST_BUS_DRAM0] = { 0xc0c, BIT(16) },
+ [RST_BUS_NAND0] = { 0xc8c, BIT(16) },
+ [RST_BUS_MMC0] = { 0xd0c, BIT(16) },
+ [RST_BUS_MMC1] = { 0xd1c, BIT(16) },
+ [RST_BUS_MMC2] = { 0xd2c, BIT(16) },
+ [RST_BUS_MMC3] = { 0xd3c, BIT(16) },
+ [RST_BUS_UFS_AHB] = { 0xd8c, BIT(16) },
+ [RST_BUS_UFS_AXI] = { 0xd8c, BIT(17) },
+ [RST_BUS_UFS_PHY] = { 0xd8c, BIT(18) },
+ [RST_BUS_UFS_CORE] = { 0xd8c, BIT(19) },
+ [RST_BUS_UART0] = { 0xe00, BIT(16) },
+ [RST_BUS_UART1] = { 0xe04, BIT(16) },
+ [RST_BUS_UART2] = { 0xe08, BIT(16) },
+ [RST_BUS_UART3] = { 0xe0c, BIT(16) },
+ [RST_BUS_UART4] = { 0xe10, BIT(16) },
+ [RST_BUS_UART5] = { 0xe14, BIT(16) },
+ [RST_BUS_UART6] = { 0xe18, BIT(16) },
+ [RST_BUS_I2C0] = { 0xe80, BIT(16) },
+ [RST_BUS_I2C1] = { 0xe84, BIT(16) },
+ [RST_BUS_I2C2] = { 0xe88, BIT(16) },
+ [RST_BUS_I2C3] = { 0xe8c, BIT(16) },
+ [RST_BUS_I2C4] = { 0xe90, BIT(16) },
+ [RST_BUS_I2C5] = { 0xe94, BIT(16) },
+ [RST_BUS_I2C6] = { 0xe98, BIT(16) },
+ [RST_BUS_I2C7] = { 0xe9c, BIT(16) },
+ [RST_BUS_I2C8] = { 0xea0, BIT(16) },
+ [RST_BUS_I2C9] = { 0xea4, BIT(16) },
+ [RST_BUS_I2C10] = { 0xea8, BIT(16) },
+ [RST_BUS_I2C11] = { 0xeac, BIT(16) },
+ [RST_BUS_I2C12] = { 0xeb0, BIT(16) },
+ [RST_BUS_SPI0] = { 0xf04, BIT(16) },
+ [RST_BUS_SPI1] = { 0xf0c, BIT(16) },
+ [RST_BUS_SPI2] = { 0xf14, BIT(16) },
+ [RST_BUS_SPIF] = { 0xf1c, BIT(16) },
+ [RST_BUS_SPI3] = { 0xf24, BIT(16) },
+ [RST_BUS_SPI4] = { 0xf2c, BIT(16) }, /* From the vendor kernel. */
+ [RST_BUS_GPADC0] = { 0xfc4, BIT(16) },
+ [RST_BUS_THS0] = { 0xfe4, BIT(16) },
+ [RST_BUS_IRRX] = { 0x1004, BIT(16) },
+ [RST_BUS_IRTX] = { 0x100c, BIT(16) },
+ [RST_BUS_LRADC] = { 0x1024, BIT(16) },
+ [RST_BUS_SGPIO] = { 0x1064, BIT(16) }, /* From the vendor kernel. */
+ [RST_BUS_LPC] = { 0x1084, BIT(16) }, /* From the vendor kernel. */
+ [RST_BUS_I2SPCM0] = { 0x120c, BIT(16) },
+ [RST_BUS_I2SPCM1] = { 0x121c, BIT(16) },
+ [RST_BUS_I2SPCM2] = { 0x122c, BIT(16) },
+ [RST_BUS_I2SPCM3] = { 0x123c, BIT(16) },
+ [RST_BUS_I2SPCM4] = { 0x124c, BIT(16) },
+ [RST_BUS_SPDIF] = { 0x128c, BIT(16) },
+ [RST_BUS_DMIC] = { 0x12cc, BIT(16) },
+ [RST_USB_PHY0] = { 0x1300, BIT(30) },
+ [RST_BUS_OHCI0] = { 0x1304, BIT(16) },
+ [RST_BUS_EHCI0] = { 0x1304, BIT(20) },
+ [RST_BUS_OTG] = { 0x1304, BIT(24) },
+ [RST_USB_PHY1] = { 0x1308, BIT(30) },
+ [RST_BUS_OHCI1] = { 0x130c, BIT(16) },
+ [RST_BUS_EHCI1] = { 0x130c, BIT(20) },
+ [RST_BUS_USB2] = { 0x135c, BIT(16) },
+ [RST_BUS_PCIE_PWRUP] = { 0x138c, BIT(16) },
+ [RST_BUS_PCIE] = { 0x138c, BIT(17) },
+ [RST_BUS_SERDES] = { 0x13c4, BIT(16) },
+ [RST_BUS_GMAC0] = { 0x141c, BIT(16) },
+ [RST_BUS_GMAC0_AXI] = { 0x141c, BIT(17) },
+ [RST_BUS_GMAC1] = { 0x142c, BIT(16) }, /* From the vendor kernel. */
+ [RST_BUS_GMAC1_AXI] = { 0x142c, BIT(17) }, /* From the vendor kernel. */
+ [RST_BUS_TCON_LCD0] = { 0x1504, BIT(16) },
+ [RST_BUS_TCON_LCD1] = { 0x150c, BIT(16) },
+ [RST_BUS_TCON_LCD2] = { 0x1514, BIT(16) }, /* From the vendor kernel. */
+ [RST_BUS_LVDS0] = { 0x1544, BIT(16) },
+ [RST_BUS_LVDS1] = { 0x154c, BIT(16) },
+ [RST_BUS_DSI0] = { 0x1584, BIT(16) },
+ [RST_BUS_DSI1] = { 0x158c, BIT(16) },
+ [RST_BUS_TCON_TV0] = { 0x1604, BIT(16) },
+ [RST_BUS_TCON_TV1] = { 0x160c, BIT(16) },
+ [RST_BUS_EDP] = { 0x164c, BIT(16) },
+ [RST_BUS_HDMI_MAIN] = { 0x168c, BIT(16) },
+ [RST_BUS_HDMI_SUB] = { 0x168c, BIT(17) },
+ [RST_BUS_HDMI_HDCP] = { 0x168c, BIT(18) },
+ [RST_BUS_DPSS_TOP0] = { 0x16c4, BIT(16) },
+ [RST_BUS_DPSS_TOP1] = { 0x16cc, BIT(16) },
+ [RST_BUS_VIDEO_OUT0] = { 0x16e4, BIT(16) },
+ [RST_BUS_VIDEO_OUT1] = { 0x16ec, BIT(16) },
+ [RST_BUS_LEDC] = { 0x1704, BIT(16) },
+ [RST_BUS_DSC] = { 0x1744, BIT(16) },
+ [RST_BUS_CSI] = { 0x1844, BIT(16) },
+ [RST_BUS_VIDEO_IN] = { 0x1884, BIT(16) },
+ [RST_BUS_APB2JTAG] = { 0x1c04, BIT(16) },
+};
+
+static const struct sunxi_ccu_desc sun60i_a733_ccu_desc = {
+ .ccu_clks = sun60i_a733_ccu_clks,
+ .num_ccu_clks = ARRAY_SIZE(sun60i_a733_ccu_clks),
+
+ .hw_clks = &sun60i_a733_hw_clks,
+
+ .resets = sun60i_a733_ccu_resets,
+ .num_resets = ARRAY_SIZE(sun60i_a733_ccu_resets),
+};
+
+static const u32 pll_regs[] = {
+ SUN60I_A733_PLL_REF_REG,
+ SUN60I_A733_PLL_DDR_REG,
+ SUN60I_A733_PLL_PERIPH0_REG,
+ SUN60I_A733_PLL_PERIPH1_REG,
+ SUN60I_A733_PLL_GPU_REG,
+ SUN60I_A733_PLL_VIDEO0_REG,
+ SUN60I_A733_PLL_VIDEO1_REG,
+ SUN60I_A733_PLL_VIDEO2_REG,
+ SUN60I_A733_PLL_VE0_REG,
+ SUN60I_A733_PLL_VE1_REG,
+ SUN60I_A733_PLL_AUDIO0_REG,
+ SUN60I_A733_PLL_AUDIO1_REG,
+ SUN60I_A733_PLL_NPU_REG,
+ SUN60I_A733_PLL_DE_REG,
+};
+
+static int sun60i_a733_ccu_probe(struct platform_device *pdev)
+{
+ void __iomem *reg;
+ u32 val;
+ int i, ret;
+
+ reg = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(reg))
+ return PTR_ERR(reg);
+
+ /*
+ * The PLL clock code does not model all bits, for instance it does
+ * not support a separate enable and gate bit. We present the
+ * gate bit(27) as the enable bit, but then have to set the
+ * PLL Enable, LDO Enable, and Lock Enable bits on all PLLs here.
+ */
+ for (i = 0; i < ARRAY_SIZE(pll_regs); i++) {
+ val = readl(reg + pll_regs[i]);
+ val |= BIT(31) | BIT(30) | BIT(29);
+ writel(val, reg + pll_regs[i]);
+ }
+
+ /* Enforce m1 = 0 for PLL_AUDIO0 */
+ val = readl(reg + SUN60I_A733_PLL_AUDIO0_REG);
+ val &= ~BIT(1);
+ writel(val, reg + SUN60I_A733_PLL_AUDIO0_REG);
+
+ ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun60i_a733_ccu_desc);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static const struct of_device_id sun60i_a733_ccu_ids[] = {
+ { .compatible = "allwinner,sun60i-a733-ccu" },
+ { /* sentinel */ }
+};
+
+static struct platform_driver sun60i_a733_ccu_driver = {
+ .probe = sun60i_a733_ccu_probe,
+ .driver = {
+ .name = "sun60i-a733-ccu",
+ .suppress_bind_attrs = true,
+ .of_match_table = sun60i_a733_ccu_ids,
+ },
+};
+module_platform_driver(sun60i_a733_ccu_driver);
+
+MODULE_IMPORT_NS("SUNXI_CCU");
+MODULE_DESCRIPTION("Support for the Allwinner A733 CCU");
+MODULE_LICENSE("GPL");
diff --git a/drivers/clk/sunxi-ng/ccu_sdm.c b/drivers/clk/sunxi-ng/ccu_sdm.c
index c564e5f9e61040..204e25feaa3652 100644
--- a/drivers/clk/sunxi-ng/ccu_sdm.c
+++ b/drivers/clk/sunxi-ng/ccu_sdm.c
@@ -18,7 +18,10 @@ bool ccu_sdm_helper_is_enabled(struct ccu_common *common,
if (sdm->enable && !(readl(common->base + common->reg) & sdm->enable))
return false;
- return !!(readl(common->base + sdm->tuning_reg) & sdm->tuning_enable);
+ if (sdm->pat1_enable && !(readl(common->base + sdm->pat1_reg) & sdm->pat1_enable))
+ return false;
+
+ return !!(readl(common->base + sdm->pat0_reg) & sdm->pat0_enable);
}
EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_is_enabled, "SUNXI_CCU");
@@ -37,18 +40,27 @@ void ccu_sdm_helper_enable(struct ccu_common *common,
for (i = 0; i < sdm->table_size; i++)
if (sdm->table[i].rate == rate)
writel(sdm->table[i].pattern,
- common->base + sdm->tuning_reg);
+ common->base + sdm->pat0_reg);
/* Make sure SDM is enabled */
spin_lock_irqsave(common->lock, flags);
- reg = readl(common->base + sdm->tuning_reg);
- writel(reg | sdm->tuning_enable, common->base + sdm->tuning_reg);
+ reg = readl(common->base + sdm->pat0_reg);
+ writel(reg | sdm->pat0_enable, common->base + sdm->pat0_reg);
spin_unlock_irqrestore(common->lock, flags);
- spin_lock_irqsave(common->lock, flags);
- reg = readl(common->base + common->reg);
- writel(reg | sdm->enable, common->base + common->reg);
- spin_unlock_irqrestore(common->lock, flags);
+ if (sdm->enable) {
+ spin_lock_irqsave(common->lock, flags);
+ reg = readl(common->base + common->reg);
+ writel(reg | sdm->enable, common->base + common->reg);
+ spin_unlock_irqrestore(common->lock, flags);
+ }
+
+ if (sdm->pat1_enable) {
+ spin_lock_irqsave(common->lock, flags);
+ reg = readl(common->base + sdm->pat1_reg);
+ writel(reg | sdm->pat1_enable, common->base + sdm->pat1_reg);
+ spin_unlock_irqrestore(common->lock, flags);
+ }
}
EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_enable, "SUNXI_CCU");
@@ -61,14 +73,23 @@ void ccu_sdm_helper_disable(struct ccu_common *common,
if (!(common->features & CCU_FEATURE_SIGMA_DELTA_MOD))
return;
- spin_lock_irqsave(common->lock, flags);
- reg = readl(common->base + common->reg);
- writel(reg & ~sdm->enable, common->base + common->reg);
- spin_unlock_irqrestore(common->lock, flags);
+ if (sdm->enable) {
+ spin_lock_irqsave(common->lock, flags);
+ reg = readl(common->base + common->reg);
+ writel(reg & ~sdm->enable, common->base + common->reg);
+ spin_unlock_irqrestore(common->lock, flags);
+ }
+
+ if (sdm->pat1_enable) {
+ spin_lock_irqsave(common->lock, flags);
+ reg = readl(common->base + sdm->pat1_reg);
+ writel(reg & ~sdm->pat1_enable, common->base + sdm->pat1_reg);
+ spin_unlock_irqrestore(common->lock, flags);
+ }
spin_lock_irqsave(common->lock, flags);
- reg = readl(common->base + sdm->tuning_reg);
- writel(reg & ~sdm->tuning_enable, common->base + sdm->tuning_reg);
+ reg = readl(common->base + sdm->pat0_reg);
+ writel(reg & ~sdm->pat0_enable, common->base + sdm->pat0_reg);
spin_unlock_irqrestore(common->lock, flags);
}
EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_disable, "SUNXI_CCU");
@@ -123,7 +144,7 @@ unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common,
pr_debug("%s: clock is sigma-delta modulated\n",
clk_hw_get_name(&common->hw));
- reg = readl(common->base + sdm->tuning_reg);
+ reg = readl(common->base + sdm->pat0_reg);
pr_debug("%s: pattern reg is 0x%x",
clk_hw_get_name(&common->hw), reg);
diff --git a/drivers/clk/sunxi-ng/ccu_sdm.h b/drivers/clk/sunxi-ng/ccu_sdm.h
index c1a7159b89c31d..e94cef141c7de8 100644
--- a/drivers/clk/sunxi-ng/ccu_sdm.h
+++ b/drivers/clk/sunxi-ng/ccu_sdm.h
@@ -33,21 +33,28 @@ struct ccu_sdm_internal {
u32 table_size;
/* early SoCs don't have the SDM enable bit in the PLL register */
u32 enable;
- /* second enable bit in tuning register */
- u32 tuning_enable;
- u16 tuning_reg;
+ /* second enable bit in pattern0 register */
+ u32 pat0_enable;
+ u16 pat0_reg;
+ /* on some platforms, the sdm enable bit in pattern1 register */
+ u32 pat1_enable;
+ u16 pat1_reg;
};
-#define _SUNXI_CCU_SDM(_table, _enable, \
- _reg, _reg_enable) \
- { \
- .table = _table, \
- .table_size = ARRAY_SIZE(_table), \
- .enable = _enable, \
- .tuning_enable = _reg_enable, \
- .tuning_reg = _reg, \
+#define _SUNXI_CCU_SDM_DUAL_PAT(_table, _enable, _pat0, _pat0_enable, _pat1, _pat1_enable) \
+ { \
+ .table = _table, \
+ .table_size = ARRAY_SIZE(_table), \
+ .enable = _enable, \
+ .pat0_enable = _pat0_enable, \
+ .pat0_reg = _pat0, \
+ .pat1_enable = _pat1_enable, \
+ .pat1_reg = _pat1, \
}
+#define _SUNXI_CCU_SDM(_table, _enable, _pat0, _pat0_enable) \
+ _SUNXI_CCU_SDM_DUAL_PAT(_table, _enable, _pat0, _pat0_enable, 0, 0)
+
bool ccu_sdm_helper_is_enabled(struct ccu_common *common,
struct ccu_sdm_internal *sdm);
void ccu_sdm_helper_enable(struct ccu_common *common,
diff --git a/include/dt-bindings/clock/sun60i-a733-ccu.h b/include/dt-bindings/clock/sun60i-a733-ccu.h
new file mode 100644
index 00000000000000..6742070e3086fa
--- /dev/null
+++ b/include/dt-bindings/clock/sun60i-a733-ccu.h
@@ -0,0 +1,290 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ *
+ * The user manual uses PCLK, HCLK, and MCLK suffixes for some bus clocks.
+ * These are represented here as APB, AHB, and MBUS prefixes respectively,
+ * with the bus type moved to the front of the clock name.
+ */
+
+#ifndef _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_
+#define _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_
+
+#define CLK_PLL_REF 0
+#define CLK_SYS_24M 1
+#define CLK_PLL_DDR 2
+#define CLK_PLL_PERIPH0_4X 3
+#define CLK_PLL_PERIPH0_2X 4
+#define CLK_PLL_PERIPH0_800M 5
+#define CLK_PLL_PERIPH0_480M 6
+#define CLK_PLL_PERIPH0_600M 7
+#define CLK_PLL_PERIPH0_400M 8
+#define CLK_PLL_PERIPH0_300M 9
+#define CLK_PLL_PERIPH0_200M 10
+#define CLK_PLL_PERIPH0_160M 11
+#define CLK_PLL_PERIPH0_150M 12
+#define CLK_PLL_PERIPH1_4X 13
+#define CLK_PLL_PERIPH1_2X 14
+#define CLK_PLL_PERIPH1_800M 15
+#define CLK_PLL_PERIPH1_480M 16
+#define CLK_PLL_PERIPH1_600M 17
+#define CLK_PLL_PERIPH1_400M 18
+#define CLK_PLL_PERIPH1_300M 19
+#define CLK_PLL_PERIPH1_200M 20
+#define CLK_PLL_PERIPH1_160M 21
+#define CLK_PLL_PERIPH1_150M 22
+#define CLK_PLL_GPU0 23
+#define CLK_PLL_VIDEO0_12X 24
+#define CLK_PLL_VIDEO0_4X 25
+#define CLK_PLL_VIDEO0_3X 26
+#define CLK_PLL_VIDEO1_12X 27
+#define CLK_PLL_VIDEO1_4X 28
+#define CLK_PLL_VIDEO1_3X 29
+#define CLK_PLL_VIDEO2_12X 30
+#define CLK_PLL_VIDEO2_4X 31
+#define CLK_PLL_VIDEO2_3X 32
+#define CLK_PLL_VE0 33
+#define CLK_PLL_VE1 34
+#define CLK_PLL_AUDIO0_4X 35
+#define CLK_PLL_AUDIO1 36
+#define CLK_PLL_AUDIO1_DIV2 37
+#define CLK_PLL_AUDIO1_DIV5 38
+#define CLK_PLL_NPU 39
+#define CLK_PLL_DE_12X 40
+#define CLK_PLL_DE_4X 41
+#define CLK_PLL_DE_3X 42
+#define CLK_AHB 43
+#define CLK_APB0 44
+#define CLK_APB1 45
+#define CLK_APB_UART 46
+#define CLK_TRACE 47
+#define CLK_BUS_ITS_PCIE0_ACLK 48
+#define CLK_MBUS 49
+#define CLK_MBUS_IOMMU0_SYS 50
+#define CLK_APB_IOMMU0_SYS 51
+#define CLK_AHB_IOMMU0_SYS 52
+#define CLK_BUS_MSI_LITE0 53
+#define CLK_BUS_MSI_LITE1 54
+#define CLK_BUS_MSI_LITE2 55
+#define CLK_MBUS_IOMMU1_SYS 56
+#define CLK_APB_IOMMU1_SYS 57
+#define CLK_AHB_IOMMU1_SYS 58
+#define CLK_AHB_VE_DEC 59
+#define CLK_AHB_VE_ENC 60
+#define CLK_AHB_VID_IN 61
+#define CLK_AHB_VID_COUT0 62
+#define CLK_AHB_VID_COUT1 63
+#define CLK_AHB_DE 64
+#define CLK_AHB_NPU 65
+#define CLK_AHB_GPU0 66
+#define CLK_AHB_SERDES 67
+#define CLK_AHB_USB_SYS 68
+#define CLK_AHB_MSI_LITE0 69
+#define CLK_AHB_STORE 70
+#define CLK_AHB_CPUS 71
+#define CLK_MBUS_IOMMU0 72
+#define CLK_MBUS_IOMMU1 73
+#define CLK_MBUS_DESYS 74
+#define CLK_MBUS_VE_ENC0_GATE 75
+#define CLK_MBUS_VE_DEC0_GATE 76
+#define CLK_MBUS_GPU0 77
+#define CLK_MBUS_NPU 78
+#define CLK_MBUS_VID_IN 79
+#define CLK_MBUS_SERDES 80
+#define CLK_MBUS_MSI_LITE0 81
+#define CLK_MBUS_STORE 82
+#define CLK_MBUS_MSI_LITE2 83
+#define CLK_MBUS_DMA0 84
+#define CLK_MBUS_VE_ENC0 85
+#define CLK_MBUS_CE 86
+#define CLK_MBUS_DMA1 87
+#define CLK_MBUS_NAND 88
+#define CLK_MBUS_CSI 89
+#define CLK_MBUS_ISP 90
+#define CLK_MBUS_GMAC0 91
+#define CLK_MBUS_GMAC1 92
+#define CLK_MBUS_VE_DEC0 93
+#define CLK_BUS_DMA0 94
+#define CLK_BUS_DMA1 95
+#define CLK_BUS_SPINLOCK 96
+#define CLK_BUS_MSGBOX0 97
+#define CLK_BUS_PWM0 98
+#define CLK_BUS_PWM1 99
+#define CLK_BUS_DBG 100
+#define CLK_BUS_SYSDAP 101
+#define CLK_TIMER0 102
+#define CLK_TIMER1 103
+#define CLK_TIMER2 104
+#define CLK_TIMER3 105
+#define CLK_TIMER4 106
+#define CLK_TIMER5 107
+#define CLK_TIMER6 108
+#define CLK_TIMER7 109
+#define CLK_TIMER8 110
+#define CLK_TIMER9 111
+#define CLK_BUS_TIMER 112
+#define CLK_AVS 113
+#define CLK_DE0 114
+#define CLK_BUS_DE0 115
+#define CLK_DI 116
+#define CLK_BUS_DI 117
+#define CLK_G2D 118
+#define CLK_BUS_G2D 119
+#define CLK_EINK 120
+#define CLK_EINK_PANEL 121
+#define CLK_BUS_EINK 122
+#define CLK_VE_ENC0 123
+#define CLK_VE_DEC0 124
+#define CLK_BUS_VE_ENC0 125
+#define CLK_BUS_VE_DEC0 126
+#define CLK_CE 127
+#define CLK_BUS_CE 128
+#define CLK_BUS_CE_SYS 129
+#define CLK_NPU 130
+#define CLK_BUS_NPU 131
+#define CLK_GPU0 132
+#define CLK_BUS_GPU0 133
+#define CLK_DRAM0 134
+#define CLK_BUS_DRAM0 135
+#define CLK_NAND0_CLK0 136
+#define CLK_NAND0_CLK1 137
+#define CLK_BUS_NAND0 138
+#define CLK_MMC0 139
+#define CLK_BUS_MMC0 140
+#define CLK_MMC1 141
+#define CLK_BUS_MMC1 142
+#define CLK_MMC2 143
+#define CLK_BUS_MMC2 144
+#define CLK_MMC3 145
+#define CLK_BUS_MMC3 146
+#define CLK_UFS_AXI 147
+#define CLK_UFS_CFG 148
+#define CLK_BUS_UFS 149
+#define CLK_BUS_UART0 150
+#define CLK_BUS_UART1 151
+#define CLK_BUS_UART2 152
+#define CLK_BUS_UART3 153
+#define CLK_BUS_UART4 154
+#define CLK_BUS_UART5 155
+#define CLK_BUS_UART6 156
+#define CLK_BUS_I2C0 157
+#define CLK_BUS_I2C1 158
+#define CLK_BUS_I2C2 159
+#define CLK_BUS_I2C3 160
+#define CLK_BUS_I2C4 161
+#define CLK_BUS_I2C5 162
+#define CLK_BUS_I2C6 163
+#define CLK_BUS_I2C7 164
+#define CLK_BUS_I2C8 165
+#define CLK_BUS_I2C9 166
+#define CLK_BUS_I2C10 167
+#define CLK_BUS_I2C11 168
+#define CLK_BUS_I2C12 169
+#define CLK_SPI0 170
+#define CLK_BUS_SPI0 171
+#define CLK_SPI1 172
+#define CLK_BUS_SPI1 173
+#define CLK_SPI2 174
+#define CLK_BUS_SPI2 175
+#define CLK_SPIF 176
+#define CLK_BUS_SPIF 177
+#define CLK_SPI3 178
+#define CLK_BUS_SPI3 179
+#define CLK_SPI4 180
+#define CLK_BUS_SPI4 181
+#define CLK_GPADC0_24M 182
+#define CLK_BUS_GPADC0 183
+#define CLK_BUS_THS0 184
+#define CLK_IRRX 185
+#define CLK_BUS_IRRX 186
+#define CLK_IRTX 187
+#define CLK_BUS_IRTX 188
+#define CLK_BUS_LRADC 189
+#define CLK_SGPIO 190
+#define CLK_BUS_SGPIO 191
+#define CLK_LPC 192
+#define CLK_BUS_LPC 193
+#define CLK_I2SPCM0 194
+#define CLK_BUS_I2SPCM0 195
+#define CLK_I2SPCM1 196
+#define CLK_BUS_I2SPCM1 197
+#define CLK_I2SPCM2 198
+#define CLK_I2SPCM2_ASRC 199
+#define CLK_BUS_I2SPCM2 200
+#define CLK_I2SPCM3 201
+#define CLK_BUS_I2SPCM3 202
+#define CLK_I2SPCM4 203
+#define CLK_BUS_I2SPCM4 204
+#define CLK_SPDIF_TX 205
+#define CLK_SPDIF_RX 206
+#define CLK_BUS_SPDIF 207
+#define CLK_DMIC 208
+#define CLK_BUS_DMIC 209
+#define CLK_USB_OHCI0 210
+#define CLK_BUS_OHCI0 211
+#define CLK_BUS_EHCI0 212
+#define CLK_BUS_OTG 213
+#define CLK_USB_OHCI1 214
+#define CLK_BUS_OHCI1 215
+#define CLK_BUS_EHCI1 216
+#define CLK_USB01_REF 217
+#define CLK_USB2_U2_REF 218
+#define CLK_USB2_SUSPEND 219
+#define CLK_USB2_MF 220
+#define CLK_USB2_U3_UTMI 221
+#define CLK_USB2_U2_PIPE 222
+#define CLK_PCIE_AUX 223
+#define CLK_PCIE_AXI_SLV 224
+#define CLK_SERDES_PHY 225
+#define CLK_GMAC_PTP 226
+#define CLK_GMAC0_PHY 227
+#define CLK_BUS_GMAC0 228
+#define CLK_GMAC1_PHY 229
+#define CLK_BUS_GMAC1 230
+#define CLK_TCON_LCD0 231
+#define CLK_BUS_TCON_LCD0 232
+#define CLK_TCON_LCD1 233
+#define CLK_BUS_TCON_LCD1 234
+#define CLK_TCON_LCD2 235
+#define CLK_BUS_TCON_LCD2 236
+#define CLK_DSI0 237
+#define CLK_BUS_DSI0 238
+#define CLK_DSI1 239
+#define CLK_BUS_DSI1 240
+#define CLK_COMBPHY0 241
+#define CLK_COMBPHY1 242
+#define CLK_BUS_TCON_TV0 243
+#define CLK_BUS_TCON_TV1 244
+#define CLK_EDP_TV 245
+#define CLK_BUS_EDP_TV 246
+#define CLK_HDMI_CEC_32K 247
+#define CLK_HDMI_CEC 248
+#define CLK_HDMI_TV 249
+#define CLK_BUS_HDMI_TV 250
+#define CLK_HDMI_SFR 251
+#define CLK_HDCP_ESM 252
+#define CLK_BUS_DPSS_TOP0 253
+#define CLK_BUS_DPSS_TOP1 254
+#define CLK_LEDC 255
+#define CLK_BUS_LEDC 256
+#define CLK_BUS_DSC 257
+#define CLK_CSI_MASTER0 258
+#define CLK_CSI_MASTER1 259
+#define CLK_CSI_MASTER2 260
+#define CLK_CSI 261
+#define CLK_BUS_CSI 262
+#define CLK_ISP 263
+#define CLK_RES_DCAP_24M 264
+#define CLK_APB2JTAG 265
+#define CLK_FANOUT_24M 266
+#define CLK_FANOUT_12M 267
+#define CLK_FANOUT_16M 268
+#define CLK_FANOUT_25M 269
+#define CLK_FANOUT_27M 270
+#define CLK_FANOUT_PCLK 271
+#define CLK_FANOUT0 272
+#define CLK_FANOUT1 273
+#define CLK_FANOUT2 274
+#define CLK_FANOUT3 275
+
+#endif /* _DT_BINDINGS_CLK_SUN60I_A733_CCU_H_ */
diff --git a/include/dt-bindings/clock/sun60i-a733-r-ccu.h b/include/dt-bindings/clock/sun60i-a733-r-ccu.h
new file mode 100644
index 00000000000000..1d3845b483bf0f
--- /dev/null
+++ b/include/dt-bindings/clock/sun60i-a733-r-ccu.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ */
+
+#ifndef _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_
+#define _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_
+
+#define CLK_R_AHB 0
+#define CLK_R_APB0 1
+#define CLK_R_APB1 2
+#define CLK_R_TIMER0 3
+#define CLK_R_TIMER1 4
+#define CLK_R_TIMER2 5
+#define CLK_R_TIMER3 6
+#define CLK_BUS_R_TIMER 7
+#define CLK_BUS_R_TWD 8
+#define CLK_R_PWM 9
+#define CLK_BUS_R_PWM 10
+#define CLK_R_SPI 11
+#define CLK_BUS_R_SPI 12
+#define CLK_BUS_R_MSGBOX 13
+#define CLK_BUS_R_UART0 14
+#define CLK_BUS_R_UART1 15
+#define CLK_BUS_R_I2C0 16
+#define CLK_BUS_R_I2C1 17
+#define CLK_BUS_R_I2C2 18
+#define CLK_BUS_R_PPU 19
+#define CLK_BUS_R_TZMA 20
+#define CLK_BUS_R_CPU_BIST 21
+#define CLK_R_IR_RX 22
+#define CLK_BUS_R_IR_RX 23
+#define CLK_BUS_R_RTC 24
+#define CLK_R_RISCV 25
+#define CLK_BUS_R_RISCV 26
+#define CLK_BUS_R_RISCV_CFG 27
+#define CLK_BUS_R_CPUCFG 28
+
+#endif /* _DT_BINDINGS_CLK_SUN60I_A733_R_CCU_H_ */
diff --git a/include/dt-bindings/reset/sun60i-a733-ccu.h b/include/dt-bindings/reset/sun60i-a733-ccu.h
new file mode 100644
index 00000000000000..8946f08925dc72
--- /dev/null
+++ b/include/dt-bindings/reset/sun60i-a733-ccu.h
@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ */
+
+#ifndef _DT_BINDINGS_RST_SUN60I_A733_CCU_H_
+#define _DT_BINDINGS_RST_SUN60I_A733_CCU_H_
+
+#define RST_BUS_ITS_PCIE0 0
+#define RST_BUS_IOMMU0_SYS 1
+#define RST_BUS_MSI_LITE0_AHB 2
+#define RST_BUS_MSI_LITE0_MBUS 3
+#define RST_BUS_MSI_LITE1_AHB 4
+#define RST_BUS_MSI_LITE1_MBUS 5
+#define RST_BUS_MSI_LITE2_AHB 6
+#define RST_BUS_MSI_LITE2_MBUS 7
+#define RST_BUS_IOMMU1_SYS 8
+#define RST_BUS_DMA0 9
+#define RST_BUS_DMA1 10
+#define RST_BUS_SPINLOCK 11
+#define RST_BUS_MSGBOX 12
+#define RST_BUS_PWM0 13
+#define RST_BUS_PWM1 14
+#define RST_BUS_DBG 15
+#define RST_BUS_SYSDAP 16
+#define RST_BUS_TIMER0 17
+#define RST_BUS_DE0 18
+#define RST_BUS_DI 19
+#define RST_BUS_G2D 20
+#define RST_BUS_EINK 21
+#define RST_BUS_DE_SYS 22
+#define RST_BUS_VE_ENC0 23
+#define RST_BUS_VE_DEC0 24
+#define RST_BUS_CE 25
+#define RST_BUS_CE_SYS 26
+#define RST_BUS_NPU_CORE 27
+#define RST_BUS_NPU_AXI 28
+#define RST_BUS_NPU_AHB 29
+#define RST_BUS_NPU_SRAM 30
+#define RST_BUS_GPU0 31
+#define RST_BUS_DRAM0 32
+#define RST_BUS_NAND0 33
+#define RST_BUS_MMC0 34
+#define RST_BUS_MMC1 35
+#define RST_BUS_MMC2 36
+#define RST_BUS_MMC3 37
+#define RST_BUS_UFS_AHB 38
+#define RST_BUS_UFS_AXI 39
+#define RST_BUS_UFS_PHY 40
+#define RST_BUS_UFS_CORE 41
+#define RST_BUS_UART0 42
+#define RST_BUS_UART1 43
+#define RST_BUS_UART2 44
+#define RST_BUS_UART3 45
+#define RST_BUS_UART4 46
+#define RST_BUS_UART5 47
+#define RST_BUS_UART6 48
+#define RST_BUS_I2C0 49
+#define RST_BUS_I2C1 50
+#define RST_BUS_I2C2 51
+#define RST_BUS_I2C3 52
+#define RST_BUS_I2C4 53
+#define RST_BUS_I2C5 54
+#define RST_BUS_I2C6 55
+#define RST_BUS_I2C7 56
+#define RST_BUS_I2C8 57
+#define RST_BUS_I2C9 58
+#define RST_BUS_I2C10 59
+#define RST_BUS_I2C11 60
+#define RST_BUS_I2C12 61
+#define RST_BUS_SPI0 62
+#define RST_BUS_SPI1 63
+#define RST_BUS_SPI2 64
+#define RST_BUS_SPIF 65
+#define RST_BUS_SPI3 66
+#define RST_BUS_SPI4 67
+#define RST_BUS_GPADC0 68
+#define RST_BUS_THS0 69
+#define RST_BUS_IRRX 70
+#define RST_BUS_IRTX 71
+#define RST_BUS_LRADC 72
+#define RST_BUS_SGPIO 73
+#define RST_BUS_LPC 74
+#define RST_BUS_I2SPCM0 75
+#define RST_BUS_I2SPCM1 76
+#define RST_BUS_I2SPCM2 77
+#define RST_BUS_I2SPCM3 78
+#define RST_BUS_I2SPCM4 79
+#define RST_BUS_SPDIF 80
+#define RST_BUS_DMIC 81
+#define RST_USB_PHY0 82
+#define RST_BUS_OHCI0 83
+#define RST_BUS_EHCI0 84
+#define RST_BUS_OTG 85
+#define RST_USB_PHY1 86
+#define RST_BUS_OHCI1 87
+#define RST_BUS_EHCI1 88
+#define RST_BUS_USB2 89
+#define RST_BUS_PCIE_PWRUP 90
+#define RST_BUS_PCIE 91
+#define RST_BUS_SERDES 92
+#define RST_BUS_GMAC0 93
+#define RST_BUS_GMAC0_AXI 94
+#define RST_BUS_GMAC1 95
+#define RST_BUS_GMAC1_AXI 96
+#define RST_BUS_TCON_LCD0 97
+#define RST_BUS_TCON_LCD1 98
+#define RST_BUS_TCON_LCD2 99
+#define RST_BUS_LVDS0 100
+#define RST_BUS_LVDS1 101
+#define RST_BUS_DSI0 102
+#define RST_BUS_DSI1 103
+#define RST_BUS_TCON_TV0 104
+#define RST_BUS_TCON_TV1 105
+#define RST_BUS_EDP 106
+#define RST_BUS_HDMI_MAIN 107
+#define RST_BUS_HDMI_SUB 108
+#define RST_BUS_HDMI_HDCP 109
+#define RST_BUS_DPSS_TOP0 110
+#define RST_BUS_DPSS_TOP1 111
+#define RST_BUS_VIDEO_OUT0 112
+#define RST_BUS_VIDEO_OUT1 113
+#define RST_BUS_LEDC 114
+#define RST_BUS_DSC 115
+#define RST_BUS_CSI 116
+#define RST_BUS_VIDEO_IN 117
+#define RST_BUS_APB2JTAG 118
+
+#endif /* _DT_BINDINGS_RST_SUN60I_A733_CCU_H_ */
diff --git a/include/dt-bindings/reset/sun60i-a733-r-ccu.h b/include/dt-bindings/reset/sun60i-a733-r-ccu.h
new file mode 100644
index 00000000000000..629e546d19984b
--- /dev/null
+++ b/include/dt-bindings/reset/sun60i-a733-r-ccu.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (C) 2026 Junhui Liu <junhui.liu@pigmoral.tech>
+ */
+
+#ifndef _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_
+#define _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_
+
+#define RST_BUS_R_TIMER 0
+#define RST_BUS_R_PWM 1
+#define RST_BUS_R_SPI 2
+#define RST_BUS_R_MSGBOX 3
+#define RST_BUS_R_UART0 4
+#define RST_BUS_R_UART1 5
+#define RST_BUS_R_I2C0 6
+#define RST_BUS_R_I2C1 7
+#define RST_BUS_R_I2C2 8
+#define RST_BUS_R_IR_RX 9
+#define RST_BUS_R_RTC 10
+#define RST_BUS_R_RISCV_CFG 11
+#define RST_BUS_R_CPUCFG 12
+
+#endif /* _DT_BINDINGS_RST_SUN60I_A733_R_CCU_H_ */
|
| 3/2 | 2026/07/12 02:57 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 65451 output: 23 thoughts: 1440 Thoughts: **Fuzzing Potential: Allwinner A733 CCU/PRCM Driver** Okay, so I've got a patch here adding support for the Allwinner A733 CCU and PRCM. It's adding the usual suspects: device tree bindings, Kconfig options, Makefiles, and the core driver files (`ccu-sun60i-a733.c` and `ccu-sun60i-a733-r.c`). Crucially, there are modifications to `ccu_sdm.c` and `ccu_sdm.h`, which are definitely worth a closer look. The real meat of this is the change to `ccu_sdm.c` involving the Sigma-Delta Modulation helper functions. Specifically, it looks like it's transitioning from supporting a single `tuning_reg` to handling *dual* pattern registers (`pat0` and `pat1`). That's a fundamental shift in how the clock driver works, and it's going to affect any other SoCs that leverage this `ccu_sdm.c` code, either directly via the new macro or indirectly if they were using the old macro that's been updated. Quick check of `ccu_sdm.h` confirms it. The old macro, `_SUNXI_CCU_SDM`, is being redefined to use `_SUNXI_CCU_SDM_DUAL_PAT` with `pat1` set to zero. This redefinition will definitely change the behavior of core functions: `ccu_sdm_helper_is_enabled`, `ccu_sdm_helper_enable`, `ccu_sdm_helper_disable`, and `ccu_sdm_helper_read_rate`. Now, the question is, is this code *fuzzable*? The Allwinner SoCs clock drivers are definitely used on many SoCs and the change to `ccu_sdm.c` is going to be used by all of them. `ccu_sdm.c` is definitely reachable within that tree. These are platform drivers, so they rely on a device tree node match for probe. In a virtualized environment like QEMU, we *could* be limited by the lack of A733 hardware. But then I remember: We can *load* the module or even compile it into the kernel, and the most promising angle is instantiating platform devices via sysfs or device tree overlays. And then it hits me. Syzkaller and its `syz_devicetree_overlay`! We can load arbitrary device tree nodes to trigger platform driver probing. This means that platform drivers are REACHABLE in Syzkaller *if* they don't strictly require hardware at probe time. Even if `ioremap` fails on an invalid physical address, sometimes, it doesn't. And we can fake it! That's the key. `devm_platform_ioremap_resource` will attempt to map the physical address from the device tree, right? If we provide a dummy address in RAM, it will succeed, and the driver will *think* it's reading/writing to MMIO. So, yes, it's absolutely fuzzable! Okay, let's circle back and solidify our understanding of the `ccu_sdm.c` changes. We're talking about changes to `ccu_sdm_helper_is_enabled`, `ccu_sdm_helper_enable`, `ccu_sdm_helper_disable`, and `ccu_sdm_helper_read_rate`. These are used by `ccu_nm.c` and `ccu_mult.c` for clock rate and enabling. And finally, we have two config options to keep in mind: `SUN60I_A733_CCU` and `SUN60I_A733_R_CCU`. They likely control the inclusion of the A733 CCU and PRCM driver in the build. I'm going to run `grepper` and see where exactly `ccu_sdm_helper_enable` is actually *used*. |
| 4/2 | 2026/07/12 02:57 | tool | grepper |
0mArgs:{
"Expression": "ccu_sdm_helper_enable"
}Results: {
"Output": "drivers/clk/sunxi-ng/ccu_nm.c=168=static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long rate,\n--\ndrivers/clk/sunxi-ng/ccu_nm.c-203-\tif (ccu_sdm_helper_has_rate(\u0026nm-\u003ecommon, \u0026nm-\u003esdm, rate)) {\ndrivers/clk/sunxi-ng/ccu_nm.c:204:\t\tccu_sdm_helper_enable(\u0026nm-\u003ecommon, \u0026nm-\u003esdm, rate);\ndrivers/clk/sunxi-ng/ccu_nm.c-205-\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=26=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_is_enabled, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-27-\ndrivers/clk/sunxi-ng/ccu_sdm.c:28:void ccu_sdm_helper_enable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-29-\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c-64-}\ndrivers/clk/sunxi-ng/ccu_sdm.c:65:EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_enable, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-66-\n--\ndrivers/clk/sunxi-ng/ccu_sdm.h=58=bool ccu_sdm_helper_is_enabled(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-59-\t\t\t struct ccu_sdm_internal *sdm);\ndrivers/clk/sunxi-ng/ccu_sdm.h:60:void ccu_sdm_helper_enable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-61-\t\t\t struct ccu_sdm_internal *sdm,\n"
} |
| 5/2 | 2026/07/12 02:57 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 68386 output: 32 thoughts: 1007 Thoughts: **Fuzzing the Sunxi-NG Clock Framework: A Targeted Approach** Okay, so I'm looking at this patch and thinking about fuzzing the `sunxi-ng` clock framework. Specifically, the introduction of `sun60i-a733-ccu.c` and `sun60i-a733-r-ccu.c` has caught my eye. The `ccu_sdm_helper_enable` function, used in `ccu_nm.c`, is also a key part of this clock framework that needs attention. My initial assessment is that these drivers are, in fact, functional because they register clocks and resets. The `probe` function, as expected, maps IO memory and registers the CCU, which looks like standard clock controller driver behavior. Given the existing clock framework in place, can this be fuzzed? Definitely. Syzkaller's `syz_devicetree_overlay` pseudo-syscall provides a direct path to instantiate a platform device. I can craft a device tree overlay with a `compatible = "allwinner,sun60i-a733-ccu"` node and a `reg` property pointing to allocated memory. This should trigger the platform bus to probe the driver, and since the memory region is RAM-backed, `devm_platform_ioremap_resource` should succeed, registering the clocks. From there, Syzkaller can interact with those clocks through the clock framework. Think clock consumers, sysfs, debugfs interfaces... all fair game. The specific prompt raises a concern: code paths unreachable in virtualized environments like GCE or QEMU. But, this isn't the case here. Syzkaller's device tree overlay mechanism overcomes that barrier. The driver is reachable. Now, let's nail down the configuration requirements. I'll need to make sure `SUN60I_A733_CCU` and `SUN60I_A733_R_CCU` are enabled. I'll verify that in the Kconfig file. Let me quickly check the dependencies in `drivers/clk/sunxi-ng/Kconfig`: Okay, the Kconfig confirms I should enable those, assuming it's an ARM64 system. Finally, the focus symbols. I've got a good list: `sun60i_a733_ccu_probe`, `sun60i_a733_r_ccu_probe`, and the `ccu_sdm_helper_*` functions, specifically `ccu_sdm_helper_enable`, `ccu_sdm_helper_disable`, `ccu_sdm_helper_is_enabled`, and `ccu_sdm_helper_read_rate`. I'll double-check those function names in `ccu_sdm.c` to be completely sure. |
| 6/2 | 2026/07/12 02:57 | tool | grepper |
0mArgs:{
"Expression": "^(void|bool|unsigned long|int) ccu_sdm_helper_"
}Results: {
"Output": "drivers/clk/sunxi-ng/ccu_sdm.c-11-\ndrivers/clk/sunxi-ng/ccu_sdm.c:12:bool ccu_sdm_helper_is_enabled(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-13-\t\t\t struct ccu_sdm_internal *sdm)\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=26=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_is_enabled, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-27-\ndrivers/clk/sunxi-ng/ccu_sdm.c:28:void ccu_sdm_helper_enable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-29-\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=65=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_enable, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-66-\ndrivers/clk/sunxi-ng/ccu_sdm.c:67:void ccu_sdm_helper_disable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-68-\t\t\t struct ccu_sdm_internal *sdm)\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=95=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_disable, \"SUNXI_CCU\");\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c-113- */\ndrivers/clk/sunxi-ng/ccu_sdm.c:114:bool ccu_sdm_helper_has_rate(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-115-\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=129=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_has_rate, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-130-\ndrivers/clk/sunxi-ng/ccu_sdm.c:131:unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-132-\t\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.c=160=EXPORT_SYMBOL_NS_GPL(ccu_sdm_helper_read_rate, \"SUNXI_CCU\");\ndrivers/clk/sunxi-ng/ccu_sdm.c-161-\ndrivers/clk/sunxi-ng/ccu_sdm.c:162:int ccu_sdm_helper_get_factors(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.c-163-\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.h=31=struct ccu_sdm_internal {\n--\ndrivers/clk/sunxi-ng/ccu_sdm.h-57-\ndrivers/clk/sunxi-ng/ccu_sdm.h:58:bool ccu_sdm_helper_is_enabled(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-59-\t\t\t struct ccu_sdm_internal *sdm);\ndrivers/clk/sunxi-ng/ccu_sdm.h:60:void ccu_sdm_helper_enable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-61-\t\t\t struct ccu_sdm_internal *sdm,\ndrivers/clk/sunxi-ng/ccu_sdm.h-62-\t\t\t unsigned long rate);\ndrivers/clk/sunxi-ng/ccu_sdm.h:63:void ccu_sdm_helper_disable(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-64-\t\t\t struct ccu_sdm_internal *sdm);\ndrivers/clk/sunxi-ng/ccu_sdm.h-65-\ndrivers/clk/sunxi-ng/ccu_sdm.h:66:bool ccu_sdm_helper_has_rate(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-67-\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.h-69-\ndrivers/clk/sunxi-ng/ccu_sdm.h:70:unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-71-\t\t\t\t struct ccu_sdm_internal *sdm,\n--\ndrivers/clk/sunxi-ng/ccu_sdm.h-73-\ndrivers/clk/sunxi-ng/ccu_sdm.h:74:int ccu_sdm_helper_get_factors(struct ccu_common *common,\ndrivers/clk/sunxi-ng/ccu_sdm.h-75-\t\t\t struct ccu_sdm_internal *sdm,\n"
} |
| 7/2 | 2026/07/12 02:57 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 71525 output: 223 thoughts: 485 Thoughts: **Patch Analysis for Fuzzing Prioritization** Okay, let's break this down for fuzzing purposes. I see we've got some key functions that have been touched. We've got modifications to the SDM helper functions: `ccu_sdm_helper_is_enabled`, `ccu_sdm_helper_enable`, `ccu_sdm_helper_disable`, and `ccu_sdm_helper_read_rate`. These are particularly interesting because they involve actual logic changes, specifically handling `pat0` and `pat1`, so we definitely want to give those a good going-over. Then there are the probe functions: `sun60i_a733_ccu_probe` and `sun60i_a733_r_ccu_probe`. These are also important to fuzz, as we always want to target probe functions. The new files `ccu-sun60i-a733.c` and `ccu-sun60i-a733-r.c` are mostly data structures and probe functions. Fuzzing the probe functions is the right approach. I need to make sure we're not missing anything else, so I checked if `SUN60I_A733_CCU` and `SUN60I_A733_R_CCU` are the only config options added, and yes, they are, in `drivers/clk/sunxi-ng/Kconfig`. Based on this analysis, I'm going to formulate my recommendation. I'm going to flag this as "WorthFuzzing: true" for sure. The core of my recommendation will include: * **FocusSymbols:** `sun60i_a733_ccu_probe`, `sun60i_a733_r_ccu_probe`, `ccu_sdm_helper_is_enabled`, `ccu_sdm_helper_enable`, `ccu_sdm_helper_disable`, `ccu_sdm_helper_read_rate`. * **EnableConfigs:** `SUN60I_A733_CCU`, and `SUN60I_A733_R_CCU`. The reasoning is solid: This patch implements new clock control unit drivers for the Allwinner A733 SoC and modifies the core sunxi-ng Sigma-Delta Modulation (SDM) helper functions to support dual pattern registers. These changes include functional logic in `ccu_sdm.c` and new probe functions that can be reached via device tree overlays. These all represent great targets for fuzzing. |
| 8/2 | 2026/07/12 02:58 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"SUN60I_A733_CCU",
"SUN60I_A733_R_CCU"
],
"FocusSymbols": [
"sun60i_a733_ccu_probe",
"sun60i_a733_r_ccu_probe",
"ccu_sdm_helper_is_enabled",
"ccu_sdm_helper_enable",
"ccu_sdm_helper_disable",
"ccu_sdm_helper_read_rate"
],
"Reasoning": "The patch introduces new clock control unit drivers for the Allwinner A733 SoC and modifies the core sunxi-ng Sigma-Delta Modulation (SDM) helper functions to support dual pattern registers. These changes include functional logic in `ccu_sdm.c` and new probe functions that can be reached via device tree overlays in a virtualized environment.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"SUN60I_A733_CCU",
"SUN60I_A733_R_CCU"
],
"FocusSymbols": [
"sun60i_a733_ccu_probe",
"sun60i_a733_r_ccu_probe",
"ccu_sdm_helper_is_enabled",
"ccu_sdm_helper_enable",
"ccu_sdm_helper_disable",
"ccu_sdm_helper_read_rate"
],
"Reasoning": "The patch introduces new clock control unit drivers for the Allwinner A733 SoC and modifies the core sunxi-ng Sigma-Delta Modulation (SDM) helper functions to support dual pattern registers. These changes include functional logic in `ccu_sdm.c` and new probe functions that can be reached via device tree overlays in a virtualized environment.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|