xref: /linux/arch/arm/include/asm/hardware/dec21285.h (revision a09e64fbc0094e3073dbb09c3b4bfe4ab669244b)
14baa9922SRussell King /*
24baa9922SRussell King  *  arch/arm/include/asm/hardware/dec21285.h
34baa9922SRussell King  *
44baa9922SRussell King  *  Copyright (C) 1998 Russell King
54baa9922SRussell King  *
64baa9922SRussell King  * This program is free software; you can redistribute it and/or modify
74baa9922SRussell King  * it under the terms of the GNU General Public License version 2 as
84baa9922SRussell King  * published by the Free Software Foundation.
94baa9922SRussell King  *
104baa9922SRussell King  *  DC21285 registers
114baa9922SRussell King  */
124baa9922SRussell King #define DC21285_PCI_IACK		0x79000000
134baa9922SRussell King #define DC21285_ARMCSR_BASE		0x42000000
144baa9922SRussell King #define DC21285_PCI_TYPE_0_CONFIG	0x7b000000
154baa9922SRussell King #define DC21285_PCI_TYPE_1_CONFIG	0x7a000000
164baa9922SRussell King #define DC21285_OUTBOUND_WRITE_FLUSH	0x78000000
174baa9922SRussell King #define DC21285_FLASH			0x41000000
184baa9922SRussell King #define DC21285_PCI_IO			0x7c000000
194baa9922SRussell King #define DC21285_PCI_MEM			0x80000000
204baa9922SRussell King 
214baa9922SRussell King #ifndef __ASSEMBLY__
22*a09e64fbSRussell King #include <mach/hardware.h>
234baa9922SRussell King #define DC21285_IO(x)		((volatile unsigned long *)(ARMCSR_BASE+(x)))
244baa9922SRussell King #else
254baa9922SRussell King #define DC21285_IO(x)		(x)
264baa9922SRussell King #endif
274baa9922SRussell King 
284baa9922SRussell King #define CSR_PCICMD		DC21285_IO(0x0004)
294baa9922SRussell King #define CSR_CLASSREV		DC21285_IO(0x0008)
304baa9922SRussell King #define CSR_PCICACHELINESIZE	DC21285_IO(0x000c)
314baa9922SRussell King #define CSR_PCICSRBASE		DC21285_IO(0x0010)
324baa9922SRussell King #define CSR_PCICSRIOBASE	DC21285_IO(0x0014)
334baa9922SRussell King #define CSR_PCISDRAMBASE	DC21285_IO(0x0018)
344baa9922SRussell King #define CSR_PCIROMBASE		DC21285_IO(0x0030)
354baa9922SRussell King #define CSR_MBOX0		DC21285_IO(0x0050)
364baa9922SRussell King #define CSR_MBOX1		DC21285_IO(0x0054)
374baa9922SRussell King #define CSR_MBOX2		DC21285_IO(0x0058)
384baa9922SRussell King #define CSR_MBOX3		DC21285_IO(0x005c)
394baa9922SRussell King #define CSR_DOORBELL		DC21285_IO(0x0060)
404baa9922SRussell King #define CSR_DOORBELL_SETUP	DC21285_IO(0x0064)
414baa9922SRussell King #define CSR_ROMWRITEREG		DC21285_IO(0x0068)
424baa9922SRussell King #define CSR_CSRBASEMASK		DC21285_IO(0x00f8)
434baa9922SRussell King #define CSR_CSRBASEOFFSET	DC21285_IO(0x00fc)
444baa9922SRussell King #define CSR_SDRAMBASEMASK	DC21285_IO(0x0100)
454baa9922SRussell King #define CSR_SDRAMBASEOFFSET	DC21285_IO(0x0104)
464baa9922SRussell King #define CSR_ROMBASEMASK		DC21285_IO(0x0108)
474baa9922SRussell King #define CSR_SDRAMTIMING		DC21285_IO(0x010c)
484baa9922SRussell King #define CSR_SDRAMADDRSIZE0	DC21285_IO(0x0110)
494baa9922SRussell King #define CSR_SDRAMADDRSIZE1	DC21285_IO(0x0114)
504baa9922SRussell King #define CSR_SDRAMADDRSIZE2	DC21285_IO(0x0118)
514baa9922SRussell King #define CSR_SDRAMADDRSIZE3	DC21285_IO(0x011c)
524baa9922SRussell King #define CSR_I2O_INFREEHEAD	DC21285_IO(0x0120)
534baa9922SRussell King #define CSR_I2O_INPOSTTAIL	DC21285_IO(0x0124)
544baa9922SRussell King #define CSR_I2O_OUTPOSTHEAD	DC21285_IO(0x0128)
554baa9922SRussell King #define CSR_I2O_OUTFREETAIL	DC21285_IO(0x012c)
564baa9922SRussell King #define CSR_I2O_INFREECOUNT	DC21285_IO(0x0130)
574baa9922SRussell King #define CSR_I2O_OUTPOSTCOUNT	DC21285_IO(0x0134)
584baa9922SRussell King #define CSR_I2O_INPOSTCOUNT	DC21285_IO(0x0138)
594baa9922SRussell King #define CSR_SA110_CNTL		DC21285_IO(0x013c)
604baa9922SRussell King #define SA110_CNTL_INITCMPLETE		(1 << 0)
614baa9922SRussell King #define SA110_CNTL_ASSERTSERR		(1 << 1)
624baa9922SRussell King #define SA110_CNTL_RXSERR		(1 << 3)
634baa9922SRussell King #define SA110_CNTL_SA110DRAMPARITY	(1 << 4)
644baa9922SRussell King #define SA110_CNTL_PCISDRAMPARITY	(1 << 5)
654baa9922SRussell King #define SA110_CNTL_DMASDRAMPARITY	(1 << 6)
664baa9922SRussell King #define SA110_CNTL_DISCARDTIMER		(1 << 8)
674baa9922SRussell King #define SA110_CNTL_PCINRESET		(1 << 9)
684baa9922SRussell King #define SA110_CNTL_I2O_256		(0 << 10)
694baa9922SRussell King #define SA110_CNTL_I20_512		(1 << 10)
704baa9922SRussell King #define SA110_CNTL_I2O_1024		(2 << 10)
714baa9922SRussell King #define SA110_CNTL_I2O_2048		(3 << 10)
724baa9922SRussell King #define SA110_CNTL_I2O_4096		(4 << 10)
734baa9922SRussell King #define SA110_CNTL_I2O_8192		(5 << 10)
744baa9922SRussell King #define SA110_CNTL_I2O_16384		(6 << 10)
754baa9922SRussell King #define SA110_CNTL_I2O_32768		(7 << 10)
764baa9922SRussell King #define SA110_CNTL_WATCHDOG		(1 << 13)
774baa9922SRussell King #define SA110_CNTL_ROMWIDTH_UNDEF	(0 << 14)
784baa9922SRussell King #define SA110_CNTL_ROMWIDTH_16		(1 << 14)
794baa9922SRussell King #define SA110_CNTL_ROMWIDTH_32		(2 << 14)
804baa9922SRussell King #define SA110_CNTL_ROMWIDTH_8		(3 << 14)
814baa9922SRussell King #define SA110_CNTL_ROMACCESSTIME(x)	((x)<<16)
824baa9922SRussell King #define SA110_CNTL_ROMBURSTTIME(x)	((x)<<20)
834baa9922SRussell King #define SA110_CNTL_ROMTRISTATETIME(x)	((x)<<24)
844baa9922SRussell King #define SA110_CNTL_XCSDIR(x)		((x)<<28)
854baa9922SRussell King #define SA110_CNTL_PCICFN		(1 << 31)
864baa9922SRussell King 
874baa9922SRussell King /*
884baa9922SRussell King  * footbridge_cfn_mode() is used when we want
894baa9922SRussell King  * to check whether we are the central function
904baa9922SRussell King  */
914baa9922SRussell King #define __footbridge_cfn_mode() (*CSR_SA110_CNTL & SA110_CNTL_PCICFN)
924baa9922SRussell King #if defined(CONFIG_FOOTBRIDGE_HOST) && defined(CONFIG_FOOTBRIDGE_ADDIN)
934baa9922SRussell King #define footbridge_cfn_mode() __footbridge_cfn_mode()
944baa9922SRussell King #elif defined(CONFIG_FOOTBRIDGE_HOST)
954baa9922SRussell King #define footbridge_cfn_mode() (1)
964baa9922SRussell King #else
974baa9922SRussell King #define footbridge_cfn_mode() (0)
984baa9922SRussell King #endif
994baa9922SRussell King 
1004baa9922SRussell King #define CSR_PCIADDR_EXTN	DC21285_IO(0x0140)
1014baa9922SRussell King #define CSR_PREFETCHMEMRANGE	DC21285_IO(0x0144)
1024baa9922SRussell King #define CSR_XBUS_CYCLE		DC21285_IO(0x0148)
1034baa9922SRussell King #define CSR_XBUS_IOSTROBE	DC21285_IO(0x014c)
1044baa9922SRussell King #define CSR_DOORBELL_PCI	DC21285_IO(0x0150)
1054baa9922SRussell King #define CSR_DOORBELL_SA110	DC21285_IO(0x0154)
1064baa9922SRussell King #define CSR_UARTDR		DC21285_IO(0x0160)
1074baa9922SRussell King #define CSR_RXSTAT		DC21285_IO(0x0164)
1084baa9922SRussell King #define CSR_H_UBRLCR		DC21285_IO(0x0168)
1094baa9922SRussell King #define CSR_M_UBRLCR		DC21285_IO(0x016c)
1104baa9922SRussell King #define CSR_L_UBRLCR		DC21285_IO(0x0170)
1114baa9922SRussell King #define CSR_UARTCON		DC21285_IO(0x0174)
1124baa9922SRussell King #define CSR_UARTFLG		DC21285_IO(0x0178)
1134baa9922SRussell King #define CSR_IRQ_STATUS		DC21285_IO(0x0180)
1144baa9922SRussell King #define CSR_IRQ_RAWSTATUS	DC21285_IO(0x0184)
1154baa9922SRussell King #define CSR_IRQ_ENABLE		DC21285_IO(0x0188)
1164baa9922SRussell King #define CSR_IRQ_DISABLE		DC21285_IO(0x018c)
1174baa9922SRussell King #define CSR_IRQ_SOFT		DC21285_IO(0x0190)
1184baa9922SRussell King #define CSR_FIQ_STATUS		DC21285_IO(0x0280)
1194baa9922SRussell King #define CSR_FIQ_RAWSTATUS	DC21285_IO(0x0284)
1204baa9922SRussell King #define CSR_FIQ_ENABLE		DC21285_IO(0x0288)
1214baa9922SRussell King #define CSR_FIQ_DISABLE		DC21285_IO(0x028c)
1224baa9922SRussell King #define CSR_FIQ_SOFT		DC21285_IO(0x0290)
1234baa9922SRussell King #define CSR_TIMER1_LOAD		DC21285_IO(0x0300)
1244baa9922SRussell King #define CSR_TIMER1_VALUE	DC21285_IO(0x0304)
1254baa9922SRussell King #define CSR_TIMER1_CNTL		DC21285_IO(0x0308)
1264baa9922SRussell King #define CSR_TIMER1_CLR		DC21285_IO(0x030c)
1274baa9922SRussell King #define CSR_TIMER2_LOAD		DC21285_IO(0x0320)
1284baa9922SRussell King #define CSR_TIMER2_VALUE	DC21285_IO(0x0324)
1294baa9922SRussell King #define CSR_TIMER2_CNTL		DC21285_IO(0x0328)
1304baa9922SRussell King #define CSR_TIMER2_CLR		DC21285_IO(0x032c)
1314baa9922SRussell King #define CSR_TIMER3_LOAD		DC21285_IO(0x0340)
1324baa9922SRussell King #define CSR_TIMER3_VALUE	DC21285_IO(0x0344)
1334baa9922SRussell King #define CSR_TIMER3_CNTL		DC21285_IO(0x0348)
1344baa9922SRussell King #define CSR_TIMER3_CLR		DC21285_IO(0x034c)
1354baa9922SRussell King #define CSR_TIMER4_LOAD		DC21285_IO(0x0360)
1364baa9922SRussell King #define CSR_TIMER4_VALUE	DC21285_IO(0x0364)
1374baa9922SRussell King #define CSR_TIMER4_CNTL		DC21285_IO(0x0368)
1384baa9922SRussell King #define CSR_TIMER4_CLR		DC21285_IO(0x036c)
1394baa9922SRussell King 
1404baa9922SRussell King #define TIMER_CNTL_ENABLE	(1 << 7)
1414baa9922SRussell King #define TIMER_CNTL_AUTORELOAD	(1 << 6)
1424baa9922SRussell King #define TIMER_CNTL_DIV1		(0)
1434baa9922SRussell King #define TIMER_CNTL_DIV16	(1 << 2)
1444baa9922SRussell King #define TIMER_CNTL_DIV256	(2 << 2)
1454baa9922SRussell King #define TIMER_CNTL_CNTEXT	(3 << 2)
1464baa9922SRussell King 
1474baa9922SRussell King 
148