immap_lsch2.h 22 KB

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