Jorge Ramirez-Ortiz | 6ac2892 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2018, Renesas Electronics Corporation. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <stdint.h> /* for uint32_t */ |
| 8 | #include <mmio.h> |
| 9 | #include "pfc_init_m3.h" |
| 10 | #include "rcar_def.h" |
| 11 | #include "rcar_private.h" |
| 12 | |
| 13 | /* GPIO base address */ |
| 14 | #define GPIO_BASE (0xE6050000U) |
| 15 | |
| 16 | /* GPIO registers */ |
| 17 | #define GPIO_IOINTSEL0 (GPIO_BASE + 0x0000U) |
| 18 | #define GPIO_INOUTSEL0 (GPIO_BASE + 0x0004U) |
| 19 | #define GPIO_OUTDT0 (GPIO_BASE + 0x0008U) |
| 20 | #define GPIO_INDT0 (GPIO_BASE + 0x000CU) |
| 21 | #define GPIO_INTDT0 (GPIO_BASE + 0x0010U) |
| 22 | #define GPIO_INTCLR0 (GPIO_BASE + 0x0014U) |
| 23 | #define GPIO_INTMSK0 (GPIO_BASE + 0x0018U) |
| 24 | #define GPIO_MSKCLR0 (GPIO_BASE + 0x001CU) |
| 25 | #define GPIO_POSNEG0 (GPIO_BASE + 0x0020U) |
| 26 | #define GPIO_EDGLEVEL0 (GPIO_BASE + 0x0024U) |
| 27 | #define GPIO_FILONOFF0 (GPIO_BASE + 0x0028U) |
| 28 | #define GPIO_INTMSKS0 (GPIO_BASE + 0x0038U) |
| 29 | #define GPIO_MSKCLRS0 (GPIO_BASE + 0x003CU) |
| 30 | #define GPIO_OUTDTSEL0 (GPIO_BASE + 0x0040U) |
| 31 | #define GPIO_OUTDTH0 (GPIO_BASE + 0x0044U) |
| 32 | #define GPIO_OUTDTL0 (GPIO_BASE + 0x0048U) |
| 33 | #define GPIO_BOTHEDGE0 (GPIO_BASE + 0x004CU) |
| 34 | #define GPIO_IOINTSEL1 (GPIO_BASE + 0x1000U) |
| 35 | #define GPIO_INOUTSEL1 (GPIO_BASE + 0x1004U) |
| 36 | #define GPIO_OUTDT1 (GPIO_BASE + 0x1008U) |
| 37 | #define GPIO_INDT1 (GPIO_BASE + 0x100CU) |
| 38 | #define GPIO_INTDT1 (GPIO_BASE + 0x1010U) |
| 39 | #define GPIO_INTCLR1 (GPIO_BASE + 0x1014U) |
| 40 | #define GPIO_INTMSK1 (GPIO_BASE + 0x1018U) |
| 41 | #define GPIO_MSKCLR1 (GPIO_BASE + 0x101CU) |
| 42 | #define GPIO_POSNEG1 (GPIO_BASE + 0x1020U) |
| 43 | #define GPIO_EDGLEVEL1 (GPIO_BASE + 0x1024U) |
| 44 | #define GPIO_FILONOFF1 (GPIO_BASE + 0x1028U) |
| 45 | #define GPIO_INTMSKS1 (GPIO_BASE + 0x1038U) |
| 46 | #define GPIO_MSKCLRS1 (GPIO_BASE + 0x103CU) |
| 47 | #define GPIO_OUTDTSEL1 (GPIO_BASE + 0x1040U) |
| 48 | #define GPIO_OUTDTH1 (GPIO_BASE + 0x1044U) |
| 49 | #define GPIO_OUTDTL1 (GPIO_BASE + 0x1048U) |
| 50 | #define GPIO_BOTHEDGE1 (GPIO_BASE + 0x104CU) |
| 51 | #define GPIO_IOINTSEL2 (GPIO_BASE + 0x2000U) |
| 52 | #define GPIO_INOUTSEL2 (GPIO_BASE + 0x2004U) |
| 53 | #define GPIO_OUTDT2 (GPIO_BASE + 0x2008U) |
| 54 | #define GPIO_INDT2 (GPIO_BASE + 0x200CU) |
| 55 | #define GPIO_INTDT2 (GPIO_BASE + 0x2010U) |
| 56 | #define GPIO_INTCLR2 (GPIO_BASE + 0x2014U) |
| 57 | #define GPIO_INTMSK2 (GPIO_BASE + 0x2018U) |
| 58 | #define GPIO_MSKCLR2 (GPIO_BASE + 0x201CU) |
| 59 | #define GPIO_POSNEG2 (GPIO_BASE + 0x2020U) |
| 60 | #define GPIO_EDGLEVEL2 (GPIO_BASE + 0x2024U) |
| 61 | #define GPIO_FILONOFF2 (GPIO_BASE + 0x2028U) |
| 62 | #define GPIO_INTMSKS2 (GPIO_BASE + 0x2038U) |
| 63 | #define GPIO_MSKCLRS2 (GPIO_BASE + 0x203CU) |
| 64 | #define GPIO_OUTDTSEL2 (GPIO_BASE + 0x2040U) |
| 65 | #define GPIO_OUTDTH2 (GPIO_BASE + 0x2044U) |
| 66 | #define GPIO_OUTDTL2 (GPIO_BASE + 0x2048U) |
| 67 | #define GPIO_BOTHEDGE2 (GPIO_BASE + 0x204CU) |
| 68 | #define GPIO_IOINTSEL3 (GPIO_BASE + 0x3000U) |
| 69 | #define GPIO_INOUTSEL3 (GPIO_BASE + 0x3004U) |
| 70 | #define GPIO_OUTDT3 (GPIO_BASE + 0x3008U) |
| 71 | #define GPIO_INDT3 (GPIO_BASE + 0x300CU) |
| 72 | #define GPIO_INTDT3 (GPIO_BASE + 0x3010U) |
| 73 | #define GPIO_INTCLR3 (GPIO_BASE + 0x3014U) |
| 74 | #define GPIO_INTMSK3 (GPIO_BASE + 0x3018U) |
| 75 | #define GPIO_MSKCLR3 (GPIO_BASE + 0x301CU) |
| 76 | #define GPIO_POSNEG3 (GPIO_BASE + 0x3020U) |
| 77 | #define GPIO_EDGLEVEL3 (GPIO_BASE + 0x3024U) |
| 78 | #define GPIO_FILONOFF3 (GPIO_BASE + 0x3028U) |
| 79 | #define GPIO_INTMSKS3 (GPIO_BASE + 0x3038U) |
| 80 | #define GPIO_MSKCLRS3 (GPIO_BASE + 0x303CU) |
| 81 | #define GPIO_OUTDTSEL3 (GPIO_BASE + 0x3040U) |
| 82 | #define GPIO_OUTDTH3 (GPIO_BASE + 0x3044U) |
| 83 | #define GPIO_OUTDTL3 (GPIO_BASE + 0x3048U) |
| 84 | #define GPIO_BOTHEDGE3 (GPIO_BASE + 0x304CU) |
| 85 | #define GPIO_IOINTSEL4 (GPIO_BASE + 0x4000U) |
| 86 | #define GPIO_INOUTSEL4 (GPIO_BASE + 0x4004U) |
| 87 | #define GPIO_OUTDT4 (GPIO_BASE + 0x4008U) |
| 88 | #define GPIO_INDT4 (GPIO_BASE + 0x400CU) |
| 89 | #define GPIO_INTDT4 (GPIO_BASE + 0x4010U) |
| 90 | #define GPIO_INTCLR4 (GPIO_BASE + 0x4014U) |
| 91 | #define GPIO_INTMSK4 (GPIO_BASE + 0x4018U) |
| 92 | #define GPIO_MSKCLR4 (GPIO_BASE + 0x401CU) |
| 93 | #define GPIO_POSNEG4 (GPIO_BASE + 0x4020U) |
| 94 | #define GPIO_EDGLEVEL4 (GPIO_BASE + 0x4024U) |
| 95 | #define GPIO_FILONOFF4 (GPIO_BASE + 0x4028U) |
| 96 | #define GPIO_INTMSKS4 (GPIO_BASE + 0x4038U) |
| 97 | #define GPIO_MSKCLRS4 (GPIO_BASE + 0x403CU) |
| 98 | #define GPIO_OUTDTSEL4 (GPIO_BASE + 0x4040U) |
| 99 | #define GPIO_OUTDTH4 (GPIO_BASE + 0x4044U) |
| 100 | #define GPIO_OUTDTL4 (GPIO_BASE + 0x4048U) |
| 101 | #define GPIO_BOTHEDGE4 (GPIO_BASE + 0x404CU) |
| 102 | #define GPIO_IOINTSEL5 (GPIO_BASE + 0x5000U) |
| 103 | #define GPIO_INOUTSEL5 (GPIO_BASE + 0x5004U) |
| 104 | #define GPIO_OUTDT5 (GPIO_BASE + 0x5008U) |
| 105 | #define GPIO_INDT5 (GPIO_BASE + 0x500CU) |
| 106 | #define GPIO_INTDT5 (GPIO_BASE + 0x5010U) |
| 107 | #define GPIO_INTCLR5 (GPIO_BASE + 0x5014U) |
| 108 | #define GPIO_INTMSK5 (GPIO_BASE + 0x5018U) |
| 109 | #define GPIO_MSKCLR5 (GPIO_BASE + 0x501CU) |
| 110 | #define GPIO_POSNEG5 (GPIO_BASE + 0x5020U) |
| 111 | #define GPIO_EDGLEVEL5 (GPIO_BASE + 0x5024U) |
| 112 | #define GPIO_FILONOFF5 (GPIO_BASE + 0x5028U) |
| 113 | #define GPIO_INTMSKS5 (GPIO_BASE + 0x5038U) |
| 114 | #define GPIO_MSKCLRS5 (GPIO_BASE + 0x503CU) |
| 115 | #define GPIO_OUTDTSEL5 (GPIO_BASE + 0x5040U) |
| 116 | #define GPIO_OUTDTH5 (GPIO_BASE + 0x5044U) |
| 117 | #define GPIO_OUTDTL5 (GPIO_BASE + 0x5048U) |
| 118 | #define GPIO_BOTHEDGE5 (GPIO_BASE + 0x504CU) |
| 119 | #define GPIO_IOINTSEL6 (GPIO_BASE + 0x5400U) |
| 120 | #define GPIO_INOUTSEL6 (GPIO_BASE + 0x5404U) |
| 121 | #define GPIO_OUTDT6 (GPIO_BASE + 0x5408U) |
| 122 | #define GPIO_INDT6 (GPIO_BASE + 0x540CU) |
| 123 | #define GPIO_INTDT6 (GPIO_BASE + 0x5410U) |
| 124 | #define GPIO_INTCLR6 (GPIO_BASE + 0x5414U) |
| 125 | #define GPIO_INTMSK6 (GPIO_BASE + 0x5418U) |
| 126 | #define GPIO_MSKCLR6 (GPIO_BASE + 0x541CU) |
| 127 | #define GPIO_POSNEG6 (GPIO_BASE + 0x5420U) |
| 128 | #define GPIO_EDGLEVEL6 (GPIO_BASE + 0x5424U) |
| 129 | #define GPIO_FILONOFF6 (GPIO_BASE + 0x5428U) |
| 130 | #define GPIO_INTMSKS6 (GPIO_BASE + 0x5438U) |
| 131 | #define GPIO_MSKCLRS6 (GPIO_BASE + 0x543CU) |
| 132 | #define GPIO_OUTDTSEL6 (GPIO_BASE + 0x5440U) |
| 133 | #define GPIO_OUTDTH6 (GPIO_BASE + 0x5444U) |
| 134 | #define GPIO_OUTDTL6 (GPIO_BASE + 0x5448U) |
| 135 | #define GPIO_BOTHEDGE6 (GPIO_BASE + 0x544CU) |
| 136 | #define GPIO_IOINTSEL7 (GPIO_BASE + 0x5800U) |
| 137 | #define GPIO_INOUTSEL7 (GPIO_BASE + 0x5804U) |
| 138 | #define GPIO_OUTDT7 (GPIO_BASE + 0x5808U) |
| 139 | #define GPIO_INDT7 (GPIO_BASE + 0x580CU) |
| 140 | #define GPIO_INTDT7 (GPIO_BASE + 0x5810U) |
| 141 | #define GPIO_INTCLR7 (GPIO_BASE + 0x5814U) |
| 142 | #define GPIO_INTMSK7 (GPIO_BASE + 0x5818U) |
| 143 | #define GPIO_MSKCLR7 (GPIO_BASE + 0x581CU) |
| 144 | #define GPIO_POSNEG7 (GPIO_BASE + 0x5820U) |
| 145 | #define GPIO_EDGLEVEL7 (GPIO_BASE + 0x5824U) |
| 146 | #define GPIO_FILONOFF7 (GPIO_BASE + 0x5828U) |
| 147 | #define GPIO_INTMSKS7 (GPIO_BASE + 0x5838U) |
| 148 | #define GPIO_MSKCLRS7 (GPIO_BASE + 0x583CU) |
| 149 | #define GPIO_OUTDTSEL7 (GPIO_BASE + 0x5840U) |
| 150 | #define GPIO_OUTDTH7 (GPIO_BASE + 0x5844U) |
| 151 | #define GPIO_OUTDTL7 (GPIO_BASE + 0x5848U) |
| 152 | #define GPIO_BOTHEDGE7 (GPIO_BASE + 0x584CU) |
| 153 | |
| 154 | /* Pin functon base address */ |
| 155 | #define PFC_BASE (0xE6060000U) |
| 156 | |
| 157 | /* Pin functon registers */ |
| 158 | #define PFC_PMMR (PFC_BASE + 0x0000U) |
| 159 | #define PFC_GPSR0 (PFC_BASE + 0x0100U) |
| 160 | #define PFC_GPSR1 (PFC_BASE + 0x0104U) |
| 161 | #define PFC_GPSR2 (PFC_BASE + 0x0108U) |
| 162 | #define PFC_GPSR3 (PFC_BASE + 0x010CU) |
| 163 | #define PFC_GPSR4 (PFC_BASE + 0x0110U) |
| 164 | #define PFC_GPSR5 (PFC_BASE + 0x0114U) |
| 165 | #define PFC_GPSR6 (PFC_BASE + 0x0118U) |
| 166 | #define PFC_GPSR7 (PFC_BASE + 0x011CU) |
| 167 | #define PFC_IPSR0 (PFC_BASE + 0x0200U) |
| 168 | #define PFC_IPSR1 (PFC_BASE + 0x0204U) |
| 169 | #define PFC_IPSR2 (PFC_BASE + 0x0208U) |
| 170 | #define PFC_IPSR3 (PFC_BASE + 0x020CU) |
| 171 | #define PFC_IPSR4 (PFC_BASE + 0x0210U) |
| 172 | #define PFC_IPSR5 (PFC_BASE + 0x0214U) |
| 173 | #define PFC_IPSR6 (PFC_BASE + 0x0218U) |
| 174 | #define PFC_IPSR7 (PFC_BASE + 0x021CU) |
| 175 | #define PFC_IPSR8 (PFC_BASE + 0x0220U) |
| 176 | #define PFC_IPSR9 (PFC_BASE + 0x0224U) |
| 177 | #define PFC_IPSR10 (PFC_BASE + 0x0228U) |
| 178 | #define PFC_IPSR11 (PFC_BASE + 0x022CU) |
| 179 | #define PFC_IPSR12 (PFC_BASE + 0x0230U) |
| 180 | #define PFC_IPSR13 (PFC_BASE + 0x0234U) |
| 181 | #define PFC_IPSR14 (PFC_BASE + 0x0238U) |
| 182 | #define PFC_IPSR15 (PFC_BASE + 0x023CU) |
| 183 | #define PFC_IPSR16 (PFC_BASE + 0x0240U) |
| 184 | #define PFC_IPSR17 (PFC_BASE + 0x0244U) |
| 185 | #define PFC_IPSR18 (PFC_BASE + 0x0248U) |
| 186 | #define PFC_DRVCTRL0 (PFC_BASE + 0x0300U) |
| 187 | #define PFC_DRVCTRL1 (PFC_BASE + 0x0304U) |
| 188 | #define PFC_DRVCTRL2 (PFC_BASE + 0x0308U) |
| 189 | #define PFC_DRVCTRL3 (PFC_BASE + 0x030CU) |
| 190 | #define PFC_DRVCTRL4 (PFC_BASE + 0x0310U) |
| 191 | #define PFC_DRVCTRL5 (PFC_BASE + 0x0314U) |
| 192 | #define PFC_DRVCTRL6 (PFC_BASE + 0x0318U) |
| 193 | #define PFC_DRVCTRL7 (PFC_BASE + 0x031CU) |
| 194 | #define PFC_DRVCTRL8 (PFC_BASE + 0x0320U) |
| 195 | #define PFC_DRVCTRL9 (PFC_BASE + 0x0324U) |
| 196 | #define PFC_DRVCTRL10 (PFC_BASE + 0x0328U) |
| 197 | #define PFC_DRVCTRL11 (PFC_BASE + 0x032CU) |
| 198 | #define PFC_DRVCTRL12 (PFC_BASE + 0x0330U) |
| 199 | #define PFC_DRVCTRL13 (PFC_BASE + 0x0334U) |
| 200 | #define PFC_DRVCTRL14 (PFC_BASE + 0x0338U) |
| 201 | #define PFC_DRVCTRL15 (PFC_BASE + 0x033CU) |
| 202 | #define PFC_DRVCTRL16 (PFC_BASE + 0x0340U) |
| 203 | #define PFC_DRVCTRL17 (PFC_BASE + 0x0344U) |
| 204 | #define PFC_DRVCTRL18 (PFC_BASE + 0x0348U) |
| 205 | #define PFC_DRVCTRL19 (PFC_BASE + 0x034CU) |
| 206 | #define PFC_DRVCTRL20 (PFC_BASE + 0x0350U) |
| 207 | #define PFC_DRVCTRL21 (PFC_BASE + 0x0354U) |
| 208 | #define PFC_DRVCTRL22 (PFC_BASE + 0x0358U) |
| 209 | #define PFC_DRVCTRL23 (PFC_BASE + 0x035CU) |
| 210 | #define PFC_DRVCTRL24 (PFC_BASE + 0x0360U) |
| 211 | #define PFC_POCCTRL0 (PFC_BASE + 0x0380U) |
| 212 | #define PFC_TDSELCTRL0 (PFC_BASE + 0x03C0U) |
| 213 | #define PFC_IOCTRL (PFC_BASE + 0x03E0U) |
| 214 | #define PFC_TSREG (PFC_BASE + 0x03E4U) |
| 215 | #define PFC_PUEN0 (PFC_BASE + 0x0400U) |
| 216 | #define PFC_PUEN1 (PFC_BASE + 0x0404U) |
| 217 | #define PFC_PUEN2 (PFC_BASE + 0x0408U) |
| 218 | #define PFC_PUEN3 (PFC_BASE + 0x040CU) |
| 219 | #define PFC_PUEN4 (PFC_BASE + 0x0410U) |
| 220 | #define PFC_PUEN5 (PFC_BASE + 0x0414U) |
| 221 | #define PFC_PUEN6 (PFC_BASE + 0x0418U) |
| 222 | #define PFC_PUD0 (PFC_BASE + 0x0440U) |
| 223 | #define PFC_PUD1 (PFC_BASE + 0x0444U) |
| 224 | #define PFC_PUD2 (PFC_BASE + 0x0448U) |
| 225 | #define PFC_PUD3 (PFC_BASE + 0x044CU) |
| 226 | #define PFC_PUD4 (PFC_BASE + 0x0450U) |
| 227 | #define PFC_PUD5 (PFC_BASE + 0x0454U) |
| 228 | #define PFC_PUD6 (PFC_BASE + 0x0458U) |
| 229 | #define PFC_MOD_SEL0 (PFC_BASE + 0x0500U) |
| 230 | #define PFC_MOD_SEL1 (PFC_BASE + 0x0504U) |
| 231 | #define PFC_MOD_SEL2 (PFC_BASE + 0x0508U) |
| 232 | |
| 233 | #define GPSR0_D15 ((uint32_t)1U << 15U) |
| 234 | #define GPSR0_D14 ((uint32_t)1U << 14U) |
| 235 | #define GPSR0_D13 ((uint32_t)1U << 13U) |
| 236 | #define GPSR0_D12 ((uint32_t)1U << 12U) |
| 237 | #define GPSR0_D11 ((uint32_t)1U << 11U) |
| 238 | #define GPSR0_D10 ((uint32_t)1U << 10U) |
| 239 | #define GPSR0_D9 ((uint32_t)1U << 9U) |
| 240 | #define GPSR0_D8 ((uint32_t)1U << 8U) |
| 241 | #define GPSR0_D7 ((uint32_t)1U << 7U) |
| 242 | #define GPSR0_D6 ((uint32_t)1U << 6U) |
| 243 | #define GPSR0_D5 ((uint32_t)1U << 5U) |
| 244 | #define GPSR0_D4 ((uint32_t)1U << 4U) |
| 245 | #define GPSR0_D3 ((uint32_t)1U << 3U) |
| 246 | #define GPSR0_D2 ((uint32_t)1U << 2U) |
| 247 | #define GPSR0_D1 ((uint32_t)1U << 1U) |
| 248 | #define GPSR0_D0 ((uint32_t)1U << 0U) |
| 249 | #define GPSR1_CLKOUT ((uint32_t)1U << 28U) |
| 250 | #define GPSR1_EX_WAIT0_A ((uint32_t)1U << 27U) |
| 251 | #define GPSR1_WE1 ((uint32_t)1U << 26U) |
| 252 | #define GPSR1_WE0 ((uint32_t)1U << 25U) |
| 253 | #define GPSR1_RD_WR ((uint32_t)1U << 24U) |
| 254 | #define GPSR1_RD ((uint32_t)1U << 23U) |
| 255 | #define GPSR1_BS ((uint32_t)1U << 22U) |
| 256 | #define GPSR1_CS1_A26 ((uint32_t)1U << 21U) |
| 257 | #define GPSR1_CS0 ((uint32_t)1U << 20U) |
| 258 | #define GPSR1_A19 ((uint32_t)1U << 19U) |
| 259 | #define GPSR1_A18 ((uint32_t)1U << 18U) |
| 260 | #define GPSR1_A17 ((uint32_t)1U << 17U) |
| 261 | #define GPSR1_A16 ((uint32_t)1U << 16U) |
| 262 | #define GPSR1_A15 ((uint32_t)1U << 15U) |
| 263 | #define GPSR1_A14 ((uint32_t)1U << 14U) |
| 264 | #define GPSR1_A13 ((uint32_t)1U << 13U) |
| 265 | #define GPSR1_A12 ((uint32_t)1U << 12U) |
| 266 | #define GPSR1_A11 ((uint32_t)1U << 11U) |
| 267 | #define GPSR1_A10 ((uint32_t)1U << 10U) |
| 268 | #define GPSR1_A9 ((uint32_t)1U << 9U) |
| 269 | #define GPSR1_A8 ((uint32_t)1U << 8U) |
| 270 | #define GPSR1_A7 ((uint32_t)1U << 7U) |
| 271 | #define GPSR1_A6 ((uint32_t)1U << 6U) |
| 272 | #define GPSR1_A5 ((uint32_t)1U << 5U) |
| 273 | #define GPSR1_A4 ((uint32_t)1U << 4U) |
| 274 | #define GPSR1_A3 ((uint32_t)1U << 3U) |
| 275 | #define GPSR1_A2 ((uint32_t)1U << 2U) |
| 276 | #define GPSR1_A1 ((uint32_t)1U << 1U) |
| 277 | #define GPSR1_A0 ((uint32_t)1U << 0U) |
| 278 | #define GPSR2_AVB_AVTP_CAPTURE_A ((uint32_t)1U << 14U) |
| 279 | #define GPSR2_AVB_AVTP_MATCH_A ((uint32_t)1U << 13U) |
| 280 | #define GPSR2_AVB_LINK ((uint32_t)1U << 12U) |
| 281 | #define GPSR2_AVB_PHY_INT ((uint32_t)1U << 11U) |
| 282 | #define GPSR2_AVB_MAGIC ((uint32_t)1U << 10U) |
| 283 | #define GPSR2_AVB_MDC ((uint32_t)1U << 9U) |
| 284 | #define GPSR2_PWM2_A ((uint32_t)1U << 8U) |
| 285 | #define GPSR2_PWM1_A ((uint32_t)1U << 7U) |
| 286 | #define GPSR2_PWM0 ((uint32_t)1U << 6U) |
| 287 | #define GPSR2_IRQ5 ((uint32_t)1U << 5U) |
| 288 | #define GPSR2_IRQ4 ((uint32_t)1U << 4U) |
| 289 | #define GPSR2_IRQ3 ((uint32_t)1U << 3U) |
| 290 | #define GPSR2_IRQ2 ((uint32_t)1U << 2U) |
| 291 | #define GPSR2_IRQ1 ((uint32_t)1U << 1U) |
| 292 | #define GPSR2_IRQ0 ((uint32_t)1U << 0U) |
| 293 | #define GPSR3_SD1_WP ((uint32_t)1U << 15U) |
| 294 | #define GPSR3_SD1_CD ((uint32_t)1U << 14U) |
| 295 | #define GPSR3_SD0_WP ((uint32_t)1U << 13U) |
| 296 | #define GPSR3_SD0_CD ((uint32_t)1U << 12U) |
| 297 | #define GPSR3_SD1_DAT3 ((uint32_t)1U << 11U) |
| 298 | #define GPSR3_SD1_DAT2 ((uint32_t)1U << 10U) |
| 299 | #define GPSR3_SD1_DAT1 ((uint32_t)1U << 9U) |
| 300 | #define GPSR3_SD1_DAT0 ((uint32_t)1U << 8U) |
| 301 | #define GPSR3_SD1_CMD ((uint32_t)1U << 7U) |
| 302 | #define GPSR3_SD1_CLK ((uint32_t)1U << 6U) |
| 303 | #define GPSR3_SD0_DAT3 ((uint32_t)1U << 5U) |
| 304 | #define GPSR3_SD0_DAT2 ((uint32_t)1U << 4U) |
| 305 | #define GPSR3_SD0_DAT1 ((uint32_t)1U << 3U) |
| 306 | #define GPSR3_SD0_DAT0 ((uint32_t)1U << 2U) |
| 307 | #define GPSR3_SD0_CMD ((uint32_t)1U << 1U) |
| 308 | #define GPSR3_SD0_CLK ((uint32_t)1U << 0U) |
| 309 | #define GPSR4_SD3_DS ((uint32_t)1U << 17U) |
| 310 | #define GPSR4_SD3_DAT7 ((uint32_t)1U << 16U) |
| 311 | #define GPSR4_SD3_DAT6 ((uint32_t)1U << 15U) |
| 312 | #define GPSR4_SD3_DAT5 ((uint32_t)1U << 14U) |
| 313 | #define GPSR4_SD3_DAT4 ((uint32_t)1U << 13U) |
| 314 | #define GPSR4_SD3_DAT3 ((uint32_t)1U << 12U) |
| 315 | #define GPSR4_SD3_DAT2 ((uint32_t)1U << 11U) |
| 316 | #define GPSR4_SD3_DAT1 ((uint32_t)1U << 10U) |
| 317 | #define GPSR4_SD3_DAT0 ((uint32_t)1U << 9U) |
| 318 | #define GPSR4_SD3_CMD ((uint32_t)1U << 8U) |
| 319 | #define GPSR4_SD3_CLK ((uint32_t)1U << 7U) |
| 320 | #define GPSR4_SD2_DS ((uint32_t)1U << 6U) |
| 321 | #define GPSR4_SD2_DAT3 ((uint32_t)1U << 5U) |
| 322 | #define GPSR4_SD2_DAT2 ((uint32_t)1U << 4U) |
| 323 | #define GPSR4_SD2_DAT1 ((uint32_t)1U << 3U) |
| 324 | #define GPSR4_SD2_DAT0 ((uint32_t)1U << 2U) |
| 325 | #define GPSR4_SD2_CMD ((uint32_t)1U << 1U) |
| 326 | #define GPSR4_SD2_CLK ((uint32_t)1U << 0U) |
| 327 | #define GPSR5_MLB_DAT ((uint32_t)1U << 25U) |
| 328 | #define GPSR5_MLB_SIG ((uint32_t)1U << 24U) |
| 329 | #define GPSR5_MLB_CLK ((uint32_t)1U << 23U) |
| 330 | #define GPSR5_MSIOF0_RXD ((uint32_t)1U << 22U) |
| 331 | #define GPSR5_MSIOF0_SS2 ((uint32_t)1U << 21U) |
| 332 | #define GPSR5_MSIOF0_TXD ((uint32_t)1U << 20U) |
| 333 | #define GPSR5_MSIOF0_SS1 ((uint32_t)1U << 19U) |
| 334 | #define GPSR5_MSIOF0_SYNC ((uint32_t)1U << 18U) |
| 335 | #define GPSR5_MSIOF0_SCK ((uint32_t)1U << 17U) |
| 336 | #define GPSR5_HRTS0 ((uint32_t)1U << 16U) |
| 337 | #define GPSR5_HCTS0 ((uint32_t)1U << 15U) |
| 338 | #define GPSR5_HTX0 ((uint32_t)1U << 14U) |
| 339 | #define GPSR5_HRX0 ((uint32_t)1U << 13U) |
| 340 | #define GPSR5_HSCK0 ((uint32_t)1U << 12U) |
| 341 | #define GPSR5_RX2_A ((uint32_t)1U << 11U) |
| 342 | #define GPSR5_TX2_A ((uint32_t)1U << 10U) |
| 343 | #define GPSR5_SCK2 ((uint32_t)1U << 9U) |
| 344 | #define GPSR5_RTS1_TANS ((uint32_t)1U << 8U) |
| 345 | #define GPSR5_CTS1 ((uint32_t)1U << 7U) |
| 346 | #define GPSR5_TX1_A ((uint32_t)1U << 6U) |
| 347 | #define GPSR5_RX1_A ((uint32_t)1U << 5U) |
| 348 | #define GPSR5_RTS0_TANS ((uint32_t)1U << 4U) |
| 349 | #define GPSR5_CTS0 ((uint32_t)1U << 3U) |
| 350 | #define GPSR5_TX0 ((uint32_t)1U << 2U) |
| 351 | #define GPSR5_RX0 ((uint32_t)1U << 1U) |
| 352 | #define GPSR5_SCK0 ((uint32_t)1U << 0U) |
| 353 | #define GPSR6_USB31_OVC ((uint32_t)1U << 31U) |
| 354 | #define GPSR6_USB31_PWEN ((uint32_t)1U << 30U) |
| 355 | #define GPSR6_USB30_OVC ((uint32_t)1U << 29U) |
| 356 | #define GPSR6_USB30_PWEN ((uint32_t)1U << 28U) |
| 357 | #define GPSR6_USB1_OVC ((uint32_t)1U << 27U) |
| 358 | #define GPSR6_USB1_PWEN ((uint32_t)1U << 26U) |
| 359 | #define GPSR6_USB0_OVC ((uint32_t)1U << 25U) |
| 360 | #define GPSR6_USB0_PWEN ((uint32_t)1U << 24U) |
| 361 | #define GPSR6_AUDIO_CLKB_B ((uint32_t)1U << 23U) |
| 362 | #define GPSR6_AUDIO_CLKA_A ((uint32_t)1U << 22U) |
| 363 | #define GPSR6_SSI_SDATA9_A ((uint32_t)1U << 21U) |
| 364 | #define GPSR6_SSI_SDATA8 ((uint32_t)1U << 20U) |
| 365 | #define GPSR6_SSI_SDATA7 ((uint32_t)1U << 19U) |
| 366 | #define GPSR6_SSI_WS78 ((uint32_t)1U << 18U) |
| 367 | #define GPSR6_SSI_SCK78 ((uint32_t)1U << 17U) |
| 368 | #define GPSR6_SSI_SDATA6 ((uint32_t)1U << 16U) |
| 369 | #define GPSR6_SSI_WS6 ((uint32_t)1U << 15U) |
| 370 | #define GPSR6_SSI_SCK6 ((uint32_t)1U << 14U) |
| 371 | #define GPSR6_SSI_SDATA5 ((uint32_t)1U << 13U) |
| 372 | #define GPSR6_SSI_WS5 ((uint32_t)1U << 12U) |
| 373 | #define GPSR6_SSI_SCK5 ((uint32_t)1U << 11U) |
| 374 | #define GPSR6_SSI_SDATA4 ((uint32_t)1U << 10U) |
| 375 | #define GPSR6_SSI_WS4 ((uint32_t)1U << 9U) |
| 376 | #define GPSR6_SSI_SCK4 ((uint32_t)1U << 8U) |
| 377 | #define GPSR6_SSI_SDATA3 ((uint32_t)1U << 7U) |
| 378 | #define GPSR6_SSI_WS34 ((uint32_t)1U << 6U) |
| 379 | #define GPSR6_SSI_SCK34 ((uint32_t)1U << 5U) |
| 380 | #define GPSR6_SSI_SDATA2_A ((uint32_t)1U << 4U) |
| 381 | #define GPSR6_SSI_SDATA1_A ((uint32_t)1U << 3U) |
| 382 | #define GPSR6_SSI_SDATA0 ((uint32_t)1U << 2U) |
| 383 | #define GPSR6_SSI_WS0129 ((uint32_t)1U << 1U) |
| 384 | #define GPSR6_SSI_SCK0129 ((uint32_t)1U << 0U) |
| 385 | #define GPSR7_HDMI1_CEC ((uint32_t)1U << 3U) |
| 386 | #define GPSR7_HDMI0_CEC ((uint32_t)1U << 2U) |
| 387 | #define GPSR7_AVS2 ((uint32_t)1U << 1U) |
| 388 | #define GPSR7_AVS1 ((uint32_t)1U << 0U) |
| 389 | |
| 390 | #define IPSR_28_FUNC(x) ((uint32_t)(x) << 28U) |
| 391 | #define IPSR_24_FUNC(x) ((uint32_t)(x) << 24U) |
| 392 | #define IPSR_20_FUNC(x) ((uint32_t)(x) << 20U) |
| 393 | #define IPSR_16_FUNC(x) ((uint32_t)(x) << 16U) |
| 394 | #define IPSR_12_FUNC(x) ((uint32_t)(x) << 12U) |
| 395 | #define IPSR_8_FUNC(x) ((uint32_t)(x) << 8U) |
| 396 | #define IPSR_4_FUNC(x) ((uint32_t)(x) << 4U) |
| 397 | #define IPSR_0_FUNC(x) ((uint32_t)(x) << 0U) |
| 398 | |
| 399 | #define POC_SD3_DS_33V ((uint32_t)1U << 29U) |
| 400 | #define POC_SD3_DAT7_33V ((uint32_t)1U << 28U) |
| 401 | #define POC_SD3_DAT6_33V ((uint32_t)1U << 27U) |
| 402 | #define POC_SD3_DAT5_33V ((uint32_t)1U << 26U) |
| 403 | #define POC_SD3_DAT4_33V ((uint32_t)1U << 25U) |
| 404 | #define POC_SD3_DAT3_33V ((uint32_t)1U << 24U) |
| 405 | #define POC_SD3_DAT2_33V ((uint32_t)1U << 23U) |
| 406 | #define POC_SD3_DAT1_33V ((uint32_t)1U << 22U) |
| 407 | #define POC_SD3_DAT0_33V ((uint32_t)1U << 21U) |
| 408 | #define POC_SD3_CMD_33V ((uint32_t)1U << 20U) |
| 409 | #define POC_SD3_CLK_33V ((uint32_t)1U << 19U) |
| 410 | #define POC_SD2_DS_33V ((uint32_t)1U << 18U) |
| 411 | #define POC_SD2_DAT3_33V ((uint32_t)1U << 17U) |
| 412 | #define POC_SD2_DAT2_33V ((uint32_t)1U << 16U) |
| 413 | #define POC_SD2_DAT1_33V ((uint32_t)1U << 15U) |
| 414 | #define POC_SD2_DAT0_33V ((uint32_t)1U << 14U) |
| 415 | #define POC_SD2_CMD_33V ((uint32_t)1U << 13U) |
| 416 | #define POC_SD2_CLK_33V ((uint32_t)1U << 12U) |
| 417 | #define POC_SD1_DAT3_33V ((uint32_t)1U << 11U) |
| 418 | #define POC_SD1_DAT2_33V ((uint32_t)1U << 10U) |
| 419 | #define POC_SD1_DAT1_33V ((uint32_t)1U << 9U) |
| 420 | #define POC_SD1_DAT0_33V ((uint32_t)1U << 8U) |
| 421 | #define POC_SD1_CMD_33V ((uint32_t)1U << 7U) |
| 422 | #define POC_SD1_CLK_33V ((uint32_t)1U << 6U) |
| 423 | #define POC_SD0_DAT3_33V ((uint32_t)1U << 5U) |
| 424 | #define POC_SD0_DAT2_33V ((uint32_t)1U << 4U) |
| 425 | #define POC_SD0_DAT1_33V ((uint32_t)1U << 3U) |
| 426 | #define POC_SD0_DAT0_33V ((uint32_t)1U << 2U) |
| 427 | #define POC_SD0_CMD_33V ((uint32_t)1U << 1U) |
| 428 | #define POC_SD0_CLK_33V ((uint32_t)1U << 0U) |
| 429 | |
| 430 | #define DRVCTRL0_MASK (0xCCCCCCCCU) |
| 431 | #define DRVCTRL1_MASK (0xCCCCCCC8U) |
| 432 | #define DRVCTRL2_MASK (0x88888888U) |
| 433 | #define DRVCTRL3_MASK (0x88888888U) |
| 434 | #define DRVCTRL4_MASK (0x88888888U) |
| 435 | #define DRVCTRL5_MASK (0x88888888U) |
| 436 | #define DRVCTRL6_MASK (0x88888888U) |
| 437 | #define DRVCTRL7_MASK (0x88888888U) |
| 438 | #define DRVCTRL8_MASK (0x88888888U) |
| 439 | #define DRVCTRL9_MASK (0x88888888U) |
| 440 | #define DRVCTRL10_MASK (0x88888888U) |
| 441 | #define DRVCTRL11_MASK (0x888888CCU) |
| 442 | #define DRVCTRL12_MASK (0xCCCFFFCFU) |
| 443 | #define DRVCTRL13_MASK (0xCC888888U) |
| 444 | #define DRVCTRL14_MASK (0x88888888U) |
| 445 | #define DRVCTRL15_MASK (0x88888888U) |
| 446 | #define DRVCTRL16_MASK (0x88888888U) |
| 447 | #define DRVCTRL17_MASK (0x88888888U) |
| 448 | #define DRVCTRL18_MASK (0x88888888U) |
| 449 | #define DRVCTRL19_MASK (0x88888888U) |
| 450 | #define DRVCTRL20_MASK (0x88888888U) |
| 451 | #define DRVCTRL21_MASK (0x88888888U) |
| 452 | #define DRVCTRL22_MASK (0x88888888U) |
| 453 | #define DRVCTRL23_MASK (0x88888888U) |
| 454 | #define DRVCTRL24_MASK (0x8888888FU) |
| 455 | |
| 456 | #define DRVCTRL0_QSPI0_SPCLK(x) ((uint32_t)(x) << 28U) |
| 457 | #define DRVCTRL0_QSPI0_MOSI_IO0(x) ((uint32_t)(x) << 24U) |
| 458 | #define DRVCTRL0_QSPI0_MISO_IO1(x) ((uint32_t)(x) << 20U) |
| 459 | #define DRVCTRL0_QSPI0_IO2(x) ((uint32_t)(x) << 16U) |
| 460 | #define DRVCTRL0_QSPI0_IO3(x) ((uint32_t)(x) << 12U) |
| 461 | #define DRVCTRL0_QSPI0_SSL(x) ((uint32_t)(x) << 8U) |
| 462 | #define DRVCTRL0_QSPI1_SPCLK(x) ((uint32_t)(x) << 4U) |
| 463 | #define DRVCTRL0_QSPI1_MOSI_IO0(x) ((uint32_t)(x) << 0U) |
| 464 | #define DRVCTRL1_QSPI1_MISO_IO1(x) ((uint32_t)(x) << 28U) |
| 465 | #define DRVCTRL1_QSPI1_IO2(x) ((uint32_t)(x) << 24U) |
| 466 | #define DRVCTRL1_QSPI1_IO3(x) ((uint32_t)(x) << 20U) |
| 467 | #define DRVCTRL1_QSPI1_SS(x) ((uint32_t)(x) << 16U) |
| 468 | #define DRVCTRL1_RPC_INT(x) ((uint32_t)(x) << 12U) |
| 469 | #define DRVCTRL1_RPC_WP(x) ((uint32_t)(x) << 8U) |
| 470 | #define DRVCTRL1_RPC_RESET(x) ((uint32_t)(x) << 4U) |
| 471 | #define DRVCTRL1_AVB_RX_CTL(x) ((uint32_t)(x) << 0U) |
| 472 | #define DRVCTRL2_AVB_RXC(x) ((uint32_t)(x) << 28U) |
| 473 | #define DRVCTRL2_AVB_RD0(x) ((uint32_t)(x) << 24U) |
| 474 | #define DRVCTRL2_AVB_RD1(x) ((uint32_t)(x) << 20U) |
| 475 | #define DRVCTRL2_AVB_RD2(x) ((uint32_t)(x) << 16U) |
| 476 | #define DRVCTRL2_AVB_RD3(x) ((uint32_t)(x) << 12U) |
| 477 | #define DRVCTRL2_AVB_TX_CTL(x) ((uint32_t)(x) << 8U) |
| 478 | #define DRVCTRL2_AVB_TXC(x) ((uint32_t)(x) << 4U) |
| 479 | #define DRVCTRL2_AVB_TD0(x) ((uint32_t)(x) << 0U) |
| 480 | #define DRVCTRL3_AVB_TD1(x) ((uint32_t)(x) << 28U) |
| 481 | #define DRVCTRL3_AVB_TD2(x) ((uint32_t)(x) << 24U) |
| 482 | #define DRVCTRL3_AVB_TD3(x) ((uint32_t)(x) << 20U) |
| 483 | #define DRVCTRL3_AVB_TXCREFCLK(x) ((uint32_t)(x) << 16U) |
| 484 | #define DRVCTRL3_AVB_MDIO(x) ((uint32_t)(x) << 12U) |
| 485 | #define DRVCTRL3_AVB_MDC(x) ((uint32_t)(x) << 8U) |
| 486 | #define DRVCTRL3_AVB_MAGIC(x) ((uint32_t)(x) << 4U) |
| 487 | #define DRVCTRL3_AVB_PHY_INT(x) ((uint32_t)(x) << 0U) |
| 488 | #define DRVCTRL4_AVB_LINK(x) ((uint32_t)(x) << 28U) |
| 489 | #define DRVCTRL4_AVB_AVTP_MATCH(x) ((uint32_t)(x) << 24U) |
| 490 | #define DRVCTRL4_AVB_AVTP_CAPTURE(x) ((uint32_t)(x) << 20U) |
| 491 | #define DRVCTRL4_IRQ0(x) ((uint32_t)(x) << 16U) |
| 492 | #define DRVCTRL4_IRQ1(x) ((uint32_t)(x) << 12U) |
| 493 | #define DRVCTRL4_IRQ2(x) ((uint32_t)(x) << 8U) |
| 494 | #define DRVCTRL4_IRQ3(x) ((uint32_t)(x) << 4U) |
| 495 | #define DRVCTRL4_IRQ4(x) ((uint32_t)(x) << 0U) |
| 496 | #define DRVCTRL5_IRQ5(x) ((uint32_t)(x) << 28U) |
| 497 | #define DRVCTRL5_PWM0(x) ((uint32_t)(x) << 24U) |
| 498 | #define DRVCTRL5_PWM1(x) ((uint32_t)(x) << 20U) |
| 499 | #define DRVCTRL5_PWM2(x) ((uint32_t)(x) << 16U) |
| 500 | #define DRVCTRL5_A0(x) ((uint32_t)(x) << 12U) |
| 501 | #define DRVCTRL5_A1(x) ((uint32_t)(x) << 8U) |
| 502 | #define DRVCTRL5_A2(x) ((uint32_t)(x) << 4U) |
| 503 | #define DRVCTRL5_A3(x) ((uint32_t)(x) << 0U) |
| 504 | #define DRVCTRL6_A4(x) ((uint32_t)(x) << 28U) |
| 505 | #define DRVCTRL6_A5(x) ((uint32_t)(x) << 24U) |
| 506 | #define DRVCTRL6_A6(x) ((uint32_t)(x) << 20U) |
| 507 | #define DRVCTRL6_A7(x) ((uint32_t)(x) << 16U) |
| 508 | #define DRVCTRL6_A8(x) ((uint32_t)(x) << 12U) |
| 509 | #define DRVCTRL6_A9(x) ((uint32_t)(x) << 8U) |
| 510 | #define DRVCTRL6_A10(x) ((uint32_t)(x) << 4U) |
| 511 | #define DRVCTRL6_A11(x) ((uint32_t)(x) << 0U) |
| 512 | #define DRVCTRL7_A12(x) ((uint32_t)(x) << 28U) |
| 513 | #define DRVCTRL7_A13(x) ((uint32_t)(x) << 24U) |
| 514 | #define DRVCTRL7_A14(x) ((uint32_t)(x) << 20U) |
| 515 | #define DRVCTRL7_A15(x) ((uint32_t)(x) << 16U) |
| 516 | #define DRVCTRL7_A16(x) ((uint32_t)(x) << 12U) |
| 517 | #define DRVCTRL7_A17(x) ((uint32_t)(x) << 8U) |
| 518 | #define DRVCTRL7_A18(x) ((uint32_t)(x) << 4U) |
| 519 | #define DRVCTRL7_A19(x) ((uint32_t)(x) << 0U) |
| 520 | #define DRVCTRL8_CLKOUT(x) ((uint32_t)(x) << 28U) |
| 521 | #define DRVCTRL8_CS0(x) ((uint32_t)(x) << 24U) |
| 522 | #define DRVCTRL8_CS1_A2(x) ((uint32_t)(x) << 20U) |
| 523 | #define DRVCTRL8_BS(x) ((uint32_t)(x) << 16U) |
| 524 | #define DRVCTRL8_RD(x) ((uint32_t)(x) << 12U) |
| 525 | #define DRVCTRL8_RD_W(x) ((uint32_t)(x) << 8U) |
| 526 | #define DRVCTRL8_WE0(x) ((uint32_t)(x) << 4U) |
| 527 | #define DRVCTRL8_WE1(x) ((uint32_t)(x) << 0U) |
| 528 | #define DRVCTRL9_EX_WAIT0(x) ((uint32_t)(x) << 28U) |
| 529 | #define DRVCTRL9_PRESETOU(x) ((uint32_t)(x) << 24U) |
| 530 | #define DRVCTRL9_D0(x) ((uint32_t)(x) << 20U) |
| 531 | #define DRVCTRL9_D1(x) ((uint32_t)(x) << 16U) |
| 532 | #define DRVCTRL9_D2(x) ((uint32_t)(x) << 12U) |
| 533 | #define DRVCTRL9_D3(x) ((uint32_t)(x) << 8U) |
| 534 | #define DRVCTRL9_D4(x) ((uint32_t)(x) << 4U) |
| 535 | #define DRVCTRL9_D5(x) ((uint32_t)(x) << 0U) |
| 536 | #define DRVCTRL10_D6(x) ((uint32_t)(x) << 28U) |
| 537 | #define DRVCTRL10_D7(x) ((uint32_t)(x) << 24U) |
| 538 | #define DRVCTRL10_D8(x) ((uint32_t)(x) << 20U) |
| 539 | #define DRVCTRL10_D9(x) ((uint32_t)(x) << 16U) |
| 540 | #define DRVCTRL10_D10(x) ((uint32_t)(x) << 12U) |
| 541 | #define DRVCTRL10_D11(x) ((uint32_t)(x) << 8U) |
| 542 | #define DRVCTRL10_D12(x) ((uint32_t)(x) << 4U) |
| 543 | #define DRVCTRL10_D13(x) ((uint32_t)(x) << 0U) |
| 544 | #define DRVCTRL11_D14(x) ((uint32_t)(x) << 28U) |
| 545 | #define DRVCTRL11_D15(x) ((uint32_t)(x) << 24U) |
| 546 | #define DRVCTRL11_AVS1(x) ((uint32_t)(x) << 20U) |
| 547 | #define DRVCTRL11_AVS2(x) ((uint32_t)(x) << 16U) |
| 548 | #define DRVCTRL11_HDMI0_CEC(x) ((uint32_t)(x) << 12U) |
| 549 | #define DRVCTRL11_HDMI1_CEC(x) ((uint32_t)(x) << 8U) |
| 550 | #define DRVCTRL11_DU_DOTCLKIN0(x) ((uint32_t)(x) << 4U) |
| 551 | #define DRVCTRL11_DU_DOTCLKIN1(x) ((uint32_t)(x) << 0U) |
| 552 | #define DRVCTRL12_DU_DOTCLKIN2(x) ((uint32_t)(x) << 28U) |
| 553 | #define DRVCTRL12_DU_DOTCLKIN3(x) ((uint32_t)(x) << 24U) |
| 554 | #define DRVCTRL12_DU_FSCLKST(x) ((uint32_t)(x) << 20U) |
| 555 | #define DRVCTRL12_DU_TMS(x) ((uint32_t)(x) << 4U) |
| 556 | #define DRVCTRL13_TDO(x) ((uint32_t)(x) << 28U) |
| 557 | #define DRVCTRL13_ASEBRK(x) ((uint32_t)(x) << 24U) |
| 558 | #define DRVCTRL13_SD0_CLK(x) ((uint32_t)(x) << 20U) |
| 559 | #define DRVCTRL13_SD0_CMD(x) ((uint32_t)(x) << 16U) |
| 560 | #define DRVCTRL13_SD0_DAT0(x) ((uint32_t)(x) << 12U) |
| 561 | #define DRVCTRL13_SD0_DAT1(x) ((uint32_t)(x) << 8U) |
| 562 | #define DRVCTRL13_SD0_DAT2(x) ((uint32_t)(x) << 4U) |
| 563 | #define DRVCTRL13_SD0_DAT3(x) ((uint32_t)(x) << 0U) |
| 564 | #define DRVCTRL14_SD1_CLK(x) ((uint32_t)(x) << 28U) |
| 565 | #define DRVCTRL14_SD1_CMD(x) ((uint32_t)(x) << 24U) |
| 566 | #define DRVCTRL14_SD1_DAT0(x) ((uint32_t)(x) << 20U) |
| 567 | #define DRVCTRL14_SD1_DAT1(x) ((uint32_t)(x) << 16U) |
| 568 | #define DRVCTRL14_SD1_DAT2(x) ((uint32_t)(x) << 12U) |
| 569 | #define DRVCTRL14_SD1_DAT3(x) ((uint32_t)(x) << 8U) |
| 570 | #define DRVCTRL14_SD2_CLK(x) ((uint32_t)(x) << 4U) |
| 571 | #define DRVCTRL14_SD2_CMD(x) ((uint32_t)(x) << 0U) |
| 572 | #define DRVCTRL15_SD2_DAT0(x) ((uint32_t)(x) << 28U) |
| 573 | #define DRVCTRL15_SD2_DAT1(x) ((uint32_t)(x) << 24U) |
| 574 | #define DRVCTRL15_SD2_DAT2(x) ((uint32_t)(x) << 20U) |
| 575 | #define DRVCTRL15_SD2_DAT3(x) ((uint32_t)(x) << 16U) |
| 576 | #define DRVCTRL15_SD2_DS(x) ((uint32_t)(x) << 12U) |
| 577 | #define DRVCTRL15_SD3_CLK(x) ((uint32_t)(x) << 8U) |
| 578 | #define DRVCTRL15_SD3_CMD(x) ((uint32_t)(x) << 4U) |
| 579 | #define DRVCTRL15_SD3_DAT0(x) ((uint32_t)(x) << 0U) |
| 580 | #define DRVCTRL16_SD3_DAT1(x) ((uint32_t)(x) << 28U) |
| 581 | #define DRVCTRL16_SD3_DAT2(x) ((uint32_t)(x) << 24U) |
| 582 | #define DRVCTRL16_SD3_DAT3(x) ((uint32_t)(x) << 20U) |
| 583 | #define DRVCTRL16_SD3_DAT4(x) ((uint32_t)(x) << 16U) |
| 584 | #define DRVCTRL16_SD3_DAT5(x) ((uint32_t)(x) << 12U) |
| 585 | #define DRVCTRL16_SD3_DAT6(x) ((uint32_t)(x) << 8U) |
| 586 | #define DRVCTRL16_SD3_DAT7(x) ((uint32_t)(x) << 4U) |
| 587 | #define DRVCTRL16_SD3_DS(x) ((uint32_t)(x) << 0U) |
| 588 | #define DRVCTRL17_SD0_CD(x) ((uint32_t)(x) << 28U) |
| 589 | #define DRVCTRL17_SD0_WP(x) ((uint32_t)(x) << 24U) |
| 590 | #define DRVCTRL17_SD1_CD(x) ((uint32_t)(x) << 20U) |
| 591 | #define DRVCTRL17_SD1_WP(x) ((uint32_t)(x) << 16U) |
| 592 | #define DRVCTRL17_SCK0(x) ((uint32_t)(x) << 12U) |
| 593 | #define DRVCTRL17_RX0(x) ((uint32_t)(x) << 8U) |
| 594 | #define DRVCTRL17_TX0(x) ((uint32_t)(x) << 4U) |
| 595 | #define DRVCTRL17_CTS0(x) ((uint32_t)(x) << 0U) |
| 596 | #define DRVCTRL18_RTS0_TANS(x) ((uint32_t)(x) << 28U) |
| 597 | #define DRVCTRL18_RX1(x) ((uint32_t)(x) << 24U) |
| 598 | #define DRVCTRL18_TX1(x) ((uint32_t)(x) << 20U) |
| 599 | #define DRVCTRL18_CTS1(x) ((uint32_t)(x) << 16U) |
| 600 | #define DRVCTRL18_RTS1_TANS(x) ((uint32_t)(x) << 12U) |
| 601 | #define DRVCTRL18_SCK2(x) ((uint32_t)(x) << 8U) |
| 602 | #define DRVCTRL18_TX2(x) ((uint32_t)(x) << 4U) |
| 603 | #define DRVCTRL18_RX2(x) ((uint32_t)(x) << 0U) |
| 604 | #define DRVCTRL19_HSCK0(x) ((uint32_t)(x) << 28U) |
| 605 | #define DRVCTRL19_HRX0(x) ((uint32_t)(x) << 24U) |
| 606 | #define DRVCTRL19_HTX0(x) ((uint32_t)(x) << 20U) |
| 607 | #define DRVCTRL19_HCTS0(x) ((uint32_t)(x) << 16U) |
| 608 | #define DRVCTRL19_HRTS0(x) ((uint32_t)(x) << 12U) |
| 609 | #define DRVCTRL19_MSIOF0_SCK(x) ((uint32_t)(x) << 8U) |
| 610 | #define DRVCTRL19_MSIOF0_SYNC(x) ((uint32_t)(x) << 4U) |
| 611 | #define DRVCTRL19_MSIOF0_SS1(x) ((uint32_t)(x) << 0U) |
| 612 | #define DRVCTRL20_MSIOF0_TXD(x) ((uint32_t)(x) << 28U) |
| 613 | #define DRVCTRL20_MSIOF0_SS2(x) ((uint32_t)(x) << 24U) |
| 614 | #define DRVCTRL20_MSIOF0_RXD(x) ((uint32_t)(x) << 20U) |
| 615 | #define DRVCTRL20_MLB_CLK(x) ((uint32_t)(x) << 16U) |
| 616 | #define DRVCTRL20_MLB_SIG(x) ((uint32_t)(x) << 12U) |
| 617 | #define DRVCTRL20_MLB_DAT(x) ((uint32_t)(x) << 8U) |
| 618 | #define DRVCTRL20_MLB_REF(x) ((uint32_t)(x) << 4U) |
| 619 | #define DRVCTRL20_SSI_SCK0129(x) ((uint32_t)(x) << 0U) |
| 620 | #define DRVCTRL21_SSI_WS0129(x) ((uint32_t)(x) << 28U) |
| 621 | #define DRVCTRL21_SSI_SDATA0(x) ((uint32_t)(x) << 24U) |
| 622 | #define DRVCTRL21_SSI_SDATA1(x) ((uint32_t)(x) << 20U) |
| 623 | #define DRVCTRL21_SSI_SDATA2(x) ((uint32_t)(x) << 16U) |
| 624 | #define DRVCTRL21_SSI_SCK34(x) ((uint32_t)(x) << 12U) |
| 625 | #define DRVCTRL21_SSI_WS34(x) ((uint32_t)(x) << 8U) |
| 626 | #define DRVCTRL21_SSI_SDATA3(x) ((uint32_t)(x) << 4U) |
| 627 | #define DRVCTRL21_SSI_SCK4(x) ((uint32_t)(x) << 0U) |
| 628 | #define DRVCTRL22_SSI_WS4(x) ((uint32_t)(x) << 28U) |
| 629 | #define DRVCTRL22_SSI_SDATA4(x) ((uint32_t)(x) << 24U) |
| 630 | #define DRVCTRL22_SSI_SCK5(x) ((uint32_t)(x) << 20U) |
| 631 | #define DRVCTRL22_SSI_WS5(x) ((uint32_t)(x) << 16U) |
| 632 | #define DRVCTRL22_SSI_SDATA5(x) ((uint32_t)(x) << 12U) |
| 633 | #define DRVCTRL22_SSI_SCK6(x) ((uint32_t)(x) << 8U) |
| 634 | #define DRVCTRL22_SSI_WS6(x) ((uint32_t)(x) << 4U) |
| 635 | #define DRVCTRL22_SSI_SDATA6(x) ((uint32_t)(x) << 0U) |
| 636 | #define DRVCTRL23_SSI_SCK78(x) ((uint32_t)(x) << 28U) |
| 637 | #define DRVCTRL23_SSI_WS78(x) ((uint32_t)(x) << 24U) |
| 638 | #define DRVCTRL23_SSI_SDATA7(x) ((uint32_t)(x) << 20U) |
| 639 | #define DRVCTRL23_SSI_SDATA8(x) ((uint32_t)(x) << 16U) |
| 640 | #define DRVCTRL23_SSI_SDATA9(x) ((uint32_t)(x) << 12U) |
| 641 | #define DRVCTRL23_AUDIO_CLKA(x) ((uint32_t)(x) << 8U) |
| 642 | #define DRVCTRL23_AUDIO_CLKB(x) ((uint32_t)(x) << 4U) |
| 643 | #define DRVCTRL23_USB0_PWEN(x) ((uint32_t)(x) << 0U) |
| 644 | #define DRVCTRL24_USB0_OVC(x) ((uint32_t)(x) << 28U) |
| 645 | #define DRVCTRL24_USB1_PWEN(x) ((uint32_t)(x) << 24U) |
| 646 | #define DRVCTRL24_USB1_OVC(x) ((uint32_t)(x) << 20U) |
| 647 | #define DRVCTRL24_USB30_PWEN(x) ((uint32_t)(x) << 16U) |
| 648 | #define DRVCTRL24_USB30_OVC(x) ((uint32_t)(x) << 12U) |
| 649 | #define DRVCTRL24_USB31_PWEN(x) ((uint32_t)(x) << 8U) |
| 650 | #define DRVCTRL24_USB31_OVC(x) ((uint32_t)(x) << 4U) |
| 651 | |
| 652 | #define MOD_SEL0_MSIOF3_A ((uint32_t)0U << 29U) |
| 653 | #define MOD_SEL0_MSIOF3_B ((uint32_t)1U << 29U) |
| 654 | #define MOD_SEL0_MSIOF3_C ((uint32_t)2U << 29U) |
| 655 | #define MOD_SEL0_MSIOF3_D ((uint32_t)3U << 29U) |
| 656 | #define MOD_SEL0_MSIOF3_E ((uint32_t)4U << 29U) |
| 657 | #define MOD_SEL0_MSIOF2_A ((uint32_t)0U << 27U) |
| 658 | #define MOD_SEL0_MSIOF2_B ((uint32_t)1U << 27U) |
| 659 | #define MOD_SEL0_MSIOF2_C ((uint32_t)2U << 27U) |
| 660 | #define MOD_SEL0_MSIOF2_D ((uint32_t)3U << 27U) |
| 661 | #define MOD_SEL0_MSIOF1_A ((uint32_t)0U << 24U) |
| 662 | #define MOD_SEL0_MSIOF1_B ((uint32_t)1U << 24U) |
| 663 | #define MOD_SEL0_MSIOF1_C ((uint32_t)2U << 24U) |
| 664 | #define MOD_SEL0_MSIOF1_D ((uint32_t)3U << 24U) |
| 665 | #define MOD_SEL0_MSIOF1_E ((uint32_t)4U << 24U) |
| 666 | #define MOD_SEL0_MSIOF1_F ((uint32_t)5U << 24U) |
| 667 | #define MOD_SEL0_MSIOF1_G ((uint32_t)6U << 24U) |
| 668 | #define MOD_SEL0_LBSC_A ((uint32_t)0U << 23U) |
| 669 | #define MOD_SEL0_LBSC_B ((uint32_t)1U << 23U) |
| 670 | #define MOD_SEL0_IEBUS_A ((uint32_t)0U << 22U) |
| 671 | #define MOD_SEL0_IEBUS_B ((uint32_t)1U << 22U) |
| 672 | #define MOD_SEL0_I2C2_A ((uint32_t)0U << 21U) |
| 673 | #define MOD_SEL0_I2C2_B ((uint32_t)1U << 21U) |
| 674 | #define MOD_SEL0_I2C1_A ((uint32_t)0U << 20U) |
| 675 | #define MOD_SEL0_I2C1_B ((uint32_t)1U << 20U) |
| 676 | #define MOD_SEL0_HSCIF4_A ((uint32_t)0U << 19U) |
| 677 | #define MOD_SEL0_HSCIF4_B ((uint32_t)1U << 19U) |
| 678 | #define MOD_SEL0_HSCIF3_A ((uint32_t)0U << 17U) |
| 679 | #define MOD_SEL0_HSCIF3_B ((uint32_t)1U << 17U) |
| 680 | #define MOD_SEL0_HSCIF3_C ((uint32_t)2U << 17U) |
| 681 | #define MOD_SEL0_HSCIF3_D ((uint32_t)3U << 17U) |
| 682 | #define MOD_SEL0_HSCIF1_A ((uint32_t)0U << 16U) |
| 683 | #define MOD_SEL0_HSCIF1_B ((uint32_t)1U << 16U) |
| 684 | #define MOD_SEL0_FSO_A ((uint32_t)0U << 15U) |
| 685 | #define MOD_SEL0_FSO_B ((uint32_t)1U << 15U) |
| 686 | #define MOD_SEL0_HSCIF2_A ((uint32_t)0U << 13U) |
| 687 | #define MOD_SEL0_HSCIF2_B ((uint32_t)1U << 13U) |
| 688 | #define MOD_SEL0_HSCIF2_C ((uint32_t)2U << 13U) |
| 689 | #define MOD_SEL0_ETHERAVB_A ((uint32_t)0U << 12U) |
| 690 | #define MOD_SEL0_ETHERAVB_B ((uint32_t)1U << 12U) |
| 691 | #define MOD_SEL0_DRIF3_A ((uint32_t)0U << 11U) |
| 692 | #define MOD_SEL0_DRIF3_B ((uint32_t)1U << 11U) |
| 693 | #define MOD_SEL0_DRIF2_A ((uint32_t)0U << 10U) |
| 694 | #define MOD_SEL0_DRIF2_B ((uint32_t)1U << 10U) |
| 695 | #define MOD_SEL0_DRIF1_A ((uint32_t)0U << 8U) |
| 696 | #define MOD_SEL0_DRIF1_B ((uint32_t)1U << 8U) |
| 697 | #define MOD_SEL0_DRIF1_C ((uint32_t)2U << 8U) |
| 698 | #define MOD_SEL0_DRIF0_A ((uint32_t)0U << 6U) |
| 699 | #define MOD_SEL0_DRIF0_B ((uint32_t)1U << 6U) |
| 700 | #define MOD_SEL0_DRIF0_C ((uint32_t)2U << 6U) |
| 701 | #define MOD_SEL0_CANFD0_A ((uint32_t)0U << 5U) |
| 702 | #define MOD_SEL0_CANFD0_B ((uint32_t)1U << 5U) |
| 703 | #define MOD_SEL0_ADG_A_A ((uint32_t)0U << 3U) |
| 704 | #define MOD_SEL0_ADG_A_B ((uint32_t)1U << 3U) |
| 705 | #define MOD_SEL0_ADG_A_C ((uint32_t)2U << 3U) |
| 706 | #define MOD_SEL1_TSIF1_A ((uint32_t)0U << 30U) |
| 707 | #define MOD_SEL1_TSIF1_B ((uint32_t)1U << 30U) |
| 708 | #define MOD_SEL1_TSIF1_C ((uint32_t)2U << 30U) |
| 709 | #define MOD_SEL1_TSIF1_D ((uint32_t)3U << 30U) |
| 710 | #define MOD_SEL1_TSIF0_A ((uint32_t)0U << 27U) |
| 711 | #define MOD_SEL1_TSIF0_B ((uint32_t)1U << 27U) |
| 712 | #define MOD_SEL1_TSIF0_C ((uint32_t)2U << 27U) |
| 713 | #define MOD_SEL1_TSIF0_D ((uint32_t)3U << 27U) |
| 714 | #define MOD_SEL1_TSIF0_E ((uint32_t)4U << 27U) |
| 715 | #define MOD_SEL1_TIMER_TMU_A ((uint32_t)0U << 26U) |
| 716 | #define MOD_SEL1_TIMER_TMU_B ((uint32_t)1U << 26U) |
| 717 | #define MOD_SEL1_SSP1_1_A ((uint32_t)0U << 24U) |
| 718 | #define MOD_SEL1_SSP1_1_B ((uint32_t)1U << 24U) |
| 719 | #define MOD_SEL1_SSP1_1_C ((uint32_t)2U << 24U) |
| 720 | #define MOD_SEL1_SSP1_1_D ((uint32_t)3U << 24U) |
| 721 | #define MOD_SEL1_SSP1_0_A ((uint32_t)0U << 21U) |
| 722 | #define MOD_SEL1_SSP1_0_B ((uint32_t)1U << 21U) |
| 723 | #define MOD_SEL1_SSP1_0_C ((uint32_t)2U << 21U) |
| 724 | #define MOD_SEL1_SSP1_0_D ((uint32_t)3U << 21U) |
| 725 | #define MOD_SEL1_SSP1_0_E ((uint32_t)4U << 21U) |
| 726 | #define MOD_SEL1_SSI_A ((uint32_t)0U << 20U) |
| 727 | #define MOD_SEL1_SSI_B ((uint32_t)1U << 20U) |
| 728 | #define MOD_SEL1_SPEED_PULSE_IF_A ((uint32_t)0U << 19U) |
| 729 | #define MOD_SEL1_SPEED_PULSE_IF_B ((uint32_t)1U << 19U) |
| 730 | #define MOD_SEL1_SIMCARD_A ((uint32_t)0U << 17U) |
| 731 | #define MOD_SEL1_SIMCARD_B ((uint32_t)1U << 17U) |
| 732 | #define MOD_SEL1_SIMCARD_C ((uint32_t)2U << 17U) |
| 733 | #define MOD_SEL1_SIMCARD_D ((uint32_t)3U << 17U) |
| 734 | #define MOD_SEL1_SDHI2_A ((uint32_t)0U << 16U) |
| 735 | #define MOD_SEL1_SDHI2_B ((uint32_t)1U << 16U) |
| 736 | #define MOD_SEL1_SCIF4_A ((uint32_t)0U << 14U) |
| 737 | #define MOD_SEL1_SCIF4_B ((uint32_t)1U << 14U) |
| 738 | #define MOD_SEL1_SCIF4_C ((uint32_t)2U << 14U) |
| 739 | #define MOD_SEL1_SCIF3_A ((uint32_t)0U << 13U) |
| 740 | #define MOD_SEL1_SCIF3_B ((uint32_t)1U << 13U) |
| 741 | #define MOD_SEL1_SCIF2_A ((uint32_t)0U << 12U) |
| 742 | #define MOD_SEL1_SCIF2_B ((uint32_t)1U << 12U) |
| 743 | #define MOD_SEL1_SCIF1_A ((uint32_t)0U << 11U) |
| 744 | #define MOD_SEL1_SCIF1_B ((uint32_t)1U << 11U) |
| 745 | #define MOD_SEL1_SCIF_A ((uint32_t)0U << 10U) |
| 746 | #define MOD_SEL1_SCIF_B ((uint32_t)1U << 10U) |
| 747 | #define MOD_SEL1_REMOCON_A ((uint32_t)0U << 9U) |
| 748 | #define MOD_SEL1_REMOCON_B ((uint32_t)1U << 9U) |
| 749 | #define MOD_SEL1_RCAN0_A ((uint32_t)0U << 6U) |
| 750 | #define MOD_SEL1_RCAN0_B ((uint32_t)1U << 6U) |
| 751 | #define MOD_SEL1_PWM6_A ((uint32_t)0U << 5U) |
| 752 | #define MOD_SEL1_PWM6_B ((uint32_t)1U << 5U) |
| 753 | #define MOD_SEL1_PWM5_A ((uint32_t)0U << 4U) |
| 754 | #define MOD_SEL1_PWM5_B ((uint32_t)1U << 4U) |
| 755 | #define MOD_SEL1_PWM4_A ((uint32_t)0U << 3U) |
| 756 | #define MOD_SEL1_PWM4_B ((uint32_t)1U << 3U) |
| 757 | #define MOD_SEL1_PWM3_A ((uint32_t)0U << 2U) |
| 758 | #define MOD_SEL1_PWM3_B ((uint32_t)1U << 2U) |
| 759 | #define MOD_SEL1_PWM2_A ((uint32_t)0U << 1U) |
| 760 | #define MOD_SEL1_PWM2_B ((uint32_t)1U << 1U) |
| 761 | #define MOD_SEL1_PWM1_A ((uint32_t)0U << 0U) |
| 762 | #define MOD_SEL1_PWM1_B ((uint32_t)1U << 0U) |
| 763 | #define MOD_SEL2_I2C_5_A ((uint32_t)0U << 31U) |
| 764 | #define MOD_SEL2_I2C_5_B ((uint32_t)1U << 31U) |
| 765 | #define MOD_SEL2_I2C_3_A ((uint32_t)0U << 30U) |
| 766 | #define MOD_SEL2_I2C_3_B ((uint32_t)1U << 30U) |
| 767 | #define MOD_SEL2_I2C_0_A ((uint32_t)0U << 29U) |
| 768 | #define MOD_SEL2_I2C_0_B ((uint32_t)1U << 29U) |
| 769 | #define MOD_SEL2_FM_A ((uint32_t)0U << 27U) |
| 770 | #define MOD_SEL2_FM_B ((uint32_t)1U << 27U) |
| 771 | #define MOD_SEL2_FM_C ((uint32_t)2U << 27U) |
| 772 | #define MOD_SEL2_FM_D ((uint32_t)3U << 27U) |
| 773 | #define MOD_SEL2_SCIF5_A ((uint32_t)0U << 26U) |
| 774 | #define MOD_SEL2_SCIF5_B ((uint32_t)1U << 26U) |
| 775 | #define MOD_SEL2_I2C6_A ((uint32_t)0U << 23U) |
| 776 | #define MOD_SEL2_I2C6_B ((uint32_t)1U << 23U) |
| 777 | #define MOD_SEL2_I2C6_C ((uint32_t)2U << 23U) |
| 778 | #define MOD_SEL2_NDF_A ((uint32_t)0U << 22U) |
| 779 | #define MOD_SEL2_NDF_B ((uint32_t)1U << 22U) |
| 780 | #define MOD_SEL2_SSI2_A ((uint32_t)0U << 21U) |
| 781 | #define MOD_SEL2_SSI2_B ((uint32_t)1U << 21U) |
| 782 | #define MOD_SEL2_SSI9_A ((uint32_t)0U << 20U) |
| 783 | #define MOD_SEL2_SSI9_B ((uint32_t)1U << 20U) |
| 784 | #define MOD_SEL2_TIMER_TMU2_A ((uint32_t)0U << 19U) |
| 785 | #define MOD_SEL2_TIMER_TMU2_B ((uint32_t)1U << 19U) |
| 786 | #define MOD_SEL2_ADG_B_A ((uint32_t)0U << 18U) |
| 787 | #define MOD_SEL2_ADG_B_B ((uint32_t)1U << 18U) |
| 788 | #define MOD_SEL2_ADG_C_A ((uint32_t)0U << 17U) |
| 789 | #define MOD_SEL2_ADG_C_B ((uint32_t)1U << 17U) |
| 790 | #define MOD_SEL2_VIN4_A ((uint32_t)0U << 0U) |
| 791 | #define MOD_SEL2_VIN4_B ((uint32_t)1U << 0U) |
| 792 | |
| 793 | /* SCIF3 Registers for Dummy write */ |
| 794 | #define SCIF3_BASE (0xE6C50000U) |
| 795 | #define SCIF3_SCFCR (SCIF3_BASE + 0x0018U) |
| 796 | #define SCIF3_SCFDR (SCIF3_BASE + 0x001CU) |
| 797 | #define SCFCR_DATA (0x0000U) |
| 798 | |
| 799 | /* Realtime module stop control */ |
| 800 | #define CPG_BASE (0xE6150000U) |
| 801 | #define CPG_SCMSTPCR0 (CPG_BASE + 0x0B20U) |
| 802 | #define CPG_MSTPSR0 (CPG_BASE + 0x0030U) |
| 803 | #define SCMSTPCR0_RTDMAC (0x00200000U) |
| 804 | |
| 805 | /* RT-DMAC Registers */ |
| 806 | #define RTDMAC_CH (0U) /* choose 0 to 15 */ |
| 807 | |
| 808 | #define RTDMAC_BASE (0xFFC10000U) |
| 809 | #define RTDMAC_RDMOR (RTDMAC_BASE + 0x0060U) |
| 810 | #define RTDMAC_RDMCHCLR (RTDMAC_BASE + 0x0080U) |
| 811 | #define RTDMAC_RDMSAR(x) (RTDMAC_BASE + 0x8000U + (0x80U * (x))) |
| 812 | #define RTDMAC_RDMDAR(x) (RTDMAC_BASE + 0x8004U + (0x80U * (x))) |
| 813 | #define RTDMAC_RDMTCR(x) (RTDMAC_BASE + 0x8008U + (0x80U * (x))) |
| 814 | #define RTDMAC_RDMCHCR(x) (RTDMAC_BASE + 0x800CU + (0x80U * (x))) |
| 815 | #define RTDMAC_RDMCHCRB(x) (RTDMAC_BASE + 0x801CU + (0x80U * (x))) |
| 816 | #define RTDMAC_RDMDPBASE(x) (RTDMAC_BASE + 0x8050U + (0x80U * (x))) |
| 817 | #define RTDMAC_DESC_BASE (RTDMAC_BASE + 0xA000U) |
| 818 | #define RTDMAC_DESC_RDMSAR (RTDMAC_DESC_BASE + 0x0000U) |
| 819 | #define RTDMAC_DESC_RDMDAR (RTDMAC_DESC_BASE + 0x0004U) |
| 820 | #define RTDMAC_DESC_RDMTCR (RTDMAC_DESC_BASE + 0x0008U) |
| 821 | |
| 822 | #define RDMOR_DME (0x0001U) /* DMA Master Enable */ |
| 823 | #define RDMCHCR_DPM_INFINITE (0x30000000U) /* Infinite repeat mode */ |
| 824 | #define RDMCHCR_RPT_TCR (0x02000000U) /* enable to update TCR */ |
| 825 | #define RDMCHCR_TS_2 (0x00000008U) /* Word(2byte) units transfer */ |
| 826 | #define RDMCHCR_RS_AUTO (0x00000400U) /* Auto request */ |
| 827 | #define RDMCHCR_DE (0x00000001U) /* DMA Enable */ |
| 828 | #define RDMCHCRB_DRST (0x00008000U) /* Descriptor reset */ |
| 829 | #define RDMCHCRB_SLM_256 (0x00000080U) /* once in 256 clock cycle */ |
| 830 | #define RDMDPBASE_SEL_EXT (0x00000001U) /* External memory use */ |
| 831 | |
| 832 | static void StartRtDma0_Descriptor(void); |
| 833 | static void pfc_reg_write(uint32_t addr, uint32_t data); |
| 834 | |
| 835 | static void StartRtDma0_Descriptor(void) |
| 836 | { |
| 837 | uint32_t reg; |
| 838 | |
| 839 | reg = mmio_read_32(RCAR_PRR); |
| 840 | reg &= (RCAR_PRODUCT_MASK | RCAR_CUT_MASK); |
| 841 | if (reg == (RCAR_PRODUCT_M3_CUT10)) { |
| 842 | /* Enable clock supply to RTDMAC. */ |
| 843 | mstpcr_write(CPG_SCMSTPCR0, CPG_MSTPSR0, SCMSTPCR0_RTDMAC); |
| 844 | |
| 845 | /* Initialize ch0, Reset Descriptor */ |
| 846 | mmio_write_32(RTDMAC_RDMCHCLR, ((uint32_t) 1U << RTDMAC_CH)); |
| 847 | mmio_write_32(RTDMAC_RDMCHCRB(RTDMAC_CH), RDMCHCRB_DRST); |
| 848 | |
| 849 | /* Enable DMA */ |
| 850 | mmio_write_16(RTDMAC_RDMOR, RDMOR_DME); |
| 851 | |
| 852 | /* Set first transfer */ |
| 853 | mmio_write_32(RTDMAC_RDMSAR(RTDMAC_CH), RCAR_PRR); |
| 854 | mmio_write_32(RTDMAC_RDMDAR(RTDMAC_CH), SCIF3_SCFDR); |
| 855 | mmio_write_32(RTDMAC_RDMTCR(RTDMAC_CH), 0x00000001U); |
| 856 | |
| 857 | /* Set descriptor */ |
| 858 | mmio_write_32(RTDMAC_DESC_RDMSAR, 0x00000000U); |
| 859 | mmio_write_32(RTDMAC_DESC_RDMDAR, 0x00000000U); |
| 860 | mmio_write_32(RTDMAC_DESC_RDMTCR, 0x00200000U); |
| 861 | mmio_write_32(RTDMAC_RDMCHCRB(RTDMAC_CH), RDMCHCRB_SLM_256); |
| 862 | mmio_write_32(RTDMAC_RDMDPBASE(RTDMAC_CH), RTDMAC_DESC_BASE |
| 863 | | RDMDPBASE_SEL_EXT); |
| 864 | |
| 865 | /* Set transfer parameter, Start transfer */ |
| 866 | mmio_write_32(RTDMAC_RDMCHCR(RTDMAC_CH), RDMCHCR_DPM_INFINITE |
| 867 | | RDMCHCR_RPT_TCR |
| 868 | | RDMCHCR_TS_2 | RDMCHCR_RS_AUTO | RDMCHCR_DE); |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | static void pfc_reg_write(uint32_t addr, uint32_t data) |
| 873 | { |
| 874 | uint32_t prr; |
| 875 | |
| 876 | prr = mmio_read_32(RCAR_PRR); |
| 877 | prr &= (RCAR_PRODUCT_MASK | RCAR_CUT_MASK); |
| 878 | |
| 879 | mmio_write_32(PFC_PMMR, ~data); |
| 880 | if (prr == (RCAR_PRODUCT_M3_CUT10)) { |
| 881 | mmio_write_16(SCIF3_SCFCR, SCFCR_DATA); /* Dummy write */ |
| 882 | } |
| 883 | mmio_write_32((uintptr_t) addr, data); |
| 884 | if (prr == (RCAR_PRODUCT_M3_CUT10)) { |
| 885 | mmio_write_16(SCIF3_SCFCR, SCFCR_DATA); /* Dummy write */ |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | void pfc_init_m3(void) |
| 890 | { |
| 891 | uint32_t reg; |
| 892 | |
| 893 | /* Work around for PFC eratta */ |
| 894 | StartRtDma0_Descriptor(); |
| 895 | |
| 896 | /* initialize module select */ |
| 897 | pfc_reg_write(PFC_MOD_SEL0, MOD_SEL0_MSIOF3_A |
| 898 | | MOD_SEL0_MSIOF2_A |
| 899 | | MOD_SEL0_MSIOF1_A |
| 900 | | MOD_SEL0_LBSC_A |
| 901 | | MOD_SEL0_IEBUS_A |
| 902 | | MOD_SEL0_I2C2_A |
| 903 | | MOD_SEL0_I2C1_A |
| 904 | | MOD_SEL0_HSCIF4_A |
| 905 | | MOD_SEL0_HSCIF3_A |
| 906 | | MOD_SEL0_HSCIF1_A |
| 907 | | MOD_SEL0_FSO_A |
| 908 | | MOD_SEL0_HSCIF2_A |
| 909 | | MOD_SEL0_ETHERAVB_A |
| 910 | | MOD_SEL0_DRIF3_A |
| 911 | | MOD_SEL0_DRIF2_A |
| 912 | | MOD_SEL0_DRIF1_A |
| 913 | | MOD_SEL0_DRIF0_A |
| 914 | | MOD_SEL0_CANFD0_A | MOD_SEL0_ADG_A_A); |
| 915 | pfc_reg_write(PFC_MOD_SEL1, MOD_SEL1_TSIF1_A |
| 916 | | MOD_SEL1_TSIF0_A |
| 917 | | MOD_SEL1_TIMER_TMU_A |
| 918 | | MOD_SEL1_SSP1_1_A |
| 919 | | MOD_SEL1_SSP1_0_A |
| 920 | | MOD_SEL1_SSI_A |
| 921 | | MOD_SEL1_SPEED_PULSE_IF_A |
| 922 | | MOD_SEL1_SIMCARD_A |
| 923 | | MOD_SEL1_SDHI2_A |
| 924 | | MOD_SEL1_SCIF4_A |
| 925 | | MOD_SEL1_SCIF3_A |
| 926 | | MOD_SEL1_SCIF2_A |
| 927 | | MOD_SEL1_SCIF1_A |
| 928 | | MOD_SEL1_SCIF_A |
| 929 | | MOD_SEL1_REMOCON_A |
| 930 | | MOD_SEL1_RCAN0_A |
| 931 | | MOD_SEL1_PWM6_A |
| 932 | | MOD_SEL1_PWM5_A |
| 933 | | MOD_SEL1_PWM4_A |
| 934 | | MOD_SEL1_PWM3_A | MOD_SEL1_PWM2_A | MOD_SEL1_PWM1_A); |
| 935 | pfc_reg_write(PFC_MOD_SEL2, MOD_SEL2_I2C_5_A |
| 936 | | MOD_SEL2_I2C_3_A |
| 937 | | MOD_SEL2_I2C_0_A |
| 938 | | MOD_SEL2_FM_A |
| 939 | | MOD_SEL2_SCIF5_A |
| 940 | | MOD_SEL2_I2C6_A |
| 941 | | MOD_SEL2_NDF_A |
| 942 | | MOD_SEL2_SSI2_A |
| 943 | | MOD_SEL2_SSI9_A |
| 944 | | MOD_SEL2_TIMER_TMU2_A |
| 945 | | MOD_SEL2_ADG_B_A | MOD_SEL2_ADG_C_A | MOD_SEL2_VIN4_A); |
| 946 | |
| 947 | /* initialize peripheral function select */ |
| 948 | pfc_reg_write(PFC_IPSR0, IPSR_28_FUNC(0) |
| 949 | | IPSR_24_FUNC(0) |
| 950 | | IPSR_20_FUNC(0) |
| 951 | | IPSR_16_FUNC(0) |
| 952 | | IPSR_12_FUNC(0) |
| 953 | | IPSR_8_FUNC(0) |
| 954 | | IPSR_4_FUNC(0) |
| 955 | | IPSR_0_FUNC(0)); |
| 956 | pfc_reg_write(PFC_IPSR1, IPSR_28_FUNC(6) |
| 957 | | IPSR_24_FUNC(0) |
| 958 | | IPSR_20_FUNC(0) |
| 959 | | IPSR_16_FUNC(0) |
| 960 | | IPSR_12_FUNC(3) |
| 961 | | IPSR_8_FUNC(3) |
| 962 | | IPSR_4_FUNC(3) |
| 963 | | IPSR_0_FUNC(3)); |
| 964 | pfc_reg_write(PFC_IPSR2, IPSR_28_FUNC(0) |
| 965 | | IPSR_24_FUNC(6) |
| 966 | | IPSR_20_FUNC(6) |
| 967 | | IPSR_16_FUNC(6) |
| 968 | | IPSR_12_FUNC(6) |
| 969 | | IPSR_8_FUNC(6) |
| 970 | | IPSR_4_FUNC(6) |
| 971 | | IPSR_0_FUNC(6)); |
| 972 | pfc_reg_write(PFC_IPSR3, IPSR_28_FUNC(6) |
| 973 | | IPSR_24_FUNC(6) |
| 974 | | IPSR_20_FUNC(6) |
| 975 | | IPSR_16_FUNC(6) |
| 976 | | IPSR_12_FUNC(6) |
| 977 | | IPSR_8_FUNC(0) |
| 978 | | IPSR_4_FUNC(0) |
| 979 | | IPSR_0_FUNC(0)); |
| 980 | pfc_reg_write(PFC_IPSR4, IPSR_28_FUNC(0) |
| 981 | | IPSR_24_FUNC(0) |
| 982 | | IPSR_20_FUNC(0) |
| 983 | | IPSR_16_FUNC(0) |
| 984 | | IPSR_12_FUNC(0) |
| 985 | | IPSR_8_FUNC(6) |
| 986 | | IPSR_4_FUNC(6) |
| 987 | | IPSR_0_FUNC(6)); |
| 988 | pfc_reg_write(PFC_IPSR5, IPSR_28_FUNC(0) |
| 989 | | IPSR_24_FUNC(0) |
| 990 | | IPSR_20_FUNC(0) |
| 991 | | IPSR_16_FUNC(0) |
| 992 | | IPSR_12_FUNC(0) |
| 993 | | IPSR_8_FUNC(6) |
| 994 | | IPSR_4_FUNC(0) |
| 995 | | IPSR_0_FUNC(0)); |
| 996 | pfc_reg_write(PFC_IPSR6, IPSR_28_FUNC(6) |
| 997 | | IPSR_24_FUNC(6) |
| 998 | | IPSR_20_FUNC(6) |
| 999 | | IPSR_16_FUNC(6) |
| 1000 | | IPSR_12_FUNC(6) |
| 1001 | | IPSR_8_FUNC(0) |
| 1002 | | IPSR_4_FUNC(0) |
| 1003 | | IPSR_0_FUNC(0)); |
| 1004 | pfc_reg_write(PFC_IPSR7, IPSR_28_FUNC(0) |
| 1005 | | IPSR_24_FUNC(0) |
| 1006 | | IPSR_20_FUNC(0) |
| 1007 | | IPSR_16_FUNC(0) |
| 1008 | | IPSR_12_FUNC(0) |
| 1009 | | IPSR_8_FUNC(6) |
| 1010 | | IPSR_4_FUNC(6) |
| 1011 | | IPSR_0_FUNC(6)); |
| 1012 | pfc_reg_write(PFC_IPSR8, IPSR_28_FUNC(1) |
| 1013 | | IPSR_24_FUNC(1) |
| 1014 | | IPSR_20_FUNC(1) |
| 1015 | | IPSR_16_FUNC(1) |
| 1016 | | IPSR_12_FUNC(0) |
| 1017 | | IPSR_8_FUNC(0) |
| 1018 | | IPSR_4_FUNC(0) |
| 1019 | | IPSR_0_FUNC(0)); |
| 1020 | pfc_reg_write(PFC_IPSR9, IPSR_28_FUNC(0) |
| 1021 | | IPSR_24_FUNC(0) |
| 1022 | | IPSR_20_FUNC(0) |
| 1023 | | IPSR_16_FUNC(0) |
| 1024 | | IPSR_12_FUNC(0) |
| 1025 | | IPSR_8_FUNC(0) |
| 1026 | | IPSR_4_FUNC(0) |
| 1027 | | IPSR_0_FUNC(0)); |
| 1028 | pfc_reg_write(PFC_IPSR10, IPSR_28_FUNC(1) |
| 1029 | | IPSR_24_FUNC(0) |
| 1030 | | IPSR_20_FUNC(0) |
| 1031 | | IPSR_16_FUNC(0) |
| 1032 | | IPSR_12_FUNC(0) |
| 1033 | | IPSR_8_FUNC(0) |
| 1034 | | IPSR_4_FUNC(0) |
| 1035 | | IPSR_0_FUNC(0)); |
| 1036 | pfc_reg_write(PFC_IPSR11, IPSR_28_FUNC(0) |
| 1037 | | IPSR_24_FUNC(4) |
| 1038 | | IPSR_20_FUNC(0) |
| 1039 | | IPSR_16_FUNC(0) |
| 1040 | | IPSR_12_FUNC(0) |
| 1041 | | IPSR_8_FUNC(0) |
| 1042 | | IPSR_4_FUNC(0) |
| 1043 | | IPSR_0_FUNC(1)); |
| 1044 | pfc_reg_write(PFC_IPSR12, IPSR_28_FUNC(0) |
| 1045 | | IPSR_24_FUNC(0) |
| 1046 | | IPSR_20_FUNC(0) |
| 1047 | | IPSR_16_FUNC(0) |
| 1048 | | IPSR_12_FUNC(0) |
| 1049 | | IPSR_8_FUNC(4) |
| 1050 | | IPSR_4_FUNC(0) |
| 1051 | | IPSR_0_FUNC(0)); |
| 1052 | pfc_reg_write(PFC_IPSR13, IPSR_28_FUNC(8) |
| 1053 | | IPSR_24_FUNC(0) |
| 1054 | | IPSR_20_FUNC(0) |
| 1055 | | IPSR_16_FUNC(0) |
| 1056 | | IPSR_12_FUNC(0) |
| 1057 | | IPSR_8_FUNC(3) |
| 1058 | | IPSR_4_FUNC(0) |
| 1059 | | IPSR_0_FUNC(0)); |
| 1060 | pfc_reg_write(PFC_IPSR14, IPSR_28_FUNC(0) |
| 1061 | | IPSR_24_FUNC(0) |
| 1062 | | IPSR_20_FUNC(0) |
| 1063 | | IPSR_16_FUNC(0) |
| 1064 | | IPSR_12_FUNC(0) |
| 1065 | | IPSR_8_FUNC(0) |
| 1066 | | IPSR_4_FUNC(3) |
| 1067 | | IPSR_0_FUNC(8)); |
| 1068 | pfc_reg_write(PFC_IPSR15, IPSR_28_FUNC(0) |
| 1069 | | IPSR_24_FUNC(0) |
| 1070 | | IPSR_20_FUNC(0) |
| 1071 | | IPSR_16_FUNC(0) |
| 1072 | | IPSR_12_FUNC(0) |
| 1073 | | IPSR_8_FUNC(0) |
| 1074 | | IPSR_4_FUNC(0) |
| 1075 | | IPSR_0_FUNC(0)); |
| 1076 | pfc_reg_write(PFC_IPSR16, IPSR_28_FUNC(0) |
| 1077 | | IPSR_24_FUNC(0) |
| 1078 | | IPSR_20_FUNC(0) |
| 1079 | | IPSR_16_FUNC(0) |
| 1080 | | IPSR_12_FUNC(0) |
| 1081 | | IPSR_8_FUNC(0) |
| 1082 | | IPSR_4_FUNC(0) |
| 1083 | | IPSR_0_FUNC(0)); |
| 1084 | pfc_reg_write(PFC_IPSR17, IPSR_28_FUNC(0) |
| 1085 | | IPSR_24_FUNC(0) |
| 1086 | | IPSR_20_FUNC(0) |
| 1087 | | IPSR_16_FUNC(0) |
| 1088 | | IPSR_12_FUNC(0) |
| 1089 | | IPSR_8_FUNC(0) |
| 1090 | | IPSR_4_FUNC(1) |
| 1091 | | IPSR_0_FUNC(0)); |
| 1092 | pfc_reg_write(PFC_IPSR18, IPSR_4_FUNC(0) |
| 1093 | | IPSR_0_FUNC(0)); |
| 1094 | |
| 1095 | /* initialize GPIO/perihperal function select */ |
| 1096 | pfc_reg_write(PFC_GPSR0, GPSR0_D15 |
| 1097 | | GPSR0_D14 |
| 1098 | | GPSR0_D13 |
| 1099 | | GPSR0_D12 |
| 1100 | | GPSR0_D11 | GPSR0_D10 | GPSR0_D9 | GPSR0_D8); |
| 1101 | pfc_reg_write(PFC_GPSR1, GPSR1_CLKOUT |
| 1102 | | GPSR1_EX_WAIT0_A |
| 1103 | | GPSR1_A19 |
| 1104 | | GPSR1_A18 |
| 1105 | | GPSR1_A17 |
| 1106 | | GPSR1_A16 |
| 1107 | | GPSR1_A15 |
| 1108 | | GPSR1_A14 |
| 1109 | | GPSR1_A13 |
| 1110 | | GPSR1_A12 |
| 1111 | | GPSR1_A7 |
| 1112 | | GPSR1_A6 |
| 1113 | | GPSR1_A5 |
| 1114 | | GPSR1_A4 | GPSR1_A3 | GPSR1_A2 | GPSR1_A1 | GPSR1_A0); |
| 1115 | pfc_reg_write(PFC_GPSR2, GPSR2_AVB_AVTP_CAPTURE_A |
| 1116 | | GPSR2_AVB_AVTP_MATCH_A |
| 1117 | | GPSR2_AVB_LINK |
| 1118 | | GPSR2_AVB_PHY_INT |
| 1119 | | GPSR2_AVB_MDC |
| 1120 | | GPSR2_PWM2_A |
| 1121 | | GPSR2_PWM1_A |
| 1122 | | GPSR2_IRQ5 |
| 1123 | | GPSR2_IRQ4 |
| 1124 | | GPSR2_IRQ3 | GPSR2_IRQ2 | GPSR2_IRQ1 | GPSR2_IRQ0); |
| 1125 | pfc_reg_write(PFC_GPSR3, GPSR3_SD0_WP |
| 1126 | | GPSR3_SD0_CD |
| 1127 | | GPSR3_SD1_DAT3 |
| 1128 | | GPSR3_SD1_DAT2 |
| 1129 | | GPSR3_SD1_DAT1 |
| 1130 | | GPSR3_SD1_DAT0 |
| 1131 | | GPSR3_SD0_DAT3 |
| 1132 | | GPSR3_SD0_DAT2 |
| 1133 | | GPSR3_SD0_DAT1 |
| 1134 | | GPSR3_SD0_DAT0 | GPSR3_SD0_CMD | GPSR3_SD0_CLK); |
| 1135 | pfc_reg_write(PFC_GPSR4, GPSR4_SD3_DAT7 |
| 1136 | | GPSR4_SD3_DAT6 |
| 1137 | | GPSR4_SD3_DAT3 |
| 1138 | | GPSR4_SD3_DAT2 |
| 1139 | | GPSR4_SD3_DAT1 |
| 1140 | | GPSR4_SD3_DAT0 |
| 1141 | | GPSR4_SD3_CMD |
| 1142 | | GPSR4_SD3_CLK |
| 1143 | | GPSR4_SD2_DS |
| 1144 | | GPSR4_SD2_DAT3 |
| 1145 | | GPSR4_SD2_DAT2 |
| 1146 | | GPSR4_SD2_DAT1 |
| 1147 | | GPSR4_SD2_DAT0 | GPSR4_SD2_CMD | GPSR4_SD2_CLK); |
| 1148 | pfc_reg_write(PFC_GPSR5, GPSR5_MSIOF0_SS2 |
| 1149 | | GPSR5_MSIOF0_SS1 |
| 1150 | | GPSR5_MSIOF0_SYNC |
| 1151 | | GPSR5_HRTS0 |
| 1152 | | GPSR5_HCTS0 |
| 1153 | | GPSR5_HTX0 |
| 1154 | | GPSR5_HRX0 |
| 1155 | | GPSR5_HSCK0 |
| 1156 | | GPSR5_RX2_A |
| 1157 | | GPSR5_TX2_A |
| 1158 | | GPSR5_SCK2 |
| 1159 | | GPSR5_RTS1_TANS |
| 1160 | | GPSR5_CTS1 |
| 1161 | | GPSR5_TX1_A |
| 1162 | | GPSR5_RX1_A | GPSR5_RTS0_TANS | GPSR5_SCK0); |
| 1163 | pfc_reg_write(PFC_GPSR6, GPSR6_USB30_OVC |
| 1164 | | GPSR6_USB30_PWEN |
| 1165 | | GPSR6_USB1_OVC |
| 1166 | | GPSR6_USB1_PWEN |
| 1167 | | GPSR6_USB0_OVC |
| 1168 | | GPSR6_USB0_PWEN |
| 1169 | | GPSR6_AUDIO_CLKB_B |
| 1170 | | GPSR6_AUDIO_CLKA_A |
| 1171 | | GPSR6_SSI_SDATA8 |
| 1172 | | GPSR6_SSI_SDATA7 |
| 1173 | | GPSR6_SSI_WS78 |
| 1174 | | GPSR6_SSI_SCK78 |
| 1175 | | GPSR6_SSI_WS6 |
| 1176 | | GPSR6_SSI_SCK6 |
| 1177 | | GPSR6_SSI_SDATA4 |
| 1178 | | GPSR6_SSI_WS4 |
| 1179 | | GPSR6_SSI_SCK4 |
| 1180 | | GPSR6_SSI_SDATA1_A |
| 1181 | | GPSR6_SSI_SDATA0 |
| 1182 | | GPSR6_SSI_WS0129 | GPSR6_SSI_SCK0129); |
| 1183 | pfc_reg_write(PFC_GPSR7, GPSR7_HDMI1_CEC |
| 1184 | | GPSR7_HDMI0_CEC | GPSR7_AVS2 | GPSR7_AVS1); |
| 1185 | |
| 1186 | /* initialize POC control register */ |
| 1187 | pfc_reg_write(PFC_POCCTRL0, POC_SD3_DS_33V |
| 1188 | | POC_SD3_DAT7_33V |
| 1189 | | POC_SD3_DAT6_33V |
| 1190 | | POC_SD3_DAT5_33V |
| 1191 | | POC_SD3_DAT4_33V |
| 1192 | | POC_SD3_DAT3_33V |
| 1193 | | POC_SD3_DAT2_33V |
| 1194 | | POC_SD3_DAT1_33V |
| 1195 | | POC_SD3_DAT0_33V |
| 1196 | | POC_SD3_CMD_33V |
| 1197 | | POC_SD3_CLK_33V |
| 1198 | | POC_SD0_DAT3_33V |
| 1199 | | POC_SD0_DAT2_33V |
| 1200 | | POC_SD0_DAT1_33V |
| 1201 | | POC_SD0_DAT0_33V | POC_SD0_CMD_33V | POC_SD0_CLK_33V); |
| 1202 | |
| 1203 | /* initialize DRV control register */ |
| 1204 | reg = mmio_read_32(PFC_DRVCTRL0); |
| 1205 | reg = ((reg & DRVCTRL0_MASK) | DRVCTRL0_QSPI0_SPCLK(3) |
| 1206 | | DRVCTRL0_QSPI0_MOSI_IO0(3) |
| 1207 | | DRVCTRL0_QSPI0_MISO_IO1(3) |
| 1208 | | DRVCTRL0_QSPI0_IO2(3) |
| 1209 | | DRVCTRL0_QSPI0_IO3(3) |
| 1210 | | DRVCTRL0_QSPI0_SSL(3) |
| 1211 | | DRVCTRL0_QSPI1_SPCLK(3) |
| 1212 | | DRVCTRL0_QSPI1_MOSI_IO0(3)); |
| 1213 | pfc_reg_write(PFC_DRVCTRL0, reg); |
| 1214 | reg = mmio_read_32(PFC_DRVCTRL1); |
| 1215 | reg = ((reg & DRVCTRL1_MASK) | DRVCTRL1_QSPI1_MISO_IO1(3) |
| 1216 | | DRVCTRL1_QSPI1_IO2(3) |
| 1217 | | DRVCTRL1_QSPI1_IO3(3) |
| 1218 | | DRVCTRL1_QSPI1_SS(3) |
| 1219 | | DRVCTRL1_RPC_INT(3) |
| 1220 | | DRVCTRL1_RPC_WP(3) |
| 1221 | | DRVCTRL1_RPC_RESET(3) |
| 1222 | | DRVCTRL1_AVB_RX_CTL(7)); |
| 1223 | pfc_reg_write(PFC_DRVCTRL1, reg); |
| 1224 | reg = mmio_read_32(PFC_DRVCTRL2); |
| 1225 | reg = ((reg & DRVCTRL2_MASK) | DRVCTRL2_AVB_RXC(7) |
| 1226 | | DRVCTRL2_AVB_RD0(7) |
| 1227 | | DRVCTRL2_AVB_RD1(7) |
| 1228 | | DRVCTRL2_AVB_RD2(7) |
| 1229 | | DRVCTRL2_AVB_RD3(7) |
| 1230 | | DRVCTRL2_AVB_TX_CTL(3) |
| 1231 | | DRVCTRL2_AVB_TXC(3) |
| 1232 | | DRVCTRL2_AVB_TD0(3)); |
| 1233 | pfc_reg_write(PFC_DRVCTRL2, reg); |
| 1234 | reg = mmio_read_32(PFC_DRVCTRL3); |
| 1235 | reg = ((reg & DRVCTRL3_MASK) | DRVCTRL3_AVB_TD1(3) |
| 1236 | | DRVCTRL3_AVB_TD2(3) |
| 1237 | | DRVCTRL3_AVB_TD3(3) |
| 1238 | | DRVCTRL3_AVB_TXCREFCLK(7) |
| 1239 | | DRVCTRL3_AVB_MDIO(7) |
| 1240 | | DRVCTRL3_AVB_MDC(7) |
| 1241 | | DRVCTRL3_AVB_MAGIC(7) |
| 1242 | | DRVCTRL3_AVB_PHY_INT(7)); |
| 1243 | pfc_reg_write(PFC_DRVCTRL3, reg); |
| 1244 | reg = mmio_read_32(PFC_DRVCTRL4); |
| 1245 | reg = ((reg & DRVCTRL4_MASK) | DRVCTRL4_AVB_LINK(7) |
| 1246 | | DRVCTRL4_AVB_AVTP_MATCH(7) |
| 1247 | | DRVCTRL4_AVB_AVTP_CAPTURE(7) |
| 1248 | | DRVCTRL4_IRQ0(7) |
| 1249 | | DRVCTRL4_IRQ1(7) |
| 1250 | | DRVCTRL4_IRQ2(7) |
| 1251 | | DRVCTRL4_IRQ3(7) |
| 1252 | | DRVCTRL4_IRQ4(7)); |
| 1253 | pfc_reg_write(PFC_DRVCTRL4, reg); |
| 1254 | reg = mmio_read_32(PFC_DRVCTRL5); |
| 1255 | reg = ((reg & DRVCTRL5_MASK) | DRVCTRL5_IRQ5(7) |
| 1256 | | DRVCTRL5_PWM0(7) |
| 1257 | | DRVCTRL5_PWM1(7) |
| 1258 | | DRVCTRL5_PWM2(7) |
| 1259 | | DRVCTRL5_A0(3) |
| 1260 | | DRVCTRL5_A1(3) |
| 1261 | | DRVCTRL5_A2(3) |
| 1262 | | DRVCTRL5_A3(3)); |
| 1263 | pfc_reg_write(PFC_DRVCTRL5, reg); |
| 1264 | reg = mmio_read_32(PFC_DRVCTRL6); |
| 1265 | reg = ((reg & DRVCTRL6_MASK) | DRVCTRL6_A4(3) |
| 1266 | | DRVCTRL6_A5(3) |
| 1267 | | DRVCTRL6_A6(3) |
| 1268 | | DRVCTRL6_A7(3) |
| 1269 | | DRVCTRL6_A8(7) |
| 1270 | | DRVCTRL6_A9(7) |
| 1271 | | DRVCTRL6_A10(7) |
| 1272 | | DRVCTRL6_A11(7)); |
| 1273 | pfc_reg_write(PFC_DRVCTRL6, reg); |
| 1274 | reg = mmio_read_32(PFC_DRVCTRL7); |
| 1275 | reg = ((reg & DRVCTRL7_MASK) | DRVCTRL7_A12(3) |
| 1276 | | DRVCTRL7_A13(3) |
| 1277 | | DRVCTRL7_A14(3) |
| 1278 | | DRVCTRL7_A15(3) |
| 1279 | | DRVCTRL7_A16(3) |
| 1280 | | DRVCTRL7_A17(3) |
| 1281 | | DRVCTRL7_A18(3) |
| 1282 | | DRVCTRL7_A19(3)); |
| 1283 | pfc_reg_write(PFC_DRVCTRL7, reg); |
| 1284 | reg = mmio_read_32(PFC_DRVCTRL8); |
| 1285 | reg = ((reg & DRVCTRL8_MASK) | DRVCTRL8_CLKOUT(7) |
| 1286 | | DRVCTRL8_CS0(7) |
| 1287 | | DRVCTRL8_CS1_A2(7) |
| 1288 | | DRVCTRL8_BS(7) |
| 1289 | | DRVCTRL8_RD(7) |
| 1290 | | DRVCTRL8_RD_W(7) |
| 1291 | | DRVCTRL8_WE0(7) |
| 1292 | | DRVCTRL8_WE1(7)); |
| 1293 | pfc_reg_write(PFC_DRVCTRL8, reg); |
| 1294 | reg = mmio_read_32(PFC_DRVCTRL9); |
| 1295 | reg = ((reg & DRVCTRL9_MASK) | DRVCTRL9_EX_WAIT0(7) |
| 1296 | | DRVCTRL9_PRESETOU(7) |
| 1297 | | DRVCTRL9_D0(7) |
| 1298 | | DRVCTRL9_D1(7) |
| 1299 | | DRVCTRL9_D2(7) |
| 1300 | | DRVCTRL9_D3(7) |
| 1301 | | DRVCTRL9_D4(7) |
| 1302 | | DRVCTRL9_D5(7)); |
| 1303 | pfc_reg_write(PFC_DRVCTRL9, reg); |
| 1304 | reg = mmio_read_32(PFC_DRVCTRL10); |
| 1305 | reg = ((reg & DRVCTRL10_MASK) | DRVCTRL10_D6(7) |
| 1306 | | DRVCTRL10_D7(7) |
| 1307 | | DRVCTRL10_D8(3) |
| 1308 | | DRVCTRL10_D9(3) |
| 1309 | | DRVCTRL10_D10(3) |
| 1310 | | DRVCTRL10_D11(3) |
| 1311 | | DRVCTRL10_D12(3) |
| 1312 | | DRVCTRL10_D13(3)); |
| 1313 | pfc_reg_write(PFC_DRVCTRL10, reg); |
| 1314 | reg = mmio_read_32(PFC_DRVCTRL11); |
| 1315 | reg = ((reg & DRVCTRL11_MASK) | DRVCTRL11_D14(3) |
| 1316 | | DRVCTRL11_D15(3) |
| 1317 | | DRVCTRL11_AVS1(7) |
| 1318 | | DRVCTRL11_AVS2(7) |
| 1319 | | DRVCTRL11_HDMI0_CEC(7) |
| 1320 | | DRVCTRL11_HDMI1_CEC(7) |
| 1321 | | DRVCTRL11_DU_DOTCLKIN0(3) |
| 1322 | | DRVCTRL11_DU_DOTCLKIN1(3)); |
| 1323 | pfc_reg_write(PFC_DRVCTRL11, reg); |
| 1324 | reg = mmio_read_32(PFC_DRVCTRL12); |
| 1325 | reg = ((reg & DRVCTRL12_MASK) | DRVCTRL12_DU_DOTCLKIN2(3) |
| 1326 | | DRVCTRL12_DU_DOTCLKIN3(3) |
| 1327 | | DRVCTRL12_DU_FSCLKST(3) |
| 1328 | | DRVCTRL12_DU_TMS(3)); |
| 1329 | pfc_reg_write(PFC_DRVCTRL12, reg); |
| 1330 | reg = mmio_read_32(PFC_DRVCTRL13); |
| 1331 | reg = ((reg & DRVCTRL13_MASK) | DRVCTRL13_TDO(3) |
| 1332 | | DRVCTRL13_ASEBRK(3) |
| 1333 | | DRVCTRL13_SD0_CLK(7) |
| 1334 | | DRVCTRL13_SD0_CMD(7) |
| 1335 | | DRVCTRL13_SD0_DAT0(7) |
| 1336 | | DRVCTRL13_SD0_DAT1(7) |
| 1337 | | DRVCTRL13_SD0_DAT2(7) |
| 1338 | | DRVCTRL13_SD0_DAT3(7)); |
| 1339 | pfc_reg_write(PFC_DRVCTRL13, reg); |
| 1340 | reg = mmio_read_32(PFC_DRVCTRL14); |
| 1341 | reg = ((reg & DRVCTRL14_MASK) | DRVCTRL14_SD1_CLK(7) |
| 1342 | | DRVCTRL14_SD1_CMD(7) |
| 1343 | | DRVCTRL14_SD1_DAT0(5) |
| 1344 | | DRVCTRL14_SD1_DAT1(5) |
| 1345 | | DRVCTRL14_SD1_DAT2(5) |
| 1346 | | DRVCTRL14_SD1_DAT3(5) |
| 1347 | | DRVCTRL14_SD2_CLK(5) |
| 1348 | | DRVCTRL14_SD2_CMD(5)); |
| 1349 | pfc_reg_write(PFC_DRVCTRL14, reg); |
| 1350 | reg = mmio_read_32(PFC_DRVCTRL15); |
| 1351 | reg = ((reg & DRVCTRL15_MASK) | DRVCTRL15_SD2_DAT0(5) |
| 1352 | | DRVCTRL15_SD2_DAT1(5) |
| 1353 | | DRVCTRL15_SD2_DAT2(5) |
| 1354 | | DRVCTRL15_SD2_DAT3(5) |
| 1355 | | DRVCTRL15_SD2_DS(5) |
| 1356 | | DRVCTRL15_SD3_CLK(7) |
| 1357 | | DRVCTRL15_SD3_CMD(7) |
| 1358 | | DRVCTRL15_SD3_DAT0(7)); |
| 1359 | pfc_reg_write(PFC_DRVCTRL15, reg); |
| 1360 | reg = mmio_read_32(PFC_DRVCTRL16); |
| 1361 | reg = ((reg & DRVCTRL16_MASK) | DRVCTRL16_SD3_DAT1(7) |
| 1362 | | DRVCTRL16_SD3_DAT2(7) |
| 1363 | | DRVCTRL16_SD3_DAT3(7) |
| 1364 | | DRVCTRL16_SD3_DAT4(7) |
| 1365 | | DRVCTRL16_SD3_DAT5(7) |
| 1366 | | DRVCTRL16_SD3_DAT6(7) |
| 1367 | | DRVCTRL16_SD3_DAT7(7) |
| 1368 | | DRVCTRL16_SD3_DS(7)); |
| 1369 | pfc_reg_write(PFC_DRVCTRL16, reg); |
| 1370 | reg = mmio_read_32(PFC_DRVCTRL17); |
| 1371 | reg = ((reg & DRVCTRL17_MASK) | DRVCTRL17_SD0_CD(7) |
| 1372 | | DRVCTRL17_SD0_WP(7) |
| 1373 | | DRVCTRL17_SD1_CD(7) |
| 1374 | | DRVCTRL17_SD1_WP(7) |
| 1375 | | DRVCTRL17_SCK0(7) |
| 1376 | | DRVCTRL17_RX0(7) |
| 1377 | | DRVCTRL17_TX0(7) |
| 1378 | | DRVCTRL17_CTS0(7)); |
| 1379 | pfc_reg_write(PFC_DRVCTRL17, reg); |
| 1380 | reg = mmio_read_32(PFC_DRVCTRL18); |
| 1381 | reg = ((reg & DRVCTRL18_MASK) | DRVCTRL18_RTS0_TANS(7) |
| 1382 | | DRVCTRL18_RX1(7) |
| 1383 | | DRVCTRL18_TX1(7) |
| 1384 | | DRVCTRL18_CTS1(7) |
| 1385 | | DRVCTRL18_RTS1_TANS(7) |
| 1386 | | DRVCTRL18_SCK2(7) |
| 1387 | | DRVCTRL18_TX2(7) |
| 1388 | | DRVCTRL18_RX2(7)); |
| 1389 | pfc_reg_write(PFC_DRVCTRL18, reg); |
| 1390 | reg = mmio_read_32(PFC_DRVCTRL19); |
| 1391 | reg = ((reg & DRVCTRL19_MASK) | DRVCTRL19_HSCK0(7) |
| 1392 | | DRVCTRL19_HRX0(7) |
| 1393 | | DRVCTRL19_HTX0(7) |
| 1394 | | DRVCTRL19_HCTS0(7) |
| 1395 | | DRVCTRL19_HRTS0(7) |
| 1396 | | DRVCTRL19_MSIOF0_SCK(7) |
| 1397 | | DRVCTRL19_MSIOF0_SYNC(7) |
| 1398 | | DRVCTRL19_MSIOF0_SS1(7)); |
| 1399 | pfc_reg_write(PFC_DRVCTRL19, reg); |
| 1400 | reg = mmio_read_32(PFC_DRVCTRL20); |
| 1401 | reg = ((reg & DRVCTRL20_MASK) | DRVCTRL20_MSIOF0_TXD(7) |
| 1402 | | DRVCTRL20_MSIOF0_SS2(7) |
| 1403 | | DRVCTRL20_MSIOF0_RXD(7) |
| 1404 | | DRVCTRL20_MLB_CLK(7) |
| 1405 | | DRVCTRL20_MLB_SIG(7) |
| 1406 | | DRVCTRL20_MLB_DAT(7) |
| 1407 | | DRVCTRL20_MLB_REF(7) |
| 1408 | | DRVCTRL20_SSI_SCK0129(7)); |
| 1409 | pfc_reg_write(PFC_DRVCTRL20, reg); |
| 1410 | reg = mmio_read_32(PFC_DRVCTRL21); |
| 1411 | reg = ((reg & DRVCTRL21_MASK) | DRVCTRL21_SSI_WS0129(7) |
| 1412 | | DRVCTRL21_SSI_SDATA0(7) |
| 1413 | | DRVCTRL21_SSI_SDATA1(7) |
| 1414 | | DRVCTRL21_SSI_SDATA2(7) |
| 1415 | | DRVCTRL21_SSI_SCK34(7) |
| 1416 | | DRVCTRL21_SSI_WS34(7) |
| 1417 | | DRVCTRL21_SSI_SDATA3(7) |
| 1418 | | DRVCTRL21_SSI_SCK4(7)); |
| 1419 | pfc_reg_write(PFC_DRVCTRL21, reg); |
| 1420 | reg = mmio_read_32(PFC_DRVCTRL22); |
| 1421 | reg = ((reg & DRVCTRL22_MASK) | DRVCTRL22_SSI_WS4(7) |
| 1422 | | DRVCTRL22_SSI_SDATA4(7) |
| 1423 | | DRVCTRL22_SSI_SCK5(7) |
| 1424 | | DRVCTRL22_SSI_WS5(7) |
| 1425 | | DRVCTRL22_SSI_SDATA5(7) |
| 1426 | | DRVCTRL22_SSI_SCK6(7) |
| 1427 | | DRVCTRL22_SSI_WS6(7) |
| 1428 | | DRVCTRL22_SSI_SDATA6(7)); |
| 1429 | pfc_reg_write(PFC_DRVCTRL22, reg); |
| 1430 | reg = mmio_read_32(PFC_DRVCTRL23); |
| 1431 | reg = ((reg & DRVCTRL23_MASK) | DRVCTRL23_SSI_SCK78(7) |
| 1432 | | DRVCTRL23_SSI_WS78(7) |
| 1433 | | DRVCTRL23_SSI_SDATA7(7) |
| 1434 | | DRVCTRL23_SSI_SDATA8(7) |
| 1435 | | DRVCTRL23_SSI_SDATA9(7) |
| 1436 | | DRVCTRL23_AUDIO_CLKA(7) |
| 1437 | | DRVCTRL23_AUDIO_CLKB(7) |
| 1438 | | DRVCTRL23_USB0_PWEN(7)); |
| 1439 | pfc_reg_write(PFC_DRVCTRL23, reg); |
| 1440 | reg = mmio_read_32(PFC_DRVCTRL24); |
| 1441 | reg = ((reg & DRVCTRL24_MASK) | DRVCTRL24_USB0_OVC(7) |
| 1442 | | DRVCTRL24_USB1_PWEN(7) |
| 1443 | | DRVCTRL24_USB1_OVC(7) |
| 1444 | | DRVCTRL24_USB30_PWEN(7) |
| 1445 | | DRVCTRL24_USB30_OVC(7) |
| 1446 | | DRVCTRL24_USB31_PWEN(7) |
| 1447 | | DRVCTRL24_USB31_OVC(7)); |
| 1448 | pfc_reg_write(PFC_DRVCTRL24, reg); |
| 1449 | |
| 1450 | /* initialize LSI pin pull-up/down control */ |
| 1451 | pfc_reg_write(PFC_PUD0, 0x00005FBFU); |
| 1452 | pfc_reg_write(PFC_PUD1, 0x00300FFEU); |
| 1453 | pfc_reg_write(PFC_PUD2, 0x330001E6U); |
| 1454 | pfc_reg_write(PFC_PUD3, 0x000002E0U); |
| 1455 | pfc_reg_write(PFC_PUD4, 0xFFFFFF00U); |
| 1456 | pfc_reg_write(PFC_PUD5, 0x7F5FFF87U); |
| 1457 | pfc_reg_write(PFC_PUD6, 0x00000055U); |
| 1458 | |
| 1459 | /* initialize LSI pin pull-enable register */ |
| 1460 | pfc_reg_write(PFC_PUEN0, 0x00000FFFU); |
| 1461 | pfc_reg_write(PFC_PUEN1, 0x00100234U); |
| 1462 | pfc_reg_write(PFC_PUEN2, 0x000004C4U); |
| 1463 | pfc_reg_write(PFC_PUEN3, 0x00000200U); |
| 1464 | pfc_reg_write(PFC_PUEN4, 0x3E000000U); |
| 1465 | pfc_reg_write(PFC_PUEN5, 0x1F000805U); |
| 1466 | pfc_reg_write(PFC_PUEN6, 0x00000006U); |
| 1467 | |
| 1468 | /* initialize positive/negative logic select */ |
| 1469 | mmio_write_32(GPIO_POSNEG0, 0x00000000U); |
| 1470 | mmio_write_32(GPIO_POSNEG1, 0x00000000U); |
| 1471 | mmio_write_32(GPIO_POSNEG2, 0x00000000U); |
| 1472 | mmio_write_32(GPIO_POSNEG3, 0x00000000U); |
| 1473 | mmio_write_32(GPIO_POSNEG4, 0x00000000U); |
| 1474 | mmio_write_32(GPIO_POSNEG5, 0x00000000U); |
| 1475 | mmio_write_32(GPIO_POSNEG6, 0x00000000U); |
| 1476 | |
| 1477 | /* initialize general IO/interrupt switching */ |
| 1478 | mmio_write_32(GPIO_IOINTSEL0, 0x00000000U); |
| 1479 | mmio_write_32(GPIO_IOINTSEL1, 0x00000000U); |
| 1480 | mmio_write_32(GPIO_IOINTSEL2, 0x00000000U); |
| 1481 | mmio_write_32(GPIO_IOINTSEL3, 0x00000000U); |
| 1482 | mmio_write_32(GPIO_IOINTSEL4, 0x00000000U); |
| 1483 | mmio_write_32(GPIO_IOINTSEL5, 0x00000000U); |
| 1484 | mmio_write_32(GPIO_IOINTSEL6, 0x00000000U); |
| 1485 | |
| 1486 | /* initialize general output register */ |
| 1487 | mmio_write_32(GPIO_OUTDT1, 0x00000000U); |
| 1488 | mmio_write_32(GPIO_OUTDT2, 0x00000400U); |
| 1489 | mmio_write_32(GPIO_OUTDT3, 0x0000C000U); |
| 1490 | mmio_write_32(GPIO_OUTDT5, 0x00000006U); |
| 1491 | mmio_write_32(GPIO_OUTDT6, 0x00003880U); |
| 1492 | |
| 1493 | /* initialize general input/output switching */ |
| 1494 | mmio_write_32(GPIO_INOUTSEL0, 0x00000000U); |
| 1495 | mmio_write_32(GPIO_INOUTSEL1, 0x01000A00U); |
| 1496 | mmio_write_32(GPIO_INOUTSEL2, 0x00000400U); |
| 1497 | mmio_write_32(GPIO_INOUTSEL3, 0x0000C000U); |
| 1498 | mmio_write_32(GPIO_INOUTSEL4, 0x00000000U); |
| 1499 | mmio_write_32(GPIO_INOUTSEL5, 0x0000020EU); |
| 1500 | mmio_write_32(GPIO_INOUTSEL6, 0x00013880U); |
| 1501 | } |