1 /*- 2 * Copyright 2015 John Wehle <john@feith.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $FreeBSD$ 27 */ 28 29 #ifndef _ARM_AMLOGIC_AML8726_CCM_H 30 #define _ARM_AMLOGIC_AML8726_CCM_H 31 32 33 struct aml8726_ccm_gate { 34 uint32_t addr; 35 uint32_t bits; 36 }; 37 38 struct aml8726_ccm_function { 39 const char *name; 40 struct aml8726_ccm_gate *gates; 41 }; 42 43 44 /* 45 * aml8726-m3 46 */ 47 48 static struct aml8726_ccm_gate aml8726_m3_ethernet[] = { 49 { 4, 0x00000008 }, 50 { 0, 0x00000000 } 51 }; 52 53 static struct aml8726_ccm_gate aml8726_m3_i2c[] = { 54 { 0, 0x00000200 }, 55 { 0, 0x00000000 } 56 }; 57 58 static struct aml8726_ccm_gate aml8726_m3_rng[] = { 59 { 0, 0x00001000 }, 60 { 0, 0x00000000 } 61 }; 62 63 static struct aml8726_ccm_gate aml8726_m3_sdio[] = { 64 { 0, 0x00020000 }, 65 { 0, 0x00000000 } 66 }; 67 68 static struct aml8726_ccm_gate aml8726_m3_sdxc[] = { 69 { 0, 0x00004000 }, 70 { 0, 0x00000000 } 71 }; 72 73 static struct aml8726_ccm_gate aml8726_m3_uart_a[] = { 74 { 0, 0x00002000 }, 75 { 0, 0x00000000 } 76 }; 77 78 static struct aml8726_ccm_gate aml8726_m3_uart_b[] = { 79 { 4, 0x00010000 }, 80 { 0, 0x00000000 } 81 }; 82 83 static struct aml8726_ccm_gate aml8726_m3_uart_c[] = { 84 { 8, 0x00008000 }, 85 { 0, 0x00000000 } 86 }; 87 88 static struct aml8726_ccm_gate aml8726_m3_usb_a[] = { 89 { 4, 0x00200000 }, 90 { 0, 0x00000000 } 91 }; 92 93 static struct aml8726_ccm_gate aml8726_m3_usb_b[] = { 94 { 4, 0x00400000 }, 95 { 0, 0x00000000 } 96 }; 97 98 struct aml8726_ccm_function aml8726_m3_ccm[] = { 99 { "ethernet", aml8726_m3_ethernet }, 100 { "i2c", aml8726_m3_i2c }, 101 { "rng", aml8726_m3_rng }, 102 { "sdio", aml8726_m3_sdio }, 103 { "sdxc", aml8726_m3_sdxc }, 104 { "uart-a", aml8726_m3_uart_a }, 105 { "uart-b", aml8726_m3_uart_b }, 106 { "uart-c", aml8726_m3_uart_c }, 107 { "usb-a", aml8726_m3_usb_a }, 108 { "usb-b", aml8726_m3_usb_b }, 109 { NULL } 110 }; 111 112 113 /* 114 * aml8726-m6 115 */ 116 117 static struct aml8726_ccm_gate aml8726_m6_ethernet[] = { 118 { 4, 0x00000008 }, 119 { 0, 0x00000000 } 120 }; 121 122 static struct aml8726_ccm_gate aml8726_m6_i2c[] = { 123 { 0, 0x00000200 }, 124 { 0, 0x00000000 } 125 }; 126 127 static struct aml8726_ccm_gate aml8726_m6_rng[] = { 128 { 0, 0x00001000 }, 129 { 0, 0x00000000 } 130 }; 131 132 static struct aml8726_ccm_gate aml8726_m6_sdio[] = { 133 { 0, 0x00020000 }, 134 { 0, 0x00000000 } 135 }; 136 137 static struct aml8726_ccm_gate aml8726_m6_sdxc[] = { 138 { 0, 0x00004000 }, 139 { 0, 0x00000000 } 140 }; 141 142 static struct aml8726_ccm_gate aml8726_m6_uart_a[] = { 143 { 0, 0x00002000 }, 144 { 0, 0x00000000 } 145 }; 146 147 static struct aml8726_ccm_gate aml8726_m6_uart_b[] = { 148 { 4, 0x00010000 }, 149 { 0, 0x00000000 } 150 }; 151 152 static struct aml8726_ccm_gate aml8726_m6_uart_c[] = { 153 { 8, 0x00008000 }, 154 { 0, 0x00000000 } 155 }; 156 157 static struct aml8726_ccm_gate aml8726_m6_usb_a[] = { 158 { 4, 0x00200000 }, 159 { 0, 0x00000000 } 160 }; 161 162 static struct aml8726_ccm_gate aml8726_m6_usb_b[] = { 163 { 4, 0x00400000 }, 164 { 0, 0x00000000 } 165 }; 166 167 struct aml8726_ccm_function aml8726_m6_ccm[] = { 168 { "ethernet", aml8726_m6_ethernet }, 169 { "i2c", aml8726_m6_i2c }, 170 { "rng", aml8726_m6_rng }, 171 { "sdio", aml8726_m6_sdio }, 172 { "sdxc", aml8726_m6_sdxc }, 173 { "uart-a", aml8726_m6_uart_a }, 174 { "uart-b", aml8726_m6_uart_b }, 175 { "uart-c", aml8726_m6_uart_c }, 176 { "usb-a", aml8726_m6_usb_a }, 177 { "usb-b", aml8726_m6_usb_b }, 178 { NULL } 179 }; 180 181 182 /* 183 * aml8726-m8 184 */ 185 186 static struct aml8726_ccm_gate aml8726_m8_ethernet[] = { 187 { 4, 0x00000008 }, 188 { 0, 0x00000000 } 189 }; 190 191 static struct aml8726_ccm_gate aml8726_m8_i2c[] = { 192 { 0, 0x00000200 }, 193 { 0, 0x00000000 } 194 }; 195 196 static struct aml8726_ccm_gate aml8726_m8_rng[] = { 197 { 0, 0x00001000 }, 198 { 16, 0x00200000 }, 199 { 0, 0x00000000 } 200 }; 201 202 static struct aml8726_ccm_gate aml8726_m8_sdio[] = { 203 { 0, 0x00020000 }, 204 { 0, 0x00000000 } 205 }; 206 207 static struct aml8726_ccm_gate aml8726_m8_sdxc[] = { 208 { 0, 0x00004000 }, 209 { 0, 0x00000000 } 210 }; 211 212 static struct aml8726_ccm_gate aml8726_m8_uart_a[] = { 213 { 0, 0x00002000 }, 214 { 0, 0x00000000 } 215 }; 216 217 static struct aml8726_ccm_gate aml8726_m8_uart_b[] = { 218 { 4, 0x00010000 }, 219 { 0, 0x00000000 } 220 }; 221 222 static struct aml8726_ccm_gate aml8726_m8_uart_c[] = { 223 { 8, 0x00008000 }, 224 { 0, 0x00000000 } 225 }; 226 227 static struct aml8726_ccm_gate aml8726_m8_usb_a[] = { 228 { 4, 0x00200000 }, 229 { 4, 0x04000000 }, 230 { 0, 0x00000000 } 231 }; 232 233 static struct aml8726_ccm_gate aml8726_m8_usb_b[] = { 234 { 4, 0x00400000 }, 235 { 4, 0x04000000 }, 236 { 0, 0x00000000 } 237 }; 238 239 struct aml8726_ccm_function aml8726_m8_ccm[] = { 240 { "ethernet", aml8726_m8_ethernet }, 241 { "i2c", aml8726_m8_i2c }, 242 { "rng", aml8726_m8_rng }, 243 { "sdio", aml8726_m8_sdio }, 244 { "sdxc", aml8726_m8_sdxc }, 245 { "uart-a", aml8726_m8_uart_a }, 246 { "uart-b", aml8726_m8_uart_b }, 247 { "uart-c", aml8726_m8_uart_c }, 248 { "usb-a", aml8726_m8_usb_a }, 249 { "usb-b", aml8726_m8_usb_b }, 250 { NULL } 251 }; 252 253 254 /* 255 * aml8726-m8b 256 */ 257 258 static struct aml8726_ccm_gate aml8726_m8b_ethernet[] = { 259 { 4, 0x00000008 }, 260 { 0, 0x00000000 } 261 }; 262 263 static struct aml8726_ccm_gate aml8726_m8b_i2c[] = { 264 { 0, 0x00000200 }, 265 { 0, 0x00000000 } 266 }; 267 268 static struct aml8726_ccm_gate aml8726_m8b_rng[] = { 269 { 0, 0x00001000 }, 270 { 16, 0x00200000 }, 271 { 0, 0x00000000 } 272 }; 273 274 static struct aml8726_ccm_gate aml8726_m8b_sdio[] = { 275 { 0, 0x00020000 }, 276 { 0, 0x00000000 } 277 }; 278 279 static struct aml8726_ccm_gate aml8726_m8b_sdxc[] = { 280 { 0, 0x00004000 }, 281 { 0, 0x00000000 } 282 }; 283 284 static struct aml8726_ccm_gate aml8726_m8b_uart_a[] = { 285 { 0, 0x00002000 }, 286 { 0, 0x00000000 } 287 }; 288 289 static struct aml8726_ccm_gate aml8726_m8b_uart_b[] = { 290 { 4, 0x00010000 }, 291 { 0, 0x00000000 } 292 }; 293 294 static struct aml8726_ccm_gate aml8726_m8b_uart_c[] = { 295 { 8, 0x00008000 }, 296 { 0, 0x00000000 } 297 }; 298 299 static struct aml8726_ccm_gate aml8726_m8b_usb_a[] = { 300 { 4, 0x00200000 }, 301 { 4, 0x04000000 }, 302 { 0, 0x00000000 } 303 }; 304 305 static struct aml8726_ccm_gate aml8726_m8b_usb_b[] = { 306 { 4, 0x00400000 }, 307 { 4, 0x04000000 }, 308 { 0, 0x00000000 } 309 }; 310 311 struct aml8726_ccm_function aml8726_m8b_ccm[] = { 312 { "ethernet", aml8726_m8b_ethernet }, 313 { "i2c", aml8726_m8b_i2c }, 314 { "rng", aml8726_m8b_rng }, 315 { "sdio", aml8726_m8b_sdio }, 316 { "sdxc", aml8726_m8b_sdxc }, 317 { "uart-a", aml8726_m8b_uart_a }, 318 { "uart-b", aml8726_m8b_uart_b }, 319 { "uart-c", aml8726_m8b_uart_c }, 320 { "usb-a", aml8726_m8b_usb_a }, 321 { "usb-b", aml8726_m8b_usb_b }, 322 { NULL } 323 }; 324 325 #endif /* _ARM_AMLOGIC_AML8726_CCM_H */ 326