32 #include "../include/pcmcia.h" 33 #include "../include/pcmcia-opts.h" 34 #include "../include/i82365.h" 37 #error PCMCIA_I82365 only works with ISA defined - set CONFIG_ISA 40 typedef enum pcic_id {
41 IS_I82365A, IS_I82365B, IS_I82365DF,
42 IS_IBM, IS_RF5Cx96, IS_VLSI, IS_VG468, IS_VG469,
43 IS_PD6710, IS_PD672X, IS_VT83C469,
47 #define IS_VADEM 0x0001 48 #define IS_CIRRUS 0x0002 50 #define IS_O2MICRO 0x0008 52 #define IS_TOPIC 0x0020 53 #define IS_RICOH 0x0040 54 #define IS_UNKNOWN 0x0400 55 #define IS_VG_PWR 0x0800 56 #define IS_DF_PWR 0x1000 58 #define IS_ALIVE 0x8000 60 typedef struct pcic_t {
65 static pcic_t pcic[] = {
66 {
"Intel i82365sl A step", 0 },
67 {
"Intel i82365sl B step", 0 },
68 {
"Intel i82365sl DF", IS_DF_PWR },
70 {
"Ricoh RF5C296/396", 0 },
72 {
"Vadem VG-468", IS_VADEM },
73 {
"Vadem VG-469", IS_VADEM|IS_VG_PWR },
74 {
"Cirrus PD6710", IS_CIRRUS },
75 {
"Cirrus PD672x", IS_CIRRUS },
76 {
"VIA VT83C469", IS_CIRRUS|IS_VIA },
79 typedef struct cirrus_state_t {
84 typedef struct vg46x_state_t {
88 typedef struct socket_info_t {
94 void (*handler)(
void *
info,
u_int events);
97 cirrus_state_t cirrus;
104 int i365_base = 0x3e0;
105 int cycle_time = 120;
108 void phex (
unsigned char c );
156 if ( 0 == (psock & 1) ) {
157 printf (
"Found a PCMCIA controller (i82365) at io %x, type '%s'\n",
port, pcic[
type].
name );
167 i365_set(sock,
reg, d);
173 i365_set(sock,
reg, d);
217 type = IS_I82365A;
break;
219 type = IS_I82365B;
break;
221 type = IS_I82365DF;
break;
222 case 0x88:
case 0x89:
case 0x8a:
223 type = IS_IBM;
break;
232 type = ((
val & 7) >= 4) ? IS_VG469 : IS_VG468;
253 int init_i82365(
void) {
254 int i, j, sock,
k, ns,
id;
262 id = identify_i365(i365_base, 0);
263 if ((
id == IS_I82365DF) && (identify_i365(i365_base, 1) !=
id)) {
264 for (i = 0; i < 4; i++) {
265 port = i365_base + ((i & 1) << 2) + ((i & 2) << 1);
267 if (identify_i365(
port, sock) == IS_I82365DF) {
268 add_socket_i365(
port, sock, IS_VLSI);
272 for (i = 0; i < 4; i += 2) {
273 port = i365_base + 2*(i>>2);
275 id = identify_i365(
port, sock);
276 if (
id < 0)
continue;
278 for (j = ns = 0; j < 2; j++) {
280 if (identify_i365(
port, sock+j) < 0)
continue;
282 for (
k = 0;
k <= i82365s;
k++)
284 for (
k = 0;
k <= i82365s;
k++)
287 if (
k <= i82365s)
break;
288 add_socket_i365(
port, sock+j,
id); ns++;
321 void phex (
unsigned char c ) {
322 unsigned char a = 0, b = 0;
324 if ( b > 9 ) b += (
'a'-
'9'-1);
326 a = (
c & 0xf0 ) >> 4;
327 if ( a > 9 ) a += (
'a'-
'9'-1);
333 int deinit_i82365(
void) {
334 printf(
"Deinitializing i82365\n" );
599 return init_i82365();
613 i365_set(sockno,
I365_MEM(0)+0, ( par1 >> 12 )& 0xff );
614 i365_set(sockno,
I365_MEM(0)+1, ( par1 >> 20 ) & 0x0f );
615 i365_set(sockno,
I365_MEM(0)+2, ((par1 + par2 - 1 ) >> 12 ) & 0xff );
616 i365_set(sockno,
I365_MEM(0)+3, (( par1 + par2 - 1 ) >> 20 ) & 0x0f );
617 i365_set(sockno,
I365_MEM(0)+4, ((0x4000000 - par1) >> 12) & 0xff );
618 i365_set(sockno,
I365_MEM(0)+5, 0x40 | (((0x40000000 - par1) >> 12) & 0x3f));
620 if ( ! ( 1 & i365_get ( sockno,
I365_ADDRWIN ) ) )
return 1;
627 if ( 0 >
pccsock[sockno].configoffset )
return 1;
628 if (
NULL == (pccc = par3 ) )
return 2;
632 if ( ( par1 & 0x7fffffc0 ) )
return 4;
633 if ( pccc->
index != par1 )
return 5;
637 i365_set(sockno,
I365_IO(0)+1, (pccc->
iowin >> 8) & 0xff);
static __always_inline void off_t int c
int printf(const char *fmt,...)
Write a formatted string to the console.
#define RF5C_CHIP_RF5C296
static unsigned int unsigned int reg
struct pccsock_t pccsock[MAXPCCSOCKS]
uint32_t type
Operating system type.
#define I365_REG(slot, reg)
static unsigned long ioaddr
uint8_t intr
Interrupts enabled.
uint8_t id
Request identifier.
#define VG468_MISC_VADEMREV
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
static const uint32_t k[64]
MD5 constants.
#define PD67_INFO_CHIP_ID
#define outb(data, io_addr)
uint8_t data[48]
Additional event data.
int i82365_interfacer(interface_func_t, int, int, int, void *)
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.
#define NULL
NULL pointer (VOID *)
#define RF5C_CHIP_RF5C396