18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Definitions for TX4937/TX4938
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
58c2ecf20Sopenharmony_ci * terms of the GNU General Public License version 2. This program is
68c2ecf20Sopenharmony_ci * licensed "as is" without any warranty of any kind, whether express
78c2ecf20Sopenharmony_ci * or implied.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#ifndef __ASM_TXX9_RBTX4938_H
128c2ecf20Sopenharmony_ci#define __ASM_TXX9_RBTX4938_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <asm/addrspace.h>
158c2ecf20Sopenharmony_ci#include <asm/txx9irq.h>
168c2ecf20Sopenharmony_ci#include <asm/txx9/tx4938.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* Address map */
198c2ecf20Sopenharmony_ci#define RBTX4938_FPGA_REG_ADDR	(IO_BASE + TXX9_CE(2) + 0x00000000)
208c2ecf20Sopenharmony_ci#define RBTX4938_FPGA_REV_ADDR	(IO_BASE + TXX9_CE(2) + 0x00000002)
218c2ecf20Sopenharmony_ci#define RBTX4938_CONFIG1_ADDR	(IO_BASE + TXX9_CE(2) + 0x00000004)
228c2ecf20Sopenharmony_ci#define RBTX4938_CONFIG2_ADDR	(IO_BASE + TXX9_CE(2) + 0x00000006)
238c2ecf20Sopenharmony_ci#define RBTX4938_CONFIG3_ADDR	(IO_BASE + TXX9_CE(2) + 0x00000008)
248c2ecf20Sopenharmony_ci#define RBTX4938_LED_ADDR	(IO_BASE + TXX9_CE(2) + 0x00001000)
258c2ecf20Sopenharmony_ci#define RBTX4938_DIPSW_ADDR	(IO_BASE + TXX9_CE(2) + 0x00001002)
268c2ecf20Sopenharmony_ci#define RBTX4938_BDIPSW_ADDR	(IO_BASE + TXX9_CE(2) + 0x00001004)
278c2ecf20Sopenharmony_ci#define RBTX4938_IMASK_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002000)
288c2ecf20Sopenharmony_ci#define RBTX4938_IMASK2_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002002)
298c2ecf20Sopenharmony_ci#define RBTX4938_INTPOL_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002004)
308c2ecf20Sopenharmony_ci#define RBTX4938_ISTAT_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002006)
318c2ecf20Sopenharmony_ci#define RBTX4938_ISTAT2_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002008)
328c2ecf20Sopenharmony_ci#define RBTX4938_IMSTAT_ADDR	(IO_BASE + TXX9_CE(2) + 0x0000200a)
338c2ecf20Sopenharmony_ci#define RBTX4938_IMSTAT2_ADDR	(IO_BASE + TXX9_CE(2) + 0x0000200c)
348c2ecf20Sopenharmony_ci#define RBTX4938_SOFTINT_ADDR	(IO_BASE + TXX9_CE(2) + 0x00003000)
358c2ecf20Sopenharmony_ci#define RBTX4938_PIOSEL_ADDR	(IO_BASE + TXX9_CE(2) + 0x00005000)
368c2ecf20Sopenharmony_ci#define RBTX4938_SPICS_ADDR	(IO_BASE + TXX9_CE(2) + 0x00005002)
378c2ecf20Sopenharmony_ci#define RBTX4938_SFPWR_ADDR	(IO_BASE + TXX9_CE(2) + 0x00005008)
388c2ecf20Sopenharmony_ci#define RBTX4938_SFVOL_ADDR	(IO_BASE + TXX9_CE(2) + 0x0000500a)
398c2ecf20Sopenharmony_ci#define RBTX4938_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x00007000)
408c2ecf20Sopenharmony_ci#define RBTX4938_SOFTRESETLOCK_ADDR	(IO_BASE + TXX9_CE(2) + 0x00007002)
418c2ecf20Sopenharmony_ci#define RBTX4938_PCIRESET_ADDR	(IO_BASE + TXX9_CE(2) + 0x00007004)
428c2ecf20Sopenharmony_ci#define RBTX4938_ETHER_BASE	(IO_BASE + TXX9_CE(2) + 0x00020000)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* Ethernet port address (Jumperless Mode (W12:Open)) */
458c2ecf20Sopenharmony_ci#define RBTX4938_ETHER_ADDR	(RBTX4938_ETHER_BASE + 0x280)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* bits for ISTAT/IMASK/IMSTAT */
488c2ecf20Sopenharmony_ci#define RBTX4938_INTB_PCID	0
498c2ecf20Sopenharmony_ci#define RBTX4938_INTB_PCIC	1
508c2ecf20Sopenharmony_ci#define RBTX4938_INTB_PCIB	2
518c2ecf20Sopenharmony_ci#define RBTX4938_INTB_PCIA	3
528c2ecf20Sopenharmony_ci#define RBTX4938_INTB_RTC	4
538c2ecf20Sopenharmony_ci#define RBTX4938_INTB_ATA	5
548c2ecf20Sopenharmony_ci#define RBTX4938_INTB_MODEM	6
558c2ecf20Sopenharmony_ci#define RBTX4938_INTB_SWINT	7
568c2ecf20Sopenharmony_ci#define RBTX4938_INTF_PCID	(1 << RBTX4938_INTB_PCID)
578c2ecf20Sopenharmony_ci#define RBTX4938_INTF_PCIC	(1 << RBTX4938_INTB_PCIC)
588c2ecf20Sopenharmony_ci#define RBTX4938_INTF_PCIB	(1 << RBTX4938_INTB_PCIB)
598c2ecf20Sopenharmony_ci#define RBTX4938_INTF_PCIA	(1 << RBTX4938_INTB_PCIA)
608c2ecf20Sopenharmony_ci#define RBTX4938_INTF_RTC	(1 << RBTX4938_INTB_RTC)
618c2ecf20Sopenharmony_ci#define RBTX4938_INTF_ATA	(1 << RBTX4938_INTB_ATA)
628c2ecf20Sopenharmony_ci#define RBTX4938_INTF_MODEM	(1 << RBTX4938_INTB_MODEM)
638c2ecf20Sopenharmony_ci#define RBTX4938_INTF_SWINT	(1 << RBTX4938_INTB_SWINT)
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define rbtx4938_fpga_rev_addr	((__u8 __iomem *)RBTX4938_FPGA_REV_ADDR)
668c2ecf20Sopenharmony_ci#define rbtx4938_led_addr	((__u8 __iomem *)RBTX4938_LED_ADDR)
678c2ecf20Sopenharmony_ci#define rbtx4938_dipsw_addr	((__u8 __iomem *)RBTX4938_DIPSW_ADDR)
688c2ecf20Sopenharmony_ci#define rbtx4938_bdipsw_addr	((__u8 __iomem *)RBTX4938_BDIPSW_ADDR)
698c2ecf20Sopenharmony_ci#define rbtx4938_imask_addr	((__u8 __iomem *)RBTX4938_IMASK_ADDR)
708c2ecf20Sopenharmony_ci#define rbtx4938_imask2_addr	((__u8 __iomem *)RBTX4938_IMASK2_ADDR)
718c2ecf20Sopenharmony_ci#define rbtx4938_intpol_addr	((__u8 __iomem *)RBTX4938_INTPOL_ADDR)
728c2ecf20Sopenharmony_ci#define rbtx4938_istat_addr	((__u8 __iomem *)RBTX4938_ISTAT_ADDR)
738c2ecf20Sopenharmony_ci#define rbtx4938_istat2_addr	((__u8 __iomem *)RBTX4938_ISTAT2_ADDR)
748c2ecf20Sopenharmony_ci#define rbtx4938_imstat_addr	((__u8 __iomem *)RBTX4938_IMSTAT_ADDR)
758c2ecf20Sopenharmony_ci#define rbtx4938_imstat2_addr	((__u8 __iomem *)RBTX4938_IMSTAT2_ADDR)
768c2ecf20Sopenharmony_ci#define rbtx4938_softint_addr	((__u8 __iomem *)RBTX4938_SOFTINT_ADDR)
778c2ecf20Sopenharmony_ci#define rbtx4938_piosel_addr	((__u8 __iomem *)RBTX4938_PIOSEL_ADDR)
788c2ecf20Sopenharmony_ci#define rbtx4938_spics_addr	((__u8 __iomem *)RBTX4938_SPICS_ADDR)
798c2ecf20Sopenharmony_ci#define rbtx4938_sfpwr_addr	((__u8 __iomem *)RBTX4938_SFPWR_ADDR)
808c2ecf20Sopenharmony_ci#define rbtx4938_sfvol_addr	((__u8 __iomem *)RBTX4938_SFVOL_ADDR)
818c2ecf20Sopenharmony_ci#define rbtx4938_softreset_addr ((__u8 __iomem *)RBTX4938_SOFTRESET_ADDR)
828c2ecf20Sopenharmony_ci#define rbtx4938_softresetlock_addr	\
838c2ecf20Sopenharmony_ci				((__u8 __iomem *)RBTX4938_SOFTRESETLOCK_ADDR)
848c2ecf20Sopenharmony_ci#define rbtx4938_pcireset_addr	((__u8 __iomem *)RBTX4938_PCIRESET_ADDR)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/*
878c2ecf20Sopenharmony_ci * IRQ mappings
888c2ecf20Sopenharmony_ci */
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define RBTX4938_SOFT_INT0	0	/* not used */
918c2ecf20Sopenharmony_ci#define RBTX4938_SOFT_INT1	1	/* not used */
928c2ecf20Sopenharmony_ci#define RBTX4938_IRC_INT	2
938c2ecf20Sopenharmony_ci#define RBTX4938_TIMER_INT	7
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci/* These are the virtual IRQ numbers, we divide all IRQ's into
968c2ecf20Sopenharmony_ci * 'spaces', the 'space' determines where and how to enable/disable
978c2ecf20Sopenharmony_ci * that particular IRQ on an RBTX4938 machine.	Add new 'spaces' as new
988c2ecf20Sopenharmony_ci * IRQ hardware is supported.
998c2ecf20Sopenharmony_ci */
1008c2ecf20Sopenharmony_ci#define RBTX4938_NR_IRQ_IOC	8
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC	TXX9_IRQ_BASE
1038c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC	(TXX9_IRQ_BASE + TX4938_NUM_IR)
1048c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_END	(RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC)
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR)
1078c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR)
1088c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n))
1098c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n))
1108c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_DMA(ch, n)	(RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch, n))
1118c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PIO	(RBTX4938_IRQ_IRC + TX4938_IR_PIO)
1128c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PDMAC	(RBTX4938_IRQ_IRC + TX4938_IR_PDMAC)
1138c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PCIC	(RBTX4938_IRQ_IRC + TX4938_IR_PCIC)
1148c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n))
1158c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_NDFMC	(RBTX4938_IRQ_IRC + TX4938_IR_NDFMC)
1168c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR)
1178c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME)
1188c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_ACLC	(RBTX4938_IRQ_IRC + TX4938_IR_ACLC)
1198c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_ACLCPME	(RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME)
1208c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_PCIC1	(RBTX4938_IRQ_IRC + TX4938_IR_PCIC1)
1218c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IRC_SPI	(RBTX4938_IRQ_IRC + TX4938_IR_SPI)
1228c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_PCID	(RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID)
1238c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_PCIC	(RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC)
1248c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_PCIB	(RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB)
1258c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_PCIA	(RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA)
1268c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_RTC	(RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC)
1278c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_ATA	(RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA)
1288c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_MODEM	(RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM)
1298c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOC_SWINT	(RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT)
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* IOC (PCI, etc) */
1338c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_IOCINT	(TXX9_IRQ_BASE + TX4938_IR_INT(0))
1348c2ecf20Sopenharmony_ci/* Onboard 10M Ether */
1358c2ecf20Sopenharmony_ci#define RBTX4938_IRQ_ETHER	(TXX9_IRQ_BASE + TX4938_IR_INT(1))
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
1388c2ecf20Sopenharmony_ci#define RBTX4938_RTL_8019_IRQ  (RBTX4938_IRQ_ETHER)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_civoid rbtx4938_prom_init(void);
1418c2ecf20Sopenharmony_civoid rbtx4938_irq_setup(void);
1428c2ecf20Sopenharmony_cistruct pci_dev;
1438c2ecf20Sopenharmony_ciint rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#endif /* __ASM_TXX9_RBTX4938_H */
146