xref: /linux/arch/sh/drivers/pci/pci-sh7780.h (revision b75762302e144b73f12b72c59b99401d036680aa)
15283ecb5SPaul Mundt /*
25283ecb5SPaul Mundt  *	Low-Level PCI Support for SH7780 targets
35283ecb5SPaul Mundt  *
45283ecb5SPaul Mundt  *  Dustin McIntire (dustin@sensoria.com) (c) 2001
55283ecb5SPaul Mundt  *  Paul Mundt (lethal@linux-sh.org) (c) 2003
65283ecb5SPaul Mundt  *
75283ecb5SPaul Mundt  *  May be copied or modified under the terms of the GNU General Public
85283ecb5SPaul Mundt  *  License.  See linux/COPYING for more information.
95283ecb5SPaul Mundt  *
105283ecb5SPaul Mundt  */
115283ecb5SPaul Mundt 
125283ecb5SPaul Mundt #ifndef _PCI_SH7780_H_
135283ecb5SPaul Mundt #define _PCI_SH7780_H_
145283ecb5SPaul Mundt 
155283ecb5SPaul Mundt /* Platform Specific Values */
165283ecb5SPaul Mundt #define SH7780_VENDOR_ID	0x1912
175283ecb5SPaul Mundt #define SH7781_DEVICE_ID	0x0001
1832351a28SPaul Mundt #define SH7780_DEVICE_ID	0x0002
1932351a28SPaul Mundt #define SH7785_DEVICE_ID	0x0007
205283ecb5SPaul Mundt 
215283ecb5SPaul Mundt /* SH7780 Control Registers */
225283ecb5SPaul Mundt #define	SH7780_PCI_VCR0		0xFE000000
235283ecb5SPaul Mundt #define	SH7780_PCI_VCR1		0xFE000004
245283ecb5SPaul Mundt #define	SH7780_PCI_VCR2		0xFE000008
255283ecb5SPaul Mundt 
265283ecb5SPaul Mundt /* SH7780 Specific Values */
275283ecb5SPaul Mundt #define SH7780_PCI_CONFIG_BASE	0xFD000000	/* Config space base addr */
285283ecb5SPaul Mundt #define SH7780_PCI_CONFIG_SIZE	0x01000000	/* Config space size */
29959f85f8SPaul Mundt 
305283ecb5SPaul Mundt #define SH7780_PCI_MEMORY_BASE	0xFD000000	/* Memory space base addr */
315283ecb5SPaul Mundt #define SH7780_PCI_MEM_SIZE	0x01000000	/* Size of Memory window */
32959f85f8SPaul Mundt 
335283ecb5SPaul Mundt #define SH7780_PCI_IO_BASE	0xFE400000	/* IO space base address */
345283ecb5SPaul Mundt #define SH7780_PCI_IO_SIZE	0x00400000	/* Size of IO window */
355283ecb5SPaul Mundt 
365283ecb5SPaul Mundt #define SH7780_PCIREG_BASE	0xFE040000	/* PCI regs base address */
375283ecb5SPaul Mundt #define PCI_REG(n)		(SH7780_PCIREG_BASE+n)
385283ecb5SPaul Mundt 
395283ecb5SPaul Mundt /* SH7780 PCI Config Registers */
405283ecb5SPaul Mundt #define SH7780_PCIVID		0x000		/* Vendor ID */
415283ecb5SPaul Mundt #define SH7780_PCIDID		0x002		/* Device ID */
425283ecb5SPaul Mundt #define SH7780_PCICMD		0x004		/* Command */
435283ecb5SPaul Mundt #define SH7780_PCISTATUS	0x006		/* Status */
445283ecb5SPaul Mundt #define SH7780_PCIRID		0x008		/* Revision ID */
455283ecb5SPaul Mundt #define SH7780_PCIPIF		0x009		/* Program Interface */
465283ecb5SPaul Mundt #define SH7780_PCISUB		0x00a		/* Sub class code */
475283ecb5SPaul Mundt #define SH7780_PCIBCC		0x00b		/* Base class code */
485283ecb5SPaul Mundt #define SH7780_PCICLS		0x00c		/* Cache line size */
495283ecb5SPaul Mundt #define SH7780_PCILTM		0x00d		/* latency timer */
505283ecb5SPaul Mundt #define SH7780_PCIHDR		0x00e		/* Header type */
515283ecb5SPaul Mundt #define SH7780_PCIBIST		0x00f		/* BIST */
525283ecb5SPaul Mundt #define SH7780_PCIIBAR		0x010		/* IO Base address */
535283ecb5SPaul Mundt #define SH7780_PCIMBAR0		0x014		/* Memory base address0 */
545283ecb5SPaul Mundt #define SH7780_PCIMBAR1		0x018		/* Memory base address1 */
555283ecb5SPaul Mundt #define SH7780_PCISVID		0x02c		/* Sub system vendor ID */
565283ecb5SPaul Mundt #define SH7780_PCISID		0x02e		/* Sub system ID */
575283ecb5SPaul Mundt #define SH7780_PCICP		0x034
585283ecb5SPaul Mundt #define SH7780_PCIINTLINE	0x03c		/* Interrupt line */
595283ecb5SPaul Mundt #define SH7780_PCIINTPIN	0x03d		/* Interrupt pin */
605283ecb5SPaul Mundt #define SH7780_PCIMINGNT	0x03e		/* Minumum grand */
615283ecb5SPaul Mundt #define SH7780_PCIMAXLAT	0x03f		/* Maxmum latency */
625283ecb5SPaul Mundt #define SH7780_PCICID		0x040
635283ecb5SPaul Mundt #define SH7780_PCINIP		0x041
645283ecb5SPaul Mundt #define SH7780_PCIPMC		0x042
655283ecb5SPaul Mundt #define SH7780_PCIPMCSR		0x044
665283ecb5SPaul Mundt #define SH7780_PCIPMCSR_BSE	0x046
675283ecb5SPaul Mundt #define SH7780_PCICDD		0x047
685283ecb5SPaul Mundt 
69*b7576230SNobuhiro Iwamatsu #define SH7780_PCICR		0x100		/* PCI Control Register */
70*b7576230SNobuhiro Iwamatsu #define SH7780_PCILSR		0x104		/* PCI Local Space Register0 */
71*b7576230SNobuhiro Iwamatsu #define SH7780_PCILSR1		0x108		/* PCI Local Space Register1 */
72*b7576230SNobuhiro Iwamatsu #define SH7780_PCILAR0		0x10C		/* PCI Local Address Register1 */
73*b7576230SNobuhiro Iwamatsu #define SH7780_PCILAR1		0x110		/* PCI Local Address Register1 */
74*b7576230SNobuhiro Iwamatsu #define SH7780_PCIIR		0x114		/* PCI Interrupt Register */
75*b7576230SNobuhiro Iwamatsu #define SH7780_PCIIMR		0x118		/* PCI Interrupt Mask Register */
76*b7576230SNobuhiro Iwamatsu #define SH7780_PCIAIR		0x11C		/* Error Address Register */
77*b7576230SNobuhiro Iwamatsu #define SH7780_PCICIR		0x120		/* Error Command/Data Register */
78*b7576230SNobuhiro Iwamatsu #define SH7780_PCIAINT		0x130		/* Arbiter Interrupt Register */
79*b7576230SNobuhiro Iwamatsu #define SH7780_PCIAINTM		0x134		/* Arbiter Int. Mask Register */
80*b7576230SNobuhiro Iwamatsu #define SH7780_PCIBMIR		0x138		/* Error Bus Master Register */
81*b7576230SNobuhiro Iwamatsu #define SH7780_PCIPAR		0x1C0		/* PIO Address Register */
82*b7576230SNobuhiro Iwamatsu #define SH7780_PCIPINT		0x1CC		/* Power Mgmnt Int. Register */
83*b7576230SNobuhiro Iwamatsu #define SH7780_PCIPINTM		0x1D0		/* Power Mgmnt Mask Register */
84*b7576230SNobuhiro Iwamatsu 
85959f85f8SPaul Mundt #define SH7780_PCIMBR0		0x1E0
86959f85f8SPaul Mundt #define SH7780_PCIMBMR0		0x1E4
87959f85f8SPaul Mundt #define SH7780_PCIMBR2		0x1F0
88959f85f8SPaul Mundt #define SH7780_PCIMBMR2		0x1F4
89959f85f8SPaul Mundt #define SH7780_PCIIOBR		0x1F8
90959f85f8SPaul Mundt #define SH7780_PCIIOBMR		0x1FC
915283ecb5SPaul Mundt #define SH7780_PCICSCR0		0x210		/* Cache Snoop1 Cnt. Register */
925283ecb5SPaul Mundt #define SH7780_PCICSCR1		0x214		/* Cache Snoop2 Cnt. Register */
935283ecb5SPaul Mundt #define SH7780_PCICSAR0		0x218	/* Cache Snoop1 Addr. Register */
945283ecb5SPaul Mundt #define SH7780_PCICSAR1		0x21C	/* Cache Snoop2 Addr. Register */
955283ecb5SPaul Mundt 
965283ecb5SPaul Mundt /* General Memory Config Addresses */
975283ecb5SPaul Mundt #define SH7780_CS0_BASE_ADDR	0x0
985283ecb5SPaul Mundt #define SH7780_MEM_REGION_SIZE	0x04000000
995283ecb5SPaul Mundt #define SH7780_CS1_BASE_ADDR	(SH7780_CS0_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1005283ecb5SPaul Mundt #define SH7780_CS2_BASE_ADDR	(SH7780_CS1_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1015283ecb5SPaul Mundt #define SH7780_CS3_BASE_ADDR	(SH7780_CS2_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1025283ecb5SPaul Mundt #define SH7780_CS4_BASE_ADDR	(SH7780_CS3_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1035283ecb5SPaul Mundt #define SH7780_CS5_BASE_ADDR	(SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1045283ecb5SPaul Mundt #define SH7780_CS6_BASE_ADDR	(SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE)
1055283ecb5SPaul Mundt 
106959f85f8SPaul Mundt struct sh4_pci_address_map;
1075283ecb5SPaul Mundt 
1085283ecb5SPaul Mundt /* arch/sh/drivers/pci/pci-sh7780.c */
109959f85f8SPaul Mundt int sh7780_pcic_init(struct sh4_pci_address_map *map);
1105283ecb5SPaul Mundt 
1115283ecb5SPaul Mundt #endif /* _PCI_SH7780_H_ */
112