Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (c) 2020 Rockchip Electronics Co. Ltd. |
| 4 | * Author: Elaine Zhang <zhangqing@rock-chips.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef _ASM_ARCH_CRU_RK3588_H |
| 8 | #define _ASM_ARCH_CRU_RK3588_H |
| 9 | |
| 10 | #define MHz 1000000 |
| 11 | #define KHz 1000 |
| 12 | #define OSC_HZ (24 * MHz) |
| 13 | |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 14 | #define LPLL_HZ (816 * MHz) |
| 15 | #define GPLL_HZ (1188 * MHz) |
| 16 | #define CPLL_HZ (1500 * MHz) |
| 17 | #define NPLL_HZ (850 * MHz) |
| 18 | #define PPLL_HZ (1100 * MHz) |
Jonas Karlman | b450590 | 2023-04-17 19:07:20 +0000 | [diff] [blame] | 19 | #define SPLL_HZ (702 * MHz) |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 20 | |
| 21 | /* RK3588 pll id */ |
| 22 | enum rk3588_pll_id { |
| 23 | B0PLL, |
| 24 | B1PLL, |
| 25 | LPLL, |
| 26 | CPLL, |
| 27 | GPLL, |
| 28 | NPLL, |
| 29 | V0PLL, |
| 30 | AUPLL, |
| 31 | PPLL, |
Heiko Stuebner | 166a047 | 2024-05-22 19:31:29 +0200 | [diff] [blame^] | 32 | SPLL, |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 33 | PLL_COUNT, |
| 34 | }; |
| 35 | |
| 36 | struct rk3588_clk_info { |
| 37 | unsigned long id; |
| 38 | char *name; |
| 39 | bool is_cru; |
| 40 | }; |
| 41 | |
| 42 | struct rk3588_clk_priv { |
| 43 | struct rk3588_cru *cru; |
| 44 | struct rk3588_grf *grf; |
| 45 | ulong ppll_hz; |
| 46 | ulong gpll_hz; |
| 47 | ulong cpll_hz; |
| 48 | ulong npll_hz; |
| 49 | ulong v0pll_hz; |
| 50 | ulong aupll_hz; |
| 51 | ulong armclk_hz; |
| 52 | ulong armclk_enter_hz; |
| 53 | ulong armclk_init_hz; |
| 54 | bool sync_kernel; |
| 55 | bool set_armclk_rate; |
| 56 | }; |
| 57 | |
| 58 | struct rk3588_pll { |
| 59 | unsigned int con0; |
| 60 | unsigned int con1; |
| 61 | unsigned int con2; |
| 62 | unsigned int con3; |
| 63 | unsigned int con4; |
| 64 | unsigned int reserved0[3]; |
| 65 | }; |
| 66 | |
Quentin Schulz | 29e289c | 2024-03-11 13:01:55 +0100 | [diff] [blame] | 67 | #define CRU_BASE 0xfd7c0000 |
| 68 | |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 69 | struct rk3588_cru { |
| 70 | struct rk3588_pll pll[18]; |
| 71 | unsigned int reserved0[16];/* Address Offset: 0x0240 */ |
| 72 | unsigned int mode_con00;/* Address Offset: 0x0280 */ |
| 73 | unsigned int reserved1[31];/* Address Offset: 0x0284 */ |
| 74 | unsigned int clksel_con[178]; /* Address Offset: 0x0300 */ |
| 75 | unsigned int reserved2[142];/* Address Offset: 0x05c8 */ |
| 76 | unsigned int clkgate_con[78];/* Address Offset: 0x0800 */ |
| 77 | unsigned int reserved3[50];/* Address Offset: 0x0938 */ |
| 78 | unsigned int softrst_con[78];/* Address Offset: 0x0400 */ |
| 79 | unsigned int reserved4[50];/* Address Offset: 0x0b38 */ |
| 80 | unsigned int glb_cnt_th;/* Address Offset: 0x0c00 */ |
| 81 | unsigned int glb_rst_st;/* Address Offset: 0x0c04 */ |
| 82 | unsigned int glb_srst_fst;/* Address Offset: 0x0c08 */ |
| 83 | unsigned int glb_srsr_snd; /* Address Offset: 0x0c0c */ |
| 84 | unsigned int glb_rst_con;/* Address Offset: 0x0c10 */ |
| 85 | unsigned int reserved5[4];/* Address Offset: 0x0c14 */ |
| 86 | unsigned int sdio_con[2];/* Address Offset: 0x0c24 */ |
| 87 | unsigned int reserved7;/* Address Offset: 0x0c2c */ |
| 88 | unsigned int sdmmc_con[2];/* Address Offset: 0x0c30 */ |
| 89 | unsigned int reserved8[48562];/* Address Offset: 0x0c38 */ |
| 90 | unsigned int pmuclksel_con[21]; /* Address Offset: 0x0100 */ |
| 91 | unsigned int reserved9[299];/* Address Offset: 0x0c38 */ |
| 92 | unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */ |
| 93 | }; |
| 94 | |
| 95 | check_member(rk3588_cru, mode_con00, 0x280); |
| 96 | check_member(rk3588_cru, pmuclksel_con[1], 0x30304); |
| 97 | |
| 98 | struct pll_rate_table { |
| 99 | unsigned long rate; |
| 100 | unsigned int m; |
| 101 | unsigned int p; |
| 102 | unsigned int s; |
| 103 | unsigned int k; |
| 104 | }; |
| 105 | |
| 106 | #define RK3588_PLL_CON(x) ((x) * 0x4) |
| 107 | #define RK3588_MODE_CON 0x280 |
| 108 | |
| 109 | #define RK3588_PHP_CRU_BASE 0x8000 |
| 110 | #define RK3588_PMU_CRU_BASE 0x30000 |
| 111 | #define RK3588_BIGCORE0_CRU_BASE 0x50000 |
| 112 | #define RK3588_BIGCORE1_CRU_BASE 0x52000 |
| 113 | #define RK3588_DSU_CRU_BASE 0x58000 |
| 114 | |
| 115 | #define RK3588_PLL_CON(x) ((x) * 0x4) |
| 116 | #define RK3588_MODE_CON0 0x280 |
| 117 | #define RK3588_CLKSEL_CON(x) ((x) * 0x4 + 0x300) |
| 118 | #define RK3588_CLKGATE_CON(x) ((x) * 0x4 + 0x800) |
| 119 | #define RK3588_SOFTRST_CON(x) ((x) * 0x4 + 0xa00) |
| 120 | #define RK3588_GLB_CNT_TH 0xc00 |
| 121 | #define RK3588_GLB_SRST_FST 0xc08 |
| 122 | #define RK3588_GLB_SRST_SND 0xc0c |
| 123 | #define RK3588_GLB_RST_CON 0xc10 |
| 124 | #define RK3588_GLB_RST_ST 0xc04 |
| 125 | #define RK3588_SDIO_CON0 0xC24 |
| 126 | #define RK3588_SDIO_CON1 0xC28 |
| 127 | #define RK3588_SDMMC_CON0 0xC30 |
| 128 | #define RK3588_SDMMC_CON1 0xC34 |
| 129 | |
| 130 | #define RK3588_PHP_CLKGATE_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE + 0x800) |
| 131 | #define RK3588_PHP_SOFTRST_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE + 0xa00) |
| 132 | |
| 133 | #define RK3588_PMU_PLL_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE) |
| 134 | #define RK3588_PMU_CLKSEL_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0x300) |
| 135 | #define RK3588_PMU_CLKGATE_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0x800) |
| 136 | #define RK3588_PMU_SOFTRST_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0xa00) |
| 137 | |
| 138 | #define RK3588_B0_PLL_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE) |
| 139 | #define RK3588_B0_PLL_MODE_CON (RK3588_BIGCORE0_CRU_BASE + 0x280) |
| 140 | #define RK3588_BIGCORE0_CLKSEL_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0x300) |
| 141 | #define RK3588_BIGCORE0_CLKGATE_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0x800) |
| 142 | #define RK3588_BIGCORE0_SOFTRST_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0xa00) |
| 143 | #define RK3588_B1_PLL_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE) |
| 144 | #define RK3588_B1_PLL_MODE_CON (RK3588_BIGCORE1_CRU_BASE + 0x280) |
| 145 | #define RK3588_BIGCORE1_CLKSEL_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0x300) |
| 146 | #define RK3588_BIGCORE1_CLKGATE_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0x800) |
| 147 | #define RK3588_BIGCORE1_SOFTRST_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0xa00) |
| 148 | #define RK3588_LPLL_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE) |
| 149 | #define RK3588_LPLL_MODE_CON (RK3588_DSU_CRU_BASE + 0x280) |
| 150 | #define RK3588_DSU_CLKSEL_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0x300) |
| 151 | #define RK3588_DSU_CLKGATE_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0x800) |
| 152 | #define RK3588_DSU_SOFTRST_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0xa00) |
| 153 | |
Heiko Stuebner | 166a047 | 2024-05-22 19:31:29 +0200 | [diff] [blame^] | 154 | #define RK3588_SBUSCRU_SPLL_CON(x) ((x) * 0x4 + 0x220) |
| 155 | #define RK3588_SBUSCRU_MODE_CON0 0x280 |
| 156 | |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 157 | enum { |
| 158 | /* CRU_CLK_SEL8_CON */ |
| 159 | ACLK_LOW_TOP_ROOT_SRC_SEL_SHIFT = 14, |
| 160 | ACLK_LOW_TOP_ROOT_SRC_SEL_MASK = 1 << ACLK_LOW_TOP_ROOT_SRC_SEL_SHIFT, |
| 161 | ACLK_LOW_TOP_ROOT_SRC_SEL_GPLL = 0, |
| 162 | ACLK_LOW_TOP_ROOT_SRC_SEL_CPLL, |
| 163 | ACLK_LOW_TOP_ROOT_DIV_SHIFT = 9, |
| 164 | ACLK_LOW_TOP_ROOT_DIV_MASK = 0x1f << ACLK_LOW_TOP_ROOT_DIV_SHIFT, |
| 165 | PCLK_TOP_ROOT_SEL_SHIFT = 7, |
| 166 | PCLK_TOP_ROOT_SEL_MASK = 3 << PCLK_TOP_ROOT_SEL_SHIFT, |
| 167 | PCLK_TOP_ROOT_SEL_100M = 0, |
| 168 | PCLK_TOP_ROOT_SEL_50M, |
| 169 | PCLK_TOP_ROOT_SEL_24M, |
| 170 | ACLK_TOP_ROOT_SRC_SEL_SHIFT = 5, |
| 171 | ACLK_TOP_ROOT_SRC_SEL_MASK = 3 << ACLK_TOP_ROOT_SRC_SEL_SHIFT, |
| 172 | ACLK_TOP_ROOT_SRC_SEL_GPLL = 0, |
| 173 | ACLK_TOP_ROOT_SRC_SEL_CPLL, |
| 174 | ACLK_TOP_ROOT_SRC_SEL_AUPLL, |
| 175 | ACLK_TOP_ROOT_DIV_SHIFT = 0, |
| 176 | ACLK_TOP_ROOT_DIV_MASK = 0x1f << ACLK_TOP_ROOT_DIV_SHIFT, |
| 177 | |
| 178 | /* CRU_CLK_SEL9_CON */ |
| 179 | ACLK_TOP_S400_SEL_SHIFT = 8, |
| 180 | ACLK_TOP_S400_SEL_MASK = 3 << ACLK_TOP_S400_SEL_SHIFT, |
| 181 | ACLK_TOP_S400_SEL_400M = 0, |
| 182 | ACLK_TOP_S400_SEL_200M, |
| 183 | ACLK_TOP_S200_SEL_SHIFT = 6, |
| 184 | ACLK_TOP_S200_SEL_MASK = 3 << ACLK_TOP_S200_SEL_SHIFT, |
| 185 | ACLK_TOP_S200_SEL_200M = 0, |
| 186 | ACLK_TOP_S200_SEL_100M, |
| 187 | |
| 188 | /* CRU_CLK_SEL38_CON */ |
| 189 | CLK_I2C8_SEL_SHIFT = 13, |
| 190 | CLK_I2C8_SEL_MASK = 1 << CLK_I2C8_SEL_SHIFT, |
| 191 | CLK_I2C7_SEL_SHIFT = 12, |
| 192 | CLK_I2C7_SEL_MASK = 1 << CLK_I2C7_SEL_SHIFT, |
| 193 | CLK_I2C6_SEL_SHIFT = 11, |
| 194 | CLK_I2C6_SEL_MASK = 1 << CLK_I2C6_SEL_SHIFT, |
| 195 | CLK_I2C5_SEL_SHIFT = 10, |
| 196 | CLK_I2C5_SEL_MASK = 1 << CLK_I2C5_SEL_SHIFT, |
| 197 | CLK_I2C4_SEL_SHIFT = 9, |
| 198 | CLK_I2C4_SEL_MASK = 1 << CLK_I2C4_SEL_SHIFT, |
| 199 | CLK_I2C3_SEL_SHIFT = 8, |
| 200 | CLK_I2C3_SEL_MASK = 1 << CLK_I2C3_SEL_SHIFT, |
| 201 | CLK_I2C2_SEL_SHIFT = 7, |
| 202 | CLK_I2C2_SEL_MASK = 1 << CLK_I2C2_SEL_SHIFT, |
| 203 | CLK_I2C1_SEL_SHIFT = 6, |
| 204 | CLK_I2C1_SEL_MASK = 1 << CLK_I2C1_SEL_SHIFT, |
| 205 | ACLK_BUS_ROOT_SEL_SHIFT = 5, |
| 206 | ACLK_BUS_ROOT_SEL_MASK = 3 << ACLK_BUS_ROOT_SEL_SHIFT, |
| 207 | ACLK_BUS_ROOT_SEL_GPLL = 0, |
| 208 | ACLK_BUS_ROOT_SEL_CPLL, |
| 209 | ACLK_BUS_ROOT_DIV_SHIFT = 0, |
| 210 | ACLK_BUS_ROOT_DIV_MASK = 0x1f << ACLK_BUS_ROOT_DIV_SHIFT, |
| 211 | |
| 212 | /* CRU_CLK_SEL40_CON */ |
| 213 | CLK_SARADC_SEL_SHIFT = 14, |
| 214 | CLK_SARADC_SEL_MASK = 0x1 << CLK_SARADC_SEL_SHIFT, |
| 215 | CLK_SARADC_SEL_GPLL = 0, |
| 216 | CLK_SARADC_SEL_24M, |
| 217 | CLK_SARADC_DIV_SHIFT = 6, |
| 218 | CLK_SARADC_DIV_MASK = 0xff << CLK_SARADC_DIV_SHIFT, |
| 219 | |
| 220 | /* CRU_CLK_SEL41_CON */ |
| 221 | CLK_UART_SRC_SEL_SHIFT = 14, |
| 222 | CLK_UART_SRC_SEL_MASK = 0x1 << CLK_UART_SRC_SEL_SHIFT, |
| 223 | CLK_UART_SRC_SEL_GPLL = 0, |
| 224 | CLK_UART_SRC_SEL_CPLL, |
| 225 | CLK_UART_SRC_DIV_SHIFT = 9, |
| 226 | CLK_UART_SRC_DIV_MASK = 0x1f << CLK_UART_SRC_DIV_SHIFT, |
| 227 | CLK_TSADC_SEL_SHIFT = 8, |
| 228 | CLK_TSADC_SEL_MASK = 0x1 << CLK_TSADC_SEL_SHIFT, |
| 229 | CLK_TSADC_SEL_GPLL = 0, |
| 230 | CLK_TSADC_SEL_24M, |
| 231 | CLK_TSADC_DIV_SHIFT = 0, |
| 232 | CLK_TSADC_DIV_MASK = 0xff << CLK_TSADC_DIV_SHIFT, |
| 233 | |
| 234 | /* CRU_CLK_SEL42_CON */ |
| 235 | CLK_UART_FRAC_NUMERATOR_SHIFT = 16, |
| 236 | CLK_UART_FRAC_NUMERATOR_MASK = 0xffff << 16, |
| 237 | CLK_UART_FRAC_DENOMINATOR_SHIFT = 0, |
| 238 | CLK_UART_FRAC_DENOMINATOR_MASK = 0xffff, |
| 239 | |
| 240 | /* CRU_CLK_SEL43_CON */ |
| 241 | CLK_UART_SEL_SHIFT = 0, |
| 242 | CLK_UART_SEL_MASK = 0x3 << CLK_UART_SEL_SHIFT, |
| 243 | CLK_UART_SEL_SRC = 0, |
| 244 | CLK_UART_SEL_FRAC, |
| 245 | CLK_UART_SEL_XIN24M, |
| 246 | |
| 247 | /* CRU_CLK_SEL59_CON */ |
| 248 | CLK_PWM2_SEL_SHIFT = 14, |
| 249 | CLK_PWM2_SEL_MASK = 3 << CLK_PWM2_SEL_SHIFT, |
| 250 | CLK_PWM1_SEL_SHIFT = 12, |
| 251 | CLK_PWM1_SEL_MASK = 3 << CLK_PWM1_SEL_SHIFT, |
| 252 | CLK_SPI4_SEL_SHIFT = 10, |
| 253 | CLK_SPI4_SEL_MASK = 3 << CLK_SPI4_SEL_SHIFT, |
| 254 | CLK_SPI3_SEL_SHIFT = 8, |
| 255 | CLK_SPI3_SEL_MASK = 3 << CLK_SPI3_SEL_SHIFT, |
| 256 | CLK_SPI2_SEL_SHIFT = 6, |
| 257 | CLK_SPI2_SEL_MASK = 3 << CLK_SPI2_SEL_SHIFT, |
| 258 | CLK_SPI1_SEL_SHIFT = 4, |
| 259 | CLK_SPI1_SEL_MASK = 3 << CLK_SPI1_SEL_SHIFT, |
| 260 | CLK_SPI0_SEL_SHIFT = 2, |
| 261 | CLK_SPI0_SEL_MASK = 3 << CLK_SPI0_SEL_SHIFT, |
| 262 | CLK_SPI_SEL_200M = 0, |
| 263 | CLK_SPI_SEL_150M, |
| 264 | CLK_SPI_SEL_24M, |
| 265 | |
| 266 | /* CRU_CLK_SEL60_CON */ |
| 267 | CLK_PWM3_SEL_SHIFT = 0, |
| 268 | CLK_PWM3_SEL_MASK = 3 << CLK_PWM3_SEL_SHIFT, |
| 269 | CLK_PWM_SEL_100M = 0, |
| 270 | CLK_PWM_SEL_50M, |
| 271 | CLK_PWM_SEL_24M, |
| 272 | |
| 273 | /* CRU_CLK_SEL62_CON */ |
| 274 | DCLK_DECOM_SEL_SHIFT = 5, |
| 275 | DCLK_DECOM_SEL_MASK = 1 << DCLK_DECOM_SEL_SHIFT, |
| 276 | DCLK_DECOM_SEL_GPLL = 0, |
| 277 | DCLK_DECOM_SEL_SPLL, |
| 278 | DCLK_DECOM_DIV_SHIFT = 0, |
| 279 | DCLK_DECOM_DIV_MASK = 0x1F << DCLK_DECOM_DIV_SHIFT, |
| 280 | |
| 281 | /* CRU_CLK_SEL77_CON */ |
| 282 | CCLK_EMMC_SEL_SHIFT = 14, |
| 283 | CCLK_EMMC_SEL_MASK = 3 << CCLK_EMMC_SEL_SHIFT, |
| 284 | CCLK_EMMC_SEL_GPLL = 0, |
| 285 | CCLK_EMMC_SEL_CPLL, |
| 286 | CCLK_EMMC_SEL_24M, |
| 287 | CCLK_EMMC_DIV_SHIFT = 8, |
| 288 | CCLK_EMMC_DIV_MASK = 0x3f << CCLK_EMMC_DIV_SHIFT, |
| 289 | |
| 290 | /* CRU_CLK_SEL78_CON */ |
| 291 | SCLK_SFC_SEL_SHIFT = 12, |
| 292 | SCLK_SFC_SEL_MASK = 3 << SCLK_SFC_SEL_SHIFT, |
| 293 | SCLK_SFC_SEL_GPLL = 0, |
| 294 | SCLK_SFC_SEL_CPLL, |
| 295 | SCLK_SFC_SEL_24M, |
| 296 | SCLK_SFC_DIV_SHIFT = 6, |
| 297 | SCLK_SFC_DIV_MASK = 0x3f << SCLK_SFC_DIV_SHIFT, |
| 298 | BCLK_EMMC_SEL_SHIFT = 5, |
| 299 | BCLK_EMMC_SEL_MASK = 1 << BCLK_EMMC_SEL_SHIFT, |
| 300 | BCLK_EMMC_SEL_GPLL = 0, |
| 301 | BCLK_EMMC_SEL_CPLL, |
| 302 | BCLK_EMMC_DIV_SHIFT = 0, |
| 303 | BCLK_EMMC_DIV_MASK = 0x1f << BCLK_EMMC_DIV_SHIFT, |
| 304 | |
| 305 | /* CRU_CLK_SEL81_CON */ |
| 306 | CLK_GMAC1_PTP_SEL_SHIFT = 13, |
| 307 | CLK_GMAC1_PTP_SEL_MASK = 1 << CLK_GMAC1_PTP_SEL_SHIFT, |
| 308 | CLK_GMAC1_PTP_SEL_CPLL = 0, |
| 309 | CLK_GMAC1_PTP_DIV_SHIFT = 7, |
| 310 | CLK_GMAC1_PTP_DIV_MASK = 0x3f << CLK_GMAC1_PTP_DIV_SHIFT, |
| 311 | CLK_GMAC0_PTP_SEL_SHIFT = 6, |
| 312 | CLK_GMAC0_PTP_SEL_MASK = 1 << CLK_GMAC0_PTP_SEL_SHIFT, |
| 313 | CLK_GMAC0_PTP_SEL_CPLL = 0, |
| 314 | CLK_GMAC0_PTP_DIV_SHIFT = 0, |
| 315 | CLK_GMAC0_PTP_DIV_MASK = 0x3f << CLK_GMAC0_PTP_DIV_SHIFT, |
| 316 | |
| 317 | /* CRU_CLK_SEL83_CON */ |
| 318 | CLK_GMAC_125M_SEL_SHIFT = 15, |
| 319 | CLK_GMAC_125M_SEL_MASK = 1 << CLK_GMAC_125M_SEL_SHIFT, |
| 320 | CLK_GMAC_125M_SEL_GPLL = 0, |
| 321 | CLK_GMAC_125M_SEL_CPLL, |
| 322 | CLK_GMAC_125M_DIV_SHIFT = 8, |
| 323 | CLK_GMAC_125M_DIV_MASK = 0x7f << CLK_GMAC_125M_DIV_SHIFT, |
| 324 | |
| 325 | /* CRU_CLK_SEL84_CON */ |
| 326 | CLK_GMAC_50M_SEL_SHIFT = 7, |
| 327 | CLK_GMAC_50M_SEL_MASK = 1 << CLK_GMAC_50M_SEL_SHIFT, |
| 328 | CLK_GMAC_50M_SEL_GPLL = 0, |
| 329 | CLK_GMAC_50M_SEL_CPLL, |
| 330 | CLK_GMAC_50M_DIV_SHIFT = 0, |
| 331 | CLK_GMAC_50M_DIV_MASK = 0x7f << CLK_GMAC_50M_DIV_SHIFT, |
| 332 | |
| 333 | /* CRU_CLK_SEL110_CON */ |
| 334 | HCLK_VOP_ROOT_SEL_SHIFT = 10, |
| 335 | HCLK_VOP_ROOT_SEL_MASK = 3 << HCLK_VOP_ROOT_SEL_SHIFT, |
| 336 | HCLK_VOP_ROOT_SEL_200M = 0, |
| 337 | HCLK_VOP_ROOT_SEL_100M, |
| 338 | HCLK_VOP_ROOT_SEL_50M, |
| 339 | HCLK_VOP_ROOT_SEL_24M, |
| 340 | ACLK_VOP_LOW_ROOT_SEL_SHIFT = 8, |
| 341 | ACLK_VOP_LOW_ROOT_SEL_MASK = 3 << ACLK_VOP_LOW_ROOT_SEL_SHIFT, |
| 342 | ACLK_VOP_LOW_ROOT_SEL_400M = 0, |
| 343 | ACLK_VOP_LOW_ROOT_SEL_200M, |
| 344 | ACLK_VOP_LOW_ROOT_SEL_100M, |
| 345 | ACLK_VOP_LOW_ROOT_SEL_24M, |
| 346 | ACLK_VOP_ROOT_SEL_SHIFT = 5, |
| 347 | ACLK_VOP_ROOT_SEL_MASK = 3 << ACLK_VOP_ROOT_SEL_SHIFT, |
| 348 | ACLK_VOP_ROOT_SEL_GPLL = 0, |
| 349 | ACLK_VOP_ROOT_SEL_CPLL, |
| 350 | ACLK_VOP_ROOT_SEL_AUPLL, |
| 351 | ACLK_VOP_ROOT_SEL_NPLL, |
| 352 | ACLK_VOP_ROOT_SEL_SPLL, |
| 353 | ACLK_VOP_ROOT_DIV_SHIFT = 0, |
| 354 | ACLK_VOP_ROOT_DIV_MASK = 0x1f << ACLK_VOP_ROOT_DIV_SHIFT, |
| 355 | |
| 356 | /* CRU_CLK_SEL111_CON */ |
| 357 | DCLK1_VOP_SRC_SEL_SHIFT = 14, |
| 358 | DCLK1_VOP_SRC_SEL_MASK = 3 << DCLK1_VOP_SRC_SEL_SHIFT, |
| 359 | DCLK1_VOP_SRC_DIV_SHIFT = 9, |
| 360 | DCLK1_VOP_SRC_DIV_MASK = 0x1f << DCLK1_VOP_SRC_DIV_SHIFT, |
| 361 | DCLK0_VOP_SRC_SEL_SHIFT = 7, |
| 362 | DCLK0_VOP_SRC_SEL_MASK = 3 << DCLK0_VOP_SRC_SEL_SHIFT, |
| 363 | DCLK_VOP_SRC_SEL_GPLL = 0, |
| 364 | DCLK_VOP_SRC_SEL_CPLL, |
| 365 | DCLK_VOP_SRC_SEL_V0PLL, |
| 366 | DCLK_VOP_SRC_SEL_AUPLL, |
| 367 | DCLK0_VOP_SRC_DIV_SHIFT = 0, |
| 368 | DCLK0_VOP_SRC_DIV_MASK = 0x7f << DCLK0_VOP_SRC_DIV_SHIFT, |
| 369 | |
| 370 | /* CRU_CLK_SEL112_CON */ |
| 371 | DCLK2_VOP_SEL_SHIFT = 11, |
| 372 | DCLK2_VOP_SEL_MASK = 3 << DCLK2_VOP_SEL_SHIFT, |
| 373 | DCLK1_VOP_SEL_SHIFT = 9, |
| 374 | DCLK1_VOP_SEL_MASK = 3 << DCLK1_VOP_SEL_SHIFT, |
| 375 | DCLK0_VOP_SEL_SHIFT = 7, |
| 376 | DCLK0_VOP_SEL_MASK = 3 << DCLK0_VOP_SEL_SHIFT, |
| 377 | DCLK2_VOP_SRC_SEL_SHIFT = 5, |
| 378 | DCLK2_VOP_SRC_SEL_MASK = 3 << DCLK2_VOP_SRC_SEL_SHIFT, |
| 379 | DCLK2_VOP_SRC_DIV_SHIFT = 0, |
| 380 | DCLK2_VOP_SRC_DIV_MASK = 0x1f << DCLK2_VOP_SRC_DIV_SHIFT, |
| 381 | |
| 382 | /* CRU_CLK_SEL113_CON */ |
| 383 | DCLK3_VOP_SRC_SEL_SHIFT = 7, |
| 384 | DCLK3_VOP_SRC_SEL_MASK = 3 << DCLK3_VOP_SRC_SEL_SHIFT, |
| 385 | DCLK3_VOP_SRC_DIV_SHIFT = 0, |
| 386 | DCLK3_VOP_SRC_DIV_MASK = 0x7f << DCLK3_VOP_SRC_DIV_SHIFT, |
| 387 | |
| 388 | /* CRU_CLK_SEL117_CON */ |
| 389 | CLK_AUX16MHZ_1_DIV_SHIFT = 8, |
| 390 | CLK_AUX16MHZ_1_DIV_MASK = 0xff << CLK_AUX16MHZ_1_DIV_SHIFT, |
| 391 | CLK_AUX16MHZ_0_DIV_SHIFT = 0, |
| 392 | CLK_AUX16MHZ_0_DIV_MASK = 0xff << CLK_AUX16MHZ_0_DIV_SHIFT, |
| 393 | |
| 394 | /* CRU_CLK_SEL165_CON */ |
| 395 | PCLK_CENTER_ROOT_SEL_SHIFT = 6, |
| 396 | PCLK_CENTER_ROOT_SEL_MASK = 3 << PCLK_CENTER_ROOT_SEL_SHIFT, |
| 397 | PCLK_CENTER_ROOT_SEL_200M = 0, |
| 398 | PCLK_CENTER_ROOT_SEL_100M, |
| 399 | PCLK_CENTER_ROOT_SEL_50M, |
| 400 | PCLK_CENTER_ROOT_SEL_24M, |
| 401 | HCLK_CENTER_ROOT_SEL_SHIFT = 4, |
| 402 | HCLK_CENTER_ROOT_SEL_MASK = 3 << HCLK_CENTER_ROOT_SEL_SHIFT, |
| 403 | HCLK_CENTER_ROOT_SEL_400M = 0, |
| 404 | HCLK_CENTER_ROOT_SEL_200M, |
| 405 | HCLK_CENTER_ROOT_SEL_100M, |
| 406 | HCLK_CENTER_ROOT_SEL_24M, |
| 407 | ACLK_CENTER_LOW_ROOT_SEL_SHIFT = 2, |
| 408 | ACLK_CENTER_LOW_ROOT_SEL_MASK = 3 << ACLK_CENTER_LOW_ROOT_SEL_SHIFT, |
| 409 | ACLK_CENTER_LOW_ROOT_SEL_500M = 0, |
| 410 | ACLK_CENTER_LOW_ROOT_SEL_250M, |
| 411 | ACLK_CENTER_LOW_ROOT_SEL_100M, |
| 412 | ACLK_CENTER_LOW_ROOT_SEL_24M, |
| 413 | ACLK_CENTER_ROOT_SEL_SHIFT = 0, |
| 414 | ACLK_CENTER_ROOT_SEL_MASK = 3 << ACLK_CENTER_ROOT_SEL_SHIFT, |
| 415 | ACLK_CENTER_ROOT_SEL_700M = 0, |
| 416 | ACLK_CENTER_ROOT_SEL_400M, |
| 417 | ACLK_CENTER_ROOT_SEL_200M, |
| 418 | ACLK_CENTER_ROOT_SEL_24M, |
| 419 | |
| 420 | /* CRU_CLK_SEL172_CON */ |
| 421 | CCLK_SDIO_SRC_SEL_SHIFT = 8, |
| 422 | CCLK_SDIO_SRC_SEL_MASK = 3 << CCLK_SDIO_SRC_SEL_SHIFT, |
| 423 | CCLK_SDIO_SRC_SEL_GPLL = 0, |
| 424 | CCLK_SDIO_SRC_SEL_CPLL, |
| 425 | CCLK_SDIO_SRC_SEL_24M, |
| 426 | CCLK_SDIO_SRC_DIV_SHIFT = 2, |
| 427 | CCLK_SDIO_SRC_DIV_MASK = 0x3f << CCLK_SDIO_SRC_DIV_SHIFT, |
| 428 | |
| 429 | /* CRU_CLK_SEL176_CON */ |
| 430 | CLK_PCIE_PHY1_PLL_DIV_SHIFT = 6, |
| 431 | CLK_PCIE_PHY1_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY1_PLL_DIV_SHIFT, |
| 432 | CLK_PCIE_PHY0_PLL_DIV_SHIFT = 0, |
| 433 | CLK_PCIE_PHY0_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY0_PLL_DIV_SHIFT, |
| 434 | |
| 435 | /* CRU_CLK_SEL177_CON */ |
| 436 | CLK_PCIE_PHY2_REF_SEL_SHIFT = 8, |
| 437 | CLK_PCIE_PHY2_REF_SEL_MASK = 1 << CLK_PCIE_PHY2_REF_SEL_SHIFT, |
| 438 | CLK_PCIE_PHY1_REF_SEL_SHIFT = 7, |
| 439 | CLK_PCIE_PHY1_REF_SEL_MASK = 1 << CLK_PCIE_PHY1_REF_SEL_SHIFT, |
| 440 | CLK_PCIE_PHY0_REF_SEL_SHIFT = 6, |
| 441 | CLK_PCIE_PHY0_REF_SEL_MASK = 1 << CLK_PCIE_PHY0_REF_SEL_SHIFT, |
| 442 | CLK_PCIE_PHY_REF_SEL_24M = 0, |
| 443 | CLK_PCIE_PHY_REF_SEL_PPLL, |
| 444 | CLK_PCIE_PHY2_PLL_DIV_SHIFT = 0, |
| 445 | CLK_PCIE_PHY2_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY2_PLL_DIV_SHIFT, |
| 446 | |
| 447 | /* PMUCRU_CLK_SEL2_CON */ |
| 448 | CLK_PMU1PWM_SEL_SHIFT = 9, |
| 449 | CLK_PMU1PWM_SEL_MASK = 3 << CLK_PMU1PWM_SEL_SHIFT, |
| 450 | |
| 451 | /* PMUCRU_CLK_SEL3_CON */ |
| 452 | CLK_I2C0_SEL_SHIFT = 6, |
| 453 | CLK_I2C0_SEL_MASK = 1 << CLK_I2C0_SEL_SHIFT, |
| 454 | CLK_I2C_SEL_200M = 0, |
| 455 | CLK_I2C_SEL_100M, |
Jonas Karlman | b450590 | 2023-04-17 19:07:20 +0000 | [diff] [blame] | 456 | |
| 457 | /* SECURECRU_CLKSEL_CON01 */ |
| 458 | SCMI_HCLK_SD_SEL_SHIFT = 2, |
| 459 | SCMI_HCLK_SD_SEL_MASK = 3 << SCMI_HCLK_SD_SEL_SHIFT, |
| 460 | SCMI_HCLK_SD_SEL_150M = 0, |
| 461 | SCMI_HCLK_SD_SEL_100M, |
| 462 | SCMI_HCLK_SD_SEL_50M, |
| 463 | SCMI_HCLK_SD_SEL_24M, |
| 464 | |
| 465 | /* SECURECRU_CLKSEL_CON03 */ |
| 466 | SCMI_CCLK_SD_SEL_SHIFT = 12, |
| 467 | SCMI_CCLK_SD_SEL_MASK = 3 << SCMI_CCLK_SD_SEL_SHIFT, |
| 468 | SCMI_CCLK_SD_SEL_GPLL = 0, |
| 469 | SCMI_CCLK_SD_SEL_SPLL, |
| 470 | SCMI_CCLK_SD_SEL_24M, |
| 471 | SCMI_CCLK_SD_DIV_SHIFT = 6, |
| 472 | SCMI_CCLK_SD_DIV_MASK = 0x3f << SCMI_CCLK_SD_DIV_SHIFT, |
Jagan Teki | 9c9aab1 | 2023-01-30 20:27:33 +0530 | [diff] [blame] | 473 | }; |
| 474 | #endif |