xref: /netbsd-src/sys/arch/atari/include/iomap.h (revision 5e4c038a45edbc7d63b7c2daa76e29f88b64a4e3)
1 /*	$NetBSD: iomap.h,v 1.11 2002/04/15 17:05:14 bjh21 Exp $	*/
2 
3 /*
4  * Copyright (c) 1995 Leo Weppelman.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *      This product includes software developed by Leo Weppelman.
18  * 4. The name of the author may not be used to endorse or promote products
19  *    derived from this software without specific prior written permission
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef _MACHINE_IOMAP_H
34 #define _MACHINE_IOMAP_H
35 
36 #ifdef _KERNEL_OPT
37 #include "opt_mbtype.h"
38 #endif
39 /*
40  * Atari TT hardware:
41  * I/O Address maps
42  */
43 #ifdef _KERNEL
44 vaddr_t	stio_addr;		/* Where the st io-area is mapped	*/
45 #define	AD_STIO	(stio_addr)	/* .. see atari_init.c			*/
46 
47 /*
48  * PCI KVA addresses. These are determined in atari_init.c. Except for
49  * the config-space, they should be used for a PCI-console only. Other
50  * cards should use the bus-functions to map io & mem spaces.
51  * Each card gets an config area of NBPG  bytes.
52  * 'pci_mem_uncached' is used by the Milan interrupt handler that frobs
53  * with the PLX. Also, the Milan uses the first page of 'pci_io_addr' for
54  * access to some of it's ISA I/O devices (RTC, Interrupt controller, etc.)
55  */
56 vaddr_t	pci_conf_addr;		/* KVA base of PCI config space		*/
57 vaddr_t	pci_io_addr;		/* KVA base of PCI io-space		*/
58 vaddr_t	pci_mem_addr;		/* KVA base of PCI mem-space		*/
59 vaddr_t	pci_mem_uncached;	/* KVA base of an uncached PCI mem-page	*/
60 #endif /* _KERNEL */
61 
62 #define	PCI_CONFB_PHYS		(0xA0000000L)
63 #define	PCI_CONFM_PHYS		(0x00010000L)
64 
65 #if defined(_ATARIHW_)
66 #define	PCI_IO_PHYS		(0xB0000000L)
67 #define	PCI_MEM_PHYS		(0x80000000L)
68 #define PCI_VGA_PHYS		(0x800a0000L)
69 #define	ISA_IOSTART		(0xfff30000L) /* XXX: With byte frobbing */
70 #define	ISA_MEMSTART		(0xff000000L)
71 #endif /* defined(_ATARIHW_) */
72 
73 #if defined(_MILANHW_)
74 #define	PCI_IO_PHYS		(0x80000000L)
75 #define	PCI_MEM_PHYS		(0x40000000L)
76 #define PCI_VGA_PHYS		(0x400a0000L)
77 #define	ISA_IOSTART		(0x80000000L) /* !NO! byte frobbing	 */
78 #define	ISA_MEMSTART		(0x40000000L)
79 #endif	/* defined(_MILANHW_) */
80 
81 /*
82  * Pre-allocated PCI-memory regions (atari_init.c). We need those in the
83  * boot-stages.
84  * XXX: Can probably be reduced to only PCI_CONF_SIZE (Leo).
85  */
86 #define PCI_CONF_SIZE	(4 * NBPG)
87 #define PCI_IO_SIZE	(NBPG)
88 #define PCI_MEM_SIZE	(NBPG)
89 
90 #define	PCI_VGA_SIZE	(32 * 1024) /* XXX Leo: Only used by grfabs_et now. */
91 
92 /*
93  * See bootm_init()/bootm_alloc() in bus.c for the usage of this pool
94  * of pre-allocated VA-space.
95  */
96 #define	BOOTM_VA_POOL	(32 * 8192)	/* Pre-allocated VA-space	*/
97 
98 #define	AD_RAM		(0x000000L)	/* main memory			*/
99 #define	AD_CART		(0xFA0000L)	/* expansion cartridge		*/
100 #define	AD_ROM		(0xFC0000L)	/* system ROM			*/
101 #define	STIO_SIZE	(0x8000L)	/* Size of mapped I/O devices	*/
102 
103 /*
104  * Physical address of I/O area. Use only for pte initialisation!
105  */
106 #define	STIO_PHYS	((machineid & (ATARI_HADES | ATARI_MILAN))	\
107 				? 0xffff8000L				\
108 				: 0x00ff8000L)
109 
110 #if defined(_ATARIHW_)
111 
112 /*
113  * I/O addresses in the STIO area:
114  */
115 #define	AD_RAMCFG	(AD_STIO + 0x0000)	/* ram configuration	*/
116 #define AD_FAL_MON_TYPE	(AD_STIO + 0x0006)	/* Falcon monitor type	*/
117 #define	AD_VIDEO	(AD_STIO + 0x0200)	/* video controller	*/
118 #define AD_RESERVED	(AD_STIO + 0x0400)	/* reserved		*/
119 #define	AD_DMA		(AD_STIO + 0x0600)	/* DMA device access	*/
120 #define	AD_SCSI_DMA	(AD_STIO + 0x0700)	/* SCSI DMA registers	*/
121 #define	AD_NCR5380	(AD_STIO + 0x0780)	/* SCSI controller	*/
122 #define	AD_SOUND	(AD_STIO + 0x0800)	/* YM-2149		*/
123 #define	AD_RTC		(AD_STIO + 0x0960)	/* TT realtime clock	*/
124 #define	AD_SCC		(AD_STIO + 0x0C80)	/* SCC 8530		*/
125 #define	AD_SCU		(AD_STIO + 0x0E00)	/* System Control Unit	*/
126 #define	AD_CFG_SWITCH	(AD_STIO + 0x1200)	/* Config switches	*/
127 #define	AD_MFP		(AD_STIO + 0x7A00)	/* 68901		*/
128 #define	AD_MFP2		(AD_STIO + 0x7A80)	/* 68901-TT		*/
129 #define	AD_ACIA		(AD_STIO + 0x7C00)	/* 2 * 6850		*/
130 #endif /* defined(_ATARIHW_) */
131 
132 #if defined(_MILANHW_)
133 /*
134  * Milan onboard I/O
135  */
136 #define	AD_MFP		(AD_STIO + 0x4100)	/* 68901		*/
137 #define	AD_PLX		(AD_STIO + 0x4200)	/* PLX9080		*/
138 
139 /*
140  * Milan special locations in the first page of the PCI I/O space.
141  */
142 #define	AD_8259_MASTER	(pci_io_addr + 0x20)	/* Master int. contr.	*/
143 #define	AD_8259_SLAVE	(pci_io_addr + 0xA0)	/* Slave int. contr.	*/
144 #define	AD_RTC		(pci_io_addr + 0x70)	/* MC146818 compat. RTC	*/
145 
146 #endif /* defined(_MILANHW_) */
147 
148 #endif /* _MACHINE_IOMAP_H */
149