patch for 2.6.14-rc1 for pcmcia on swarm
Hi,
The attached patch implements a hacked pcmcia driver for the Sibyte swarm board. The driver has only been tested with storage cards (eg. CF cards). It will probably not work with anything else.
The main problem is that the swarm pcmcia hardware only seems to be capable of generating memory accesses on the pcmcia bus. I don't know if this is a hardware limition of the swarm board or just a lack of documentation. I haven't found any documented way of generating a pcmcia i/o access on the swarm board.
Cheers,
Peter (p2).
Signature · 1 line
goa is a state of mind
drivers/ide/legacy/ide-cs.c +9 -0
@@ -186,10 +186,19 @@static int idecs_register (unsigned long io,unsigned long ctl,unsigned long irq) {hw_regs_t hw; + +#ifdef CONFIG_PCMCIA_SIBYTE_SB1xxx_SOC +extern int sb_pcmcia_ack_intr (struct hwif_s *hwif); +#endif +memset (&hw,0 ,sizeof (hw));ide_init_hwif_ports (&hw, io, ctl,NULL ); hw.irq = irq; hw.chipset = ide_pci; + +#ifdef CONFIG_PCMCIA_SIBYTE_SB1xxx_SOC + hw.ack_intr=sb_pcmcia_ack_intr; +#endif return ide_register_hw_with_fixup (&hw,NULL , ide_undecoded_slave); }
drivers/pcmcia/Kconfig +4 -0
@@ -221,6 +221,10 @@ tristate "NEC VRC4173 CARDU support" depends on CPU_VR41XX && PCI && PCMCIA +config PCMCIA_SIBYTE_SB1xxx_SOC + tristate "SiByte SB1xxxx PCMCIA support" + depends on PCMCIA && SIBYTE_SB1xxx_SOC + config OMAP_CF tristate "OMAP CompactFlash Controller" depends on PCMCIA && ARCH_OMAP16XX
drivers/pcmcia/Makefile +2 -0
@@ -35,6 +35,8 @@ obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o obj-$(CONFIG_OMAP_CF) += omap_cf.o +obj-$(CONFIG_PCMCIA_SIBYTE_SB1xxx_SOC) += sibyte_generic.o + sa11xx_core-y += soc_common.o sa11xx_base.o pxa2xx_core-y += soc_common.o pxa2xx_base.o
drivers/pcmcia/pcmcia_resource.c +2 -0
@@ -648,6 +648,7 @@ c->Copy = req->Copy;pcmcia_write_cis_mem (s,1 , (base +CISREG_SCR )>>1 ,1 , &c->Copy); } +#ifdef CONFIG_PCMCIA_SIBYTE_SB1xxx_SOCif (req->Present &PRESENT_OPTION ) {if (s->functions ==1 ) { c->Option = req->ConfigIndex &COR_CONFIG_MASK ;
@@ -663,6 +664,7 @@pcmcia_write_cis_mem (s,1 , (base +CISREG_COR )>>1 ,1 , &c->Option); mdelay(40); } +#endif if (req->Present &PRESENT_STATUS ) { c->Status = req->Status;pcmcia_write_cis_mem (s,1 , (base +CISREG_CCSR )>>1 ,1 , &c->Status);
drivers/pcmcia/sibyte_generic.c +558 -0
558 lines not on this page · raw message
include/asm-mips/ide.h +5 -0
@@ -10,4 +10,9 @@#include <ide.h> +#ifdef CONFIG_PCMCIA_SIBYTE_SB1xxx_SOC +#define IDE_ARCH_ACK_INTR +#define ide_ack_intr (hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1) +#endif +#endif /* __ASM_IDE_H */