Andy Yan | b5e1630 | 2019-11-14 11:21:12 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | *Copyright 2019 Rockchip Electronics Co., Ltd. |
| 4 | */ |
| 5 | #ifndef _ASM_ARCH_GRF_rk3308_H |
| 6 | #define _ASM_ARCH_GRF_rk3308_H |
| 7 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 8 | #include <linux/kernel.h> |
| 9 | |
Andy Yan | b5e1630 | 2019-11-14 11:21:12 +0800 | [diff] [blame] | 10 | struct rk3308_grf { |
| 11 | unsigned int gpio0a_iomux; |
| 12 | unsigned int reserved0; |
| 13 | unsigned int gpio0b_iomux; |
| 14 | unsigned int reserved1; |
| 15 | unsigned int gpio0c_iomux; |
| 16 | unsigned int reserved2[3]; |
| 17 | unsigned int gpio1a_iomux; |
| 18 | unsigned int reserved3; |
| 19 | unsigned int gpio1bl_iomux; |
| 20 | unsigned int gpio1bh_iomux; |
| 21 | unsigned int gpio1cl_iomux; |
| 22 | unsigned int gpio1ch_iomux; |
| 23 | unsigned int gpio1d_iomux; |
| 24 | unsigned int reserved4; |
| 25 | unsigned int gpio2a_iomux; |
| 26 | unsigned int reserved5; |
| 27 | unsigned int gpio2b_iomux; |
| 28 | unsigned int reserved6; |
| 29 | unsigned int gpio2c_iomux; |
| 30 | unsigned int reserved7[3]; |
| 31 | unsigned int gpio3a_iomux; |
| 32 | unsigned int reserved8; |
| 33 | unsigned int gpio3b_iomux; |
| 34 | unsigned int reserved9[5]; |
| 35 | unsigned int gpio4a_iomux; |
| 36 | unsigned int reserved33; |
| 37 | unsigned int gpio4b_iomux; |
| 38 | unsigned int reserved10; |
| 39 | unsigned int gpio4c_iomux; |
| 40 | unsigned int reserved11; |
| 41 | unsigned int gpio4d_iomux; |
| 42 | unsigned int reserved34; |
| 43 | unsigned int gpio0a_p; |
| 44 | unsigned int gpio0b_p; |
| 45 | unsigned int gpio0c_p; |
| 46 | unsigned int reserved12; |
| 47 | unsigned int gpio1a_p; |
| 48 | unsigned int gpio1b_p; |
| 49 | unsigned int gpio1c_p; |
| 50 | unsigned int gpio1d_p; |
| 51 | unsigned int gpio2a_p; |
| 52 | unsigned int gpio2b_p; |
| 53 | unsigned int gpio2c_p; |
| 54 | unsigned int reserved13; |
| 55 | unsigned int gpio3a_p; |
| 56 | unsigned int gpio3b_p; |
| 57 | unsigned int reserved14[2]; |
| 58 | unsigned int gpio4a_p; |
| 59 | unsigned int gpio4b_p; |
| 60 | unsigned int gpio4c_p; |
| 61 | unsigned int gpio4d_p; |
| 62 | unsigned int reserved15[(0x100 - 0xec) / 4 - 1]; |
| 63 | unsigned int gpio0a_e; |
| 64 | unsigned int gpio0b_e; |
| 65 | unsigned int gpio0c_e; |
| 66 | unsigned int reserved16; |
| 67 | unsigned int gpio1a_e; |
| 68 | unsigned int gpio1b_e; |
| 69 | unsigned int gpio1c_e; |
| 70 | unsigned int gpio1d_e; |
| 71 | unsigned int gpio2a_e; |
| 72 | unsigned int gpio2b_e; |
| 73 | unsigned int gpio2c_e; |
| 74 | unsigned int reserved17; |
| 75 | unsigned int gpio3a_e; |
| 76 | unsigned int gpio3b_e; |
| 77 | unsigned int reserved18[2]; |
| 78 | unsigned int gpio4a_e; |
| 79 | unsigned int gpio4b_e; |
| 80 | unsigned int gpio4c_e; |
| 81 | unsigned int gpio4d_e; |
| 82 | unsigned int gpio0a_sr; |
| 83 | unsigned int gpio0b_sr; |
| 84 | unsigned int gpio0c_sr; |
| 85 | unsigned int reserved19; |
| 86 | unsigned int gpio1a_sr; |
| 87 | unsigned int gpio1b_sr; |
| 88 | unsigned int gpio1c_sr; |
| 89 | unsigned int gpio1d_sr; |
| 90 | unsigned int gpio2a_sr; |
| 91 | unsigned int gpio2b_sr; |
| 92 | unsigned int gpio2c_sr; |
| 93 | unsigned int reserved20; |
| 94 | unsigned int gpio3a_sr; |
| 95 | unsigned int gpio3b_sr; |
| 96 | unsigned int reserved21[2]; |
| 97 | unsigned int gpio4a_sr; |
| 98 | unsigned int gpio4b_sr; |
| 99 | unsigned int gpio4c_sr; |
| 100 | unsigned int gpio4d_sr; |
| 101 | unsigned int gpio0a_smt; |
| 102 | unsigned int gpio0b_smt; |
| 103 | unsigned int gpio0c_smt; |
| 104 | unsigned int reserved22; |
| 105 | unsigned int gpio1a_smt; |
| 106 | unsigned int gpio1b_smt; |
| 107 | unsigned int gpio1c_smt; |
| 108 | unsigned int gpio1d_smt; |
| 109 | unsigned int gpio2a_smt; |
| 110 | unsigned int gpio2b_smt; |
| 111 | unsigned int gpio2c_smt; |
| 112 | unsigned int reserved23; |
| 113 | unsigned int gpio3a_smt; |
| 114 | unsigned int gpio3b_smt; |
| 115 | unsigned int reserved35[2]; |
| 116 | unsigned int gpio4a_smt; |
| 117 | unsigned int gpio4b_smt; |
| 118 | unsigned int gpio4c_smt; |
| 119 | unsigned int gpio4d_smt; |
| 120 | unsigned int reserved24[(0x300 - 0x1EC) / 4 - 1]; |
| 121 | unsigned int soc_con0; |
| 122 | unsigned int soc_con1; |
| 123 | unsigned int soc_con2; |
| 124 | unsigned int soc_con3; |
| 125 | unsigned int soc_con4; |
| 126 | unsigned int soc_con5; |
| 127 | unsigned int soc_con6; |
| 128 | unsigned int soc_con7; |
| 129 | unsigned int soc_con8; |
| 130 | unsigned int soc_con9; |
| 131 | unsigned int soc_con10; |
| 132 | unsigned int reserved25[(0x380 - 0x328) / 4 - 1]; |
| 133 | unsigned int soc_status0; |
| 134 | unsigned int reserved26[(0x400 - 0x380) / 4 - 1]; |
| 135 | unsigned int cpu_con0; |
| 136 | unsigned int cpu_con1; |
| 137 | unsigned int cpu_con2; |
| 138 | unsigned int reserved27[(0x420 - 0x408) / 4 - 1]; |
| 139 | unsigned int cpu_status0; |
| 140 | unsigned int cpu_status1; |
| 141 | unsigned int reserved28[(0x440 - 0x424) / 4 - 1]; |
| 142 | unsigned int pvtm_con0; |
| 143 | unsigned int pvtm_con1; |
| 144 | unsigned int pvtm_status0; |
| 145 | unsigned int pvtm_status1; |
| 146 | unsigned int reserved29[(0x460 - 0x44C) / 4 - 1]; |
| 147 | unsigned int tsadc_tbl; |
| 148 | unsigned int tsadc_tbh; |
| 149 | unsigned int reserved30[(0x480 - 0x464) / 4 - 1]; |
| 150 | unsigned int host0_con0; |
| 151 | unsigned int host0_con1; |
| 152 | unsigned int otg_con0; |
| 153 | unsigned int host0_status0; |
| 154 | unsigned int reserved31[(0x4a0 - 0x48C) / 4 - 1]; |
| 155 | unsigned int mac_con0; |
| 156 | unsigned int upctrl_con0; |
| 157 | unsigned int upctrl_status0; |
| 158 | unsigned int reserved32[(0x500 - 0x4A8) / 4 - 1]; |
| 159 | unsigned int os_reg0; |
| 160 | unsigned int os_reg1; |
| 161 | unsigned int os_reg2; |
| 162 | unsigned int os_reg3; |
| 163 | unsigned int os_reg4; |
| 164 | unsigned int os_reg5; |
| 165 | unsigned int os_reg6; |
| 166 | unsigned int os_reg7; |
| 167 | unsigned int os_reg8; |
| 168 | unsigned int os_reg9; |
| 169 | unsigned int os_reg10; |
| 170 | unsigned int os_reg11; |
| 171 | unsigned int reserved38[(0x600 - 0x52c) / 4 - 1]; |
| 172 | unsigned int soc_con12; |
| 173 | unsigned int reserved39; |
| 174 | unsigned int soc_con13; |
| 175 | unsigned int soc_con14; |
| 176 | unsigned int soc_con15; |
| 177 | unsigned int reserved40[(0x800 - 0x610) / 4 - 1]; |
| 178 | unsigned int chip_id; |
| 179 | }; |
| 180 | check_member(rk3308_grf, gpio0a_p, 0xa0); |
| 181 | |
| 182 | struct rk3308_sgrf { |
| 183 | unsigned int soc_con0; |
| 184 | unsigned int soc_con1; |
| 185 | unsigned int con_tzma_r0size; |
| 186 | unsigned int con_secure0; |
| 187 | unsigned int reserved0; |
| 188 | unsigned int clk_timer_en; |
| 189 | unsigned int clkgat_con; |
| 190 | unsigned int fastboot_addr; |
| 191 | unsigned int fastboot_en; |
| 192 | unsigned int reserved1[(0x30 - 0x24) / 4]; |
| 193 | unsigned int srst_con; |
| 194 | }; |
| 195 | check_member(rk3308_sgrf, fastboot_en, 0x20); |
| 196 | |
| 197 | #endif |