[PATCH] pcmcia: disable read prefetch/write burst on old O2Micro bridges

Older O2Micro bridges have problems with both read prefetch and write burst
depending on the combination of the chipset, bridge, cardbus card. safest is
to disable read prefetch and write burst on those old bridges.

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Daniel Ritz and committed by Linus Torvalds eaaf9c68 d8c4b419

+27 -7
+27 -7
drivers/pcmcia/o2micro.h
··· 120 #define O2_MODE_E_LED_OUT 0x08 121 #define O2_MODE_E_SKTA_ACTV 0x10 122 123 static int o2micro_override(struct yenta_socket *socket) 124 { 125 /* 126 - * 'reserved' register at 0x94/D4. chaning it to 0xCA (8 bit) enables 127 - * read prefetching which for example makes the RME Hammerfall DSP 128 * working. for some bridges it is at 0x94, for others at 0xD4. it's 129 * ok to write to both registers on all O2 bridges. 130 * from Eric Still, 02Micro. ··· 137 u8 a, b; 138 139 if (PCI_FUNC(socket->dev->devfn) == 0) { 140 - a = config_readb(socket, 0x94); 141 - b = config_readb(socket, 0xD4); 142 143 printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b); 144 145 switch (socket->dev->device) { 146 case PCI_DEVICE_ID_O2_6832: 147 - printk(KERN_INFO "Yenta O2: old bridge, not enabling read prefetch / write burst\n"); 148 break; 149 150 default: 151 printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n"); 152 - config_writeb(socket, 0x94, a | 0x0a); 153 - config_writeb(socket, 0xD4, b | 0x0a); 154 } 155 } 156
··· 120 #define O2_MODE_E_LED_OUT 0x08 121 #define O2_MODE_E_SKTA_ACTV 0x10 122 123 + #define O2_RESERVED1 0x94 124 + #define O2_RESERVED2 0xD4 125 + #define O2_RES_READ_PREFETCH 0x02 126 + #define O2_RES_WRITE_BURST 0x08 127 + 128 static int o2micro_override(struct yenta_socket *socket) 129 { 130 /* 131 + * 'reserved' register at 0x94/D4. allows setting read prefetch and write 132 + * bursting. read prefetching for example makes the RME Hammerfall DSP 133 * working. for some bridges it is at 0x94, for others at 0xD4. it's 134 * ok to write to both registers on all O2 bridges. 135 * from Eric Still, 02Micro. ··· 132 u8 a, b; 133 134 if (PCI_FUNC(socket->dev->devfn) == 0) { 135 + a = config_readb(socket, O2_RESERVED1); 136 + b = config_readb(socket, O2_RESERVED2); 137 138 printk(KERN_INFO "Yenta O2: res at 0x94/0xD4: %02x/%02x\n", a, b); 139 140 switch (socket->dev->device) { 141 + /* 142 + * older bridges have problems with both read prefetch and write 143 + * bursting depending on the combination of the chipset, bridge 144 + * and the cardbus card. so disable them to be on the safe side. 145 + */ 146 + case PCI_DEVICE_ID_O2_6729: 147 + case PCI_DEVICE_ID_O2_6730: 148 + case PCI_DEVICE_ID_O2_6812: 149 case PCI_DEVICE_ID_O2_6832: 150 + case PCI_DEVICE_ID_O2_6836: 151 + printk(KERN_INFO "Yenta O2: old bridge, disabling read prefetch/write burst\n"); 152 + config_writeb(socket, O2_RESERVED1, 153 + a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST)); 154 + config_writeb(socket, O2_RESERVED2, 155 + b & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST)); 156 break; 157 158 default: 159 printk(KERN_INFO "Yenta O2: enabling read prefetch/write burst\n"); 160 + config_writeb(socket, O2_RESERVED1, 161 + a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST); 162 + config_writeb(socket, O2_RESERVED2, 163 + b | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST); 164 } 165 } 166