18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Author: MontaVista Software, Inc.
38c2ecf20Sopenharmony_ci *	   source@mvista.com
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 2001-2002 MontaVista Software Inc.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci *  This program is free software; you can redistribute it and/or modify it
88c2ecf20Sopenharmony_ci *  under the terms of the GNU General Public License as published by the
98c2ecf20Sopenharmony_ci *  Free Software Foundation; either version 2 of the License, or (at your
108c2ecf20Sopenharmony_ci *  option) any later version.
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
138c2ecf20Sopenharmony_ci *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
148c2ecf20Sopenharmony_ci *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
158c2ecf20Sopenharmony_ci *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
168c2ecf20Sopenharmony_ci *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
178c2ecf20Sopenharmony_ci *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
188c2ecf20Sopenharmony_ci *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
198c2ecf20Sopenharmony_ci *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
208c2ecf20Sopenharmony_ci *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
218c2ecf20Sopenharmony_ci *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci *  You should have received a copy of the GNU General Public License along
248c2ecf20Sopenharmony_ci *  with this program; if not, write to the Free Software Foundation, Inc.,
258c2ecf20Sopenharmony_ci *  675 Mass Ave, Cambridge, MA 02139, USA.
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_ci#ifndef __ASM_TXX9_RBTX4927_H
288c2ecf20Sopenharmony_ci#define __ASM_TXX9_RBTX4927_H
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#include <asm/txx9/tx4927.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define RBTX4927_PCIMEM		0x08000000
338c2ecf20Sopenharmony_ci#define RBTX4927_PCIMEM_SIZE	0x08000000
348c2ecf20Sopenharmony_ci#define RBTX4927_PCIIO		0x16000000
358c2ecf20Sopenharmony_ci#define RBTX4927_PCIIO_SIZE	0x01000000
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define RBTX4927_LED_ADDR	(IO_BASE + TXX9_CE(2) + 0x00001000)
388c2ecf20Sopenharmony_ci#define RBTX4927_IMASK_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002000)
398c2ecf20Sopenharmony_ci#define RBTX4927_IMSTAT_ADDR	(IO_BASE + TXX9_CE(2) + 0x00002006)
408c2ecf20Sopenharmony_ci#define RBTX4927_SOFTINT_ADDR	(IO_BASE + TXX9_CE(2) + 0x00003000)
418c2ecf20Sopenharmony_ci#define RBTX4927_SOFTRESET_ADDR (IO_BASE + TXX9_CE(2) + 0x0000f000)
428c2ecf20Sopenharmony_ci#define RBTX4927_SOFTRESETLOCK_ADDR	(IO_BASE + TXX9_CE(2) + 0x0000f002)
438c2ecf20Sopenharmony_ci#define RBTX4927_PCIRESET_ADDR	(IO_BASE + TXX9_CE(2) + 0x0000f006)
448c2ecf20Sopenharmony_ci#define RBTX4927_BRAMRTC_BASE	(IO_BASE + TXX9_CE(2) + 0x00010000)
458c2ecf20Sopenharmony_ci#define RBTX4927_ETHER_BASE	(IO_BASE + TXX9_CE(2) + 0x00020000)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* Ethernet port address */
488c2ecf20Sopenharmony_ci#define RBTX4927_ETHER_ADDR	(RBTX4927_ETHER_BASE + 0x280)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define rbtx4927_imask_addr	((__u8 __iomem *)RBTX4927_IMASK_ADDR)
518c2ecf20Sopenharmony_ci#define rbtx4927_imstat_addr	((__u8 __iomem *)RBTX4927_IMSTAT_ADDR)
528c2ecf20Sopenharmony_ci#define rbtx4927_softint_addr	((__u8 __iomem *)RBTX4927_SOFTINT_ADDR)
538c2ecf20Sopenharmony_ci#define rbtx4927_softreset_addr ((__u8 __iomem *)RBTX4927_SOFTRESET_ADDR)
548c2ecf20Sopenharmony_ci#define rbtx4927_softresetlock_addr	\
558c2ecf20Sopenharmony_ci				((__u8 __iomem *)RBTX4927_SOFTRESETLOCK_ADDR)
568c2ecf20Sopenharmony_ci#define rbtx4927_pcireset_addr	((__u8 __iomem *)RBTX4927_PCIRESET_ADDR)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/* bits for ISTAT/IMASK/IMSTAT */
598c2ecf20Sopenharmony_ci#define RBTX4927_INTB_PCID	0
608c2ecf20Sopenharmony_ci#define RBTX4927_INTB_PCIC	1
618c2ecf20Sopenharmony_ci#define RBTX4927_INTB_PCIB	2
628c2ecf20Sopenharmony_ci#define RBTX4927_INTB_PCIA	3
638c2ecf20Sopenharmony_ci#define RBTX4927_INTF_PCID	(1 << RBTX4927_INTB_PCID)
648c2ecf20Sopenharmony_ci#define RBTX4927_INTF_PCIC	(1 << RBTX4927_INTB_PCIC)
658c2ecf20Sopenharmony_ci#define RBTX4927_INTF_PCIB	(1 << RBTX4927_INTB_PCIB)
668c2ecf20Sopenharmony_ci#define RBTX4927_INTF_PCIA	(1 << RBTX4927_INTB_PCIA)
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#define RBTX4927_NR_IRQ_IOC	8	/* IOC */
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOC	(TXX9_IRQ_BASE + TX4927_NUM_IR)
718c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOC_PCID	(RBTX4927_IRQ_IOC + RBTX4927_INTB_PCID)
728c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOC_PCIC	(RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIC)
738c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOC_PCIB	(RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIB)
748c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOC_PCIA	(RBTX4927_IRQ_IOC + RBTX4927_INTB_PCIA)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define RBTX4927_IRQ_IOCINT	(TXX9_IRQ_BASE + TX4927_IR_INT(1))
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#ifdef CONFIG_PCI
798c2ecf20Sopenharmony_ci#define RBTX4927_ISA_IO_OFFSET RBTX4927_PCIIO
808c2ecf20Sopenharmony_ci#else
818c2ecf20Sopenharmony_ci#define RBTX4927_ISA_IO_OFFSET 0
828c2ecf20Sopenharmony_ci#endif
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define RBTX4927_RTL_8019_BASE (RBTX4927_ETHER_ADDR - mips_io_port_base)
858c2ecf20Sopenharmony_ci#define RBTX4927_RTL_8019_IRQ  (TXX9_IRQ_BASE + TX4927_IR_INT(3))
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_civoid rbtx4927_prom_init(void);
888c2ecf20Sopenharmony_civoid rbtx4927_irq_setup(void);
898c2ecf20Sopenharmony_cistruct pci_dev;
908c2ecf20Sopenharmony_ciint rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#endif /* __ASM_TXX9_RBTX4927_H */
93