From: Petr Vandrovec This ugly hack add support for Siemens MC45 PCMCIA GPRS card (which is identical to Possio GCC, and which is offered by one of our local GPRS providers). Card has unfortunate feature that after poweron oxcf950 chip is fully powered and works, but attached MC45 modem is powered down :-( There is a special sequence (which takes 1 sec :-( ) to poweron MC45 (and after MC45 powers on, it takes more than 2 secs until firmware fully boots...) which needs to be executed after all powerons. I'm really not familiar with PCMCIA subsystem, so I have no idea whether I should issue request_region() on rest of oxcf950 address range (0-7 is UART, 8-F are special configuration registers), or how this should be better integrated with PM system and so on - I just put it in same place where another hack already lived... Card uses 18.432MHz XTAL, so to get it to work you must add lines below to the /etc/pcmcia/serial.opts. case "$MANFID-$FUNCID-$PRODID_1-$PRODID_2-$PRODID_3-$PRODID_4" in '030c,0003-2-GPRS-CARD--') SERIAL_OPTS="baud_base 1152000" ;; esac Signed-off-by: Andrew Morton --- 25-akpm/drivers/serial/serial_cs.c | 51 +++++++++++++++++++++++++++++++------ 25-akpm/include/pcmcia/ciscode.h | 3 ++ 2 files changed, 47 insertions(+), 7 deletions(-) diff -puN drivers/serial/serial_cs.c~add-support-for-possio-gcc-aka-pcmcia-siemens-mc45 drivers/serial/serial_cs.c --- 25/drivers/serial/serial_cs.c~add-support-for-possio-gcc-aka-pcmcia-siemens-mc45 2005-01-10 21:15:25.569566416 -0800 +++ 25-akpm/drivers/serial/serial_cs.c 2005-01-10 21:15:25.576565352 -0800 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,8 @@ struct serial_info { int multi; int slave; int manfid; + int prodid; + int c950ctrl; dev_node_t node[4]; int line[4]; }; @@ -125,6 +128,33 @@ static void serial_detach(dev_link_t *); static dev_link_t *dev_list = NULL; +static void wakeup_card(struct serial_info *info) +{ + int ctrl = info->c950ctrl; + + if (info->manfid == MANFID_OXSEMI) { + outb(12, ctrl + 1); + } else if (info->manfid == MANFID_POSSIO && info->prodid == PRODID_POSSIO_GCC) { + /* request_region? oxsemi branch does no request_region too... */ + /* This sequence is needed to properly initialize MC45 attached to OXCF950. + * I tried decreasing these msleep()s, but it worked properly (survived + * 1000 stop/start operations) with these timeouts (or bigger). */ + outb(0xA, ctrl + 1); + msleep(100); + outb(0xE, ctrl + 1); + msleep(300); + outb(0xC, ctrl + 1); + msleep(100); + outb(0xE, ctrl + 1); + msleep(200); + outb(0xF, ctrl + 1); + msleep(100); + outb(0xE, ctrl + 1); + msleep(100); + outb(0xC, ctrl + 1); + } +} + /*====================================================================== After a card is removed, serial_remove() will unregister @@ -189,6 +219,7 @@ static void serial_resume(dev_link_t *li for (i = 0; i < info->ndev; i++) serial8250_resume_port(info->line[i]); + wakeup_card(info); } } @@ -555,15 +586,20 @@ static int multi_config(dev_link_t * lin } /* The Oxford Semiconductor OXCF950 cards are in fact single-port: - 8 registers are for the UART, the others are extra registers */ - if (info->manfid == MANFID_OXSEMI) { + 8 registers are for the UART, the others are extra registers. + Siemen's MC45 PCMCIA (Possio's GCC) is OXCF950 based too. */ + if (info->manfid == MANFID_OXSEMI || + (info->manfid == MANFID_POSSIO && info->prodid == PRODID_POSSIO_GCC)) { + int err; + if (cf->index == 1 || cf->index == 3) { - setup_serial(info, base2, link->irq.AssignedIRQ); - outb(12, link->io.BasePort1 + 1); + err = setup_serial(info, base2, link->irq.AssignedIRQ); + base2 = link->io.BasePort1; } else { - setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ); - outb(12, base2 + 1); + err = setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ); } + info->c950ctrl = base2; + wakeup_card(info); return 0; } @@ -623,9 +659,10 @@ void serial_config(dev_link_t * link) tuple.DesiredTuple = CISTPL_MANFID; if (first_tuple(handle, &tuple, &parse) == CS_SUCCESS) { info->manfid = le16_to_cpu(buf[0]); + info->prodid = le16_to_cpu(buf[1]); for (i = 0; i < MULTI_COUNT; i++) if ((info->manfid == multi_id[i].manfid) && - (le16_to_cpu(buf[1]) == multi_id[i].prodid)) + (info->prodid == multi_id[i].prodid)) break; if (i < MULTI_COUNT) info->multi = multi_id[i].multi; diff -puN include/pcmcia/ciscode.h~add-support-for-possio-gcc-aka-pcmcia-siemens-mc45 include/pcmcia/ciscode.h --- 25/include/pcmcia/ciscode.h~add-support-for-possio-gcc-aka-pcmcia-siemens-mc45 2005-01-10 21:15:25.571566112 -0800 +++ 25-akpm/include/pcmcia/ciscode.h 2005-01-10 21:15:25.576565352 -0800 @@ -120,4 +120,7 @@ #define MANFID_XIRCOM 0x0105 +#define MANFID_POSSIO 0x030c +#define PRODID_POSSIO_GCC 0x0003 + #endif /* _LINUX_CISCODE_H */ _