Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-3-Clause |
| 2 | /* |
| 3 | * Clock drivers for Qualcomm QCS404 |
| 4 | * |
| 5 | * (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org> |
| 6 | */ |
| 7 | |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 8 | #include <clk-uclass.h> |
| 9 | #include <dm.h> |
| 10 | #include <errno.h> |
| 11 | #include <asm/io.h> |
| 12 | #include <linux/bitops.h> |
Konrad Dybcio | 3ead661 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 13 | #include <dt-bindings/clock/qcom,gcc-qcs404.h> |
| 14 | |
Caleb Connolly | a623c14 | 2023-11-07 12:40:59 +0000 | [diff] [blame] | 15 | #include "clock-qcom.h" |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 16 | |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 17 | /* Clocks: (from CLK_CTL_BASE) */ |
| 18 | #define GPLL0_STATUS (0x21000) |
| 19 | #define GPLL1_STATUS (0x20000) |
| 20 | #define APCS_GPLL_ENA_VOTE (0x45000) |
| 21 | #define APCS_CLOCK_BRANCH_ENA_VOTE (0x45004) |
| 22 | |
| 23 | /* BLSP1 AHB clock (root clock for BLSP) */ |
| 24 | #define BLSP1_AHB_CBCR 0x1008 |
| 25 | |
| 26 | /* Uart clock control registers */ |
| 27 | #define BLSP1_UART2_BCR (0x3028) |
| 28 | #define BLSP1_UART2_APPS_CBCR (0x302C) |
| 29 | #define BLSP1_UART2_APPS_CMD_RCGR (0x3034) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 30 | |
| 31 | /* I2C controller clock control registerss */ |
| 32 | #define BLSP1_QUP0_I2C_APPS_CBCR (0x6028) |
| 33 | #define BLSP1_QUP0_I2C_APPS_CMD_RCGR (0x602C) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 34 | #define BLSP1_QUP1_I2C_APPS_CBCR (0x2008) |
| 35 | #define BLSP1_QUP1_I2C_APPS_CMD_RCGR (0x200C) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 36 | #define BLSP1_QUP2_I2C_APPS_CBCR (0x3010) |
| 37 | #define BLSP1_QUP2_I2C_APPS_CMD_RCGR (0x3000) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 38 | #define BLSP1_QUP3_I2C_APPS_CBCR (0x4020) |
| 39 | #define BLSP1_QUP3_I2C_APPS_CMD_RCGR (0x4000) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 40 | #define BLSP1_QUP4_I2C_APPS_CBCR (0x5020) |
| 41 | #define BLSP1_QUP4_I2C_APPS_CMD_RCGR (0x5000) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 42 | |
| 43 | /* SD controller clock control registers */ |
| 44 | #define SDCC_BCR(n) (((n) * 0x1000) + 0x41000) |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 45 | #define SDCC_CMD_RCGR(n) (((n + 1) * 0x1000) + 0x41004) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 46 | #define SDCC_APPS_CBCR(n) (((n) * 0x1000) + 0x41018) |
| 47 | #define SDCC_AHB_CBCR(n) (((n) * 0x1000) + 0x4101C) |
| 48 | |
| 49 | /* USB-3.0 controller clock control registers */ |
| 50 | #define SYS_NOC_USB3_CBCR (0x26014) |
| 51 | #define USB30_BCR (0x39000) |
| 52 | #define USB3PHY_BCR (0x39008) |
| 53 | #define USB30_MASTER_CBCR (0x3900C) |
| 54 | #define USB30_SLEEP_CBCR (0x39010) |
| 55 | #define USB30_MOCK_UTMI_CBCR (0x39014) |
| 56 | #define USB30_MOCK_UTMI_CMD_RCGR (0x3901C) |
| 57 | #define USB30_MOCK_UTMI_CFG_RCGR (0x39020) |
| 58 | #define USB30_MASTER_CMD_RCGR (0x39028) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 59 | #define USB2A_PHY_SLEEP_CBCR (0x4102C) |
| 60 | #define USB_HS_PHY_CFG_AHB_CBCR (0x41030) |
| 61 | |
| 62 | /* ETH controller clock control registers */ |
| 63 | #define ETH_PTP_CBCR (0x4e004) |
| 64 | #define ETH_RGMII_CBCR (0x4e008) |
| 65 | #define ETH_SLAVE_AHB_CBCR (0x4e00c) |
| 66 | #define ETH_AXI_CBCR (0x4e010) |
| 67 | #define EMAC_PTP_CMD_RCGR (0x4e014) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 68 | #define EMAC_CMD_RCGR (0x4e01c) |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 69 | |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 70 | |
| 71 | /* GPLL0 clock control registers */ |
| 72 | #define GPLL0_STATUS_ACTIVE BIT(31) |
| 73 | |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 74 | #define CFG_CLK_SRC_GPLL1 BIT(8) |
| 75 | #define GPLL1_STATUS_ACTIVE BIT(31) |
| 76 | |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 77 | static struct vote_clk gcc_blsp1_ahb_clk = { |
| 78 | .cbcr_reg = BLSP1_AHB_CBCR, |
| 79 | .ena_vote = APCS_CLOCK_BRANCH_ENA_VOTE, |
| 80 | .vote_bit = BIT(10) | BIT(5) | BIT(4), |
| 81 | }; |
| 82 | |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 83 | static struct pll_vote_clk gpll0_vote_clk = { |
| 84 | .status = GPLL0_STATUS, |
| 85 | .status_bit = GPLL0_STATUS_ACTIVE, |
| 86 | .ena_vote = APCS_GPLL_ENA_VOTE, |
| 87 | .vote_bit = BIT(0), |
| 88 | }; |
| 89 | |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 90 | static struct pll_vote_clk gpll1_vote_clk = { |
| 91 | .status = GPLL1_STATUS, |
| 92 | .status_bit = GPLL1_STATUS_ACTIVE, |
| 93 | .ena_vote = APCS_GPLL_ENA_VOTE, |
| 94 | .vote_bit = BIT(1), |
| 95 | }; |
| 96 | |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 97 | static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 98 | { |
| 99 | struct msm_clk_priv *priv = dev_get_priv(clk->dev); |
| 100 | |
| 101 | switch (clk->id) { |
| 102 | case GCC_BLSP1_UART2_APPS_CLK: |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 103 | /* UART: 1843200Hz for a fixed 115200 baudrate (19200000 * (12/125)) */ |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 104 | clk_rcg_set_rate_mnd(priv->base, BLSP1_UART2_APPS_CMD_RCGR, 0, 12, 125, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 105 | CFG_CLK_SRC_CXO, 16); |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 106 | clk_enable_cbc(priv->base + BLSP1_UART2_APPS_CBCR); |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 107 | return 1843200; |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 108 | case GCC_SDCC1_APPS_CLK: |
| 109 | /* SDCC1: 200MHz */ |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 110 | clk_rcg_set_rate_mnd(priv->base, SDCC_CMD_RCGR(0), 7, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 111 | CFG_CLK_SRC_GPLL0, 8); |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 112 | clk_enable_gpll0(priv->base, &gpll0_vote_clk); |
| 113 | clk_enable_cbc(priv->base + SDCC_APPS_CBCR(1)); |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 114 | return rate; |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 115 | case GCC_ETH_RGMII_CLK: |
| 116 | if (rate == 250000000) |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 117 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 118 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 119 | else if (rate == 125000000) |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 120 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 7, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 121 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 122 | else if (rate == 50000000) |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 123 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 19, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 124 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 125 | else if (rate == 5000000) |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 126 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 1, 50, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 127 | CFG_CLK_SRC_GPLL1, 8); |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 128 | return rate; |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 129 | } |
| 130 | |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 131 | /* There is a bug only seeming to affect this board where the MMC driver somehow calls |
| 132 | * clk_set_rate() on a clock with id 0 which is associated with the qcom_clk device. |
| 133 | * The only clock with ID 0 is the xo_board clock which should not be associated with |
| 134 | * this device... |
| 135 | */ |
| 136 | log_debug("Unknown clock id %ld\n", clk->id); |
Sumit Garg | a4a9d9e | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 137 | return 0; |
| 138 | } |
Sumit Garg | c9e384e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 139 | |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 140 | static int qcs404_clk_enable(struct clk *clk) |
Sumit Garg | c9e384e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 141 | { |
Sumit Garg | 968597b | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 142 | struct msm_clk_priv *priv = dev_get_priv(clk->dev); |
| 143 | |
| 144 | switch (clk->id) { |
| 145 | case GCC_USB30_MASTER_CLK: |
| 146 | clk_enable_cbc(priv->base + USB30_MASTER_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 147 | clk_rcg_set_rate_mnd(priv->base, USB30_MASTER_CMD_RCGR, 7, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 148 | CFG_CLK_SRC_GPLL0, 8); |
Sumit Garg | 968597b | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 149 | break; |
| 150 | case GCC_SYS_NOC_USB3_CLK: |
| 151 | clk_enable_cbc(priv->base + SYS_NOC_USB3_CBCR); |
| 152 | break; |
| 153 | case GCC_USB30_SLEEP_CLK: |
| 154 | clk_enable_cbc(priv->base + USB30_SLEEP_CBCR); |
| 155 | break; |
| 156 | case GCC_USB30_MOCK_UTMI_CLK: |
| 157 | clk_enable_cbc(priv->base + USB30_MOCK_UTMI_CBCR); |
| 158 | break; |
| 159 | case GCC_USB_HS_PHY_CFG_AHB_CLK: |
| 160 | clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); |
| 161 | break; |
| 162 | case GCC_USB2A_PHY_SLEEP_CLK: |
| 163 | clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); |
| 164 | break; |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 165 | case GCC_ETH_PTP_CLK: |
| 166 | /* SPEED_1000: freq -> 250MHz */ |
| 167 | clk_enable_cbc(priv->base + ETH_PTP_CBCR); |
| 168 | clk_enable_gpll0(priv->base, &gpll1_vote_clk); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 169 | clk_rcg_set_rate_mnd(priv->base, EMAC_PTP_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 170 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 171 | break; |
| 172 | case GCC_ETH_RGMII_CLK: |
| 173 | /* SPEED_1000: freq -> 250MHz */ |
| 174 | clk_enable_cbc(priv->base + ETH_RGMII_CBCR); |
| 175 | clk_enable_gpll0(priv->base, &gpll1_vote_clk); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 176 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | 6acc443 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 177 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | 71ffa23 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 178 | break; |
| 179 | case GCC_ETH_SLAVE_AHB_CLK: |
| 180 | clk_enable_cbc(priv->base + ETH_SLAVE_AHB_CBCR); |
| 181 | break; |
| 182 | case GCC_ETH_AXI_CLK: |
| 183 | clk_enable_cbc(priv->base + ETH_AXI_CBCR); |
| 184 | break; |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 185 | case GCC_BLSP1_AHB_CLK: |
| 186 | clk_enable_vote_clk(priv->base, &gcc_blsp1_ahb_clk); |
| 187 | break; |
| 188 | case GCC_BLSP1_QUP0_I2C_APPS_CLK: |
| 189 | clk_enable_cbc(priv->base + BLSP1_QUP0_I2C_APPS_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 190 | clk_rcg_set_rate(priv->base, BLSP1_QUP0_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 191 | CFG_CLK_SRC_CXO); |
| 192 | break; |
| 193 | case GCC_BLSP1_QUP1_I2C_APPS_CLK: |
| 194 | clk_enable_cbc(priv->base + BLSP1_QUP1_I2C_APPS_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 195 | clk_rcg_set_rate(priv->base, BLSP1_QUP1_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 196 | CFG_CLK_SRC_CXO); |
| 197 | break; |
| 198 | case GCC_BLSP1_QUP2_I2C_APPS_CLK: |
| 199 | clk_enable_cbc(priv->base + BLSP1_QUP2_I2C_APPS_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 200 | clk_rcg_set_rate(priv->base, BLSP1_QUP2_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 201 | CFG_CLK_SRC_CXO); |
| 202 | break; |
| 203 | case GCC_BLSP1_QUP3_I2C_APPS_CLK: |
| 204 | clk_enable_cbc(priv->base + BLSP1_QUP3_I2C_APPS_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 205 | clk_rcg_set_rate(priv->base, BLSP1_QUP3_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 206 | CFG_CLK_SRC_CXO); |
| 207 | break; |
| 208 | case GCC_BLSP1_QUP4_I2C_APPS_CLK: |
| 209 | clk_enable_cbc(priv->base + BLSP1_QUP4_I2C_APPS_CBCR); |
Caleb Connolly | d33d4e0 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 210 | clk_rcg_set_rate(priv->base, BLSP1_QUP4_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | b97487d | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 211 | CFG_CLK_SRC_CXO); |
| 212 | break; |
Caleb Connolly | 641237b | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 213 | case GCC_SDCC1_AHB_CLK: |
| 214 | clk_enable_cbc(priv->base + SDCC_AHB_CBCR(1)); |
| 215 | break; |
Sumit Garg | 968597b | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 216 | default: |
| 217 | return 0; |
| 218 | } |
| 219 | |
Sumit Garg | c9e384e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 220 | return 0; |
| 221 | } |
Konrad Dybcio | 3ead661 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 222 | |
| 223 | static const struct qcom_reset_map qcs404_gcc_resets[] = { |
| 224 | [GCC_GENI_IR_BCR] = { 0x0F000 }, |
| 225 | [GCC_CDSP_RESTART] = { 0x18000 }, |
| 226 | [GCC_USB_HS_BCR] = { 0x41000 }, |
| 227 | [GCC_USB2_HS_PHY_ONLY_BCR] = { 0x41034 }, |
| 228 | [GCC_QUSB2_PHY_BCR] = { 0x4103c }, |
| 229 | [GCC_USB_HS_PHY_CFG_AHB_BCR] = { 0x0000c, 1 }, |
| 230 | [GCC_USB2A_PHY_BCR] = { 0x0000c, 0 }, |
| 231 | [GCC_USB3_PHY_BCR] = { 0x39004 }, |
| 232 | [GCC_USB_30_BCR] = { 0x39000 }, |
| 233 | [GCC_USB3PHY_PHY_BCR] = { 0x39008 }, |
| 234 | [GCC_PCIE_0_BCR] = { 0x3e000 }, |
| 235 | [GCC_PCIE_0_PHY_BCR] = { 0x3e004 }, |
| 236 | [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x3e038 }, |
| 237 | [GCC_PCIEPHY_0_PHY_BCR] = { 0x3e03c }, |
| 238 | [GCC_PCIE_0_AXI_MASTER_STICKY_ARES] = { 0x3e040, 6}, |
| 239 | [GCC_PCIE_0_AHB_ARES] = { 0x3e040, 5 }, |
| 240 | [GCC_PCIE_0_AXI_SLAVE_ARES] = { 0x3e040, 4 }, |
| 241 | [GCC_PCIE_0_AXI_MASTER_ARES] = { 0x3e040, 3 }, |
| 242 | [GCC_PCIE_0_CORE_STICKY_ARES] = { 0x3e040, 2 }, |
| 243 | [GCC_PCIE_0_SLEEP_ARES] = { 0x3e040, 1 }, |
| 244 | [GCC_PCIE_0_PIPE_ARES] = { 0x3e040, 0 }, |
| 245 | [GCC_EMAC_BCR] = { 0x4e000 }, |
| 246 | [GCC_WDSP_RESTART] = {0x19000}, |
| 247 | }; |
| 248 | |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 249 | static const struct msm_clk_data qcs404_clk_gcc_data = { |
Konrad Dybcio | 3ead661 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 250 | .resets = qcs404_gcc_resets, |
| 251 | .num_resets = ARRAY_SIZE(qcs404_gcc_resets), |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 252 | .enable = qcs404_clk_enable, |
| 253 | .set_rate = qcs404_clk_set_rate, |
Konrad Dybcio | 3ead661 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 254 | }; |
| 255 | |
| 256 | static const struct udevice_id gcc_qcs404_of_match[] = { |
| 257 | { |
| 258 | .compatible = "qcom,gcc-qcs404", |
Caleb Connolly | 37ea134 | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 259 | .data = (ulong)&qcs404_clk_gcc_data |
Konrad Dybcio | 3ead661 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 260 | }, |
| 261 | { } |
| 262 | }; |
| 263 | |
| 264 | U_BOOT_DRIVER(gcc_qcs404) = { |
| 265 | .name = "gcc_qcs404", |
| 266 | .id = UCLASS_NOP, |
| 267 | .of_match = gcc_qcs404_of_match, |
| 268 | .bind = qcom_cc_bind, |
| 269 | .flags = DM_FLAG_PRE_RELOC, |
| 270 | }; |