Sumit Garg | e6a488b | 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 | e6a488b | 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 | 6c0b844 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 13 | #include <dt-bindings/clock/qcom,gcc-qcs404.h> |
| 14 | |
Caleb Connolly | 878b26a | 2023-11-07 12:40:59 +0000 | [diff] [blame] | 15 | #include "clock-qcom.h" |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 16 | |
Caleb Connolly | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 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 | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 45 | #define SDCC_CMD_RCGR(n) (((n + 1) * 0x1000) + 0x41004) |
Caleb Connolly | 10a0abb | 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 | 10a0abb | 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 | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 68 | #define EMAC_CMD_RCGR (0x4e01c) |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 69 | |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 70 | /* GPLL0 clock control registers */ |
| 71 | #define GPLL0_STATUS_ACTIVE BIT(31) |
| 72 | |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 73 | #define CFG_CLK_SRC_GPLL1 BIT(8) |
| 74 | #define GPLL1_STATUS_ACTIVE BIT(31) |
| 75 | |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 76 | static struct vote_clk gcc_blsp1_ahb_clk = { |
| 77 | .cbcr_reg = BLSP1_AHB_CBCR, |
| 78 | .ena_vote = APCS_CLOCK_BRANCH_ENA_VOTE, |
| 79 | .vote_bit = BIT(10) | BIT(5) | BIT(4), |
| 80 | }; |
| 81 | |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 82 | static struct pll_vote_clk gpll0_vote_clk = { |
| 83 | .status = GPLL0_STATUS, |
| 84 | .status_bit = GPLL0_STATUS_ACTIVE, |
| 85 | .ena_vote = APCS_GPLL_ENA_VOTE, |
| 86 | .vote_bit = BIT(0), |
| 87 | }; |
| 88 | |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 89 | static struct pll_vote_clk gpll1_vote_clk = { |
| 90 | .status = GPLL1_STATUS, |
| 91 | .status_bit = GPLL1_STATUS_ACTIVE, |
| 92 | .ena_vote = APCS_GPLL_ENA_VOTE, |
| 93 | .vote_bit = BIT(1), |
| 94 | }; |
| 95 | |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 96 | static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 97 | { |
| 98 | struct msm_clk_priv *priv = dev_get_priv(clk->dev); |
| 99 | |
| 100 | switch (clk->id) { |
| 101 | case GCC_BLSP1_UART2_APPS_CLK: |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 102 | /* UART: 1843200Hz for a fixed 115200 baudrate (19200000 * (12/125)) */ |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 103 | clk_rcg_set_rate_mnd(priv->base, BLSP1_UART2_APPS_CMD_RCGR, 0, 12, 125, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 104 | CFG_CLK_SRC_CXO, 16); |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 105 | clk_enable_cbc(priv->base + BLSP1_UART2_APPS_CBCR); |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 106 | return 1843200; |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 107 | case GCC_SDCC1_APPS_CLK: |
| 108 | /* SDCC1: 200MHz */ |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 109 | clk_rcg_set_rate_mnd(priv->base, SDCC_CMD_RCGR(0), 7, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 110 | CFG_CLK_SRC_GPLL0, 8); |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 111 | clk_enable_gpll0(priv->base, &gpll0_vote_clk); |
| 112 | clk_enable_cbc(priv->base + SDCC_APPS_CBCR(1)); |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 113 | return rate; |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 114 | case GCC_ETH_RGMII_CLK: |
| 115 | if (rate == 250000000) |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 116 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 117 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 118 | else if (rate == 125000000) |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 119 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 7, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 120 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 121 | else if (rate == 50000000) |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 122 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 19, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 123 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 124 | else if (rate == 5000000) |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 125 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 1, 50, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 126 | CFG_CLK_SRC_GPLL1, 8); |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 127 | return rate; |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 128 | } |
| 129 | |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 130 | /* There is a bug only seeming to affect this board where the MMC driver somehow calls |
| 131 | * clk_set_rate() on a clock with id 0 which is associated with the qcom_clk device. |
| 132 | * The only clock with ID 0 is the xo_board clock which should not be associated with |
| 133 | * this device... |
| 134 | */ |
| 135 | log_debug("Unknown clock id %ld\n", clk->id); |
Sumit Garg | e6a488b | 2022-07-12 12:42:11 +0530 | [diff] [blame] | 136 | return 0; |
| 137 | } |
Sumit Garg | 1d1ca6e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 138 | |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 139 | static int qcs404_clk_enable(struct clk *clk) |
Sumit Garg | 1d1ca6e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 140 | { |
Sumit Garg | 3018e52 | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 141 | struct msm_clk_priv *priv = dev_get_priv(clk->dev); |
| 142 | |
| 143 | switch (clk->id) { |
| 144 | case GCC_USB30_MASTER_CLK: |
| 145 | clk_enable_cbc(priv->base + USB30_MASTER_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 146 | clk_rcg_set_rate_mnd(priv->base, USB30_MASTER_CMD_RCGR, 7, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 147 | CFG_CLK_SRC_GPLL0, 8); |
Sumit Garg | 3018e52 | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 148 | break; |
| 149 | case GCC_SYS_NOC_USB3_CLK: |
| 150 | clk_enable_cbc(priv->base + SYS_NOC_USB3_CBCR); |
| 151 | break; |
| 152 | case GCC_USB30_SLEEP_CLK: |
| 153 | clk_enable_cbc(priv->base + USB30_SLEEP_CBCR); |
| 154 | break; |
| 155 | case GCC_USB30_MOCK_UTMI_CLK: |
| 156 | clk_enable_cbc(priv->base + USB30_MOCK_UTMI_CBCR); |
| 157 | break; |
| 158 | case GCC_USB_HS_PHY_CFG_AHB_CLK: |
| 159 | clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); |
| 160 | break; |
| 161 | case GCC_USB2A_PHY_SLEEP_CLK: |
| 162 | clk_enable_cbc(priv->base + USB_HS_PHY_CFG_AHB_CBCR); |
| 163 | break; |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 164 | case GCC_ETH_PTP_CLK: |
| 165 | /* SPEED_1000: freq -> 250MHz */ |
| 166 | clk_enable_cbc(priv->base + ETH_PTP_CBCR); |
| 167 | clk_enable_gpll0(priv->base, &gpll1_vote_clk); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 168 | clk_rcg_set_rate_mnd(priv->base, EMAC_PTP_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 169 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 170 | break; |
| 171 | case GCC_ETH_RGMII_CLK: |
| 172 | /* SPEED_1000: freq -> 250MHz */ |
| 173 | clk_enable_cbc(priv->base + ETH_RGMII_CBCR); |
| 174 | clk_enable_gpll0(priv->base, &gpll1_vote_clk); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 175 | clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, |
Caleb Connolly | fbacc67 | 2023-11-07 12:41:04 +0000 | [diff] [blame] | 176 | CFG_CLK_SRC_GPLL1, 8); |
Sumit Garg | e9e6234 | 2023-02-01 19:28:50 +0530 | [diff] [blame] | 177 | break; |
| 178 | case GCC_ETH_SLAVE_AHB_CLK: |
| 179 | clk_enable_cbc(priv->base + ETH_SLAVE_AHB_CBCR); |
| 180 | break; |
| 181 | case GCC_ETH_AXI_CLK: |
| 182 | clk_enable_cbc(priv->base + ETH_AXI_CBCR); |
| 183 | break; |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 184 | case GCC_BLSP1_AHB_CLK: |
| 185 | clk_enable_vote_clk(priv->base, &gcc_blsp1_ahb_clk); |
| 186 | break; |
| 187 | case GCC_BLSP1_QUP0_I2C_APPS_CLK: |
| 188 | clk_enable_cbc(priv->base + BLSP1_QUP0_I2C_APPS_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 189 | clk_rcg_set_rate(priv->base, BLSP1_QUP0_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 190 | CFG_CLK_SRC_CXO); |
| 191 | break; |
| 192 | case GCC_BLSP1_QUP1_I2C_APPS_CLK: |
| 193 | clk_enable_cbc(priv->base + BLSP1_QUP1_I2C_APPS_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 194 | clk_rcg_set_rate(priv->base, BLSP1_QUP1_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 195 | CFG_CLK_SRC_CXO); |
| 196 | break; |
| 197 | case GCC_BLSP1_QUP2_I2C_APPS_CLK: |
| 198 | clk_enable_cbc(priv->base + BLSP1_QUP2_I2C_APPS_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 199 | clk_rcg_set_rate(priv->base, BLSP1_QUP2_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 200 | CFG_CLK_SRC_CXO); |
| 201 | break; |
| 202 | case GCC_BLSP1_QUP3_I2C_APPS_CLK: |
| 203 | clk_enable_cbc(priv->base + BLSP1_QUP3_I2C_APPS_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 204 | clk_rcg_set_rate(priv->base, BLSP1_QUP3_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 205 | CFG_CLK_SRC_CXO); |
| 206 | break; |
| 207 | case GCC_BLSP1_QUP4_I2C_APPS_CLK: |
| 208 | clk_enable_cbc(priv->base + BLSP1_QUP4_I2C_APPS_CBCR); |
Caleb Connolly | cbdad44 | 2024-04-03 14:07:40 +0200 | [diff] [blame] | 209 | clk_rcg_set_rate(priv->base, BLSP1_QUP4_I2C_APPS_CMD_RCGR, 0, |
Sumit Garg | 89e0dff | 2023-02-13 10:19:09 +0530 | [diff] [blame] | 210 | CFG_CLK_SRC_CXO); |
| 211 | break; |
Caleb Connolly | d718e3e | 2024-02-26 17:26:10 +0000 | [diff] [blame] | 212 | case GCC_SDCC1_AHB_CLK: |
| 213 | clk_enable_cbc(priv->base + SDCC_AHB_CBCR(1)); |
| 214 | break; |
Sumit Garg | 3018e52 | 2022-08-04 19:57:15 +0530 | [diff] [blame] | 215 | default: |
| 216 | return 0; |
| 217 | } |
| 218 | |
Sumit Garg | 1d1ca6e | 2022-08-04 19:57:14 +0530 | [diff] [blame] | 219 | return 0; |
| 220 | } |
Konrad Dybcio | 6c0b844 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 221 | |
| 222 | static const struct qcom_reset_map qcs404_gcc_resets[] = { |
| 223 | [GCC_GENI_IR_BCR] = { 0x0F000 }, |
| 224 | [GCC_CDSP_RESTART] = { 0x18000 }, |
| 225 | [GCC_USB_HS_BCR] = { 0x41000 }, |
| 226 | [GCC_USB2_HS_PHY_ONLY_BCR] = { 0x41034 }, |
| 227 | [GCC_QUSB2_PHY_BCR] = { 0x4103c }, |
| 228 | [GCC_USB_HS_PHY_CFG_AHB_BCR] = { 0x0000c, 1 }, |
| 229 | [GCC_USB2A_PHY_BCR] = { 0x0000c, 0 }, |
| 230 | [GCC_USB3_PHY_BCR] = { 0x39004 }, |
| 231 | [GCC_USB_30_BCR] = { 0x39000 }, |
| 232 | [GCC_USB3PHY_PHY_BCR] = { 0x39008 }, |
| 233 | [GCC_PCIE_0_BCR] = { 0x3e000 }, |
| 234 | [GCC_PCIE_0_PHY_BCR] = { 0x3e004 }, |
| 235 | [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x3e038 }, |
| 236 | [GCC_PCIEPHY_0_PHY_BCR] = { 0x3e03c }, |
| 237 | [GCC_PCIE_0_AXI_MASTER_STICKY_ARES] = { 0x3e040, 6}, |
| 238 | [GCC_PCIE_0_AHB_ARES] = { 0x3e040, 5 }, |
| 239 | [GCC_PCIE_0_AXI_SLAVE_ARES] = { 0x3e040, 4 }, |
| 240 | [GCC_PCIE_0_AXI_MASTER_ARES] = { 0x3e040, 3 }, |
| 241 | [GCC_PCIE_0_CORE_STICKY_ARES] = { 0x3e040, 2 }, |
| 242 | [GCC_PCIE_0_SLEEP_ARES] = { 0x3e040, 1 }, |
| 243 | [GCC_PCIE_0_PIPE_ARES] = { 0x3e040, 0 }, |
| 244 | [GCC_EMAC_BCR] = { 0x4e000 }, |
| 245 | [GCC_WDSP_RESTART] = {0x19000}, |
| 246 | }; |
| 247 | |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 248 | static const struct msm_clk_data qcs404_clk_gcc_data = { |
Konrad Dybcio | 6c0b844 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 249 | .resets = qcs404_gcc_resets, |
| 250 | .num_resets = ARRAY_SIZE(qcs404_gcc_resets), |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 251 | .enable = qcs404_clk_enable, |
| 252 | .set_rate = qcs404_clk_set_rate, |
Konrad Dybcio | 6c0b844 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 253 | }; |
| 254 | |
| 255 | static const struct udevice_id gcc_qcs404_of_match[] = { |
| 256 | { |
| 257 | .compatible = "qcom,gcc-qcs404", |
Caleb Connolly | 10a0abb | 2023-11-07 12:41:03 +0000 | [diff] [blame] | 258 | .data = (ulong)&qcs404_clk_gcc_data |
Konrad Dybcio | 6c0b844 | 2023-11-07 12:41:01 +0000 | [diff] [blame] | 259 | }, |
| 260 | { } |
| 261 | }; |
| 262 | |
| 263 | U_BOOT_DRIVER(gcc_qcs404) = { |
| 264 | .name = "gcc_qcs404", |
| 265 | .id = UCLASS_NOP, |
| 266 | .of_match = gcc_qcs404_of_match, |
| 267 | .bind = qcom_cc_bind, |
| 268 | .flags = DM_FLAG_PRE_RELOC, |
| 269 | }; |