2 * I/O routines for Titan
5 #include <asm/machvec.h>
6 #include <asm/addrspace.h>
7 #include <mach/titan.h>
10 static inline unsigned int port2adr(unsigned int port
)
12 maybebadio((unsigned long)port
);
16 u8
titan_inb(unsigned long port
)
19 return ctrl_inb(port
);
20 return ctrl_inw(port2adr(port
)) & 0xff;
23 u8
titan_inb_p(unsigned long port
)
30 v
= ctrl_inw(port2adr(port
)) & 0xff;
35 u16
titan_inw(unsigned long port
)
38 return ctrl_inw(port
);
39 else if (port
>= 0x2000)
40 return ctrl_inw(port2adr(port
));
46 u32
titan_inl(unsigned long port
)
49 return ctrl_inl(port
);
50 else if (port
>= 0x2000)
51 return ctrl_inw(port2adr(port
));
57 void titan_outb(u8 value
, unsigned long port
)
60 ctrl_outb(value
, port
);
62 ctrl_outw(value
, port2adr(port
));
65 void titan_outb_p(u8 value
, unsigned long port
)
68 ctrl_outb(value
, port
);
70 ctrl_outw(value
, port2adr(port
));
74 void titan_outw(u16 value
, unsigned long port
)
77 ctrl_outw(value
, port
);
78 else if (port
>= 0x2000)
79 ctrl_outw(value
, port2adr(port
));
84 void titan_outl(u32 value
, unsigned long port
)
87 ctrl_outl(value
, port
);
92 void titan_insl(unsigned long port
, void *dst
, unsigned long count
)
97 void titan_outsl(unsigned long port
, const void *src
, unsigned long count
)
102 void __iomem
*titan_ioport_map(unsigned long port
, unsigned int size
)
105 return (void __iomem
*)port
;
107 return (void __iomem
*)port2adr(port
);