Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Nobuhiro Iwamatsu | 3966dea | 2012-07-20 13:06:54 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 Renesas Solutions Corp. |
Nobuhiro Iwamatsu | 3966dea | 2012-07-20 13:06:54 +0900 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __ASM_ARCH_R8A7740_H |
| 7 | #define __ASM_ARCH_R8A7740_H |
| 8 | |
| 9 | /* |
| 10 | * R8A7740 I/O Addresses |
| 11 | */ |
| 12 | |
| 13 | #define MERAM_BASE 0xE5580000 |
| 14 | #define DDRP_BASE 0xC12A0000 |
| 15 | #define HPB_BASE 0xE6000000 |
| 16 | #define RWDT0_BASE 0xE6020000 |
| 17 | #define RWDT1_BASE 0xE6030000 |
| 18 | #define GPIO_BASE 0xE6050000 |
| 19 | #define CMT1_BASE 0xE6138000 |
| 20 | #define CPG_BASE 0xE6150000 |
| 21 | #define SYSC_BASE 0xE6180000 |
| 22 | #define SDHI0_BASE 0xE6850000 |
| 23 | #define SDHI1_BASE 0xE6860000 |
| 24 | #define MMCIF_BASE 0xE6BD0000 |
| 25 | #define SCIF5_BASE 0xE6CB0000 |
| 26 | #define SCIF6_BASE 0xE6CC0000 |
| 27 | #define DBSC_BASE 0xFE400000 |
| 28 | #define BSC_BASE 0xFEC10000 |
| 29 | #define I2C0_BASE 0xFFF20000 |
| 30 | #define I2C1_BASE 0xE6C20000 |
| 31 | #define TMU_BASE 0xFFF80000 |
| 32 | |
| 33 | #ifndef __ASSEMBLY__ |
| 34 | #include <asm/types.h> |
| 35 | |
| 36 | /* RWDT */ |
| 37 | struct r8a7740_rwdt { |
| 38 | u16 rwtcnt0; /* 0x00 */ |
| 39 | u16 dummy0; /* 0x02 */ |
| 40 | u16 rwtcsra0; /* 0x04 */ |
| 41 | u16 dummy1; /* 0x06 */ |
| 42 | u16 rwtcsrb0; /* 0x08 */ |
| 43 | u16 dummy2; /* 0x0A */ |
| 44 | }; |
| 45 | |
| 46 | /* HPB Semaphore Control Registers */ |
| 47 | struct r8a7740_hpb { |
| 48 | u32 hpbctrl0; |
| 49 | u32 hpbctrl1; |
| 50 | u32 hpbctrl2; |
| 51 | u32 cccr; |
| 52 | u32 dummy0; /* 0x20 */ |
| 53 | u32 hpbctrl4; |
| 54 | u32 hpbctrl5; |
| 55 | }; |
| 56 | |
| 57 | /* CPG */ |
| 58 | struct r8a7740_cpg { |
| 59 | u32 frqcra; |
| 60 | u32 frqcrb; |
| 61 | u32 vclkcr1; |
| 62 | u32 vclkcr2; |
| 63 | u32 fmsickcr; |
| 64 | u32 fmsockcr; |
| 65 | u32 fsiackcr; |
| 66 | u32 dummy0; /* 0x1c */ |
| 67 | u32 rtstbcr; |
| 68 | u32 systbcr; |
| 69 | u32 pllc01cr; |
| 70 | u32 pllc2cr; |
| 71 | u32 mstpsr0; |
| 72 | u32 dummy1; /* 0x34 */ |
| 73 | u32 mstpsr1; |
| 74 | u32 mstpsr5; |
| 75 | u32 mstpsr2; |
| 76 | u32 dummy2; /* 0x44 */ |
| 77 | u32 mstpsr3; |
| 78 | u32 mstpsr4; |
| 79 | u32 dummy3; /* 0x50 */ |
| 80 | u32 astat; |
| 81 | u32 dummy4[4]; /* 0x58 .. 0x64 */ |
| 82 | u32 ztrckcr; |
| 83 | u32 dummy5[5]; /* 0x6c .. 0x7c */ |
| 84 | u32 subckcr; |
| 85 | u32 spuckcr; |
| 86 | u32 vouckcr; |
| 87 | u32 usbckcr; |
| 88 | u32 dummy6[3]; /* 0x90 .. 0x98 */ |
| 89 | u32 stprckcr; |
| 90 | u32 srcr0; |
| 91 | u32 dummy7; /* 0xa4 */ |
| 92 | u32 srcr1; |
| 93 | u32 dummy8; /* 0xac */ |
| 94 | u32 srcr2; |
| 95 | u32 dummy9; /* 0xb4 */ |
| 96 | u32 srcr3; |
| 97 | u32 srcr4; |
| 98 | u32 dummy10; /* 0xc0 */ |
| 99 | u32 srcr5; |
| 100 | u32 pllc01stpcr; |
| 101 | u32 dummy11[5]; /* 0xcc .. 0xdc */ |
| 102 | u32 frqcrc; |
| 103 | u32 frqcrd; |
| 104 | u32 dummy12[10]; /* 0xe8 .. 0x10c */ |
| 105 | u32 rmstpcr0; |
| 106 | u32 rmstpcr1; |
| 107 | u32 rmstpcr2; |
| 108 | u32 rmstpcr3; |
| 109 | u32 rmstpcr4; |
| 110 | u32 rmstpcr5; |
| 111 | u32 dummy13[2]; /* 0x128 .. 0x12c */ |
| 112 | u32 smstpcr0; |
| 113 | u32 smstpcr1; |
| 114 | u32 smstpcr2; |
| 115 | u32 smstpcr3; |
| 116 | u32 smstpcr4; |
| 117 | u32 smstpcr5; |
| 118 | }; |
| 119 | |
| 120 | /* BSC */ |
| 121 | struct r8a7740_bsc { |
| 122 | u32 cmncr; |
| 123 | u32 cs0bcr; |
| 124 | u32 cs2bcr; |
| 125 | u32 dummy0; /* 0x0c */ |
| 126 | u32 cs4bcr; |
| 127 | u32 cs5abcr; |
| 128 | u32 cs5bbcr; |
| 129 | u32 cs6abcr; |
| 130 | u32 dummy1; /* 0x20 */ |
| 131 | u32 cs0wcr; |
| 132 | u32 cs2wcr; |
| 133 | u32 dummy2; /* 0x2c */ |
| 134 | u32 cs4wcr; |
| 135 | u32 cs5awcr; |
| 136 | u32 cs5bwcr; |
| 137 | u32 cs6awcr; |
| 138 | u32 dummy3[5]; /* 0x40 .. 0x50 */ |
| 139 | u32 rbwtcnt; |
| 140 | u32 busycr; |
| 141 | u32 dummy4[5]; /* 0x5c .. 0x6c */ |
| 142 | u32 bromtimcr; |
| 143 | u32 dummy5[7]; /* 0x74 .. 0x8c */ |
| 144 | u32 bptcr00; |
| 145 | u32 bptcr01; |
| 146 | u32 bptcr02; |
| 147 | u32 bptcr03; |
| 148 | u32 bptcr04; |
| 149 | u32 bptcr05; |
| 150 | u32 bptcr06; |
| 151 | u32 bptcr07; |
| 152 | u32 bptcr08; |
| 153 | u32 bptcr09; |
| 154 | u32 bptcr10; |
| 155 | u32 bptcr11; |
| 156 | u32 bptcr12; |
| 157 | u32 bptcr13; |
| 158 | u32 bptcr14; |
| 159 | u32 bptcr15; |
| 160 | u32 bptcr16; |
| 161 | u32 bptcr17; |
| 162 | u32 bptcr18; |
| 163 | u32 bptcr19; |
| 164 | u32 bptcr20; |
| 165 | u32 bptcr21; |
| 166 | u32 bptcr22; |
| 167 | u32 bptcr23; |
| 168 | u32 bptcr24; |
| 169 | u32 bptcr25; |
| 170 | u32 bptcr26; |
| 171 | u32 bptcr27; |
| 172 | u32 bptcr28; |
| 173 | u32 bptcr29; |
| 174 | u32 bptcr30; |
| 175 | u32 bptcr31; |
| 176 | u32 bswcr; |
| 177 | u32 dummy6[68]; /* 0x114 .. 0x220 */ |
| 178 | u32 cs0wcr2; |
| 179 | u32 cs2wcr2; |
| 180 | u32 dummy7; /* 0x22c */ |
| 181 | u32 cs4wcr2; |
| 182 | }; |
| 183 | |
| 184 | #define CS0WCR2 0xFEC10224 |
| 185 | #define CS2WCR2 0xFEC10228 |
| 186 | #define CS4WCR2 0xFEC10230 |
| 187 | |
| 188 | /* DDRP */ |
| 189 | struct r8a7740_ddrp { |
| 190 | u32 funcctrl; |
| 191 | u32 dllctrl; |
| 192 | u32 zqcalctrl; |
| 193 | u32 zqodtctrl; |
| 194 | u32 rdctrl; |
| 195 | u32 rdtmg; |
| 196 | u32 fifoinit; |
| 197 | u32 outctrl; |
| 198 | u32 dummy0[50]; /* 0x20 .. 0xe4 */ |
| 199 | u32 dqcalofs1; |
| 200 | u32 dqcalofs2; |
| 201 | u32 dummy1[2]; /* 0xf0 .. 0xf4 */ |
| 202 | u32 dqcalexp; |
| 203 | }; |
| 204 | |
| 205 | #define DDRPNCNT 0xE605803C |
| 206 | #define DDRVREFCNT 0xE61500EC |
| 207 | |
| 208 | /* DBSC */ |
| 209 | struct r8a7740_dbsc { |
| 210 | u32 dummy0; |
| 211 | u32 dbsvcr; |
| 212 | u32 dbstate0; |
| 213 | u32 dbstate1; |
| 214 | u32 dbacen; |
| 215 | u32 dbrfen; |
| 216 | u32 dbcmd; |
| 217 | u32 dbwait; |
| 218 | u32 dbkind; |
| 219 | u32 dbconf0; |
| 220 | u32 dummy1[2]; /* 0x28 .. 0x2c */ |
| 221 | u32 dbphytype; |
| 222 | u32 dummy2[3]; /* 0x34 .. 0x3c */ |
| 223 | u32 dbtr0; |
| 224 | u32 dbtr1; |
| 225 | u32 dbtr2; |
| 226 | u32 dummy3; /* 0x4c */ |
| 227 | u32 dbtr3; |
| 228 | u32 dbtr4; |
| 229 | u32 dbtr5; |
| 230 | u32 dbtr6; |
| 231 | u32 dbtr7; |
| 232 | u32 dbtr8; |
| 233 | u32 dbtr9; |
| 234 | u32 dbtr10; |
| 235 | u32 dbtr11; |
| 236 | u32 dbtr12; |
| 237 | u32 dbtr13; |
| 238 | u32 dbtr14; |
| 239 | u32 dbtr15; |
| 240 | u32 dbtr16; |
| 241 | u32 dbtr17; |
| 242 | u32 dbtr18; |
| 243 | u32 dbtr19; |
| 244 | u32 dummy4[7]; /* 0x94 .. 0xac */ |
| 245 | u32 dbbl; |
| 246 | u32 dummy5[3]; /* 0xb4 .. 0xbc */ |
| 247 | u32 dbadj0; |
| 248 | u32 dbadj1; |
| 249 | u32 dbadj2; |
| 250 | u32 dummy6[5]; /* 0xcc .. 0xdc */ |
| 251 | u32 dbrfcnf0; |
| 252 | u32 dbrfcnf1; |
| 253 | u32 dbrfcnf2; |
| 254 | u32 dbrfcnf3; |
| 255 | u32 dummy7; /* 0xf0 */ |
| 256 | u32 dbcalcnf; |
| 257 | u32 dbcaltr; |
| 258 | u32 dummy8; /* 0xfc */; |
| 259 | u32 dbrnk0; |
| 260 | u32 dummy9[31]; /* 0x104 .. 0x17C */ |
| 261 | u32 dbpdncnf; |
| 262 | u32 dummy10[7]; /* 0x184 .. 0x19C */ |
| 263 | u32 dbmrrdr; |
| 264 | u32 dummy11[39]; /* 0x1A4 .. 0x23C */ |
| 265 | u32 dbdfistat; |
| 266 | u32 dbdficnt; |
| 267 | u32 dummy12[46]; /* 0x248 .. 0x2FC */ |
| 268 | u32 dbbs0cnt0; |
| 269 | u32 dbbs0cnt1; |
| 270 | }; |
| 271 | |
| 272 | #endif |
| 273 | |
| 274 | #endif /* __ASM_ARCH_R8A7740_H */ |