CardBus on DBAu1500
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a PCI->PCI bridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived in arch/mips/au1000/db1x00/pci_ops.c:
Inside of config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:
if (bus != 0) {
*data = 0xffffffff;
return -1;
}At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.
Thanks for your suggestions!
-Jeff
Quoted 26 lines · Pete Popov
Quoted 4 lines · Jeff Baitis
Yes, the DBAu1500 board does not have CardBus support. We want to support 802.11A/G, so at the moment I have a 3.3V PCI card with a Texas Instruments 1510 CardBus bridge. A lot of modern wireless cards are CardBus-only, so that's why we have decided to incorporate the TI bridge into our boards.
Ah, yes, that's true. Just FYI, I had to debug a cardbus problem months ago on a different architecture, so I did it on the Pb1500 instead. It was a pci-cardbus adapter and I did get it to work,eventually, with a cardbus wireless card. Unfortunately I didn't have time to clean it up and submit it anywhere, internally or externally, and the bits died at some point.
So what you're trying to do is not hopeless but it will require some debugging :)
Pete
Quoted 8 lines
If someone out there has some notes or tips concerning getting PCMCIA working under this architecture, I would greatly appreciate the information.
Take care, and thanks again!
-Jeff
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer
Evolution Robotics, Inc.
130 West Union Street
Pasadena CA 91103
tel: 626.535.2776 | fax: 626.535.2777 | [email protected] Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at arch/mips/au1000/pb1500/pci_ops.c for type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)
Pete
Pete and others:
Thanks! I can access CardBus-enabled cards... but only if I plug the CardBus card into a PCI bridge device.
For those who might be interested in hearing, here's my current status:
I tested the PCI->PCI bridge code by copying pb1500/pci_ops.c into db1x00/pci_ops.c. It seemed to work. Great!
After noticing that yenta_socket driver still locked up, I plugged a PCI-PCI bridge board in between the Au1500 dev board and the CardBus bridge. CardBus didn't work quite right, so I checked the PCI configuration registers on all devices on my PCI bus.
I noticed the PCI bridge device's SUBORDINATE_BUS value was set to 01, which is completely incorrect. It should have been at *least* 11, given that the CardBus bridge's SECONDARY_BUS register was set to 10.
So, I used setpci to change the PCI bridge's SUBORDINATE_BUS to 1f. I started the CardBus services, and it seems that everything worked with CardBus cards. Eject, insert, and status all good -- and I can look at all the PCI configuration registers on the CardBus card.
***
It seems like the issue with plugging in the CardBus bridge directly into PCI bus 0 (no PCI-PCI bridge) has to do with 16-bit CardBus support. I enabled debugging on yenta_socket, and here's some results. First, I present information *without* the PCI bridge, and then *with* PCI bridge.
Without PCI bridge:
dmesg gives:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000
00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
I/O at 0x00000300 [size=0x8]°°
I/O at 0x00000308 [size=0x4]
I/O at 0x00000310 [size=0x8]
I/O at 0x00000318 [size=0x4]
I/O at 0x00000400 [size=0x100]
00:0d.0 Class 0607: 104c:ac56°°°°°°°°°
Mem at 0x40000000 [size=0x1000]
Mem unavailable -- skipping°°°°
I/O at 0x00000500 [size=0x4]
Mem at 0x40001000 [size=0x1000]
Mem at 0x40002000 [size=0x1000]
Mem at 0x40003000 [size=0x1000] lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001
Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1
I/O ports at 0300 [size=8]
I/O ports at 0308 [size=4]
I/O ports at 0310 [size=8]
I/O ports at 0318 [size=4]
I/O ports at 0400 [size=256]
Expansion ROM at <unassigned> [disabled] [size=128K]
Capabilities: [60] Power Management version 2 00:0d.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234
Flags: bus master, medium devsel, latency 128, IRQ 1
Memory at 40000000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=05, subordinate=00, sec-latency=0
Memory window 0: 40001000-40002000 (prefetchable)
I/O window 0: 00000000-00000003
I/O window 1: 00000000-00000003
16-bit legacy interface ports at 0001 [email protected]:~# modprobe yenta_socket
Linux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel: c0112bd0 0044 00000000
config_writel: c0112bd0 0010 40000000
config_writew: c0112bd0 0004 0087°°°°
config_writeb: c0112bd0 000c 08°°
config_writeb: c0112bd0 000d a8
config_writel: c0112bd0 0018 b0000500
config_readw: c0112bd0 003e 0340°°°°°
config_writew: c0112bd0 003e 0580
exca_writeb: c0112bd0 001e 00°°°°
exca_writeb: c0112bd0 0016 00
cb_writel: c0112bd0 000c 00004000
cb_writel: c0112bd0 0004 00000000
config_readl: c0112bd0 001c 40001000
config_readl: c0112bd0 0020 40002000
config_readl: c0112bd0 0024 40003000
config_readl: c0112bd0 0028 00000000
config_writel: c0112bd0 0024 40400000
config_writel: c0112bd0 0028 407fffff
config_readl: c0112bd0 002c 00000000°
config_readl: c0112bd0 0030 00000000
config_writel: c0112bd0 002c 00004000
config_writel: c0112bd0 0030 000040ff
config_readl: c0112bd0 0034 00000000°
config_readl: c0112bd0 0038 00000000
config_writel: c0112bd0 0034 00004400
config_writel: c0112bd0 0038 000044ff
cb_readl: c0112bd0 0000 00000006°°°°°
cb_writel: c0112bd0 0000 00000006
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
** following portion loops indefinitely **
cb_readl: c0112bd0 0000 00000000
cb_writel: c0112bd0 0000 00000000
exca_readb: c0112bd0 0004 00°°°°°
exca_readb: c0112bd0 0003 00
With PCI bridge:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
I/O at 0x00000300 [size=0x8]°°
I/O at 0x00000308 [size=0x4]
I/O at 0x00000310 [size=0x8]
I/O at 0x00000318 [size=0x4]
I/O at 0x00000400 [size=0x100]
00:0d.0 Class 0604: 1011:0022 (rev 02)
Bridge: primary=00, secondary=01
Scanning sub bus 01, I/O 0x00001000, Mem 0x40000000
01:07.0 Class 0607: 104c:ac56°°°°°°°°°°°°°°°°°°°°°°
Mem at 0x40000000 [size=0x1000]
Mem unavailable -- skipping°°°°
I/O at 0x00001000 [size=0x4]
Mem at 0x40001000 [size=0x1000]
Mem at 0x40002000 [size=0x1000]
Mem at 0x40003000 [size=0x1000]Back to bus 00°°°°°°°°°°°°°°°°°°°°°°°°°
lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001
Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1
I/O ports at 0300 [size=8]
I/O ports at 0308 [size=4]
I/O ports at 0310 [size=8]
I/O ports at 0318 [size=4]
I/O ports at 0400 [size=256]
Expansion ROM at <unassigned> [disabled] [size=128K]
Capabilities: [60] Power Management version 200:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21150 (rev 02) (prog-if 00 [Normal decode])
Flags: bus master, medium devsel, latency 0
Bus: primary=00, secondary=01, subordinate=1f, sec-latency=0
I/O behind bridge: 00001000-00001fff
Memory behind bridge: 40000000-400fffff
Prefetchable memory behind bridge: 0000000000000000-000000000000000001:07.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234
Flags: bus master, medium devsel, latency 128, IRQ 255
Memory at 40000000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=10, subordinate=00, sec-latency=0
Memory window 0: 40001000-40002000 (prefetchable)
I/O window 0: 00000000-00000003
I/O window 1: 00000000-00000003
16-bit legacy interface ports at 0001 [email protected]:~# modprobe yenta_socket
Linux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel: c0112bd0 0044 00000000
config_writel: c0112bd0 0010 40000000
config_writew: c0112bd0 0004 0087°°°°
config_writeb: c0112bd0 000c 08°°
config_writeb: c0112bd0 000d a8
config_writel: c0112bd0 0018 b0001000
config_readw: c0112bd0 003e 0340°°°°°
config_writew: c0112bd0 003e 0580
exca_writeb: c0112bd0 001e 00°°°°
exca_writeb: c0112bd0 0016 00
cb_writel: c0112bd0 000c 00004000
cb_writel: c0112bd0 0004 00000000
config_readl: c0112bd0 001c 40001000
config_readl: c0112bd0 0020 40002000
config_readl: c0112bd0 0024 40003000
config_readl: c0112bd0 0028 00000000
config_writel: c0112bd0 0024 10000000
config_writel: c0112bd0 0028 103fffff
config_readl: c0112bd0 002c 00000000°
config_readl: c0112bd0 0030 00000000
config_writel: c0112bd0 002c 00004000
config_writel: c0112bd0 0030 000040ff
config_readl: c0112bd0 0034 00000000°
config_readl: c0112bd0 0038 00000000
config_writel: c0112bd0 0034 00004400
config_writel: c0112bd0 0038 000044ff
config_readw: c0112bd0 003e 05c0°°°°°
cb_writel: c0112bd0 0000 ffffffff
cb_writel: c0112bd0 0004 00000001
exca_writeb: c0112bd0 0005 00°°°°
warning: end_irq 60 did not enable (6)
warning: end_irq 59 did not enable (6)
warning: end_irq 58 did not enable (6)
warning: end_irq 57 did not enable (6)
warning: end_irq 55 did not enable (6)
warning: end_irq 52 did not enable (6)
warning: end_irq 48 did not enable (6)
warning: end_irq 46 did not enable (6)
warning: end_irq 45 did not enable (6)
warning: end_irq 44 did not enable (6)
warning: end_irq 43 did not enable (6)
warning: end_irq 42 did not enable (6)
warning: end_irq 41 did not enable (6)
warning: end_irq 40 did not enable (6)
warning: end_irq 39 did not enable (6)
warning: end_irq 38 did not enable (6)
warning: end_irq 31 did not enable (6)
warning: end_irq 27 did not enable (6)
warning: end_irq 18 did not enable (6)
warning: end_irq 14 did not enable (6)
warning: end_irq 5 did not enable (6)°
warning: end_irq 4 did not enable (6)
warning: end_irq 2 did not enable (6)
warning: end_irq 1 did not enable (6)
warning: end_irq 60 did not enable (16)
warning: end_irq 59 did not enable (16)
warning: end_irq 58 did not enable (16)
warning: end_irq 57 did not enable (16)
warning: end_irq 55 did not enable (16)
warning: end_irq 52 did not enable (16)
warning: end_irq 48 did not enable (16)
warning: end_irq 46 did not enable (16)
warning: end_irq 45 did not enable (16)
warning: end_irq 44 did not enable (16)
warning: end_irq 43 did not enable (16)
warning: end_irq 42 did not enable (16)
warning: end_irq 41 did not enable (16)
warning: end_irq 40 did not enable (16)
warning: end_irq 39 did not enable (16)
warning: end_irq 38 did not enable (16)
warning: end_irq 27 did not enable (16)
warning: end_irq 18 did not enable (16)
warning: end_irq 5 did not enable (16)°
warning: end_irq 4 did not enable (16)
warning: end_irq 2 did not enable (16)
warning: end_irq 1 did not enable (16)
exca_writeb: c0112bd0 0005 31°°°°°°°°°
cb_writel: c0112bd0 000c 00000001
cb_writel: c0112bd0 0000 ffffffff
exca_writeb: c0112bd0 0005 91°°°°
cb_writel: c0112bd0 000c 00000001
cb_writel: c0112bd0 0000 ffffffff
exca_writeb: c0112bd0 0005 a1°°°°
cb_writel: c0112bd0 000c 00000001
cb_writel: c0112bd0 0000 ffffffff
exca_writeb: c0112bd0 0005 b1°°°°
cb_writel: c0112bd0 000c 00000001
cb_writel: c0112bd0 0000 ffffffff
cb_writel: c0112bd0 0004 00000000
exca_writeb: c0112bd0 0005 00°°°°
config_writew: c0112bd0 003e 0540
Yenta IRQ list 0000, PCI irq0°°°°
cb_readl: c0112bd0 0008 30000020
Socket status: 30000020°°°°°°°°°
config_writel: c0112bd0 0044 00000000
config_writel: c0112bd0 0010 40000000
config_writew: c0112bd0 0004 0087°°°°
config_writeb: c0112bd0 000c 08°°
config_writeb: c0112bd0 000d a8
config_writel: c0112bd0 0018 b0001000
config_readw: c0112bd0 003e 0540°°°°°
config_writew: c0112bd0 003e 0580
exca_writeb: c0112bd0 001e 00°°°°
exca_writeb: c0112bd0 0016 00
cb_writel: c0112bd0 000c 00004000
cb_readl: c0112bd0 0010 00000400°
cb_writel: c0112bd0 0010 00000000
config_readw: c0112bd0 003e 05c0°
cb_readl: c0112bd0 0008 30000820
exca_readb: c0112bd0 0003 00°°°°
exca_writeb: c0112bd0 0003 00
config_writew: c0112bd0 003e 0580
cb_writel: c0112bd0 0000 ffffffff
cb_writel: c0112bd0 0004 00000006
exca_readb: c0112bd0 0006 00°°°°°
exca_writew: c0112bd0 0008 0000
exca_writew: c0112bd0 000a 0001
exca_readb: c0112bd0 0007 00°°°
exca_writeb: c0112bd0 0007 00
exca_readb: c0112bd0 0006 00°
exca_writew: c0112bd0 000c 0000
exca_writew: c0112bd0 000e 0001
exca_readb: c0112bd0 0007 00°°°
exca_writeb: c0112bd0 0007 00
exca_readb: c0112bd0 0006 00°
exca_writeb: c0112bd0 0040 00
exca_writew: c0112bd0 0010 0000
exca_writew: c0112bd0 0012 0000
exca_writew: c0112bd0 0014 0000
..... etc etc
Thanks, all, for the information. I hope someone finds this useful! I'm gonna get remote kgdb goin' here, so I can hopefully fix the obnoxious infinite loop...
-Jeff
Quoted 39 lines · Pete Popov
Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at
arch/mips/au1000/pb1500/pci_ops.cfor type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)Pete
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer
Evolution Robotics, Inc.
130 West Union Street
Pasadena CA 91103
tel: 626.535.2776 | fax: 626.535.2777 | [email protected] Quoted 3 lines
I tested the
PCI->PCIbridge code by copyingpb1500/pci_ops.cintodb1x00/pci_ops.c. It seemed to work. Great!
I'll fix that. Actually, the code is the same for the Pb1500 and Db1500, so I'll merge it into a common file.
Pete
Quoted 363 lines
After noticing that
yenta_socketdriver still locked up, I plugged a PCI-PCI bridge board in between the Au1500 dev board and the CardBus bridge. CardBus didn't work quite right, so I checked the PCI configuration registers on all devices on my PCI bus.I noticed the PCI bridge device's
SUBORDINATE_BUSvalue was set to 01, which is completely incorrect. It should have been at *least* 11, given that the CardBus bridge'sSECONDARY_BUSregister was set to 10.So, I used setpci to change the PCI bridge's
SUBORDINATE_BUSto 1f. I started the CardBus services, and it seems that everything worked with CardBus cards. Eject, insert, and status all good -- and I can look at all the PCI configuration registers on the CardBus card.***
It seems like the issue with plugging in the CardBus bridge directly into PCI bus 0 (no PCI-PCI bridge) has to do with 16-bit CardBus support. I enabled debugging on
yenta_socket, and here's some results. First, I present information *without* the PCI bridge, and then *with* PCI bridge.Without PCI bridge:
dmesg gives:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0607: 104c:ac56°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00000500 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 1 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=05, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0000500
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 40400000
config_writel:c0112bd00028407fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
cb_readl:c0112bd00000 00000006°°°°°
cb_writel:c0112bd00000 00000006
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
** following portion loops indefinitely **
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00With PCI bridge:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0604: 1011:0022 (rev 02) Bridge: primary=00, secondary=01 Scanning sub bus 01, I/O 0x00001000, Mem 0x40000000 01:07.0 Class 0607: 104c:ac56°°°°°°°°°°°°°°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00001000 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]Back to bus 00°°°°°°°°°°°°°°°°°°°°°°°°°
lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21150 (rev 02) (prog-if 00 [Normal decode])
Flags: bus master, medium devsel, latency 0 Bus: primary=00, secondary=01, subordinate=1f, sec-latency=0 I/O behind bridge: 00001000-00001fff Memory behind bridge: 40000000-400fffff Prefetchable memory behind bridge: 0000000000000000-000000000000000001:07.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 255 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=10, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 10000000
config_writel:c0112bd00028103fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
config_readw:c0112bd0003e 05c0°°°°°
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000001
exca_writeb:c0112bd00005 00°°°°
warning:end_irq60 did not enable (6)
warning:end_irq59 did not enable (6)
warning:end_irq58 did not enable (6)
warning:end_irq57 did not enable (6)
warning:end_irq55 did not enable (6)
warning:end_irq52 did not enable (6)
warning:end_irq48 did not enable (6)
warning:end_irq46 did not enable (6)
warning:end_irq45 did not enable (6)
warning:end_irq44 did not enable (6)
warning:end_irq43 did not enable (6)
warning:end_irq42 did not enable (6)
warning:end_irq41 did not enable (6)
warning:end_irq40 did not enable (6)
warning:end_irq39 did not enable (6)
warning:end_irq38 did not enable (6)
warning:end_irq31 did not enable (6)
warning:end_irq27 did not enable (6)
warning:end_irq18 did not enable (6)
warning:end_irq14 did not enable (6)
warning:end_irq5 did not enable (6)°
warning:end_irq4 did not enable (6)
warning:end_irq2 did not enable (6)
warning:end_irq1 did not enable (6)
warning:end_irq60 did not enable (16)
warning:end_irq59 did not enable (16)
warning:end_irq58 did not enable (16)
warning:end_irq57 did not enable (16)
warning:end_irq55 did not enable (16)
warning:end_irq52 did not enable (16)
warning:end_irq48 did not enable (16)
warning:end_irq46 did not enable (16)
warning:end_irq45 did not enable (16)
warning:end_irq44 did not enable (16)
warning:end_irq43 did not enable (16)
warning:end_irq42 did not enable (16)
warning:end_irq41 did not enable (16)
warning:end_irq40 did not enable (16)
warning:end_irq39 did not enable (16)
warning:end_irq38 did not enable (16)
warning:end_irq27 did not enable (16)
warning:end_irq18 did not enable (16)
warning:end_irq5 did not enable (16)°
warning:end_irq4 did not enable (16)
warning:end_irq2 did not enable (16)
warning:end_irq1 did not enable (16)
exca_writeb:c0112bd00005 31°°°°°°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 91°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 a1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 b1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000000
exca_writeb:c0112bd00005 00°°°°
config_writew:c0112bd0003e 0540
Yenta IRQ list 0000, PCI irq0°°°°
cb_readl:c0112bd00008 30000020
Socket status: 30000020°°°°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0540°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_readl:c0112bd00010 00000400°
cb_writel:c0112bd00010 00000000
config_readw:c0112bd0003e 05c0°
cb_readl:c0112bd00008 30000820
exca_readb:c0112bd00003 00°°°°
exca_writeb:c0112bd00003 00
config_writew:c0112bd0003e 0580
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000006
exca_readb:c0112bd00006 00°°°°°
exca_writew:c0112bd00008 0000
exca_writew:c0112bd0000a 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writew:c0112bd0000c 0000
exca_writew:c0112bd0000e 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writeb:c0112bd00040 00
exca_writew:c0112bd00010 0000
exca_writew:c0112bd00012 0000
exca_writew:c0112bd00014 0000
..... etc etcThanks, all, for the information. I hope someone finds this useful! I'm gonna get remote kgdb goin' here, so I can hopefully fix the obnoxious infinite loop...
-Jeff
Quoted 39 lines · Pete Popov
Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at
arch/mips/au1000/pb1500/pci_ops.cfor type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)Pete
Re: CardBus on DBAu1500 -- IRQ storm?
In reply to Jeff BaitisI belive I've made some progress tracking down this problem. The yenta_socket driver launches the yenta_open_bh thread. Earlier, all CardBus and EXCA interrupts were masked out. Near line 650, yenta_open_bh tries to allocate an interrupt line:
if (!(socket->cb_irq) || request_irq(socket->cb_irq, yenta_interrupt,
SA_SHIRQ, socket->dev->name, socket)) {request_irq, from linux/arch/mips/kernel/irq.c, enters a critical section around line 873. startup() is invoked on the IRQ descriptor, and then the critical section is exited with a call to spin_unlock_irqrestore(&desc->lock,flags);
As soon as this call is made, the kernel calls yenta_interrupt over and over. Pardon my inexperience, but is this called an 'IRQ storm?'
yenta_interrupt: Enteringyenta_events: Enteringcb_readl: c0113eb0 0000 00000000cb_writel: c0113eb0 0000 00000000exca_readb: c0113eb0 0004 00exca_readb: c0113eb0 0003 00yenta_events: Exiting (retval is 0)yenta_interrupt: Exitingyenta_interrupt: Entering
etc etc
I've verified using our PCI analyzer that no interrupt events are transmitted by the CardBus bridge, so this seems to be a software problem.
I'm going to continue to hunt this down, on the assumption that the kernel's interrupt table is getting incorrect / corrupt data. Suggestions are always appreciated.
May all your CardBuses be happy!
-Jeff
Quoted 384 lines · Jeff Baitis
Pete and others:
Thanks! I can access CardBus-enabled cards... but only if I plug the CardBus card into a PCI bridge device.
For those who might be interested in hearing, here's my current status:
I tested the
PCI->PCIbridge code by copyingpb1500/pci_ops.cintodb1x00/pci_ops.c. It seemed to work. Great!After noticing that
yenta_socketdriver still locked up, I plugged a PCI-PCI bridge board in between the Au1500 dev board and the CardBus bridge. CardBus didn't work quite right, so I checked the PCI configuration registers on all devices on my PCI bus.I noticed the PCI bridge device's
SUBORDINATE_BUSvalue was set to 01, which is completely incorrect. It should have been at *least* 11, given that the CardBus bridge'sSECONDARY_BUSregister was set to 10.So, I used setpci to change the PCI bridge's
SUBORDINATE_BUSto 1f. I started the CardBus services, and it seems that everything worked with CardBus cards. Eject, insert, and status all good -- and I can look at all the PCI configuration registers on the CardBus card.***
It seems like the issue with plugging in the CardBus bridge directly into PCI bus 0 (no PCI-PCI bridge) has to do with 16-bit CardBus support. I enabled debugging on
yenta_socket, and here's some results. First, I present information *without* the PCI bridge, and then *with* PCI bridge.Without PCI bridge:
dmesg gives:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0607: 104c:ac56°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00000500 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 1 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=05, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0000500
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 40400000
config_writel:c0112bd00028407fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
cb_readl:c0112bd00000 00000006°°°°°
cb_writel:c0112bd00000 00000006
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
** following portion loops indefinitely **
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00With PCI bridge:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0604: 1011:0022 (rev 02) Bridge: primary=00, secondary=01 Scanning sub bus 01, I/O 0x00001000, Mem 0x40000000 01:07.0 Class 0607: 104c:ac56°°°°°°°°°°°°°°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00001000 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]Back to bus 00°°°°°°°°°°°°°°°°°°°°°°°°°
lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21150 (rev 02) (prog-if 00 [Normal decode])
Flags: bus master, medium devsel, latency 0 Bus: primary=00, secondary=01, subordinate=1f, sec-latency=0 I/O behind bridge: 00001000-00001fff Memory behind bridge: 40000000-400fffff Prefetchable memory behind bridge: 0000000000000000-000000000000000001:07.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 255 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=10, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 10000000
config_writel:c0112bd00028103fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
config_readw:c0112bd0003e 05c0°°°°°
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000001
exca_writeb:c0112bd00005 00°°°°
warning:end_irq60 did not enable (6)
warning:end_irq59 did not enable (6)
warning:end_irq58 did not enable (6)
warning:end_irq57 did not enable (6)
warning:end_irq55 did not enable (6)
warning:end_irq52 did not enable (6)
warning:end_irq48 did not enable (6)
warning:end_irq46 did not enable (6)
warning:end_irq45 did not enable (6)
warning:end_irq44 did not enable (6)
warning:end_irq43 did not enable (6)
warning:end_irq42 did not enable (6)
warning:end_irq41 did not enable (6)
warning:end_irq40 did not enable (6)
warning:end_irq39 did not enable (6)
warning:end_irq38 did not enable (6)
warning:end_irq31 did not enable (6)
warning:end_irq27 did not enable (6)
warning:end_irq18 did not enable (6)
warning:end_irq14 did not enable (6)
warning:end_irq5 did not enable (6)°
warning:end_irq4 did not enable (6)
warning:end_irq2 did not enable (6)
warning:end_irq1 did not enable (6)
warning:end_irq60 did not enable (16)
warning:end_irq59 did not enable (16)
warning:end_irq58 did not enable (16)
warning:end_irq57 did not enable (16)
warning:end_irq55 did not enable (16)
warning:end_irq52 did not enable (16)
warning:end_irq48 did not enable (16)
warning:end_irq46 did not enable (16)
warning:end_irq45 did not enable (16)
warning:end_irq44 did not enable (16)
warning:end_irq43 did not enable (16)
warning:end_irq42 did not enable (16)
warning:end_irq41 did not enable (16)
warning:end_irq40 did not enable (16)
warning:end_irq39 did not enable (16)
warning:end_irq38 did not enable (16)
warning:end_irq27 did not enable (16)
warning:end_irq18 did not enable (16)
warning:end_irq5 did not enable (16)°
warning:end_irq4 did not enable (16)
warning:end_irq2 did not enable (16)
warning:end_irq1 did not enable (16)
exca_writeb:c0112bd00005 31°°°°°°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 91°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 a1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 b1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000000
exca_writeb:c0112bd00005 00°°°°
config_writew:c0112bd0003e 0540
Yenta IRQ list 0000, PCI irq0°°°°
cb_readl:c0112bd00008 30000020
Socket status: 30000020°°°°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0540°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_readl:c0112bd00010 00000400°
cb_writel:c0112bd00010 00000000
config_readw:c0112bd0003e 05c0°
cb_readl:c0112bd00008 30000820
exca_readb:c0112bd00003 00°°°°
exca_writeb:c0112bd00003 00
config_writew:c0112bd0003e 0580
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000006
exca_readb:c0112bd00006 00°°°°°
exca_writew:c0112bd00008 0000
exca_writew:c0112bd0000a 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writew:c0112bd0000c 0000
exca_writew:c0112bd0000e 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writeb:c0112bd00040 00
exca_writew:c0112bd00010 0000
exca_writew:c0112bd00012 0000
exca_writew:c0112bd00014 0000
..... etc etcThanks, all, for the information. I hope someone finds this useful! I'm gonna get remote kgdb goin' here, so I can hopefully fix the obnoxious infinite loop...
-Jeff
Quoted 39 lines · Pete Popov
Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at
arch/mips/au1000/pb1500/pci_ops.cfor type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)Pete
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer Evolution Robotics, Inc. 130 West Union Street Pasadena CA 91103 tel: 626.535.2776 | fax: 626.535.2777 | [email protected]
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer
Evolution Robotics, Inc.
130 West Union Street
Pasadena CA 91103
tel: 626.535.2776 | fax: 626.535.2777 | [email protected] Re: CardBus on DBAu1500 -- IRQ storm?
Quoted 8 lines · Jeff Baitis
I belive I've made some progress tracking down this problem. The
yenta_socketdriver launches theyenta_open_bhthread. Earlier, all CardBus and EXCA interrupts were masked out. Near line 650,yenta_open_bhtries to allocate an interrupt line:if (!(socket->cb_irq) || request_irq(socket->cb_irq, yenta_interrupt, SA_SHIRQ, socket->dev->name, socket)) {
Quoted 7 lines
request_irq, fromlinux/arch/mips/kernel/irq.c, enters a critical section around line 873.startup()is invoked on the IRQ descriptor, and then the critical section is exited with a call tospin_unlock_irqrestore(&desc->lock,flags);As soon as this call is made, the kernel calls
yenta_interruptover and over. Pardon my inexperience, but is this called an 'IRQ storm?'
Check to see what yenta_interrupt is doing. Is it acknowledging the interrupt?
Pete
Quoted 410 lines
yenta_interrupt: Enteringyenta_events: Enteringcb_readl:c0113eb00000 00000000cb_writel:c0113eb00000 00000000exca_readb:c0113eb00004 00exca_readb:c0113eb00003 00yenta_events: Exiting (retval is 0)yenta_interrupt: Exitingyenta_interrupt: Enteringetc etc
I've verified using our PCI analyzer that no interrupt events are transmitted by the CardBus bridge, so this seems to be a software problem.
I'm going to continue to hunt this down, on the assumption that the kernel's interrupt table is getting incorrect / corrupt data. Suggestions are always appreciated.
May all your CardBuses be happy!
-Jeff
Quoted 384 lines · Jeff Baitis
Pete and others:
Thanks! I can access CardBus-enabled cards... but only if I plug the CardBus card into a PCI bridge device.
For those who might be interested in hearing, here's my current status:
I tested the
PCI->PCIbridge code by copyingpb1500/pci_ops.cintodb1x00/pci_ops.c. It seemed to work. Great!After noticing that
yenta_socketdriver still locked up, I plugged a PCI-PCI bridge board in between the Au1500 dev board and the CardBus bridge. CardBus didn't work quite right, so I checked the PCI configuration registers on all devices on my PCI bus.I noticed the PCI bridge device's
SUBORDINATE_BUSvalue was set to 01, which is completely incorrect. It should have been at *least* 11, given that the CardBus bridge'sSECONDARY_BUSregister was set to 10.So, I used setpci to change the PCI bridge's
SUBORDINATE_BUSto 1f. I started the CardBus services, and it seems that everything worked with CardBus cards. Eject, insert, and status all good -- and I can look at all the PCI configuration registers on the CardBus card.***
It seems like the issue with plugging in the CardBus bridge directly into PCI bus 0 (no PCI-PCI bridge) has to do with 16-bit CardBus support. I enabled debugging on
yenta_socket, and here's some results. First, I present information *without* the PCI bridge, and then *with* PCI bridge.Without PCI bridge:
dmesg gives:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0607: 104c:ac56°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00000500 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 1 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=05, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0000500
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 40400000
config_writel:c0112bd00028407fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
cb_readl:c0112bd00000 00000006°°°°°
cb_writel:c0112bd00000 00000006
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
** following portion loops indefinitely **
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00With PCI bridge:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0604: 1011:0022 (rev 02) Bridge: primary=00, secondary=01 Scanning sub bus 01, I/O 0x00001000, Mem 0x40000000 01:07.0 Class 0607: 104c:ac56°°°°°°°°°°°°°°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00001000 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]Back to bus 00°°°°°°°°°°°°°°°°°°°°°°°°°
lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21150 (rev 02) (prog-if 00 [Normal decode])
Flags: bus master, medium devsel, latency 0 Bus: primary=00, secondary=01, subordinate=1f, sec-latency=0 I/O behind bridge: 00001000-00001fff Memory behind bridge: 40000000-400fffff Prefetchable memory behind bridge: 0000000000000000-000000000000000001:07.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 255 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=10, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 10000000
config_writel:c0112bd00028103fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
config_readw:c0112bd0003e 05c0°°°°°
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000001
exca_writeb:c0112bd00005 00°°°°
warning:end_irq60 did not enable (6)
warning:end_irq59 did not enable (6)
warning:end_irq58 did not enable (6)
warning:end_irq57 did not enable (6)
warning:end_irq55 did not enable (6)
warning:end_irq52 did not enable (6)
warning:end_irq48 did not enable (6)
warning:end_irq46 did not enable (6)
warning:end_irq45 did not enable (6)
warning:end_irq44 did not enable (6)
warning:end_irq43 did not enable (6)
warning:end_irq42 did not enable (6)
warning:end_irq41 did not enable (6)
warning:end_irq40 did not enable (6)
warning:end_irq39 did not enable (6)
warning:end_irq38 did not enable (6)
warning:end_irq31 did not enable (6)
warning:end_irq27 did not enable (6)
warning:end_irq18 did not enable (6)
warning:end_irq14 did not enable (6)
warning:end_irq5 did not enable (6)°
warning:end_irq4 did not enable (6)
warning:end_irq2 did not enable (6)
warning:end_irq1 did not enable (6)
warning:end_irq60 did not enable (16)
warning:end_irq59 did not enable (16)
warning:end_irq58 did not enable (16)
warning:end_irq57 did not enable (16)
warning:end_irq55 did not enable (16)
warning:end_irq52 did not enable (16)
warning:end_irq48 did not enable (16)
warning:end_irq46 did not enable (16)
warning:end_irq45 did not enable (16)
warning:end_irq44 did not enable (16)
warning:end_irq43 did not enable (16)
warning:end_irq42 did not enable (16)
warning:end_irq41 did not enable (16)
warning:end_irq40 did not enable (16)
warning:end_irq39 did not enable (16)
warning:end_irq38 did not enable (16)
warning:end_irq27 did not enable (16)
warning:end_irq18 did not enable (16)
warning:end_irq5 did not enable (16)°
warning:end_irq4 did not enable (16)
warning:end_irq2 did not enable (16)
warning:end_irq1 did not enable (16)
exca_writeb:c0112bd00005 31°°°°°°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 91°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 a1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 b1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000000
exca_writeb:c0112bd00005 00°°°°
config_writew:c0112bd0003e 0540
Yenta IRQ list 0000, PCI irq0°°°°
cb_readl:c0112bd00008 30000020
Socket status: 30000020°°°°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0540°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_readl:c0112bd00010 00000400°
cb_writel:c0112bd00010 00000000
config_readw:c0112bd0003e 05c0°
cb_readl:c0112bd00008 30000820
exca_readb:c0112bd00003 00°°°°
exca_writeb:c0112bd00003 00
config_writew:c0112bd0003e 0580
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000006
exca_readb:c0112bd00006 00°°°°°
exca_writew:c0112bd00008 0000
exca_writew:c0112bd0000a 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writew:c0112bd0000c 0000
exca_writew:c0112bd0000e 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writeb:c0112bd00040 00
exca_writew:c0112bd00010 0000
exca_writew:c0112bd00012 0000
exca_writew:c0112bd00014 0000
..... etc etcThanks, all, for the information. I hope someone finds this useful! I'm gonna get remote kgdb goin' here, so I can hopefully fix the obnoxious infinite loop...
-Jeff
Quoted 39 lines · Pete Popov
Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at
arch/mips/au1000/pb1500/pci_ops.cfor type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)Pete
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer Evolution Robotics, Inc. 130 West Union Street Pasadena CA 91103 tel: 626.535.2776 | fax: 626.535.2777 | [email protected]
Re: CardBus on DBAu1500 -- IRQ storm?
Quoted 4 lines · Pete Popov
Check to see what
yenta_interruptis doing. Is it acknowledging the interrupt?Pete
Pardon my delayed response -- I've got a lot of irons in a lot of different fires over here ;)
To try to answer your question, Pete:
yenta_interrupt() is calling yenta_events(), which reads the CardBus socket event register, and then writes the returned value back to the CardBus socket event register. Presumably this tells the CardBus controller to clear those bits in the event register. (I checked up on this in the PCI1510 data manual.)
Seemingly related: Today I discovered that my PCI->PCI bridge is rerouting INTA to INTD. To help discover the culprit, our hardware dept temporarily rerouted INTA to INTD on the CardBus bridge PCI card. This interrupt rerouting had *no* effect -- the card still 'IRQ storms' when plugged in without the PCI->PCI bridge.
Given this information, I added some debugging output to arch/mips/kernel/irq.c. I discovered in the 'IRQ Storm' configuration, the yenta_socket driver requests an IRQ which eventually ends up in irq.c:setup_irq() being called, with an IRQ of '1'. This IRQ is associated with INTA.
Here's the pertinent part of the debugging output:
...
yenta_open: Launched yenta_open_bh thread
yenta_open: Exiting at end of fcn
yenta_open_bh: Entering
cb_writel: c0113eb0 0004 00000000
yenta_open_bh: Attempted to disable all CardBus events
exca_writeb: c0113eb0 0005 00
yenta_open_bh: Attempted to disable all EXCA events
cb_readl: c0113eb0 0004 00000000
exca_readb: c0113eb0 0005 00
request_irq:544: entering
request_irq:583: About to run setup_irq
setup_irq:851: entering. setting up irq number 1
setup_irq:873: about to spinlock
setup_irq:898: adding new IRQ
yenta_interrupt: Entering
yenta_events: Entering
cb_readl: c0113eb0 0000 00000000
cb_writel: c0113eb0 0000 00000000
exca_readb: c0113eb0 0004 00
exca_readb: c0113eb0 0003 00
yenta_events: Exiting (retval is 0)
yenta_interrupt: Exiting
yenta_interrupt: Entering
yenta_events: Entering
... ( IRQ storm ensues ) ...In the PCI->PCI bridge configuration, setup_irq was never called:
...
yenta_open: Launched yenta_open_bh thread
yenta_open: Exiting at end of fcn
yenta_open_bh: Entering
cb_writel: c0113eb0 0004 00000000
yenta_open_bh: Attempted to disable all CardBus events
exca_writeb: c0113eb0 0005 00
yenta_open_bh: Attempted to disable all EXCA events
cb_readl: c0113eb0 0004 00000000
exca_readb: c0113eb0 0005 00
request_irq:544: entering
request_irq:561: Exiting
yenta_open_bh: exited testyenta_open_bh: totally exited testyenta_get_socket_capabilities: Entering
yenta_probe_irq: Entering
config_readw: c0113eb0 003e 05c0
cb_writel: c0113eb0 0000 ffffffff
cb_writel: c0113eb0 0004 00000001
... happy ...Any ideas?
Thanks so much for looking at this!
-Jeff
Quoted 411 lines
Quoted 410 lines
yenta_interrupt: Enteringyenta_events: Enteringcb_readl:c0113eb00000 00000000cb_writel:c0113eb00000 00000000exca_readb:c0113eb00004 00exca_readb:c0113eb00003 00yenta_events: Exiting (retval is 0)yenta_interrupt: Exitingyenta_interrupt: Enteringetc etc
I've verified using our PCI analyzer that no interrupt events are transmitted by the CardBus bridge, so this seems to be a software problem.
I'm going to continue to hunt this down, on the assumption that the kernel's interrupt table is getting incorrect / corrupt data. Suggestions are always appreciated.
May all your CardBuses be happy!
-Jeff
Quoted 384 lines · Jeff Baitis
Pete and others:
Thanks! I can access CardBus-enabled cards... but only if I plug the CardBus card into a PCI bridge device.
For those who might be interested in hearing, here's my current status:
I tested the
PCI->PCIbridge code by copyingpb1500/pci_ops.cintodb1x00/pci_ops.c. It seemed to work. Great!After noticing that
yenta_socketdriver still locked up, I plugged a PCI-PCI bridge board in between the Au1500 dev board and the CardBus bridge. CardBus didn't work quite right, so I checked the PCI configuration registers on all devices on my PCI bus.I noticed the PCI bridge device's
SUBORDINATE_BUSvalue was set to 01, which is completely incorrect. It should have been at *least* 11, given that the CardBus bridge'sSECONDARY_BUSregister was set to 10.So, I used setpci to change the PCI bridge's
SUBORDINATE_BUSto 1f. I started the CardBus services, and it seems that everything worked with CardBus cards. Eject, insert, and status all good -- and I can look at all the PCI configuration registers on the CardBus card.***
It seems like the issue with plugging in the CardBus bridge directly into PCI bus 0 (no PCI-PCI bridge) has to do with 16-bit CardBus support. I enabled debugging on
yenta_socket, and here's some results. First, I present information *without* the PCI bridge, and then *with* PCI bridge.Without PCI bridge:
dmesg gives:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0607: 104c:ac56°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00000500 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 1 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=05, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0000500
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 40400000
config_writel:c0112bd00028407fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
cb_readl:c0112bd00000 00000006°°°°°
cb_writel:c0112bd00000 00000006
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00
** following portion loops indefinitely **
cb_readl:c0112bd00000 00000000
cb_writel:c0112bd00000 00000000
exca_readb:c0112bd00004 00°°°°°
exca_readb:c0112bd00003 00With PCI bridge:
Autoconfig PCI channel 0x8029fc38°°
Scanning bus 00, I/O 0x00000300:0x00100000, Mem 0x40000000:0x44000000 00:0c.0 Class 0104: 1103:0007 (rev 01)°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°I/O at 0x00000300 [size=0x8]°° I/O at 0x00000308 [size=0x4] I/O at 0x00000310 [size=0x8] I/O at 0x00000318 [size=0x4] I/O at 0x00000400 [size=0x100] 00:0d.0 Class 0604: 1011:0022 (rev 02) Bridge: primary=00, secondary=01 Scanning sub bus 01, I/O 0x00001000, Mem 0x40000000 01:07.0 Class 0607: 104c:ac56°°°°°°°°°°°°°°°°°°°°°° Mem at 0x40000000 [size=0x1000] Mem unavailable -- skipping°°°° I/O at 0x00001000 [size=0x4] Mem at 0x40001000 [size=0x1000] Mem at 0x40002000 [size=0x1000] Mem at 0x40003000 [size=0x1000]Back to bus 00°°°°°°°°°°°°°°°°°°°°°°°°°
lspci -v gives:
00:0c.0 RAID bus controller: Triones Technologies, Inc.: Unknown device 0007 (rev 01)
Subsystem: Triones Technologies, Inc.: Unknown device 0001 Flags: bus master, 66Mhz, medium devsel, latency 128, IRQ 1 I/O ports at 0300 [size=8] I/O ports at 0308 [size=4] I/O ports at 0310 [size=8] I/O ports at 0318 [size=4] I/O ports at 0400 [size=256] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [60] Power Management version 200:0d.0 PCI bridge: Digital Equipment Corporation DECchip 21150 (rev 02) (prog-if 00 [Normal decode])
Flags: bus master, medium devsel, latency 0 Bus: primary=00, secondary=01, subordinate=1f, sec-latency=0 I/O behind bridge: 00001000-00001fff Memory behind bridge: 40000000-400fffff Prefetchable memory behind bridge: 0000000000000000-000000000000000001:07.0 CardBus bridge: Texas Instruments: Unknown device ac56
Subsystem: Unknown device 5678:1234 Flags: bus master, medium devsel, latency 128, IRQ 255 Memory at 40000000 (32-bit, non-prefetchable) [size=4K] Bus: primary=00, secondary=10, subordinate=00, sec-latency=0 Memory window 0: 40001000-40002000 (prefetchable) I/O window 0: 00000000-00000003 I/O window 1: 00000000-00000003 16-bit legacy interface ports at 0001[email protected]:~# modprobe yenta_socketLinux Kernel Card Services 3.1.22
options: [pci] [cardbus]°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0340°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_writel:c0112bd00004 00000000
config_readl:c0112bd0001c 40001000
config_readl:c0112bd00020 40002000
config_readl:c0112bd00024 40003000
config_readl:c0112bd00028 00000000
config_writel:c0112bd00024 10000000
config_writel:c0112bd00028103fffff
config_readl:c0112bd0002c 00000000°
config_readl:c0112bd00030 00000000
config_writel:c0112bd0002c 00004000
config_writel:c0112bd00030000040ff
config_readl:c0112bd00034 00000000°
config_readl:c0112bd00038 00000000
config_writel:c0112bd00034 00004400
config_writel:c0112bd00038000044ff
config_readw:c0112bd0003e 05c0°°°°°
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000001
exca_writeb:c0112bd00005 00°°°°
warning:end_irq60 did not enable (6)
warning:end_irq59 did not enable (6)
warning:end_irq58 did not enable (6)
warning:end_irq57 did not enable (6)
warning:end_irq55 did not enable (6)
warning:end_irq52 did not enable (6)
warning:end_irq48 did not enable (6)
warning:end_irq46 did not enable (6)
warning:end_irq45 did not enable (6)
warning:end_irq44 did not enable (6)
warning:end_irq43 did not enable (6)
warning:end_irq42 did not enable (6)
warning:end_irq41 did not enable (6)
warning:end_irq40 did not enable (6)
warning:end_irq39 did not enable (6)
warning:end_irq38 did not enable (6)
warning:end_irq31 did not enable (6)
warning:end_irq27 did not enable (6)
warning:end_irq18 did not enable (6)
warning:end_irq14 did not enable (6)
warning:end_irq5 did not enable (6)°
warning:end_irq4 did not enable (6)
warning:end_irq2 did not enable (6)
warning:end_irq1 did not enable (6)
warning:end_irq60 did not enable (16)
warning:end_irq59 did not enable (16)
warning:end_irq58 did not enable (16)
warning:end_irq57 did not enable (16)
warning:end_irq55 did not enable (16)
warning:end_irq52 did not enable (16)
warning:end_irq48 did not enable (16)
warning:end_irq46 did not enable (16)
warning:end_irq45 did not enable (16)
warning:end_irq44 did not enable (16)
warning:end_irq43 did not enable (16)
warning:end_irq42 did not enable (16)
warning:end_irq41 did not enable (16)
warning:end_irq40 did not enable (16)
warning:end_irq39 did not enable (16)
warning:end_irq38 did not enable (16)
warning:end_irq27 did not enable (16)
warning:end_irq18 did not enable (16)
warning:end_irq5 did not enable (16)°
warning:end_irq4 did not enable (16)
warning:end_irq2 did not enable (16)
warning:end_irq1 did not enable (16)
exca_writeb:c0112bd00005 31°°°°°°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 91°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 a1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
exca_writeb:c0112bd00005 b1°°°°
cb_writel:c0112bd0000c 00000001
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000000
exca_writeb:c0112bd00005 00°°°°
config_writew:c0112bd0003e 0540
Yenta IRQ list 0000, PCI irq0°°°°
cb_readl:c0112bd00008 30000020
Socket status: 30000020°°°°°°°°°
config_writel:c0112bd00044 00000000
config_writel:c0112bd00010 40000000
config_writew:c0112bd00004 0087°°°°
config_writeb:c0112bd0000c 08°°
config_writeb:c0112bd0000d a8
config_writel:c0112bd00018b0001000
config_readw:c0112bd0003e 0540°°°°°
config_writew:c0112bd0003e 0580
exca_writeb:c0112bd0001e 00°°°°
exca_writeb:c0112bd00016 00
cb_writel:c0112bd0000c 00004000
cb_readl:c0112bd00010 00000400°
cb_writel:c0112bd00010 00000000
config_readw:c0112bd0003e 05c0°
cb_readl:c0112bd00008 30000820
exca_readb:c0112bd00003 00°°°°
exca_writeb:c0112bd00003 00
config_writew:c0112bd0003e 0580
cb_writel:c0112bd00000 ffffffff
cb_writel:c0112bd00004 00000006
exca_readb:c0112bd00006 00°°°°°
exca_writew:c0112bd00008 0000
exca_writew:c0112bd0000a 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writew:c0112bd0000c 0000
exca_writew:c0112bd0000e 0001
exca_readb:c0112bd00007 00°°°
exca_writeb:c0112bd00007 00
exca_readb:c0112bd00006 00°
exca_writeb:c0112bd00040 00
exca_writew:c0112bd00010 0000
exca_writew:c0112bd00012 0000
exca_writew:c0112bd00014 0000
..... etc etcThanks, all, for the information. I hope someone finds this useful! I'm gonna get remote kgdb goin' here, so I can hopefully fix the obnoxious infinite loop...
-Jeff
Quoted 39 lines · Pete Popov
Quoted 21 lines · Jeff Baitis
Hey Pete and others!
I'm finally working on CardBus support on the DBAu1500. Just got acquainted with PCI today. :)
I decided that the first step is to plug in a
PCI->PCIbridge, and try to see if it would work, which it did not. After winding around inside of the kernel, I finally arrived inarch/mips/au1000/db1x00/pci_ops.c:Inside of
config_access(unsigned char access_type, struct pci_dev *dev, unsigned char where, u32 * data), on line 97, a little surprise:if (bus != 0) { *data = 0xffffffff; return -1; }At this point, I concluded that I cannot traverse a PCI-PCI or CardBus bridge, since any devices behind the bridge will require Type 1 Configuration Cycles, and it seems that only Type 0 is currently supported.
Quoted 6 lines
I assume that I should add code to handle the case where I need to generate Type 1 Configuration Cycles inside of
config_access. Pete, since you authored this code, I thought I'd quickly run this by you to make sure that I'm on track.Thanks for your suggestions!
Take a look at
arch/mips/au1000/pb1500/pci_ops.cfor type 1 config access. The patch was courtesy of David Gathright and apparently I missed adding it in the db1500. Actually, we need to combine that code because it's the same. Let me get through my eternal struggle of getting the 36 bit patch applied (with Ralf's help I think a modified patch should be ready this weekend) and then I'll worry about clean ups :)Pete
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer Evolution Robotics, Inc. 130 West Union Street Pasadena CA 91103 tel: 626.535.2776 | fax: 626.535.2777 | [email protected]
Signature · 7 lines
Jeffrey Baitis - Associate Software Engineer
Evolution Robotics, Inc.
130 West Union Street
Pasadena CA 91103
tel: 626.535.2776 | fax: 626.535.2777 | [email protected]