aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-au1x00/au1000.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/mach-au1x00/au1000.h')
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000.h1529
1 files changed, 589 insertions, 940 deletions
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h
index b4c3ecb17d48..a7eec3364a64 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000.h
@@ -34,6 +34,558 @@
34#ifndef _AU1000_H_ 34#ifndef _AU1000_H_
35#define _AU1000_H_ 35#define _AU1000_H_
36 36
37/* SOC Interrupt numbers */
38/* Au1000-style (IC0/1): 2 controllers with 32 sources each */
39#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
40#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
41#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_LAST + 1)
42#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
43#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST
44
45/* Au1300-style (GPIC): 1 controller with up to 128 sources */
46#define ALCHEMY_GPIC_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
47#define ALCHEMY_GPIC_INT_NUM 128
48#define ALCHEMY_GPIC_INT_LAST (ALCHEMY_GPIC_INT_BASE + ALCHEMY_GPIC_INT_NUM - 1)
49
50/* common clock names, shared among all variants. AUXPLL2 is Au1300 */
51#define ALCHEMY_ROOT_CLK "root_clk"
52#define ALCHEMY_CPU_CLK "cpu_clk"
53#define ALCHEMY_AUXPLL_CLK "auxpll_clk"
54#define ALCHEMY_AUXPLL2_CLK "auxpll2_clk"
55#define ALCHEMY_SYSBUS_CLK "sysbus_clk"
56#define ALCHEMY_PERIPH_CLK "periph_clk"
57#define ALCHEMY_MEM_CLK "mem_clk"
58#define ALCHEMY_LR_CLK "lr_clk"
59#define ALCHEMY_FG0_CLK "fg0_clk"
60#define ALCHEMY_FG1_CLK "fg1_clk"
61#define ALCHEMY_FG2_CLK "fg2_clk"
62#define ALCHEMY_FG3_CLK "fg3_clk"
63#define ALCHEMY_FG4_CLK "fg4_clk"
64#define ALCHEMY_FG5_CLK "fg5_clk"
65
66/* Au1300 peripheral interrupt numbers */
67#define AU1300_FIRST_INT (ALCHEMY_GPIC_INT_BASE)
68#define AU1300_UART1_INT (AU1300_FIRST_INT + 17)
69#define AU1300_UART2_INT (AU1300_FIRST_INT + 25)
70#define AU1300_UART3_INT (AU1300_FIRST_INT + 27)
71#define AU1300_SD1_INT (AU1300_FIRST_INT + 32)
72#define AU1300_SD2_INT (AU1300_FIRST_INT + 38)
73#define AU1300_PSC0_INT (AU1300_FIRST_INT + 48)
74#define AU1300_PSC1_INT (AU1300_FIRST_INT + 52)
75#define AU1300_PSC2_INT (AU1300_FIRST_INT + 56)
76#define AU1300_PSC3_INT (AU1300_FIRST_INT + 60)
77#define AU1300_NAND_INT (AU1300_FIRST_INT + 62)
78#define AU1300_DDMA_INT (AU1300_FIRST_INT + 75)
79#define AU1300_MMU_INT (AU1300_FIRST_INT + 76)
80#define AU1300_MPU_INT (AU1300_FIRST_INT + 77)
81#define AU1300_GPU_INT (AU1300_FIRST_INT + 78)
82#define AU1300_UDMA_INT (AU1300_FIRST_INT + 79)
83#define AU1300_TOY_INT (AU1300_FIRST_INT + 80)
84#define AU1300_TOY_MATCH0_INT (AU1300_FIRST_INT + 81)
85#define AU1300_TOY_MATCH1_INT (AU1300_FIRST_INT + 82)
86#define AU1300_TOY_MATCH2_INT (AU1300_FIRST_INT + 83)
87#define AU1300_RTC_INT (AU1300_FIRST_INT + 84)
88#define AU1300_RTC_MATCH0_INT (AU1300_FIRST_INT + 85)
89#define AU1300_RTC_MATCH1_INT (AU1300_FIRST_INT + 86)
90#define AU1300_RTC_MATCH2_INT (AU1300_FIRST_INT + 87)
91#define AU1300_UART0_INT (AU1300_FIRST_INT + 88)
92#define AU1300_SD0_INT (AU1300_FIRST_INT + 89)
93#define AU1300_USB_INT (AU1300_FIRST_INT + 90)
94#define AU1300_LCD_INT (AU1300_FIRST_INT + 91)
95#define AU1300_BSA_INT (AU1300_FIRST_INT + 92)
96#define AU1300_MPE_INT (AU1300_FIRST_INT + 93)
97#define AU1300_ITE_INT (AU1300_FIRST_INT + 94)
98#define AU1300_AES_INT (AU1300_FIRST_INT + 95)
99#define AU1300_CIM_INT (AU1300_FIRST_INT + 96)
100
101/**********************************************************************/
102
103/*
104 * Physical base addresses for integrated peripherals
105 * 0..au1000 1..au1500 2..au1100 3..au1550 4..au1200 5..au1300
106 */
107
108#define AU1000_AC97_PHYS_ADDR 0x10000000 /* 012 */
109#define AU1300_ROM_PHYS_ADDR 0x10000000 /* 5 */
110#define AU1300_OTP_PHYS_ADDR 0x10002000 /* 5 */
111#define AU1300_VSS_PHYS_ADDR 0x10003000 /* 5 */
112#define AU1300_UART0_PHYS_ADDR 0x10100000 /* 5 */
113#define AU1300_UART1_PHYS_ADDR 0x10101000 /* 5 */
114#define AU1300_UART2_PHYS_ADDR 0x10102000 /* 5 */
115#define AU1300_UART3_PHYS_ADDR 0x10103000 /* 5 */
116#define AU1000_USB_OHCI_PHYS_ADDR 0x10100000 /* 012 */
117#define AU1000_USB_UDC_PHYS_ADDR 0x10200000 /* 0123 */
118#define AU1300_GPIC_PHYS_ADDR 0x10200000 /* 5 */
119#define AU1000_IRDA_PHYS_ADDR 0x10300000 /* 02 */
120#define AU1200_AES_PHYS_ADDR 0x10300000 /* 45 */
121#define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */
122#define AU1300_GPU_PHYS_ADDR 0x10500000 /* 5 */
123#define AU1000_MAC0_PHYS_ADDR 0x10500000 /* 023 */
124#define AU1000_MAC1_PHYS_ADDR 0x10510000 /* 023 */
125#define AU1000_MACEN_PHYS_ADDR 0x10520000 /* 023 */
126#define AU1100_SD0_PHYS_ADDR 0x10600000 /* 245 */
127#define AU1300_SD1_PHYS_ADDR 0x10601000 /* 5 */
128#define AU1300_SD2_PHYS_ADDR 0x10602000 /* 5 */
129#define AU1100_SD1_PHYS_ADDR 0x10680000 /* 24 */
130#define AU1300_SYS_PHYS_ADDR 0x10900000 /* 5 */
131#define AU1550_PSC2_PHYS_ADDR 0x10A00000 /* 3 */
132#define AU1550_PSC3_PHYS_ADDR 0x10B00000 /* 3 */
133#define AU1300_PSC0_PHYS_ADDR 0x10A00000 /* 5 */
134#define AU1300_PSC1_PHYS_ADDR 0x10A01000 /* 5 */
135#define AU1300_PSC2_PHYS_ADDR 0x10A02000 /* 5 */
136#define AU1300_PSC3_PHYS_ADDR 0x10A03000 /* 5 */
137#define AU1000_I2S_PHYS_ADDR 0x11000000 /* 02 */
138#define AU1500_MAC0_PHYS_ADDR 0x11500000 /* 1 */
139#define AU1500_MAC1_PHYS_ADDR 0x11510000 /* 1 */
140#define AU1500_MACEN_PHYS_ADDR 0x11520000 /* 1 */
141#define AU1000_UART0_PHYS_ADDR 0x11100000 /* 01234 */
142#define AU1200_SWCNT_PHYS_ADDR 0x1110010C /* 4 */
143#define AU1000_UART1_PHYS_ADDR 0x11200000 /* 0234 */
144#define AU1000_UART2_PHYS_ADDR 0x11300000 /* 0 */
145#define AU1000_UART3_PHYS_ADDR 0x11400000 /* 0123 */
146#define AU1000_SSI0_PHYS_ADDR 0x11600000 /* 02 */
147#define AU1000_SSI1_PHYS_ADDR 0x11680000 /* 02 */
148#define AU1500_GPIO2_PHYS_ADDR 0x11700000 /* 1234 */
149#define AU1000_IC1_PHYS_ADDR 0x11800000 /* 01234 */
150#define AU1000_SYS_PHYS_ADDR 0x11900000 /* 012345 */
151#define AU1550_PSC0_PHYS_ADDR 0x11A00000 /* 34 */
152#define AU1550_PSC1_PHYS_ADDR 0x11B00000 /* 34 */
153#define AU1000_MEM_PHYS_ADDR 0x14000000 /* 01234 */
154#define AU1000_STATIC_MEM_PHYS_ADDR 0x14001000 /* 01234 */
155#define AU1300_UDMA_PHYS_ADDR 0x14001800 /* 5 */
156#define AU1000_DMA_PHYS_ADDR 0x14002000 /* 012 */
157#define AU1550_DBDMA_PHYS_ADDR 0x14002000 /* 345 */
158#define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 345 */
159#define AU1000_MACDMA0_PHYS_ADDR 0x14004000 /* 0123 */
160#define AU1000_MACDMA1_PHYS_ADDR 0x14004200 /* 0123 */
161#define AU1200_CIM_PHYS_ADDR 0x14004000 /* 45 */
162#define AU1500_PCI_PHYS_ADDR 0x14005000 /* 13 */
163#define AU1550_PE_PHYS_ADDR 0x14008000 /* 3 */
164#define AU1200_MAEBE_PHYS_ADDR 0x14010000 /* 4 */
165#define AU1200_MAEFE_PHYS_ADDR 0x14012000 /* 4 */
166#define AU1300_MAEITE_PHYS_ADDR 0x14010000 /* 5 */
167#define AU1300_MAEMPE_PHYS_ADDR 0x14014000 /* 5 */
168#define AU1550_USB_OHCI_PHYS_ADDR 0x14020000 /* 3 */
169#define AU1200_USB_CTL_PHYS_ADDR 0x14020000 /* 4 */
170#define AU1200_USB_OTG_PHYS_ADDR 0x14020020 /* 4 */
171#define AU1200_USB_OHCI_PHYS_ADDR 0x14020100 /* 4 */
172#define AU1200_USB_EHCI_PHYS_ADDR 0x14020200 /* 4 */
173#define AU1200_USB_UDC_PHYS_ADDR 0x14022000 /* 4 */
174#define AU1300_USB_EHCI_PHYS_ADDR 0x14020000 /* 5 */
175#define AU1300_USB_OHCI0_PHYS_ADDR 0x14020400 /* 5 */
176#define AU1300_USB_OHCI1_PHYS_ADDR 0x14020800 /* 5 */
177#define AU1300_USB_CTL_PHYS_ADDR 0x14021000 /* 5 */
178#define AU1300_USB_OTG_PHYS_ADDR 0x14022000 /* 5 */
179#define AU1300_MAEBSA_PHYS_ADDR 0x14030000 /* 5 */
180#define AU1100_LCD_PHYS_ADDR 0x15000000 /* 2 */
181#define AU1200_LCD_PHYS_ADDR 0x15000000 /* 45 */
182#define AU1500_PCI_MEM_PHYS_ADDR 0x400000000ULL /* 13 */
183#define AU1500_PCI_IO_PHYS_ADDR 0x500000000ULL /* 13 */
184#define AU1500_PCI_CONFIG0_PHYS_ADDR 0x600000000ULL /* 13 */
185#define AU1500_PCI_CONFIG1_PHYS_ADDR 0x680000000ULL /* 13 */
186#define AU1000_PCMCIA_IO_PHYS_ADDR 0xF00000000ULL /* 012345 */
187#define AU1000_PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL /* 012345 */
188#define AU1000_PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL /* 012345 */
189
190/**********************************************************************/
191
192
193/*
194 * Au1300 GPIO+INT controller (GPIC) register offsets and bits
195 * Registers are 128bits (0x10 bytes), divided into 4 "banks".
196 */
197#define AU1300_GPIC_PINVAL 0x0000
198#define AU1300_GPIC_PINVALCLR 0x0010
199#define AU1300_GPIC_IPEND 0x0020
200#define AU1300_GPIC_PRIENC 0x0030
201#define AU1300_GPIC_IEN 0x0040 /* int_mask in manual */
202#define AU1300_GPIC_IDIS 0x0050 /* int_maskclr in manual */
203#define AU1300_GPIC_DMASEL 0x0060
204#define AU1300_GPIC_DEVSEL 0x0080
205#define AU1300_GPIC_DEVCLR 0x0090
206#define AU1300_GPIC_RSTVAL 0x00a0
207/* pin configuration space. one 32bit register for up to 128 IRQs */
208#define AU1300_GPIC_PINCFG 0x1000
209
210#define GPIC_GPIO_TO_BIT(gpio) \
211 (1 << ((gpio) & 0x1f))
212
213#define GPIC_GPIO_BANKOFF(gpio) \
214 (((gpio) >> 5) * 4)
215
216/* Pin Control bits: who owns the pin, what does it do */
217#define GPIC_CFG_PC_GPIN 0
218#define GPIC_CFG_PC_DEV 1
219#define GPIC_CFG_PC_GPOLOW 2
220#define GPIC_CFG_PC_GPOHIGH 3
221#define GPIC_CFG_PC_MASK 3
222
223/* assign pin to MIPS IRQ line */
224#define GPIC_CFG_IL_SET(x) (((x) & 3) << 2)
225#define GPIC_CFG_IL_MASK (3 << 2)
226
227/* pin interrupt type setup */
228#define GPIC_CFG_IC_OFF (0 << 4)
229#define GPIC_CFG_IC_LEVEL_LOW (1 << 4)
230#define GPIC_CFG_IC_LEVEL_HIGH (2 << 4)
231#define GPIC_CFG_IC_EDGE_FALL (5 << 4)
232#define GPIC_CFG_IC_EDGE_RISE (6 << 4)
233#define GPIC_CFG_IC_EDGE_BOTH (7 << 4)
234#define GPIC_CFG_IC_MASK (7 << 4)
235
236/* allow interrupt to wake cpu from 'wait' */
237#define GPIC_CFG_IDLEWAKE (1 << 7)
238
239/***********************************************************************/
240
241/* Au1000 SDRAM memory controller register offsets */
242#define AU1000_MEM_SDMODE0 0x0000
243#define AU1000_MEM_SDMODE1 0x0004
244#define AU1000_MEM_SDMODE2 0x0008
245#define AU1000_MEM_SDADDR0 0x000C
246#define AU1000_MEM_SDADDR1 0x0010
247#define AU1000_MEM_SDADDR2 0x0014
248#define AU1000_MEM_SDREFCFG 0x0018
249#define AU1000_MEM_SDPRECMD 0x001C
250#define AU1000_MEM_SDAUTOREF 0x0020
251#define AU1000_MEM_SDWRMD0 0x0024
252#define AU1000_MEM_SDWRMD1 0x0028
253#define AU1000_MEM_SDWRMD2 0x002C
254#define AU1000_MEM_SDSLEEP 0x0030
255#define AU1000_MEM_SDSMCKE 0x0034
256
257/* MEM_SDMODE register content definitions */
258#define MEM_SDMODE_F (1 << 22)
259#define MEM_SDMODE_SR (1 << 21)
260#define MEM_SDMODE_BS (1 << 20)
261#define MEM_SDMODE_RS (3 << 18)
262#define MEM_SDMODE_CS (7 << 15)
263#define MEM_SDMODE_TRAS (15 << 11)
264#define MEM_SDMODE_TMRD (3 << 9)
265#define MEM_SDMODE_TWR (3 << 7)
266#define MEM_SDMODE_TRP (3 << 5)
267#define MEM_SDMODE_TRCD (3 << 3)
268#define MEM_SDMODE_TCL (7 << 0)
269
270#define MEM_SDMODE_BS_2Bank (0 << 20)
271#define MEM_SDMODE_BS_4Bank (1 << 20)
272#define MEM_SDMODE_RS_11Row (0 << 18)
273#define MEM_SDMODE_RS_12Row (1 << 18)
274#define MEM_SDMODE_RS_13Row (2 << 18)
275#define MEM_SDMODE_RS_N(N) ((N) << 18)
276#define MEM_SDMODE_CS_7Col (0 << 15)
277#define MEM_SDMODE_CS_8Col (1 << 15)
278#define MEM_SDMODE_CS_9Col (2 << 15)
279#define MEM_SDMODE_CS_10Col (3 << 15)
280#define MEM_SDMODE_CS_11Col (4 << 15)
281#define MEM_SDMODE_CS_N(N) ((N) << 15)
282#define MEM_SDMODE_TRAS_N(N) ((N) << 11)
283#define MEM_SDMODE_TMRD_N(N) ((N) << 9)
284#define MEM_SDMODE_TWR_N(N) ((N) << 7)
285#define MEM_SDMODE_TRP_N(N) ((N) << 5)
286#define MEM_SDMODE_TRCD_N(N) ((N) << 3)
287#define MEM_SDMODE_TCL_N(N) ((N) << 0)
288
289/* MEM_SDADDR register contents definitions */
290#define MEM_SDADDR_E (1 << 20)
291#define MEM_SDADDR_CSBA (0x03FF << 10)
292#define MEM_SDADDR_CSMASK (0x03FF << 0)
293#define MEM_SDADDR_CSBA_N(N) ((N) & (0x03FF << 22) >> 12)
294#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF << 22) >> 22)
295
296/* MEM_SDREFCFG register content definitions */
297#define MEM_SDREFCFG_TRC (15 << 28)
298#define MEM_SDREFCFG_TRPM (3 << 26)
299#define MEM_SDREFCFG_E (1 << 25)
300#define MEM_SDREFCFG_RE (0x1ffffff << 0)
301#define MEM_SDREFCFG_TRC_N(N) ((N) << MEM_SDREFCFG_TRC)
302#define MEM_SDREFCFG_TRPM_N(N) ((N) << MEM_SDREFCFG_TRPM)
303#define MEM_SDREFCFG_REF_N(N) (N)
304
305/* Au1550 SDRAM Register Offsets */
306#define AU1550_MEM_SDMODE0 0x0800
307#define AU1550_MEM_SDMODE1 0x0808
308#define AU1550_MEM_SDMODE2 0x0810
309#define AU1550_MEM_SDADDR0 0x0820
310#define AU1550_MEM_SDADDR1 0x0828
311#define AU1550_MEM_SDADDR2 0x0830
312#define AU1550_MEM_SDCONFIGA 0x0840
313#define AU1550_MEM_SDCONFIGB 0x0848
314#define AU1550_MEM_SDSTAT 0x0850
315#define AU1550_MEM_SDERRADDR 0x0858
316#define AU1550_MEM_SDSTRIDE0 0x0860
317#define AU1550_MEM_SDSTRIDE1 0x0868
318#define AU1550_MEM_SDSTRIDE2 0x0870
319#define AU1550_MEM_SDWRMD0 0x0880
320#define AU1550_MEM_SDWRMD1 0x0888
321#define AU1550_MEM_SDWRMD2 0x0890
322#define AU1550_MEM_SDPRECMD 0x08C0
323#define AU1550_MEM_SDAUTOREF 0x08C8
324#define AU1550_MEM_SDSREF 0x08D0
325#define AU1550_MEM_SDSLEEP MEM_SDSREF
326
327/* Static Bus Controller register offsets */
328#define AU1000_MEM_STCFG0 0x000
329#define AU1000_MEM_STTIME0 0x004
330#define AU1000_MEM_STADDR0 0x008
331#define AU1000_MEM_STCFG1 0x010
332#define AU1000_MEM_STTIME1 0x014
333#define AU1000_MEM_STADDR1 0x018
334#define AU1000_MEM_STCFG2 0x020
335#define AU1000_MEM_STTIME2 0x024
336#define AU1000_MEM_STADDR2 0x028
337#define AU1000_MEM_STCFG3 0x030
338#define AU1000_MEM_STTIME3 0x034
339#define AU1000_MEM_STADDR3 0x038
340#define AU1000_MEM_STNDCTL 0x100
341#define AU1000_MEM_STSTAT 0x104
342
343#define MEM_STNAND_CMD 0x0
344#define MEM_STNAND_ADDR 0x4
345#define MEM_STNAND_DATA 0x20
346
347
348/* Programmable Counters 0 and 1 */
349#define AU1000_SYS_CNTRCTRL 0x14
350# define SYS_CNTRL_E1S (1 << 23)
351# define SYS_CNTRL_T1S (1 << 20)
352# define SYS_CNTRL_M21 (1 << 19)
353# define SYS_CNTRL_M11 (1 << 18)
354# define SYS_CNTRL_M01 (1 << 17)
355# define SYS_CNTRL_C1S (1 << 16)
356# define SYS_CNTRL_BP (1 << 14)
357# define SYS_CNTRL_EN1 (1 << 13)
358# define SYS_CNTRL_BT1 (1 << 12)
359# define SYS_CNTRL_EN0 (1 << 11)
360# define SYS_CNTRL_BT0 (1 << 10)
361# define SYS_CNTRL_E0 (1 << 8)
362# define SYS_CNTRL_E0S (1 << 7)
363# define SYS_CNTRL_32S (1 << 5)
364# define SYS_CNTRL_T0S (1 << 4)
365# define SYS_CNTRL_M20 (1 << 3)
366# define SYS_CNTRL_M10 (1 << 2)
367# define SYS_CNTRL_M00 (1 << 1)
368# define SYS_CNTRL_C0S (1 << 0)
369
370/* Programmable Counter 0 Registers */
371#define AU1000_SYS_TOYTRIM 0x00
372#define AU1000_SYS_TOYWRITE 0x04
373#define AU1000_SYS_TOYMATCH0 0x08
374#define AU1000_SYS_TOYMATCH1 0x0c
375#define AU1000_SYS_TOYMATCH2 0x10
376#define AU1000_SYS_TOYREAD 0x40
377
378/* Programmable Counter 1 Registers */
379#define AU1000_SYS_RTCTRIM 0x44
380#define AU1000_SYS_RTCWRITE 0x48
381#define AU1000_SYS_RTCMATCH0 0x4c
382#define AU1000_SYS_RTCMATCH1 0x50
383#define AU1000_SYS_RTCMATCH2 0x54
384#define AU1000_SYS_RTCREAD 0x58
385
386
387/* GPIO */
388#define AU1000_SYS_PINFUNC 0x2C
389# define SYS_PF_USB (1 << 15) /* 2nd USB device/host */
390# define SYS_PF_U3 (1 << 14) /* GPIO23/U3TXD */
391# define SYS_PF_U2 (1 << 13) /* GPIO22/U2TXD */
392# define SYS_PF_U1 (1 << 12) /* GPIO21/U1TXD */
393# define SYS_PF_SRC (1 << 11) /* GPIO6/SROMCKE */
394# define SYS_PF_CK5 (1 << 10) /* GPIO3/CLK5 */
395# define SYS_PF_CK4 (1 << 9) /* GPIO2/CLK4 */
396# define SYS_PF_IRF (1 << 8) /* GPIO15/IRFIRSEL */
397# define SYS_PF_UR3 (1 << 7) /* GPIO[14:9]/UART3 */
398# define SYS_PF_I2D (1 << 6) /* GPIO8/I2SDI */
399# define SYS_PF_I2S (1 << 5) /* I2S/GPIO[29:31] */
400# define SYS_PF_NI2 (1 << 4) /* NI2/GPIO[24:28] */
401# define SYS_PF_U0 (1 << 3) /* U0TXD/GPIO20 */
402# define SYS_PF_RD (1 << 2) /* IRTXD/GPIO19 */
403# define SYS_PF_A97 (1 << 1) /* AC97/SSL1 */
404# define SYS_PF_S0 (1 << 0) /* SSI_0/GPIO[16:18] */
405
406/* Au1100 only */
407# define SYS_PF_PC (1 << 18) /* PCMCIA/GPIO[207:204] */
408# define SYS_PF_LCD (1 << 17) /* extern lcd/GPIO[203:200] */
409# define SYS_PF_CS (1 << 16) /* EXTCLK0/32KHz to gpio2 */
410# define SYS_PF_EX0 (1 << 9) /* GPIO2/clock */
411
412/* Au1550 only. Redefines lots of pins */
413# define SYS_PF_PSC2_MASK (7 << 17)
414# define SYS_PF_PSC2_AC97 0
415# define SYS_PF_PSC2_SPI 0
416# define SYS_PF_PSC2_I2S (1 << 17)
417# define SYS_PF_PSC2_SMBUS (3 << 17)
418# define SYS_PF_PSC2_GPIO (7 << 17)
419# define SYS_PF_PSC3_MASK (7 << 20)
420# define SYS_PF_PSC3_AC97 0
421# define SYS_PF_PSC3_SPI 0
422# define SYS_PF_PSC3_I2S (1 << 20)
423# define SYS_PF_PSC3_SMBUS (3 << 20)
424# define SYS_PF_PSC3_GPIO (7 << 20)
425# define SYS_PF_PSC1_S1 (1 << 1)
426# define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
427
428/* Au1200 only */
429#define SYS_PINFUNC_DMA (1 << 31)
430#define SYS_PINFUNC_S0A (1 << 30)
431#define SYS_PINFUNC_S1A (1 << 29)
432#define SYS_PINFUNC_LP0 (1 << 28)
433#define SYS_PINFUNC_LP1 (1 << 27)
434#define SYS_PINFUNC_LD16 (1 << 26)
435#define SYS_PINFUNC_LD8 (1 << 25)
436#define SYS_PINFUNC_LD1 (1 << 24)
437#define SYS_PINFUNC_LD0 (1 << 23)
438#define SYS_PINFUNC_P1A (3 << 21)
439#define SYS_PINFUNC_P1B (1 << 20)
440#define SYS_PINFUNC_FS3 (1 << 19)
441#define SYS_PINFUNC_P0A (3 << 17)
442#define SYS_PINFUNC_CS (1 << 16)
443#define SYS_PINFUNC_CIM (1 << 15)
444#define SYS_PINFUNC_P1C (1 << 14)
445#define SYS_PINFUNC_U1T (1 << 12)
446#define SYS_PINFUNC_U1R (1 << 11)
447#define SYS_PINFUNC_EX1 (1 << 10)
448#define SYS_PINFUNC_EX0 (1 << 9)
449#define SYS_PINFUNC_U0R (1 << 8)
450#define SYS_PINFUNC_MC (1 << 7)
451#define SYS_PINFUNC_S0B (1 << 6)
452#define SYS_PINFUNC_S0C (1 << 5)
453#define SYS_PINFUNC_P0B (1 << 4)
454#define SYS_PINFUNC_U0T (1 << 3)
455#define SYS_PINFUNC_S1B (1 << 2)
456
457/* Power Management */
458#define AU1000_SYS_SCRATCH0 0x18
459#define AU1000_SYS_SCRATCH1 0x1c
460#define AU1000_SYS_WAKEMSK 0x34
461#define AU1000_SYS_ENDIAN 0x38
462#define AU1000_SYS_POWERCTRL 0x3c
463#define AU1000_SYS_WAKESRC 0x5c
464#define AU1000_SYS_SLPPWR 0x78
465#define AU1000_SYS_SLEEP 0x7c
466
467#define SYS_WAKEMSK_D2 (1 << 9)
468#define SYS_WAKEMSK_M2 (1 << 8)
469#define SYS_WAKEMSK_GPIO(x) (1 << (x))
470
471/* Clock Controller */
472#define AU1000_SYS_FREQCTRL0 0x20
473#define AU1000_SYS_FREQCTRL1 0x24
474#define AU1000_SYS_CLKSRC 0x28
475#define AU1000_SYS_CPUPLL 0x60
476#define AU1000_SYS_AUXPLL 0x64
477#define AU1300_SYS_AUXPLL2 0x68
478
479
480/**********************************************************************/
481
482
483/* The PCI chip selects are outside the 32bit space, and since we can't
484 * just program the 36bit addresses into BARs, we have to take a chunk
485 * out of the 32bit space and reserve it for PCI. When these addresses
486 * are ioremap()ed, they'll be fixed up to the real 36bit address before
487 * being passed to the real ioremap function.
488 */
489#define ALCHEMY_PCI_MEMWIN_START (AU1500_PCI_MEM_PHYS_ADDR >> 4)
490#define ALCHEMY_PCI_MEMWIN_END (ALCHEMY_PCI_MEMWIN_START + 0x0FFFFFFF)
491
492/* for PCI IO it's simpler because we get to do the ioremap ourselves and then
493 * adjust the device's resources.
494 */
495#define ALCHEMY_PCI_IOWIN_START 0x00001000
496#define ALCHEMY_PCI_IOWIN_END 0x0000FFFF
497
498#ifdef CONFIG_PCI
499
500#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
501#define IOPORT_RESOURCE_END 0xffffffff
502#define IOMEM_RESOURCE_START 0x10000000
503#define IOMEM_RESOURCE_END 0xfffffffffULL
504
505#else
506
507/* Don't allow any legacy ports probing */
508#define IOPORT_RESOURCE_START 0x10000000
509#define IOPORT_RESOURCE_END 0xffffffff
510#define IOMEM_RESOURCE_START 0x10000000
511#define IOMEM_RESOURCE_END 0xfffffffffULL
512
513#endif
514
515/* PCI controller block register offsets */
516#define PCI_REG_CMEM 0x0000
517#define PCI_REG_CONFIG 0x0004
518#define PCI_REG_B2BMASK_CCH 0x0008
519#define PCI_REG_B2BBASE0_VID 0x000C
520#define PCI_REG_B2BBASE1_SID 0x0010
521#define PCI_REG_MWMASK_DEV 0x0014
522#define PCI_REG_MWBASE_REV_CCL 0x0018
523#define PCI_REG_ERR_ADDR 0x001C
524#define PCI_REG_SPEC_INTACK 0x0020
525#define PCI_REG_ID 0x0100
526#define PCI_REG_STATCMD 0x0104
527#define PCI_REG_CLASSREV 0x0108
528#define PCI_REG_PARAM 0x010C
529#define PCI_REG_MBAR 0x0110
530#define PCI_REG_TIMEOUT 0x0140
531
532/* PCI controller block register bits */
533#define PCI_CMEM_E (1 << 28) /* enable cacheable memory */
534#define PCI_CMEM_CMBASE(x) (((x) & 0x3fff) << 14)
535#define PCI_CMEM_CMMASK(x) ((x) & 0x3fff)
536#define PCI_CONFIG_ERD (1 << 27) /* pci error during R/W */
537#define PCI_CONFIG_ET (1 << 26) /* error in target mode */
538#define PCI_CONFIG_EF (1 << 25) /* fatal error */
539#define PCI_CONFIG_EP (1 << 24) /* parity error */
540#define PCI_CONFIG_EM (1 << 23) /* multiple errors */
541#define PCI_CONFIG_BM (1 << 22) /* bad master error */
542#define PCI_CONFIG_PD (1 << 20) /* PCI Disable */
543#define PCI_CONFIG_BME (1 << 19) /* Byte Mask Enable for reads */
544#define PCI_CONFIG_NC (1 << 16) /* mark mem access non-coherent */
545#define PCI_CONFIG_IA (1 << 15) /* INTA# enabled (target mode) */
546#define PCI_CONFIG_IP (1 << 13) /* int on PCI_PERR# */
547#define PCI_CONFIG_IS (1 << 12) /* int on PCI_SERR# */
548#define PCI_CONFIG_IMM (1 << 11) /* int on master abort */
549#define PCI_CONFIG_ITM (1 << 10) /* int on target abort (as master) */
550#define PCI_CONFIG_ITT (1 << 9) /* int on target abort (as target) */
551#define PCI_CONFIG_IPB (1 << 8) /* int on PERR# in bus master acc */
552#define PCI_CONFIG_SIC_NO (0 << 6) /* no byte mask changes */
553#define PCI_CONFIG_SIC_BA_ADR (1 << 6) /* on byte/hw acc, invert adr bits */
554#define PCI_CONFIG_SIC_HWA_DAT (2 << 6) /* on halfword acc, swap data */
555#define PCI_CONFIG_SIC_ALL (3 << 6) /* swap data bytes on all accesses */
556#define PCI_CONFIG_ST (1 << 5) /* swap data by target transactions */
557#define PCI_CONFIG_SM (1 << 4) /* swap data from PCI ctl */
558#define PCI_CONFIG_AEN (1 << 3) /* enable internal arbiter */
559#define PCI_CONFIG_R2H (1 << 2) /* REQ2# to hi-prio arbiter */
560#define PCI_CONFIG_R1H (1 << 1) /* REQ1# to hi-prio arbiter */
561#define PCI_CONFIG_CH (1 << 0) /* PCI ctl to hi-prio arbiter */
562#define PCI_B2BMASK_B2BMASK(x) (((x) & 0xffff) << 16)
563#define PCI_B2BMASK_CCH(x) ((x) & 0xffff) /* 16 upper bits of class code */
564#define PCI_B2BBASE0_VID_B0(x) (((x) & 0xffff) << 16)
565#define PCI_B2BBASE0_VID_SV(x) ((x) & 0xffff)
566#define PCI_B2BBASE1_SID_B1(x) (((x) & 0xffff) << 16)
567#define PCI_B2BBASE1_SID_SI(x) ((x) & 0xffff)
568#define PCI_MWMASKDEV_MWMASK(x) (((x) & 0xffff) << 16)
569#define PCI_MWMASKDEV_DEVID(x) ((x) & 0xffff)
570#define PCI_MWBASEREVCCL_BASE(x) (((x) & 0xffff) << 16)
571#define PCI_MWBASEREVCCL_REV(x) (((x) & 0xff) << 8)
572#define PCI_MWBASEREVCCL_CCL(x) ((x) & 0xff)
573#define PCI_ID_DID(x) (((x) & 0xffff) << 16)
574#define PCI_ID_VID(x) ((x) & 0xffff)
575#define PCI_STATCMD_STATUS(x) (((x) & 0xffff) << 16)
576#define PCI_STATCMD_CMD(x) ((x) & 0xffff)
577#define PCI_CLASSREV_CLASS(x) (((x) & 0x00ffffff) << 8)
578#define PCI_CLASSREV_REV(x) ((x) & 0xff)
579#define PCI_PARAM_BIST(x) (((x) & 0xff) << 24)
580#define PCI_PARAM_HT(x) (((x) & 0xff) << 16)
581#define PCI_PARAM_LT(x) (((x) & 0xff) << 8)
582#define PCI_PARAM_CLS(x) ((x) & 0xff)
583#define PCI_TIMEOUT_RETRIES(x) (((x) & 0xff) << 8) /* max retries */
584#define PCI_TIMEOUT_TO(x) ((x) & 0xff) /* target ready timeout */
585
586
587/**********************************************************************/
588
37 589
38#ifndef _LANGUAGE_ASSEMBLY 590#ifndef _LANGUAGE_ASSEMBLY
39 591
@@ -45,52 +597,36 @@
45 597
46#include <asm/cpu.h> 598#include <asm/cpu.h>
47 599
48/* cpu pipeline flush */ 600/* helpers to access the SYS_* registers */
49void static inline au_sync(void) 601static inline unsigned long alchemy_rdsys(int regofs)
50{ 602{
51 __asm__ volatile ("sync"); 603 void __iomem *b = (void __iomem *)KSEG1ADDR(AU1000_SYS_PHYS_ADDR);
52}
53 604
54void static inline au_sync_udelay(int us) 605 return __raw_readl(b + regofs);
55{
56 __asm__ volatile ("sync");
57 udelay(us);
58} 606}
59 607
60void static inline au_sync_delay(int ms) 608static inline void alchemy_wrsys(unsigned long v, int regofs)
61{ 609{
62 __asm__ volatile ("sync"); 610 void __iomem *b = (void __iomem *)KSEG1ADDR(AU1000_SYS_PHYS_ADDR);
63 mdelay(ms);
64}
65 611
66void static inline au_writeb(u8 val, unsigned long reg) 612 __raw_writel(v, b + regofs);
67{ 613 wmb(); /* drain writebuffer */
68 *(volatile u8 *)reg = val;
69} 614}
70 615
71void static inline au_writew(u16 val, unsigned long reg) 616/* helpers to access static memctrl registers */
617static inline unsigned long alchemy_rdsmem(int regofs)
72{ 618{
73 *(volatile u16 *)reg = val; 619 void __iomem *b = (void __iomem *)KSEG1ADDR(AU1000_STATIC_MEM_PHYS_ADDR);
74}
75 620
76void static inline au_writel(u32 val, unsigned long reg) 621 return __raw_readl(b + regofs);
77{
78 *(volatile u32 *)reg = val;
79} 622}
80 623
81static inline u8 au_readb(unsigned long reg) 624static inline void alchemy_wrsmem(unsigned long v, int regofs)
82{ 625{
83 return *(volatile u8 *)reg; 626 void __iomem *b = (void __iomem *)KSEG1ADDR(AU1000_STATIC_MEM_PHYS_ADDR);
84}
85 627
86static inline u16 au_readw(unsigned long reg) 628 __raw_writel(v, b + regofs);
87{ 629 wmb(); /* drain writebuffer */
88 return *(volatile u16 *)reg;
89}
90
91static inline u32 au_readl(unsigned long reg)
92{
93 return *(volatile u32 *)reg;
94} 630}
95 631
96/* Early Au1000 have a write-only SYS_CPUPLL register. */ 632/* Early Au1000 have a write-only SYS_CPUPLL register. */
@@ -192,19 +728,20 @@ static inline void alchemy_uart_enable(u32 uart_phys)
192 /* reset, enable clock, deassert reset */ 728 /* reset, enable clock, deassert reset */
193 if ((__raw_readl(addr + 0x100) & 3) != 3) { 729 if ((__raw_readl(addr + 0x100) & 3) != 3) {
194 __raw_writel(0, addr + 0x100); 730 __raw_writel(0, addr + 0x100);
195 wmb(); 731 wmb(); /* drain writebuffer */
196 __raw_writel(1, addr + 0x100); 732 __raw_writel(1, addr + 0x100);
197 wmb(); 733 wmb(); /* drain writebuffer */
198 } 734 }
199 __raw_writel(3, addr + 0x100); 735 __raw_writel(3, addr + 0x100);
200 wmb(); 736 wmb(); /* drain writebuffer */
201} 737}
202 738
203static inline void alchemy_uart_disable(u32 uart_phys) 739static inline void alchemy_uart_disable(u32 uart_phys)
204{ 740{
205 void __iomem *addr = (void __iomem *)KSEG1ADDR(uart_phys); 741 void __iomem *addr = (void __iomem *)KSEG1ADDR(uart_phys);
742
206 __raw_writel(0, addr + 0x100); /* UART_MOD_CNTRL */ 743 __raw_writel(0, addr + 0x100); /* UART_MOD_CNTRL */
207 wmb(); 744 wmb(); /* drain writebuffer */
208} 745}
209 746
210static inline void alchemy_uart_putchar(u32 uart_phys, u8 c) 747static inline void alchemy_uart_putchar(u32 uart_phys, u8 c)
@@ -223,7 +760,7 @@ static inline void alchemy_uart_putchar(u32 uart_phys, u8 c)
223 } while (--timeout); 760 } while (--timeout);
224 761
225 __raw_writel(c, base + 0x04); /* tx */ 762 __raw_writel(c, base + 0x04); /* tx */
226 wmb(); 763 wmb(); /* drain writebuffer */
227} 764}
228 765
229/* return number of ethernet MACs on a given cputype */ 766/* return number of ethernet MACs on a given cputype */
@@ -240,20 +777,13 @@ static inline int alchemy_get_macs(int type)
240 return 0; 777 return 0;
241} 778}
242 779
243/* arch/mips/au1000/common/clocks.c */
244extern void set_au1x00_speed(unsigned int new_freq);
245extern unsigned int get_au1x00_speed(void);
246extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
247extern unsigned long get_au1x00_uart_baud_base(void);
248extern unsigned long au1xxx_calc_clock(void);
249
250/* PM: arch/mips/alchemy/common/sleeper.S, power.c, irq.c */ 780/* PM: arch/mips/alchemy/common/sleeper.S, power.c, irq.c */
251void alchemy_sleep_au1000(void); 781void alchemy_sleep_au1000(void);
252void alchemy_sleep_au1550(void); 782void alchemy_sleep_au1550(void);
253void alchemy_sleep_au1300(void); 783void alchemy_sleep_au1300(void);
254void au_sleep(void); 784void au_sleep(void);
255 785
256/* USB: drivers/usb/host/alchemy-common.c */ 786/* USB: arch/mips/alchemy/common/usb.c */
257enum alchemy_usb_block { 787enum alchemy_usb_block {
258 ALCHEMY_USB_OHCI0, 788 ALCHEMY_USB_OHCI0,
259 ALCHEMY_USB_UDC0, 789 ALCHEMY_USB_UDC0,
@@ -272,6 +802,20 @@ struct alchemy_pci_platdata {
272 unsigned long pci_cfg_clr; 802 unsigned long pci_cfg_clr;
273}; 803};
274 804
805/* The IrDA peripheral has an IRFIRSEL pin, but on the DB/PB boards it's
806 * not used to select FIR/SIR mode on the transceiver but as a GPIO.
807 * Instead a CPLD has to be told about the mode. The driver calls the
808 * set_phy_mode() function in addition to driving the IRFIRSEL pin.
809 */
810#define AU1000_IRDA_PHY_MODE_OFF 0
811#define AU1000_IRDA_PHY_MODE_SIR 1
812#define AU1000_IRDA_PHY_MODE_FIR 2
813
814struct au1k_irda_platform_data {
815 void (*set_phy_mode)(int mode);
816};
817
818
275/* Multifunction pins: Each of these pins can either be assigned to the 819/* Multifunction pins: Each of these pins can either be assigned to the
276 * GPIO controller or a on-chip peripheral. 820 * GPIO controller or a on-chip peripheral.
277 * Call "au1300_pinfunc_to_dev()" or "au1300_pinfunc_to_gpio()" to 821 * Call "au1300_pinfunc_to_dev()" or "au1300_pinfunc_to_gpio()" to
@@ -344,20 +888,6 @@ enum au1300_vss_block {
344 888
345extern void au1300_vss_block_control(int block, int enable); 889extern void au1300_vss_block_control(int block, int enable);
346 890
347
348/* SOC Interrupt numbers */
349/* Au1000-style (IC0/1): 2 controllers with 32 sources each */
350#define AU1000_INTC0_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
351#define AU1000_INTC0_INT_LAST (AU1000_INTC0_INT_BASE + 31)
352#define AU1000_INTC1_INT_BASE (AU1000_INTC0_INT_LAST + 1)
353#define AU1000_INTC1_INT_LAST (AU1000_INTC1_INT_BASE + 31)
354#define AU1000_MAX_INTR AU1000_INTC1_INT_LAST
355
356/* Au1300-style (GPIC): 1 controller with up to 128 sources */
357#define ALCHEMY_GPIC_INT_BASE (MIPS_CPU_IRQ_BASE + 8)
358#define ALCHEMY_GPIC_INT_NUM 128
359#define ALCHEMY_GPIC_INT_LAST (ALCHEMY_GPIC_INT_BASE + ALCHEMY_GPIC_INT_NUM - 1)
360
361enum soc_au1000_ints { 891enum soc_au1000_ints {
362 AU1000_FIRST_INT = AU1000_INTC0_INT_BASE, 892 AU1000_FIRST_INT = AU1000_INTC0_INT_BASE,
363 AU1000_UART0_INT = AU1000_FIRST_INT, 893 AU1000_UART0_INT = AU1000_FIRST_INT,
@@ -678,885 +1208,4 @@ enum soc_au1200_ints {
678 1208
679#endif /* !defined (_LANGUAGE_ASSEMBLY) */ 1209#endif /* !defined (_LANGUAGE_ASSEMBLY) */
680 1210
681/* Au1300 peripheral interrupt numbers */
682#define AU1300_FIRST_INT (ALCHEMY_GPIC_INT_BASE)
683#define AU1300_UART1_INT (AU1300_FIRST_INT + 17)
684#define AU1300_UART2_INT (AU1300_FIRST_INT + 25)
685#define AU1300_UART3_INT (AU1300_FIRST_INT + 27)
686#define AU1300_SD1_INT (AU1300_FIRST_INT + 32)
687#define AU1300_SD2_INT (AU1300_FIRST_INT + 38)
688#define AU1300_PSC0_INT (AU1300_FIRST_INT + 48)
689#define AU1300_PSC1_INT (AU1300_FIRST_INT + 52)
690#define AU1300_PSC2_INT (AU1300_FIRST_INT + 56)
691#define AU1300_PSC3_INT (AU1300_FIRST_INT + 60)
692#define AU1300_NAND_INT (AU1300_FIRST_INT + 62)
693#define AU1300_DDMA_INT (AU1300_FIRST_INT + 75)
694#define AU1300_MMU_INT (AU1300_FIRST_INT + 76)
695#define AU1300_MPU_INT (AU1300_FIRST_INT + 77)
696#define AU1300_GPU_INT (AU1300_FIRST_INT + 78)
697#define AU1300_UDMA_INT (AU1300_FIRST_INT + 79)
698#define AU1300_TOY_INT (AU1300_FIRST_INT + 80)
699#define AU1300_TOY_MATCH0_INT (AU1300_FIRST_INT + 81)
700#define AU1300_TOY_MATCH1_INT (AU1300_FIRST_INT + 82)
701#define AU1300_TOY_MATCH2_INT (AU1300_FIRST_INT + 83)
702#define AU1300_RTC_INT (AU1300_FIRST_INT + 84)
703#define AU1300_RTC_MATCH0_INT (AU1300_FIRST_INT + 85)
704#define AU1300_RTC_MATCH1_INT (AU1300_FIRST_INT + 86)
705#define AU1300_RTC_MATCH2_INT (AU1300_FIRST_INT + 87)
706#define AU1300_UART0_INT (AU1300_FIRST_INT + 88)
707#define AU1300_SD0_INT (AU1300_FIRST_INT + 89)
708#define AU1300_USB_INT (AU1300_FIRST_INT + 90)
709#define AU1300_LCD_INT (AU1300_FIRST_INT + 91)
710#define AU1300_BSA_INT (AU1300_FIRST_INT + 92)
711#define AU1300_MPE_INT (AU1300_FIRST_INT + 93)
712#define AU1300_ITE_INT (AU1300_FIRST_INT + 94)
713#define AU1300_AES_INT (AU1300_FIRST_INT + 95)
714#define AU1300_CIM_INT (AU1300_FIRST_INT + 96)
715
716/**********************************************************************/
717
718/*
719 * Physical base addresses for integrated peripherals
720 * 0..au1000 1..au1500 2..au1100 3..au1550 4..au1200 5..au1300
721 */
722
723#define AU1000_AC97_PHYS_ADDR 0x10000000 /* 012 */
724#define AU1300_ROM_PHYS_ADDR 0x10000000 /* 5 */
725#define AU1300_OTP_PHYS_ADDR 0x10002000 /* 5 */
726#define AU1300_VSS_PHYS_ADDR 0x10003000 /* 5 */
727#define AU1300_UART0_PHYS_ADDR 0x10100000 /* 5 */
728#define AU1300_UART1_PHYS_ADDR 0x10101000 /* 5 */
729#define AU1300_UART2_PHYS_ADDR 0x10102000 /* 5 */
730#define AU1300_UART3_PHYS_ADDR 0x10103000 /* 5 */
731#define AU1000_USB_OHCI_PHYS_ADDR 0x10100000 /* 012 */
732#define AU1000_USB_UDC_PHYS_ADDR 0x10200000 /* 0123 */
733#define AU1300_GPIC_PHYS_ADDR 0x10200000 /* 5 */
734#define AU1000_IRDA_PHYS_ADDR 0x10300000 /* 02 */
735#define AU1200_AES_PHYS_ADDR 0x10300000 /* 45 */
736#define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */
737#define AU1300_GPU_PHYS_ADDR 0x10500000 /* 5 */
738#define AU1000_MAC0_PHYS_ADDR 0x10500000 /* 023 */
739#define AU1000_MAC1_PHYS_ADDR 0x10510000 /* 023 */
740#define AU1000_MACEN_PHYS_ADDR 0x10520000 /* 023 */
741#define AU1100_SD0_PHYS_ADDR 0x10600000 /* 245 */
742#define AU1300_SD1_PHYS_ADDR 0x10601000 /* 5 */
743#define AU1300_SD2_PHYS_ADDR 0x10602000 /* 5 */
744#define AU1100_SD1_PHYS_ADDR 0x10680000 /* 24 */
745#define AU1300_SYS_PHYS_ADDR 0x10900000 /* 5 */
746#define AU1550_PSC2_PHYS_ADDR 0x10A00000 /* 3 */
747#define AU1550_PSC3_PHYS_ADDR 0x10B00000 /* 3 */
748#define AU1300_PSC0_PHYS_ADDR 0x10A00000 /* 5 */
749#define AU1300_PSC1_PHYS_ADDR 0x10A01000 /* 5 */
750#define AU1300_PSC2_PHYS_ADDR 0x10A02000 /* 5 */
751#define AU1300_PSC3_PHYS_ADDR 0x10A03000 /* 5 */
752#define AU1000_I2S_PHYS_ADDR 0x11000000 /* 02 */
753#define AU1500_MAC0_PHYS_ADDR 0x11500000 /* 1 */
754#define AU1500_MAC1_PHYS_ADDR 0x11510000 /* 1 */
755#define AU1500_MACEN_PHYS_ADDR 0x11520000 /* 1 */
756#define AU1000_UART0_PHYS_ADDR 0x11100000 /* 01234 */
757#define AU1200_SWCNT_PHYS_ADDR 0x1110010C /* 4 */
758#define AU1000_UART1_PHYS_ADDR 0x11200000 /* 0234 */
759#define AU1000_UART2_PHYS_ADDR 0x11300000 /* 0 */
760#define AU1000_UART3_PHYS_ADDR 0x11400000 /* 0123 */
761#define AU1000_SSI0_PHYS_ADDR 0x11600000 /* 02 */
762#define AU1000_SSI1_PHYS_ADDR 0x11680000 /* 02 */
763#define AU1500_GPIO2_PHYS_ADDR 0x11700000 /* 1234 */
764#define AU1000_IC1_PHYS_ADDR 0x11800000 /* 01234 */
765#define AU1000_SYS_PHYS_ADDR 0x11900000 /* 012345 */
766#define AU1550_PSC0_PHYS_ADDR 0x11A00000 /* 34 */
767#define AU1550_PSC1_PHYS_ADDR 0x11B00000 /* 34 */
768#define AU1000_MEM_PHYS_ADDR 0x14000000 /* 01234 */
769#define AU1000_STATIC_MEM_PHYS_ADDR 0x14001000 /* 01234 */
770#define AU1300_UDMA_PHYS_ADDR 0x14001800 /* 5 */
771#define AU1000_DMA_PHYS_ADDR 0x14002000 /* 012 */
772#define AU1550_DBDMA_PHYS_ADDR 0x14002000 /* 345 */
773#define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 345 */
774#define AU1000_MACDMA0_PHYS_ADDR 0x14004000 /* 0123 */
775#define AU1000_MACDMA1_PHYS_ADDR 0x14004200 /* 0123 */
776#define AU1200_CIM_PHYS_ADDR 0x14004000 /* 45 */
777#define AU1500_PCI_PHYS_ADDR 0x14005000 /* 13 */
778#define AU1550_PE_PHYS_ADDR 0x14008000 /* 3 */
779#define AU1200_MAEBE_PHYS_ADDR 0x14010000 /* 4 */
780#define AU1200_MAEFE_PHYS_ADDR 0x14012000 /* 4 */
781#define AU1300_MAEITE_PHYS_ADDR 0x14010000 /* 5 */
782#define AU1300_MAEMPE_PHYS_ADDR 0x14014000 /* 5 */
783#define AU1550_USB_OHCI_PHYS_ADDR 0x14020000 /* 3 */
784#define AU1200_USB_CTL_PHYS_ADDR 0x14020000 /* 4 */
785#define AU1200_USB_OTG_PHYS_ADDR 0x14020020 /* 4 */
786#define AU1200_USB_OHCI_PHYS_ADDR 0x14020100 /* 4 */
787#define AU1200_USB_EHCI_PHYS_ADDR 0x14020200 /* 4 */
788#define AU1200_USB_UDC_PHYS_ADDR 0x14022000 /* 4 */
789#define AU1300_USB_EHCI_PHYS_ADDR 0x14020000 /* 5 */
790#define AU1300_USB_OHCI0_PHYS_ADDR 0x14020400 /* 5 */
791#define AU1300_USB_OHCI1_PHYS_ADDR 0x14020800 /* 5 */
792#define AU1300_USB_CTL_PHYS_ADDR 0x14021000 /* 5 */
793#define AU1300_USB_OTG_PHYS_ADDR 0x14022000 /* 5 */
794#define AU1300_MAEBSA_PHYS_ADDR 0x14030000 /* 5 */
795#define AU1100_LCD_PHYS_ADDR 0x15000000 /* 2 */
796#define AU1200_LCD_PHYS_ADDR 0x15000000 /* 45 */
797#define AU1500_PCI_MEM_PHYS_ADDR 0x400000000ULL /* 13 */
798#define AU1500_PCI_IO_PHYS_ADDR 0x500000000ULL /* 13 */
799#define AU1500_PCI_CONFIG0_PHYS_ADDR 0x600000000ULL /* 13 */
800#define AU1500_PCI_CONFIG1_PHYS_ADDR 0x680000000ULL /* 13 */
801#define AU1000_PCMCIA_IO_PHYS_ADDR 0xF00000000ULL /* 012345 */
802#define AU1000_PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL /* 012345 */
803#define AU1000_PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL /* 012345 */
804
805/**********************************************************************/
806
807
808/*
809 * Au1300 GPIO+INT controller (GPIC) register offsets and bits
810 * Registers are 128bits (0x10 bytes), divided into 4 "banks".
811 */
812#define AU1300_GPIC_PINVAL 0x0000
813#define AU1300_GPIC_PINVALCLR 0x0010
814#define AU1300_GPIC_IPEND 0x0020
815#define AU1300_GPIC_PRIENC 0x0030
816#define AU1300_GPIC_IEN 0x0040 /* int_mask in manual */
817#define AU1300_GPIC_IDIS 0x0050 /* int_maskclr in manual */
818#define AU1300_GPIC_DMASEL 0x0060
819#define AU1300_GPIC_DEVSEL 0x0080
820#define AU1300_GPIC_DEVCLR 0x0090
821#define AU1300_GPIC_RSTVAL 0x00a0
822/* pin configuration space. one 32bit register for up to 128 IRQs */
823#define AU1300_GPIC_PINCFG 0x1000
824
825#define GPIC_GPIO_TO_BIT(gpio) \
826 (1 << ((gpio) & 0x1f))
827
828#define GPIC_GPIO_BANKOFF(gpio) \
829 (((gpio) >> 5) * 4)
830
831/* Pin Control bits: who owns the pin, what does it do */
832#define GPIC_CFG_PC_GPIN 0
833#define GPIC_CFG_PC_DEV 1
834#define GPIC_CFG_PC_GPOLOW 2
835#define GPIC_CFG_PC_GPOHIGH 3
836#define GPIC_CFG_PC_MASK 3
837
838/* assign pin to MIPS IRQ line */
839#define GPIC_CFG_IL_SET(x) (((x) & 3) << 2)
840#define GPIC_CFG_IL_MASK (3 << 2)
841
842/* pin interrupt type setup */
843#define GPIC_CFG_IC_OFF (0 << 4)
844#define GPIC_CFG_IC_LEVEL_LOW (1 << 4)
845#define GPIC_CFG_IC_LEVEL_HIGH (2 << 4)
846#define GPIC_CFG_IC_EDGE_FALL (5 << 4)
847#define GPIC_CFG_IC_EDGE_RISE (6 << 4)
848#define GPIC_CFG_IC_EDGE_BOTH (7 << 4)
849#define GPIC_CFG_IC_MASK (7 << 4)
850
851/* allow interrupt to wake cpu from 'wait' */
852#define GPIC_CFG_IDLEWAKE (1 << 7)
853
854/***********************************************************************/
855
856/* Au1000 SDRAM memory controller register offsets */
857#define AU1000_MEM_SDMODE0 0x0000
858#define AU1000_MEM_SDMODE1 0x0004
859#define AU1000_MEM_SDMODE2 0x0008
860#define AU1000_MEM_SDADDR0 0x000C
861#define AU1000_MEM_SDADDR1 0x0010
862#define AU1000_MEM_SDADDR2 0x0014
863#define AU1000_MEM_SDREFCFG 0x0018
864#define AU1000_MEM_SDPRECMD 0x001C
865#define AU1000_MEM_SDAUTOREF 0x0020
866#define AU1000_MEM_SDWRMD0 0x0024
867#define AU1000_MEM_SDWRMD1 0x0028
868#define AU1000_MEM_SDWRMD2 0x002C
869#define AU1000_MEM_SDSLEEP 0x0030
870#define AU1000_MEM_SDSMCKE 0x0034
871
872/* MEM_SDMODE register content definitions */
873#define MEM_SDMODE_F (1 << 22)
874#define MEM_SDMODE_SR (1 << 21)
875#define MEM_SDMODE_BS (1 << 20)
876#define MEM_SDMODE_RS (3 << 18)
877#define MEM_SDMODE_CS (7 << 15)
878#define MEM_SDMODE_TRAS (15 << 11)
879#define MEM_SDMODE_TMRD (3 << 9)
880#define MEM_SDMODE_TWR (3 << 7)
881#define MEM_SDMODE_TRP (3 << 5)
882#define MEM_SDMODE_TRCD (3 << 3)
883#define MEM_SDMODE_TCL (7 << 0)
884
885#define MEM_SDMODE_BS_2Bank (0 << 20)
886#define MEM_SDMODE_BS_4Bank (1 << 20)
887#define MEM_SDMODE_RS_11Row (0 << 18)
888#define MEM_SDMODE_RS_12Row (1 << 18)
889#define MEM_SDMODE_RS_13Row (2 << 18)
890#define MEM_SDMODE_RS_N(N) ((N) << 18)
891#define MEM_SDMODE_CS_7Col (0 << 15)
892#define MEM_SDMODE_CS_8Col (1 << 15)
893#define MEM_SDMODE_CS_9Col (2 << 15)
894#define MEM_SDMODE_CS_10Col (3 << 15)
895#define MEM_SDMODE_CS_11Col (4 << 15)
896#define MEM_SDMODE_CS_N(N) ((N) << 15)
897#define MEM_SDMODE_TRAS_N(N) ((N) << 11)
898#define MEM_SDMODE_TMRD_N(N) ((N) << 9)
899#define MEM_SDMODE_TWR_N(N) ((N) << 7)
900#define MEM_SDMODE_TRP_N(N) ((N) << 5)
901#define MEM_SDMODE_TRCD_N(N) ((N) << 3)
902#define MEM_SDMODE_TCL_N(N) ((N) << 0)
903
904/* MEM_SDADDR register contents definitions */
905#define MEM_SDADDR_E (1 << 20)
906#define MEM_SDADDR_CSBA (0x03FF << 10)
907#define MEM_SDADDR_CSMASK (0x03FF << 0)
908#define MEM_SDADDR_CSBA_N(N) ((N) & (0x03FF << 22) >> 12)
909#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF << 22) >> 22)
910
911/* MEM_SDREFCFG register content definitions */
912#define MEM_SDREFCFG_TRC (15 << 28)
913#define MEM_SDREFCFG_TRPM (3 << 26)
914#define MEM_SDREFCFG_E (1 << 25)
915#define MEM_SDREFCFG_RE (0x1ffffff << 0)
916#define MEM_SDREFCFG_TRC_N(N) ((N) << MEM_SDREFCFG_TRC)
917#define MEM_SDREFCFG_TRPM_N(N) ((N) << MEM_SDREFCFG_TRPM)
918#define MEM_SDREFCFG_REF_N(N) (N)
919
920/* Au1550 SDRAM Register Offsets */
921#define AU1550_MEM_SDMODE0 0x0800
922#define AU1550_MEM_SDMODE1 0x0808
923#define AU1550_MEM_SDMODE2 0x0810
924#define AU1550_MEM_SDADDR0 0x0820
925#define AU1550_MEM_SDADDR1 0x0828
926#define AU1550_MEM_SDADDR2 0x0830
927#define AU1550_MEM_SDCONFIGA 0x0840
928#define AU1550_MEM_SDCONFIGB 0x0848
929#define AU1550_MEM_SDSTAT 0x0850
930#define AU1550_MEM_SDERRADDR 0x0858
931#define AU1550_MEM_SDSTRIDE0 0x0860
932#define AU1550_MEM_SDSTRIDE1 0x0868
933#define AU1550_MEM_SDSTRIDE2 0x0870
934#define AU1550_MEM_SDWRMD0 0x0880
935#define AU1550_MEM_SDWRMD1 0x0888
936#define AU1550_MEM_SDWRMD2 0x0890
937#define AU1550_MEM_SDPRECMD 0x08C0
938#define AU1550_MEM_SDAUTOREF 0x08C8
939#define AU1550_MEM_SDSREF 0x08D0
940#define AU1550_MEM_SDSLEEP MEM_SDSREF
941
942/* Static Bus Controller */
943#define MEM_STCFG0 0xB4001000
944#define MEM_STTIME0 0xB4001004
945#define MEM_STADDR0 0xB4001008
946
947#define MEM_STCFG1 0xB4001010
948#define MEM_STTIME1 0xB4001014
949#define MEM_STADDR1 0xB4001018
950
951#define MEM_STCFG2 0xB4001020
952#define MEM_STTIME2 0xB4001024
953#define MEM_STADDR2 0xB4001028
954
955#define MEM_STCFG3 0xB4001030
956#define MEM_STTIME3 0xB4001034
957#define MEM_STADDR3 0xB4001038
958
959#define MEM_STNDCTL 0xB4001100
960#define MEM_STSTAT 0xB4001104
961
962#define MEM_STNAND_CMD 0x0
963#define MEM_STNAND_ADDR 0x4
964#define MEM_STNAND_DATA 0x20
965
966
967/* Programmable Counters 0 and 1 */
968#define SYS_BASE 0xB1900000
969#define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
970# define SYS_CNTRL_E1S (1 << 23)
971# define SYS_CNTRL_T1S (1 << 20)
972# define SYS_CNTRL_M21 (1 << 19)
973# define SYS_CNTRL_M11 (1 << 18)
974# define SYS_CNTRL_M01 (1 << 17)
975# define SYS_CNTRL_C1S (1 << 16)
976# define SYS_CNTRL_BP (1 << 14)
977# define SYS_CNTRL_EN1 (1 << 13)
978# define SYS_CNTRL_BT1 (1 << 12)
979# define SYS_CNTRL_EN0 (1 << 11)
980# define SYS_CNTRL_BT0 (1 << 10)
981# define SYS_CNTRL_E0 (1 << 8)
982# define SYS_CNTRL_E0S (1 << 7)
983# define SYS_CNTRL_32S (1 << 5)
984# define SYS_CNTRL_T0S (1 << 4)
985# define SYS_CNTRL_M20 (1 << 3)
986# define SYS_CNTRL_M10 (1 << 2)
987# define SYS_CNTRL_M00 (1 << 1)
988# define SYS_CNTRL_C0S (1 << 0)
989
990/* Programmable Counter 0 Registers */
991#define SYS_TOYTRIM (SYS_BASE + 0)
992#define SYS_TOYWRITE (SYS_BASE + 4)
993#define SYS_TOYMATCH0 (SYS_BASE + 8)
994#define SYS_TOYMATCH1 (SYS_BASE + 0xC)
995#define SYS_TOYMATCH2 (SYS_BASE + 0x10)
996#define SYS_TOYREAD (SYS_BASE + 0x40)
997
998/* Programmable Counter 1 Registers */
999#define SYS_RTCTRIM (SYS_BASE + 0x44)
1000#define SYS_RTCWRITE (SYS_BASE + 0x48)
1001#define SYS_RTCMATCH0 (SYS_BASE + 0x4C)
1002#define SYS_RTCMATCH1 (SYS_BASE + 0x50)
1003#define SYS_RTCMATCH2 (SYS_BASE + 0x54)
1004#define SYS_RTCREAD (SYS_BASE + 0x58)
1005
1006/* I2S Controller */
1007#define I2S_DATA 0xB1000000
1008# define I2S_DATA_MASK 0xffffff
1009#define I2S_CONFIG 0xB1000004
1010# define I2S_CONFIG_XU (1 << 25)
1011# define I2S_CONFIG_XO (1 << 24)
1012# define I2S_CONFIG_RU (1 << 23)
1013# define I2S_CONFIG_RO (1 << 22)
1014# define I2S_CONFIG_TR (1 << 21)
1015# define I2S_CONFIG_TE (1 << 20)
1016# define I2S_CONFIG_TF (1 << 19)
1017# define I2S_CONFIG_RR (1 << 18)
1018# define I2S_CONFIG_RE (1 << 17)
1019# define I2S_CONFIG_RF (1 << 16)
1020# define I2S_CONFIG_PD (1 << 11)
1021# define I2S_CONFIG_LB (1 << 10)
1022# define I2S_CONFIG_IC (1 << 9)
1023# define I2S_CONFIG_FM_BIT 7
1024# define I2S_CONFIG_FM_MASK (0x3 << I2S_CONFIG_FM_BIT)
1025# define I2S_CONFIG_FM_I2S (0x0 << I2S_CONFIG_FM_BIT)
1026# define I2S_CONFIG_FM_LJ (0x1 << I2S_CONFIG_FM_BIT)
1027# define I2S_CONFIG_FM_RJ (0x2 << I2S_CONFIG_FM_BIT)
1028# define I2S_CONFIG_TN (1 << 6)
1029# define I2S_CONFIG_RN (1 << 5)
1030# define I2S_CONFIG_SZ_BIT 0
1031# define I2S_CONFIG_SZ_MASK (0x1F << I2S_CONFIG_SZ_BIT)
1032
1033#define I2S_CONTROL 0xB1000008
1034# define I2S_CONTROL_D (1 << 1)
1035# define I2S_CONTROL_CE (1 << 0)
1036
1037
1038/* Ethernet Controllers */
1039
1040/* 4 byte offsets from AU1000_ETH_BASE */
1041#define MAC_CONTROL 0x0
1042# define MAC_RX_ENABLE (1 << 2)
1043# define MAC_TX_ENABLE (1 << 3)
1044# define MAC_DEF_CHECK (1 << 5)
1045# define MAC_SET_BL(X) (((X) & 0x3) << 6)
1046# define MAC_AUTO_PAD (1 << 8)
1047# define MAC_DISABLE_RETRY (1 << 10)
1048# define MAC_DISABLE_BCAST (1 << 11)
1049# define MAC_LATE_COL (1 << 12)
1050# define MAC_HASH_MODE (1 << 13)
1051# define MAC_HASH_ONLY (1 << 15)
1052# define MAC_PASS_ALL (1 << 16)
1053# define MAC_INVERSE_FILTER (1 << 17)
1054# define MAC_PROMISCUOUS (1 << 18)
1055# define MAC_PASS_ALL_MULTI (1 << 19)
1056# define MAC_FULL_DUPLEX (1 << 20)
1057# define MAC_NORMAL_MODE 0
1058# define MAC_INT_LOOPBACK (1 << 21)
1059# define MAC_EXT_LOOPBACK (1 << 22)
1060# define MAC_DISABLE_RX_OWN (1 << 23)
1061# define MAC_BIG_ENDIAN (1 << 30)
1062# define MAC_RX_ALL (1 << 31)
1063#define MAC_ADDRESS_HIGH 0x4
1064#define MAC_ADDRESS_LOW 0x8
1065#define MAC_MCAST_HIGH 0xC
1066#define MAC_MCAST_LOW 0x10
1067#define MAC_MII_CNTRL 0x14
1068# define MAC_MII_BUSY (1 << 0)
1069# define MAC_MII_READ 0
1070# define MAC_MII_WRITE (1 << 1)
1071# define MAC_SET_MII_SELECT_REG(X) (((X) & 0x1f) << 6)
1072# define MAC_SET_MII_SELECT_PHY(X) (((X) & 0x1f) << 11)
1073#define MAC_MII_DATA 0x18
1074#define MAC_FLOW_CNTRL 0x1C
1075# define MAC_FLOW_CNTRL_BUSY (1 << 0)
1076# define MAC_FLOW_CNTRL_ENABLE (1 << 1)
1077# define MAC_PASS_CONTROL (1 << 2)
1078# define MAC_SET_PAUSE(X) (((X) & 0xffff) << 16)
1079#define MAC_VLAN1_TAG 0x20
1080#define MAC_VLAN2_TAG 0x24
1081
1082/* Ethernet Controller Enable */
1083
1084# define MAC_EN_CLOCK_ENABLE (1 << 0)
1085# define MAC_EN_RESET0 (1 << 1)
1086# define MAC_EN_TOSS (0 << 2)
1087# define MAC_EN_CACHEABLE (1 << 3)
1088# define MAC_EN_RESET1 (1 << 4)
1089# define MAC_EN_RESET2 (1 << 5)
1090# define MAC_DMA_RESET (1 << 6)
1091
1092/* Ethernet Controller DMA Channels */
1093
1094#define MAC0_TX_DMA_ADDR 0xB4004000
1095#define MAC1_TX_DMA_ADDR 0xB4004200
1096/* offsets from MAC_TX_RING_ADDR address */
1097#define MAC_TX_BUFF0_STATUS 0x0
1098# define TX_FRAME_ABORTED (1 << 0)
1099# define TX_JAB_TIMEOUT (1 << 1)
1100# define TX_NO_CARRIER (1 << 2)
1101# define TX_LOSS_CARRIER (1 << 3)
1102# define TX_EXC_DEF (1 << 4)
1103# define TX_LATE_COLL_ABORT (1 << 5)
1104# define TX_EXC_COLL (1 << 6)
1105# define TX_UNDERRUN (1 << 7)
1106# define TX_DEFERRED (1 << 8)
1107# define TX_LATE_COLL (1 << 9)
1108# define TX_COLL_CNT_MASK (0xF << 10)
1109# define TX_PKT_RETRY (1 << 31)
1110#define MAC_TX_BUFF0_ADDR 0x4
1111# define TX_DMA_ENABLE (1 << 0)
1112# define TX_T_DONE (1 << 1)
1113# define TX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1114#define MAC_TX_BUFF0_LEN 0x8
1115#define MAC_TX_BUFF1_STATUS 0x10
1116#define MAC_TX_BUFF1_ADDR 0x14
1117#define MAC_TX_BUFF1_LEN 0x18
1118#define MAC_TX_BUFF2_STATUS 0x20
1119#define MAC_TX_BUFF2_ADDR 0x24
1120#define MAC_TX_BUFF2_LEN 0x28
1121#define MAC_TX_BUFF3_STATUS 0x30
1122#define MAC_TX_BUFF3_ADDR 0x34
1123#define MAC_TX_BUFF3_LEN 0x38
1124
1125#define MAC0_RX_DMA_ADDR 0xB4004100
1126#define MAC1_RX_DMA_ADDR 0xB4004300
1127/* offsets from MAC_RX_RING_ADDR */
1128#define MAC_RX_BUFF0_STATUS 0x0
1129# define RX_FRAME_LEN_MASK 0x3fff
1130# define RX_WDOG_TIMER (1 << 14)
1131# define RX_RUNT (1 << 15)
1132# define RX_OVERLEN (1 << 16)
1133# define RX_COLL (1 << 17)
1134# define RX_ETHER (1 << 18)
1135# define RX_MII_ERROR (1 << 19)
1136# define RX_DRIBBLING (1 << 20)
1137# define RX_CRC_ERROR (1 << 21)
1138# define RX_VLAN1 (1 << 22)
1139# define RX_VLAN2 (1 << 23)
1140# define RX_LEN_ERROR (1 << 24)
1141# define RX_CNTRL_FRAME (1 << 25)
1142# define RX_U_CNTRL_FRAME (1 << 26)
1143# define RX_MCAST_FRAME (1 << 27)
1144# define RX_BCAST_FRAME (1 << 28)
1145# define RX_FILTER_FAIL (1 << 29)
1146# define RX_PACKET_FILTER (1 << 30)
1147# define RX_MISSED_FRAME (1 << 31)
1148
1149# define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN | \
1150 RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
1151 RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
1152#define MAC_RX_BUFF0_ADDR 0x4
1153# define RX_DMA_ENABLE (1 << 0)
1154# define RX_T_DONE (1 << 1)
1155# define RX_GET_DMA_BUFFER(X) (((X) >> 2) & 0x3)
1156# define RX_SET_BUFF_ADDR(X) ((X) & 0xffffffc0)
1157#define MAC_RX_BUFF1_STATUS 0x10
1158#define MAC_RX_BUFF1_ADDR 0x14
1159#define MAC_RX_BUFF2_STATUS 0x20
1160#define MAC_RX_BUFF2_ADDR 0x24
1161#define MAC_RX_BUFF3_STATUS 0x30
1162#define MAC_RX_BUFF3_ADDR 0x34
1163
1164/* SSIO */
1165#define SSI0_STATUS 0xB1600000
1166# define SSI_STATUS_BF (1 << 4)
1167# define SSI_STATUS_OF (1 << 3)
1168# define SSI_STATUS_UF (1 << 2)
1169# define SSI_STATUS_D (1 << 1)
1170# define SSI_STATUS_B (1 << 0)
1171#define SSI0_INT 0xB1600004
1172# define SSI_INT_OI (1 << 3)
1173# define SSI_INT_UI (1 << 2)
1174# define SSI_INT_DI (1 << 1)
1175#define SSI0_INT_ENABLE 0xB1600008
1176# define SSI_INTE_OIE (1 << 3)
1177# define SSI_INTE_UIE (1 << 2)
1178# define SSI_INTE_DIE (1 << 1)
1179#define SSI0_CONFIG 0xB1600020
1180# define SSI_CONFIG_AO (1 << 24)
1181# define SSI_CONFIG_DO (1 << 23)
1182# define SSI_CONFIG_ALEN_BIT 20
1183# define SSI_CONFIG_ALEN_MASK (0x7 << 20)
1184# define SSI_CONFIG_DLEN_BIT 16
1185# define SSI_CONFIG_DLEN_MASK (0x7 << 16)
1186# define SSI_CONFIG_DD (1 << 11)
1187# define SSI_CONFIG_AD (1 << 10)
1188# define SSI_CONFIG_BM_BIT 8
1189# define SSI_CONFIG_BM_MASK (0x3 << 8)
1190# define SSI_CONFIG_CE (1 << 7)
1191# define SSI_CONFIG_DP (1 << 6)
1192# define SSI_CONFIG_DL (1 << 5)
1193# define SSI_CONFIG_EP (1 << 4)
1194#define SSI0_ADATA 0xB1600024
1195# define SSI_AD_D (1 << 24)
1196# define SSI_AD_ADDR_BIT 16
1197# define SSI_AD_ADDR_MASK (0xff << 16)
1198# define SSI_AD_DATA_BIT 0
1199# define SSI_AD_DATA_MASK (0xfff << 0)
1200#define SSI0_CLKDIV 0xB1600028
1201#define SSI0_CONTROL 0xB1600100
1202# define SSI_CONTROL_CD (1 << 1)
1203# define SSI_CONTROL_E (1 << 0)
1204
1205/* SSI1 */
1206#define SSI1_STATUS 0xB1680000
1207#define SSI1_INT 0xB1680004
1208#define SSI1_INT_ENABLE 0xB1680008
1209#define SSI1_CONFIG 0xB1680020
1210#define SSI1_ADATA 0xB1680024
1211#define SSI1_CLKDIV 0xB1680028
1212#define SSI1_ENABLE 0xB1680100
1213
1214/*
1215 * Register content definitions
1216 */
1217#define SSI_STATUS_BF (1 << 4)
1218#define SSI_STATUS_OF (1 << 3)
1219#define SSI_STATUS_UF (1 << 2)
1220#define SSI_STATUS_D (1 << 1)
1221#define SSI_STATUS_B (1 << 0)
1222
1223/* SSI_INT */
1224#define SSI_INT_OI (1 << 3)
1225#define SSI_INT_UI (1 << 2)
1226#define SSI_INT_DI (1 << 1)
1227
1228/* SSI_INTEN */
1229#define SSI_INTEN_OIE (1 << 3)
1230#define SSI_INTEN_UIE (1 << 2)
1231#define SSI_INTEN_DIE (1 << 1)
1232
1233#define SSI_CONFIG_AO (1 << 24)
1234#define SSI_CONFIG_DO (1 << 23)
1235#define SSI_CONFIG_ALEN (7 << 20)
1236#define SSI_CONFIG_DLEN (15 << 16)
1237#define SSI_CONFIG_DD (1 << 11)
1238#define SSI_CONFIG_AD (1 << 10)
1239#define SSI_CONFIG_BM (3 << 8)
1240#define SSI_CONFIG_CE (1 << 7)
1241#define SSI_CONFIG_DP (1 << 6)
1242#define SSI_CONFIG_DL (1 << 5)
1243#define SSI_CONFIG_EP (1 << 4)
1244#define SSI_CONFIG_ALEN_N(N) ((N-1) << 20)
1245#define SSI_CONFIG_DLEN_N(N) ((N-1) << 16)
1246#define SSI_CONFIG_BM_HI (0 << 8)
1247#define SSI_CONFIG_BM_LO (1 << 8)
1248#define SSI_CONFIG_BM_CY (2 << 8)
1249
1250#define SSI_ADATA_D (1 << 24)
1251#define SSI_ADATA_ADDR (0xFF << 16)
1252#define SSI_ADATA_DATA 0x0FFF
1253#define SSI_ADATA_ADDR_N(N) (N << 16)
1254
1255#define SSI_ENABLE_CD (1 << 1)
1256#define SSI_ENABLE_E (1 << 0)
1257
1258
1259/*
1260 * The IrDA peripheral has an IRFIRSEL pin, but on the DB/PB boards it's not
1261 * used to select FIR/SIR mode on the transceiver but as a GPIO. Instead a
1262 * CPLD has to be told about the mode.
1263 */
1264#define AU1000_IRDA_PHY_MODE_OFF 0
1265#define AU1000_IRDA_PHY_MODE_SIR 1
1266#define AU1000_IRDA_PHY_MODE_FIR 2
1267
1268struct au1k_irda_platform_data {
1269 void(*set_phy_mode)(int mode);
1270};
1271
1272
1273/* GPIO */
1274#define SYS_PINFUNC 0xB190002C
1275# define SYS_PF_USB (1 << 15) /* 2nd USB device/host */
1276# define SYS_PF_U3 (1 << 14) /* GPIO23/U3TXD */
1277# define SYS_PF_U2 (1 << 13) /* GPIO22/U2TXD */
1278# define SYS_PF_U1 (1 << 12) /* GPIO21/U1TXD */
1279# define SYS_PF_SRC (1 << 11) /* GPIO6/SROMCKE */
1280# define SYS_PF_CK5 (1 << 10) /* GPIO3/CLK5 */
1281# define SYS_PF_CK4 (1 << 9) /* GPIO2/CLK4 */
1282# define SYS_PF_IRF (1 << 8) /* GPIO15/IRFIRSEL */
1283# define SYS_PF_UR3 (1 << 7) /* GPIO[14:9]/UART3 */
1284# define SYS_PF_I2D (1 << 6) /* GPIO8/I2SDI */
1285# define SYS_PF_I2S (1 << 5) /* I2S/GPIO[29:31] */
1286# define SYS_PF_NI2 (1 << 4) /* NI2/GPIO[24:28] */
1287# define SYS_PF_U0 (1 << 3) /* U0TXD/GPIO20 */
1288# define SYS_PF_RD (1 << 2) /* IRTXD/GPIO19 */
1289# define SYS_PF_A97 (1 << 1) /* AC97/SSL1 */
1290# define SYS_PF_S0 (1 << 0) /* SSI_0/GPIO[16:18] */
1291
1292/* Au1100 only */
1293# define SYS_PF_PC (1 << 18) /* PCMCIA/GPIO[207:204] */
1294# define SYS_PF_LCD (1 << 17) /* extern lcd/GPIO[203:200] */
1295# define SYS_PF_CS (1 << 16) /* EXTCLK0/32KHz to gpio2 */
1296# define SYS_PF_EX0 (1 << 9) /* GPIO2/clock */
1297
1298/* Au1550 only. Redefines lots of pins */
1299# define SYS_PF_PSC2_MASK (7 << 17)
1300# define SYS_PF_PSC2_AC97 0
1301# define SYS_PF_PSC2_SPI 0
1302# define SYS_PF_PSC2_I2S (1 << 17)
1303# define SYS_PF_PSC2_SMBUS (3 << 17)
1304# define SYS_PF_PSC2_GPIO (7 << 17)
1305# define SYS_PF_PSC3_MASK (7 << 20)
1306# define SYS_PF_PSC3_AC97 0
1307# define SYS_PF_PSC3_SPI 0
1308# define SYS_PF_PSC3_I2S (1 << 20)
1309# define SYS_PF_PSC3_SMBUS (3 << 20)
1310# define SYS_PF_PSC3_GPIO (7 << 20)
1311# define SYS_PF_PSC1_S1 (1 << 1)
1312# define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
1313
1314/* Au1200 only */
1315#define SYS_PINFUNC_DMA (1 << 31)
1316#define SYS_PINFUNC_S0A (1 << 30)
1317#define SYS_PINFUNC_S1A (1 << 29)
1318#define SYS_PINFUNC_LP0 (1 << 28)
1319#define SYS_PINFUNC_LP1 (1 << 27)
1320#define SYS_PINFUNC_LD16 (1 << 26)
1321#define SYS_PINFUNC_LD8 (1 << 25)
1322#define SYS_PINFUNC_LD1 (1 << 24)
1323#define SYS_PINFUNC_LD0 (1 << 23)
1324#define SYS_PINFUNC_P1A (3 << 21)
1325#define SYS_PINFUNC_P1B (1 << 20)
1326#define SYS_PINFUNC_FS3 (1 << 19)
1327#define SYS_PINFUNC_P0A (3 << 17)
1328#define SYS_PINFUNC_CS (1 << 16)
1329#define SYS_PINFUNC_CIM (1 << 15)
1330#define SYS_PINFUNC_P1C (1 << 14)
1331#define SYS_PINFUNC_U1T (1 << 12)
1332#define SYS_PINFUNC_U1R (1 << 11)
1333#define SYS_PINFUNC_EX1 (1 << 10)
1334#define SYS_PINFUNC_EX0 (1 << 9)
1335#define SYS_PINFUNC_U0R (1 << 8)
1336#define SYS_PINFUNC_MC (1 << 7)
1337#define SYS_PINFUNC_S0B (1 << 6)
1338#define SYS_PINFUNC_S0C (1 << 5)
1339#define SYS_PINFUNC_P0B (1 << 4)
1340#define SYS_PINFUNC_U0T (1 << 3)
1341#define SYS_PINFUNC_S1B (1 << 2)
1342
1343/* Power Management */
1344#define SYS_SCRATCH0 0xB1900018
1345#define SYS_SCRATCH1 0xB190001C
1346#define SYS_WAKEMSK 0xB1900034
1347#define SYS_ENDIAN 0xB1900038
1348#define SYS_POWERCTRL 0xB190003C
1349#define SYS_WAKESRC 0xB190005C
1350#define SYS_SLPPWR 0xB1900078
1351#define SYS_SLEEP 0xB190007C
1352
1353#define SYS_WAKEMSK_D2 (1 << 9)
1354#define SYS_WAKEMSK_M2 (1 << 8)
1355#define SYS_WAKEMSK_GPIO(x) (1 << (x))
1356
1357/* Clock Controller */
1358#define SYS_FREQCTRL0 0xB1900020
1359# define SYS_FC_FRDIV2_BIT 22
1360# define SYS_FC_FRDIV2_MASK (0xff << SYS_FC_FRDIV2_BIT)
1361# define SYS_FC_FE2 (1 << 21)
1362# define SYS_FC_FS2 (1 << 20)
1363# define SYS_FC_FRDIV1_BIT 12
1364# define SYS_FC_FRDIV1_MASK (0xff << SYS_FC_FRDIV1_BIT)
1365# define SYS_FC_FE1 (1 << 11)
1366# define SYS_FC_FS1 (1 << 10)
1367# define SYS_FC_FRDIV0_BIT 2
1368# define SYS_FC_FRDIV0_MASK (0xff << SYS_FC_FRDIV0_BIT)
1369# define SYS_FC_FE0 (1 << 1)
1370# define SYS_FC_FS0 (1 << 0)
1371#define SYS_FREQCTRL1 0xB1900024
1372# define SYS_FC_FRDIV5_BIT 22
1373# define SYS_FC_FRDIV5_MASK (0xff << SYS_FC_FRDIV5_BIT)
1374# define SYS_FC_FE5 (1 << 21)
1375# define SYS_FC_FS5 (1 << 20)
1376# define SYS_FC_FRDIV4_BIT 12
1377# define SYS_FC_FRDIV4_MASK (0xff << SYS_FC_FRDIV4_BIT)
1378# define SYS_FC_FE4 (1 << 11)
1379# define SYS_FC_FS4 (1 << 10)
1380# define SYS_FC_FRDIV3_BIT 2
1381# define SYS_FC_FRDIV3_MASK (0xff << SYS_FC_FRDIV3_BIT)
1382# define SYS_FC_FE3 (1 << 1)
1383# define SYS_FC_FS3 (1 << 0)
1384#define SYS_CLKSRC 0xB1900028
1385# define SYS_CS_ME1_BIT 27
1386# define SYS_CS_ME1_MASK (0x7 << SYS_CS_ME1_BIT)
1387# define SYS_CS_DE1 (1 << 26)
1388# define SYS_CS_CE1 (1 << 25)
1389# define SYS_CS_ME0_BIT 22
1390# define SYS_CS_ME0_MASK (0x7 << SYS_CS_ME0_BIT)
1391# define SYS_CS_DE0 (1 << 21)
1392# define SYS_CS_CE0 (1 << 20)
1393# define SYS_CS_MI2_BIT 17
1394# define SYS_CS_MI2_MASK (0x7 << SYS_CS_MI2_BIT)
1395# define SYS_CS_DI2 (1 << 16)
1396# define SYS_CS_CI2 (1 << 15)
1397
1398# define SYS_CS_ML_BIT 7
1399# define SYS_CS_ML_MASK (0x7 << SYS_CS_ML_BIT)
1400# define SYS_CS_DL (1 << 6)
1401# define SYS_CS_CL (1 << 5)
1402
1403# define SYS_CS_MUH_BIT 12
1404# define SYS_CS_MUH_MASK (0x7 << SYS_CS_MUH_BIT)
1405# define SYS_CS_DUH (1 << 11)
1406# define SYS_CS_CUH (1 << 10)
1407# define SYS_CS_MUD_BIT 7
1408# define SYS_CS_MUD_MASK (0x7 << SYS_CS_MUD_BIT)
1409# define SYS_CS_DUD (1 << 6)
1410# define SYS_CS_CUD (1 << 5)
1411
1412# define SYS_CS_MIR_BIT 2
1413# define SYS_CS_MIR_MASK (0x7 << SYS_CS_MIR_BIT)
1414# define SYS_CS_DIR (1 << 1)
1415# define SYS_CS_CIR (1 << 0)
1416
1417# define SYS_CS_MUX_AUX 0x1
1418# define SYS_CS_MUX_FQ0 0x2
1419# define SYS_CS_MUX_FQ1 0x3
1420# define SYS_CS_MUX_FQ2 0x4
1421# define SYS_CS_MUX_FQ3 0x5
1422# define SYS_CS_MUX_FQ4 0x6
1423# define SYS_CS_MUX_FQ5 0x7
1424#define SYS_CPUPLL 0xB1900060
1425#define SYS_AUXPLL 0xB1900064
1426
1427/* AC97 Controller */
1428#define AC97C_CONFIG 0xB0000000
1429# define AC97C_RECV_SLOTS_BIT 13
1430# define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
1431# define AC97C_XMIT_SLOTS_BIT 3
1432# define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
1433# define AC97C_SG (1 << 2)
1434# define AC97C_SYNC (1 << 1)
1435# define AC97C_RESET (1 << 0)
1436#define AC97C_STATUS 0xB0000004
1437# define AC97C_XU (1 << 11)
1438# define AC97C_XO (1 << 10)
1439# define AC97C_RU (1 << 9)
1440# define AC97C_RO (1 << 8)
1441# define AC97C_READY (1 << 7)
1442# define AC97C_CP (1 << 6)
1443# define AC97C_TR (1 << 5)
1444# define AC97C_TE (1 << 4)
1445# define AC97C_TF (1 << 3)
1446# define AC97C_RR (1 << 2)
1447# define AC97C_RE (1 << 1)
1448# define AC97C_RF (1 << 0)
1449#define AC97C_DATA 0xB0000008
1450#define AC97C_CMD 0xB000000C
1451# define AC97C_WD_BIT 16
1452# define AC97C_READ (1 << 7)
1453# define AC97C_INDEX_MASK 0x7f
1454#define AC97C_CNTRL 0xB0000010
1455# define AC97C_RS (1 << 1)
1456# define AC97C_CE (1 << 0)
1457
1458
1459/* The PCI chip selects are outside the 32bit space, and since we can't
1460 * just program the 36bit addresses into BARs, we have to take a chunk
1461 * out of the 32bit space and reserve it for PCI. When these addresses
1462 * are ioremap()ed, they'll be fixed up to the real 36bit address before
1463 * being passed to the real ioremap function.
1464 */
1465#define ALCHEMY_PCI_MEMWIN_START (AU1500_PCI_MEM_PHYS_ADDR >> 4)
1466#define ALCHEMY_PCI_MEMWIN_END (ALCHEMY_PCI_MEMWIN_START + 0x0FFFFFFF)
1467
1468/* for PCI IO it's simpler because we get to do the ioremap ourselves and then
1469 * adjust the device's resources.
1470 */
1471#define ALCHEMY_PCI_IOWIN_START 0x00001000
1472#define ALCHEMY_PCI_IOWIN_END 0x0000FFFF
1473
1474#ifdef CONFIG_PCI
1475
1476#define IOPORT_RESOURCE_START 0x00001000 /* skip legacy probing */
1477#define IOPORT_RESOURCE_END 0xffffffff
1478#define IOMEM_RESOURCE_START 0x10000000
1479#define IOMEM_RESOURCE_END 0xfffffffffULL
1480
1481#else
1482
1483/* Don't allow any legacy ports probing */
1484#define IOPORT_RESOURCE_START 0x10000000
1485#define IOPORT_RESOURCE_END 0xffffffff
1486#define IOMEM_RESOURCE_START 0x10000000
1487#define IOMEM_RESOURCE_END 0xfffffffffULL
1488
1489#endif
1490
1491/* PCI controller block register offsets */
1492#define PCI_REG_CMEM 0x0000
1493#define PCI_REG_CONFIG 0x0004
1494#define PCI_REG_B2BMASK_CCH 0x0008
1495#define PCI_REG_B2BBASE0_VID 0x000C
1496#define PCI_REG_B2BBASE1_SID 0x0010
1497#define PCI_REG_MWMASK_DEV 0x0014
1498#define PCI_REG_MWBASE_REV_CCL 0x0018
1499#define PCI_REG_ERR_ADDR 0x001C
1500#define PCI_REG_SPEC_INTACK 0x0020
1501#define PCI_REG_ID 0x0100
1502#define PCI_REG_STATCMD 0x0104
1503#define PCI_REG_CLASSREV 0x0108
1504#define PCI_REG_PARAM 0x010C
1505#define PCI_REG_MBAR 0x0110
1506#define PCI_REG_TIMEOUT 0x0140
1507
1508/* PCI controller block register bits */
1509#define PCI_CMEM_E (1 << 28) /* enable cacheable memory */
1510#define PCI_CMEM_CMBASE(x) (((x) & 0x3fff) << 14)
1511#define PCI_CMEM_CMMASK(x) ((x) & 0x3fff)
1512#define PCI_CONFIG_ERD (1 << 27) /* pci error during R/W */
1513#define PCI_CONFIG_ET (1 << 26) /* error in target mode */
1514#define PCI_CONFIG_EF (1 << 25) /* fatal error */
1515#define PCI_CONFIG_EP (1 << 24) /* parity error */
1516#define PCI_CONFIG_EM (1 << 23) /* multiple errors */
1517#define PCI_CONFIG_BM (1 << 22) /* bad master error */
1518#define PCI_CONFIG_PD (1 << 20) /* PCI Disable */
1519#define PCI_CONFIG_BME (1 << 19) /* Byte Mask Enable for reads */
1520#define PCI_CONFIG_NC (1 << 16) /* mark mem access non-coherent */
1521#define PCI_CONFIG_IA (1 << 15) /* INTA# enabled (target mode) */
1522#define PCI_CONFIG_IP (1 << 13) /* int on PCI_PERR# */
1523#define PCI_CONFIG_IS (1 << 12) /* int on PCI_SERR# */
1524#define PCI_CONFIG_IMM (1 << 11) /* int on master abort */
1525#define PCI_CONFIG_ITM (1 << 10) /* int on target abort (as master) */
1526#define PCI_CONFIG_ITT (1 << 9) /* int on target abort (as target) */
1527#define PCI_CONFIG_IPB (1 << 8) /* int on PERR# in bus master acc */
1528#define PCI_CONFIG_SIC_NO (0 << 6) /* no byte mask changes */
1529#define PCI_CONFIG_SIC_BA_ADR (1 << 6) /* on byte/hw acc, invert adr bits */
1530#define PCI_CONFIG_SIC_HWA_DAT (2 << 6) /* on halfword acc, swap data */
1531#define PCI_CONFIG_SIC_ALL (3 << 6) /* swap data bytes on all accesses */
1532#define PCI_CONFIG_ST (1 << 5) /* swap data by target transactions */
1533#define PCI_CONFIG_SM (1 << 4) /* swap data from PCI ctl */
1534#define PCI_CONFIG_AEN (1 << 3) /* enable internal arbiter */
1535#define PCI_CONFIG_R2H (1 << 2) /* REQ2# to hi-prio arbiter */
1536#define PCI_CONFIG_R1H (1 << 1) /* REQ1# to hi-prio arbiter */
1537#define PCI_CONFIG_CH (1 << 0) /* PCI ctl to hi-prio arbiter */
1538#define PCI_B2BMASK_B2BMASK(x) (((x) & 0xffff) << 16)
1539#define PCI_B2BMASK_CCH(x) ((x) & 0xffff) /* 16 upper bits of class code */
1540#define PCI_B2BBASE0_VID_B0(x) (((x) & 0xffff) << 16)
1541#define PCI_B2BBASE0_VID_SV(x) ((x) & 0xffff)
1542#define PCI_B2BBASE1_SID_B1(x) (((x) & 0xffff) << 16)
1543#define PCI_B2BBASE1_SID_SI(x) ((x) & 0xffff)
1544#define PCI_MWMASKDEV_MWMASK(x) (((x) & 0xffff) << 16)
1545#define PCI_MWMASKDEV_DEVID(x) ((x) & 0xffff)
1546#define PCI_MWBASEREVCCL_BASE(x) (((x) & 0xffff) << 16)
1547#define PCI_MWBASEREVCCL_REV(x) (((x) & 0xff) << 8)
1548#define PCI_MWBASEREVCCL_CCL(x) ((x) & 0xff)
1549#define PCI_ID_DID(x) (((x) & 0xffff) << 16)
1550#define PCI_ID_VID(x) ((x) & 0xffff)
1551#define PCI_STATCMD_STATUS(x) (((x) & 0xffff) << 16)
1552#define PCI_STATCMD_CMD(x) ((x) & 0xffff)
1553#define PCI_CLASSREV_CLASS(x) (((x) & 0x00ffffff) << 8)
1554#define PCI_CLASSREV_REV(x) ((x) & 0xff)
1555#define PCI_PARAM_BIST(x) (((x) & 0xff) << 24)
1556#define PCI_PARAM_HT(x) (((x) & 0xff) << 16)
1557#define PCI_PARAM_LT(x) (((x) & 0xff) << 8)
1558#define PCI_PARAM_CLS(x) ((x) & 0xff)
1559#define PCI_TIMEOUT_RETRIES(x) (((x) & 0xff) << 8) /* max retries */
1560#define PCI_TIMEOUT_TO(x) ((x) & 0xff) /* target ready timeout */
1561
1562#endif 1211#endif