blob: a7d765af359d168a22f7c62cb38890c4a848b980 [file] [log] [blame]
Alison Wang24e8bee2013-05-27 22:55:42 +00001/*
Chao Fucb6d04d2014-05-06 09:13:03 +08002 * Copyright 2013-2014 Freescale Semiconductor, Inc.
Alison Wang24e8bee2013-05-27 22:55:42 +00003 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Alison Wang24e8bee2013-05-27 22:55:42 +00005 */
6
7#ifndef __ASM_ARCH_IMX_REGS_H__
8#define __ASM_ARCH_IMX_REGS_H__
9
10#define ARCH_MXC
11
12#define IRAM_BASE_ADDR 0x3F000000 /* internal ram */
13#define IRAM_SIZE 0x00080000 /* 512 KB */
14
15#define AIPS0_BASE_ADDR 0x40000000
16#define AIPS1_BASE_ADDR 0x40080000
17
18/* AIPS 0 */
19#define MSCM_BASE_ADDR (AIPS0_BASE_ADDR + 0x00001000)
20#define MSCM_IR_BASE_ADDR (AIPS0_BASE_ADDR + 0x00001800)
21#define CA5SCU_BASE_ADDR (AIPS0_BASE_ADDR + 0x00002000)
22#define CA5_INTD_BASE_ADDR (AIPS0_BASE_ADDR + 0x00003000)
23#define CA5_L2C_BASE_ADDR (AIPS0_BASE_ADDR + 0x00006000)
24#define NIC0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00008000)
25#define NIC1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00009000)
26#define NIC2_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000A000)
27#define NIC3_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000B000)
28#define NIC4_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000C000)
29#define NIC5_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000D000)
30#define NIC6_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000E000)
31#define NIC7_BASE_ADDR (AIPS0_BASE_ADDR + 0x0000F000)
32#define AHBTZASC_BASE_ADDR (AIPS0_BASE_ADDR + 0x00010000)
33#define TZASC_SYS0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00011000)
34#define TZASC_SYS1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00012000)
35#define TZASC_GFX_BASE_ADDR (AIPS0_BASE_ADDR + 0x00013000)
36#define TZASC_DDR0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00014000)
37#define TZASC_DDR1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00015000)
38#define CSU_BASE_ADDR (AIPS0_BASE_ADDR + 0x00017000)
39#define DMA0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00018000)
40#define DMA0_TCD_BASE_ADDR (AIPS0_BASE_ADDR + 0x00019000)
41#define SEMA4_BASE_ADDR (AIPS0_BASE_ADDR + 0x0001D000)
42#define FB_BASE_ADDR (AIPS0_BASE_ADDR + 0x0001E000)
43#define DMA_MUX0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00024000)
44#define UART0_BASE (AIPS0_BASE_ADDR + 0x00027000)
45#define UART1_BASE (AIPS0_BASE_ADDR + 0x00028000)
46#define UART2_BASE (AIPS0_BASE_ADDR + 0x00029000)
47#define UART3_BASE (AIPS0_BASE_ADDR + 0x0002A000)
48#define SPI0_BASE_ADDR (AIPS0_BASE_ADDR + 0x0002C000)
49#define SPI1_BASE_ADDR (AIPS0_BASE_ADDR + 0x0002D000)
50#define SAI0_BASE_ADDR (AIPS0_BASE_ADDR + 0x0002F000)
51#define SAI1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00030000)
52#define SAI2_BASE_ADDR (AIPS0_BASE_ADDR + 0x00031000)
53#define SAI3_BASE_ADDR (AIPS0_BASE_ADDR + 0x00032000)
54#define CRC_BASE_ADDR (AIPS0_BASE_ADDR + 0x00033000)
Sanchayan Maitya94bb7a2015-04-15 16:24:27 +053055#define USBC0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00034000)
Alison Wang24e8bee2013-05-27 22:55:42 +000056#define PDB_BASE_ADDR (AIPS0_BASE_ADDR + 0x00036000)
57#define PIT_BASE_ADDR (AIPS0_BASE_ADDR + 0x00037000)
58#define FTM0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00038000)
59#define FTM1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00039000)
60#define ADC_BASE_ADDR (AIPS0_BASE_ADDR + 0x0003B000)
61#define TCON0_BASE_ADDR (AIPS0_BASE_ADDR + 0x0003D000)
62#define WDOG1_BASE_ADDR (AIPS0_BASE_ADDR + 0x0003E000)
63#define LPTMR_BASE_ADDR (AIPS0_BASE_ADDR + 0x00040000)
64#define RLE_BASE_ADDR (AIPS0_BASE_ADDR + 0x00042000)
65#define MLB_BASE_ADDR (AIPS0_BASE_ADDR + 0x00043000)
66#define QSPI0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00044000)
67#define IOMUXC_BASE_ADDR (AIPS0_BASE_ADDR + 0x00048000)
68#define ANADIG_BASE_ADDR (AIPS0_BASE_ADDR + 0x00050000)
Sanchayan Maitya94bb7a2015-04-15 16:24:27 +053069#define USB_PHY0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00050800)
70#define USB_PHY1_BASE_ADDR (AIPS0_BASE_ADDR + 0x00050C00)
Stefan Agner8b4f9af2015-04-15 16:24:23 +053071#define SCSC_BASE_ADDR (AIPS0_BASE_ADDR + 0x00052000)
Alison Wang24e8bee2013-05-27 22:55:42 +000072#define ASRC_BASE_ADDR (AIPS0_BASE_ADDR + 0x00060000)
73#define SPDIF_BASE_ADDR (AIPS0_BASE_ADDR + 0x00061000)
74#define ESAI_BASE_ADDR (AIPS0_BASE_ADDR + 0x00062000)
75#define ESAI_FIFO_BASE_ADDR (AIPS0_BASE_ADDR + 0x00063000)
76#define WDOG_BASE_ADDR (AIPS0_BASE_ADDR + 0x00065000)
77#define I2C0_BASE_ADDR (AIPS0_BASE_ADDR + 0x00066000)
78#define WKUP_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006A000)
79#define CCM_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006B000)
80#define GPC_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006C000)
81#define VREG_DIG_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006D000)
82#define SRC_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006E000)
83#define CMU_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006F000)
84
85/* AIPS 1 */
86#define OCOTP_BASE_ADDR (AIPS1_BASE_ADDR + 0x00025000)
87#define DDR_BASE_ADDR (AIPS1_BASE_ADDR + 0x0002E000)
88#define ESDHC0_BASE_ADDR (AIPS1_BASE_ADDR + 0x00031000)
89#define ESDHC1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00032000)
Sanchayan Maitya94bb7a2015-04-15 16:24:27 +053090#define USBC1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00034000)
Alison Wang24e8bee2013-05-27 22:55:42 +000091#define ENET_BASE_ADDR (AIPS1_BASE_ADDR + 0x00050000)
Marcel Ziswiler6c81a932014-03-11 18:43:59 +010092#define ENET1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00051000)
Stefan Agnerb0e31c72014-08-06 10:59:36 +020093#define NFC_BASE_ADDR (AIPS1_BASE_ADDR + 0x00060000)
Alison Wang24e8bee2013-05-27 22:55:42 +000094
Chao Fucb6d04d2014-05-06 09:13:03 +080095#define QSPI0_AMBA_BASE 0x20000000
96
Alison Wang24e8bee2013-05-27 22:55:42 +000097/* MUX mode and PAD ctrl are in one register */
98#define CONFIG_IOMUX_SHARE_CONF_REG
99
100#define FEC_QUIRK_ENET_MAC
Alison Wang1221b3d2013-06-17 15:30:38 +0800101#define I2C_QUIRK_REG
Alison Wang24e8bee2013-05-27 22:55:42 +0000102
103/* MSCM interrupt rounter */
104#define MSCM_IRSPRC_CP0_EN 1
105#define MSCM_IRSPRC_NUM 112
106
107/* DDRMC */
108#define DDRMC_PHY_DQ_TIMING 0x00002613
109#define DDRMC_PHY_DQS_TIMING 0x00002615
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200110#define DDRMC_PHY_CTRL 0x00210000
Alison Wang24e8bee2013-05-27 22:55:42 +0000111#define DDRMC_PHY_MASTER_CTRL 0x0001012a
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200112#define DDRMC_PHY_SLAVE_CTRL 0x00002000
113#define DDRMC_PHY_OFF 0x00000000
114#define DDRMC_PHY_PROC_PAD_ODT 0x00010101
Alison Wang24e8bee2013-05-27 22:55:42 +0000115
116#define DDRMC_PHY50_DDR3_MODE (1 << 12)
117#define DDRMC_PHY50_EN_SW_HALF_CYCLE (1 << 8)
118
119#define DDRMC_CR00_DRAM_CLASS_DDR3 (0x6 << 8)
120#define DDRMC_CR00_DRAM_CLASS_LPDDR2 (0x5 << 8)
121#define DDRMC_CR00_START 1
122#define DDRMC_CR02_DRAM_TINIT(v) ((v) & 0xffffff)
123#define DDRMC_CR10_TRST_PWRON(v) (v)
124#define DDRMC_CR11_CKE_INACTIVE(v) (v)
125#define DDRMC_CR12_WRLAT(v) (((v) & 0x1f) << 8)
126#define DDRMC_CR12_CASLAT_LIN(v) ((v) & 0x3f)
127#define DDRMC_CR13_TRC(v) (((v) & 0xff) << 24)
128#define DDRMC_CR13_TRRD(v) (((v) & 0xff) << 16)
129#define DDRMC_CR13_TCCD(v) (((v) & 0x1f) << 8)
130#define DDRMC_CR13_TBST_INT_INTERVAL(v) ((v) & 0x7)
131#define DDRMC_CR14_TFAW(v) (((v) & 0x3f) << 24)
132#define DDRMC_CR14_TRP(v) (((v) & 0x1f) << 16)
133#define DDRMC_CR14_TWTR(v) (((v) & 0xf) << 8)
134#define DDRMC_CR14_TRAS_MIN(v) ((v) & 0xff)
135#define DDRMC_CR16_TMRD(v) (((v) & 0x1f) << 24)
136#define DDRMC_CR16_TRTP(v) (((v) & 0xf) << 16)
137#define DDRMC_CR17_TRAS_MAX(v) (((v) & 0x1ffff) << 8)
138#define DDRMC_CR17_TMOD(v) ((v) & 0xff)
139#define DDRMC_CR18_TCKESR(v) (((v) & 0x1f) << 8)
140#define DDRMC_CR18_TCKE(v) ((v) & 0x7)
141#define DDRMC_CR20_AP_EN (1 << 24)
142#define DDRMC_CR21_TRCD_INT(v) (((v) & 0xff) << 16)
143#define DDRMC_CR21_TRAS_LOCKOUT (1 << 8)
144#define DDRMC_CR21_CCMAP_EN 1
145#define DDRMC_CR22_TDAL(v) (((v) & 0x3f) << 16)
146#define DDRMC_CR23_BSTLEN(v) (((v) & 0x7) << 24)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200147#define DDRMC_CR23_TDLL(v) ((v) & 0xffff)
Alison Wang24e8bee2013-05-27 22:55:42 +0000148#define DDRMC_CR24_TRP_AB(v) ((v) & 0x1f)
149#define DDRMC_CR25_TREF_EN (1 << 16)
150#define DDRMC_CR26_TREF(v) (((v) & 0xffff) << 16)
151#define DDRMC_CR26_TRFC(v) ((v) & 0x3ff)
152#define DDRMC_CR28_TREF_INT(v) ((v) & 0xffff)
153#define DDRMC_CR29_TPDEX(v) ((v) & 0xffff)
154#define DDRMC_CR30_TXPDLL(v) ((v) & 0xffff)
155#define DDRMC_CR31_TXSNR(v) (((v) & 0xffff) << 16)
156#define DDRMC_CR31_TXSR(v) ((v) & 0xffff)
157#define DDRMC_CR33_EN_QK_SREF (1 << 16)
158#define DDRMC_CR34_CKSRX(v) (((v) & 0xf) << 16)
159#define DDRMC_CR34_CKSRE(v) (((v) & 0xf) << 8)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200160#define DDRMC_CR38_FREQ_CHG_EN(v) (((v) & 0x1) << 8)
Alison Wang24e8bee2013-05-27 22:55:42 +0000161#define DDRMC_CR39_PHY_INI_COM(v) (((v) & 0xffff) << 16)
162#define DDRMC_CR39_PHY_INI_STA(v) (((v) & 0xff) << 8)
163#define DDRMC_CR39_FRQ_CH_DLLOFF(v) ((v) & 0x3)
164#define DDRMC_CR41_PHY_INI_STRT_INI_DIS 1
165#define DDRMC_CR48_MR1_DA_0(v) (((v) & 0xffff) << 16)
166#define DDRMC_CR48_MR0_DA_0(v) ((v) & 0xffff)
167#define DDRMC_CR66_ZQCL(v) (((v) & 0xfff) << 16)
168#define DDRMC_CR66_ZQINIT(v) ((v) & 0xfff)
169#define DDRMC_CR67_ZQCS(v) ((v) & 0xfff)
170#define DDRMC_CR69_ZQ_ON_SREF_EX(v) (((v) & 0xf) << 8)
171#define DDRMC_CR70_REF_PER_ZQ(v) (v)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200172#define DDRMC_CR72_ZQCS_ROTATE(v) (((v) & 0x1) << 24)
Alison Wang24e8bee2013-05-27 22:55:42 +0000173#define DDRMC_CR73_APREBIT(v) (((v) & 0xf) << 24)
174#define DDRMC_CR73_COL_DIFF(v) (((v) & 0x7) << 16)
175#define DDRMC_CR73_ROW_DIFF(v) (((v) & 0x3) << 8)
176#define DDRMC_CR74_BANKSPLT_EN (1 << 24)
177#define DDRMC_CR74_ADDR_CMP_EN (1 << 16)
178#define DDRMC_CR74_CMD_AGE_CNT(v) (((v) & 0xff) << 8)
179#define DDRMC_CR74_AGE_CNT(v) ((v) & 0xff)
180#define DDRMC_CR75_RW_PG_EN (1 << 24)
181#define DDRMC_CR75_RW_EN (1 << 16)
182#define DDRMC_CR75_PRI_EN (1 << 8)
183#define DDRMC_CR75_PLEN 1
184#define DDRMC_CR76_NQENT_ACTDIS(v) (((v) & 0x7) << 24)
185#define DDRMC_CR76_D_RW_G_BKCN(v) (((v) & 0x3) << 16)
186#define DDRMC_CR76_W2R_SPLT_EN (1 << 8)
187#define DDRMC_CR76_CS_EN 1
188#define DDRMC_CR77_CS_MAP (1 << 24)
189#define DDRMC_CR77_DI_RD_INTLEAVE (1 << 8)
190#define DDRMC_CR77_SWAP_EN 1
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200191#define DDRMC_CR78_Q_FULLNESS(v) (((v) & 0x7) << 24)
Alison Wang24e8bee2013-05-27 22:55:42 +0000192#define DDRMC_CR78_BUR_ON_FLY_BIT(v) ((v) & 0xf)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200193#define DDRMC_CR79_CTLUPD_AREF(v) (((v) & 0x1) << 24)
194#define DDRMC_CR82_INT_MASK 0x10000000
Alison Wang24e8bee2013-05-27 22:55:42 +0000195#define DDRMC_CR87_ODT_WR_MAPCS0 (1 << 24)
196#define DDRMC_CR87_ODT_RD_MAPCS0 (1 << 16)
197#define DDRMC_CR88_TODTL_CMD(v) (((v) & 0x1f) << 16)
198#define DDRMC_CR89_AODT_RWSMCS(v) ((v) & 0xf)
199#define DDRMC_CR91_R2W_SMCSDL(v) (((v) & 0x7) << 16)
200#define DDRMC_CR96_WLMRD(v) (((v) & 0x3f) << 8)
201#define DDRMC_CR96_WLDQSEN(v) ((v) & 0x3f)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200202#define DDRMC_CR97_WRLVL_EN (1 << 24)
Sanchayan Maityc7ea2432015-04-15 16:24:22 +0530203#define DDRMC_CR98_WRLVL_DL_0(v) ((v) & 0xffff)
204#define DDRMC_CR99_WRLVL_DL_1(v) ((v) & 0xffff)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200205#define DDRMC_CR102_RDLVL_GT_REGEN (1 << 16)
206#define DDRMC_CR102_RDLVL_REG_EN (1 << 8)
Alison Wang24e8bee2013-05-27 22:55:42 +0000207#define DDRMC_CR105_RDLVL_DL_0(v) (((v) & 0xff) << 8)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200208#define DDRMC_CR106_RDLVL_GTDL_0(v) ((v) & 0xff)
Alison Wang24e8bee2013-05-27 22:55:42 +0000209#define DDRMC_CR110_RDLVL_DL_1(v) ((v) & 0xff)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200210#define DDRMC_CR110_RDLVL_GTDL_1(v) (((v) & 0xff) << 16)
Alison Wang24e8bee2013-05-27 22:55:42 +0000211#define DDRMC_CR114_RDLVL_GTDL_2(v) (((v) & 0xffff) << 8)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200212#define DDRMC_CR115_RDLVL_GTDL_2(v) ((v) & 0xff)
Alison Wang24e8bee2013-05-27 22:55:42 +0000213#define DDRMC_CR117_AXI0_W_PRI(v) (((v) & 0x3) << 8)
214#define DDRMC_CR117_AXI0_R_PRI(v) ((v) & 0x3)
215#define DDRMC_CR118_AXI1_W_PRI(v) (((v) & 0x3) << 24)
216#define DDRMC_CR118_AXI1_R_PRI(v) (((v) & 0x3) << 16)
217#define DDRMC_CR120_AXI0_PRI1_RPRI(v) (((v) & 0xf) << 24)
218#define DDRMC_CR120_AXI0_PRI0_RPRI(v) (((v) & 0xf) << 16)
219#define DDRMC_CR121_AXI0_PRI3_RPRI(v) (((v) & 0xf) << 8)
220#define DDRMC_CR121_AXI0_PRI2_RPRI(v) ((v) & 0xf)
221#define DDRMC_CR122_AXI1_PRI1_RPRI(v) (((v) & 0xf) << 24)
222#define DDRMC_CR122_AXI1_PRI0_RPRI(v) (((v) & 0xf) << 16)
223#define DDRMC_CR122_AXI0_PRIRLX(v) ((v) & 0x3ff)
224#define DDRMC_CR123_AXI1_PRI3_RPRI(v) (((v) & 0xf) << 8)
225#define DDRMC_CR123_AXI1_PRI2_RPRI(v) ((v) & 0xf)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200226#define DDRMC_CR123_AXI1_P_ODR_EN (1 << 16)
Alison Wang24e8bee2013-05-27 22:55:42 +0000227#define DDRMC_CR124_AXI1_PRIRLX(v) ((v) & 0x3ff)
228#define DDRMC_CR126_PHY_RDLAT(v) (((v) & 0x3f) << 8)
229#define DDRMC_CR132_WRLAT_ADJ(v) (((v) & 0x1f) << 8)
230#define DDRMC_CR132_RDLAT_ADJ(v) ((v) & 0x3f)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200231#define DDRMC_CR137_PHYCTL_DL(v) (((v) & 0xf) << 16)
232#define DDRMC_CR138_PHY_WRLV_MXDL(v) (((v) & 0xffff) << 16)
233#define DDRMC_CR138_PHYDRAM_CK_EN(v) (((v) & 0x8) << 8)
Alison Wang24e8bee2013-05-27 22:55:42 +0000234#define DDRMC_CR139_PHY_WRLV_RESPLAT(v) (((v) & 0xff) << 24)
235#define DDRMC_CR139_PHY_WRLV_LOAD(v) (((v) & 0xff) << 16)
236#define DDRMC_CR139_PHY_WRLV_DLL(v) (((v) & 0xff) << 8)
237#define DDRMC_CR139_PHY_WRLV_EN(v) ((v) & 0xff)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200238#define DDRMC_CR140_PHY_WRLV_WW(v) ((v) & 0x3ff)
239#define DDRMC_CR143_RDLV_GAT_MXDL(v) (((v) & 0xffff) << 16)
240#define DDRMC_CR143_RDLV_MXDL(v) ((v) & 0xffff)
241#define DDRMC_CR144_PHY_RDLVL_RES(v) (((v) & 0xff) << 24)
242#define DDRMC_CR144_PHY_RDLV_LOAD(v) (((v) & 0xff) << 16)
243#define DDRMC_CR144_PHY_RDLV_DLL(v) (((v) & 0xff) << 8)
244#define DDRMC_CR144_PHY_RDLV_EN(v) ((v) & 0xff)
245#define DDRMC_CR145_PHY_RDLV_RR(v) ((v) & 0x3ff)
246#define DDRMC_CR146_PHY_RDLVL_RESP(v) (v)
247#define DDRMC_CR147_RDLV_RESP_MASK(v) ((v) & 0xfffff)
248#define DDRMC_CR148_RDLV_GATE_RESP_MASK(v) ((v) & 0xfffff)
249#define DDRMC_CR151_RDLV_GAT_DQ_ZERO_CNT(v) (((v) & 0xf) << 8)
250#define DDRMC_CR151_RDLVL_DQ_ZERO_CNT(v) ((v) & 0xf)
Alison Wang24e8bee2013-05-27 22:55:42 +0000251#define DDRMC_CR154_PAD_ZQ_EARLY_CMP_EN_TIMER(v) (((v) & 0x1f) << 27)
252#define DDRMC_CR154_PAD_ZQ_MODE(v) (((v) & 0x3) << 21)
Stefan Agner56d83d12014-04-23 18:17:51 +0200253#define DDRMC_CR154_DDR_SEL_PAD_CONTR(v) (((v) & 0x3) << 18)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200254#define DDRMC_CR154_PAD_ZQ_HW_FOR(v) (((v) & 0x1) << 14)
Alison Wang24e8bee2013-05-27 22:55:42 +0000255#define DDRMC_CR155_AXI0_AWCACHE (1 << 10)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200256#define DDRMC_CR155_PAD_ODT_BYTE1(v) (((v) & 0x7) << 3)
257#define DDRMC_CR155_PAD_ODT_BYTE0(v) ((v) & 0x7)
Alison Wang24e8bee2013-05-27 22:55:42 +0000258#define DDRMC_CR158_TWR(v) ((v) & 0x3f)
Anthony Felicec19a8bc2014-09-06 19:47:06 +0200259#define DDRMC_CR161_ODT_EN(v) (((v) & 0x1) << 16)
260#define DDRMC_CR161_TODTH_RD(v) (((v) & 0xf) << 8)
261#define DDRMC_CR161_TODTH_WR(v) ((v) & 0xf)
Alison Wang24e8bee2013-05-27 22:55:42 +0000262
Stefan Agner9e89a642014-11-27 23:58:20 +0100263/* System Reset Controller (SRC) */
264#define SRC_SRSR_SW_RST (0x1 << 18)
265#define SRC_SRSR_RESETB (0x1 << 7)
266#define SRC_SRSR_JTAG_RST (0x1 << 5)
267#define SRC_SRSR_WDOG_M4 (0x1 << 4)
268#define SRC_SRSR_WDOG_A5 (0x1 << 3)
269#define SRC_SRSR_POR_RST (0x1 << 0)
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530270#define SRC_SBMR2_BMOD_MASK (0x3 << 24)
271#define SRC_SBMR2_BMOD_SHIFT 24
272#define SRC_SBMR2_BMOD_FUSES 0x0
273#define SRC_SBMR2_BMOD_SERIAL 0x1
274#define SRC_SBMR2_BMOD_RCON 0x2
Stefan Agner9e89a642014-11-27 23:58:20 +0100275
Stefan Agner8b4f9af2015-04-15 16:24:23 +0530276/* Slow Clock Source Controller Module (SCSC) */
277#define SCSC_SOSC_CTR_SOSC_EN 0x1
278
Alison Wang24e8bee2013-05-27 22:55:42 +0000279#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
280#include <asm/types.h>
281
282/* System Reset Controller (SRC) */
283struct src {
284 u32 scr;
285 u32 sbmr1;
286 u32 srsr;
287 u32 secr;
288 u32 gpsr;
289 u32 sicr;
290 u32 simr;
291 u32 sbmr2;
292 u32 gpr0;
293 u32 gpr1;
294 u32 gpr2;
295 u32 gpr3;
296 u32 gpr4;
297 u32 hab0;
298 u32 hab1;
299 u32 hab2;
300 u32 hab3;
301 u32 hab4;
302 u32 hab5;
303 u32 misc0;
304 u32 misc1;
305 u32 misc2;
306 u32 misc3;
307};
308
309/* Periodic Interrupt Timer (PIT) */
310struct pit_reg {
311 u32 mcr;
312 u32 recv0[55];
313 u32 ltmr64h;
314 u32 ltmr64l;
315 u32 recv1[6];
316 u32 ldval0;
317 u32 cval0;
318 u32 tctrl0;
319 u32 tflg0;
320 u32 ldval1;
321 u32 cval1;
322 u32 tctrl1;
323 u32 tflg1;
324 u32 ldval2;
325 u32 cval2;
326 u32 tctrl2;
327 u32 tflg2;
328 u32 ldval3;
329 u32 cval3;
330 u32 tctrl3;
331 u32 tflg3;
332 u32 ldval4;
333 u32 cval4;
334 u32 tctrl4;
335 u32 tflg4;
336 u32 ldval5;
337 u32 cval5;
338 u32 tctrl5;
339 u32 tflg5;
340 u32 ldval6;
341 u32 cval6;
342 u32 tctrl6;
343 u32 tflg6;
344 u32 ldval7;
345 u32 cval7;
346 u32 tctrl7;
347 u32 tflg7;
348};
349
350/* Watchdog Timer (WDOG) */
351struct wdog_regs {
352 u16 wcr;
353 u16 wsr;
354 u16 wrsr;
355 u16 wicr;
356 u16 wmcr;
357};
358
359/* LPDDR2/DDR3 SDRAM Memory Controller (DDRMC) */
360struct ddrmr_regs {
361 u32 cr[162];
362 u32 rsvd[94];
363 u32 phy[53];
364};
365
366/* On-Chip One Time Programmable Controller (OCOTP) */
367struct ocotp_regs {
368 u32 ctrl;
369 u32 ctrl_set;
370 u32 ctrl_clr;
371 u32 ctrl_tog;
372 u32 timing;
373 u32 rsvd0[3];
374 u32 data;
375 u32 rsvd1[3];
376 u32 read_ctrl;
377 u32 rsvd2[3];
378 u32 read_fuse_data;
379 u32 rsvd3[7];
380 u32 scs;
381 u32 scs_set;
382 u32 scs_clr;
383 u32 scs_tog;
384 u32 crc_addr;
385 u32 rsvd4[3];
386 u32 crc_value;
387 u32 rsvd5[3];
388 u32 version;
389 u32 rsvd6[0xdb];
390
391 struct fuse_bank {
392 u32 fuse_regs[0x20];
393 } bank[16];
394};
395
396struct fuse_bank0_regs {
397 u32 lock;
398 u32 rsvd0[3];
399 u32 uid_low;
400 u32 rsvd1[3];
401 u32 uid_high;
402 u32 rsvd2[0x17];
403};
404
405struct fuse_bank4_regs {
406 u32 sjc_resp0;
407 u32 rsvd0[3];
408 u32 sjc_resp1;
409 u32 rsvd1[3];
410 u32 mac_addr0;
411 u32 rsvd2[3];
412 u32 mac_addr1;
413 u32 rsvd3[3];
414 u32 mac_addr2;
415 u32 rsvd4[3];
416 u32 mac_addr3;
417 u32 rsvd5[3];
418 u32 gp1;
419 u32 rsvd6[3];
420 u32 gp2;
421 u32 rsvd7[3];
422};
423
424/* UART */
425struct lpuart_fsl {
426 u8 ubdh;
427 u8 ubdl;
428 u8 uc1;
429 u8 uc2;
430 u8 us1;
431 u8 us2;
432 u8 uc3;
433 u8 ud;
434 u8 uma1;
435 u8 uma2;
436 u8 uc4;
437 u8 uc5;
438 u8 ued;
439 u8 umodem;
440 u8 uir;
441 u8 reserved;
442 u8 upfifo;
443 u8 ucfifo;
444 u8 usfifo;
445 u8 utwfifo;
446 u8 utcfifo;
447 u8 urwfifo;
448 u8 urcfifo;
449 u8 rsvd[28];
450};
451
452/* MSCM Interrupt Router */
453struct mscm_ir {
454 u32 ircp0ir;
455 u32 ircp1ir;
456 u32 rsvd1[6];
457 u32 ircpgir;
458 u32 rsvd2[23];
459 u16 irsprc[112];
460 u16 rsvd3[848];
461};
462
Stefan Agner8b4f9af2015-04-15 16:24:23 +0530463/* SCSC */
464struct scsc_reg {
465 u32 sirc_ctr;
466 u32 sosc_ctr;
467};
468
Sanchayan Maity1db503c2015-04-15 16:24:24 +0530469/* MSCM */
470struct mscm {
471 u32 cpxtype;
472 u32 cpxnum;
473 u32 cpxmaster;
474 u32 cpxcount;
475 u32 cpxcfg0;
476 u32 cpxcfg1;
477 u32 cpxcfg2;
478 u32 cpxcfg3;
479};
480
Alison Wang24e8bee2013-05-27 22:55:42 +0000481#endif /* __ASSEMBLER__*/
482
483#endif /* __ASM_ARCH_IMX_REGS_H__ */