From: Jesper S. <js...@re...> - 2000-08-08 12:38:35
|
Greetings people, I've written a (partial) driver for the PCC PCMCIA module in some of the SH3 CPUs (I have a SH7707 board). Unfortunately, I cannot submit a patch that can be easily integrated. This is mostly because it is not completed and is rather hackish in some parts - and I will not be completing the driver (it works well enough for me at this time). Below are three sets of patches: o pcmcia.diff - this one contains the driver and its header file. At the top comment is a list of stuff that needs to be done to complete the driver. o asm.diff - interrupt hack definitions. o kernel.diff - this one contains a hack, remapping interrupts from the card to vector 11 (comes in at vector 62). If you have a board which uses another irq demux function, you'll have to integrate them. This interrupt stuff is the single biggest hack of the code; the PCMCIA driver layer expects interrupts to be in the range 0-15, and that just doesn't jive well with the PCC modules interrupts at vectors 62 and 63. Please note that the driver is written for use with cs-pcmcia-3.19. I simply copied the files from there into my kernel directory and it works just fine. You'll also need to remap the PCI driver's access to the PCMCIA IO region using something like this: -------------------------------------------------------------------- #define _P2SEGADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | 0xb8000000)) void * _ioremap(unsigned long offset, unsigned long size) { #if 0 return (void *) P2SEGADDR(offset); #else /* FIXME:jskov Bad hack, redeirecting PCI access to the right region */ if (offset < 0x10000) return (void *) _P2SEGADDR(offset); else return (void *) P2SEGADDR(offset); #endif } void * _ioremap_nocache (unsigned long offset, unsigned long size) { #if 0 return (void *) P2SEGADDR(offset); #else /* FIXME:jskov Bad hack, redeirecting PCI access to the right region */ if (offset < 0x10000) return (void *) _P2SEGADDR(offset); else return (void *) P2SEGADDR(offset); #endif } -------------------------------------------------------------------- Finally, you need to add the necessary configury. Even though the driver is not 100% complete, it still works well enough for me to use an ethernet card in slot 0. I hope someone else will find it useful. Obviously, I'd be interested if anyone finds (or fixes) problems with the driver. Thanks, Jesper |