blob: 9c30955630ffb8882064a53a54c76e9d810af659 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Paul Mundt2c7834a2006-09-27 18:17:31 +090011#define _ASM_SH_MACHVEC_H
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/types.h>
14#include <linux/time.h>
Sam Ravnborg3252b112009-10-17 22:20:22 +020015#include <generated/machtypes.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Paul Mundtb66c1a32006-01-16 22:14:15 -080017struct sh_machine_vector {
Paul Mundt2c7834a2006-09-27 18:17:31 +090018 void (*mv_setup)(char **cmdline_p);
19 const char *mv_name;
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 int mv_nr_irqs;
21
Paul Mundtb66c1a32006-01-16 22:14:15 -080022 u8 (*mv_inb)(unsigned long);
23 u16 (*mv_inw)(unsigned long);
24 u32 (*mv_inl)(unsigned long);
25 void (*mv_outb)(u8, unsigned long);
26 void (*mv_outw)(u16, unsigned long);
27 void (*mv_outl)(u32, unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Paul Mundtb66c1a32006-01-16 22:14:15 -080029 u8 (*mv_inb_p)(unsigned long);
30 u16 (*mv_inw_p)(unsigned long);
31 u32 (*mv_inl_p)(unsigned long);
32 void (*mv_outb_p)(u8, unsigned long);
33 void (*mv_outw_p)(u16, unsigned long);
34 void (*mv_outl_p)(u32, unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Paul Mundtb66c1a32006-01-16 22:14:15 -080036 void (*mv_insb)(unsigned long, void *dst, unsigned long count);
37 void (*mv_insw)(unsigned long, void *dst, unsigned long count);
38 void (*mv_insl)(unsigned long, void *dst, unsigned long count);
39 void (*mv_outsb)(unsigned long, const void *src, unsigned long count);
40 void (*mv_outsw)(unsigned long, const void *src, unsigned long count);
41 void (*mv_outsl)(unsigned long, const void *src, unsigned long count);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 int (*mv_irq_demux)(int irq);
44
45 void (*mv_init_irq)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Paul Mundtb66c1a32006-01-16 22:14:15 -080047 void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
48 void (*mv_ioport_unmap)(void __iomem *);
Paul Mundt253b0882009-05-13 17:38:11 +090049
50 int (*mv_clk_init)(void);
Magnus Dammeb9b9b52009-05-28 11:51:51 +000051 int (*mv_mode_pins)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052};
53
54extern struct sh_machine_vector sh_mv;
55
Paul Mundt2c7834a2006-09-27 18:17:31 +090056#define get_system_type() sh_mv.mv_name
57
Paul Mundt82f81f42007-05-15 15:19:34 +090058#define __initmv \
Adrian Bunk3ff6eec2008-01-24 22:16:20 +010059 __used __section(.machvec.init)
Paul Mundt82f81f42007-05-15 15:19:34 +090060
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif /* _ASM_SH_MACHVEC_H */