1 /*
2  * include/asm-sh/machvec.h
3  *
4  * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
5  *
6  * May be copied or modified under the terms of the GNU General Public
7  * License.  See linux/COPYING for more information.
8  */
9 
10 #ifndef _ASM_SH_MACHVEC_H
11 #define _ASM_SH_MACHVEC_H 1
12 
13 #include <linux/config.h>
14 #include <linux/types.h>
15 
16 struct timeval;
17 
18 struct sh_machine_vector
19 {
20 	const char *mv_name;
21 
22 	int mv_nr_irqs;
23 
24 	unsigned char (*mv_inb)(unsigned long);
25 	unsigned short (*mv_inw)(unsigned long);
26 	unsigned int (*mv_inl)(unsigned long);
27 	void (*mv_outb)(unsigned char, unsigned long);
28 	void (*mv_outw)(unsigned short, unsigned long);
29 	void (*mv_outl)(unsigned int, unsigned long);
30 
31 	unsigned char (*mv_inb_p)(unsigned long);
32 	unsigned short (*mv_inw_p)(unsigned long);
33 	unsigned int (*mv_inl_p)(unsigned long);
34 	void (*mv_outb_p)(unsigned char, unsigned long);
35 	void (*mv_outw_p)(unsigned short, unsigned long);
36 	void (*mv_outl_p)(unsigned int, unsigned long);
37 
38 	void (*mv_insb)(unsigned long port, void *addr, unsigned long count);
39 	void (*mv_insw)(unsigned long port, void *addr, unsigned long count);
40 	void (*mv_insl)(unsigned long port, void *addr, unsigned long count);
41 	void (*mv_outsb)(unsigned long port, const void *addr, unsigned long count);
42 	void (*mv_outsw)(unsigned long port, const void *addr, unsigned long count);
43 	void (*mv_outsl)(unsigned long port, const void *addr, unsigned long count);
44 
45 	unsigned char (*mv_readb)(unsigned long);
46 	unsigned short (*mv_readw)(unsigned long);
47 	unsigned int (*mv_readl)(unsigned long);
48 	void (*mv_writeb)(unsigned char, unsigned long);
49 	void (*mv_writew)(unsigned short, unsigned long);
50 	void (*mv_writel)(unsigned int, unsigned long);
51 
52 	void* (*mv_ioremap)(unsigned long offset, unsigned long size);
53 	void (*mv_iounmap)(void *addr);
54 
55 	unsigned long (*mv_isa_port2addr)(unsigned long offset);
56 
57 	int (*mv_irq_demux)(int irq);
58 
59 	void (*mv_init_arch)(void);
60 	void (*mv_init_irq)(void);
61 	void (*mv_init_pci)(void);
62 	void (*mv_kill_arch)(int);
63 
64 	void (*mv_heartbeat)(void);
65 
66 	void (*mv_rtc_gettimeofday)(struct timeval *tv);
67 	int (*mv_rtc_settimeofday)(const struct timeval *tv);
68 
69 	unsigned int mv_hw_se : 1;
70 	unsigned int mv_hw_shmse : 1;
71 	unsigned int mv_hw_hp600 : 1;
72 	unsigned int mv_hw_hp620 : 1;
73 	unsigned int mv_hw_hp680 : 1;
74 	unsigned int mv_hw_hp690 : 1;
75 	unsigned int mv_hw_hd64461 : 1;
76 	unsigned int mv_hw_sh2000 : 1;
77 	unsigned int mv_hw_hd64465 : 1;
78 	unsigned int mv_hw_dreamcast : 1;
79 	unsigned int mv_hw_bigsur : 1;
80 	unsigned int mv_hw_hs7729pci : 1;
81 	unsigned int mv_hw_7751se: 1;
82 	unsigned int mv_hw_adx : 1;
83 	unsigned int mv_hw_snapgear : 1;
84 	unsigned int mv_hw_sh4202_microdev : 1;
85 };
86 
87 extern struct sh_machine_vector sh_mv;
88 
89 /* Machine check macros */
90 #ifdef CONFIG_SH_GENERIC
91 #define MACH_SE		(sh_mv.mv_hw_se)
92 #define MACH_SHMSE	(sh_mv.mv_hw_shmse)
93 #define MACH_HP600	(sh_mv.mv_hw_hp600)
94 #define MACH_HP620	(sh_mv.mv_hw_hp620)
95 #define MACH_HP680	(sh_mv.mv_hw_hp680)
96 #define MACH_HP690	(sh_mv.mv_hw_hp690)
97 #define MACH_HD64461	(sh_mv.mv_hw_hd64461)
98 #define MACH_HD64465	(sh_mv.mv_hw_hd64465)
99 #define MACH_SH2000	(sh_mv.mv_hw_sh2000)
100 #define MACH_DREAMCAST	(sh_mv.mv_hw_dreamcast)
101 #define MACH_BIGSUR	(sh_mv.mv_hw_bigsur)
102 #define MACH_HS7729PCI	(sh_mv.mv_hw_hs7729pci)
103 #define MACH_7751SE	(sh_mv.mv_hw_7751se)
104 #define MACH_ADX	(sh_mv.mv_hw_adx)
105 #define MACH_SNAPGEAR	(sh_mv.mv_snapgear)
106 #define MACH_SH4202_MICRODEV	(sh_mv.mv_hw_sh4202_microdev)
107 #else
108 # ifdef CONFIG_SH_SOLUTION_ENGINE
109 #  define MACH_SE		1
110 # else
111 #  define MACH_SE		0
112 # endif
113 # ifdef CONFIG_SH_7751_SOLUTION_ENGINE
114 #  define MACH_7751SE		1
115 # else
116 #  define MACH_7751SE		0
117 # endif
118 # ifdef CONFIG_SH_MOBILE_SOLUTION_ENGINE
119 #  define MACH_SHMSE 	        1
120 # else
121 #  define MACH_SHMSE		0
122 # endif
123 # ifdef CONFIG_SH_HP600
124 #  define MACH_HP600		1
125 # else
126 #  define MACH_HP600		0
127 # endif
128 # ifdef CONFIG_SH_HP620
129 #  define MACH_HP620		1
130 # else
131 #  define MACH_HP620		0
132 # endif
133 # ifdef CONFIG_SH_HP680
134 #  define MACH_HP680		1
135 # else
136 #  define MACH_HP680		0
137 # endif
138 # ifdef CONFIG_SH_HP690
139 #  define MACH_HP690		1
140 # else
141 #  define MACH_HP690		0
142 # endif
143 # ifdef CONFIG_HD64461
144 #  define MACH_HD64461		1
145 # else
146 #  define MACH_HD64461		0
147 # endif
148 # ifdef CONFIG_HD64465
149 #  define MACH_HD64465		1
150 # else
151 #  define MACH_HD64465		0
152 # endif
153 # ifdef CONFIG_SH_SH2000
154 #  define MACH_SH2000		1
155 # else
156 #  define MACH_SH2000		0
157 # endif
158 # ifdef CONFIG_SH_EC3104
159 #  define MACH_EC3104		1
160 # else
161 #  define MACH_EC3104		0
162 # endif
163 # ifdef CONFIG_SH_DREAMCAST
164 #  define MACH_DREAMCAST	1
165 # else
166 #  define MACH_DREAMCAST	0
167 # endif
168 # ifdef CONFIG_SH_BIGSUR
169 #  define MACH_BIGSUR		1
170 # else
171 #  define MACH_BIGSUR		0
172 # endif
173 # ifdef CONFIG_SH_HS7729PCI
174 #  define MACH_HS7729PCI	1
175 # else
176 #  define MACH_HS7729PCI	0
177 # endif
178 # ifdef CONFIG_SH_ADX
179 #  define MACH_ADX		1
180 # else
181 #  define MACH_ADX		0
182 # endif
183 # ifdef CONFIG_SH_SECUREEDGE5410
184 #  define MACH_SNAPGEAR		1
185 # else
186 #  define MACH_SNAPGEAR		0
187 # endif
188 # ifdef CONFIG_SH_SH4202_MICRODEV
189 #  define MACH_SH4202_MICRODEV	1
190 # else
191 #  define MACH_SH4202_MICRODEV	0
192 # endif
193 #endif
194 
195 #endif /* _ASM_SH_MACHVEC_H */
196