00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _ABLE_CLIB_ABLE_IO_H
00030 #define _ABLE_CLIB_ABLE_IO_H 1
00031
00032 #define ROM_BASE 0xf0000000
00033
00034 #define IO_BASE 0x10000000
00035
00036 #define PCIO_BASE (IO_BASE + 0x3010000)
00037 #define IOMD_BASE (IO_BASE + 0x3200000)
00038 #define VIDC_BASE (IO_BASE + 0x3400000)
00039
00040 #define IOC_BASE IOMD_BASE
00041 #define IO_IOMD_BASE IOMD_BASE
00042
00043
00044 #define PCIO_MAP(x) (PCIO_BASE + ((x) << 2))
00045
00046 #define FDC_BASE 0x3f0
00047
00048 #define PARPORT_BASE 0x278
00049
00050 #define SERIAL_BASE_1 0x3f8
00051 #define SERIAL_BASE_2 0x2f8
00052
00053 #ifndef __ASSEMBLY__
00054
00055 typedef unsigned long io_addr_t;
00056
00057 #include <sys/types.h>
00058
00059
00060 extern void insw(volatile void *, void *, size_t);
00061 extern void outsw(void *, void *, size_t);
00062
00063 extern void infsw(volatile void *, void *, size_t);
00064
00065 static inline unsigned char inb(io_addr_t byte)
00066 {
00067 return *((volatile unsigned char *)byte);
00068 }
00069
00070 static inline unsigned short inw(io_addr_t data)
00071 {
00072 return *((volatile unsigned int *)data);
00073 }
00074
00075 static inline void outw(unsigned short w, io_addr_t data)
00076 {
00077 *((volatile unsigned int *)data) = w;
00078 }
00079
00080 static inline void outb(unsigned char c, io_addr_t data)
00081 {
00082 *((volatile unsigned char *)data) = c;
00083 }
00084
00085 static inline void outl(unsigned int l, io_addr_t data)
00086 {
00087 *((volatile unsigned int *)data) = l;
00088 }
00089
00090 static inline int inl(io_addr_t data)
00091 {
00092 return *((volatile unsigned int *)data);
00093 }
00094
00095 #define le32_to_cpu(x)(x)
00096 #define le16_to_cpu(x)(x)
00097 #define cpu_to_le32(x)(x)
00098 #define cpu_to_le16(x)(x)
00099
00100 static inline __u32 be32_to_cpu(__u32 from)
00101 {
00102 return ((from & (255<<24) >> 24) |
00103 (from & (255<<16) >> 8) |
00104 (from & (255<<8) << 8) |
00105 (from & (255) << 24));
00106
00107 }
00108
00109 static inline __u16 be16_to_cpu(__u16 from)
00110 {
00111 return (((from & 255) << 8) |
00112 ((from & 0xff00) >> 8));
00113 }
00114
00115
00116 #endif
00117
00118 #endif