Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 2 | /* |
| 3 | * Common internal memory map for some Freescale SoCs |
| 4 | * |
York Sun | 34e026f | 2014-03-27 17:54:47 -0700 | [diff] [blame] | 5 | * Copyright 2013-2014 Freescale Semiconductor, Inc. |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __FSL_IMMAP_H |
| 9 | #define __FSL_IMMAP_H |
Tom Rini | 03de305 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 10 | |
| 11 | #include <linux/types.h> |
| 12 | |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 13 | /* |
| 14 | * DDR memory controller registers |
| 15 | * This structure works for mpc83xx (DDR2 and DDR3), mpc85xx, mpc86xx. |
| 16 | */ |
| 17 | struct ccsr_ddr { |
| 18 | u32 cs0_bnds; /* Chip Select 0 Memory Bounds */ |
| 19 | u8 res_04[4]; |
| 20 | u32 cs1_bnds; /* Chip Select 1 Memory Bounds */ |
| 21 | u8 res_0c[4]; |
| 22 | u32 cs2_bnds; /* Chip Select 2 Memory Bounds */ |
| 23 | u8 res_14[4]; |
| 24 | u32 cs3_bnds; /* Chip Select 3 Memory Bounds */ |
| 25 | u8 res_1c[100]; |
| 26 | u32 cs0_config; /* Chip Select Configuration */ |
| 27 | u32 cs1_config; /* Chip Select Configuration */ |
| 28 | u32 cs2_config; /* Chip Select Configuration */ |
| 29 | u32 cs3_config; /* Chip Select Configuration */ |
| 30 | u8 res_90[48]; |
| 31 | u32 cs0_config_2; /* Chip Select Configuration 2 */ |
| 32 | u32 cs1_config_2; /* Chip Select Configuration 2 */ |
| 33 | u32 cs2_config_2; /* Chip Select Configuration 2 */ |
| 34 | u32 cs3_config_2; /* Chip Select Configuration 2 */ |
| 35 | u8 res_d0[48]; |
| 36 | u32 timing_cfg_3; /* SDRAM Timing Configuration 3 */ |
| 37 | u32 timing_cfg_0; /* SDRAM Timing Configuration 0 */ |
| 38 | u32 timing_cfg_1; /* SDRAM Timing Configuration 1 */ |
| 39 | u32 timing_cfg_2; /* SDRAM Timing Configuration 2 */ |
| 40 | u32 sdram_cfg; /* SDRAM Control Configuration */ |
| 41 | u32 sdram_cfg_2; /* SDRAM Control Configuration 2 */ |
| 42 | u32 sdram_mode; /* SDRAM Mode Configuration */ |
| 43 | u32 sdram_mode_2; /* SDRAM Mode Configuration 2 */ |
| 44 | u32 sdram_md_cntl; /* SDRAM Mode Control */ |
| 45 | u32 sdram_interval; /* SDRAM Interval Configuration */ |
| 46 | u32 sdram_data_init; /* SDRAM Data initialization */ |
| 47 | u8 res_12c[4]; |
| 48 | u32 sdram_clk_cntl; /* SDRAM Clock Control */ |
| 49 | u8 res_134[20]; |
| 50 | u32 init_addr; /* training init addr */ |
| 51 | u32 init_ext_addr; /* training init extended addr */ |
| 52 | u8 res_150[16]; |
| 53 | u32 timing_cfg_4; /* SDRAM Timing Configuration 4 */ |
| 54 | u32 timing_cfg_5; /* SDRAM Timing Configuration 5 */ |
York Sun | 34e026f | 2014-03-27 17:54:47 -0700 | [diff] [blame] | 55 | u32 timing_cfg_6; /* SDRAM Timing Configuration 6 */ |
| 56 | u32 timing_cfg_7; /* SDRAM Timing Configuration 7 */ |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 57 | u32 ddr_zq_cntl; /* ZQ calibration control*/ |
| 58 | u32 ddr_wrlvl_cntl; /* write leveling control*/ |
| 59 | u8 reg_178[4]; |
| 60 | u32 ddr_sr_cntr; /* self refresh counter */ |
| 61 | u32 ddr_sdram_rcw_1; /* Control Words 1 */ |
| 62 | u32 ddr_sdram_rcw_2; /* Control Words 2 */ |
| 63 | u8 reg_188[8]; |
| 64 | u32 ddr_wrlvl_cntl_2; /* write leveling control 2 */ |
| 65 | u32 ddr_wrlvl_cntl_3; /* write leveling control 3 */ |
York Sun | 34e026f | 2014-03-27 17:54:47 -0700 | [diff] [blame] | 66 | u8 res_198[0x1a0-0x198]; |
| 67 | u32 ddr_sdram_rcw_3; |
| 68 | u32 ddr_sdram_rcw_4; |
| 69 | u32 ddr_sdram_rcw_5; |
| 70 | u32 ddr_sdram_rcw_6; |
| 71 | u8 res_1b0[0x200-0x1b0]; |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 72 | u32 sdram_mode_3; /* SDRAM Mode Configuration 3 */ |
| 73 | u32 sdram_mode_4; /* SDRAM Mode Configuration 4 */ |
| 74 | u32 sdram_mode_5; /* SDRAM Mode Configuration 5 */ |
| 75 | u32 sdram_mode_6; /* SDRAM Mode Configuration 6 */ |
| 76 | u32 sdram_mode_7; /* SDRAM Mode Configuration 7 */ |
| 77 | u32 sdram_mode_8; /* SDRAM Mode Configuration 8 */ |
York Sun | 34e026f | 2014-03-27 17:54:47 -0700 | [diff] [blame] | 78 | u8 res_218[0x220-0x218]; |
| 79 | u32 sdram_mode_9; /* SDRAM Mode Configuration 9 */ |
| 80 | u32 sdram_mode_10; /* SDRAM Mode Configuration 10 */ |
| 81 | u32 sdram_mode_11; /* SDRAM Mode Configuration 11 */ |
| 82 | u32 sdram_mode_12; /* SDRAM Mode Configuration 12 */ |
| 83 | u32 sdram_mode_13; /* SDRAM Mode Configuration 13 */ |
| 84 | u32 sdram_mode_14; /* SDRAM Mode Configuration 14 */ |
| 85 | u32 sdram_mode_15; /* SDRAM Mode Configuration 15 */ |
| 86 | u32 sdram_mode_16; /* SDRAM Mode Configuration 16 */ |
| 87 | u8 res_240[0x250-0x240]; |
| 88 | u32 timing_cfg_8; /* SDRAM Timing Configuration 8 */ |
| 89 | u32 timing_cfg_9; /* SDRAM Timing Configuration 9 */ |
| 90 | u8 res_258[0x260-0x258]; |
| 91 | u32 sdram_cfg_3; |
York Sun | d9be24c | 2015-04-28 14:23:14 -0700 | [diff] [blame] | 92 | u8 res_264[0x400-0x264]; |
York Sun | 34e026f | 2014-03-27 17:54:47 -0700 | [diff] [blame] | 93 | u32 dq_map_0; |
| 94 | u32 dq_map_1; |
| 95 | u32 dq_map_2; |
| 96 | u32 dq_map_3; |
| 97 | u8 res_410[0xb20-0x410]; |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 98 | u32 ddr_dsr1; /* Debug Status 1 */ |
| 99 | u32 ddr_dsr2; /* Debug Status 2 */ |
| 100 | u32 ddr_cdr1; /* Control Driver 1 */ |
| 101 | u32 ddr_cdr2; /* Control Driver 2 */ |
| 102 | u8 res_b30[200]; |
| 103 | u32 ip_rev1; /* IP Block Revision 1 */ |
| 104 | u32 ip_rev2; /* IP Block Revision 2 */ |
| 105 | u32 eor; /* Enhanced Optimization Register */ |
| 106 | u8 res_c04[252]; |
| 107 | u32 mtcr; /* Memory Test Control Register */ |
| 108 | u8 res_d04[28]; |
| 109 | u32 mtp1; /* Memory Test Pattern 1 */ |
| 110 | u32 mtp2; /* Memory Test Pattern 2 */ |
| 111 | u32 mtp3; /* Memory Test Pattern 3 */ |
| 112 | u32 mtp4; /* Memory Test Pattern 4 */ |
| 113 | u32 mtp5; /* Memory Test Pattern 5 */ |
| 114 | u32 mtp6; /* Memory Test Pattern 6 */ |
| 115 | u32 mtp7; /* Memory Test Pattern 7 */ |
| 116 | u32 mtp8; /* Memory Test Pattern 8 */ |
| 117 | u32 mtp9; /* Memory Test Pattern 9 */ |
| 118 | u32 mtp10; /* Memory Test Pattern 10 */ |
| 119 | u8 res_d48[184]; |
| 120 | u32 data_err_inject_hi; /* Data Path Err Injection Mask High */ |
| 121 | u32 data_err_inject_lo; /* Data Path Err Injection Mask Low */ |
| 122 | u32 ecc_err_inject; /* Data Path Err Injection Mask ECC */ |
| 123 | u8 res_e0c[20]; |
| 124 | u32 capture_data_hi; /* Data Path Read Capture High */ |
| 125 | u32 capture_data_lo; /* Data Path Read Capture Low */ |
| 126 | u32 capture_ecc; /* Data Path Read Capture ECC */ |
| 127 | u8 res_e2c[20]; |
| 128 | u32 err_detect; /* Error Detect */ |
| 129 | u32 err_disable; /* Error Disable */ |
| 130 | u32 err_int_en; |
| 131 | u32 capture_attributes; /* Error Attrs Capture */ |
| 132 | u32 capture_address; /* Error Addr Capture */ |
| 133 | u32 capture_ext_address; /* Error Extended Addr Capture */ |
| 134 | u32 err_sbe; /* Single-Bit ECC Error Management */ |
| 135 | u8 res_e5c[164]; |
York Sun | b406731 | 2016-08-29 17:04:12 +0800 | [diff] [blame] | 136 | u32 debug[64]; /* debug_1 to debug_64 */ |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 137 | }; |
Ashish Kumar | 63b2316 | 2017-08-11 11:09:14 +0530 | [diff] [blame] | 138 | |
| 139 | #ifdef CONFIG_SYS_FSL_HAS_CCI400 |
| 140 | #define CCI400_CTRLORD_TERM_BARRIER 0x00000008 |
| 141 | #define CCI400_CTRLORD_EN_BARRIER 0 |
| 142 | #define CCI400_SHAORD_NON_SHAREABLE 0x00000002 |
| 143 | #define CCI400_DVM_MESSAGE_REQ_EN 0x00000002 |
| 144 | #define CCI400_SNOOP_REQ_EN 0x00000001 |
| 145 | |
| 146 | /* CCI-400 registers */ |
| 147 | struct ccsr_cci400 { |
| 148 | u32 ctrl_ord; /* Control Override */ |
| 149 | u32 spec_ctrl; /* Speculation Control */ |
| 150 | u32 secure_access; /* Secure Access */ |
| 151 | u32 status; /* Status */ |
| 152 | u32 impr_err; /* Imprecise Error */ |
| 153 | u8 res_14[0x100 - 0x14]; |
| 154 | u32 pmcr; /* Performance Monitor Control */ |
| 155 | u8 res_104[0xfd0 - 0x104]; |
| 156 | u32 pid[8]; /* Peripheral ID */ |
| 157 | u32 cid[4]; /* Component ID */ |
| 158 | struct { |
| 159 | u32 snoop_ctrl; /* Snoop Control */ |
| 160 | u32 sha_ord; /* Shareable Override */ |
| 161 | u8 res_1008[0x1100 - 0x1008]; |
| 162 | u32 rc_qos_ord; /* read channel QoS Value Override */ |
| 163 | u32 wc_qos_ord; /* read channel QoS Value Override */ |
| 164 | u8 res_1108[0x110c - 0x1108]; |
| 165 | u32 qos_ctrl; /* QoS Control */ |
| 166 | u32 max_ot; /* Max OT */ |
| 167 | u8 res_1114[0x1130 - 0x1114]; |
| 168 | u32 target_lat; /* Target Latency */ |
| 169 | u32 latency_regu; /* Latency Regulation */ |
| 170 | u32 qos_range; /* QoS Range */ |
| 171 | u8 res_113c[0x2000 - 0x113c]; |
| 172 | } slave[5]; /* Slave Interface */ |
| 173 | u8 res_6000[0x9004 - 0x6000]; |
| 174 | u32 cycle_counter; /* Cycle counter */ |
| 175 | u32 count_ctrl; /* Count Control */ |
| 176 | u32 overflow_status; /* Overflow Flag Status */ |
| 177 | u8 res_9010[0xa000 - 0x9010]; |
| 178 | struct { |
| 179 | u32 event_select; /* Event Select */ |
| 180 | u32 event_count; /* Event Count */ |
| 181 | u32 counter_ctrl; /* Counter Control */ |
| 182 | u32 overflow_status; /* Overflow Flag Status */ |
| 183 | u8 res_a010[0xb000 - 0xa010]; |
| 184 | } pcounter[4]; /* Performance Counter */ |
| 185 | u8 res_e004[0x10000 - 0xe004]; |
| 186 | }; |
| 187 | #endif |
| 188 | |
York Sun | 9a17eb5 | 2013-11-18 10:29:32 -0800 | [diff] [blame] | 189 | #endif /* __FSL_IMMAP_H */ |