immap_lsch2.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. * Copyright 2013-2015 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __ARCH_FSL_LSCH2_IMMAP_H__
  7. #define __ARCH_FSL_LSCH2_IMMAP_H__
  8. #include <fsl_immap.h>
  9. #define CONFIG_SYS_IMMR 0x01000000
  10. #define CONFIG_SYS_DCSRBAR 0x20000000
  11. #define CONFIG_SYS_DCSR_DCFG_ADDR (CONFIG_SYS_DCSRBAR + 0x00140000)
  12. #define CONFIG_SYS_DCSR_COP_CCP_ADDR (CONFIG_SYS_DCSRBAR + 0x02008040)
  13. #define CONFIG_SYS_FSL_DDR_ADDR (CONFIG_SYS_IMMR + 0x00080000)
  14. #define CONFIG_SYS_CCI400_ADDR (CONFIG_SYS_IMMR + 0x00180000)
  15. #define CONFIG_SYS_GIC400_ADDR (CONFIG_SYS_IMMR + 0x00400000)
  16. #define CONFIG_SYS_IFC_ADDR (CONFIG_SYS_IMMR + 0x00530000)
  17. #define SYS_FSL_QSPI_ADDR (CONFIG_SYS_IMMR + 0x00550000)
  18. #define CONFIG_SYS_FSL_ESDHC_ADDR (CONFIG_SYS_IMMR + 0x00560000)
  19. #define CONFIG_SYS_FSL_CSU_ADDR (CONFIG_SYS_IMMR + 0x00510000)
  20. #define CONFIG_SYS_FSL_GUTS_ADDR (CONFIG_SYS_IMMR + 0x00ee0000)
  21. #define CONFIG_SYS_FSL_RST_ADDR (CONFIG_SYS_IMMR + 0x00ee00b0)
  22. #define CONFIG_SYS_FSL_SCFG_ADDR (CONFIG_SYS_IMMR + 0x00570000)
  23. #define CONFIG_SYS_FSL_FMAN_ADDR (CONFIG_SYS_IMMR + 0x00a00000)
  24. #define CONFIG_SYS_FSL_SERDES_ADDR (CONFIG_SYS_IMMR + 0x00ea0000)
  25. #define CONFIG_SYS_FSL_DCFG_ADDR (CONFIG_SYS_IMMR + 0x00ee0000)
  26. #define CONFIG_SYS_FSL_CLK_ADDR (CONFIG_SYS_IMMR + 0x00ee1000)
  27. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x011c0500)
  28. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x011c0600)
  29. #define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_IMMR + 0x011d0500)
  30. #define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_IMMR + 0x011d0600)
  31. #define CONFIG_SYS_XHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x01f00000)
  32. #define CONFIG_SYS_XHCI_USB2_ADDR (CONFIG_SYS_IMMR + 0x02000000)
  33. #define CONFIG_SYS_XHCI_USB3_ADDR (CONFIG_SYS_IMMR + 0x02100000)
  34. #define CONFIG_SYS_EHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x07600000)
  35. #define CONFIG_SYS_PCIE1_ADDR (CONFIG_SYS_IMMR + 0x2400000)
  36. #define CONFIG_SYS_PCIE2_ADDR (CONFIG_SYS_IMMR + 0x2500000)
  37. #define CONFIG_SYS_PCIE3_ADDR (CONFIG_SYS_IMMR + 0x2600000)
  38. #define CONFIG_SYS_SEC_MON_ADDR (CONFIG_SYS_IMMR + 0xe90000)
  39. #define CONFIG_SYS_SFP_ADDR (CONFIG_SYS_IMMR + 0xe80200)
  40. #define CONFIG_SYS_FSL_TIMER_ADDR 0x02b00000
  41. #define I2C1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01180000)
  42. #define I2C2_BASE_ADDR (CONFIG_SYS_IMMR + 0x01190000)
  43. #define I2C3_BASE_ADDR (CONFIG_SYS_IMMR + 0x011a0000)
  44. #define I2C4_BASE_ADDR (CONFIG_SYS_IMMR + 0x011b0000)
  45. #define WDOG1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01ad0000)
  46. #define QSPI0_BASE_ADDR (CONFIG_SYS_IMMR + 0x00550000)
  47. #define DSPI1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01100000)
  48. #define LPUART_BASE (CONFIG_SYS_IMMR + 0x01950000)
  49. #define AHCI_BASE_ADDR (CONFIG_SYS_IMMR + 0x02200000)
  50. #define CONFIG_SYS_PCIE1_PHYS_ADDR 0x4000000000ULL
  51. #define CONFIG_SYS_PCIE2_PHYS_ADDR 0x4800000000ULL
  52. #define CONFIG_SYS_PCIE3_PHYS_ADDR 0x5000000000ULL
  53. /* LUT registers */
  54. #ifdef CONFIG_ARCH_LS1012A
  55. #define PCIE_LUT_BASE 0xC0000
  56. #else
  57. #define PCIE_LUT_BASE 0x10000
  58. #endif
  59. #define PCIE_LUT_LCTRL0 0x7F8
  60. #define PCIE_LUT_DBG 0x7FC
  61. /* TZ Address Space Controller Definitions */
  62. #define TZASC1_BASE 0x01100000 /* as per CCSR map. */
  63. #define TZASC2_BASE 0x01110000 /* as per CCSR map. */
  64. #define TZASC3_BASE 0x01120000 /* as per CCSR map. */
  65. #define TZASC4_BASE 0x01130000 /* as per CCSR map. */
  66. #define TZASC_BUILD_CONFIG_REG(x) ((TZASC1_BASE + (x * 0x10000)))
  67. #define TZASC_ACTION_REG(x) ((TZASC1_BASE + (x * 0x10000)) + 0x004)
  68. #define TZASC_GATE_KEEPER(x) ((TZASC1_BASE + (x * 0x10000)) + 0x008)
  69. #define TZASC_REGION_BASE_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x100)
  70. #define TZASC_REGION_BASE_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x104)
  71. #define TZASC_REGION_TOP_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x108)
  72. #define TZASC_REGION_TOP_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x10C)
  73. #define TZASC_REGION_ATTRIBUTES_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x110)
  74. #define TZASC_REGION_ID_ACCESS_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x114)
  75. #define TP_ITYP_AV 0x00000001 /* Initiator available */
  76. #define TP_ITYP_TYPE(x) (((x) & 0x6) >> 1) /* Initiator Type */
  77. #define TP_ITYP_TYPE_ARM 0x0
  78. #define TP_ITYP_TYPE_PPC 0x1 /* PowerPC */
  79. #define TP_ITYP_TYPE_OTHER 0x2 /* StarCore DSP */
  80. #define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */
  81. #define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */
  82. #define TP_ITYP_VER(x) (((x) & 0xe0) >> 5) /* Initiator Version */
  83. #define TY_ITYP_VER_A7 0x1
  84. #define TY_ITYP_VER_A53 0x2
  85. #define TY_ITYP_VER_A57 0x3
  86. #define TY_ITYP_VER_A72 0x4
  87. #define TP_CLUSTER_EOC 0xc0000000 /* end of clusters */
  88. #define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */
  89. #define TP_INIT_PER_CLUSTER 4
  90. /*
  91. * Define default values for some CCSR macros to make header files cleaner*
  92. *
  93. * To completely disable CCSR relocation in a board header file, define
  94. * CONFIG_SYS_CCSR_DO_NOT_RELOCATE. This will force CONFIG_SYS_CCSRBAR_PHYS
  95. * to a value that is the same as CONFIG_SYS_CCSRBAR.
  96. */
  97. #ifdef CONFIG_SYS_CCSRBAR_PHYS
  98. #error "Do not define CONFIG_SYS_CCSRBAR_PHYS directly. Use \
  99. CONFIG_SYS_CCSRBAR_PHYS_LOW and/or CONFIG_SYS_CCSRBAR_PHYS_HIGH instead."
  100. #endif
  101. #ifdef CONFIG_SYS_CCSR_DO_NOT_RELOCATE
  102. #undef CONFIG_SYS_CCSRBAR_PHYS_HIGH
  103. #undef CONFIG_SYS_CCSRBAR_PHYS_LOW
  104. #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
  105. #endif
  106. #ifndef CONFIG_SYS_CCSRBAR
  107. #define CONFIG_SYS_CCSRBAR 0x01000000
  108. #endif
  109. #ifndef CONFIG_SYS_CCSRBAR_PHYS_HIGH
  110. #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
  111. #endif
  112. #ifndef CONFIG_SYS_CCSRBAR_PHYS_LOW
  113. #define CONFIG_SYS_CCSRBAR_PHYS_LOW 0x01000000
  114. #endif
  115. #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH * 1ull) << 32 | \
  116. CONFIG_SYS_CCSRBAR_PHYS_LOW)
  117. struct sys_info {
  118. unsigned long freq_processor[CONFIG_MAX_CPUS];
  119. /* frequency of platform PLL */
  120. unsigned long freq_systembus;
  121. unsigned long freq_ddrbus;
  122. unsigned long freq_localbus;
  123. unsigned long freq_sdhc;
  124. #ifdef CONFIG_SYS_DPAA_FMAN
  125. unsigned long freq_fman[CONFIG_SYS_NUM_FMAN];
  126. #endif
  127. unsigned long freq_qman;
  128. };
  129. #define CONFIG_SYS_FSL_FM1_OFFSET 0xa00000
  130. #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0xa88000
  131. #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0xa89000
  132. #define CONFIG_SYS_FSL_FM1_RX2_1G_OFFSET 0xa8a000
  133. #define CONFIG_SYS_FSL_FM1_RX3_1G_OFFSET 0xa8b000
  134. #define CONFIG_SYS_FSL_FM1_RX4_1G_OFFSET 0xa8c000
  135. #define CONFIG_SYS_FSL_FM1_RX5_1G_OFFSET 0xa8d000
  136. #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0xae0000
  137. #define CONFIG_SYS_FSL_FM1_ADDR \
  138. (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_OFFSET)
  139. #define CONFIG_SYS_FSL_FM1_DTSEC1_ADDR \
  140. (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET)
  141. #define CONFIG_SYS_FSL_SEC_OFFSET 0x700000ull
  142. #define CONFIG_SYS_FSL_JR0_OFFSET 0x710000ull
  143. #define CONFIG_SYS_FSL_SEC_ADDR \
  144. (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET)
  145. #define CONFIG_SYS_FSL_JR0_ADDR \
  146. (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_JR0_OFFSET)
  147. /* Device Configuration and Pin Control */
  148. #define DCFG_DCSR_PORCR1 0x0
  149. struct ccsr_gur {
  150. u32 porsr1; /* POR status 1 */
  151. #define FSL_CHASSIS2_CCSR_PORSR1_RCW_MASK 0xFF800000
  152. u32 porsr2; /* POR status 2 */
  153. u8 res_008[0x20-0x8];
  154. u32 gpporcr1; /* General-purpose POR configuration */
  155. u32 gpporcr2;
  156. #define FSL_CHASSIS2_DCFG_FUSESR_VID_SHIFT 25
  157. #define FSL_CHASSIS2_DCFG_FUSESR_VID_MASK 0x1F
  158. #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_SHIFT 20
  159. #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_MASK 0x1F
  160. u32 dcfg_fusesr; /* Fuse status register */
  161. u8 res_02c[0x70-0x2c];
  162. u32 devdisr; /* Device disable control */
  163. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_1 0x80000000
  164. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_2 0x40000000
  165. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_3 0x20000000
  166. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_4 0x10000000
  167. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_5 0x08000000
  168. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_6 0x04000000
  169. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_9 0x00800000
  170. #define FSL_CHASSIS2_DEVDISR2_DTSEC1_10 0x00400000
  171. #define FSL_CHASSIS2_DEVDISR2_10GEC1_1 0x00800000
  172. #define FSL_CHASSIS2_DEVDISR2_10GEC1_2 0x00400000
  173. #define FSL_CHASSIS2_DEVDISR2_10GEC1_3 0x80000000
  174. #define FSL_CHASSIS2_DEVDISR2_10GEC1_4 0x40000000
  175. u32 devdisr2; /* Device disable control 2 */
  176. u32 devdisr3; /* Device disable control 3 */
  177. u32 devdisr4; /* Device disable control 4 */
  178. u32 devdisr5; /* Device disable control 5 */
  179. u32 devdisr6; /* Device disable control 6 */
  180. u32 devdisr7; /* Device disable control 7 */
  181. u8 res_08c[0x94-0x8c];
  182. u32 coredisru; /* uppper portion for support of 64 cores */
  183. u32 coredisrl; /* lower portion for support of 64 cores */
  184. u8 res_09c[0xa0-0x9c];
  185. u32 pvr; /* Processor version */
  186. u32 svr; /* System version */
  187. u32 mvr; /* Manufacturing version */
  188. u8 res_0ac[0xb0-0xac];
  189. u32 rstcr; /* Reset control */
  190. u32 rstrqpblsr; /* Reset request preboot loader status */
  191. u8 res_0b8[0xc0-0xb8];
  192. u32 rstrqmr1; /* Reset request mask */
  193. u8 res_0c4[0xc8-0xc4];
  194. u32 rstrqsr1; /* Reset request status */
  195. u8 res_0cc[0xd4-0xcc];
  196. u32 rstrqwdtmrl; /* Reset request WDT mask */
  197. u8 res_0d8[0xdc-0xd8];
  198. u32 rstrqwdtsrl; /* Reset request WDT status */
  199. u8 res_0e0[0xe4-0xe0];
  200. u32 brrl; /* Boot release */
  201. u8 res_0e8[0x100-0xe8];
  202. u32 rcwsr[16]; /* Reset control word status */
  203. #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT 25
  204. #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f
  205. #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT 16
  206. #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK 0x3f
  207. #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK 0xffff0000
  208. #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT 16
  209. #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_MASK 0x0000ffff
  210. #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_SHIFT 0
  211. #define RCW_SB_EN_REG_INDEX 7
  212. #define RCW_SB_EN_MASK 0x00200000
  213. u8 res_140[0x200-0x140];
  214. u32 scratchrw[4]; /* Scratch Read/Write */
  215. u8 res_210[0x300-0x210];
  216. u32 scratchw1r[4]; /* Scratch Read (Write once) */
  217. u8 res_310[0x400-0x310];
  218. u32 crstsr[12];
  219. u8 res_430[0x500-0x430];
  220. /* PCI Express n Logical I/O Device Number register */
  221. u32 dcfg_ccsr_pex1liodnr;
  222. u32 dcfg_ccsr_pex2liodnr;
  223. u32 dcfg_ccsr_pex3liodnr;
  224. u32 dcfg_ccsr_pex4liodnr;
  225. /* RIO n Logical I/O Device Number register */
  226. u32 dcfg_ccsr_rio1liodnr;
  227. u32 dcfg_ccsr_rio2liodnr;
  228. u32 dcfg_ccsr_rio3liodnr;
  229. u32 dcfg_ccsr_rio4liodnr;
  230. /* USB Logical I/O Device Number register */
  231. u32 dcfg_ccsr_usb1liodnr;
  232. u32 dcfg_ccsr_usb2liodnr;
  233. u32 dcfg_ccsr_usb3liodnr;
  234. u32 dcfg_ccsr_usb4liodnr;
  235. /* SD/MMC Logical I/O Device Number register */
  236. u32 dcfg_ccsr_sdmmc1liodnr;
  237. u32 dcfg_ccsr_sdmmc2liodnr;
  238. u32 dcfg_ccsr_sdmmc3liodnr;
  239. u32 dcfg_ccsr_sdmmc4liodnr;
  240. /* RIO Message Unit Logical I/O Device Number register */
  241. u32 dcfg_ccsr_riomaintliodnr;
  242. u8 res_544[0x550-0x544];
  243. u32 sataliodnr[4];
  244. u8 res_560[0x570-0x560];
  245. u32 dcfg_ccsr_misc1liodnr;
  246. u32 dcfg_ccsr_misc2liodnr;
  247. u32 dcfg_ccsr_misc3liodnr;
  248. u32 dcfg_ccsr_misc4liodnr;
  249. u32 dcfg_ccsr_dma1liodnr;
  250. u32 dcfg_ccsr_dma2liodnr;
  251. u32 dcfg_ccsr_dma3liodnr;
  252. u32 dcfg_ccsr_dma4liodnr;
  253. u32 dcfg_ccsr_spare1liodnr;
  254. u32 dcfg_ccsr_spare2liodnr;
  255. u32 dcfg_ccsr_spare3liodnr;
  256. u32 dcfg_ccsr_spare4liodnr;
  257. u8 res_5a0[0x600-0x5a0];
  258. u32 dcfg_ccsr_pblsr;
  259. u32 pamubypenr;
  260. u32 dmacr1;
  261. u8 res_60c[0x610-0x60c];
  262. u32 dcfg_ccsr_gensr1;
  263. u32 dcfg_ccsr_gensr2;
  264. u32 dcfg_ccsr_gensr3;
  265. u32 dcfg_ccsr_gensr4;
  266. u32 dcfg_ccsr_gencr1;
  267. u32 dcfg_ccsr_gencr2;
  268. u32 dcfg_ccsr_gencr3;
  269. u32 dcfg_ccsr_gencr4;
  270. u32 dcfg_ccsr_gencr5;
  271. u32 dcfg_ccsr_gencr6;
  272. u32 dcfg_ccsr_gencr7;
  273. u8 res_63c[0x658-0x63c];
  274. u32 dcfg_ccsr_cgensr1;
  275. u32 dcfg_ccsr_cgensr0;
  276. u8 res_660[0x678-0x660];
  277. u32 dcfg_ccsr_cgencr1;
  278. u32 dcfg_ccsr_cgencr0;
  279. u8 res_680[0x700-0x680];
  280. u32 dcfg_ccsr_sriopstecr;
  281. u32 dcfg_ccsr_dcsrcr;
  282. u8 res_708[0x740-0x708]; /* add more registers when needed */
  283. u32 tp_ityp[64]; /* Topology Initiator Type Register */
  284. struct {
  285. u32 upper;
  286. u32 lower;
  287. } tp_cluster[16];
  288. u8 res_8c0[0xa00-0x8c0]; /* add more registers when needed */
  289. u32 dcfg_ccsr_qmbm_warmrst;
  290. u8 res_a04[0xa20-0xa04]; /* add more registers when needed */
  291. u32 dcfg_ccsr_reserved0;
  292. u32 dcfg_ccsr_reserved1;
  293. };
  294. #define SCFG_QSPI_CLKSEL 0x40100000
  295. #define SCFG_USBDRVVBUS_SELCR_USB1 0x00000000
  296. #define SCFG_USBDRVVBUS_SELCR_USB2 0x00000001
  297. #define SCFG_USBDRVVBUS_SELCR_USB3 0x00000002
  298. #define SCFG_USBPWRFAULT_INACTIVE 0x00000000
  299. #define SCFG_USBPWRFAULT_SHARED 0x00000001
  300. #define SCFG_USBPWRFAULT_DEDICATED 0x00000002
  301. #define SCFG_USBPWRFAULT_USB3_SHIFT 4
  302. #define SCFG_USBPWRFAULT_USB2_SHIFT 2
  303. #define SCFG_USBPWRFAULT_USB1_SHIFT 0
  304. #define SCFG_SNPCNFGCR_SECRDSNP 0x80000000
  305. #define SCFG_SNPCNFGCR_SECWRSNP 0x40000000
  306. #define SCFG_SNPCNFGCR_SATARDSNP 0x00800000
  307. #define SCFG_SNPCNFGCR_SATAWRSNP 0x00400000
  308. /* Supplemental Configuration Unit */
  309. struct ccsr_scfg {
  310. u8 res_000[0x100-0x000];
  311. u32 usb2_icid;
  312. u32 usb3_icid;
  313. u8 res_108[0x114-0x108];
  314. u32 dma_icid;
  315. u32 sata_icid;
  316. u32 usb1_icid;
  317. u32 qe_icid;
  318. u32 sdhc_icid;
  319. u32 edma_icid;
  320. u32 etr_icid;
  321. u32 core_sft_rst[4];
  322. u8 res_140[0x158-0x140];
  323. u32 altcbar;
  324. u32 qspi_cfg;
  325. u8 res_160[0x180-0x160];
  326. u32 dmamcr;
  327. u8 res_184[0x188-0x184];
  328. u32 gic_align;
  329. u32 debug_icid;
  330. u8 res_190[0x1a4-0x190];
  331. u32 snpcnfgcr;
  332. u8 res_1a8[0x1ac-0x1a8];
  333. u32 intpcr;
  334. u8 res_1b0[0x204-0x1b0];
  335. u32 coresrencr;
  336. u8 res_208[0x220-0x208];
  337. u32 rvbar0_0;
  338. u32 rvbar0_1;
  339. u32 rvbar1_0;
  340. u32 rvbar1_1;
  341. u32 rvbar2_0;
  342. u32 rvbar2_1;
  343. u32 rvbar3_0;
  344. u32 rvbar3_1;
  345. u32 lpmcsr;
  346. u8 res_244[0x400-0x244];
  347. u32 qspidqscr;
  348. u32 ecgtxcmcr;
  349. u32 sdhciovselcr;
  350. u32 rcwpmuxcr0;
  351. u32 usbdrvvbus_selcr;
  352. u32 usbpwrfault_selcr;
  353. u32 usb_refclk_selcr1;
  354. u32 usb_refclk_selcr2;
  355. u32 usb_refclk_selcr3;
  356. u8 res_424[0x600-0x424];
  357. u32 scratchrw[4];
  358. u8 res_610[0x680-0x610];
  359. u32 corebcr;
  360. u8 res_684[0x1000-0x684];
  361. u32 pex1msiir;
  362. u32 pex1msir;
  363. u8 res_1008[0x2000-0x1008];
  364. u32 pex2;
  365. u32 pex2msir;
  366. u8 res_2008[0x3000-0x2008];
  367. u32 pex3msiir;
  368. u32 pex3msir;
  369. };
  370. /* Clocking */
  371. struct ccsr_clk {
  372. struct {
  373. u32 clkcncsr; /* core cluster n clock control status */
  374. u8 res_004[0x0c];
  375. u32 clkcghwacsr; /* Clock generator n hardware accelerator */
  376. u8 res_014[0x0c];
  377. } clkcsr[4];
  378. u8 res_040[0x780]; /* 0x100 */
  379. struct {
  380. u32 pllcngsr;
  381. u8 res_804[0x1c];
  382. } pllcgsr[2];
  383. u8 res_840[0x1c0];
  384. u32 clkpcsr; /* 0xa00 Platform clock domain control/status */
  385. u8 res_a04[0x1fc];
  386. u32 pllpgsr; /* 0xc00 Platform PLL General Status */
  387. u8 res_c04[0x1c];
  388. u32 plldgsr; /* 0xc20 DDR PLL General Status */
  389. u8 res_c24[0x3dc];
  390. };
  391. /* System Counter */
  392. struct sctr_regs {
  393. u32 cntcr;
  394. u32 cntsr;
  395. u32 cntcv1;
  396. u32 cntcv2;
  397. u32 resv1[4];
  398. u32 cntfid0;
  399. u32 cntfid1;
  400. u32 resv2[1002];
  401. u32 counterid[12];
  402. };
  403. #define SRDS_MAX_LANES 4
  404. struct ccsr_serdes {
  405. struct {
  406. u32 rstctl; /* Reset Control Register */
  407. #define SRDS_RSTCTL_RST 0x80000000
  408. #define SRDS_RSTCTL_RSTDONE 0x40000000
  409. #define SRDS_RSTCTL_RSTERR 0x20000000
  410. #define SRDS_RSTCTL_SWRST 0x10000000
  411. #define SRDS_RSTCTL_SDEN 0x00000020
  412. #define SRDS_RSTCTL_SDRST_B 0x00000040
  413. #define SRDS_RSTCTL_PLLRST_B 0x00000080
  414. u32 pllcr0; /* PLL Control Register 0 */
  415. #define SRDS_PLLCR0_POFF 0x80000000
  416. #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000
  417. #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000
  418. #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000
  419. #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000
  420. #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000
  421. #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000
  422. #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000
  423. #define SRDS_PLLCR0_PLL_LCK 0x00800000
  424. #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000
  425. #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000
  426. #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000
  427. #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000
  428. #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000
  429. #define SRDS_PLLCR0_FRATE_SEL_3_12 0x00090000
  430. #define SRDS_PLLCR0_FRATE_SEL_3 0x000a0000
  431. u32 pllcr1; /* PLL Control Register 1 */
  432. #define SRDS_PLLCR1_PLL_BWSEL 0x08000000
  433. u32 res_0c; /* 0x00c */
  434. u32 pllcr3;
  435. u32 pllcr4;
  436. u32 pllcr5; /* 0x018 SerDes PLL1 Control 5 */
  437. u8 res_1c[0x20-0x1c];
  438. } bank[2];
  439. u8 res_40[0x90-0x40];
  440. u32 srdstcalcr; /* 0x90 TX Calibration Control */
  441. u8 res_94[0xa0-0x94];
  442. u32 srdsrcalcr; /* 0xa0 RX Calibration Control */
  443. u8 res_a4[0xb0-0xa4];
  444. u32 srdsgr0; /* 0xb0 General Register 0 */
  445. u8 res_b4[0x100-0xb4];
  446. struct {
  447. u32 lnpssr0; /* 0x100, 0x120, 0x140, 0x160 */
  448. u8 res_104[0x120-0x104];
  449. } lnpssr[4]; /* Lane A, B, C, D */
  450. u8 res_180[0x200-0x180];
  451. u32 srdspccr0; /* 0x200 Protocol Configuration 0 */
  452. u32 srdspccr1; /* 0x204 Protocol Configuration 1 */
  453. u32 srdspccr2; /* 0x208 Protocol Configuration 2 */
  454. u32 srdspccr3; /* 0x20c Protocol Configuration 3 */
  455. u32 srdspccr4; /* 0x210 Protocol Configuration 4 */
  456. u32 srdspccr5; /* 0x214 Protocol Configuration 5 */
  457. u32 srdspccr6; /* 0x218 Protocol Configuration 6 */
  458. u32 srdspccr7; /* 0x21c Protocol Configuration 7 */
  459. u32 srdspccr8; /* 0x220 Protocol Configuration 8 */
  460. u32 srdspccr9; /* 0x224 Protocol Configuration 9 */
  461. u32 srdspccra; /* 0x228 Protocol Configuration A */
  462. u32 srdspccrb; /* 0x22c Protocol Configuration B */
  463. u8 res_230[0x800-0x230];
  464. struct {
  465. u32 gcr0; /* 0x800 General Control Register 0 */
  466. u32 gcr1; /* 0x804 General Control Register 1 */
  467. u32 gcr2; /* 0x808 General Control Register 2 */
  468. u32 sscr0;
  469. u32 recr0; /* 0x810 Receive Equalization Control */
  470. u32 recr1;
  471. u32 tecr0; /* 0x818 Transmit Equalization Control */
  472. u32 sscr1;
  473. u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */
  474. u8 res_824[0x83c-0x824];
  475. u32 tcsr3;
  476. } lane[4]; /* Lane A, B, C, D */
  477. u8 res_900[0x1000-0x900]; /* from 0x900 to 0xfff */
  478. struct {
  479. u32 srdspexcr0; /* 0x1000, 0x1040, 0x1080 */
  480. u8 res_1004[0x1040-0x1004];
  481. } pcie[3];
  482. u8 res_10c0[0x1800-0x10c0];
  483. struct {
  484. u8 res_1800[0x1804-0x1800];
  485. u32 srdssgmiicr1; /* 0x1804 SGMII Protocol Control 1 */
  486. u8 res_1808[0x180c-0x1808];
  487. u32 srdssgmiicr3; /* 0x180c SGMII Protocol Control 3 */
  488. } sgmii[4]; /* Lane A, B, C, D */
  489. u8 res_1840[0x1880-0x1840];
  490. struct {
  491. u8 res_1880[0x1884-0x1880];
  492. u32 srdsqsgmiicr1; /* 0x1884 QSGMII Protocol Control 1 */
  493. u8 res_1888[0x188c-0x1888];
  494. u32 srdsqsgmiicr3; /* 0x188c QSGMII Protocol Control 3 */
  495. } qsgmii[2]; /* Lane A, B */
  496. u8 res_18a0[0x1980-0x18a0];
  497. struct {
  498. u8 res_1980[0x1984-0x1980];
  499. u32 srdsxficr1; /* 0x1984 XFI Protocol Control 1 */
  500. u8 res_1988[0x198c-0x1988];
  501. u32 srdsxficr3; /* 0x198c XFI Protocol Control 3 */
  502. } xfi[2]; /* Lane A, B */
  503. u8 res_19a0[0x2000-0x19a0]; /* from 0x19a0 to 0x1fff */
  504. };
  505. #define CCI400_CTRLORD_TERM_BARRIER 0x00000008
  506. #define CCI400_CTRLORD_EN_BARRIER 0
  507. #define CCI400_SHAORD_NON_SHAREABLE 0x00000002
  508. #define CCI400_DVM_MESSAGE_REQ_EN 0x00000002
  509. #define CCI400_SNOOP_REQ_EN 0x00000001
  510. /* CCI-400 registers */
  511. struct ccsr_cci400 {
  512. u32 ctrl_ord; /* Control Override */
  513. u32 spec_ctrl; /* Speculation Control */
  514. u32 secure_access; /* Secure Access */
  515. u32 status; /* Status */
  516. u32 impr_err; /* Imprecise Error */
  517. u8 res_14[0x100 - 0x14];
  518. u32 pmcr; /* Performance Monitor Control */
  519. u8 res_104[0xfd0 - 0x104];
  520. u32 pid[8]; /* Peripheral ID */
  521. u32 cid[4]; /* Component ID */
  522. struct {
  523. u32 snoop_ctrl; /* Snoop Control */
  524. u32 sha_ord; /* Shareable Override */
  525. u8 res_1008[0x1100 - 0x1008];
  526. u32 rc_qos_ord; /* read channel QoS Value Override */
  527. u32 wc_qos_ord; /* read channel QoS Value Override */
  528. u8 res_1108[0x110c - 0x1108];
  529. u32 qos_ctrl; /* QoS Control */
  530. u32 max_ot; /* Max OT */
  531. u8 res_1114[0x1130 - 0x1114];
  532. u32 target_lat; /* Target Latency */
  533. u32 latency_regu; /* Latency Regulation */
  534. u32 qos_range; /* QoS Range */
  535. u8 res_113c[0x2000 - 0x113c];
  536. } slave[5]; /* Slave Interface */
  537. u8 res_6000[0x9004 - 0x6000];
  538. u32 cycle_counter; /* Cycle counter */
  539. u32 count_ctrl; /* Count Control */
  540. u32 overflow_status; /* Overflow Flag Status */
  541. u8 res_9010[0xa000 - 0x9010];
  542. struct {
  543. u32 event_select; /* Event Select */
  544. u32 event_count; /* Event Count */
  545. u32 counter_ctrl; /* Counter Control */
  546. u32 overflow_status; /* Overflow Flag Status */
  547. u8 res_a010[0xb000 - 0xa010];
  548. } pcounter[4]; /* Performance Counter */
  549. u8 res_e004[0x10000 - 0xe004];
  550. };
  551. /* MMU 500 */
  552. #define SMMU_SCR0 (SMMU_BASE + 0x0)
  553. #define SMMU_SCR1 (SMMU_BASE + 0x4)
  554. #define SMMU_SCR2 (SMMU_BASE + 0x8)
  555. #define SMMU_SACR (SMMU_BASE + 0x10)
  556. #define SMMU_IDR0 (SMMU_BASE + 0x20)
  557. #define SMMU_IDR1 (SMMU_BASE + 0x24)
  558. #define SMMU_NSCR0 (SMMU_BASE + 0x400)
  559. #define SMMU_NSCR2 (SMMU_BASE + 0x408)
  560. #define SMMU_NSACR (SMMU_BASE + 0x410)
  561. #define SCR0_CLIENTPD_MASK 0x00000001
  562. #define SCR0_USFCFG_MASK 0x00000400
  563. uint get_svr(void);
  564. #endif /* __ARCH_FSL_LSCH2_IMMAP_H__*/