bcm53xx_reg.h revision 1.14.2.2 1 /*-
2 * Copyright (c) 2012 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Matt Thomas of 3am Software Foundry.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #ifndef _ARM_BROADCOM_BCM53XX_REG_H_
31 #define _ARM_BROADCOM_BCM53XX_REG_H_
32
33 /*
34 * 0x0000_0000..0x07ff_ffff 128MB DDR2/3 DRAM Memory Region (dual map)
35 * 0x0800_0000..0x0fff_ffff 128MB PCIe 0 Address Match Region
36 * 0x1800_0000..0x180f_ffff 1MB Core Register Region
37 * 0x1810_0000..0x181f_ffff 1MB IDM Register Region
38 * 0x1900_0000..0x190f_ffff 1MB ARMcore (CORTEX-A9) Register Region
39 * 0x1c00_0000..0x1dff_ffff 1MB NAND Flash Region
40 * 0x1e00_0000..0x1dff_ffff 1MB Serial Flash Region
41 * 0x4000_0000..0x47ff_ffff 128MB PCIe 1 Address Match Region
42 * 0x4800_0000..0x4fff_ffff 128MB PCIe 2 Address Match Region
43 * 0x8000_0000..0xbfff_ffff 1024MB DDR2/3 DRAM Memory Region
44 * 0xfffd_0000..0xfffe_ffff 128KB Internal Boot ROM Region
45 * 0xffff_0000..0xffff_043f 1088B Internal SKU ROM Region
46 * 0xffff_1000..0xffff_1fff 4KB Enumeration ROM Register Region
47 */
48 #define BCM53XX_PCIE0_OWIN_PBASE 0x08000000
49 #define BCM53XX_PCIE0_OWIN_SIZE 0x04000000
50 #define BCM53XX_PCIE0_OWIN_MAX 0x08000000
51
52 #define BCM53XX_IOREG_PBASE 0x18000000
53 #define BCM53XX_IOREG_SIZE 0x00200000
54
55 #define BCM53XX_ARMCORE_PBASE 0x19000000
56 #define BCM53XX_ARMCORE_SIZE 0x00100000
57
58 #define BCM53XX_NAND_PBASE 0x1c000000
59 #define BCM53XX_NAND_SIZE 0x01000000
60
61 #define BCM53XX_SPIFLASH_PBASE 0x1d000000
62 #define BCM53XX_SPIFLASH_SIZE 0x01000000
63
64 #define BCM53XX_PCIE1_OWIN_PBASE 0x40000000
65 #define BCM53XX_PCIE1_OWIN_SIZE 0x04000000
66 #define BCM53XX_PCIE1_OWIN_MAX 0x08000000
67
68 #define BCM53XX_PCIE2_OWIN_PBASE 0x48000000
69 #define BCM53XX_PCIE2_OWIN_SIZE 0x04000000
70 #define BCM53XX_PCIE2_OWIN_MAX 0x08000000
71
72 #define BCM53XX_IO_SIZE (BCM53XX_IOREG_SIZE \
73 + BCM53XX_ARMCORE_SIZE \
74 + BCM53XX_PCIE0_OWIN_SIZE \
75 + BCM53XX_PCIE1_OWIN_SIZE \
76 + BCM53XX_PCIE2_OWIN_SIZE)
77
78 #define BCM53XX_REF_CLK (25*1000*1000)
79
80 #define CCA_UART_FREQ BCM53XX_REF_CLK
81
82 /* Chip Common A */
83 #define CCA_MISC_BASE 0x000000
84 #define CCA_MISC_SIZE 0x001000
85 #define CCA_UART0_BASE 0x000300
86 #define CCA_UART1_BASE 0x000400
87
88 /* Chip Common B */
89 #define CCB_BASE 0x000000
90 #define CCB_SIZE 0x030000
91 #define PWM_BASE 0x002000
92 #define MII_BASE 0x003000
93 #define RNG_BASE 0x004000
94 #define TIMER0_BASE 0x005000
95 #define TIMER1_BASE 0x006000
96 #define SRAB_BASE 0x007000
97
98 #define CRU_BASE 0x00b000
99 #define DMU_BASE 0x00c000
100
101 #define DDR_BASE 0x010000
102
103 #define PCIE0_BASE 0x012000
104 #define PCIE1_BASE 0x013000
105
106 #ifdef BCM5301X
107 #define UART2_BASE 0x008000
108 #define SMBUS1_BASE 0x009000
109 #define PCIE2_BASE 0x014000
110 #define SDIO_BASE 0x020000
111 #define EHCI_BASE 0x021000
112 #define OHCI_BASE 0x022000
113 #define GMAC0_BASE 0x024000
114 #define GMAC1_BASE 0x025000
115 #define GMAC2_BASE 0x026000
116 #define GMAC3_BASE 0x027000
117 #define NAND_BASE 0x028000
118 #define QSPI_BASE 0x029000
119 #define I2S_BASE 0x02A000
120 #define DMAC_BASE 0x02C000
121 #endif
122
123 #ifdef BCM563XX
124 #define UART2_BASE 0x007000
125 #define SMBUS1_BASE 0x008000
126 #define WDT_BASE 0x009000
127 #define PKA_BASE 0x00a000
128 #define SMBUS2_BASE 0x00b000
129 #define DMAC_BASE 0x020000
130 #define GMAC0_BASE 0x022000
131 #define GMAC1_BASE 0x023000
132 #define NAND_BASE 0x026000
133 #define QSPI_BASE 0x027000
134 #define EHCI_BASE 0x02A000
135 #define OHCI_BASE 0x02B000
136 #endif
137
138 #define IDM_BASE 0x100000
139 #define IDM_SIZE 0x100000
140
141 /* Chip Common A */
142
143 #ifdef CCA_PRIVATE
144
145 #define MISC_CHIPID 0x000
146 #define CHIPID_REV __BITS(19,16)
147 #define CHIPID_ID __BITS(15,0)
148 #define ID_BCM53010 0xcf12 // 53010
149 #define ID_BCM53011 0xcf13 // 53011
150 #define ID_BCM53012 0xcf14 // 53012
151 #define ID_BCM53013 0xcf15 // 53013
152 #define ID_BCM56340 0xdc14 // 56340
153
154 #define MISC_CAPABILITY 0x004
155 #define CAPABILITY_JTAG_PRESENT __BIT(22)
156 #define CAPABILITY_UART_CLKSEL __BITS(4,3)
157 #define UART_CLKSEL_REFCLK 0
158 #define UART_CLKSEL_INTCLK 1
159 /* 2 & 3 are reserved */
160 #define CAPABILITY_BIG_ENDIAN __BIT(2)
161 #define CAPABILITY_UART_COUNT __BITS(1,0)
162
163 #define MISC_CORECTL 0x008
164 #define CORECTL_UART_CLK_EN __BIT(3)
165 #define CORECTL_GPIO_ASYNC_INT_EN __BIT(2)
166 #define CORECTL_UART_CLK_OVERRIDE __BIT(0)
167
168 #define MISC_INTSTATUS 0x020
169 #define INTSTATUS_WDRESET __BIT(31) // WO2C
170 #define INTSTATUS_UARTINT __BIT(6) // RO
171 #define INTSTATUS_GPIOINT __BIT(0) // RO
172
173 #define MISC_INTMASK 0x024
174 #define INTMASK_UARTINT __BIT(6) // 1 = enabled
175 #define INTMASK_GPIOINT __BIT(0) // 1 = enabled
176
177 /* Only bits [23:0] are used in the GPIO registers */
178 #define GPIO_INPUT 0x060 // RO
179 #define GPIO_OUT 0x064
180 #define GPIO_OUTEN 0x068
181 #define GPIO_INTPOLARITY 0x070 // 1 = active low
182 #define GPIO_INTMASK 0x074 // 1 = enabled (level)
183 #define GPIO_EVENT 0x078 // W1C, 1 = edge seen
184 #define GPIO_EVENT_INTMASK 0x07c // 1 = enabled (edge)
185 #define GPIO_EVENT_INTPOLARITY 0x084 // 1 = falling
186 #define GPIO_TIMER_VAL 0x088
187 #define TIMERVAL_ONCOUNT __BITS(31,16)
188 #define TIMERVAL_OFFCOUNT __BITS(15,0)
189 #define GPIO_TIMER_OUTMASK 0x08c
190 #define GPIO_DEBUG_SEL 0x0a8
191
192 #define MISC_WATCHDOG 0x080 // 0 disables, 1 resets
193
194 #define MISC_CLKDIV 0x0a4
195 #define CLKDIV_JTAG_MASTER_CLKDIV __BITS(13,9)
196 #define CLKDIV_UART_CLKDIV __BITS(7,1)
197
198 #define MISC_CAPABILITY2 0x0ac
199 #define CAPABILITY2_GSIO_PRESENT __BIT(1) // SPI exists
200
201 #define MISC_GSIOCTL 0x0e4
202 #define GSIOCTL_STARTBUSY __BIT(31)
203 #define GSIOCTL_GSIOMODE __BIT(30) // 0 = SPI
204 #define GSIOCTL_ERROR __BIT(23)
205 #define GSIOCTL_BIGENDIAN __BIT(22)
206 #define GSIOCTL_GSIOGO __BIT(21)
207 #define GSIOCTL_NUM_DATABYTES __BITS(17,16) // actual is + 1
208 #define GSIOCTL_NUM_WAITCYCLES __BITS(15,14) // actual is + 1
209 #define GSIOCTL_NUM_ADDRESSBYTES __BITS(13,12) // actual is + 1
210 #define GSIOCTL_GSIOCODE __BITS(10,8)
211 #define GSIOCODE_OP_RD1DATA 0
212 #define GSIOCODE_OP_WRADDR_RDADDR 1
213 #define GSIOCODE_OP_WRADDR_XFRDATA 2
214 #define GSIOCODE_OP_WRADDR_WAIT_XFRDATA 3
215 #define GSIOCODE_XFRDATA 4
216 #define GSIOCTL_GSIOOP __BITS(7,0)
217
218 #define MISC_GSIOADDRESS 0x0e8
219 #define MISC_GSIODATA 0x0ec
220
221 #define MISC_CLKDIV2 0x0f0
222 #define CLKDIV2_GSIODIV __BITS(20,5)
223
224 #define MISC_EROM_PTR_OFFSET 0x0fc
225
226 #endif /* CCA_PRIVATE */
227
228 /*
229 * UART0 & 1 use the standard 16550 register layout (normal 1 byte stride)
230 * and have 64-byte FIFOs
231 */
232
233 /* TIMER0 & 1 are implemented by the dtimer driver */
234
235 #define TIMER_FREQ BCM53XX_REF_CLK
236
237 #ifdef SRAB_PRIVATE
238 #define SRAB_CMDSTAT 0x002c
239 #define SRA_PAGE __BITS(31,24)
240 #define SRA_OFFSET __BITS(23,16)
241 #define SRA_PAGEOFFSET __BITS(31,16)
242 #define SRA_RST __BIT(2)
243 #define SRA_WRITE __BIT(1)
244 #define SRA_GORDYN __BIT(0)
245 #define SRAB_WDH 0x0030
246 #define SRAB_WDL 0x0034
247 #define SRAB_RDH 0x0038
248 #define SRAB_RDL 0x003c
249 #endif
250
251 #ifdef MII_PRIVATE
252 #define MII_INTERNAL 0x0038003 /* internal phy bitmask */
253 #define MIIMGT 0x000
254 #define MIIMGT_BYP __BIT(10)
255 #define MIIMGT_EXT __BIT(9)
256 #define MIIMGT_BSY __BIT(8)
257 #define MIIMGT_PRE __BIT(7)
258 #define MIIMGT_MDCDIV __BITS(6,0)
259 #define MIICMD 0x004
260 #define MIICMD_SB __BITS(31,30)
261 #define MIICMD_SB_DEF __SHIFTIN(1, MIICMD_SB)
262 #define MIICMD_OP __BITS(29,28)
263 #define MIICMD_OP_RD __SHIFTIN(2, MIICMD_OP)
264 #define MIICMD_OP_WR __SHIFTIN(1, MIICMD_OP)
265 #define MIICMD_PHY __BITS(27,23)
266 #define MIICMD_REG __BITS(22,18)
267 #define MIICMD_TA __BITS(17,16)
268 #define MIICMD_TA_DEF __SHIFTIN(2, MIICMD_TA)
269 #define MIICMD_DATA __BITS(15,0)
270
271 #define MIICMD_RD_DEF (MIICMD_SB_DEF|MIICMD_OP_RD|MIICMD_TA_DEF)
272 #define MIICMD_WR_DEF (MIICMD_SB_DEF|MIICMD_OP_WR|MIICMD_TA_DEF)
273 #define MIICMD__PHYREG(p,r) (__SHIFTIN(p,MIICMD_PHY)|__SHIFTIN(r,MIICMD_REG))
274 #define MIICMD_RD(p,r) (MIICMD_RD_DEF|MIICMD__PHYREG((p),(r)))
275 #define MIICMD_WR(p,r,v) (MIICMD_WR_DEF|MIICMD__PHYREG((p),(r))|(v))
276 #endif /* MII_PRIVATE */
277
278 #ifdef RNG_PRIVATE
279 #define RNG_CTRL 0x000
280 #define RNG_COMBLK2_OSC_DIS __BITS(27,22)
281 #define RNG_COMBLK1_OSC_DIS __BITS(21,16)
282 #define RNG_ICLK_BYP_DIV_CNT __BITS(15,8)
283 #define RNG_JCLK_BYP_SRC __BIT(5)
284 #define RNG_JCLK_BYP_SEL __BIT(4)
285 #define RNG_RBG2X __BIT(1)
286 #define RNG_RBGEN __BIT(0)
287 #define RNG_STATUS 0x004
288 #define RNG_VAL __BITS(31,24)
289 #define RNG_WARM_CNT __BITS(19,0)
290
291 #define RNG_DATA 0x008
292 #define RNG_FF_THRESHOLD 0x00c
293 #define RNG_INT_MASK 0x010
294 #define RNG_INT_OFF __BIT(0)
295 #endif /* RNG_PRIVATE */
296
297 #ifdef UART2_PRIVATE
298 /*
299 * UART2 (ChipCommonB) uses a 4-byte stride and 16-byte FIFO.
300 * Its frequency is the APB clock.
301 */
302 #define UART2_LPDLL 0x020
303 #define UART2_LPDLH 0x024
304 #endif
305
306 #ifdef CRU_PRIVATE
307
308 #define CRU_CONTROL 0x000
309 #define CRUCTL_QSPI_CLK_SEL __BITS(2,1)
310 #define QSPI_CLK_25MHZ 0 // iproc_ref_clk
311 #define QSPI_CLK_50MHZ 1 // iproc_sdio_clk / 4
312 #define QSPI_CLK_31dot25MHZ 2 // iproc_clk250 / 8
313 #define QSPI_CLK_62dot5MHZ 3 // iproc_clk250 / 4
314 #define CRUCTL_SW_RESET __BIT(0)
315
316 #define CRU_GENPLL_CONTROL5 0x1154
317 #define GENPLL_CONTROL5_NDIV_INT __BITS(29,20) // = (n ? n : 1024)
318 #define GENPLL_CONTROL5_NDIV_FRAC __BITS(19,0) // = 1 / n
319 #define CRU_GENPLL_CONTROL6 0x1158
320 #define GENPLL_CONTROL6_PDIV __BITS(26,24) // = (n ? n : 8)
321 #define GENPLL_CONTROL6_CH0_MDIV __BITS(23,16) // = (n ? n : 256), clk_mac
322 #define GENPLL_CONTROL6_CH1_MDIV __BITS(15,8) // = (n ? n : 256), clk_robo
323 #define GENPLL_CONTROL6_CH2_MDIV __BITS(7,0) // = (n ? n : 256), clf_usb2
324 #define CRU_GENPLL_CONTROL7 0x115c
325 #define GENPLL_CONTROL7_CH3_MDIV __BITS(23,16) // = (n ? n : 256), clk_iproc
326
327 #define USB2_REF_CLK (1920*1000*1000)
328 #define CRU_USB2_CONTROL 0x1164
329 #define USB2_CONTROL_KA __BITS(24,22)
330 #define USB2_CONTROL_KI __BITS(31,19)
331 #define USB2_CONTROL_KP __BITS(18,15)
332 #define USB2_CONTROL_PDIV __BITS(14,12) // = (n ? n : 8)
333 #define USB2_CONTROL_NDIV_INT __BITS(11,2) // = (n ? n : 1024)
334 #define USB2_CONTROL_PLL_PCIEUSB3_RESET __BIT(1) // inverted 1=normal
335 #define USB2_CONTROL_PLL_USB2_RESET __BIT(0) // inverted 1=normal
336
337 #define CRU_CLKSET_KEY 0x1180
338 #define CRU_CLKSET_KEY_MAGIC 0xea68
339
340 #define CRU_GPIO_SELECT 0x11c0 // CRU GPIO Select
341 #define CRU_GPIO_DRIVE_SEL2 0x11c4
342 #define CRU_GPIO_DRIVE_SEL1 0x11c8
343 #define CRU_GPIO_DRIVE_SEL0 0x11cc
344 #define CRU_GPIO_INPUT_DISABLE 0x11d0
345 #define CRU_GPIO_HYSTERESIS 0x11d4
346 #define CRU_GPIO_SLEW_RATE 0x11d8
347 #define CRU_GPIO_PULL_UP 0x11dc
348 #define CRU_GPIO_PULL_DOWN 0x11e0
349
350 #define CRU_STRAPS_CONTROL 0x12a0
351 #define STRAP_BOOT_DEV __BITS(17,16)
352 #define STRAP_NAND_TYPE __BITS(15,12)
353 #define STRAP_NAND_PAGE __BITS(11,10)
354 #define STRAP_DDR3 __BIT(9)
355 #define STRAP_P5_VOLT_15 __BIT(8)
356 #define STRAP_P5_MODE __BITS(7,6)
357 #define STRAP_PCIE0_MODE __BIT(5)
358 #define STRAP_USB3_SEL __BIT(4)
359 #define STRAP_EX_EXTCLK __BIT(3)
360 #define STRAP_HW_FWDG_EN __BIT(2)
361 #define STRAP_LED_SERIAL_MODE __BIT(1)
362 #define STRAP_BISR_BYPASS_AUTOLOAD __BIT(0)
363
364 #endif /* CRU_PRIVATE */
365
366 #ifdef DMU_PRIVATE
367
368 #define DMU_LCPLL_CONTROL0 0x100
369 #define DMU_LCPLL_CONTROL1 0x104
370 #define LCPLL_CONTROL1_PDIV __BITS(30,28) // = (n ? n : 8)
371 #define LCPLL_CONTROL1_NDIV_INT __BITS(27,20) // = (n ? n : 256)
372 #define LCPLL_CONTROL1_NDIV_FRAC __BITS(19,0) // = 1 / n
373 /*
374 * SYS_CLK = (1 / pdiv) * (ndiv_int + (ndiv_frac / 0x40000000)) x F(ref)
375 */
376 #define DMU_LCPLL_CONTROL2 0x108
377 #define LCPLL_CONTROL2_CH0_MDIV __BITS(31,24) // = (n ? n : 256), clk_pcie_ref
378 #define LCPLL_CONTROL2_CH1_MDIV __BITS(23,16) // = (n ? n : 256), clk_sdio
379 #define LCPLL_CONTROL2_CH2_MDIV __BITS(15,8) // = (n ? n : 256), clk_ddr
380 #define LCPLL_CONTROL2_CH3_MDIV __BITS(7,0) // = (n ? n : 256), clf_dft
381
382 #endif /* DMU_PRIVATE */
383
384 #ifdef DDR_PRIVATE
385 /*
386 * DDR CTL register has such inspired names.
387 */
388 #define DDR_CTL_01 0x004
389 #define CTL_01_MAX_CHIP_SEL __BITS(18,16) // not documented as such
390 #define CTL_01_MAX_COL __BITS(11,8)
391 #define CTL_01_MAX_ROW __BITS(4,0)
392
393 #define DDR_CTL_82 0x148
394 #define CTL_82_COL_DIFF __BITS(26,24)
395 #define CTL_82_ROW_DIFF __BITS(18,16)
396 #define CTL_82_BANK_DIFF __BITS(9,8)
397 #define CTL_82_ZQCS_ROTATE __BIT(0)
398
399 #define DDR_CTL_86 0x158
400 #define CTL_86_CS_MAP __BITS(27,24)
401 #define CTL_86_INHIBIT_DRAM_CMD __BIT(16)
402 #define CTL_86_DIS_RD_INTRLV __BIT(8)
403 #define CTL_86_NUM_QENT_ACT_DIS __BITS(2,0)
404
405 #define DDR_CTL_87 0x15c
406 #define CTL_87_IN_ORDER_ACCEPT __BIT(24)
407 #define CTL_87_Q_FULLNESS __BITS(18,16)
408 #define CTL_87_REDUC __BIT(8)
409 #define CTL_87_BURST_ON_FLY_BIT __BITS(3,0)
410
411 #define DDR_PHY_CTL_PLL_STATUS 0x810
412 #define PLL_STATUS_LOCK_LOST __BIT(26)
413 #define PLL_STATUS_MHZ __BITS(25,14)
414 #define PLL_STATUS_CLOCKING_4X __BIT(13)
415 #define PLL_STATUS_STATUS __BITS(12,1)
416 #define PLL_STATUS_LOCK __BIT(0)
417
418 #define DDR_PHY_CTL_PLL_DIVIDERS 0x81c
419 #define PLL_DIVIDERS_POST_DIV __BITS(13,11)
420 #define PLL_DIVIDERS_PDIV __BITS(10,8) // 4x: (n ? n : 8), n = n - 4, 4x
421 #define PLL_DIVIDERS_NDIV __BITS(7,0)
422
423 #endif /* DDR_PRIVATE */
424
425 #ifdef PCIE_PRIVATE
426
427 #define PCIE_CLK_CONTROL 0x000
428
429 #define PCIE_RC_AXI_CONFIG 0x100
430 #define PCIE_AWCACHE_CONFIG __BITS(17,14)
431 #define PCIE_AWUSER_CONFIG __BITS(13,9)
432 #define PCIE_ARCACHE_CONFIG __BITS(8,5)
433 #define PCIE_ARUSER_CONFIG __BITS(4,0)
434
435 #define PCIE_CFG_IND_ADDR 0x120
436 #define CFG_IND_ADDR_FUNC __BITS(15,13)
437 #define CFG_IND_ADDR_LAYER __BITS(12,11)
438 #define CFG_IND_ADDR_REG __BITS(10,2)
439 #define PCIE_CFG_IND_DATA 0x124
440 #define PCIE_CFG_ADDR 0x1f8
441 #define CFG_ADDR_BUS __BITS(27,20)
442 #define CFG_ADDR_DEV __BITS(19,15)
443 #define CFG_ADDR_FUNC __BITS(14,12)
444 #define CFG_ADDR_REG __BITS(11,2)
445 #define CFG_ADDR_TYPE __BITS(1,0)
446 #define CFG_ADDR_TYPE0 __SHIFTIN(0, CFG_ADDR_TYPE)
447 #define CFG_ADDR_TYPE1 __SHIFTIN(1, CFG_ADDR_TYPE)
448 #define PCIE_CFG_DATA 0x1fc
449 #define PCIE_EQ_PAGE 0x200
450 #define PCIE_MSI_PAGE 0x204
451 #define PCIE_MSI_INTR_EN 0x208
452 #define PCIE_MSI_CTRL_0 0x210
453 #define PCIE_MSI_CTRL_1 0x214
454 #define PCIE_MSI_CTRL_2 0x218
455 #define PCIE_MSI_CTRL_3 0x21c
456 #define PCIE_MSI_CTRL_4 0x220
457 #define PCIE_MSI_CTRL_5 0x224
458 #define PCIE_SYS_EQ_HEAD_0 0x250
459 #define PCIE_SYS_EQ_TAIL_0 0x254
460 #define PCIE_SYS_EQ_HEAD_1 0x258
461 #define PCIE_SYS_EQ_TAIL_1 0x25c
462 #define PCIE_SYS_EQ_HEAD_2 0x260
463 #define PCIE_SYS_EQ_TAIL_2 0x264
464 #define PCIE_SYS_EQ_HEAD_3 0x268
465 #define PCIE_SYS_EQ_TAIL_3 0x26c
466 #define PCIE_SYS_EQ_HEAD_4 0x270
467 #define PCIE_SYS_EQ_TAIL_4 0x274
468 #define PCIE_SYS_EQ_HEAD_5 0x278
469 #define PCIE_SYS_EQ_TAIL_5 0x27c
470 #define PCIE_SYS_RC_INTX_EN 0x330
471 #define PCIE_SYS_RC_INTX_CSR 0x334
472
473 #define PCIE_CFG000_BASE 0x400
474
475 #define PCIE_FUNC0_IMAP0_0 0xc00
476 #define PCIE_FUNC0_IMAP0_1 0xc04
477 #define PCIE_FUNC0_IMAP0_2 0xc08
478 #define PCIE_FUNC0_IMAP0_3 0xc0c
479 #define PCIE_FUNC0_IMAP0_4 0xc10
480 #define PCIE_FUNC0_IMAP0_5 0xc14
481 #define PCIE_FUNC0_IMAP0_6 0xc18
482 #define PCIE_FUNC0_IMAP0_7 0xc1c
483
484 #define PCIE_FUNC0_IMAP1 0xc80
485 #define PCIE_FUNC1_IMAP1 0xc88
486 #define PCIE_FUNC0_IMAP2 0xcc0
487 #define PCIE_FUNC1_IMAP2 0xcc8
488
489 #define PCIE_IARR_0_LOWER 0xd00
490 #define PCIE_IARR_0_UPPER 0xd04
491 #define PCIE_IARR_1_LOWER 0xd08
492 #define PCIE_IARR_1_UPPER 0xd0c
493 #define PCIE_IARR_2_LOWER 0xd10
494 #define PCIE_IARR_2_UPPER 0xd14
495
496 #define PCIE_OARR_0 0xd20
497 #define PCIE_OARR_1 0xd28
498
499 #define PCIE_OARR_ADDR __BITS(31,26)
500
501 #define PCIE_OMAP_0_LOWER 0xd40
502 #define PCIE_OMAP_0_UPPER 0xd44
503 #define PCIE_OMAP_1_LOWER 0xd48
504 #define PCIE_OMAP_1_UPPER 0xd4c
505
506 #define PCIE_OMAP_ADDRL __BITS(31,26)
507
508 #define PCIE_FUNC1_IARR_1_SIZE 0xd58
509 #define PCIE_FUNC1_IARR_2_SIZE 0xd5c
510
511 #define PCIE_MEM_CONTROL 0xf00
512 #define PCIE_MEM_ECC_ERR_LOG_0 0xf04
513 #define PCIE_MEM_ECC_ERR_LOG_1 0xf08
514
515 #define PCIE_LINK_STATUS 0xf0c
516 #define PCIE_PHYLINKUP __BIT(3)
517 #define PCIE_DL_ACTIVE __BIT(2)
518 #define PCIE_RX_LOS_TIMEOUT __BIT(1)
519 #define PCIE_LINK_IN_L1 __BIT(0)
520 #define PCIE_STRAP_STATUS 0xf10
521 #define STRAP_PCIE_REPLAY_BUF_TM __BITS(8,4)
522 #define STRAP_PCIE_USER_FOR_CE_GEN1 __BIT(3)
523 #define STRAP_PCIE_USER_FOR_CE_1LANE __BIT(2)
524 #define STRAP_PCIE_IF_ENABLE __BIT(1)
525 #define STRAP_PCIE_USER_RC_MODE __BIT(0)
526 #define PCIE_RESET_STATUS 0xf14
527
528 #define PCIE_RESET_ENABLE_IN_PCIE_LINK_DOWN 0xf18
529
530 #define PCIE_MISC_INTR_EN 0xf1c
531 #define PCIE_TX_DEBUG_CFG 0xf20
532 #define PCIE_ERROR_INTR_EN 0xf30
533 #define PCIE_ERROR_INTR_CLR 0xf34
534 #define PCIE_ERROR_INTR_STS 0xf38
535
536
537 // PCIE_SYS_MSI_INTR_EN
538 #define MSI_INTR_EN_EQ_5 __BIT(5)
539 #define MSI_INTR_EN_EQ_4 __BIT(4)
540 #define MSI_INTR_EN_EQ_3 __BIT(3)
541 #define MSI_INTR_EN_EQ_2 __BIT(2)
542 #define MSI_INTR_EN_EQ_1 __BIT(1)
543 #define MSI_INTR_EN_EQ_0 __BIT(0)
544
545 // PCIE_SYS_MSI_CTRL<n>
546 #define INT_N_DELAY __BITS(9,6)
547 #define INT_N_EVENT __BITS(1,1)
548 #define EQ_ENABLE __BIT(0)
549
550 // PCIE_SYS_EQ_HEAD<n>
551 #define HEAD_PTR __BITS(5,0)
552
553 // PCIE_SYS_EQ_TAIL<n>
554 #define EQ_OVERFLOW __BIT(6)
555 #define TAIL_PTR __BITS(5,0)
556
557 // PCIE_SYS_RC_INTRX_EN
558 #define RC_EN_INTD __BIT(3)
559 #define RC_EN_INTC __BIT(2)
560 #define RC_EN_INTB __BIT(1)
561 #define RC_EN_INTA __BIT(0)
562
563 // PCIE_SYS_RC_INTRX_CSR
564 #define RC_INTD __BIT(3)
565 #define RC_INTC __BIT(2)
566 #define RC_INTB __BIT(1)
567 #define RC_INTA __BIT(0)
568
569 // PCIE_IARR_0_LOWER / UPPER
570 #define IARR0_ADDR __BIT(31,15)
571 #define IARR0_VALID __BIT(0)
572
573 // PCIE_IARR_1_LOWER / UPPER
574 #define IARR1_ADDR __BIT(31,20)
575 #define IARR1_SIZE __BIT(7,0)
576
577 // PCIE_IARR_2_LOWER / UPPER
578 #define IARR2_ADDR __BIT(31,20)
579 #define IARR2_SIZE __BIT(7,0)
580
581 // PCIE_MISC_INTR_EN
582 #define INTR_EN_PCIE_ERR_ATTN __BIT(2)
583 #define INTR_EN_PAXB_ECC_2B_ATTN __BIT(1)
584 #define INTR_EN_PCIE_IN_WAKE_B __BIT(0)
585
586 // PCIE_ERR_INTR_{EN,CLR,STS}
587 #define PCIE_OVERFLOW_UNDERFLOW_INTR __BIT(10)
588 #define PCIE_AXI_MASTER_RRESP_SLV_ERR_INTR __BIT(9)
589 #define PCIE_AXI_MASTER_RRESP_DECERR_INTR __BIT(8)
590 #define PCIE_ECRC_ERR_INTR __BIT(7)
591 #define PCIE_CMPL_TIMEROUT_INTR __BIT(6)
592 #define PCIE_ERR_ATTN_INTR __BIT(5)
593 #define PCIE_IN_WAKE_B_INTR __BIT(4)
594 #define PCIE_REPLAY_BUF_2B_ECC_ERR_INTR __BIT(3)
595 #define PCIE_RD_CMPL_BUF_1_2B_ECC_ERR_INTR __BIT(2)
596 #define PCIE_RD_CMPL_BUF_0_2B_ECC_ERR_INTR __BIT(1)
597 #define PCIE_WR_DATA_BUF_2B_ECC_ERR_INTR __BIT(0)
598
599 #define REGS_DEVICE_CAPACITY 0x04d4
600 #define REGS_LINK_CAPACITY 0x03dc
601 #define REGS_TL_CONTROL_0 0x0800
602 #define REGS_DL_STATUS 0x1048
603
604 #endif /* PCIE_PRIVATE */
605
606 #define ARMCORE_SCU_BASE 0x20000 /* CBAR is 19020000 */
607 #define ARMCORE_L2C_BASE 0x22000
608
609 #ifdef ARMCORE_PRIVATE
610
611 #define ARMCORE_CLK_POLICY_FREQ 0x008
612 #define CLK_POLICY_FREQ_PRIVED __BIT(31)
613 #define CLK_POLICY_FREQ_POLICY3 __BITS(26,24)
614 #define CLK_POLICY_FREQ_POLICY2 __BITS(18,16)
615 #define CLK_POLICY_FREQ_POLICY1 __BITS(10,8)
616 #define CLK_POLICY_FREQ_POLICY0 __BITS(2,0)
617 #define CLK_POLICY_REF_CLK 0 // 25 MHZ
618 #define CLK_POLICY_SYS_CLK 1 // sys clk (200MHZ)
619 #define CLK_POLICY_ARM_PLL_CH0 6 // slow clock
620 #define CLK_POLICY_ARM_PLL_CH1 7 // fast clock
621
622 #define ARMCORE_CLK_APB_DIV 0xa10
623 #define CLK_APB_DIV_PRIVED __BIT(31)
624 #define CLK_APB_DIV_VALUE __BITS(1,0) // n = n + 1
625
626 #define ARMCORE_CLK_APB_DIV_TRIGGER 0xa10
627 #define CLK_APB_DIV_TRIGGER_PRIVED __BIT(31)
628 #define CLK_APB_DIV_TRIGGER_OVERRIDE __BIT(0)
629
630 #define ARMCORE_CLK_PLLARMA 0xc00
631 #define CLK_PLLARMA_PDIV __BITS(26,24) // = (n ? n : 16(?))
632 #define CLK_PLLARMA_NDIV_INT __BITS(17,8) // = (n ? n : 1024)
633
634 #define ARMCORE_CLK_PLLARMB 0xc04
635 #define CLK_PLLARMB_NDIV_FRAC __BITS(19,0) // = 1 / n
636
637 #endif
638
639 #ifdef IDM_PRIVATE
640
641 #define IDM_ARMCORE_M0_BASE 0x00000
642 #define IDM_PCIE_M0_BASE 0x01000
643 #define IDM_PCIE_M1_BASE 0x02000
644 #define IDM_PCIE_M2_BASE 0x03000
645 #define IDM_USB3_BASE 0x05000
646 #define IDM_ARMCORE_S1_BASE 0x06000
647 #define IDM_ARMCORE_S0_BASE 0x07000
648 #define IDM_DDR_S1_BASE 0x08000
649 #define IDM_DDR_S2_BASE 0x09000
650 #define IDM_ROM_S0_BASE 0x0d000
651 #define IDM_AMAC0_BASE 0x10000
652 #define IDM_AMAC1_BASE 0x11000
653 #define IDM_AMAC2_BASE 0x12000
654 #define IDM_AMAC3_BASE 0x13000
655 #define IDM_DMAC_M0_BASE 0x14000
656 #define IDM_USB2_BASE 0x15000
657 #define IDM_SDIO_BASE 0x16000
658 #define IDM_I2S_M0_BASE 0x17000
659 #define IDM_A9JTAG_M0_BASE 0x18000
660 #define IDM_NAND_BASE 0x1a000
661 #define IDM_QSPI_BASE 0x1b000
662 #define IDM_APBX_BASE 0x21000
663
664 #define IDM_IO_CONTROL_DIRECT 0x0408
665 #define IDM_IO_STATUS 0x0500
666 #define IDM_RESET_CONTROL 0x0800
667 #define IDM_RESET_STATUS 0x0804
668 #define IDM_INTERRUPT_STATUS 0x0a00
669
670 #define IO_CONTROL_DIRECT_ARUSER __BITS(29,25)
671 #define IO_CONTROL_DIRECT_AWUSER __BITS(24,20)
672 #define IO_CONTROL_DIRECT_ARCACHE __BITS(19,16)
673 #define IO_CONTROL_DIRECT_AWCACHE __BITS(10,7)
674 #define AXCACHE_WA __BIT(3)
675 #define AXCACHE_RA __BIT(2)
676 #define AXCACHE_C __BIT(1)
677 #define AXCACHE_B __BIT(0)
678 #define IO_CONTROL_DIRECT_UARTCLKSEL __BIT(17)
679 #define IO_CONTROL_DIRECT_CLK_250_SEL __BIT(6)
680 #define IO_CONTROL_DIRECT_DIRECT_GMII_MODE __BIT(5)
681 #define IO_CONTROL_DIRECT_TX_CLK_OUT_INVERT_EN __BIT(4)
682 #define IO_CONTROL_DIRECT_DEST_SYNC_MODE_EN __BIT(3)
683 #define IO_CONTROL_DIRECT_SOURCE_SYNC_MODE_EN __BIT(2)
684 #define IO_CONTROL_DIRECT_CLK_GATING_EN __BIT(0)
685
686 #define RESET_CONTROL_RESET __BIT(0)
687
688 #endif /* IDM_PRIVATE */
689
690 #ifdef USBH_PRIVATE
691 #define USBH_PHY_CTRL_P0 0x200
692 #define USBH_PHY_CTRL_P1 0x204
693
694 #define USBH_PHY_CTRL_INIT 0x3ff
695 #endif
696
697 #ifdef GMAC_PRIVATE
698
699 struct gmac_txdb {
700 uint32_t txdb_flags;
701 uint32_t txdb_buflen;
702 uint32_t txdb_addrlo;
703 uint32_t txdb_addrhi;
704 };
705 #define TXDB_FLAG_SF __BIT(31) // Start oF Frame
706 #define TXDB_FLAG_EF __BIT(30) // End oF Frame
707 #define TXDB_FLAG_IC __BIT(29) // Interupt on Completetion
708 #define TXDB_FLAG_ET __BIT(28) // End Of Table
709
710 struct gmac_rxdb {
711 uint32_t rxdb_flags;
712 uint32_t rxdb_buflen;
713 uint32_t rxdb_addrlo;
714 uint32_t rxdb_addrhi;
715 };
716 #define RXDB_FLAG_SF __BIT(31) // Start oF Frame (ignored)
717 #define RXDB_FLAG_EF __BIT(30) // End oF Frame (ignored)
718 #define RXDB_FLAG_IC __BIT(29) // Interupt on Completetion
719 #define RXDB_FLAG_ET __BIT(28) // End Of Table
720
721 #define RXSTS_FRAMELEN __BITS(15,0) // # of bytes (including padding)
722 #define RXSTS_PKTTYPE __BITS(17,16)
723 #define RXSTS_PKTTYPE_UC 0 // Unicast
724 #define RXSTS_PKTTYPE_MC 1 // Multicast
725 #define RXSTS_PKTTYPE_BC 2 // Broadcast
726 #define RXSTS_VLAN_PRESENT __BIT(18)
727 #define RXSTS_CRC_ERROR __BIT(19)
728 #define RXSTS_OVERSIZED __BIT(20)
729 #define RXSTS_CTF_HIT __BIT(21)
730 #define RXSTS_CTF_ERROR __BIT(22)
731 #define RXSTS_PKT_OVERFLOW __BIT(23)
732 #define RXSTS_DESC_COUNT __BITS(27,24) // # of descriptors - 1
733
734 #define GMAC_DEVCONTROL 0x000
735 #define ENABLE_DEL_G_TXC __BIT(21)
736 #define ENABLE_DEL_G_RXC __BIT(20)
737 #define TXC_DRNG __BITS(19,18)
738 #define RXC_DRNG __BITS(17,16)
739 #define TXQ_FLUSH __BIT(8)
740 #define NWAY_AUTO_POLL_EN __BIT(7)
741 #define FLOW_CTRL_MODE __BITS(6,5)
742 #define MIB_RD_RESET_EN __BIT(4)
743 #define RGMII_LINK_STATUS_SEL __BIT(3)
744 #define CPU_FLOW_CTRL_ON __BIT(2)
745 #define RXQ_OVERFLOW_CTRL_SEL __BIT(1)
746 #define TXARB_STRICT_MODE __BIT(0)
747 #define GMAC_DEVSTATUS 0x004
748 #define GMAC_BISTSTATUS 0x00c
749 #define GMAC_INTSTATUS 0x020
750 #define GMAC_INTMASK 0x024
751 #define TXQECCUNCORRECTED __BIT(31)
752 #define TXQECCCORRECTED __BIT(30)
753 #define RXQECCUNCORRECTED __BIT(29)
754 #define RXQECCCORRECTED __BIT(28)
755 #define XMTINT_3 __BIT(27)
756 #define XMTINT_2 __BIT(26)
757 #define XMTINT_1 __BIT(25)
758 #define XMTINT_0 __BIT(24)
759 #define RCVINT __BIT(16)
760 #define XMTUF __BIT(15)
761 #define RCVFIFOOF __BIT(14)
762 #define RCVDESCUF __BIT(13)
763 #define DESCPROTOERR __BIT(12)
764 #define DATAERR __BIT(11)
765 #define DESCERR __BIT(10)
766 #define INT_SW_LINK_ST_CHG __BIT(8)
767 #define INT_TIMEOUT __BIT(7)
768 #define MIB_TX_INT __BIT(6)
769 #define MIB_RX_INT __BIT(5)
770 #define MDIOINT __BIT(4)
771 #define NWAYLINKSTATINT __BIT(3)
772 #define TXQ_FLUSH_DONEINT __BIT(2)
773 #define MIB_TX_OVERFLOW __BIT(1)
774 #define MIB_RX_OVERFLOW __BIT(0)
775 #define GMAC_GPTIMER 0x028
776
777 #define GMAC_INTRCVLAZY 0x100
778 #define INTRCVLAZY_FRAMECOUNT __BITS(31,24)
779 #define INTRCVLAZY_TIMEOUT __BITS(23,0)
780 #define GMAC_FLOWCNTL_TH 0x104
781 #define GMAC_TXARB_WRR_TH 0x108
782 #define GMAC_GMACIDLE_CNT_TH 0x10c
783
784 #define GMAC_FIFOACCESSADDR 0x120
785 #define GMAC_FIFOACCESSBYTE 0x124
786 #define GMAC_FIFOACCESSDATA 0x128
787
788 #define GMAC_PHYACCESS 0x180
789 #define GMAC_PHYCONTROL 0x188
790 #define GMAC_TXQCONTROL 0x18c
791 #define GMAC_RXQCONTROL 0x190
792 #define GMAC_GPIOSELECT 0x194
793 #define GMAC_GPIOOUTPUTEN 0x198
794 #define GMAC_TXQRXQMEMORYCONTROL 0x1a0
795 #define GMAC_MEMORYECCSTATUS 0x1a4
796
797 #define GMAC_CLOCKCONTROLSTATUS 0x1e0
798 #define GMAC_POWERCONTROL 0x1e8
799
800 #define GMAC_XMTCONTROL 0x200
801 #define XMTCTL_PREFETCH_THRESH __BITS(25,24)
802 #define XMTCTL_PREFETCH_CTL __BITS(23,21)
803 #define XMTCTL_BURSTLEN __BITS(20,18)
804 #define XMTCTL_ADDREXT __BITS(17,16)
805 #define XMTCTL_DMA_ACT_INDEX __BIT(13)
806 #define XMTCTL_PARITY_DIS __BIT(11)
807 #define XMTCTL_OUTSTANDING_READS __BITS(7,6)
808 #define XMTCTL_BURST_ALIGN_EN __BIT(5)
809 #define XMTCTL_DMA_LOOPBACK __BIT(2)
810 #define XMTCTL_SUSPEND __BIT(1)
811 #define XMTCTL_ENABLE __BIT(0)
812 #define GMAC_XMTPTR 0x204
813 #define XMT_LASTDSCR __BITS(11,4)
814 #define GMAC_XMTADDR_LOW 0x208
815 #define GMAC_XMTADDR_HIGH 0x20c
816 #define GMAC_XMTSTATUS0 0x210
817 #define XMTSTATE __BITS(31,28)
818 #define XMTSTATE_DIS 0
819 #define XMTSTATE_ACTIVE 1
820 #define XMTSTATE_IDLE_WAIT 2
821 #define XMTSTATE_STOPPED 3
822 #define XMTSTATE_SUSP_PENDING 4
823 #define XMT_CURRDSCR __BITS(11,4)
824 #define GMAC_XMTSTATUS1 0x214
825 #define XMTERR __BITS(31,28)
826 #define XMT_ACTIVEDSCR __BITS(11,4)
827 #define GMAC_RCVCONTROL 0x220
828 #define RCVCTL_PREFETCH_THRESH __BITS(25,24)
829 #define RCVCTL_PREFETCH_CTL __BITS(23,21)
830 #define RCVCTL_BURSTLEN __BITS(20,18)
831 #define RCVCTL_ADDREXT __BITS(17,16)
832 #define RCVCTL_DMA_ACT_INDEX __BIT(13)
833 #define RCVCTL_PARITY_DIS __BIT(11)
834 #define RCVCTL_OFLOW_CONTINUE __BIT(10)
835 #define RCVCTL_SEPRXHDRDESC __BIT(9)
836 #define RCVCTL_RCVOFFSET __BITS(7,1)
837 #define RCVCTL_ENABLE __BIT(0)
838 #define GMAC_RCVPTR 0x224
839 #define RCVPTR __BITS(11,4)
840 #define GMAC_RCVADDR_LOW 0x228
841 #define GMAC_RCVADDR_HIGH 0x22c
842 #define GMAC_RCVSTATUS0 0x230
843 #define RCVSTATE __BITS(31,28)
844 #define RCVSTATE_DIS 0
845 #define RCVSTATE_ACTIVE 1
846 #define RCVSTATE_IDLE_WAIT 2
847 #define RCVSTATE_STOPPED 3
848 #define RCVSTATE_SUSP_PENDING 4
849 #define RCV_CURRDSCR __BITS(11,4)
850 #define GMAC_RCVSTATUS1 0x234
851 #define RCV_ACTIVEDSCR __BITS(11,4)
852
853 #define GMAC_TX_GD_OCTETS_LO 0x300
854
855
856 #define UNIMAC_IPG_HD_BPG_CNTL 0x804
857 #define UNIMAC_COMMAND_CONFIG 0x808
858 #define RUNT_FILTER_DIS __BIT(30)
859 #define OOB_EFC_EN __BIT(29)
860 #define IGNORE_TX_PAUSE __BIT(28)
861 #define PRBL_ENA __BIT(27)
862 #define RX_ERR_DIS __BIT(26)
863 #define LINE_LOOPBACK __BIT(25)
864 #define NO_LENGTH_CHECK __BIT(24)
865 #define CNTRL_FRM_ENA __BIT(23)
866 #define ENA_EXT_CONFIG __BIT(22)
867 #define EN_INTERNAL_TX_CRS __BIT(21)
868 #define SW_OVERRIDE_RX __BIT(18)
869 #define SW_OVERRIDE_TX __BIT(17)
870 #define MAC_LOOP_CON __BIT(16)
871 #define LOOP_ENA __BIT(15)
872 #define RCS_CORRUPT_URUN_EN __BIT(14)
873 #define SW_RESET __BIT(13)
874 #define OVERFLOW_EN __BIT(12)
875 #define RX_LOW_LATENCY_EN __BIT(11)
876 #define HD_ENA __BIT(10)
877 #define TX_ADDR_INS __BIT(9)
878 #define PAUSE_IGNORE __BIT(8)
879 #define PAUSE_FWD __BIT(7)
880 #define CRC_FWD __BIT(6)
881 #define PAD_EN __BIT(5)
882 #define PROMISC_EN __BIT(4)
883 #define ETH_SPEED __BITS(3,2)
884 #define ETH_SPEED_10 0
885 #define ETH_SPEED_100 1
886 #define ETH_SPEED_1000 2
887 #define ETH_SPEED_2500 3
888 #define RX_ENA __BIT(1)
889 #define TX_ENA __BIT(0)
890 #define UNIMAC_MAC_0 0x80c // bits 16:47 of macaddr
891 #define UNIMAC_MAC_1 0x810 // bits 0:15 of macaddr
892 #define UNIMAC_FRAME_LEN 0x814
893 #define UNIMAC_PAUSE_QUANTA 0x818
894 #define UNIMAC_TX_TS_SEQ_ID 0x83c
895 #define UNIMAC_MAC_MODE 0x844
896 #define UNIMAC_TAG_0 0x848
897 #define UNIMAC_TAG_1 0x84c
898 #define UNIMAC_RX_PAUSE_QUANTA_SCALE 0x850
899 #define UNIMAC_TX_PREAMBLE 0x854
900 #define UNIMAC_TX_IPG_LENGTH 0x85c
901 #define UNIMAC_PRF_XOFF_TIMER 0x860
902 #define UNIMAC_UMAC_EEE_CTRL 0x864
903 #define UNIMAC_MII_EEE_DELAY_ENTRY_TIMER 0x868
904 #define UNIMAC_GMII_EEE_DELAY_ENTRY_TIMER 0x86c
905 #define UNIMAC_UMAC_EEE_REF_COUNT 0x870
906 #define UNIMAC_UMAX_RX_PKT_DROP_STATUS 0x878
907
908 #define UNIMAC_UMAC_SYMMETRIC_IDLE_THRESHOLD 0x87c // RX IDLE threshold for LPI prediction
909 #define UNIMAC_MII_EEE_WAKE_TIMER 0x880 // MII_EEE Wake timer
910 #define UNIMAC_GMII_EEE_WAKE_TIMER 0x884 // GMII_EEE Wake timer
911 #define UNIMAC_UMAC_REV_ID 0x888 // UNIMAC_REV_ID
912 #define UNIMAC_MAC_PFC_TYPE 0xb00 // Programmable ethertype (GNAT 13440)
913 #define UNIMAC_MAC_PFC_OPCODE 0xb04 // Programmable opcode (GNAT 13440)
914 #define UNIMAC_MAC_PFC_DA_0 0xb08 // lower 32 bits of programmable DA for PPP (GNAT 13897)
915 #define UNIMAC_MAC_PFC_DA_1 0xb0c // upper 16 bits of programmable DA for PPP (GNAT 13897)
916 #define UNIMAC_MACSEC_CNTRL 0xb14 // Miscellaneous control for MACSEC (GNAT 11599,11600,12078,12198)
917 #define UNIMAC_TS_STATUS_CNTRL 0xb18 // Timestamp control/status
918 #define UNIMAC_TX_TS_DATA 0xb1c // Transmit Timestamp data
919 #define UNIMAC_PAUSE_CONTROL 0xb30 // PAUSE frame timer control register
920 #define UNIMAC_FLUSH_CONTROL 0xb34 // Flush enable control register
921 #define UNIMAC_RXFIFO_STAT 0xb38 // RXFIFO status register
922 #define UNIMAC_TXFIFO_STAT 0xb3c // TXFIFO status register
923 #define UNIMAC_MAC_PFC_CTRL 0xb40 // PPP control register
924 #define UNIMAC_MAC_PFC_REFRESH_CTRL 0xb44 // PPP refresh control register
925
926 #endif /* GMAC_PRIVATE */
927
928 #ifdef NAND_PRIVATE
929
930 #define NAND_REVISION 0x0000 // NAND Revision
931 #define NAND_CMD_START 0x0004 // Nand Flash Command Start
932 #define NAND_CMD_EXT_ADDR 0x0008 // Nand Flash Command Extended Address
933 #define NAND_CMD_ADDR 0x000c // Nand Flash Command Address
934 #define NAND_CMD_END_ADDR 0x0010 // Nand Flash Command End Address
935 #define NAND_INTFC_STATUS 0x0014 // Nand Flash Interface Status
936 #define NAND_CS_NAND_XOR 0x001c // Nand Flash EBI
937 #define NAND_LL_OP 0x0020 // Nand Flash Low Level Operation
938 #define NAND_MPLANE_BASE_EXT_ADDR 0x0024 // Nand Flash Multiplane base address
939 #define NAND_MPLANE_BASE_ADDR 0x0028 // Nand Flash Multiplane base address
940 #define NAND_ACC_CONTROL_CS0 0x0050 // Nand Flash Access Control
941 #define NAND_CONFIG_CS0 0x0054 // Nand Flash Config
942 #define NAND_TIMING_1_CS0 0x0058 // Nand Flash Timing Parameters 1
943 #define NAND_TIMING_2_CS0 0x005c // Nand Flash Timing Parameters 2
944 #define NAND_ACC_CONTROL_CS1 0x0060 // Nand Flash Access Control
945 #define NAND_CONFIG_CS1 0x0064 // Nand Flash
946 #define NAND_TIMING_1_CS1 0x0068 // Nand Flash Timing Parameters 1
947 #define NAND_TIMING_2_CS1 0x006c // Nand Flash Timing Parameters 2
948 #define NAND_CORR_STAT_THRESHOLD 0x00c0 // Correctable Error Reporting Threshold
949 #define NAND_BLK_WR_PROTECT 0x00c8 // Block Write Protect Enable and Size for EBI_CS0b
950 #define NAND_MULTIPLANE_OPCODES_1 0x00cc // Nand Flash Multiplane Customized Opcodes
951 #define NAND_MULTIPLANE_OPCODES_2 0x00d0 // Nand Flash Multiplane Customized Opcodes
952 #define NAND_MULTIPLANE_CTRL 0x00d4 // Nand Flash Multiplane Control
953 #define NAND_UNCORR_ERROR_COUNT 0x00fc // Read Uncorrectable Event Count
954 #define NAND_CORR_ERROR_COUNT 0x0100 // Read Error Count
955 #define NAND_READ_ERROR_COUNT 0x0104 // Read Error Count
956 #define NAND_BLOCK_LOCK_STATUS 0x0108 // Nand Flash Block Lock Status
957 #define NAND_ECC_CORR_EXT_ADDR 0x010c // ECC Correctable Error Extended Address
958 #define NAND_ECC_CORR_ADDR 0x0110 // ECC Correctable Error Address
959 #define NAND_ECC_UNC_EXT_ADDR 0x0114 // ECC Uncorrectable Error Extended Address
960 #define NAND_ECC_UNC_ADDR 0x0118 // ECC Uncorrectable Error Address
961 #define NAND_FLASH_READ_EXT_ADDR 0x011c // Flash Read Data Extended Address
962 #define NAND_FLASH_READ_ADDR 0x0120 // Flash Read Data Address
963 #define NAND_PROGRAM_PAGE_EXT_ADDR 0x0124 // Page Program Extended Address
964 #define NAND_PROGRAM_PAGE_ADDR 0x0128 // Page Program Address
965 #define NAND_COPY_BACK_EXT_ADDR 0x012c // Copy Back Extended Address
966 #define NAND_COPY_BACK_ADDR 0x0130 // Copy Back Address
967 #define NAND_BLOCK_ERASE_EXT_ADDR 0x0134 // Block Erase Extended Address
968 #define NAND_BLOCK_ERASE_ADDR 0x0138 // Block Erase Address
969 #define NAND_INV_READ_EXT_ADDR 0x013c // Flash Invalid Data Extended Address
970 #define NAND_INV_READ_ADDR 0x0140 // Flash Invalid Data Address
971 #define NAND_INIT_STATUS 0x0144 // Initialization status
972 #define NAND_ONFI_STATUS 0x0148 // ONFI Status
973 #define NAND_ONFI_DEBUG_DATA 0x014c // ONFI Debug Data
974 #define NAND_SEMAPHORE 0x0150 // Semaphore
975 #define NAND_FLASH_DEVICE_ID 0x0194 // Nand Flash Device ID
976 #define NAND_FLASH_DEVICE_ID_EXT 0x0198 // Nand Flash Extended Device ID
977 #define NAND_LL_RDDATA 0x019c // Nand Flash Low Level Read Data
978
979 #define NAND_SPARE_AREA_READ_OFSn(n) (0x0200+4*(n)) // Nand Flash Spare Area Read Bytes
980 #define NAND_SPARE_AREA_WRITE_OFSn(n) (0x0280+4*(n)) // Nand Flash Spare Area Write Bytes 8-11
981 #define NAND_FLASH_CACHEn(n) (0x0400+4*(n)) // Flash Cache Buffer Read Access
982
983 #define NAND_DIRECT_READ_RD_MISS 0x0f00 // Interrupt from Nand indicating a read miss on internal memory
984 #define NAND_BLOCK_ERASE_COMPLETE 0x0f04 // Interrupt from Nand indicating block erase
985 #define NAND_COPY_BACK_COMPLETE 0x0f08 // Interrupt from Nand indicating Copy-Back complete.
986 #define NAND_PROGRAM_PAGE_COMPLETE 0x0f0c // Interrupt from nand indicating page program is complete.
987 #define NAND_RO_CTLR_READY 0x0f10 // Interrupt from nand indicating controller ready
988 #define NAND_NAND_RB_B 0x0f14 // Interrupt from nand indicating status of Nand Flash ready_bus pin
989 #define NAND_ECC_MIPS_UNCORR 0x0f18 // Interrupt from Nand indicating Uncorrectable error
990 #define NAND_ECC_MIPS_CORR 0x0f1c // Interrupt from Nand indicating correctable error
991
992 #define NAND_CMD_START_OPCODE __BITS(28,24)
993 #define NAND_CMD_START_OPCODE_DEFAULT 0
994 #define NAND_CMD_START_OPCODE_NULL 0
995 #define NAND_CMD_START_OPCODE_PAGE_READ 1
996 #define NAND_CMD_START_OPCODE_SPARE_AREA_READ 2
997 #define NAND_CMD_START_OPCODE_STATUS_READ 3
998 #define NAND_CMD_START_OPCODE_PROGRAM_PAGE 4
999 #define NAND_CMD_START_OPCODE_PROGRAM_SPARE_AREA 5
1000 #define NAND_CMD_START_OPCODE_COPY_BACK 6
1001 #define NAND_CMD_START_OPCODE_DEVICE_ID_READ 7
1002 #define NAND_CMD_START_OPCODE_BLOCK_ERASE 8
1003 #define NAND_CMD_START_OPCODE_FLASH_RESET 9
1004 #define NAND_CMD_START_OPCODE_BLOCKS_LOCK 10
1005 #define NAND_CMD_START_OPCODE_BLOCKS_LOCK_DOWN 11
1006 #define NAND_CMD_START_OPCODE_BLOCKS_UNLOCK 12
1007 #define NAND_CMD_START_OPCODE_READ_BLOCKS_LOCK_STATUS 13
1008 #define NAND_CMD_START_OPCODE_PARAMETER_READ 14
1009 #define NAND_CMD_START_OPCODE_PARAMETER_CHANGE_COL 15
1010 #define NAND_CMD_START_OPCODE_LOW_LEVEL_OP 16
1011 #define NAND_CMD_START_OPCODE_PAGE_READ_MULTI 17
1012 #define NAND_CMD_START_OPCODE_STATUS_READ_MULTI 18
1013 #define NAND_CMD_START_OPCODE_PROGRAM_PAGE_MULTI 19
1014 #define NAND_CMD_START_OPCODE_PROGRAM_PAGE_MULTI_CACHE 20
1015 #define NAND_CMD_START_OPCODE_BLOCK_ERASE_MULTI 21
1016 #define NAND_CMD_START_CSEL __BITS(18,16)
1017 #define NAND_CMD_EXT_ADDRESS __BITS(15,0)
1018
1019 #endif /* NAND_PRIVATE */
1020
1021 #endif /* _ARM_BROADCOM_BCM53XX_REG_H_ */
1022