blob: 4cff8eeda2c1b1ba865be51ca1d80b744d0eb115 [file] [log] [blame]
Jason Liudec11122011-11-25 00:18:02 +00001/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Jason Liudec11122011-11-25 00:18:02 +00005 */
6
7#ifndef __ASM_ARCH_MX6_IMX_REGS_H__
8#define __ASM_ARCH_MX6_IMX_REGS_H__
9
Benoît Thébaudeau1da8a7b2012-08-13 07:27:58 +000010#define ARCH_MXC
11
Peng Fan52d37392015-07-20 19:28:24 +080012#ifdef CONFIG_MX6UL
13#define CONFIG_SYS_CACHELINE_SIZE 64
14#else
Eric Nelson51a12d82012-03-04 11:47:37 +000015#define CONFIG_SYS_CACHELINE_SIZE 32
Peng Fan52d37392015-07-20 19:28:24 +080016#endif
Eric Nelson51a12d82012-03-04 11:47:37 +000017
Jason Liudec11122011-11-25 00:18:02 +000018#define ROMCP_ARB_BASE_ADDR 0x00000000
19#define ROMCP_ARB_END_ADDR 0x000FFFFF
Fabio Estevamf7b9ac22013-04-10 09:32:57 +000020
21#ifdef CONFIG_MX6SL
22#define GPU_2D_ARB_BASE_ADDR 0x02200000
23#define GPU_2D_ARB_END_ADDR 0x02203FFF
24#define OPENVG_ARB_BASE_ADDR 0x02204000
25#define OPENVG_ARB_END_ADDR 0x02207FFF
Peng Fan59e680d2015-07-20 19:28:23 +080026#elif (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Fabio Estevam712ab882014-06-24 17:40:58 -030027#define CAAM_ARB_BASE_ADDR 0x00100000
28#define CAAM_ARB_END_ADDR 0x00107FFF
29#define GPU_ARB_BASE_ADDR 0x01800000
30#define GPU_ARB_END_ADDR 0x01803FFF
31#define APBH_DMA_ARB_BASE_ADDR 0x01804000
32#define APBH_DMA_ARB_END_ADDR 0x0180BFFF
33#define M4_BOOTROM_BASE_ADDR 0x007F8000
34
Fabio Estevamf7b9ac22013-04-10 09:32:57 +000035#else
Jason Liudec11122011-11-25 00:18:02 +000036#define CAAM_ARB_BASE_ADDR 0x00100000
37#define CAAM_ARB_END_ADDR 0x00103FFF
38#define APBH_DMA_ARB_BASE_ADDR 0x00110000
39#define APBH_DMA_ARB_END_ADDR 0x00117FFF
40#define HDMI_ARB_BASE_ADDR 0x00120000
41#define HDMI_ARB_END_ADDR 0x00128FFF
42#define GPU_3D_ARB_BASE_ADDR 0x00130000
43#define GPU_3D_ARB_END_ADDR 0x00133FFF
44#define GPU_2D_ARB_BASE_ADDR 0x00134000
45#define GPU_2D_ARB_END_ADDR 0x00137FFF
46#define DTCP_ARB_BASE_ADDR 0x00138000
47#define DTCP_ARB_END_ADDR 0x0013BFFF
Fabio Estevamf7b9ac22013-04-10 09:32:57 +000048#endif /* CONFIG_MX6SL */
Stefan Roese412e0462013-04-09 21:06:09 +000049
50#define MXS_APBH_BASE APBH_DMA_ARB_BASE_ADDR
51#define MXS_GPMI_BASE (APBH_DMA_ARB_BASE_ADDR + 0x02000)
52#define MXS_BCH_BASE (APBH_DMA_ARB_BASE_ADDR + 0x04000)
53
Jason Liudec11122011-11-25 00:18:02 +000054/* GPV - PL301 configuration ports */
Peng Fan59e680d2015-07-20 19:28:23 +080055#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Fabio Estevamf7b9ac22013-04-10 09:32:57 +000056#define GPV2_BASE_ADDR 0x00D00000
57#else
Jason Liudec11122011-11-25 00:18:02 +000058#define GPV2_BASE_ADDR 0x00200000
Fabio Estevamf7b9ac22013-04-10 09:32:57 +000059#endif
60
Peng Fan59e680d2015-07-20 19:28:23 +080061#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Fabio Estevam712ab882014-06-24 17:40:58 -030062#define GPV3_BASE_ADDR 0x00E00000
63#define GPV4_BASE_ADDR 0x00F00000
64#define GPV5_BASE_ADDR 0x01000000
65#define GPV6_BASE_ADDR 0x01100000
66#define PCIE_ARB_BASE_ADDR 0x08000000
67#define PCIE_ARB_END_ADDR 0x08FFFFFF
68
69#else
Jason Liudec11122011-11-25 00:18:02 +000070#define GPV3_BASE_ADDR 0x00300000
71#define GPV4_BASE_ADDR 0x00800000
Fabio Estevam712ab882014-06-24 17:40:58 -030072#define PCIE_ARB_BASE_ADDR 0x01000000
73#define PCIE_ARB_END_ADDR 0x01FFFFFF
74#endif
75
Jason Liudec11122011-11-25 00:18:02 +000076#define IRAM_BASE_ADDR 0x00900000
77#define SCU_BASE_ADDR 0x00A00000
78#define IC_INTERFACES_BASE_ADDR 0x00A00100
79#define GLOBAL_TIMER_BASE_ADDR 0x00A00200
80#define PRIVATE_TIMERS_WD_BASE_ADDR 0x00A00600
81#define IC_DISTRIBUTOR_BASE_ADDR 0x00A01000
Fabio Estevam13409292014-01-29 17:39:49 -020082#define L2_PL310_BASE 0x00A02000
Jason Liudec11122011-11-25 00:18:02 +000083#define GPV0_BASE_ADDR 0x00B00000
84#define GPV1_BASE_ADDR 0x00C00000
Jason Liudec11122011-11-25 00:18:02 +000085
86#define AIPS1_ARB_BASE_ADDR 0x02000000
87#define AIPS1_ARB_END_ADDR 0x020FFFFF
88#define AIPS2_ARB_BASE_ADDR 0x02100000
89#define AIPS2_ARB_END_ADDR 0x021FFFFF
Peng Fan59e680d2015-07-20 19:28:23 +080090/* AIPS3 only on i.MX6SX */
Ye.Li00cce362015-01-14 17:18:12 +080091#define AIPS3_ARB_BASE_ADDR 0x02200000
92#define AIPS3_ARB_END_ADDR 0x022FFFFF
Peng Fan59e680d2015-07-20 19:28:23 +080093#ifdef CONFIG_MX6SX
Fabio Estevam712ab882014-06-24 17:40:58 -030094#define WEIM_ARB_BASE_ADDR 0x50000000
95#define WEIM_ARB_END_ADDR 0x57FFFFFF
Peng Fan828e4682014-12-31 11:01:38 +080096#define QSPI0_AMBA_BASE 0x60000000
97#define QSPI0_AMBA_END 0x6FFFFFFF
98#define QSPI1_AMBA_BASE 0x70000000
99#define QSPI1_AMBA_END 0x7FFFFFFF
Peng Fan59e680d2015-07-20 19:28:23 +0800100#elif defined(CONFIG_MX6UL)
101#define WEIM_ARB_BASE_ADDR 0x50000000
102#define WEIM_ARB_END_ADDR 0x57FFFFFF
103#define QSPI0_AMBA_BASE 0x60000000
104#define QSPI0_AMBA_END 0x6FFFFFFF
Fabio Estevam712ab882014-06-24 17:40:58 -0300105#else
Jason Liudec11122011-11-25 00:18:02 +0000106#define SATA_ARB_BASE_ADDR 0x02200000
107#define SATA_ARB_END_ADDR 0x02203FFF
108#define OPENVG_ARB_BASE_ADDR 0x02204000
109#define OPENVG_ARB_END_ADDR 0x02207FFF
110#define HSI_ARB_BASE_ADDR 0x02208000
111#define HSI_ARB_END_ADDR 0x0220BFFF
112#define IPU1_ARB_BASE_ADDR 0x02400000
113#define IPU1_ARB_END_ADDR 0x027FFFFF
114#define IPU2_ARB_BASE_ADDR 0x02800000
115#define IPU2_ARB_END_ADDR 0x02BFFFFF
116#define WEIM_ARB_BASE_ADDR 0x08000000
117#define WEIM_ARB_END_ADDR 0x0FFFFFFF
Fabio Estevam712ab882014-06-24 17:40:58 -0300118#endif
Jason Liudec11122011-11-25 00:18:02 +0000119
Peng Fan59e680d2015-07-20 19:28:23 +0800120#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000121#define MMDC0_ARB_BASE_ADDR 0x80000000
122#define MMDC0_ARB_END_ADDR 0xFFFFFFFF
123#define MMDC1_ARB_BASE_ADDR 0xC0000000
124#define MMDC1_ARB_END_ADDR 0xFFFFFFFF
125#else
Jason Liudec11122011-11-25 00:18:02 +0000126#define MMDC0_ARB_BASE_ADDR 0x10000000
127#define MMDC0_ARB_END_ADDR 0x7FFFFFFF
128#define MMDC1_ARB_BASE_ADDR 0x80000000
129#define MMDC1_ARB_END_ADDR 0xFFFFFFFF
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000130#endif
Jason Liudec11122011-11-25 00:18:02 +0000131
Fabio Estevam712ab882014-06-24 17:40:58 -0300132#ifndef CONFIG_MX6SX
Fabio Estevama0005af2012-05-31 07:23:55 +0000133#define IPU_SOC_BASE_ADDR IPU1_ARB_BASE_ADDR
134#define IPU_SOC_OFFSET 0x00200000
Fabio Estevam712ab882014-06-24 17:40:58 -0300135#endif
Fabio Estevama0005af2012-05-31 07:23:55 +0000136
Jason Liudec11122011-11-25 00:18:02 +0000137/* Defines for Blocks connected via AIPS (SkyBlue) */
138#define ATZ1_BASE_ADDR AIPS1_ARB_BASE_ADDR
139#define ATZ2_BASE_ADDR AIPS2_ARB_BASE_ADDR
Adrian Alonsoee7c4ca2015-09-02 13:54:15 -0500140#define ATZ3_BASE_ADDR AIPS3_ARB_BASE_ADDR
Jason Liudec11122011-11-25 00:18:02 +0000141#define AIPS1_BASE_ADDR AIPS1_ON_BASE_ADDR
142#define AIPS2_BASE_ADDR AIPS2_ON_BASE_ADDR
Adrian Alonsoee7c4ca2015-09-02 13:54:15 -0500143#define AIPS3_BASE_ADDR AIPS3_ON_BASE_ADDR
Jason Liudec11122011-11-25 00:18:02 +0000144
145#define SPDIF_BASE_ADDR (ATZ1_BASE_ADDR + 0x04000)
146#define ECSPI1_BASE_ADDR (ATZ1_BASE_ADDR + 0x08000)
147#define ECSPI2_BASE_ADDR (ATZ1_BASE_ADDR + 0x0C000)
148#define ECSPI3_BASE_ADDR (ATZ1_BASE_ADDR + 0x10000)
149#define ECSPI4_BASE_ADDR (ATZ1_BASE_ADDR + 0x14000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000150#ifdef CONFIG_MX6SL
151#define UART5_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x18000)
152#define UART1_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x20000)
153#define UART2_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x24000)
154#define SSI1_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x28000)
155#define SSI2_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x2C000)
156#define SSI3_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x30000)
157#define UART3_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x34000)
158#define UART4_IPS_BASE_ADDR (ATZ1_BASE_ADDR + 0x38000)
159#else
Fabio Estevam712ab882014-06-24 17:40:58 -0300160#ifndef CONFIG_MX6SX
Jason Liudec11122011-11-25 00:18:02 +0000161#define ECSPI5_BASE_ADDR (ATZ1_BASE_ADDR + 0x18000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300162#endif
Jason Liudec11122011-11-25 00:18:02 +0000163#define UART1_BASE (ATZ1_BASE_ADDR + 0x20000)
164#define ESAI1_BASE_ADDR (ATZ1_BASE_ADDR + 0x24000)
165#define SSI1_BASE_ADDR (ATZ1_BASE_ADDR + 0x28000)
166#define SSI2_BASE_ADDR (ATZ1_BASE_ADDR + 0x2C000)
167#define SSI3_BASE_ADDR (ATZ1_BASE_ADDR + 0x30000)
168#define ASRC_BASE_ADDR (ATZ1_BASE_ADDR + 0x34000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000169#endif
170
Fabio Estevam712ab882014-06-24 17:40:58 -0300171#ifndef CONFIG_MX6SX
Jason Liudec11122011-11-25 00:18:02 +0000172#define SPBA_BASE_ADDR (ATZ1_BASE_ADDR + 0x3C000)
173#define VPU_BASE_ADDR (ATZ1_BASE_ADDR + 0x40000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300174#endif
Jason Liudec11122011-11-25 00:18:02 +0000175#define AIPS1_ON_BASE_ADDR (ATZ1_BASE_ADDR + 0x7C000)
176
177#define AIPS1_OFF_BASE_ADDR (ATZ1_BASE_ADDR + 0x80000)
178#define PWM1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x0000)
179#define PWM2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x4000)
180#define PWM3_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x8000)
181#define PWM4_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0xC000)
182#define CAN1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x10000)
183#define CAN2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x14000)
184#define GPT1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x18000)
185#define GPIO1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x1C000)
186#define GPIO2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x20000)
187#define GPIO3_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x24000)
188#define GPIO4_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x28000)
189#define GPIO5_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x2C000)
190#define GPIO6_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x30000)
191#define GPIO7_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x34000)
192#define KPP_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x38000)
193#define WDOG1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x3C000)
194#define WDOG2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x40000)
Wolfgang Grandegger1859b702012-02-08 22:33:25 +0000195#define ANATOP_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x48000)
196#define USB_PHY0_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x49000)
197#define USB_PHY1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x4a000)
Jason Liudec11122011-11-25 00:18:02 +0000198#define CCM_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x44000)
Jason Liudec11122011-11-25 00:18:02 +0000199#define SNVS_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x4C000)
200#define EPIT1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x50000)
201#define EPIT2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x54000)
202#define SRC_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x58000)
203#define GPC_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x5C000)
204#define IOMUXC_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x60000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000205#ifdef CONFIG_MX6SL
206#define CSI_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x64000)
207#define SIPIX_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x68000)
208#define SDMA_PORT_HOST_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x6C000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300209#elif CONFIG_MX6SX
210#define CANFD1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x68000)
211#define SDMA_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x6C000)
212#define CANFD2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x70000)
213#define SEMAPHORE1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x74000)
214#define SEMAPHORE2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x78000)
215#define RDC_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x7C000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000216#else
Jason Liudec11122011-11-25 00:18:02 +0000217#define DCIC1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x64000)
218#define DCIC2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x68000)
219#define DMA_REQ_PORT_HOST_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x6C000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000220#endif
Jason Liudec11122011-11-25 00:18:02 +0000221
222#define AIPS2_ON_BASE_ADDR (ATZ2_BASE_ADDR + 0x7C000)
223#define AIPS2_OFF_BASE_ADDR (ATZ2_BASE_ADDR + 0x80000)
Adrian Alonsoee7c4ca2015-09-02 13:54:15 -0500224#define AIPS3_ON_BASE_ADDR (ATZ3_BASE_ADDR + 0x7C000)
225#define AIPS3_OFF_BASE_ADDR (ATZ3_BASE_ADDR + 0x80000)
Jason Liudec11122011-11-25 00:18:02 +0000226#define CAAM_BASE_ADDR (ATZ2_BASE_ADDR)
227#define ARM_BASE_ADDR (ATZ2_BASE_ADDR + 0x40000)
Raul Cardenasb5a36d82015-02-27 11:22:06 -0600228
229#define CONFIG_SYS_FSL_SEC_ADDR CAAM_BASE_ADDR
230#define CONFIG_SYS_FSL_JR0_ADDR (CAAM_BASE_ADDR + 0x1000)
231
Ye.Lif93453a2014-09-15 17:23:14 +0800232#define USB_PL301_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x0000)
233#define USB_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000234
Jason Liudec11122011-11-25 00:18:02 +0000235#define ENET_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x8000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000236#ifdef CONFIG_MX6SL
237#define MSHC_IPS_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0xC000)
238#else
Jason Liudec11122011-11-25 00:18:02 +0000239#define MLB_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0xC000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000240#endif
241
Jason Liudec11122011-11-25 00:18:02 +0000242#define USDHC1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x10000)
243#define USDHC2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x14000)
244#define USDHC3_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x18000)
245#define USDHC4_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x1C000)
246#define I2C1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x20000)
247#define I2C2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x24000)
248#define I2C3_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x28000)
249#define ROMCP_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x2C000)
250#define MMDC_P0_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x30000)
Peng Fan59e680d2015-07-20 19:28:23 +0800251/* i.MX6SL */
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000252#define RNGB_IPS_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x34000)
Peng Fan59e680d2015-07-20 19:28:23 +0800253#ifdef CONFIG_MX6UL
254#define ENET2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x34000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000255#else
Peng Fan59e680d2015-07-20 19:28:23 +0800256/* i.MX6SX */
257#define ENET2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x34000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000258#endif
Peng Fan59e680d2015-07-20 19:28:23 +0800259/* i.MX6DQ/SDL */
260#define MMDC_P1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x34000)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000261
Jason Liudec11122011-11-25 00:18:02 +0000262#define WEIM_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x38000)
263#define OCOTP_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x3C000)
264#define CSU_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x40000)
265#define IP2APB_PERFMON1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x44000)
266#define IP2APB_PERFMON2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x48000)
Peng Fan7f323212015-10-29 15:54:45 +0800267#define MX6UL_LCDIF1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x48000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300268#ifdef CONFIG_MX6SX
269#define DEBUG_MONITOR_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4C000)
270#else
Jason Liudec11122011-11-25 00:18:02 +0000271#define IP2APB_PERFMON3_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4C000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300272#endif
Jason Liudec11122011-11-25 00:18:02 +0000273#define IP2APB_TZASC1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x50000)
Peng Fan59e680d2015-07-20 19:28:23 +0800274#ifdef CONFIG_MX6UL
275#define QSPI0_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x60000)
276#elif defined(CONFIG_MX6SX)
Fabio Estevam712ab882014-06-24 17:40:58 -0300277#define SAI1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x54000)
Jason Liudec11122011-11-25 00:18:02 +0000278#define AUDMUX_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x58000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300279#define SAI2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x5C000)
Peng Fan828e4682014-12-31 11:01:38 +0800280#define QSPI0_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x60000)
281#define QSPI1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x64000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300282#else
Peng Fan59e680d2015-07-20 19:28:23 +0800283#define IP2APB_TZASC2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x54000)
Jason Liudec11122011-11-25 00:18:02 +0000284#define MIPI_CSI2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x5C000)
285#define MIPI_DSI_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x60000)
286#define VDOA_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x64000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300287#endif
Peng Fan59e680d2015-07-20 19:28:23 +0800288#define MX6UL_WDOG3_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x64000)
Jason Liudec11122011-11-25 00:18:02 +0000289#define UART2_BASE (AIPS2_OFF_BASE_ADDR + 0x68000)
290#define UART3_BASE (AIPS2_OFF_BASE_ADDR + 0x6C000)
291#define UART4_BASE (AIPS2_OFF_BASE_ADDR + 0x70000)
292#define UART5_BASE (AIPS2_OFF_BASE_ADDR + 0x74000)
Heiko Schocher5c4b1e92015-05-18 10:56:24 +0200293#define I2C4_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x78000)
Jason Liudec11122011-11-25 00:18:02 +0000294#define IP2APB_USBPHY1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x78000)
295#define IP2APB_USBPHY2_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x7C000)
296
Fabio Estevam712ab882014-06-24 17:40:58 -0300297#ifdef CONFIG_MX6SX
298#define GIS_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x04000)
299#define DCIC1_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x0C000)
300#define DCIC2_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x10000)
301#define CSI1_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x14000)
302#define PXP_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x18000)
303#define CSI2_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x1C000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300304#define VADC_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x28000)
305#define VDEC_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x2C000)
306#define SPBA_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x3C000)
307#define AIPS3_CONFIG_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x7C000)
308#define ADC1_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x80000)
309#define ADC2_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x84000)
Fabio Estevam712ab882014-06-24 17:40:58 -0300310#define ECSPI5_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x8C000)
311#define HS_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x90000)
312#define MU_MCU_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x94000)
313#define CANFD_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x98000)
314#define MU_DSP_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x9C000)
315#define UART6_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xA0000)
316#define PWM5_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xA4000)
317#define PWM6_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xA8000)
318#define PWM7_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xAC000)
319#define PWM8_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0xB0000)
320#endif
Peng Fan7f323212015-10-29 15:54:45 +0800321/* Only for i.MX6SX */
322#define LCDIF2_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x24000)
323#define MX6SX_LCDIF1_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x20000)
Peng Fan59e680d2015-07-20 19:28:23 +0800324#define MX6SX_WDOG3_BASE_ADDR (AIPS3_ARB_BASE_ADDR + 0x88000)
325
Peng Fan59e680d2015-07-20 19:28:23 +0800326#if !(defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Jason Liudec11122011-11-25 00:18:02 +0000327#define IRAM_SIZE 0x00040000
Fabio Estevam712ab882014-06-24 17:40:58 -0300328#else
329#define IRAM_SIZE 0x00020000
330#endif
Troy Kisky01112132012-02-07 14:08:46 +0000331#define FEC_QUIRK_ENET_MAC
Jason Liudec11122011-11-25 00:18:02 +0000332
Peng Fan7f323212015-10-29 15:54:45 +0800333#include <asm/imx-common/regs-lcdif.h>
Jason Liudec11122011-11-25 00:18:02 +0000334#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
335#include <asm/types.h>
336
Peng Fan7f323212015-10-29 15:54:45 +0800337/* only for i.MX6SX/UL */
Peng Fanf0d3fbf2015-11-30 16:04:51 +0800338#define WDOG3_BASE_ADDR ((is_cpu_type(MXC_CPU_MX6UL) ? \
339 MX6UL_WDOG3_BASE_ADDR : MX6SX_WDOG3_BASE_ADDR))
340#define LCDIF1_BASE_ADDR ((is_cpu_type(MXC_CPU_MX6UL)) ? \
341 MX6UL_LCDIF1_BASE_ADDR : MX6SX_LCDIF1_BASE_ADDR)
Peng Fan7f323212015-10-29 15:54:45 +0800342
343
Fabio Estevam04fc1282011-12-20 05:46:31 +0000344extern void imx_get_mac_from_fuse(int dev_id, unsigned char *mac);
Jason Liudec11122011-11-25 00:18:02 +0000345
Gabriel Huau170ceaf2014-07-26 11:35:43 -0700346#define SRC_SCR_CORE_1_RESET_OFFSET 14
347#define SRC_SCR_CORE_1_RESET_MASK (1<<SRC_SCR_CORE_1_RESET_OFFSET)
348#define SRC_SCR_CORE_2_RESET_OFFSET 15
349#define SRC_SCR_CORE_2_RESET_MASK (1<<SRC_SCR_CORE_2_RESET_OFFSET)
350#define SRC_SCR_CORE_3_RESET_OFFSET 16
351#define SRC_SCR_CORE_3_RESET_MASK (1<<SRC_SCR_CORE_3_RESET_OFFSET)
352#define SRC_SCR_CORE_1_ENABLE_OFFSET 22
353#define SRC_SCR_CORE_1_ENABLE_MASK (1<<SRC_SCR_CORE_1_ENABLE_OFFSET)
354#define SRC_SCR_CORE_2_ENABLE_OFFSET 23
355#define SRC_SCR_CORE_2_ENABLE_MASK (1<<SRC_SCR_CORE_2_ENABLE_OFFSET)
356#define SRC_SCR_CORE_3_ENABLE_OFFSET 24
357#define SRC_SCR_CORE_3_ENABLE_MASK (1<<SRC_SCR_CORE_3_ENABLE_OFFSET)
358
Peng Fan42997432016-01-28 16:54:59 +0800359struct rdc_regs {
360 u32 vir; /* Version information */
361 u32 reserved1[8];
362 u32 stat; /* Status */
363 u32 intctrl; /* Interrupt and Control */
364 u32 intstat; /* Interrupt Status */
365 u32 reserved2[116];
366 u32 mda[32]; /* Master Domain Assignment */
367 u32 reserved3[96];
368 u32 pdap[104]; /* Peripheral Domain Access Permissions */
369 u32 reserved4[88];
370 struct {
371 u32 mrsa; /* Memory Region Start Address */
372 u32 mrea; /* Memory Region End Address */
373 u32 mrc; /* Memory Region Control */
374 u32 mrvs; /* Memory Region Violation Status */
375 } mem_region[55];
376};
377
378struct rdc_sema_regs {
379 u8 gate[64]; /* Gate */
380 u16 rstgt; /* Reset Gate */
381};
382
Fabio Estevamba613422014-11-14 11:27:22 -0200383/* WEIM registers */
384struct weim {
385 u32 cs0gcr1;
386 u32 cs0gcr2;
387 u32 cs0rcr1;
388 u32 cs0rcr2;
389 u32 cs0wcr1;
390 u32 cs0wcr2;
391
392 u32 cs1gcr1;
393 u32 cs1gcr2;
394 u32 cs1rcr1;
395 u32 cs1rcr2;
396 u32 cs1wcr1;
397 u32 cs1wcr2;
398
399 u32 cs2gcr1;
400 u32 cs2gcr2;
401 u32 cs2rcr1;
402 u32 cs2rcr2;
403 u32 cs2wcr1;
404 u32 cs2wcr2;
405
406 u32 cs3gcr1;
407 u32 cs3gcr2;
408 u32 cs3rcr1;
409 u32 cs3rcr2;
410 u32 cs3wcr1;
411 u32 cs3wcr2;
412
413 u32 unused[12];
414
415 u32 wcr;
416 u32 wiar;
417 u32 ear;
418};
419
Jason Liudec11122011-11-25 00:18:02 +0000420/* System Reset Controller (SRC) */
421struct src {
422 u32 scr;
423 u32 sbmr1;
424 u32 srsr;
425 u32 reserved1[2];
426 u32 sisr;
427 u32 simr;
428 u32 sbmr2;
429 u32 gpr1;
430 u32 gpr2;
431 u32 gpr3;
432 u32 gpr4;
433 u32 gpr5;
434 u32 gpr6;
435 u32 gpr7;
436 u32 gpr8;
437 u32 gpr9;
438 u32 gpr10;
439};
440
Fabio Estevamf22d7592014-01-03 15:55:58 -0200441/* GPR1 bitfields */
Heiko Schocherff2b40d2015-09-25 12:31:48 +0200442#define IOMUXC_GPR1_APP_CLK_REQ_N BIT(30)
443#define IOMUXC_GPR1_PCIE_EXIT_L1 BIT(28)
444#define IOMUXC_GPR1_PCIE_RDY_L23 BIT(27)
445#define IOMUXC_GPR1_PCIE_ENTER_L1 BIT(26)
446#define IOMUXC_GPR1_MIPI_COLOR_SW BIT(25)
447#define IOMUXC_GPR1_DPI_OFF BIT(24)
448#define IOMUXC_GPR1_EXC_MON_SLVE BIT(22)
Fabio Estevamf22d7592014-01-03 15:55:58 -0200449#define IOMUXC_GPR1_ENET_CLK_SEL_OFFSET 21
450#define IOMUXC_GPR1_ENET_CLK_SEL_MASK (1 << IOMUXC_GPR1_ENET_CLK_SEL_OFFSET)
Heiko Schocherff2b40d2015-09-25 12:31:48 +0200451#define IOMUXC_GPR1_MIPI_IPU2_MUX_IOMUX BIT(20)
452#define IOMUXC_GPR1_MIPI_IPU1_MUX_IOMUX BIT(19)
453#define IOMUXC_GPR1_PCIE_TEST_PD BIT(18)
454#define IOMUXC_GPR1_IPU_VPU_MUX_IPU2 BIT(17)
455#define IOMUXC_GPR1_PCIE_REF_CLK_EN BIT(16)
456#define IOMUXC_GPR1_USB_EXP_MODE BIT(15)
457#define IOMUXC_GPR1_PCIE_INT BIT(14)
Heiko Schochera0230d82014-07-18 06:07:17 +0200458#define IOMUXC_GPR1_USB_OTG_ID_OFFSET 13
459#define IOMUXC_GPR1_USB_OTG_ID_SEL_MASK (1 << IOMUXC_GPR1_USB_OTG_ID_OFFSET)
Heiko Schocherff2b40d2015-09-25 12:31:48 +0200460#define IOMUXC_GPR1_GINT BIT(12)
461#define IOMUXC_GPR1_ADDRS3_MASK (0x3 << 10)
462#define IOMUXC_GPR1_ADDRS3_32MB (0x0 << 10)
463#define IOMUXC_GPR1_ADDRS3_64MB (0x1 << 10)
464#define IOMUXC_GPR1_ADDRS3_128MB (0x2 << 10)
465#define IOMUXC_GPR1_ACT_CS3 BIT(9)
466#define IOMUXC_GPR1_ADDRS2_MASK (0x3 << 7)
467#define IOMUXC_GPR1_ACT_CS2 BIT(6)
468#define IOMUXC_GPR1_ADDRS1_MASK (0x3 << 4)
469#define IOMUXC_GPR1_ACT_CS1 BIT(3)
470#define IOMUXC_GPR1_ADDRS0_OFFSET (1)
471#define IOMUXC_GPR1_ADDRS0_MASK (0x3 << 1)
472#define IOMUXC_GPR1_ACT_CS0 BIT(0)
Fabio Estevamf22d7592014-01-03 15:55:58 -0200473
Eric Nelsonadc8c382012-09-21 11:41:42 +0000474/* GPR3 bitfields */
475#define IOMUXC_GPR3_GPU_DBG_OFFSET 29
476#define IOMUXC_GPR3_GPU_DBG_MASK (3<<IOMUXC_GPR3_GPU_DBG_OFFSET)
477#define IOMUXC_GPR3_BCH_WR_CACHE_CTL_OFFSET 28
478#define IOMUXC_GPR3_BCH_WR_CACHE_CTL_MASK (1<<IOMUXC_GPR3_BCH_WR_CACHE_CTL_OFFSET)
479#define IOMUXC_GPR3_BCH_RD_CACHE_CTL_OFFSET 27
480#define IOMUXC_GPR3_BCH_RD_CACHE_CTL_MASK (1<<IOMUXC_GPR3_BCH_RD_CACHE_CTL_OFFSET)
481#define IOMUXC_GPR3_uSDHCx_WR_CACHE_CTL_OFFSET 26
482#define IOMUXC_GPR3_uSDHCx_WR_CACHE_CTL_MASK (1<<IOMUXC_GPR3_uSDHCx_WR_CACHE_CTL_OFFSET)
483#define IOMUXC_GPR3_uSDHCx_RD_CACHE_CTL_OFFSET 25
484#define IOMUXC_GPR3_uSDHCx_RD_CACHE_CTL_MASK (1<<IOMUXC_GPR3_uSDHCx_RD_CACHE_CTL_OFFSET)
485#define IOMUXC_GPR3_OCRAM_CTL_OFFSET 21
486#define IOMUXC_GPR3_OCRAM_CTL_MASK (0xf<<IOMUXC_GPR3_OCRAM_CTL_OFFSET)
487#define IOMUXC_GPR3_OCRAM_STATUS_OFFSET 17
488#define IOMUXC_GPR3_OCRAM_STATUS_MASK (0xf<<IOMUXC_GPR3_OCRAM_STATUS_OFFSET)
489#define IOMUXC_GPR3_CORE3_DBG_ACK_EN_OFFSET 16
490#define IOMUXC_GPR3_CORE3_DBG_ACK_EN_MASK (1<<IOMUXC_GPR3_CORE3_DBG_ACK_EN_OFFSET)
491#define IOMUXC_GPR3_CORE2_DBG_ACK_EN_OFFSET 15
492#define IOMUXC_GPR3_CORE2_DBG_ACK_EN_MASK (1<<IOMUXC_GPR3_CORE2_DBG_ACK_EN_OFFSET)
493#define IOMUXC_GPR3_CORE1_DBG_ACK_EN_OFFSET 14
494#define IOMUXC_GPR3_CORE1_DBG_ACK_EN_MASK (1<<IOMUXC_GPR3_CORE1_DBG_ACK_EN_OFFSET)
495#define IOMUXC_GPR3_CORE0_DBG_ACK_EN_OFFSET 13
496#define IOMUXC_GPR3_CORE0_DBG_ACK_EN_MASK (1<<IOMUXC_GPR3_CORE0_DBG_ACK_EN_OFFSET)
497#define IOMUXC_GPR3_TZASC2_BOOT_LOCK_OFFSET 12
498#define IOMUXC_GPR3_TZASC2_BOOT_LOCK_MASK (1<<IOMUXC_GPR3_TZASC2_BOOT_LOCK_OFFSET)
499#define IOMUXC_GPR3_TZASC1_BOOT_LOCK_OFFSET 11
500#define IOMUXC_GPR3_TZASC1_BOOT_LOCK_MASK (1<<IOMUXC_GPR3_TZASC1_BOOT_LOCK_OFFSET)
501#define IOMUXC_GPR3_IPU_DIAG_OFFSET 10
502#define IOMUXC_GPR3_IPU_DIAG_MASK (1<<IOMUXC_GPR3_IPU_DIAG_OFFSET)
503
504#define IOMUXC_GPR3_MUX_SRC_IPU1_DI0 0
505#define IOMUXC_GPR3_MUX_SRC_IPU1_DI1 1
506#define IOMUXC_GPR3_MUX_SRC_IPU2_DI0 2
507#define IOMUXC_GPR3_MUX_SRC_IPU2_DI1 3
508
509#define IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET 8
510#define IOMUXC_GPR3_LVDS1_MUX_CTL_MASK (3<<IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET)
511
512#define IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET 6
513#define IOMUXC_GPR3_LVDS0_MUX_CTL_MASK (3<<IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET)
514
515#define IOMUXC_GPR3_MIPI_MUX_CTL_OFFSET 4
516#define IOMUXC_GPR3_MIPI_MUX_CTL_MASK (3<<IOMUXC_GPR3_MIPI_MUX_CTL_OFFSET)
517
518#define IOMUXC_GPR3_HDMI_MUX_CTL_OFFSET 2
519#define IOMUXC_GPR3_HDMI_MUX_CTL_MASK (3<<IOMUXC_GPR3_HDMI_MUX_CTL_OFFSET)
520
Heiko Schocherff2b40d2015-09-25 12:31:48 +0200521/* gpr12 bitfields */
522#define IOMUXC_GPR12_ARMP_IPG_CLK_EN BIT(27)
523#define IOMUXC_GPR12_ARMP_AHB_CLK_EN BIT(26)
524#define IOMUXC_GPR12_ARMP_ATB_CLK_EN BIT(25)
525#define IOMUXC_GPR12_ARMP_APB_CLK_EN BIT(24)
526#define IOMUXC_GPR12_DEVICE_TYPE (0xf << 12)
527#define IOMUXC_GPR12_PCIE_CTL_2 BIT(10)
528#define IOMUXC_GPR12_LOS_LEVEL (0x1f << 4)
Eric Nelsonadc8c382012-09-21 11:41:42 +0000529
Eric Nelson0c555872012-09-19 08:32:31 +0000530struct iomuxc {
Peng Fan59e680d2015-07-20 19:28:23 +0800531#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
Fabio Estevam72edac02014-07-09 17:59:55 -0300532 u8 reserved[0x4000];
533#endif
Eric Nelson0c555872012-09-19 08:32:31 +0000534 u32 gpr[14];
Eric Nelson0c555872012-09-19 08:32:31 +0000535};
536
Fabio Estevam1a5b0b42014-08-25 14:26:44 -0300537struct gpc {
538 u32 cntr;
539 u32 pgr;
540 u32 imr1;
541 u32 imr2;
542 u32 imr3;
543 u32 imr4;
544 u32 isr1;
545 u32 isr2;
546 u32 isr3;
547 u32 isr4;
548};
549
Eric Nelson0c555872012-09-19 08:32:31 +0000550#define IOMUXC_GPR2_COUNTER_RESET_VAL_OFFSET 20
551#define IOMUXC_GPR2_COUNTER_RESET_VAL_MASK (3<<IOMUXC_GPR2_COUNTER_RESET_VAL_OFFSET)
552#define IOMUXC_GPR2_LVDS_CLK_SHIFT_OFFSET 16
553#define IOMUXC_GPR2_LVDS_CLK_SHIFT_MASK (7<<IOMUXC_GPR2_LVDS_CLK_SHIFT_OFFSET)
554
555#define IOMUXC_GPR2_BGREF_RRMODE_OFFSET 15
556#define IOMUXC_GPR2_BGREF_RRMODE_MASK (1<<IOMUXC_GPR2_BGREF_RRMODE_OFFSET)
557#define IOMUXC_GPR2_BGREF_RRMODE_INTERNAL_RES (1<<IOMUXC_GPR2_BGREF_RRMODE_OFFSET)
558#define IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES (0<<IOMUXC_GPR2_BGREF_RRMODE_OFFSET)
559#define IOMUXC_GPR2_VSYNC_ACTIVE_HIGH 0
560#define IOMUXC_GPR2_VSYNC_ACTIVE_LOW 1
561
562#define IOMUXC_GPR2_DI1_VS_POLARITY_OFFSET 10
563#define IOMUXC_GPR2_DI1_VS_POLARITY_MASK (1<<IOMUXC_GPR2_DI1_VS_POLARITY_OFFSET)
564#define IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_HIGH (IOMUXC_GPR2_VSYNC_ACTIVE_HIGH<<IOMUXC_GPR2_DI1_VS_POLARITY_OFFSET)
565#define IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW (IOMUXC_GPR2_VSYNC_ACTIVE_LOW<<IOMUXC_GPR2_DI1_VS_POLARITY_OFFSET)
566
567#define IOMUXC_GPR2_DI0_VS_POLARITY_OFFSET 9
568#define IOMUXC_GPR2_DI0_VS_POLARITY_MASK (1<<IOMUXC_GPR2_DI0_VS_POLARITY_OFFSET)
569#define IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_HIGH (IOMUXC_GPR2_VSYNC_ACTIVE_HIGH<<IOMUXC_GPR2_DI0_VS_POLARITY_OFFSET)
570#define IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW (IOMUXC_GPR2_VSYNC_ACTIVE_LOW<<IOMUXC_GPR2_DI0_VS_POLARITY_OFFSET)
571
572#define IOMUXC_GPR2_BITMAP_SPWG 0
573#define IOMUXC_GPR2_BITMAP_JEIDA 1
574
575#define IOMUXC_GPR2_BIT_MAPPING_CH1_OFFSET 8
576#define IOMUXC_GPR2_BIT_MAPPING_CH1_MASK (1<<IOMUXC_GPR2_BIT_MAPPING_CH1_OFFSET)
577#define IOMUXC_GPR2_BIT_MAPPING_CH1_JEIDA (IOMUXC_GPR2_BITMAP_JEIDA<<IOMUXC_GPR2_BIT_MAPPING_CH1_OFFSET)
578#define IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG (IOMUXC_GPR2_BITMAP_SPWG<<IOMUXC_GPR2_BIT_MAPPING_CH1_OFFSET)
579
580#define IOMUXC_GPR2_DATA_WIDTH_18 0
581#define IOMUXC_GPR2_DATA_WIDTH_24 1
582
583#define IOMUXC_GPR2_DATA_WIDTH_CH1_OFFSET 7
584#define IOMUXC_GPR2_DATA_WIDTH_CH1_MASK (1<<IOMUXC_GPR2_DATA_WIDTH_CH1_OFFSET)
585#define IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT (IOMUXC_GPR2_DATA_WIDTH_18<<IOMUXC_GPR2_DATA_WIDTH_CH1_OFFSET)
586#define IOMUXC_GPR2_DATA_WIDTH_CH1_24BIT (IOMUXC_GPR2_DATA_WIDTH_24<<IOMUXC_GPR2_DATA_WIDTH_CH1_OFFSET)
587
588#define IOMUXC_GPR2_BIT_MAPPING_CH0_OFFSET 6
589#define IOMUXC_GPR2_BIT_MAPPING_CH0_MASK (1<<IOMUXC_GPR2_BIT_MAPPING_CH0_OFFSET)
590#define IOMUXC_GPR2_BIT_MAPPING_CH0_JEIDA (IOMUXC_GPR2_BITMAP_JEIDA<<IOMUXC_GPR2_BIT_MAPPING_CH0_OFFSET)
591#define IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG (IOMUXC_GPR2_BITMAP_SPWG<<IOMUXC_GPR2_BIT_MAPPING_CH0_OFFSET)
592
593#define IOMUXC_GPR2_DATA_WIDTH_CH0_OFFSET 5
594#define IOMUXC_GPR2_DATA_WIDTH_CH0_MASK (1<<IOMUXC_GPR2_DATA_WIDTH_CH0_OFFSET)
595#define IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT (IOMUXC_GPR2_DATA_WIDTH_18<<IOMUXC_GPR2_DATA_WIDTH_CH0_OFFSET)
596#define IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT (IOMUXC_GPR2_DATA_WIDTH_24<<IOMUXC_GPR2_DATA_WIDTH_CH0_OFFSET)
597
598#define IOMUXC_GPR2_SPLIT_MODE_EN_OFFSET 4
599#define IOMUXC_GPR2_SPLIT_MODE_EN_MASK (1<<IOMUXC_GPR2_SPLIT_MODE_EN_OFFSET)
600
601#define IOMUXC_GPR2_MODE_DISABLED 0
602#define IOMUXC_GPR2_MODE_ENABLED_DI0 1
Pierre Aubert7f5746b2013-06-19 11:16:13 +0200603#define IOMUXC_GPR2_MODE_ENABLED_DI1 3
Eric Nelson0c555872012-09-19 08:32:31 +0000604
605#define IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET 2
606#define IOMUXC_GPR2_LVDS_CH1_MODE_MASK (3<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
607#define IOMUXC_GPR2_LVDS_CH1_MODE_DISABLED (IOMUXC_GPR2_MODE_DISABLED<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
608#define IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0 (IOMUXC_GPR2_MODE_ENABLED_DI0<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
609#define IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI1 (IOMUXC_GPR2_MODE_ENABLED_DI1<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
610
611#define IOMUXC_GPR2_LVDS_CH0_MODE_OFFSET 0
612#define IOMUXC_GPR2_LVDS_CH0_MODE_MASK (3<<IOMUXC_GPR2_LVDS_CH0_MODE_OFFSET)
613#define IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED (IOMUXC_GPR2_MODE_DISABLED<<IOMUXC_GPR2_LVDS_CH0_MODE_OFFSET)
614#define IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0 (IOMUXC_GPR2_MODE_ENABLED_DI0<<IOMUXC_GPR2_LVDS_CH0_MODE_OFFSET)
615#define IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI1 (IOMUXC_GPR2_MODE_ENABLED_DI1<<IOMUXC_GPR2_LVDS_CH0_MODE_OFFSET)
616
Eric Nelson32565c52012-01-31 07:52:04 +0000617/* ECSPI registers */
618struct cspi_regs {
619 u32 rxdata;
620 u32 txdata;
621 u32 ctrl;
622 u32 cfg;
623 u32 intr;
624 u32 dma;
625 u32 stat;
626 u32 period;
627};
628
629/*
630 * CSPI register definitions
631 */
632#define MXC_ECSPI
633#define MXC_CSPICTRL_EN (1 << 0)
634#define MXC_CSPICTRL_MODE (1 << 1)
635#define MXC_CSPICTRL_XCH (1 << 2)
Fabio Estevam833fb552013-04-09 13:06:25 +0000636#define MXC_CSPICTRL_MODE_MASK (0xf << 4)
Eric Nelson32565c52012-01-31 07:52:04 +0000637#define MXC_CSPICTRL_CHIPSELECT(x) (((x) & 0x3) << 12)
638#define MXC_CSPICTRL_BITCOUNT(x) (((x) & 0xfff) << 20)
639#define MXC_CSPICTRL_PREDIV(x) (((x) & 0xF) << 12)
640#define MXC_CSPICTRL_POSTDIV(x) (((x) & 0xF) << 8)
641#define MXC_CSPICTRL_SELCHAN(x) (((x) & 0x3) << 18)
642#define MXC_CSPICTRL_MAXBITS 0xfff
643#define MXC_CSPICTRL_TC (1 << 7)
644#define MXC_CSPICTRL_RXOVF (1 << 6)
645#define MXC_CSPIPERIOD_32KHZ (1 << 15)
646#define MAX_SPI_BYTES 32
Heiko Schocher472a68f2014-07-18 06:07:20 +0200647#define SPI_MAX_NUM 4
Eric Nelson32565c52012-01-31 07:52:04 +0000648
649/* Bit position inside CTRL register to be associated with SS */
650#define MXC_CSPICTRL_CHAN 18
651
652/* Bit position inside CON register to be associated with SS */
Markus Niebel92bc4e02014-02-17 17:33:16 +0100653#define MXC_CSPICON_PHA 0 /* SCLK phase control */
654#define MXC_CSPICON_POL 4 /* SCLK polarity */
655#define MXC_CSPICON_SSPOL 12 /* SS polarity */
656#define MXC_CSPICON_CTL 20 /* inactive state of SCLK */
Peng Fan59e680d2015-07-20 19:28:23 +0800657#if defined(CONFIG_MX6SL) || defined(CONFIG_MX6DL) || defined(CONFIG_MX6UL)
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000658#define MXC_SPI_BASE_ADDRESSES \
659 ECSPI1_BASE_ADDR, \
660 ECSPI2_BASE_ADDR, \
661 ECSPI3_BASE_ADDR, \
662 ECSPI4_BASE_ADDR
663#else
Eric Nelson32565c52012-01-31 07:52:04 +0000664#define MXC_SPI_BASE_ADDRESSES \
665 ECSPI1_BASE_ADDR, \
666 ECSPI2_BASE_ADDR, \
667 ECSPI3_BASE_ADDR, \
668 ECSPI4_BASE_ADDR, \
669 ECSPI5_BASE_ADDR
Fabio Estevamf7b9ac22013-04-10 09:32:57 +0000670#endif
Eric Nelson32565c52012-01-31 07:52:04 +0000671
Benoît Thébaudeaufa7e3952013-04-23 10:17:38 +0000672struct ocotp_regs {
Jason Liudec11122011-11-25 00:18:02 +0000673 u32 ctrl;
674 u32 ctrl_set;
675 u32 ctrl_clr;
676 u32 ctrl_tog;
677 u32 timing;
678 u32 rsvd0[3];
679 u32 data;
680 u32 rsvd1[3];
681 u32 read_ctrl;
682 u32 rsvd2[3];
Benoît Thébaudeaufa7e3952013-04-23 10:17:38 +0000683 u32 read_fuse_data;
Jason Liudec11122011-11-25 00:18:02 +0000684 u32 rsvd3[3];
Benoît Thébaudeaufa7e3952013-04-23 10:17:38 +0000685 u32 sw_sticky;
Jason Liudec11122011-11-25 00:18:02 +0000686 u32 rsvd4[3];
687 u32 scs;
688 u32 scs_set;
689 u32 scs_clr;
690 u32 scs_tog;
691 u32 crc_addr;
692 u32 rsvd5[3];
693 u32 crc_value;
694 u32 rsvd6[3];
695 u32 version;
Jason Liubf651aa2011-12-19 02:38:13 +0000696 u32 rsvd7[0xdb];
Jason Liudec11122011-11-25 00:18:02 +0000697
Peng Fan52bae462015-08-26 15:40:47 +0800698 /* fuse banks */
Jason Liudec11122011-11-25 00:18:02 +0000699 struct fuse_bank {
700 u32 fuse_regs[0x20];
Peng Fan52bae462015-08-26 15:40:47 +0800701 } bank[0];
Jason Liudec11122011-11-25 00:18:02 +0000702};
703
Benoît Thébaudeaub29e3962013-04-23 10:17:39 +0000704struct fuse_bank0_regs {
705 u32 lock;
706 u32 rsvd0[3];
707 u32 uid_low;
708 u32 rsvd1[3];
709 u32 uid_high;
Stefano Babic83fd8582013-06-28 00:20:21 +0200710 u32 rsvd2[3];
Peng Fanc3490dbc2015-01-09 16:59:40 +0800711 u32 cfg2;
712 u32 rsvd3[3];
713 u32 cfg3;
714 u32 rsvd4[3];
715 u32 cfg4;
716 u32 rsvd5[3];
Stefano Babic83fd8582013-06-28 00:20:21 +0200717 u32 cfg5;
718 u32 rsvd6[3];
Peng Fanc3490dbc2015-01-09 16:59:40 +0800719 u32 cfg6;
720 u32 rsvd7[3];
Benoît Thébaudeaub29e3962013-04-23 10:17:39 +0000721};
722
Tim Harvey3eece962015-05-18 06:56:44 -0700723struct fuse_bank1_regs {
724 u32 mem0;
725 u32 rsvd0[3];
726 u32 mem1;
727 u32 rsvd1[3];
728 u32 mem2;
729 u32 rsvd2[3];
730 u32 mem3;
731 u32 rsvd3[3];
732 u32 mem4;
733 u32 rsvd4[3];
734 u32 ana0;
735 u32 rsvd5[3];
736 u32 ana1;
737 u32 rsvd6[3];
738 u32 ana2;
739 u32 rsvd7[3];
740};
741
Fabio Estevam712ab882014-06-24 17:40:58 -0300742struct fuse_bank4_regs {
743 u32 sjc_resp_low;
744 u32 rsvd0[3];
745 u32 sjc_resp_high;
746 u32 rsvd1[3];
Ye Lid5d8bf72016-02-01 10:41:31 +0800747 u32 mac_addr0;
Fabio Estevam712ab882014-06-24 17:40:58 -0300748 u32 rsvd2[3];
Ye Lid5d8bf72016-02-01 10:41:31 +0800749 u32 mac_addr1;
Fabio Estevam712ab882014-06-24 17:40:58 -0300750 u32 rsvd3[3];
Ye Lid5d8bf72016-02-01 10:41:31 +0800751 u32 mac_addr2; /*For i.MX6SX and i.MX6UL*/
Fabio Estevam712ab882014-06-24 17:40:58 -0300752 u32 rsvd4[7];
753 u32 gp1;
Peng Fan59e680d2015-07-20 19:28:23 +0800754 u32 rsvd5[3];
755 u32 gp2;
756 u32 rsvd6[3];
Fabio Estevam712ab882014-06-24 17:40:58 -0300757};
Jason Liudec11122011-11-25 00:18:02 +0000758
Jason Liubb25e072012-01-10 00:52:59 +0000759struct aipstz_regs {
760 u32 mprot0;
761 u32 mprot1;
762 u32 rsvd[0xe];
763 u32 opacr0;
764 u32 opacr1;
765 u32 opacr2;
766 u32 opacr3;
767 u32 opacr4;
768};
769
Fabio Estevam46e97332012-03-20 04:21:45 +0000770struct anatop_regs {
771 u32 pll_sys; /* 0x000 */
772 u32 pll_sys_set; /* 0x004 */
773 u32 pll_sys_clr; /* 0x008 */
774 u32 pll_sys_tog; /* 0x00c */
775 u32 usb1_pll_480_ctrl; /* 0x010 */
776 u32 usb1_pll_480_ctrl_set; /* 0x014 */
777 u32 usb1_pll_480_ctrl_clr; /* 0x018 */
778 u32 usb1_pll_480_ctrl_tog; /* 0x01c */
779 u32 usb2_pll_480_ctrl; /* 0x020 */
780 u32 usb2_pll_480_ctrl_set; /* 0x024 */
781 u32 usb2_pll_480_ctrl_clr; /* 0x028 */
782 u32 usb2_pll_480_ctrl_tog; /* 0x02c */
783 u32 pll_528; /* 0x030 */
784 u32 pll_528_set; /* 0x034 */
785 u32 pll_528_clr; /* 0x038 */
786 u32 pll_528_tog; /* 0x03c */
787 u32 pll_528_ss; /* 0x040 */
788 u32 rsvd0[3];
789 u32 pll_528_num; /* 0x050 */
790 u32 rsvd1[3];
791 u32 pll_528_denom; /* 0x060 */
792 u32 rsvd2[3];
793 u32 pll_audio; /* 0x070 */
794 u32 pll_audio_set; /* 0x074 */
795 u32 pll_audio_clr; /* 0x078 */
796 u32 pll_audio_tog; /* 0x07c */
797 u32 pll_audio_num; /* 0x080 */
798 u32 rsvd3[3];
799 u32 pll_audio_denom; /* 0x090 */
800 u32 rsvd4[3];
801 u32 pll_video; /* 0x0a0 */
802 u32 pll_video_set; /* 0x0a4 */
803 u32 pll_video_clr; /* 0x0a8 */
804 u32 pll_video_tog; /* 0x0ac */
805 u32 pll_video_num; /* 0x0b0 */
806 u32 rsvd5[3];
807 u32 pll_video_denom; /* 0x0c0 */
808 u32 rsvd6[3];
809 u32 pll_mlb; /* 0x0d0 */
810 u32 pll_mlb_set; /* 0x0d4 */
811 u32 pll_mlb_clr; /* 0x0d8 */
812 u32 pll_mlb_tog; /* 0x0dc */
813 u32 pll_enet; /* 0x0e0 */
814 u32 pll_enet_set; /* 0x0e4 */
815 u32 pll_enet_clr; /* 0x0e8 */
816 u32 pll_enet_tog; /* 0x0ec */
817 u32 pfd_480; /* 0x0f0 */
818 u32 pfd_480_set; /* 0x0f4 */
819 u32 pfd_480_clr; /* 0x0f8 */
820 u32 pfd_480_tog; /* 0x0fc */
821 u32 pfd_528; /* 0x100 */
822 u32 pfd_528_set; /* 0x104 */
823 u32 pfd_528_clr; /* 0x108 */
824 u32 pfd_528_tog; /* 0x10c */
825 u32 reg_1p1; /* 0x110 */
826 u32 reg_1p1_set; /* 0x114 */
827 u32 reg_1p1_clr; /* 0x118 */
828 u32 reg_1p1_tog; /* 0x11c */
829 u32 reg_3p0; /* 0x120 */
830 u32 reg_3p0_set; /* 0x124 */
831 u32 reg_3p0_clr; /* 0x128 */
832 u32 reg_3p0_tog; /* 0x12c */
833 u32 reg_2p5; /* 0x130 */
834 u32 reg_2p5_set; /* 0x134 */
835 u32 reg_2p5_clr; /* 0x138 */
836 u32 reg_2p5_tog; /* 0x13c */
837 u32 reg_core; /* 0x140 */
838 u32 reg_core_set; /* 0x144 */
839 u32 reg_core_clr; /* 0x148 */
840 u32 reg_core_tog; /* 0x14c */
841 u32 ana_misc0; /* 0x150 */
842 u32 ana_misc0_set; /* 0x154 */
843 u32 ana_misc0_clr; /* 0x158 */
844 u32 ana_misc0_tog; /* 0x15c */
845 u32 ana_misc1; /* 0x160 */
846 u32 ana_misc1_set; /* 0x164 */
847 u32 ana_misc1_clr; /* 0x168 */
848 u32 ana_misc1_tog; /* 0x16c */
849 u32 ana_misc2; /* 0x170 */
850 u32 ana_misc2_set; /* 0x174 */
851 u32 ana_misc2_clr; /* 0x178 */
852 u32 ana_misc2_tog; /* 0x17c */
853 u32 tempsense0; /* 0x180 */
854 u32 tempsense0_set; /* 0x184 */
855 u32 tempsense0_clr; /* 0x188 */
856 u32 tempsense0_tog; /* 0x18c */
857 u32 tempsense1; /* 0x190 */
858 u32 tempsense1_set; /* 0x194 */
859 u32 tempsense1_clr; /* 0x198 */
860 u32 tempsense1_tog; /* 0x19c */
861 u32 usb1_vbus_detect; /* 0x1a0 */
862 u32 usb1_vbus_detect_set; /* 0x1a4 */
863 u32 usb1_vbus_detect_clr; /* 0x1a8 */
864 u32 usb1_vbus_detect_tog; /* 0x1ac */
865 u32 usb1_chrg_detect; /* 0x1b0 */
866 u32 usb1_chrg_detect_set; /* 0x1b4 */
867 u32 usb1_chrg_detect_clr; /* 0x1b8 */
868 u32 usb1_chrg_detect_tog; /* 0x1bc */
869 u32 usb1_vbus_det_stat; /* 0x1c0 */
870 u32 usb1_vbus_det_stat_set; /* 0x1c4 */
871 u32 usb1_vbus_det_stat_clr; /* 0x1c8 */
872 u32 usb1_vbus_det_stat_tog; /* 0x1cc */
873 u32 usb1_chrg_det_stat; /* 0x1d0 */
874 u32 usb1_chrg_det_stat_set; /* 0x1d4 */
875 u32 usb1_chrg_det_stat_clr; /* 0x1d8 */
876 u32 usb1_chrg_det_stat_tog; /* 0x1dc */
877 u32 usb1_loopback; /* 0x1e0 */
878 u32 usb1_loopback_set; /* 0x1e4 */
879 u32 usb1_loopback_clr; /* 0x1e8 */
880 u32 usb1_loopback_tog; /* 0x1ec */
881 u32 usb1_misc; /* 0x1f0 */
882 u32 usb1_misc_set; /* 0x1f4 */
883 u32 usb1_misc_clr; /* 0x1f8 */
884 u32 usb1_misc_tog; /* 0x1fc */
885 u32 usb2_vbus_detect; /* 0x200 */
886 u32 usb2_vbus_detect_set; /* 0x204 */
887 u32 usb2_vbus_detect_clr; /* 0x208 */
888 u32 usb2_vbus_detect_tog; /* 0x20c */
889 u32 usb2_chrg_detect; /* 0x210 */
890 u32 usb2_chrg_detect_set; /* 0x214 */
891 u32 usb2_chrg_detect_clr; /* 0x218 */
892 u32 usb2_chrg_detect_tog; /* 0x21c */
893 u32 usb2_vbus_det_stat; /* 0x220 */
894 u32 usb2_vbus_det_stat_set; /* 0x224 */
895 u32 usb2_vbus_det_stat_clr; /* 0x228 */
896 u32 usb2_vbus_det_stat_tog; /* 0x22c */
897 u32 usb2_chrg_det_stat; /* 0x230 */
898 u32 usb2_chrg_det_stat_set; /* 0x234 */
899 u32 usb2_chrg_det_stat_clr; /* 0x238 */
900 u32 usb2_chrg_det_stat_tog; /* 0x23c */
901 u32 usb2_loopback; /* 0x240 */
902 u32 usb2_loopback_set; /* 0x244 */
903 u32 usb2_loopback_clr; /* 0x248 */
904 u32 usb2_loopback_tog; /* 0x24c */
905 u32 usb2_misc; /* 0x250 */
906 u32 usb2_misc_set; /* 0x254 */
907 u32 usb2_misc_clr; /* 0x258 */
908 u32 usb2_misc_tog; /* 0x25c */
909 u32 digprog; /* 0x260 */
Troy Kisky58394932012-10-23 10:57:46 +0000910 u32 reserved1[7];
911 u32 digprog_sololite; /* 0x280 */
Fabio Estevam46e97332012-03-20 04:21:45 +0000912};
913
Eric Nelson939dd082013-08-29 12:37:35 -0700914#define ANATOP_PFD_FRAC_SHIFT(n) ((n)*8)
915#define ANATOP_PFD_FRAC_MASK(n) (0x3f<<ANATOP_PFD_FRAC_SHIFT(n))
916#define ANATOP_PFD_STABLE_SHIFT(n) (6+((n)*8))
917#define ANATOP_PFD_STABLE_MASK(n) (1<<ANATOP_PFD_STABLE_SHIFT(n))
918#define ANATOP_PFD_CLKGATE_SHIFT(n) (7+((n)*8))
919#define ANATOP_PFD_CLKGATE_MASK(n) (1<<ANATOP_PFD_CLKGATE_SHIFT(n))
Eric Nelson8098ec12012-09-19 08:29:46 +0000920
Fabio Estevam48e65b02013-02-07 06:45:23 +0000921struct wdog_regs {
922 u16 wcr; /* Control */
923 u16 wsr; /* Service */
924 u16 wrsr; /* Reset Status */
925 u16 wicr; /* Interrupt Control */
926 u16 wmcr; /* Miscellaneous Control */
927};
928
Heiko Schocher72b20902014-07-18 06:07:18 +0200929#define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)
930#define PWMCR_DOZEEN (1 << 24)
931#define PWMCR_WAITEN (1 << 23)
932#define PWMCR_DBGEN (1 << 22)
933#define PWMCR_CLKSRC_IPG_HIGH (2 << 16)
934#define PWMCR_CLKSRC_IPG (1 << 16)
935#define PWMCR_EN (1 << 0)
936
937struct pwm_regs {
938 u32 cr;
939 u32 sr;
940 u32 ir;
941 u32 sar;
942 u32 pr;
943 u32 cnr;
944};
Jason Liudec11122011-11-25 00:18:02 +0000945#endif /* __ASSEMBLER__*/
946#endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */