2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __ASM_ARCH_LS102XA_IMMAP_H_
8 #define __ASM_ARCH_LS102XA_IMMAP_H_
10 #define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
11 #define SVR_MIN(svr) (((svr) >> 0) & 0xf)
12 #define SVR_SOC_VER(svr) (((svr) >> 8) & 0x7ff)
13 #define IS_E_PROCESSOR(svr) (svr & 0x80000)
15 #define SOC_VER_SLS1020 0x00
16 #define SOC_VER_LS1020 0x10
17 #define SOC_VER_LS1021 0x11
18 #define SOC_VER_LS1022 0x12
20 #define CCSR_BRR_OFFSET 0xe4
21 #define CCSR_SCRATCHRW1_OFFSET 0x200
23 #define RCWSR0_SYS_PLL_RAT_SHIFT 25
24 #define RCWSR0_SYS_PLL_RAT_MASK 0x1f
25 #define RCWSR0_MEM_PLL_RAT_SHIFT 16
26 #define RCWSR0_MEM_PLL_RAT_MASK 0x3f
28 #define RCWSR4_SRDS1_PRTCL_SHIFT 24
29 #define RCWSR4_SRDS1_PRTCL_MASK 0xff000000
31 #define TIMER_COMP_VAL 0xffffffff
32 #define ARCH_TIMER_CTRL_ENABLE (1 << 0)
33 #define SYS_COUNTER_CTRL_ENABLE (1 << 24)
35 #define DCFG_CCSR_PORSR1_RCW_MASK 0xff800000
36 #define DCFG_CCSR_PORSR1_RCW_SRC_I2C 0x24800000
38 #define DCFG_DCSR_PORCR1 0
41 * Define default values for some CCSR macros to make header files cleaner
43 * To completely disable CCSR relocation in a board header file, define
44 * CONFIG_SYS_CCSR_DO_NOT_RELOCATE. This will force CONFIG_SYS_CCSRBAR_PHYS
45 * to a value that is the same as CONFIG_SYS_CCSRBAR.
48 #ifdef CONFIG_SYS_CCSRBAR_PHYS
49 #error "Do not define CONFIG_SYS_CCSRBAR_PHYS directly."
52 #ifdef CONFIG_SYS_CCSR_DO_NOT_RELOCATE
53 #undef CONFIG_SYS_CCSRBAR_PHYS_HIGH
54 #undef CONFIG_SYS_CCSRBAR_PHYS_LOW
55 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
58 #ifndef CONFIG_SYS_CCSRBAR
59 #define CONFIG_SYS_CCSRBAR CONFIG_SYS_IMMR
62 #ifndef CONFIG_SYS_CCSRBAR_PHYS_HIGH
63 #ifdef CONFIG_PHYS_64BIT
64 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0xf
66 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
70 #ifndef CONFIG_SYS_CCSRBAR_PHYS_LOW
71 #define CONFIG_SYS_CCSRBAR_PHYS_LOW CONFIG_SYS_IMMR
74 #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH * 1ull) << 32 | \
75 CONFIG_SYS_CCSRBAR_PHYS_LOW)
78 unsigned long freq_processor[CONFIG_MAX_CPUS];
79 unsigned long freq_systembus;
80 unsigned long freq_ddrbus;
81 unsigned long freq_localbus;
84 /* Device Configuration and Pin Control */
86 u32 porsr1; /* POR status 1 */
87 u32 porsr2; /* POR status 2 */
89 u32 gpporcr1; /* General-purpose POR configuration */
91 u32 dcfg_fusesr; /* Fuse status register */
92 u8 res_02c[0x70-0x2c];
93 u32 devdisr; /* Device disable control */
94 u32 devdisr2; /* Device disable control 2 */
95 u32 devdisr3; /* Device disable control 3 */
96 u32 devdisr4; /* Device disable control 4 */
97 u32 devdisr5; /* Device disable control 5 */
98 u8 res_084[0x94-0x84];
99 u32 coredisru; /* uppper portion for support of 64 cores */
100 u32 coredisrl; /* lower portion for support of 64 cores */
101 u8 res_09c[0xa4-0x9c];
102 u32 svr; /* System version */
103 u8 res_0a8[0xb0-0xa8];
104 u32 rstcr; /* Reset control */
105 u32 rstrqpblsr; /* Reset request preboot loader status */
106 u8 res_0b8[0xc0-0xb8];
107 u32 rstrqmr1; /* Reset request mask */
108 u8 res_0c4[0xc8-0xc4];
109 u32 rstrqsr1; /* Reset request status */
110 u8 res_0cc[0xd4-0xcc];
111 u32 rstrqwdtmrl; /* Reset request WDT mask */
112 u8 res_0d8[0xdc-0xd8];
113 u32 rstrqwdtsrl; /* Reset request WDT status */
114 u8 res_0e0[0xe4-0xe0];
115 u32 brrl; /* Boot release */
116 u8 res_0e8[0x100-0xe8];
117 u32 rcwsr[16]; /* Reset control word status */
118 u8 res_140[0x200-0x140];
119 u32 scratchrw[4]; /* Scratch Read/Write */
120 u8 res_210[0x300-0x210];
121 u32 scratchw1r[4]; /* Scratch Read (Write once) */
122 u8 res_310[0x400-0x310];
124 u8 res_404[0x550-0x404];
126 u8 res_554[0x604-0x554];
129 u8 res_60c[0x740-0x60c]; /* add more registers when needed */
130 u32 tp_ityp[64]; /* Topology Initiator Type Register */
134 } tp_cluster[1]; /* Core Cluster n Topology Register */
135 u8 res_848[0xe60-0x848];
137 u8 res_e60[0xe68-0xe64];
139 u8 res_e68[0xe80-0xe6c];
143 #define SCFG_ETSECDMAMCR_LE_BD_FR 0xf8001a0f
144 #define SCFG_ETSECCMCR_GE2_CLK125 0x04000000
145 #define SCFG_ETSECCMCR_GE0_CLK125 0x00000000
146 #define SCFG_ETSECCMCR_GE1_CLK125 0x08000000
147 #define SCFG_PIXCLKCR_PXCKEN 0x80000000
148 #define SCFG_QSPI_CLKSEL 0xc0100000
150 /* Supplemental Configuration Unit */
166 u32 pex1rdmsgpldlsbsr;
167 u32 pex1rdmsgpldmsbsr;
168 u32 pex2rdmsgpldlsbsr;
169 u32 pex2rdmsgpldmsbsr;
236 u32 clkcncsr; /* core cluster n clock control status */
239 u8 res_040[0x7c0]; /* 0x100 */
245 u32 clkpcsr; /* 0xa00 Platform clock domain control/status */
247 u32 pllpgsr; /* 0xc00 Platform PLL General Status */
249 u32 plldgsr; /* 0xc20 DDR PLL General Status */
267 #define SRDS_MAX_LANES 4
268 #define SRDS_MAX_BANK 2
270 #define SRDS_RSTCTL_RST 0x80000000
271 #define SRDS_RSTCTL_RSTDONE 0x40000000
272 #define SRDS_RSTCTL_RSTERR 0x20000000
273 #define SRDS_RSTCTL_SWRST 0x10000000
274 #define SRDS_RSTCTL_SDEN 0x00000020
275 #define SRDS_RSTCTL_SDRST_B 0x00000040
276 #define SRDS_RSTCTL_PLLRST_B 0x00000080
277 #define SRDS_PLLCR0_POFF 0x80000000
278 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000
279 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000
280 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000
281 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000
282 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000
283 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000
284 #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000
285 #define SRDS_PLLCR0_PLL_LCK 0x00800000
286 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000
287 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000
288 #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000
289 #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000
290 #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000
291 #define SRDS_PLLCR0_FRATE_SEL_3_12 0x00090000
292 #define SRDS_PLLCR0_FRATE_SEL_3 0x000a0000
293 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000
297 u32 rstctl; /* Reset Control Register */
299 u32 pllcr0; /* PLL Control Register 0 */
301 u32 pllcr1; /* PLL Control Register 1 */
302 u32 res_0c; /* 0x00c */
305 u8 res_18[0x20-0x18];
307 u8 res_40[0x90-0x40];
308 u32 srdstcalcr; /* 0x90 TX Calibration Control */
309 u8 res_94[0xa0-0x94];
310 u32 srdsrcalcr; /* 0xa0 RX Calibration Control */
311 u8 res_a4[0xb0-0xa4];
312 u32 srdsgr0; /* 0xb0 General Register 0 */
313 u8 res_b4[0xe0-0xb4];
314 u32 srdspccr0; /* 0xe0 Protocol Converter Config 0 */
315 u32 srdspccr1; /* 0xe4 Protocol Converter Config 1 */
316 u32 srdspccr2; /* 0xe8 Protocol Converter Config 2 */
317 u32 srdspccr3; /* 0xec Protocol Converter Config 3 */
318 u32 srdspccr4; /* 0xf0 Protocol Converter Config 4 */
319 u8 res_f4[0x100-0xf4];
321 u32 lnpssr; /* 0x100, 0x120, ..., 0x1e0 */
322 u8 res_104[0x120-0x104];
324 u8 res_180[0x300-0x180];
326 u32 srdspexeqpcr[11];
327 u8 res_330[0x400-0x330];
329 u8 res_404[0x440-0x404];
331 u8 res_444[0x800-0x444];
333 u32 gcr0; /* 0x800 General Control Register 0 */
334 u32 gcr1; /* 0x804 General Control Register 1 */
335 u32 gcr2; /* 0x808 General Control Register 2 */
337 u32 recr0; /* 0x810 Receive Equalization Control */
339 u32 tecr0; /* 0x818 Transmit Equalization Control */
341 u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */
342 u8 res_824[0x83c-0x824];
344 } lane[4]; /* Lane A, B, C, D, E, F, G, H */
345 u8 res_a00[0x1000-0xa00]; /* from 0xa00 to 0xfff */
348 #define DDR_SDRAM_CFG 0x470c0008
349 #define DDR_CS0_BNDS 0x008000bf
350 #define DDR_CS0_CONFIG 0x80014302
351 #define DDR_TIMING_CFG_0 0x50550004
352 #define DDR_TIMING_CFG_1 0xbcb38c56
353 #define DDR_TIMING_CFG_2 0x0040d120
354 #define DDR_TIMING_CFG_3 0x010e1000
355 #define DDR_TIMING_CFG_4 0x00000001
356 #define DDR_TIMING_CFG_5 0x03401400
357 #define DDR_SDRAM_CFG_2 0x00401010
358 #define DDR_SDRAM_MODE 0x00061c60
359 #define DDR_SDRAM_MODE_2 0x00180000
360 #define DDR_SDRAM_INTERVAL 0x18600618
361 #define DDR_DDR_WRLVL_CNTL 0x8655f605
362 #define DDR_DDR_WRLVL_CNTL_2 0x05060607
363 #define DDR_DDR_WRLVL_CNTL_3 0x05050505
364 #define DDR_DDR_CDR1 0x80040000
365 #define DDR_DDR_CDR2 0x00000001
366 #define DDR_SDRAM_CLK_CNTL 0x02000000
367 #define DDR_DDR_ZQ_CNTL 0x89080600
368 #define DDR_CS0_CONFIG_2 0
369 #define DDR_SDRAM_CFG_MEM_EN 0x80000000
371 /* DDR memory controller registers */
373 u32 cs0_bnds; /* Chip Select 0 Memory Bounds */
375 u32 cs1_bnds; /* Chip Select 1 Memory Bounds */
377 u32 cs2_bnds; /* Chip Select 2 Memory Bounds */
379 u32 cs3_bnds; /* Chip Select 3 Memory Bounds */
381 u32 cs0_config; /* Chip Select Configuration */
382 u32 cs1_config; /* Chip Select Configuration */
383 u32 cs2_config; /* Chip Select Configuration */
384 u32 cs3_config; /* Chip Select Configuration */
386 u32 cs0_config_2; /* Chip Select Configuration 2 */
387 u32 cs1_config_2; /* Chip Select Configuration 2 */
388 u32 cs2_config_2; /* Chip Select Configuration 2 */
389 u32 cs3_config_2; /* Chip Select Configuration 2 */
391 u32 timing_cfg_3; /* SDRAM Timing Configuration 3 */
392 u32 timing_cfg_0; /* SDRAM Timing Configuration 0 */
393 u32 timing_cfg_1; /* SDRAM Timing Configuration 1 */
394 u32 timing_cfg_2; /* SDRAM Timing Configuration 2 */
395 u32 sdram_cfg; /* SDRAM Control Configuration */
396 u32 sdram_cfg_2; /* SDRAM Control Configuration 2 */
397 u32 sdram_mode; /* SDRAM Mode Configuration */
398 u32 sdram_mode_2; /* SDRAM Mode Configuration 2 */
399 u32 sdram_md_cntl; /* SDRAM Mode Control */
400 u32 sdram_interval; /* SDRAM Interval Configuration */
401 u32 sdram_data_init; /* SDRAM Data initialization */
403 u32 sdram_clk_cntl; /* SDRAM Clock Control */
405 u32 init_addr; /* training init addr */
406 u32 init_ext_addr; /* training init extended addr */
408 u32 timing_cfg_4; /* SDRAM Timing Configuration 4 */
409 u32 timing_cfg_5; /* SDRAM Timing Configuration 5 */
410 u32 timing_cfg_6; /* SDRAM Timing Configuration 6 */
411 u32 timing_cfg_7; /* SDRAM Timing Configuration 7 */
412 u32 ddr_zq_cntl; /* ZQ calibration control*/
413 u32 ddr_wrlvl_cntl; /* write leveling control*/
415 u32 ddr_sr_cntr; /* self refresvh counter */
416 u32 ddr_sdram_rcw_1; /* Control Words 1 */
417 u32 ddr_sdram_rcw_2; /* Control Words 2 */
419 u32 ddr_wrlvl_cntl_2; /* write leveling control 2 */
420 u32 ddr_wrlvl_cntl_3; /* write leveling control 3 */
422 u32 ddr_sdram_rcw_3; /* Control Words 3 */
423 u32 ddr_sdram_rcw_4; /* Control Words 4 */
424 u32 ddr_sdram_rcw_5; /* Control Words 5 */
425 u32 ddr_sdram_rcw_6; /* Control Words 6 */
427 u32 sdram_mode_3; /* SDRAM Mode Configuration 3 */
428 u32 sdram_mode_4; /* SDRAM Mode Configuration 4 */
429 u32 sdram_mode_5; /* SDRAM Mode Configuration 5 */
430 u32 sdram_mode_6; /* SDRAM Mode Configuration 6 */
431 u32 sdram_mode_7; /* SDRAM Mode Configuration 7 */
432 u32 sdram_mode_8; /* SDRAM Mode Configuration 8 */
433 u32 sdram_mode_9; /* SDRAM Mode Configuration 9 */
434 u32 sdram_mode_10; /* SDRAM Mode Configuration 10 */
435 u32 sdram_mode_11; /* SDRAM Mode Configuration 11 */
436 u32 sdram_mode_12; /* SDRAM Mode Configuration 12 */
437 u32 sdram_mode_13; /* SDRAM Mode Configuration 13 */
438 u32 sdram_mode_14; /* SDRAM Mode Configuration 14 */
439 u32 sdram_mode_15; /* SDRAM Mode Configuration 15 */
440 u32 sdram_mode_16; /* SDRAM Mode Configuration 16 */
442 u32 timing_cfg_8; /* SDRAM Timing Configuration 8 */
443 u32 timing_cfg_9; /* SDRAM Timing Configuration 9 */
445 u32 sdram_cfg_3; /* SDRAM Control Configuration 3 */
447 u32 deskew_cntl; /* SDRAM Deskew Control */
449 u32 ddr_dsr1; /* Debug Status 1 */
450 u32 ddr_dsr2; /* Debug Status 2 */
451 u32 ddr_cdr1; /* Control Driver 1 */
452 u32 ddr_cdr2; /* Control Driver 2 */
454 u32 ip_rev1; /* IP Block Revision 1 */
455 u32 ip_rev2; /* IP Block Revision 2 */
456 u32 eor; /* Enhanced Optimization Register */
458 u32 mtcr; /* Memory Test Control Register */
460 u32 mtp1; /* Memory Test Pattern 1 */
461 u32 mtp2; /* Memory Test Pattern 2 */
462 u32 mtp3; /* Memory Test Pattern 3 */
463 u32 mtp4; /* Memory Test Pattern 4 */
464 u32 mtp5; /* Memory Test Pattern 5 */
465 u32 mtp6; /* Memory Test Pattern 6 */
466 u32 mtp7; /* Memory Test Pattern 7 */
467 u32 mtp8; /* Memory Test Pattern 8 */
468 u32 mtp9; /* Memory Test Pattern 9 */
469 u32 mtp10; /* Memory Test Pattern 10 */
471 u32 ddr_mt_st_ext_addr; /* Memory Test Start Extended Address */
472 u32 ddr_mt_st_addr; /* Memory Test Start Address */
473 u32 ddr_mt_end_ext_addr; /* Memory Test End Extended Address */
474 u32 ddr_mt_end_addr; /* Memory Test End Address */
476 u32 data_err_inject_hi; /* Data Path Err Injection Mask High */
477 u32 data_err_inject_lo; /* Data Path Err Injection Mask Low */
478 u32 ecc_err_inject; /* Data Path Err Injection Mask ECC */
480 u32 capture_data_hi; /* Data Path Read Capture High */
481 u32 capture_data_lo; /* Data Path Read Capture Low */
482 u32 capture_ecc; /* Data Path Read Capture ECC */
484 u32 err_detect; /* Error Detect */
485 u32 err_disable; /* Error Disable */
487 u32 capture_attributes; /* Error Attrs Capture */
488 u32 capture_address; /* Error Addr Capture */
489 u32 capture_ext_address; /* Error Extended Addr Capture */
490 u32 err_sbe; /* Single-Bit ECC Error Management */
494 #define CCI400_CTRLORD_TERM_BARRIER 0x00000008
495 #define CCI400_CTRLORD_EN_BARRIER 0
496 #define CCI400_SHAORD_NON_SHAREABLE 0x00000002
497 #define CCI400_DVM_MESSAGE_REQ_EN 0x00000002
498 #define CCI400_SNOOP_REQ_EN 0x00000001
500 /* CCI-400 registers */
502 u32 ctrl_ord; /* Control Override */
503 u32 spec_ctrl; /* Speculation Control */
504 u32 secure_access; /* Secure Access */
505 u32 status; /* Status */
506 u32 impr_err; /* Imprecise Error */
507 u8 res_14[0x100 - 0x14];
508 u32 pmcr; /* Performance Monitor Control */
509 u8 res_104[0xfd0 - 0x104];
510 u32 pid[8]; /* Peripheral ID */
511 u32 cid[4]; /* Component ID */
513 u32 snoop_ctrl; /* Snoop Control */
514 u32 sha_ord; /* Shareable Override */
515 u8 res_1008[0x1100 - 0x1008];
516 u32 rc_qos_ord; /* read channel QoS Value Override */
517 u32 wc_qos_ord; /* read channel QoS Value Override */
518 u8 res_1108[0x110c - 0x1108];
519 u32 qos_ctrl; /* QoS Control */
520 u32 max_ot; /* Max OT */
521 u8 res_1114[0x1130 - 0x1114];
522 u32 target_lat; /* Target Latency */
523 u32 latency_regu; /* Latency Regulation */
524 u32 qos_range; /* QoS Range */
525 u8 res_113c[0x2000 - 0x113c];
526 } slave[5]; /* Slave Interface */
527 u8 res_6000[0x9004 - 0x6000];
528 u32 cycle_counter; /* Cycle counter */
529 u32 count_ctrl; /* Count Control */
530 u32 overflow_status; /* Overflow Flag Status */
531 u8 res_9010[0xa000 - 0x9010];
533 u32 event_select; /* Event Select */
534 u32 event_count; /* Event Count */
535 u32 counter_ctrl; /* Counter Control */
536 u32 overflow_status; /* Overflow Flag Status */
537 u8 res_a010[0xb000 - 0xa010];
538 } pcounter[4]; /* Performance Counter */
539 u8 res_e004[0x10000 - 0xe004];
541 #endif /* __ASM_ARCH_LS102XA_IMMAP_H_ */