2 * linux/arch/sh/kernel/io_ec3104.c
3 * EC3104 companion chip support
5 * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
9 * This code was written without any documentation about the EC3104 chip. While
10 * I hope I got most of the basic functionality right, the register names I use
11 * are most likely completely different from those in the chip documentation.
13 * If you have any further information about the EC3104, please tell me
17 #include <linux/kernel.h>
18 #include <linux/types.h>
21 #include <asm/ec3104/ec3104.h>
24 * EC3104 has a real ISA bus which we redirect low port accesses to (the
25 * actual device on mine is a ESS 1868, and I don't want to hack the driver
26 * more than strictly necessary). I am not going to duplicate the
27 * hard coding of PC addresses (for the 16550s aso) here though; it's just
31 #define low_port(port) ((port) < 0x10000)
33 static inline unsigned long port2addr(unsigned long port
)
37 return EC3104_ISA_BASE
+ port
* 2;
39 /* XXX hack. it's unclear what to do about the serial ports */
41 return EC3104_BASE
+ (port
&0xffff) * 4;
49 unsigned char ec3104_inb(unsigned long port
)
53 ret
= *(volatile u8
*)port2addr(port
);
58 unsigned short ec3104_inw(unsigned long port
)
63 unsigned long ec3104_inl(unsigned long port
)
68 void ec3104_outb(unsigned char data
, unsigned long port
)
70 *(volatile u8
*)port2addr(port
) = data
;
73 void ec3104_outw(unsigned short data
, unsigned long port
)
78 void ec3104_outl(unsigned long data
, unsigned long port
)