blob: cb0c2c15c03b4b397075dc3d2099b9bb274b71b2 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peng Fan8fb02222017-02-22 16:21:40 +08002/*
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
Peng Fan8fb02222017-02-22 16:21:40 +08004 */
5
6#ifndef _MX7ULP_REGS_H_
7#define _MX7ULP_REGS_H_
8
9#include <linux/sizes.h>
10
Peng Fan00565bf2019-05-09 08:33:55 +000011#define ARCH_MXC
12
Peng Fanb1d6be92019-07-22 01:24:37 +000013#define ROM_SW_INFO_ADDR 0x000001E8
14
Peng Fan8fb02222017-02-22 16:21:40 +080015#define CAAM_SEC_SRAM_BASE (0x26000000)
16#define CAAM_SEC_SRAM_SIZE (SZ_32K)
17#define CAAM_SEC_SRAM_END (CAAM_SEC_SRAM_BASE + CAAM_SEC_SRAM_SIZE - 1)
18
Franck LENORMAND4fde0a12021-03-25 17:30:23 +080019#define CAAM_ARB_BASE_ADDR CAAM_SEC_SRAM_BASE
20
Peng Fan8fb02222017-02-22 16:21:40 +080021#define OCRAM_0_BASE (0x2F000000)
22#define OCRAM_0_SIZE (SZ_128K)
23#define OCRAM_0_END (OCRAM_0_BASE + OCRAM_0_SIZE - 1)
24
25#define OCRAM_1_BASE (0x2F020000)
26#define OCRAM_1_SIZE (SZ_128K)
27#define OCRAM_1_END (OCRAM_1_BASE + OCRAM_1_SIZE - 1)
28
29#define TCML_BASE (0x1FFD0000)
30#define TCMU_BASE (0x20000000)
31
32#define AIPS3_BASE (0x40800000UL)
33#define AIPS3_SLOT_SIZE (SZ_64K)
34#define AIPS2_BASE (0x40000000UL)
35#define AIPS2_SLOT_SIZE (SZ_64K)
36#define AIPS1_BASE (0x41080000UL)
37#define AIPS1_SLOT_SIZE (SZ_4K)
38#define AIPS0_BASE (0x41000000UL)
39#define AIPS0_SLOT_SIZE (SZ_4K)
40#define IOMUXC0_AIPS0_SLOT (61)
41#define WDG0_AIPS0_SLOT (37)
42#define WDG1_AIPS2_SLOT (61)
43#define WDG2_AIPS2_SLOT (67)
44#define WDG0_PCC0_SLOT (37)
45#define IOMUXC1_AIPS3_SLOT (44)
46#define CMC0_AIPS1_SLOT (36)
47#define CMC1_AIPS2_SLOT (65)
48#define SCG0_AIPS0_SLOT (39)
49#define PCC0_AIPS0_SLOT (38)
50#define PCC1_AIPS1_SLOT (50)
51#define PCC2_AIPS2_SLOT (63)
52#define PCC3_AIPS3_SLOT (51)
53#define SCG1_AIPS2_SLOT (62)
54#define SIM0_AIPS1_SLOT (35)
55#define SIM1_AIPS1_SLOT (48)
56#define USBOTG0_AIPS2_SLOT (51)
57#define USBOTG1_AIPS2_SLOT (52)
58#define USBPHY_AIPS2_SLOT (53)
59#define USDHC0_AIPS2_SLOT (55)
60#define USDHC1_AIPS2_SLOT (56)
61#define RGPIO2P0_AIPS0_SLOT (15)
62#define RGPIO2P1_AIPS2_SLOT (15)
Bai Pingb1b61c62019-07-22 01:24:42 +000063#define SNVS_AIPS2_SLOT (35)
Peng Fan8fb02222017-02-22 16:21:40 +080064#define IOMUXC0_AIPS0_SLOT (61)
65#define OCOTP_CTRL_AIPS1_SLOT (38)
66#define OCOTP_CTRL_PCC1_SLOT (38)
67#define SIM1_PCC1_SLOT (48)
68#define MMDC0_AIPS3_SLOT (43)
69#define IOMUXC_DDR_AIPS3_SLOT (45)
70
71#define LPI2C0_AIPS0_SLOT (51)
72#define LPI2C1_AIPS0_SLOT (52)
73#define LPI2C2_AIPS0_SLOT (53)
74#define LPI2C3_AIPS0_SLOT (54)
75#define LPI2C4_AIPS2_SLOT (43)
76#define LPI2C5_AIPS2_SLOT (44)
77#define LPI2C6_AIPS3_SLOT (36)
78#define LPI2C7_AIPS3_SLOT (37)
79
80#define LPUART0_PCC0_SLOT (58)
81#define LPUART1_PCC0_SLOT (59)
82#define LPUART2_PCC1_SLOT (43)
83#define LPUART3_PCC1_SLOT (44)
84#define LPUART0_AIPS0_SLOT (58)
85#define LPUART1_AIPS0_SLOT (59)
86#define LPUART2_AIPS1_SLOT (43)
87#define LPUART3_AIPS1_SLOT (44)
88#define LPUART4_AIPS2_SLOT (45)
89#define LPUART5_AIPS2_SLOT (46)
90#define LPUART6_AIPS3_SLOT (38)
91#define LPUART7_AIPS3_SLOT (39)
92
93#define CORE_B_ROM_SIZE (SZ_32K + SZ_64K)
94#define CORE_B_ROM_BASE (0x00000000)
95
96#define ROMCP_ARB_BASE_ADDR CORE_B_ROM_BASE
97#define ROMCP_ARB_END_ADDR CORE_B_ROM_SIZE
98#define IRAM_BASE_ADDR OCRAM_0_BASE
99#define IRAM_SIZE (SZ_128K + SZ_128K)
100
101#define IOMUXC_PCR_MUX_ALT0 (0<<8)
102#define IOMUXC_PCR_MUX_ALT1 (1<<8)
103#define IOMUXC_PCR_MUX_ALT2 (2<<8)
104#define IOMUXC_PCR_MUX_ALT3 (3<<8)
105#define IOMUXC_PCR_MUX_ALT4 (4<<8)
106#define IOMUXC_PCR_MUX_ALT5 (5<<8)
107#define IOMUXC_PCR_MUX_ALT6 (6<<8)
108#define IOMUXC_PCR_MUX_ALT7 (7<<8)
109#define IOMUXC_PCR_MUX_ALT8 (8<<8)
110#define IOMUXC_PCR_MUX_ALT9 (9<<8)
111#define IOMUXC_PCR_MUX_ALT10 (10<<8)
112#define IOMUXC_PCR_MUX_ALT11 (11<<8)
113#define IOMUXC_PCR_MUX_ALT12 (12<<8)
114#define IOMUXC_PCR_MUX_ALT13 (13<<8)
115#define IOMUXC_PCR_MUX_ALT14 (14<<8)
116#define IOMUXC_PCR_MUX_ALT15 (15<<8)
117
118#define IOMUXC_PSMI_IMUX_ALT0 (0x0)
119#define IOMUXC_PSMI_IMUX_ALT1 (0x1)
120#define IOMUXC_PSMI_IMUX_ALT2 (0x2)
121#define IOMUXC_PSMI_IMUX_ALT3 (0x3)
122#define IOMUXC_PSMI_IMUX_ALT4 (0x4)
123#define IOMUXC_PSMI_IMUX_ALT5 (0x5)
124#define IOMUXC_PSMI_IMUX_ALT6 (0x6)
125#define IOMUXC_PSMI_IMUX_ALT7 (0x7)
126
127
128#define SIM_SOPT1_EN_SNVS_HARD_RST (1<<8)
129#define SIM_SOPT1_PMIC_STBY_REQ (1<<2)
130#define SIM_SOPT1_A7_SW_RESET (1<<0)
131
132#define IOMUXC_PCR_MUX_ALT_SHIFT (8)
133#define IOMUXC_PCR_MUX_ALT_MASK (0xF00)
134#define IOMUXC_PSMI_IMUX_ALT_SHIFT (0)
135
136#define IOMUXC0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * IOMUXC0_AIPS0_SLOT)))
137#define IOMUXC1_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * IOMUXC1_AIPS3_SLOT)))
138#define WDG0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * WDG0_AIPS0_SLOT)))
139#define WDG1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * WDG1_AIPS2_SLOT)))
140#define WDG2_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * WDG2_AIPS2_SLOT)))
141#define SCG0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * SCG0_AIPS0_SLOT)))
142#define SCG1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * SCG1_AIPS2_SLOT)))
143#define PCC0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * PCC0_AIPS0_SLOT)))
144#define PCC1_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * PCC1_AIPS1_SLOT)))
145#define PCC2_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * PCC2_AIPS2_SLOT)))
146#define PCC3_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * PCC3_AIPS3_SLOT)))
147#define IOMUXC0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * IOMUXC0_AIPS0_SLOT)))
148#define PSMI0_RBASE ((IOMUXC0_RBASE + 0x100)) /* in iomuxc0 after pta and ptb */
149#define CMC0_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * CMC0_AIPS1_SLOT)))
150#define CMC1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * CMC1_AIPS2_SLOT)))
151#define OCOTP_BASE_ADDR ((AIPS1_BASE + (AIPS1_SLOT_SIZE * OCOTP_CTRL_AIPS1_SLOT)))
152#define SIM0_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * SIM0_AIPS1_SLOT)))
153#define SIM1_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * SIM1_AIPS1_SLOT)))
154#define MMDC0_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * MMDC0_AIPS3_SLOT)))
155
156#define USBOTG0_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * USBOTG0_AIPS2_SLOT)))
157#define USBOTG1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * USBOTG1_AIPS2_SLOT)))
158#define USBPHY_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * USBPHY_AIPS2_SLOT)))
159#define USB_PHY0_BASE_ADDR USBPHY_RBASE
160#define USB_BASE_ADDR USBOTG0_RBASE
161
162#define LPI2C1_BASE_ADDR ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPI2C0_AIPS0_SLOT)))
163#define LPI2C2_BASE_ADDR ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPI2C1_AIPS0_SLOT)))
164#define LPI2C3_BASE_ADDR ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPI2C2_AIPS0_SLOT)))
165#define LPI2C4_BASE_ADDR ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPI2C3_AIPS0_SLOT)))
166#define LPI2C5_BASE_ADDR ((AIPS2_BASE + (AIPS2_SLOT_SIZE * LPI2C4_AIPS2_SLOT)))
167#define LPI2C6_BASE_ADDR ((AIPS2_BASE + (AIPS2_SLOT_SIZE * LPI2C5_AIPS2_SLOT)))
168#define LPI2C7_BASE_ADDR ((AIPS3_BASE + (AIPS3_SLOT_SIZE * LPI2C6_AIPS3_SLOT)))
169#define LPI2C8_BASE_ADDR ((AIPS3_BASE + (AIPS3_SLOT_SIZE * LPI2C7_AIPS3_SLOT)))
170
171#define LPUART0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPUART0_AIPS0_SLOT)))
172#define LPUART1_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * LPUART1_AIPS0_SLOT)))
173#define LPUART2_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * LPUART2_AIPS1_SLOT)))
174#define LPUART3_RBASE ((AIPS1_BASE + (AIPS1_SLOT_SIZE * LPUART3_AIPS1_SLOT)))
175#define LPUART4_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * LPUART4_AIPS2_SLOT)))
176#define LPUART5_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * LPUART5_AIPS2_SLOT)))
177#define LPUART6_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * LPUART6_AIPS3_SLOT)))
178#define LPUART7_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * LPUART7_AIPS3_SLOT)))
179
180#define USDHC0_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * USDHC0_AIPS2_SLOT)))
181#define USDHC1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * USDHC1_AIPS2_SLOT)))
182
Bai Pingb1b61c62019-07-22 01:24:42 +0000183#define SNVS_BASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * SNVS_AIPS2_SLOT)))
184#define SNVS_LP_LPCR (SNVS_BASE + 0x38)
185
Peng Fan8fb02222017-02-22 16:21:40 +0800186#define RGPIO2P0_RBASE ((AIPS0_BASE + (AIPS0_SLOT_SIZE * RGPIO2P0_AIPS0_SLOT)))
187#define RGPIO2P1_RBASE ((AIPS2_BASE + (AIPS2_SLOT_SIZE * RGPIO2P1_AIPS2_SLOT)))
188
189#define WDG0_PCC_REG (PCC0_RBASE + (4 * WDG0_PCC0_SLOT))
190#define WDG1_PCC_REG (PCC2_RBASE + (4 * WDG1_PCC2_SLOT))
191#define CMC0_SRS (CMC0_RBASE + 0x20)
192#define CMC0_SSRS (CMC0_RBASE + 0x28)
193#define CMC1_SRS (CMC1_RBASE + 0x20)
194#define CMC1_SSRS (CMC1_RBASE + 0x28)
195
196#define IOMUXC0_PCR0 (IOMUXC0_RBASE + (4 * 0))
197#define IOMUXC0_PCR1 (IOMUXC0_RBASE + (4 * 1))
198#define IOMUXC0_PCR2 (IOMUXC0_RBASE + (4 * 2))
199#define IOMUXC0_PCR3 (IOMUXC0_RBASE + (4 * 3))
200#define IOMUXC0_PSMI62 (PSMI0_RBASE + (4 * 62))
201#define IOMUXC0_PSMI63 (PSMI0_RBASE + (4 * 63))
202#define IOMUXC0_PSMI64 (PSMI0_RBASE + (4 * 64))
203
204#define SCG_CSR (SCG0_RBASE + 0x010)
205#define SCG_RCCR (SCG0_RBASE + 0x014)
206#define SCG_VCCR (SCG0_RBASE + 0x018)
207#define SCG_HCCR (SCG0_RBASE + 0x01c)
208
209#define LPUART0_PCC_REG (PCC0_RBASE + (4 * LPUART0_PCC0_SLOT))
210#define LPUART1_PCC_REG (PCC0_RBASE + (4 * LPUART1_PCC0_SLOT))
211#define LPUART2_PCC_REG (PCC1_RBASE + (4 * LPUART2_PCC1_SLOT))
212#define LPUART3_PCC_REG (PCC1_RBASE + (4 * LPUART3_PCC1_SLOT))
213#define LPUART4_PCC_REG (PCC2_RBASE + (4 * LPUART4_PCC2_SLOT))
214#define LPUART5_PCC_REG (PCC2_RBASE + (4 * LPUART5_PCC2_SLOT))
215#define LPUART6_PCC_REG (PCC3_RBASE + (4 * LPUART6_PCC3_SLOT))
216#define LPUART7_PCC_REG (PCC3_RBASE + (4 * LPUART7_PCC3_SLOT))
217
218#define USDHC0_PCC_REG (PCC2_RBASE + (4 * USDHC0_PCC2_SLOT))
219#define USDHC1_PCC_REG (PCC2_RBASE + (4 * USDHC1_PCC2_SLOT))
220
221#define SIM1_PCC_REG (PCC1_RBASE + (4 * SIM1_PCC1_SLOT))
222#define SCG1_PCC_REG (PCC2_RBASE + (4 * SCG1_PCC2_SLOT))
223
224#define OCOTP_CTRL_PCC_REG (PCC1_RBASE + (4 * OCOTP_CTRL_PCC1_SLOT))
225
226#define IOMUXC_DDR_RBASE ((AIPS3_BASE + (AIPS3_SLOT_SIZE * IOMUXC_DDR_AIPS3_SLOT)))
227#define MMDC0_PCC_REG (PCC3_RBASE + (4 * MMDC0_PCC3_SLOT))
228
Franck LENORMAND4fde0a12021-03-25 17:30:23 +0800229#define CAAM_IPS_BASE_ADDR (AIPS2_BASE + 0x240000) /* 40240000 */
230
231#define CONFIG_SYS_FSL_SEC_OFFSET 0
232#define CONFIG_SYS_FSL_SEC_ADDR (CAAM_IPS_BASE_ADDR + \
233 CONFIG_SYS_FSL_SEC_OFFSET)
234#define CONFIG_SYS_FSL_JR0_OFFSET 0x1000
235#define CONFIG_SYS_FSL_JR0_ADDR (CONFIG_SYS_FSL_SEC_ADDR + \
236 CONFIG_SYS_FSL_JR0_OFFSET)
237#define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1
238
Peng Fan8fb02222017-02-22 16:21:40 +0800239#define IOMUXC_DPCR_DDR_DQS0 ((IOMUXC_DDR_RBASE + (4 * 32)))
240#define IOMUXC_DPCR_DDR_DQS1 ((IOMUXC_DDR_RBASE + (4 * 33)))
241#define IOMUXC_DPCR_DDR_DQS2 ((IOMUXC_DDR_RBASE + (4 * 34)))
242#define IOMUXC_DPCR_DDR_DQS3 ((IOMUXC_DDR_RBASE + (4 * 35)))
243
244
245#define IOMUXC_DPCR_DDR_DQ0 ((IOMUXC_DDR_RBASE + (4 * 0)))
246#define IOMUXC_DPCR_DDR_DQ1 ((IOMUXC_DDR_RBASE + (4 * 1)))
247#define IOMUXC_DPCR_DDR_DQ2 ((IOMUXC_DDR_RBASE + (4 * 2)))
248#define IOMUXC_DPCR_DDR_DQ3 ((IOMUXC_DDR_RBASE + (4 * 3)))
249#define IOMUXC_DPCR_DDR_DQ4 ((IOMUXC_DDR_RBASE + (4 * 4)))
250#define IOMUXC_DPCR_DDR_DQ5 ((IOMUXC_DDR_RBASE + (4 * 5)))
251#define IOMUXC_DPCR_DDR_DQ6 ((IOMUXC_DDR_RBASE + (4 * 6)))
252#define IOMUXC_DPCR_DDR_DQ7 ((IOMUXC_DDR_RBASE + (4 * 7)))
253#define IOMUXC_DPCR_DDR_DQ8 ((IOMUXC_DDR_RBASE + (4 * 8)))
254#define IOMUXC_DPCR_DDR_DQ9 ((IOMUXC_DDR_RBASE + (4 * 9)))
255#define IOMUXC_DPCR_DDR_DQ10 ((IOMUXC_DDR_RBASE + (4 * 10)))
256#define IOMUXC_DPCR_DDR_DQ11 ((IOMUXC_DDR_RBASE + (4 * 11)))
257#define IOMUXC_DPCR_DDR_DQ12 ((IOMUXC_DDR_RBASE + (4 * 12)))
258#define IOMUXC_DPCR_DDR_DQ13 ((IOMUXC_DDR_RBASE + (4 * 13)))
259#define IOMUXC_DPCR_DDR_DQ14 ((IOMUXC_DDR_RBASE + (4 * 14)))
260#define IOMUXC_DPCR_DDR_DQ15 ((IOMUXC_DDR_RBASE + (4 * 15)))
261#define IOMUXC_DPCR_DDR_DQ16 ((IOMUXC_DDR_RBASE + (4 * 16)))
262#define IOMUXC_DPCR_DDR_DQ17 ((IOMUXC_DDR_RBASE + (4 * 17)))
263#define IOMUXC_DPCR_DDR_DQ18 ((IOMUXC_DDR_RBASE + (4 * 18)))
264#define IOMUXC_DPCR_DDR_DQ19 ((IOMUXC_DDR_RBASE + (4 * 19)))
265#define IOMUXC_DPCR_DDR_DQ20 ((IOMUXC_DDR_RBASE + (4 * 20)))
266#define IOMUXC_DPCR_DDR_DQ21 ((IOMUXC_DDR_RBASE + (4 * 21)))
267#define IOMUXC_DPCR_DDR_DQ22 ((IOMUXC_DDR_RBASE + (4 * 22)))
268#define IOMUXC_DPCR_DDR_DQ23 ((IOMUXC_DDR_RBASE + (4 * 23)))
269#define IOMUXC_DPCR_DDR_DQ24 ((IOMUXC_DDR_RBASE + (4 * 24)))
270#define IOMUXC_DPCR_DDR_DQ25 ((IOMUXC_DDR_RBASE + (4 * 25)))
271#define IOMUXC_DPCR_DDR_DQ26 ((IOMUXC_DDR_RBASE + (4 * 26)))
272#define IOMUXC_DPCR_DDR_DQ27 ((IOMUXC_DDR_RBASE + (4 * 27)))
273#define IOMUXC_DPCR_DDR_DQ28 ((IOMUXC_DDR_RBASE + (4 * 28)))
274#define IOMUXC_DPCR_DDR_DQ29 ((IOMUXC_DDR_RBASE + (4 * 29)))
275#define IOMUXC_DPCR_DDR_DQ30 ((IOMUXC_DDR_RBASE + (4 * 30)))
276#define IOMUXC_DPCR_DDR_DQ31 ((IOMUXC_DDR_RBASE + (4 * 31)))
277
278/* Remap the rgpio2p registers addr to driver's addr */
279#define RGPIO2P_GPIO1_BASE_ADDR RGPIO2P0_RBASE
280#define RGPIO2P_GPIO2_BASE_ADDR (RGPIO2P0_RBASE + 0x40)
281#define RGPIO2P_GPIO3_BASE_ADDR (RGPIO2P1_RBASE)
282#define RGPIO2P_GPIO4_BASE_ADDR (RGPIO2P1_RBASE + 0x40)
283#define RGPIO2P_GPIO5_BASE_ADDR (RGPIO2P1_RBASE + 0x80)
284#define RGPIO2P_GPIO6_BASE_ADDR (RGPIO2P1_RBASE + 0xc0)
285
286/* MMDC registers addresses */
287#define MMDC_MDCTL_OFFSET (0x000)
288#define MMDC_MDPDC_OFFSET (0x004)
289#define MMDC_MDOTC_OFFSET (0x008)
290#define MMDC_MDCFG0_OFFSET (0x00C)
291#define MMDC_MDCFG1_OFFSET (0x010)
292#define MMDC_MDCFG2_OFFSET (0x014)
293#define MMDC_MDMISC_OFFSET (0x018)
294#define MMDC_MDSCR_OFFSET (0x01C)
295#define MMDC_MDREF_OFFSET (0x020)
296#define MMDC_MDRWD_OFFSET (0x02C)
297#define MMDC_MDOR_OFFSET (0x030)
298#define MMDC_MDMRR_OFFSET (0x034)
299#define MMDC_MDCFG3LP_OFFSET (0x038)
300#define MMDC_MDMR4_OFFSET (0x03C)
301#define MMDC_MDASP_OFFSET (0x040)
302
303#define MMDC_MAARCR_OFFSET (0x400)
304#define MMDC_MAPSR_OFFSET (0x404)
305#define MMDC_MAEXIDR0_OFFSET (0x408)
306#define MMDC_MAEXIDR1_OFFSET (0x40C)
307#define MMDC_MADPCR0_OFFSET (0x410)
308#define MMDC_MADPCR1_OFFSET (0x414)
309#define MMDC_MADPSR0_OFFSET (0x418)
310#define MMDC_MADPSR1_OFFSET (0x41C)
311#define MMDC_MADPSR2_OFFSET (0x420)
312#define MMDC_MADPSR3_OFFSET (0x424)
313#define MMDC_MADPSR4_OFFSET (0x428)
314#define MMDC_MADPSR5_OFFSET (0x42C)
315#define MMDC_MASBS0_OFFSET (0x430)
316#define MMDC_MASBS1_OFFSET (0x434)
317#define MMDC_MAGENP_OFFSET (0x440)
318
319#define MMDC_MPZQHWCTRL_OFFSET (0x800)
320#define MMDC_MPZQSWCTRL_OFFSET (0x804)
321#define MMDC_MPWLGCR_OFFSET (0x808)
322#define MMDC_MPWLDECTRL0_OFFSET (0x80C)
323#define MMDC_MPWLDECTRL1_OFFSET (0x810)
324#define MMDC_MPWLDLST_OFFSET (0x814)
325#define MMDC_MPODTCTRL_OFFSET (0x818)
326#define MMDC_MPREDQBY0DL_OFFSET (0x81C)
327#define MMDC_MPREDQBY1DL_OFFSET (0x820)
328#define MMDC_MPREDQBY2DL_OFFSET (0x824)
329#define MMDC_MPREDQBY3DL_OFFSET (0x828)
330#define MMDC_MPWRDQBY0DL_OFFSET (0x82C)
331#define MMDC_MPWRDQBY1DL_OFFSET (0x830)
332#define MMDC_MPWRDQBY2DL_OFFSET (0x834)
333#define MMDC_MPWRDQBY3DL_OFFSET (0x838)
334#define MMDC_MPDGCTRL0_OFFSET (0x83C)
335#define MMDC_MPDGCTRL1_OFFSET (0x840)
336#define MMDC_MPDGDLST_OFFSET (0x844)
337#define MMDC_MPRDDLCTL_OFFSET (0x848)
338#define MMDC_MPRDDLST_OFFSET (0x84C)
339#define MMDC_MPWRDLCTL_OFFSET (0x850)
340#define MMDC_MPWRDLST_OFFSET (0x854)
341#define MMDC_MPSDCTRL_OFFSET (0x858)
342#define MMDC_MPZQLP2CTL_OFFSET (0x85C)
343#define MMDC_MPRDDLHWCTL_OFFSET (0x860)
344#define MMDC_MPWRDLHWCTL_OFFSET (0x864)
345#define MMDC_MPRDDLHWST0_OFFSET (0x868)
346#define MMDC_MPRDDLHWST1_OFFSET (0x86C)
347#define MMDC_MPWRDLHWST0_OFFSET (0x870)
348#define MMDC_MPWRDLHWST1_OFFSET (0x874)
349#define MMDC_MPWLHWERR_OFFSET (0x878)
350#define MMDC_MPDGHWST0_OFFSET (0x87C)
351#define MMDC_MPDGHWST1_OFFSET (0x880)
352#define MMDC_MPDGHWST2_OFFSET (0x884)
353#define MMDC_MPDGHWST3_OFFSET (0x888)
354#define MMDC_MPPDCMPR1_OFFSET (0x88C)
355#define MMDC_MPPDCMPR2_OFFSET (0x890)
356#define MMDC_MPSWDAR_OFFSET (0x894)
357#define MMDC_MPSWDRDR0_OFFSET (0x898)
358#define MMDC_MPSWDRDR1_OFFSET (0x89C)
359#define MMDC_MPSWDRDR2_OFFSET (0x8A0)
360#define MMDC_MPSWDRDR3_OFFSET (0x8A4)
361#define MMDC_MPSWDRDR4_OFFSET (0x8A8)
362#define MMDC_MPSWDRDR5_OFFSET (0x8AC)
363#define MMDC_MPSWDRDR6_OFFSET (0x8B0)
364#define MMDC_MPSWDRDR7_OFFSET (0x8B4)
365#define MMDC_MPMUR_OFFSET (0x8B8)
366#define MMDC_MPWRCADL_OFFSET (0x8BC)
367#define MMDC_MPDCCR_OFFSET (0x8C0)
368#define MMDC_MPBC_OFFSET (0x8C4)
369#define MMDC_MPSWDRAR_OFFSET (0x8C8)
370
371/* First MMDC invalid IPS address */
372#define MMDC_IPS_ILL_ADDR_START_OFFSET (0x8CC)
373#define MMDC_REGS_BASE MMDC0_RBASE
374
375#define MMDC_MDCTL ((MMDC_REGS_BASE + MMDC_MDCTL_OFFSET))
376#define MMDC_MDPDC ((MMDC_REGS_BASE + MMDC_MDPDC_OFFSET))
377#define MMDC_MDOTC ((MMDC_REGS_BASE + MMDC_MDOTC_OFFSET))
378#define MMDC_MDCFG0 ((MMDC_REGS_BASE + MMDC_MDCFG0_OFFSET))
379#define MMDC_MDCFG1 ((MMDC_REGS_BASE + MMDC_MDCFG1_OFFSET))
380#define MMDC_MDCFG2 ((MMDC_REGS_BASE + MMDC_MDCFG2_OFFSET))
381#define MMDC_MDMISC ((MMDC_REGS_BASE + MMDC_MDMISC_OFFSET))
382#define MMDC_MDSCR ((MMDC_REGS_BASE + MMDC_MDSCR_OFFSET))
383#define MMDC_MDREF ((MMDC_REGS_BASE + MMDC_MDREF_OFFSET))
384#define MMDC_MDRWD ((MMDC_REGS_BASE + MMDC_MDRWD_OFFSET))
385#define MMDC_MDOR ((MMDC_REGS_BASE + MMDC_MDOR_OFFSET))
386#define MMDC_MDMRR ((MMDC_REGS_BASE + MMDC_MDMRR_OFFSET))
387#define MMDC_MDCFG3LP ((MMDC_REGS_BASE + MMDC_MDCFG3LP_OFFSET))
388#define MMDC_MDMR4 ((MMDC_REGS_BASE + MMDC_MDMR4_OFFSET))
389#define MMDC_MDASP ((MMDC_REGS_BASE + MMDC_MDASP_OFFSET))
390
391#define MMDC_MAARCR ((MMDC_REGS_BASE + MMDC_MAARCR_OFFSET))
392#define MMDC_MAPSR ((MMDC_REGS_BASE + MMDC_MAPSR_OFFSET))
393#define MMDC_MAEXIDR0 ((MMDC_REGS_BASE + MMDC_MAEXIDR0_OFFSET))
394#define MMDC_MAEXIDR1 ((MMDC_REGS_BASE + MMDC_MAEXIDR1_OFFSET))
395#define MMDC_MADPCR0 ((MMDC_REGS_BASE + MMDC_MADPCR0_OFFSET))
396#define MMDC_MADPCR1 ((MMDC_REGS_BASE + MMDC_MADPCR1_OFFSET))
397#define MMDC_MADPSR0 ((MMDC_REGS_BASE + MMDC_MADPSR0_OFFSET))
398#define MMDC_MADPSR1 ((MMDC_REGS_BASE + MMDC_MADPSR1_OFFSET))
399#define MMDC_MADPSR2 ((MMDC_REGS_BASE + MMDC_MADPSR2_OFFSET))
400#define MMDC_MADPSR3 ((MMDC_REGS_BASE + MMDC_MADPSR3_OFFSET))
401#define MMDC_MADPSR4 ((MMDC_REGS_BASE + MMDC_MADPSR4_OFFSET))
402#define MMDC_MADPSR5 ((MMDC_REGS_BASE + MMDC_MADPSR5_OFFSET))
403#define MMDC_MASBS0 ((MMDC_REGS_BASE + MMDC_MASBS0_OFFSET))
404#define MMDC_MASBS1 ((MMDC_REGS_BASE + MMDC_MASBS1_OFFSET))
405#define MMDC_MAGENP ((MMDC_REGS_BASE + MMDC_MAGENP_OFFSET))
406
407#define MMDC_MPZQHWCTRL ((MMDC_REGS_BASE + MMDC_MPZQHWCTRL_OFFSET))
408#define MMDC_MPZQSWCTRL ((MMDC_REGS_BASE + MMDC_MPZQSWCTRL_OFFSET))
409#define MMDC_MPWLGCR ((MMDC_REGS_BASE + MMDC_MPWLGCR_OFFSET))
410#define MMDC_MPWLDECTRL0 ((MMDC_REGS_BASE + MMDC_MPWLDECTRL0_OFFSET))
411#define MMDC_MPWLDECTRL1 ((MMDC_REGS_BASE + MMDC_MPWLDECTRL1_OFFSET))
412#define MMDC_MPWLDLST ((MMDC_REGS_BASE + MMDC_MPWLDLST_OFFSET))
413#define MMDC_MPODTCTRL ((MMDC_REGS_BASE + MMDC_MPODTCTRL_OFFSET))
414#define MMDC_MPREDQBY0DL ((MMDC_REGS_BASE + MMDC_MPREDQBY0DL_OFFSET))
415#define MMDC_MPREDQBY1DL ((MMDC_REGS_BASE + MMDC_MPREDQBY1DL_OFFSET))
416#define MMDC_MPREDQBY2DL ((MMDC_REGS_BASE + MMDC_MPREDQBY2DL_OFFSET))
417#define MMDC_MPREDQBY3DL ((MMDC_REGS_BASE + MMDC_MPREDQBY3DL_OFFSET))
418#define MMDC_MPWRDQBY0DL ((MMDC_REGS_BASE + MMDC_MPWRDQBY0DL_OFFSET))
419#define MMDC_MPWRDQBY1DL ((MMDC_REGS_BASE + MMDC_MPWRDQBY1DL_OFFSET))
420#define MMDC_MPWRDQBY2DL ((MMDC_REGS_BASE + MMDC_MPWRDQBY2DL_OFFSET))
421#define MMDC_MPWRDQBY3DL ((MMDC_REGS_BASE + MMDC_MPWRDQBY3DL_OFFSET))
422#define MMDC_MPDGCTRL0 ((MMDC_REGS_BASE + MMDC_MPDGCTRL0_OFFSET))
423#define MMDC_MPDGCTRL1 ((MMDC_REGS_BASE + MMDC_MPDGCTRL1_OFFSET))
424#define MMDC_MPDGDLST ((MMDC_REGS_BASE + MMDC_MPDGDLST_OFFSET))
425#define MMDC_MPRDDLCTL ((MMDC_REGS_BASE + MMDC_MPRDDLCTL_OFFSET))
426#define MMDC_MPRDDLST ((MMDC_REGS_BASE + MMDC_MPRDDLST_OFFSET))
427#define MMDC_MPWRDLCTL ((MMDC_REGS_BASE + MMDC_MPWRDLCTL_OFFSET))
428#define MMDC_MPWRDLST ((MMDC_REGS_BASE + MMDC_MPWRDLST_OFFSET))
429#define MMDC_MPSDCTRL ((MMDC_REGS_BASE + MMDC_MPSDCTRL_OFFSET))
430#define MMDC_MPZQLP2CTL ((MMDC_REGS_BASE + MMDC_MPZQLP2CTL_OFFSET))
431#define MMDC_MPRDDLHWCTL ((MMDC_REGS_BASE + MMDC_MPRDDLHWCTL_OFFSET))
432#define MMDC_MPWRDLHWCTL ((MMDC_REGS_BASE + MMDC_MPWRDLHWCTL_OFFSET))
433#define MMDC_MPRDDLHWST0 ((MMDC_REGS_BASE + MMDC_MPRDDLHWST0_OFFSET))
434#define MMDC_MPRDDLHWST1 ((MMDC_REGS_BASE + MMDC_MPRDDLHWST1_OFFSET))
435#define MMDC_MPWRDLHWST0 ((MMDC_REGS_BASE + MMDC_MPWRDLHWST0_OFFSET))
436#define MMDC_MPWRDLHWST1 ((MMDC_REGS_BASE + MMDC_MPWRDLHWST1_OFFSET))
437#define MMDC_MPWLHWERR ((MMDC_REGS_BASE + MMDC_MPWLHWERR_OFFSET))
438#define MMDC_MPDGHWST0 ((MMDC_REGS_BASE + MMDC_MPDGHWST0_OFFSET))
439#define MMDC_MPDGHWST1 ((MMDC_REGS_BASE + MMDC_MPDGHWST1_OFFSET))
440#define MMDC_MPDGHWST2 ((MMDC_REGS_BASE + MMDC_MPDGHWST2_OFFSET))
441#define MMDC_MPDGHWST3 ((MMDC_REGS_BASE + MMDC_MPDGHWST3_OFFSET))
442#define MMDC_MPPDCMPR1 ((MMDC_REGS_BASE + MMDC_MPPDCMPR1_OFFSET))
443#define MMDC_MPPDCMPR2 ((MMDC_REGS_BASE + MMDC_MPPDCMPR2_OFFSET))
444#define MMDC_MPSWDAR ((MMDC_REGS_BASE + MMDC_MPSWDAR_OFFSET))
445#define MMDC_MPSWDRDR0 ((MMDC_REGS_BASE + MMDC_MPSWDRDR0_OFFSET))
446#define MMDC_MPSWDRDR1 ((MMDC_REGS_BASE + MMDC_MPSWDRDR1_OFFSET))
447#define MMDC_MPSWDRDR2 ((MMDC_REGS_BASE + MMDC_MPSWDRDR2_OFFSET))
448#define MMDC_MPSWDRDR3 ((MMDC_REGS_BASE + MMDC_MPSWDRDR3_OFFSET))
449#define MMDC_MPSWDRDR4 ((MMDC_REGS_BASE + MMDC_MPSWDRDR4_OFFSET))
450#define MMDC_MPSWDRDR5 ((MMDC_REGS_BASE + MMDC_MPSWDRDR5_OFFSET))
451#define MMDC_MPSWDRDR6 ((MMDC_REGS_BASE + MMDC_MPSWDRDR6_OFFSET))
452#define MMDC_MPSWDRDR7 ((MMDC_REGS_BASE + MMDC_MPSWDRDR7_OFFSET))
453#define MMDC_MPMUR ((MMDC_REGS_BASE + MMDC_MPMUR_OFFSET))
454#define MMDC_MPWRCADL ((MMDC_REGS_BASE + MMDC_MPWRCADL_OFFSET))
455#define MMDC_MPDCCR ((MMDC_REGS_BASE + MMDC_MPDCCR_OFFSET))
456#define MMDC_MPBC ((MMDC_REGS_BASE + MMDC_MPBC_OFFSET))
457#define MMDC_MPSWDRAR ((MMDC_REGS_BASE + MMDC_MPSWDRAR_OFFSET))
458
459/* MMDC registers bit defines */
460#define MMDC_MDCTL_SDE_0 (31)
461#define MMDC_MDCTL_SDE_1 (30)
462#define MMDC_MDCTL_ROW (24)
463#define MMDC_MDCTL_COL (20)
464#define MMDC_MDCTL_BL (19)
465#define MMDC_MDCTL_DSIZ (16)
466
467/* MDMISC */
468#define MMDC_MDMISC_CS0_RDY (31)
469#define MMDC_MDMISC_CS1_RDY (30)
470#define MMDC_MDMISC_CK1_DEL (22)
471#define MMDC_MDMISC_CK1_GATING (21)
472#define MMDC_MDMISC_CALIB_PER_CS (20)
473#define MMDC_MDMISC_ADDR_MIRROR (19)
474#define MMDC_MDMISC_LHD (18)
475#define MMDC_MDMISC_WALAT (16)
476#define MMDC_MDMISC_BI (12)
477#define MMDC_MDMISC_LPDDR2_S (11)
478#define MMDC_MDMISC_MIF3_MODE (9)
479#define MMDC_MDMISC_RALAT (6)
480#define MMDC_MDMISC_DDR_4_BANK (5)
481#define MMDC_MDMISC_DDR_TYPE (3)
482#define MMDC_MDMISC_RST (1)
483
484/* MPWLGCR */
485#define MMDC_MPWLGCR_WL_HW_ERR (8)
486
487/* MDSCR */
488#define MMDC_MDSCR_CMD_ADDR_MSB (24)
489#define MMDC_MDSCR_MR_OP (24)
490#define MMDC_MDSCR_CMD_ADDR_LSB (16)
491#define MMDC_MDSCR_MR_ADDR (16)
492#define MMDC_MDSCR_CON_REQ (15)
493#define MMDC_MDSCR_CON_ACK (14)
494#define MMDC_MDSCR_MRR_READ_DATA_VALID (10)
495#define MMDC_MDSCR_WL_EN (9)
496#define MMDC_MDSCR_CMD (4)
497#define MMDC_MDSCR_CMD_CS (3)
498#define MMDC_MDSCR_CMD_BA (0)
499
500/* MPZQHWCTRL */
501#define MMDC_MPZQHWCTRL_ZQ_HW_FOR (16)
502#define MMDC_MPZQHWCTRL_ZQ_MODE (0)
503
504/* MPZQSWCTRL */
505#define MMDC_MPZQSWCTRL_ZQ_CMP_OUT_SMP (16)
506#define MMDC_MPZQSWCTRL_USE_ZQ_SW_VAL (13)
507#define MMDC_MPZQSWCTRL_ZQ_SW_PD (12)
508#define MMDC_MPZQSWCTRL_ZQ_SW_PD_VAL (7)
509#define MMDC_MPZQSWCTRL_ZQ_SW_PU_VAL (2)
510#define MMDC_MPZQSWCTRL_ZQ_SW_RES (1)
511#define MMDC_MPZQSWCTRL_ZQ_SW_FOR (0)
512
513/* MPDGCTRL0 */
514#define MMDC_MPDGCTRL0_RST_RD_FIFO (31)
515#define MMDC_MPDGCTRL0_DG_CMP_CYC (30)
516#define MMDC_MPDGCTRL0_DG_DIS (29)
517#define MMDC_MPDGCTRL0_HW_DG_EN (28)
518#define MMDC_MPDGCTRL0_HW_DG_ERR (12)
519
520/* MPRDDLHWCTL */
521#define MMDC_MPRDDLHWCTL_HW_RD_DL_CMP_CYC (5)
522#define MMDC_MPRDDLHWCTL_HW_RD_DL_EN (4)
523#define MMDC_MPRDDLHWCTL_HW_RD_DL_ERR (0)
524
525/* MPWRDLHWCTL */
526#define MMDC_MPWRDLHWCTL_HW_WR_DL_CMP_CYC (5)
527#define MMDC_MPWRDLHWCTL_HW_WR_DL_EN (4)
528#define MMDC_MPWRDLHWCTL_HW_WR_DL_ERR (0)
529
530/* MPSWDAR */
531#define MMDC_MPSWDAR_TEST_DUMMY_EN (6)
532#define MMDC_MPSWDAR_SW_DUM_CMP3 (5)
533#define MMDC_MPSWDAR_SW_DUM_CMP2 (4)
534#define MMDC_MPSWDAR_SW_DUM_CMP1 (3)
535#define MMDC_MPSWDAR_SW_DUM_CMP0 (2)
536#define MMDC_MPSWDAR_SW_DUMMY_RD (1)
537#define MMDC_MPSWDAR_SW_DUMMY_WR (0)
538
539/* MADPCR0 */
540#define MMDC_MADPCR0_SBS (9)
541#define MMDC_MADPCR0_SBS_EN (8)
542
543/* MASBS1 */
544#define MMDC_MASBS1_SBS_VLD (0)
545#define MMDC_MASBS1_SBS_TYPE (1)
546
547/* MDREF */
548#define MMDC_MDREF_REF_CNT (16)
549#define MMDC_MDREF_REF_SEL (14)
550#define MMDC_MDREF_REFR (11)
551#define MMDC_MDREF_START_REF (0)
552
553/* MPWLGCR */
554#define MMDC_MPWLGCR_HW_WL_EN (0)
555
556/* MPBC */
557#define MMDC_MPBC_BIST_DM_LP_EN (0)
558#define MMDC_MPBC_BIST_CA0_LP_EN (1)
559#define MMDC_MPBC_BIST_DQ0_LP_EN (3)
560#define MMDC_MPBC_BIST_DQ1_LP_EN (4)
561#define MMDC_MPBC_BIST_DQ2_LP_EN (5)
562#define MMDC_MPBC_BIST_DQ3_LP_EN (6)
563
564/* MPMUR */
565#define MMDC_MPMUR_FRC_MSR (11)
566
567/* MPODTCTRL */
568#define MMDC_MPODTCTRL_ODT_RD_ACT_EN (3)
569#define MMDC_MPODTCTRL_ODT_RD_PAS_EN (2)
570#define MMDC_MPODTCTRL_ODT_WR_ACT_EN (1)
571#define MMDC_MPODTCTRL_ODT_WR_PAS_EN (0)
572
573/* MAPSR */
574#define MMDC_MAPSR_DVACK (25)
575#define MMDC_MAPSR_LPACK (24)
576#define MMDC_MAPSR_DVFS (21)
577#define MMDC_MAPSR_LPMD (20)
578
579/* MAARCR */
580#define MMDC_MAARCR_ARCR_EXC_ERR_EN (28)
581
582/* MPZQLP2CTL */
583#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCS (24)
584#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCL (16)
585#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQINIT (0)
586
587/* MDCFG3LP */
588#define MMDC_MDCFG3LP_tRC_LP (16)
589#define MMDC_MDCFG3LP_tRCD_LP (8)
590#define MMDC_MDCFG3LP_tRPpb_LP (4)
591#define MMDC_MDCFG3LP_tRPab_LP (0)
592
593/* MDOR */
594#define MMDC_MDOR_tXPR (16)
595#define MMDC_MDOR_SDE_to_RST (8)
596#define MMDC_MDOR_RST_to_CKE (0)
597
598/* MDCFG0 */
599#define MMDC_MDCFG0_tRFC (24)
600#define MMDC_MDCFG0_tXS (16)
601#define MMDC_MDCFG0_tXP (13)
602#define MMDC_MDCFG0_tXPDLL (9)
603#define MMDC_MDCFG0_tFAW (4)
604#define MMDC_MDCFG0_tCL (0)
605
606/* MDCFG1 */
607#define MMDC_MDCFG1_tRCD (29)
608#define MMDC_MDCFG1_tRP (26)
609#define MMDC_MDCFG1_tRC (21)
610#define MMDC_MDCFG1_tRAS (16)
611#define MMDC_MDCFG1_tRPA (15)
612#define MMDC_MDCFG1_tWR (9)
613#define MMDC_MDCFG1_tMRD (5)
614#define MMDC_MDCFG1_tCWL (0)
615
616/* MDCFG2 */
617#define MMDC_MDCFG2_tDLLK (16)
618#define MMDC_MDCFG2_tRTP (6)
619#define MMDC_MDCFG2_tWTR (3)
620#define MMDC_MDCFG2_tRRD (0)
621
622/* MDRWD */
623#define MMDC_MDRWD_tDAI (16)
624#define MMDC_MDRWD_RTW_SAME (12)
625#define MMDC_MDRWD_WTR_DIFF (9)
626#define MMDC_MDRWD_WTW_DIFF (6)
627#define MMDC_MDRWD_RTW_DIFF (3)
628#define MMDC_MDRWD_RTR_DIFF (0)
629
630/* MDPDC */
631#define MMDC_MDPDC_PRCT_1 (28)
632#define MMDC_MDPDC_PRCT_0 (24)
633#define MMDC_MDPDC_tCKE (16)
634#define MMDC_MDPDC_PWDT_1 (12)
635#define MMDC_MDPDC_PWDT_0 (8)
636#define MMDC_MDPDC_SLOW_PD (7)
637#define MMDC_MDPDC_BOTH_CS_PD (6)
638#define MMDC_MDPDC_tCKSRX (3)
639#define MMDC_MDPDC_tCKSRE (0)
640
641/* MDASP */
642#define MMDC_MDASP_CS0_END (0)
643
644/* MAEXIDR0 */
645#define MMDC_MAEXIDR0_EXC_ID_MONITOR1 (16)
646#define MMDC_MAEXIDR0_EXC_ID_MONITOR0 (0)
647
648/* MAEXIDR1 */
649#define MMDC_MAEXIDR1_EXC_ID_MONITOR3 (16)
650#define MMDC_MAEXIDR1_EXC_ID_MONITOR2 (0)
651
652/* MPWRDLCTL */
653#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET3 (24)
654#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET2 (16)
655#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET1 (8)
656#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET0 (0)
657
658/* MPRDDLCTL */
659#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET3 (24)
660#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET2 (16)
661#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET1 (8)
662#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET0 (0)
663
664/* MPWRDQBY0DL */
665#define MMDC_MPWRDQBY0DL_WR_DM0_DEL (30)
666#define MMDC_MPWRDQBY0DL_WR_DQ7_DEL (28)
667#define MMDC_MPWRDQBY0DL_WR_DQ6_DEL (24)
668#define MMDC_MPWRDQBY0DL_WR_DQ5_DEL (20)
669#define MMDC_MPWRDQBY0DL_WR_DQ4_DEL (16)
670#define MMDC_MPWRDQBY0DL_WR_DQ3_DEL (12)
671#define MMDC_MPWRDQBY0DL_WR_DQ2_DEL (8)
672#define MMDC_MPWRDQBY0DL_WR_DQ1_DEL (4)
673#define MMDC_MPWRDQBY0DL_WR_DQ0_DEL (0)
674
675/* MPWRDQBY1DL */
676#define MMDC_MPWRDQBY1DL_WR_DM1_DEL (30)
677#define MMDC_MPWRDQBY1DL_WR_DQ15_DEL (28)
678#define MMDC_MPWRDQBY1DL_WR_DQ14_DEL (24)
679#define MMDC_MPWRDQBY1DL_WR_DQ13_DEL (20)
680#define MMDC_MPWRDQBY1DL_WR_DQ12_DEL (16)
681#define MMDC_MPWRDQBY1DL_WR_DQ11_DEL (12)
682#define MMDC_MPWRDQBY1DL_WR_DQ10_DEL (8)
683#define MMDC_MPWRDQBY1DL_WR_DQ9_DEL (4)
684#define MMDC_MPWRDQBY1DL_WR_DQ8_DEL (0)
685
686/* MPWRDQBY2DL */
687#define MMDC_MPWRDQBY2DL_WR_DM2_DEL (30)
688#define MMDC_MPWRDQBY2DL_WR_DQ23_DEL (28)
689#define MMDC_MPWRDQBY2DL_WR_DQ22_DEL (24)
690#define MMDC_MPWRDQBY2DL_WR_DQ21_DEL (20)
691#define MMDC_MPWRDQBY2DL_WR_DQ20_DEL (16)
692#define MMDC_MPWRDQBY2DL_WR_DQ19_DEL (12)
693#define MMDC_MPWRDQBY2DL_WR_DQ18_DEL (8)
694#define MMDC_MPWRDQBY2DL_WR_DQ17_DEL (4)
695#define MMDC_MPWRDQBY2DL_WR_DQ16_DEL (0)
696
697/* MPWRDQBY3DL */
698#define MMDC_MPWRDQBY3DL_WR_DM3_DEL (30)
699#define MMDC_MPWRDQBY3DL_WR_DQ31_DEL (28)
700#define MMDC_MPWRDQBY3DL_WR_DQ30_DEL (24)
701#define MMDC_MPWRDQBY3DL_WR_DQ29_DEL (20)
702#define MMDC_MPWRDQBY3DL_WR_DQ28_DEL (16)
703#define MMDC_MPWRDQBY3DL_WR_DQ27_DEL (12)
704#define MMDC_MPWRDQBY3DL_WR_DQ26_DEL (8)
705#define MMDC_MPWRDQBY3DL_WR_DQ25_DEL (4)
706#define MMDC_MPWRDQBY3DL_WR_DQ24_DEL (0)
707
708/* Fields masks */
709#define MMDC_MDCTL_SDE_0_MASK ((0x1 << MMDC_MDCTL_SDE_0))
710#define MMDC_MDCTL_SDE_1_MASK ((0x1 << MMDC_MDCTL_SDE_1))
711#define MMDC_MDCTL_BL_MASK ((0x1 << MMDC_MDCTL_BL))
712#define MMDC_MDCTL_ROW_MASK ((0x7 << MMDC_MDCTL_ROW))
713#define MMDC_MDCTL_COL_MASK ((0x7 << MMDC_MDCTL_COL))
714#define MMDC_MDCTL_DSIZ_MASK ((0x3 << MMDC_MDCTL_DSIZ))
715
716/* MDMISC */
717#define MMDC_MDMISC_CS0_RDY_MASK ((0x1 << MMDC_MDMISC_CS0_RDY))
718#define MMDC_MDMISC_CS1_RDY_MASK ((0x1 << MMDC_MDMISC_CS1_RDY))
719#define MMDC_MDMISC_CK1_DEL_MASK ((0x3 << MMDC_MDMISC_CK1_DEL))
720#define MMDC_MDMISC_CK1_GATING_MASK ((0x1 << MMDC_MDMISC_CK1_GATING))
721#define MMDC_MDMISC_CALIB_PER_CS_MASK ((0x1 << MMDC_MDMISC_CALIB_PER_CS))
722#define MMDC_MDMISC_ADDR_MIRROR_MASK ((0x1 << MMDC_MDMISC_ADDR_MIRROR))
723#define MMDC_MDMISC_LHD_MASK ((0x1 << MMDC_MDMISC_LHD))
724#define MMDC_MDMISC_WALAT_MASK ((0x3 << MMDC_MDMISC_WALAT))
725#define MMDC_MDMISC_BI_MASK ((0x1 << MMDC_MDMISC_BI))
726#define MMDC_MDMISC_LPDDR2_S_MASK ((0x1 << MMDC_MDMISC_LPDDR2_S))
727#define MMDC_MDMISC_MIF3_MODE_MASK ((0x3 << MMDC_MDMISC_MIF3_MODE))
728#define MMDC_MDMISC_RALAT_MASK ((0x7 << MMDC_MDMISC_RALAT))
729#define MMDC_MDMISC_DDR_4_BANK_MASK ((0x1 << MMDC_MDMISC_DDR_4_BANK))
730#define MMDC_MDMISC_DDR_TYPE_MASK ((0x3 << MMDC_MDMISC_DDR_TYPE))
731#define MMDC_MDMISC_RST_MASK ((0x1 << MMDC_MDMISC_RST))
732
733/* MPWLGCR */
734#define MMDC_MPWLGCR_WL_HW_ERR_MASK ((0xf << MMDC_MPWLGCR_WL_HW_ERR))
735
736/* MDSCR */
737#define MMDC_MDSCR_CMD_ADDR_MSB_MASK ((0xff << MMDC_MDSCR_CMD_ADDR_MSB))
738#define MMDC_MDSCR_MR_OP_MASK ((0xff << MMDC_MDSCR_MR_OP))
739#define MMDC_MDSCR_CMD_ADDR_LSB_MASK ((0xff << MMDC_MDSCR_CMD_ADDR_LSB))
740#define MMDC_MDSCR_MR_ADDR_MASK ((0xff << MMDC_MDSCR_MR_ADDR))
741#define MMDC_MDSCR_CON_REQ_MASK ((0x1 << MMDC_MDSCR_CON_REQ))
742#define MMDC_MDSCR_CON_ACK_MASK ((0x1 << MMDC_MDSCR_CON_ACK))
743#define MMDC_MDSCR_MRR_READ_DATA_VALID_MASK ((0x1 << MMDC_MDSCR_MRR_READ_DATA_VALID))
744#define MMDC_MDSCR_WL_EN_MASK ((0x1 << MMDC_MDSCR_WL_EN))
745#define MMDC_MDSCR_CMD_MASK ((0x7 << MMDC_MDSCR_CMD))
746#define MMDC_MDSCR_CMD_CS_MASK ((0x1 << MMDC_MDSCR_CMD_CS))
747#define MMDC_MDSCR_CMD_BA_MASK ((0x7 << MMDC_MDSCR_CMD_BA))
748
749/* MPZQHWCTRL */
750#define MMDC_MPZQHWCTRL_ZQ_HW_FOR_MASK ((0x1 << MMDC_MPZQHWCTRL_ZQ_HW_FOR))
751#define MMDC_MPZQHWCTRL_ZQ_MODE_MASK ((0x3 << MMDC_MPZQHWCTRL_ZQ_MODE))
752
753/* MPZQSWCTRL */
754#define MMDC_MPZQSWCTRL_ZQ_CMP_OUT_SMP_MASK ((0x3 << MMDC_MPZQSWCTRL_ZQ_CMP_OUT_SMP))
755#define MMDC_MPZQSWCTRL_USE_ZQ_SW_VAL_MASK ((0x1 << MMDC_MPZQSWCTRL_USE_ZQ_SW_VAL))
756#define MMDC_MPZQSWCTRL_ZQ_SW_PD_MASK ((0x1 << MMDC_MPZQSWCTRL_ZQ_SW_PD))
757#define MMDC_MPZQSWCTRL_ZQ_SW_PD_VAL_MASK ((0x1f << MMDC_MPZQSWCTRL_ZQ_SW_PD_VAL))
758#define MMDC_MPZQSWCTRL_ZQ_SW_PU_VAL_MASK ((0x1f << MMDC_MPZQSWCTRL_ZQ_SW_PU_VAL))
759#define MMDC_MPZQSWCTRL_ZQ_SW_RES_MASK ((0x1 << MMDC_MPZQSWCTRL_ZQ_SW_RES))
760#define MMDC_MPZQSWCTRL_ZQ_SW_FOR_MASK ((0x1 << MMDC_MPZQSWCTRL_ZQ_SW_FOR))
761
762/* MPDGCTRL0 */
763#define MMDC_MPDGCTRL0_RST_RD_FIFO_MASK ((0x1 << MMDC_MPDGCTRL0_RST_RD_FIFO))
764#define MMDC_MPDGCTRL0_DG_CMP_CYC_MASK ((0x1 << MMDC_MPDGCTRL0_DG_CMP_CYC))
765#define MMDC_MPDGCTRL0_DG_DIS_MASK ((0x1 << MMDC_MPDGCTRL0_DG_DIS))
766#define MMDC_MPDGCTRL0_HW_DG_EN_MASK ((0x1 << MMDC_MPDGCTRL0_HW_DG_EN))
767#define MMDC_MPDGCTRL0_HW_DG_ERR_MASK ((0x1 << MMDC_MPDGCTRL0_HW_DG_ERR))
768
769/* MPRDDLHWCTL */
770#define MMDC_MPRDDLHWCTL_HW_RD_DL_CMP_CYC_MASK ((0x1 << MMDC_MPRDDLHWCTL_HW_RD_DL_CMP_CYC))
771#define MMDC_MPRDDLHWCTL_HW_RD_DL_EN_MASK ((0x1 << MMDC_MPRDDLHWCTL_HW_RD_DL_EN))
772#define MMDC_MPRDDLHWCTL_HW_RD_DL_ERR_MASK ((0xf << MMDC_MPRDDLHWCTL_HW_RD_DL_ERR))
773
774/* MPWRDLHWCTL */
775#define MMDC_MPWRDLHWCTL_HW_WR_DL_CMP_CYC_MASK ((0x1 << MMDC_MPWRDLHWCTL_HW_WR_DL_CMP_CYC))
776#define MMDC_MPWRDLHWCTL_HW_WR_DL_EN_MASK ((0x1 << MMDC_MPWRDLHWCTL_HW_WR_DL_EN))
777#define MMDC_MPWRDLHWCTL_HW_WR_DL_ERR_MASK ((0xf << MMDC_MPWRDLHWCTL_HW_WR_DL_ERR))
778
779/* MPSWDAR */
780#define MMDC_MPSWDAR_TEST_DUMMY_EN_MASK ((0x1 << MMDC_MPSWDAR_TEST_DUMMY_EN))
781#define MMDC_MPSWDAR_SW_DUM_CMP3_MASK ((0x1 << MMDC_MPSWDAR_SW_DUM_CMP3))
782#define MMDC_MPSWDAR_SW_DUM_CMP2_MASK ((0x1 << MMDC_MPSWDAR_SW_DUM_CMP2))
783#define MMDC_MPSWDAR_SW_DUM_CMP1_MASK ((0x1 << MMDC_MPSWDAR_SW_DUM_CMP1))
784#define MMDC_MPSWDAR_SW_DUM_CMP0_MASK ((0x1 << MMDC_MPSWDAR_SW_DUM_CMP0))
785#define MMDC_MPSWDAR_SW_DUMMY_RD_MASK ((0x1 << MMDC_MPSWDAR_SW_DUMMY_RD))
786#define MMDC_MPSWDAR_SW_DUMMY_WR_MASK ((0x1 << MMDC_MPSWDAR_SW_DUMMY_WR))
787
788/* MADPCR0 */
789#define MMDC_MADPCR0_SBS_MASK ((0x1 << MMDC_MADPCR0_SBS))
790#define MMDC_MADPCR0_SBS_EN_MASK ((0x1 << MMDC_MADPCR0_SBS_EN))
791
792/* MASBS1 */
793#define MMDC_MASBS1_SBS_VLD_MASK ((0x1 << MMDC_MASBS1_SBS_VLD))
794#define MMDC_MASBS1_SBS_TYPE_MASK ((0x1 << MMDC_MASBS1_SBS_TYPE))
795
796/* MDREF */
797#define MMDC_MDREF_REF_CNT_MASK ((0xffff << MMDC_MDREF_REF_CNT))
798#define MMDC_MDREF_REF_SEL_MASK ((0x3 << MMDC_MDREF_REF_SEL))
799#define MMDC_MDREF_REFR_MASK ((0x7 << MMDC_MDREF_REFR))
800#define MMDC_MDREF_START_REF_MASK ((0x1 << MMDC_MDREF_START_REF))
801
802/* MPWLGCR */
803#define MMDC_MPWLGCR_HW_WL_EN_MASK ((0x1 << MMDC_MPWLGCR_HW_WL_EN))
804
805/* MPBC */
806#define MMDC_MPBC_BIST_DM_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_DM_LP_EN))
807#define MMDC_MPBC_BIST_CA0_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_CA0_LP_EN))
808#define MMDC_MPBC_BIST_DQ0_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_DQ0_LP_EN))
809#define MMDC_MPBC_BIST_DQ1_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_DQ1_LP_EN))
810#define MMDC_MPBC_BIST_DQ2_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_DQ2_LP_EN))
811#define MMDC_MPBC_BIST_DQ3_LP_EN_MASK ((0x1 << MMDC_MPBC_BIST_DQ3_LP_EN))
812#define MMDC_MPBC_BIST_DQ_LP_EN_MASK ((0xf << MMDC_MPBC_BIST_DQ0_LP_EN))
813
814/* MPMUR */
815#define MMDC_MPMUR_FRC_MSR_MASK ((0x1 << MMDC_MPMUR_FRC_MSR))
816
817/* MPODTCTRL */
818#define MMDC_MPODTCTRL_ODT_RD_ACT_EN_MASK ((0x1 << MMDC_MPODTCTRL_ODT_RD_ACT_EN))
819#define MMDC_MPODTCTRL_ODT_RD_PAS_EN_MASK ((0x1 << MMDC_MPODTCTRL_ODT_RD_PAS_EN))
820#define MMDC_MPODTCTRL_ODT_WR_ACT_EN_MASK ((0x1 << MMDC_MPODTCTRL_ODT_WR_ACT_EN))
821#define MMDC_MPODTCTRL_ODT_WR_PAS_EN_MASK ((0x1 << MMDC_MPODTCTRL_ODT_WR_PAS_EN))
822
823/* MAPSR */
824#define MMDC_MAPSR_DVACK_MASK ((0x1 << MMDC_MAPSR_DVACK))
825#define MMDC_MAPSR_LPACK_MASK ((0x1 << MMDC_MAPSR_LPACK))
826#define MMDC_MAPSR_DVFS_MASK ((0x1 << MMDC_MAPSR_DVFS))
827#define MMDC_MAPSR_LPMD_MASK ((0x1 << MMDC_MAPSR_LPMD))
828
829/* MAARCR */
830#define MMDC_MAARCR_ARCR_EXC_ERR_EN_MASK ((0x1 << MMDC_MAARCR_ARCR_EXC_ERR_EN))
831
832/* MPZQLP2CTL */
833#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCS_MASK ((0x7f << MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCS))
834#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCL_MASK ((0xff << MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQCL))
835#define MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQINIT_MASK ((0x1ff << MMDC_MPZQLP2CTL_ZQ_LP2_HW_ZQINIT))
836
837/* MDCFG3LP */
838#define MMDC_MDCFG3LP_tRC_LP_MASK ((0x3f << MMDC_MDCFG3LP_tRC_LP))
839#define MMDC_MDCFG3LP_tRCD_LP_MASK ((0xf << MMDC_MDCFG3LP_tRCD_LP))
840#define MMDC_MDCFG3LP_tRPpb_LP_MASK ((0xf << MMDC_MDCFG3LP_tRPpb_LP))
841#define MMDC_MDCFG3LP_tRPab_LP_MASK ((0xf << MMDC_MDCFG3LP_tRPab_LP))
842
843/* MDOR */
844#define MMDC_MDOR_tXPR_MASK ((0xff << MMDC_MDOR_tXPR))
845#define MMDC_MDOR_SDE_to_RST_MASK ((0x3f << MMDC_MDOR_SDE_to_RST))
846#define MMDC_MDOR_RST_to_CKE_MASK ((0x3f << MMDC_MDOR_RST_to_CKE))
847
848/* MDCFG0 */
849#define MMDC_MDCFG0_tRFC_MASK ((0xff << MMDC_MDCFG0_tRFC))
850#define MMDC_MDCFG0_tXS_MASK ((0xff << MMDC_MDCFG0_tXS))
851#define MMDC_MDCFG0_tXP_MASK ((0x7 << MMDC_MDCFG0_tXP))
852#define MMDC_MDCFG0_tXPDLL_MASK ((0xf << MMDC_MDCFG0_tXPDLL))
853#define MMDC_MDCFG0_tFAW_MASK ((0x1f << MMDC_MDCFG0_tFAW))
854#define MMDC_MDCFG0_tCL_MASK ((0xf << MMDC_MDCFG0_tCL))
855
856/* MDCFG1 */
857#define MMDC_MDCFG1_tRCD_MASK ((0x7 << MMDC_MDCFG1_tRCD))
858#define MMDC_MDCFG1_tRP_MASK ((0x7 << MMDC_MDCFG1_tRP))
859#define MMDC_MDCFG1_tRC_MASK ((0x1f << MMDC_MDCFG1_tRC))
860#define MMDC_MDCFG1_tRAS_MASK ((0x1f << MMDC_MDCFG1_tRAS))
861#define MMDC_MDCFG1_tRPA_MASK ((0x1 << MMDC_MDCFG1_tRPA))
862#define MMDC_MDCFG1_tWR_MASK ((0x7 << MMDC_MDCFG1_tWR))
863#define MMDC_MDCFG1_tMRD_MASK ((0xf << MMDC_MDCFG1_tMRD))
864#define MMDC_MDCFG1_tCWL_MASK ((0x7 << MMDC_MDCFG1_tCWL))
865
866/* MDCFG2 */
867#define MMDC_MDCFG2_tDLLK_MASK ((0x1ff << MMDC_MDCFG2_tDLLK))
868#define MMDC_MDCFG2_tRTP_MASK ((0x7 << MMDC_MDCFG2_tRTP))
869#define MMDC_MDCFG2_tWTR_MASK ((0x7 << MMDC_MDCFG2_tWTR))
870#define MMDC_MDCFG2_tRRD_MASK ((0x7 << MMDC_MDCFG2_tRRD))
871
872/* MDRWD */
873#define MMDC_MDRWD_tDAI_MASK ((0x1fff << MMDC_MDRWD_tDAI))
874#define MMDC_MDRWD_RTW_SAME_MASK ((0x7 << MMDC_MDRWD_RTW_SAME))
875#define MMDC_MDRWD_WTR_DIFF_MASK ((0x7 << MMDC_MDRWD_WTR_DIFF))
876#define MMDC_MDRWD_WTW_DIFF_MASK ((0x7 << MMDC_MDRWD_WTW_DIFF))
877#define MMDC_MDRWD_RTW_DIFF_MASK ((0x7 << MMDC_MDRWD_RTW_DIFF))
878#define MMDC_MDRWD_RTR_DIFF_MASK ((0x7 << MMDC_MDRWD_RTR_DIFF))
879
880/* MDPDC */
881#define MMDC_MDPDC_PRCT_1_MASK ((0x7 << MMDC_MDPDC_PRCT_1))
882#define MMDC_MDPDC_PRCT_0_MASK ((0x7 << MMDC_MDPDC_PRCT_0))
883#define MMDC_MDPDC_tCKE_MASK ((0x7 << MMDC_MDPDC_tCKE))
884#define MMDC_MDPDC_PWDT_1_MASK ((0xf << MMDC_MDPDC_PWDT_1))
885#define MMDC_MDPDC_PWDT_0_MASK ((0xf << MMDC_MDPDC_PWDT_0))
886#define MMDC_MDPDC_SLOW_PD_MASK ((0x1 << MMDC_MDPDC_SLOW_PD))
887#define MMDC_MDPDC_BOTH_CS_PD_MASK ((0x1 << MMDC_MDPDC_BOTH_CS_PD))
888#define MMDC_MDPDC_tCKSRX_MASK ((0x7 << MMDC_MDPDC_tCKSRX))
889#define MMDC_MDPDC_tCKSRE_MASK ((0x7 << MMDC_MDPDC_tCKSRE))
890
891/* MDASP */
892#define MMDC_MDASP_CS0_END_MASK ((0x7f << MMDC_MDASP_CS0_END))
893
894/* MAEXIDR0 */
895#define MMDC_MAEXIDR0_EXC_ID_MONITOR1_MASK ((0xffff << MMDC_MAEXIDR0_EXC_ID_MONITOR1))
896#define MMDC_MAEXIDR0_EXC_ID_MONITOR0_MASK ((0xffff << MMDC_MAEXIDR0_EXC_ID_MONITOR0))
897
898/* MAEXIDR1 */
899#define MMDC_MAEXIDR1_EXC_ID_MONITOR3_MASK ((0xffff << MMDC_MAEXIDR1_EXC_ID_MONITOR3))
900#define MMDC_MAEXIDR1_EXC_ID_MONITOR2_MASK ((0xffff << MMDC_MAEXIDR1_EXC_ID_MONITOR2))
901
902/* MPWRDLCTL */
903#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET3_MASK ((0x7f << MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET3))
904#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET2_MASK ((0x7f << MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET2))
905#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET1_MASK ((0x7f << MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET1))
906#define MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET0_MASK ((0x7f << MMDC_MPWRDLCTL_WR_DL_ABS_OFFSET0))
907
908/* MPRDDLCTL */
909#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET3_MASK ((0x7f << MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET3))
910#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET2_MASK ((0x7f << MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET2))
911#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET1_MASK ((0x7f << MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET1))
912#define MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET0_MASK ((0x7f << MMDC_MPRDDLCTL_RD_DL_ABS_OFFSET0))
913
914/* MPWRDQBY0DL */
915#define MMDC_MPWRDQBY0DL_WR_DM0_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DM0_DEL))
916#define MMDC_MPWRDQBY0DL_WR_DQ7_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ7_DEL))
917#define MMDC_MPWRDQBY0DL_WR_DQ6_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ6_DEL))
918#define MMDC_MPWRDQBY0DL_WR_DQ5_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ5_DEL))
919#define MMDC_MPWRDQBY0DL_WR_DQ4_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ4_DEL))
920#define MMDC_MPWRDQBY0DL_WR_DQ3_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ3_DEL))
921#define MMDC_MPWRDQBY0DL_WR_DQ2_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ2_DEL))
922#define MMDC_MPWRDQBY0DL_WR_DQ1_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ1_DEL))
923#define MMDC_MPWRDQBY0DL_WR_DQ0_DEL_MASK ((0x3f << MMDC_MPWRDQBY0DL_WR_DQ0_DEL))
924
925/* MPWRDQBY1DL */
926#define MMDC_MPWRDQBY1DL_WR_DM1_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DM1_DEL))
927#define MMDC_MPWRDQBY1DL_WR_DQ15_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ15_DEL))
928#define MMDC_MPWRDQBY1DL_WR_DQ14_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ14_DEL))
929#define MMDC_MPWRDQBY1DL_WR_DQ13_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ13_DEL))
930#define MMDC_MPWRDQBY1DL_WR_DQ12_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ12_DEL))
931#define MMDC_MPWRDQBY1DL_WR_DQ11_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ11_DEL))
932#define MMDC_MPWRDQBY1DL_WR_DQ10_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ10_DEL))
933#define MMDC_MPWRDQBY1DL_WR_DQ9_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ9_DEL))
934#define MMDC_MPWRDQBY1DL_WR_DQ8_DEL_MASK ((0x3f << MMDC_MPWRDQBY1DL_WR_DQ8_DEL))
935
936/* MPWRDQBY2DL */
937#define MMDC_MPWRDQBY2DL_WR_DM2_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DM2_DEL))
938#define MMDC_MPWRDQBY2DL_WR_DQ23_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ23_DEL))
939#define MMDC_MPWRDQBY2DL_WR_DQ22_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ22_DEL))
940#define MMDC_MPWRDQBY2DL_WR_DQ21_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ21_DEL))
941#define MMDC_MPWRDQBY2DL_WR_DQ20_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ20_DEL))
942#define MMDC_MPWRDQBY2DL_WR_DQ19_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ19_DEL))
943#define MMDC_MPWRDQBY2DL_WR_DQ18_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ18_DEL))
944#define MMDC_MPWRDQBY2DL_WR_DQ17_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ17_DEL))
945#define MMDC_MPWRDQBY2DL_WR_DQ16_DEL_MASK ((0x3f << MMDC_MPWRDQBY2DL_WR_DQ16_DEL))
946
947/* MPWRDQBY3DL */
948#define MMDC_MPWRDQBY3DL_WR_DM3_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DM3_DEL))
949#define MMDC_MPWRDQBY3DL_WR_DQ31_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ31_DEL))
950#define MMDC_MPWRDQBY3DL_WR_DQ30_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ30_DEL))
951#define MMDC_MPWRDQBY3DL_WR_DQ29_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ29_DEL))
952#define MMDC_MPWRDQBY3DL_WR_DQ28_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ28_DEL))
953#define MMDC_MPWRDQBY3DL_WR_DQ27_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ27_DEL))
954#define MMDC_MPWRDQBY3DL_WR_DQ26_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ26_DEL))
955#define MMDC_MPWRDQBY3DL_WR_DQ25_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ25_DEL))
956#define MMDC_MPWRDQBY3DL_WR_DQ24_DEL_MASK ((0x3f << MMDC_MPWRDQBY3DL_WR_DQ24_DEL))
957
Bai Pingb1b61c62019-07-22 01:24:42 +0000958#define SNVS_LPCR_DPEN (0x20)
959#define SNVS_LPCR_SRTC_ENV (0x1)
960
Fabio Estevamecb3ed62019-10-23 11:08:55 -0300961#define SRC_BASE_ADDR CMC1_RBASE
962#define IRAM_BASE_ADDR OCRAM_0_BASE
963#define IOMUXC_BASE_ADDR IOMUXC1_RBASE
964
Peng Fan8fb02222017-02-22 16:21:40 +0800965#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
966
967#include <asm/types.h>
968
969struct fuse_word {
970 u32 fuse;
971 u32 rsvd[3];
972};
973
974struct ocotp_regs {
975 u32 ctrl;
976 u32 ctrl_set;
977 u32 ctrl_clr;
978 u32 ctrl_tog;
979 u32 pdn;
980 u32 rsvd0[3];
981 u32 data;
982 u32 rsvd1[3];
983 u32 read_ctrl;
984 u32 rsvd2[3];
985 u32 read_fuse_data;
986 u32 rsvd3[3];
987 u32 sw_sticky;
988 u32 rsvd4[3];
989 u32 scs;
990 u32 scs_set;
991 u32 scs_clr;
992 u32 scs_tog;
993 u32 out_status;
994 u32 out_status_set;
995 u32 out_status_clr;
996 u32 out_status_tog;
997 u32 startword;
998 u32 rsvd5[3];
999 u32 version;
1000 u32 rsvd6[19];
1001 struct fuse_word mem_repair[8];
1002 u32 rsvd7[0xa8];
1003
1004 /* fuse banks */
1005 struct fuse_bank {
1006 u32 fuse_regs[0x20];
1007 } bank[0];
1008};
1009
1010struct fuse_bank1_regs {
1011 u32 lock0;
1012 u32 rsvd0[3];
1013 u32 lock1;
1014 u32 rsvd1[3];
1015 u32 lock2;
1016 u32 rsvd2[3];
1017 u32 cfg0;
1018 u32 rsvd3[3];
1019 u32 cfg1;
1020 u32 rsvd4[3];
1021 u32 cfg2;
1022 u32 rsvd5[3];
1023 u32 cfg3;
1024 u32 rsvd6[3];
1025 u32 cfg4;
1026 u32 rsvd7[3];
1027};
1028
1029struct fuse_bank2_regs {
1030 struct fuse_word boot[8];
1031};
1032
1033struct fuse_bank3_regs {
1034 u32 mem0;
1035 u32 rsvd0[3];
1036 u32 mem1;
1037 u32 rsvd1[3];
1038 u32 mem2;
1039 u32 rsvd2[3];
1040 u32 mem3;
1041 u32 rsvd3[3];
1042 u32 ana0;
1043 u32 rsvd4[3];
1044 u32 ana1;
1045 u32 rsvd5[3];
1046 u32 ana2;
1047 u32 rsvd6[3];
1048 u32 ana3;
1049 u32 rsvd7[3];
1050};
1051
1052struct fuse_bank7_regs {
1053 u32 sjc_resp0;
1054 u32 rsvd0[3];
1055 u32 sjc_resp1;
1056 u32 rsvd1[3];
1057 u32 gp0;
1058 u32 rsvd2[3];
1059 u32 gp1;
1060 u32 rsvd3[3];
1061 u32 gp2;
1062 u32 rsvd4[3];
1063 u32 gp3;
1064 u32 rsvd5[3];
1065 u32 gp4;
1066 u32 rsvd6[3];
1067 u32 gp5;
1068 u32 rsvd7[3];
1069};
1070
1071struct usbphy_regs {
1072 u32 usbphy_pwd; /* 0x000 */
1073 u32 usbphy_pwd_set; /* 0x004 */
1074 u32 usbphy_pwd_clr; /* 0x008 */
1075 u32 usbphy_pwd_tog; /* 0x00c */
1076 u32 usbphy_tx; /* 0x010 */
1077 u32 usbphy_tx_set; /* 0x014 */
1078 u32 usbphy_tx_clr; /* 0x018 */
1079 u32 usbphy_tx_tog; /* 0x01c */
1080 u32 usbphy_rx; /* 0x020 */
1081 u32 usbphy_rx_set; /* 0x024 */
1082 u32 usbphy_rx_clr; /* 0x028 */
1083 u32 usbphy_rx_tog; /* 0x02c */
1084 u32 usbphy_ctrl; /* 0x030 */
1085 u32 usbphy_ctrl_set; /* 0x034 */
1086 u32 usbphy_ctrl_clr; /* 0x038 */
1087 u32 usbphy_ctrl_tog; /* 0x03c */
1088 u32 usbphy_status; /* 0x040 */
1089 u32 reserved0[3];
1090 u32 usbphy_debug0; /* 0x050 */
1091 u32 usbphy_debug0_set; /* 0x054 */
1092 u32 usbphy_debug0_clr; /* 0x058 */
1093 u32 usbphy_debug0_tog; /* 0x05c */
1094 u32 reserved1[4];
1095 u32 usbphy_debug1; /* 0x070 */
1096 u32 usbphy_debug1_set; /* 0x074 */
1097 u32 usbphy_debug1_clr; /* 0x078 */
1098 u32 usbphy_debug1_tog; /* 0x07c */
1099 u32 usbphy_version; /* 0x080 */
1100 u32 reserved2[7];
1101 u32 usb1_pll_480_ctrl; /* 0x0a0 */
1102 u32 usb1_pll_480_ctrl_set; /* 0x0a4 */
1103 u32 usb1_pll_480_ctrl_clr; /* 0x0a8 */
1104 u32 usb1_pll_480_ctrl_tog; /* 0x0ac */
1105 u32 reserved3[4];
1106 u32 usb1_vbus_detect; /* 0xc0 */
1107 u32 usb1_vbus_detect_set; /* 0xc4 */
1108 u32 usb1_vbus_detect_clr; /* 0xc8 */
1109 u32 usb1_vbus_detect_tog; /* 0xcc */
1110 u32 usb1_vbus_det_stat; /* 0xd0 */
1111 u32 reserved4[3];
1112 u32 usb1_chrg_detect; /* 0xe0 */
1113 u32 usb1_chrg_detect_set; /* 0xe4 */
1114 u32 usb1_chrg_detect_clr; /* 0xe8 */
1115 u32 usb1_chrg_detect_tog; /* 0xec */
1116 u32 usb1_chrg_det_stat; /* 0xf0 */
1117 u32 reserved5[3];
1118 u32 usbphy_anactrl; /* 0x100 */
1119 u32 usbphy_anactrl_set; /* 0x104 */
1120 u32 usbphy_anactrl_clr; /* 0x108 */
1121 u32 usbphy_anactrl_tog; /* 0x10c */
1122 u32 usb1_loopback; /* 0x110 */
1123 u32 usb1_loopback_set; /* 0x114 */
1124 u32 usb1_loopback_clr; /* 0x118 */
1125 u32 usb1_loopback_tog; /* 0x11c */
1126 u32 usb1_loopback_hsfscnt; /* 0x120 */
1127 u32 usb1_loopback_hsfscnt_set; /* 0x124 */
1128 u32 usb1_loopback_hsfscnt_clr; /* 0x128 */
1129 u32 usb1_loopback_hsfscnt_tog; /* 0x12c */
1130 u32 usphy_trim_override_en; /* 0x130 */
1131 u32 usphy_trim_override_en_set; /* 0x134 */
1132 u32 usphy_trim_override_en_clr; /* 0x138 */
1133 u32 usphy_trim_override_en_tog; /* 0x13c */
1134 u32 usb1_pfda_ctrl1; /* 0x140 */
1135 u32 usb1_pfda_ctrl1_set; /* 0x144 */
1136 u32 usb1_pfda_ctrl1_clr; /* 0x148 */
1137 u32 usb1_pfda_ctrl1_tog; /* 0x14c */
1138};
1139
Peng Fanb1d6be92019-07-22 01:24:37 +00001140struct bootrom_sw_info {
1141 u8 reserved_1;
1142 u8 boot_dev_instance;
1143 u8 boot_dev_type;
1144 u8 reserved_2;
1145 u32 core_freq;
1146 u32 axi_freq;
1147 u32 ddr_freq;
1148 u32 rom_tick_freq;
1149 u32 reserved_3[3];
1150};
Peng Fan8fb02222017-02-22 16:21:40 +08001151
1152#define is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))
1153#define disconnect_from_pc(void) writel(0x0, USBOTG0_RBASE + 0x140)
1154
1155#endif
1156
1157#endif /* _MX7ULP_REGS_H_*/