Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2009 Freescale Semiconductor, Inc. |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 7 | #ifndef __ASM_ARCH_MX5_IMX_REGS_H__ |
| 8 | #define __ASM_ARCH_MX5_IMX_REGS_H__ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 9 | |
Benoît Thébaudeau | 8e99ecd | 2012-08-13 07:27:58 +0000 | [diff] [blame] | 10 | #define ARCH_MXC |
| 11 | |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 12 | #if defined(CONFIG_MX51) |
Shawn Guo | 1ab027c | 2010-10-28 10:13:15 +0800 | [diff] [blame] | 13 | #define IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */ |
Fabio Estevam | fff6ef7 | 2012-05-15 08:01:16 +0000 | [diff] [blame] | 14 | #define IPU_SOC_BASE_ADDR 0x40000000 |
| 15 | #define IPU_SOC_OFFSET 0x1E000000 |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 16 | #define SPBA0_BASE_ADDR 0x70000000 |
| 17 | #define AIPS1_BASE_ADDR 0x73F00000 |
| 18 | #define AIPS2_BASE_ADDR 0x83F00000 |
| 19 | #define CSD0_BASE_ADDR 0x90000000 |
| 20 | #define CSD1_BASE_ADDR 0xA0000000 |
| 21 | #define NFC_BASE_ADDR_AXI 0xCFFF0000 |
Fabio Estevam | ac4020e | 2011-06-07 07:02:50 +0000 | [diff] [blame] | 22 | #define CS1_BASE_ADDR 0xB8000000 |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 23 | #elif defined(CONFIG_MX53) |
Fabio Estevam | fff6ef7 | 2012-05-15 08:01:16 +0000 | [diff] [blame] | 24 | #define IPU_SOC_BASE_ADDR 0x18000000 |
| 25 | #define IPU_SOC_OFFSET 0x06000000 |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 26 | #define SPBA0_BASE_ADDR 0x50000000 |
| 27 | #define AIPS1_BASE_ADDR 0x53F00000 |
| 28 | #define AIPS2_BASE_ADDR 0x63F00000 |
| 29 | #define CSD0_BASE_ADDR 0x70000000 |
| 30 | #define CSD1_BASE_ADDR 0xB0000000 |
| 31 | #define NFC_BASE_ADDR_AXI 0xF7FF0000 |
| 32 | #define IRAM_BASE_ADDR 0xF8000000 |
Fabio Estevam | ac4020e | 2011-06-07 07:02:50 +0000 | [diff] [blame] | 33 | #define CS1_BASE_ADDR 0xF4000000 |
Stefano Babic | d87c85c | 2012-02-22 00:24:36 +0000 | [diff] [blame] | 34 | #define SATA_BASE_ADDR 0x10000000 |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 35 | #else |
| 36 | #error "CPU_TYPE not defined" |
| 37 | #endif |
| 38 | |
| 39 | #define IRAM_SIZE 0x00020000 /* 128 KB */ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * SPBA global module enabled #0 |
| 43 | */ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 44 | #define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) |
| 45 | #define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) |
Stefano Babic | 40f6fff | 2011-11-22 15:22:39 +0100 | [diff] [blame] | 46 | #define UART3_BASE (SPBA0_BASE_ADDR + 0x0000C000) |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 47 | #define CSPI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) |
| 48 | #define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) |
| 49 | #define MMC_SDHC3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) |
| 50 | #define MMC_SDHC4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) |
| 51 | #define SPDIF_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) |
| 52 | #define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) |
| 53 | #define SLIM_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) |
| 54 | #define HSI2C_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) |
| 55 | #define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) |
| 56 | |
| 57 | /* |
| 58 | * AIPS 1 |
| 59 | */ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 60 | #define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000) |
| 61 | #define GPIO1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000) |
| 62 | #define GPIO2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) |
| 63 | #define GPIO3_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) |
| 64 | #define GPIO4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) |
| 65 | #define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) |
| 66 | #define WDOG1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) |
| 67 | #define WDOG2_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) |
| 68 | #define GPT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) |
| 69 | #define SRTC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) |
| 70 | #define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) |
| 71 | #define EPIT1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) |
| 72 | #define EPIT2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) |
| 73 | #define PWM1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000) |
| 74 | #define PWM2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) |
Stefano Babic | 40f6fff | 2011-11-22 15:22:39 +0100 | [diff] [blame] | 75 | #define UART1_BASE (AIPS1_BASE_ADDR + 0x000BC000) |
| 76 | #define UART2_BASE (AIPS1_BASE_ADDR + 0x000C0000) |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 77 | #define SRC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D0000) |
| 78 | #define CCM_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D4000) |
| 79 | #define GPC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000D8000) |
| 80 | |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 81 | #if defined(CONFIG_MX53) |
| 82 | #define GPIO5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000DC000) |
| 83 | #define GPIO6_BASE_ADDR (AIPS1_BASE_ADDR + 0x000E0000) |
| 84 | #define GPIO7_BASE_ADDR (AIPS1_BASE_ADDR + 0x000E4000) |
Troy Kisky | df369dc | 2012-07-19 08:18:24 +0000 | [diff] [blame] | 85 | #define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x000EC000) |
Stefano Babic | 4a9677e | 2012-02-22 00:24:33 +0000 | [diff] [blame] | 86 | #define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000F0000) |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 87 | #endif |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 88 | /* |
| 89 | * AIPS 2 |
| 90 | */ |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 91 | #define PLL1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) |
| 92 | #define PLL2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) |
| 93 | #define PLL3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) |
Marek Vasut | bf2eaf5 | 2011-09-23 11:43:47 +0200 | [diff] [blame] | 94 | #ifdef CONFIG_MX53 |
| 95 | #define PLL4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008c000) |
| 96 | #endif |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 97 | #define AHBMAX_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) |
| 98 | #define IIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) |
| 99 | #define CSU_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) |
| 100 | #define ARM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) |
| 101 | #define OWIRE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) |
| 102 | #define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) |
| 103 | #define CSPI2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) |
| 104 | #define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) |
| 105 | #define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) |
| 106 | #define ROMCP_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) |
| 107 | #define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) |
| 108 | #define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) |
| 109 | #define I2C2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000) |
| 110 | #define I2C1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) |
| 111 | #define SSI1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) |
| 112 | #define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) |
| 113 | #define M4IF_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000) |
| 114 | #define ESDCTL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D9000) |
| 115 | #define WEIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DA000) |
| 116 | #define NFC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DB000) |
| 117 | #define EMI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DBF00) |
| 118 | #define MIPI_HSC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) |
| 119 | #define ATA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) |
| 120 | #define SIM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E4000) |
| 121 | #define SSI3BASE_ADDR (AIPS2_BASE_ADDR + 0x000E8000) |
| 122 | #define FEC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000) |
| 123 | #define TVE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F0000) |
| 124 | #define VPU_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F4000) |
| 125 | #define SAHARA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) |
| 126 | |
Stefano Babic | 4a9677e | 2012-02-22 00:24:33 +0000 | [diff] [blame] | 127 | #if defined(CONFIG_MX53) |
| 128 | #define UART5_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) |
| 129 | #endif |
| 130 | |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 131 | /* |
Fabio Estevam | ac4020e | 2011-06-07 07:02:50 +0000 | [diff] [blame] | 132 | * WEIM CSnGCR1 |
| 133 | */ |
| 134 | #define CSEN 1 |
| 135 | #define SWR (1 << 1) |
| 136 | #define SRD (1 << 2) |
| 137 | #define MUM (1 << 3) |
| 138 | #define WFL (1 << 4) |
| 139 | #define RFL (1 << 5) |
| 140 | #define CRE (1 << 6) |
| 141 | #define CREP (1 << 7) |
| 142 | #define BL(x) (((x) & 0x7) << 8) |
| 143 | #define WC (1 << 11) |
| 144 | #define BCD(x) (((x) & 0x3) << 12) |
| 145 | #define BCS(x) (((x) & 0x3) << 14) |
| 146 | #define DSZ(x) (((x) & 0x7) << 16) |
| 147 | #define SP (1 << 19) |
| 148 | #define CSREC(x) (((x) & 0x7) << 20) |
| 149 | #define AUS (1 << 23) |
| 150 | #define GBC(x) (((x) & 0x7) << 24) |
| 151 | #define WP (1 << 27) |
| 152 | #define PSZ(x) (((x) & 0x0f << 28) |
| 153 | |
| 154 | /* |
| 155 | * WEIM CSnGCR2 |
| 156 | */ |
| 157 | #define ADH(x) (((x) & 0x3)) |
| 158 | #define DAPS(x) (((x) & 0x0f << 4) |
| 159 | #define DAE (1 << 8) |
| 160 | #define DAP (1 << 9) |
| 161 | #define MUX16_BYP (1 << 12) |
| 162 | |
| 163 | /* |
| 164 | * WEIM CSnRCR1 |
| 165 | */ |
| 166 | #define RCSN(x) (((x) & 0x7)) |
| 167 | #define RCSA(x) (((x) & 0x7) << 4) |
| 168 | #define OEN(x) (((x) & 0x7) << 8) |
| 169 | #define OEA(x) (((x) & 0x7) << 12) |
| 170 | #define RADVN(x) (((x) & 0x7) << 16) |
| 171 | #define RAL (1 << 19) |
| 172 | #define RADVA(x) (((x) & 0x7) << 20) |
| 173 | #define RWSC(x) (((x) & 0x3f) << 24) |
| 174 | |
| 175 | /* |
| 176 | * WEIM CSnRCR2 |
| 177 | */ |
| 178 | #define RBEN(x) (((x) & 0x7)) |
| 179 | #define RBE (1 << 3) |
| 180 | #define RBEA(x) (((x) & 0x7) << 4) |
| 181 | #define RL(x) (((x) & 0x3) << 8) |
| 182 | #define PAT(x) (((x) & 0x7) << 12) |
| 183 | #define APR (1 << 15) |
| 184 | |
| 185 | /* |
| 186 | * WEIM CSnWCR1 |
| 187 | */ |
| 188 | #define WCSN(x) (((x) & 0x7)) |
| 189 | #define WCSA(x) (((x) & 0x7) << 3) |
| 190 | #define WEN(x) (((x) & 0x7) << 6) |
| 191 | #define WEA(x) (((x) & 0x7) << 9) |
| 192 | #define WBEN(x) (((x) & 0x7) << 12) |
| 193 | #define WBEA(x) (((x) & 0x7) << 15) |
| 194 | #define WADVN(x) (((x) & 0x7) << 18) |
| 195 | #define WADVA(x) (((x) & 0x7) << 21) |
| 196 | #define WWSC(x) (((x) & 0x3f) << 24) |
| 197 | #define WBED1 (1 << 30) |
| 198 | #define WAL (1 << 31) |
| 199 | |
| 200 | /* |
| 201 | * WEIM CSnWCR2 |
| 202 | */ |
| 203 | #define WBED 1 |
| 204 | |
Fabio Estevam | a6e961c | 2011-06-07 07:02:52 +0000 | [diff] [blame] | 205 | #define CS0_128 0 |
| 206 | #define CS0_64M_CS1_64M 1 |
| 207 | #define CS0_64M_CS1_32M_CS2_32M 2 |
| 208 | #define CS0_32M_CS1_32M_CS2_32M_CS3_32M 3 |
| 209 | |
Fabio Estevam | ac4020e | 2011-06-07 07:02:50 +0000 | [diff] [blame] | 210 | /* |
Eric Nelson | 08c61a5 | 2012-01-31 07:52:03 +0000 | [diff] [blame] | 211 | * CSPI register definitions |
| 212 | */ |
| 213 | #define MXC_ECSPI |
| 214 | #define MXC_CSPICTRL_EN (1 << 0) |
| 215 | #define MXC_CSPICTRL_MODE (1 << 1) |
| 216 | #define MXC_CSPICTRL_XCH (1 << 2) |
Fabio Estevam | 0f1411b | 2013-04-09 13:06:25 +0000 | [diff] [blame] | 217 | #define MXC_CSPICTRL_MODE_MASK (0xf << 4) |
Eric Nelson | 08c61a5 | 2012-01-31 07:52:03 +0000 | [diff] [blame] | 218 | #define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12) |
| 219 | #define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20) |
| 220 | #define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12) |
| 221 | #define MXC_CSPICTRL_POSTDIV(x) (((x) & 0xF) << 8) |
| 222 | #define MXC_CSPICTRL_SELCHAN(x) (((x) & 0x3) << 18) |
| 223 | #define MXC_CSPICTRL_MAXBITS 0xfff |
| 224 | #define MXC_CSPICTRL_TC (1 << 7) |
| 225 | #define MXC_CSPICTRL_RXOVF (1 << 6) |
| 226 | #define MXC_CSPIPERIOD_32KHZ (1 << 15) |
| 227 | #define MAX_SPI_BYTES 32 |
| 228 | |
| 229 | /* Bit position inside CTRL register to be associated with SS */ |
| 230 | #define MXC_CSPICTRL_CHAN 18 |
| 231 | |
| 232 | /* Bit position inside CON register to be associated with SS */ |
| 233 | #define MXC_CSPICON_POL 4 |
| 234 | #define MXC_CSPICON_PHA 0 |
| 235 | #define MXC_CSPICON_SSPOL 12 |
| 236 | #define MXC_SPI_BASE_ADDRESSES \ |
| 237 | CSPI1_BASE_ADDR, \ |
| 238 | CSPI2_BASE_ADDR, \ |
| 239 | CSPI3_BASE_ADDR, |
| 240 | |
| 241 | /* |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 242 | * Number of GPIO pins per port |
| 243 | */ |
| 244 | #define GPIO_NUM_PIN 32 |
| 245 | |
| 246 | #define IIM_SREV 0x24 |
| 247 | #define ROM_SI_REV 0x48 |
| 248 | |
| 249 | #define NFC_BUF_SIZE 0x1000 |
| 250 | |
| 251 | /* M4IF */ |
| 252 | #define M4IF_FBPM0 0x40 |
| 253 | #define M4IF_FIDBP 0x48 |
Fabio Estevam | 1155d55 | 2013-04-24 14:44:27 +0000 | [diff] [blame] | 254 | #define M4IF_GENP_WEIM_MM_MASK 0x00000001 |
| 255 | #define WEIM_GCR2_MUX16_BYP_GRANT_MASK 0x00001000 |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 256 | |
| 257 | /* Assuming 24MHz input clock with doubler ON */ |
| 258 | /* MFI PDF */ |
David Jander | 9db1bfa | 2011-07-13 21:11:53 +0000 | [diff] [blame] | 259 | #define DP_OP_864 ((8 << 4) + ((1 - 1) << 0)) |
| 260 | #define DP_MFD_864 (180 - 1) /* PL Dither mode */ |
| 261 | #define DP_MFN_864 180 |
| 262 | #define DP_MFN_800_DIT 60 /* PL Dither mode */ |
| 263 | |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 264 | #define DP_OP_850 ((8 << 4) + ((1 - 1) << 0)) |
| 265 | #define DP_MFD_850 (48 - 1) |
| 266 | #define DP_MFN_850 41 |
| 267 | |
| 268 | #define DP_OP_800 ((8 << 4) + ((1 - 1) << 0)) |
| 269 | #define DP_MFD_800 (3 - 1) |
| 270 | #define DP_MFN_800 1 |
| 271 | |
| 272 | #define DP_OP_700 ((7 << 4) + ((1 - 1) << 0)) |
| 273 | #define DP_MFD_700 (24 - 1) |
| 274 | #define DP_MFN_700 7 |
| 275 | |
| 276 | #define DP_OP_665 ((6 << 4) + ((1 - 1) << 0)) |
| 277 | #define DP_MFD_665 (96 - 1) |
| 278 | #define DP_MFN_665 89 |
| 279 | |
| 280 | #define DP_OP_532 ((5 << 4) + ((1 - 1) << 0)) |
| 281 | #define DP_MFD_532 (24 - 1) |
| 282 | #define DP_MFN_532 13 |
| 283 | |
| 284 | #define DP_OP_400 ((8 << 4) + ((2 - 1) << 0)) |
| 285 | #define DP_MFD_400 (3 - 1) |
| 286 | #define DP_MFN_400 1 |
| 287 | |
Fabio Estevam | 782b028 | 2012-10-15 05:37:16 +0000 | [diff] [blame] | 288 | #define DP_OP_455 ((9 << 4) + ((2 - 1) << 0)) |
| 289 | #define DP_MFD_455 (48 - 1) |
| 290 | #define DP_MFN_455 23 |
| 291 | |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 292 | #define DP_OP_216 ((6 << 4) + ((3 - 1) << 0)) |
| 293 | #define DP_MFD_216 (4 - 1) |
| 294 | #define DP_MFN_216 3 |
| 295 | |
| 296 | #define CHIP_REV_1_0 0x10 |
| 297 | #define CHIP_REV_1_1 0x11 |
| 298 | #define CHIP_REV_2_0 0x20 |
| 299 | #define CHIP_REV_2_5 0x25 |
| 300 | #define CHIP_REV_3_0 0x30 |
| 301 | |
| 302 | #define BOARD_REV_1_0 0x0 |
| 303 | #define BOARD_REV_2_0 0x1 |
| 304 | |
Benoît Thébaudeau | 362635b | 2012-09-18 04:48:42 +0000 | [diff] [blame] | 305 | #define BOARD_VER_OFFSET 0x8 |
| 306 | |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 307 | #define IMX_IIM_BASE (IIM_BASE_ADDR) |
| 308 | |
Stefano Babic | f3554df | 2010-09-30 13:11:57 +0200 | [diff] [blame] | 309 | #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) |
| 310 | #include <asm/types.h> |
| 311 | |
| 312 | #define __REG(x) (*((volatile u32 *)(x))) |
| 313 | #define __REG16(x) (*((volatile u16 *)(x))) |
| 314 | #define __REG8(x) (*((volatile u8 *)(x))) |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 315 | |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 316 | struct clkctl { |
| 317 | u32 ccr; |
| 318 | u32 ccdr; |
| 319 | u32 csr; |
| 320 | u32 ccsr; |
| 321 | u32 cacrr; |
| 322 | u32 cbcdr; |
| 323 | u32 cbcmr; |
| 324 | u32 cscmr1; |
| 325 | u32 cscmr2; |
| 326 | u32 cscdr1; |
| 327 | u32 cs1cdr; |
| 328 | u32 cs2cdr; |
| 329 | u32 cdcdr; |
| 330 | u32 chsccdr; |
| 331 | u32 cscdr2; |
| 332 | u32 cscdr3; |
| 333 | u32 cscdr4; |
| 334 | u32 cwdr; |
| 335 | u32 cdhipr; |
| 336 | u32 cdcr; |
| 337 | u32 ctor; |
| 338 | u32 clpcr; |
| 339 | u32 cisr; |
| 340 | u32 cimr; |
| 341 | u32 ccosr; |
| 342 | u32 cgpr; |
| 343 | u32 ccgr0; |
| 344 | u32 ccgr1; |
| 345 | u32 ccgr2; |
| 346 | u32 ccgr3; |
| 347 | u32 ccgr4; |
| 348 | u32 ccgr5; |
| 349 | u32 ccgr6; |
Stefano Babic | 0edf8b5 | 2011-07-07 03:37:06 +0000 | [diff] [blame] | 350 | #if defined(CONFIG_MX53) |
| 351 | u32 ccgr7; |
| 352 | #endif |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 353 | u32 cmeor; |
| 354 | }; |
| 355 | |
Stefano Babic | 0edf8b5 | 2011-07-07 03:37:06 +0000 | [diff] [blame] | 356 | /* DPLL registers */ |
| 357 | struct dpll { |
| 358 | u32 dp_ctl; |
| 359 | u32 dp_config; |
| 360 | u32 dp_op; |
| 361 | u32 dp_mfd; |
| 362 | u32 dp_mfn; |
| 363 | u32 dp_mfn_minus; |
| 364 | u32 dp_mfn_plus; |
| 365 | u32 dp_hfs_op; |
| 366 | u32 dp_hfs_mfd; |
| 367 | u32 dp_hfs_mfn; |
| 368 | u32 dp_mfn_togc; |
| 369 | u32 dp_destat; |
| 370 | }; |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 371 | /* WEIM registers */ |
| 372 | struct weim { |
Fabio Estevam | ac4020e | 2011-06-07 07:02:50 +0000 | [diff] [blame] | 373 | u32 cs0gcr1; |
| 374 | u32 cs0gcr2; |
| 375 | u32 cs0rcr1; |
| 376 | u32 cs0rcr2; |
| 377 | u32 cs0wcr1; |
| 378 | u32 cs0wcr2; |
| 379 | u32 cs1gcr1; |
| 380 | u32 cs1gcr2; |
| 381 | u32 cs1rcr1; |
| 382 | u32 cs1rcr2; |
| 383 | u32 cs1wcr1; |
| 384 | u32 cs1wcr2; |
| 385 | u32 cs2gcr1; |
| 386 | u32 cs2gcr2; |
| 387 | u32 cs2rcr1; |
| 388 | u32 cs2rcr2; |
| 389 | u32 cs2wcr1; |
| 390 | u32 cs2wcr2; |
| 391 | u32 cs3gcr1; |
| 392 | u32 cs3gcr2; |
| 393 | u32 cs3rcr1; |
| 394 | u32 cs3rcr2; |
| 395 | u32 cs3wcr1; |
| 396 | u32 cs3wcr2; |
| 397 | u32 cs4gcr1; |
| 398 | u32 cs4gcr2; |
| 399 | u32 cs4rcr1; |
| 400 | u32 cs4rcr2; |
| 401 | u32 cs4wcr1; |
| 402 | u32 cs4wcr2; |
| 403 | u32 cs5gcr1; |
| 404 | u32 cs5gcr2; |
| 405 | u32 cs5rcr1; |
| 406 | u32 cs5rcr2; |
| 407 | u32 cs5wcr1; |
| 408 | u32 cs5wcr2; |
| 409 | u32 wcr; |
| 410 | u32 wiar; |
| 411 | u32 ear; |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 412 | }; |
| 413 | |
Fabio Estevam | a682b3f | 2011-06-07 07:02:51 +0000 | [diff] [blame] | 414 | #if defined(CONFIG_MX51) |
| 415 | struct iomuxc { |
| 416 | u32 gpr0; |
| 417 | u32 gpr1; |
| 418 | u32 omux0; |
| 419 | u32 omux1; |
| 420 | u32 omux2; |
| 421 | u32 omux3; |
| 422 | u32 omux4; |
| 423 | }; |
| 424 | #elif defined(CONFIG_MX53) |
| 425 | struct iomuxc { |
| 426 | u32 gpr0; |
| 427 | u32 gpr1; |
| 428 | u32 gpr2; |
| 429 | u32 omux0; |
| 430 | u32 omux1; |
| 431 | u32 omux2; |
| 432 | u32 omux3; |
| 433 | u32 omux4; |
| 434 | }; |
| 435 | #endif |
| 436 | |
Stefano Babic | 9583dfa | 2010-08-20 10:42:31 +0200 | [diff] [blame] | 437 | /* System Reset Controller (SRC) */ |
| 438 | struct src { |
| 439 | u32 scr; |
| 440 | u32 sbmr; |
| 441 | u32 srsr; |
| 442 | u32 reserved1[2]; |
| 443 | u32 sisr; |
| 444 | u32 simr; |
| 445 | }; |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 446 | |
Troy Kisky | 124a06d | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 447 | struct srtc_regs { |
| 448 | u32 lpscmr; /* 0x00 */ |
| 449 | u32 lpsclr; /* 0x04 */ |
| 450 | u32 lpsar; /* 0x08 */ |
| 451 | u32 lpsmcr; /* 0x0c */ |
| 452 | u32 lpcr; /* 0x10 */ |
| 453 | u32 lpsr; /* 0x14 */ |
| 454 | u32 lppdr; /* 0x18 */ |
| 455 | u32 lpgr; /* 0x1c */ |
| 456 | u32 hpcmr; /* 0x20 */ |
| 457 | u32 hpclr; /* 0x24 */ |
| 458 | u32 hpamr; /* 0x28 */ |
| 459 | u32 hpalr; /* 0x2c */ |
| 460 | u32 hpcr; /* 0x30 */ |
| 461 | u32 hpisr; /* 0x34 */ |
| 462 | u32 hpienr; /* 0x38 */ |
| 463 | }; |
| 464 | |
Stefano Babic | ac87c17 | 2011-01-19 22:46:33 +0000 | [diff] [blame] | 465 | /* CSPI registers */ |
| 466 | struct cspi_regs { |
| 467 | u32 rxdata; |
| 468 | u32 txdata; |
| 469 | u32 ctrl; |
| 470 | u32 cfg; |
| 471 | u32 intr; |
| 472 | u32 dma; |
| 473 | u32 stat; |
| 474 | u32 period; |
| 475 | }; |
| 476 | |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 477 | struct iim_regs { |
| 478 | u32 stat; |
| 479 | u32 statm; |
| 480 | u32 err; |
| 481 | u32 emask; |
| 482 | u32 fctl; |
| 483 | u32 ua; |
| 484 | u32 la; |
| 485 | u32 sdat; |
| 486 | u32 prev; |
| 487 | u32 srev; |
Benoît Thébaudeau | 8f3ff11 | 2013-04-23 10:17:38 +0000 | [diff] [blame] | 488 | u32 prg_p; |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 489 | u32 scs0; |
| 490 | u32 scs1; |
| 491 | u32 scs2; |
| 492 | u32 scs3; |
| 493 | u32 res0[0x1f1]; |
| 494 | struct fuse_bank { |
| 495 | u32 fuse_regs[0x20]; |
| 496 | u32 fuse_rsvd[0xe0]; |
Benoît Thébaudeau | 8f3ff11 | 2013-04-23 10:17:38 +0000 | [diff] [blame] | 497 | #if defined(CONFIG_MX51) |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 498 | } bank[4]; |
Benoît Thébaudeau | 8f3ff11 | 2013-04-23 10:17:38 +0000 | [diff] [blame] | 499 | #elif defined(CONFIG_MX53) |
| 500 | } bank[5]; |
| 501 | #endif |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 502 | }; |
| 503 | |
Fabio Estevam | 54cd1de | 2012-05-08 03:40:49 +0000 | [diff] [blame] | 504 | struct fuse_bank0_regs { |
Benoît Thébaudeau | 6adbd30 | 2013-04-23 10:17:39 +0000 | [diff] [blame] | 505 | u32 fuse0_7[8]; |
| 506 | u32 uid[8]; |
| 507 | u32 fuse16_23[8]; |
| 508 | #if defined(CONFIG_MX51) |
| 509 | u32 imei[8]; |
| 510 | #elif defined(CONFIG_MX53) |
Fabio Estevam | 54cd1de | 2012-05-08 03:40:49 +0000 | [diff] [blame] | 511 | u32 gp[8]; |
Benoît Thébaudeau | 6adbd30 | 2013-04-23 10:17:39 +0000 | [diff] [blame] | 512 | #endif |
Fabio Estevam | 54cd1de | 2012-05-08 03:40:49 +0000 | [diff] [blame] | 513 | }; |
| 514 | |
Liu Hui-R64343 | 565e39c | 2010-11-18 23:45:55 +0000 | [diff] [blame] | 515 | struct fuse_bank1_regs { |
| 516 | u32 fuse0_8[9]; |
| 517 | u32 mac_addr[6]; |
| 518 | u32 fuse15_31[0x11]; |
| 519 | }; |
| 520 | |
Benoît Thébaudeau | 6adbd30 | 2013-04-23 10:17:39 +0000 | [diff] [blame] | 521 | #if defined(CONFIG_MX53) |
| 522 | struct fuse_bank4_regs { |
| 523 | u32 fuse0_4[5]; |
| 524 | u32 gp[3]; |
| 525 | u32 fuse8_31[0x18]; |
| 526 | }; |
| 527 | #endif |
| 528 | |
Stefano Babic | fb87a1e | 2010-01-20 18:19:51 +0100 | [diff] [blame] | 529 | #endif /* __ASSEMBLER__*/ |
| 530 | |
Liu Hui-R64343 | 595f3e5 | 2011-01-03 22:27:35 +0000 | [diff] [blame] | 531 | #endif /* __ASM_ARCH_MX5_IMX_REGS_H__ */ |