Using high IO-port ranges with PCMCIA
Iain Barker
ibarker at aastra.com
Wed Apr 26 15:40:21 EDT 2006
Hi all,
I'm using Linux 2.6.11.7 on an embedded ARM processor, with pcmcia-cs-3.2.8
[Unfortunately, due to other dependencies on our hardware platform, I'm not in a position to be able to use a later kernel release with the hotplug/pcmciautils patches.]
ARM is host on the PCI bus, with a TI1510 controller and one 512MB CF card. The only other PCI device is a (non-PCMCIA) ethernet card.
>From the dmesg it looks like the PCI correctly allocates the required resources, and the cs-ide module can 'see' the card in memory space. But the CF device does not bind correctly and I get an error message "cardmgr: could not adjust resource"
The ARM hardware uses a 32-bit 'high' range for the IO ports (PCIBIOS_MIN_IO=0x20000000), whereas x86 assumes 16-bit addresses (PCIBIOS_MIN_IO=0x0000). Does the PCMCIA code support this kind of scheme?
I've set up the config.opts mappings for the resources which yenta is requesting, but I can't get any further - it seems that cardmgr has a problem trying to map the high IO range?
Unfortunately, I can't confirm this because as soon as I load the yenta_socket module, accessing /proc/ioports creates a kernel oops (it works fine before loading that module however).
Any idea how I can debug this further? The relevant logs are below:
Boot logs:
PCI: Succeeded allocate mem resource #9:2000000 at 30000000 for 0000:00:00.0
PCI: Succeeded allocate mem resource #10:2000000 at 32000000 for 0000:00:00.0
PCI: Succeeded allocate mem resource #6:10000 at 34000000 for 0000:00:01.0
PCI: Succeeded allocate mem resource #0:1000 at 34010000 for 0000:00:00.0
PCI: Succeeded allocate I/O resource #7:1000 at 20000000 for 0000:00:00.0
PCI: Succeeded allocate I/O resource #8:1000 at 20001000 for 0000:00:00.0
PCI: Succeeded allocate mem resource #1:1000 at 34011000 for 0000:00:01.0
PCI: Succeeded allocate I/O resource #0:100 at 20002000 for 0000:00:01.0
PCI: Bus 1, cardbus bridge: 0000:00:00.0
IO window: 20000000-20000fff
IO window: 20001000-20001fff
PREFETCH window: 30000000-31ffffff
MEM window: 32000000-33ffffff
natsemi dp8381x driver, version 1.07+LK1.0.17, Sep 27, 2002
originally by Donald Becker <becker at scyld.com>
http://www.scyld.com/network/natsemi.html
2.4.x kernel port by Jeff Garzik, Tjeerd Mulder
PCI: enabling device 0000:00:01.0 (0146 -> 0147)
natsemi eth2: NatSemi DP8381[56] at 0x34011000 (0000:00:01.0), ff:ff:ff:ff:ff:ff, IRQ 39, port TP.
# cat /proc/ioports
20000000-2000ffff : Comcerto PCI I/O Space
20000000-20000fff : PCI CardBus #01
20001000-20001fff : PCI CardBus #01
20002000-200020ff : 0000:00:01.0
20002000-200020ff : natsemi
#
# cat /proc/iomem
01000000-07ffffff : System RAM
01021000-01256ceb : Kernel text
01258000-01315fa7 : Kernel data
10090000-1009001f : serial
10098000-10099000 : comcerto-spi
10098000-10099000 : Comcerto SPI
11000000-117fffff : comcerto flash
30000000-37ffffff : Comcerto PCI Memory Space
30000000-31ffffff : PCI CardBus #01
32000000-33ffffff : PCI CardBus #01
34000000-3400ffff : 0000:00:01.0
34010000-34010fff : 0000:00:00.0
34011000-34011fff : 0000:00:01.0
34011000-34011fff : natsemi
#
# cat /etc/pcmcia/config.opts
# Include resources mapped to yenta
include memory 0x30000000-0x31ffffff
include memory 0x32000000-0x33ffffff
include port 0x20000000-0x20000fff
include port 0x20001000-0x20001fff
# Include resources mapped to CF
include memory 0x34010000-0x34010fff
# Exclude resources mapped to eth2
exclude memory 0x34000000-0x3400ffff
exclude memory 0x34011000-0x34011fff
exclude port 0x20002000-0x200020ff
# All hardware resources available to PCI
include port 0x20000000-0x2000ffff
# depmod -a
# modprobe yenta_socket
Linux Kernel Card Services
options: [pci] [cardbus]
PCI: enabling device 0000:00:00.0 (0146 -> 0147)
Yenta: CardBus bridge found at 0000:00:00.0 [0000:0000]
yenta 0000:00:00.0: Preassigned resource 0 busy, reconfiguring...
yenta 0000:00:00.0: Preassigned resource 1 busy, reconfiguring...
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:00:00.0, mfunc 0x00001000, devctl 0x66
Yenta TI: socket 0000:00:00.0 probing PCI interrupt failed, trying to fix
Yenta TI: socket 0000:00:00.0 falling back to parallel PCI interrupts
Yenta TI: socket 0000:00:00.0 parallel PCI interrupts ok
Yenta: ISA IRQ mask 0x0000, PCI irq 39
Socket status: 30000047
#
# /rc.pcmcia start
Shutting down PCMCIA services: cardmgr[831]: exiting
done.
Starting PCMCIA services: cardmgr[975]: watching 1 socket
cardmgr[1132]: could not adjust resource: IO ports 0x20000000-0x20000fff: Input/output error
cardmgr[1132]: could not adjust resource: IO ports 0x20001000-0x20001fff: Input/output error
cardmgr[1132]: could not adjust resource: IO ports 0x20002000-0x200020ff: Input/output error
cardmgr[1132]: could not adjust resource: IO ports 0x20000000-0x2000ffff: Input/output error
done.
#
cs: pcmcia_socket0: voltage interrogation timed out.
cardmgr[976]: socket 0: ATA/IDE Fixed Disk
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
0.0: GetNextTuple: No more items
cardmgr[976]: get dev info on socket 0 failed: No such device
# dump_cis
Socket 0:
dev_info
fn_specific 120ns, 2kb
common_jedec 0xdf 0x01
manfid 0x0045, 0x0401
vers_1 4.1, "SanDisk", "SDP", "5/3 0.6"
funcid fixed_disk [post]
disk_interface [ide]
disk_features [silicon] [unique] [single]
[sleep] [standby] [idle] [low power]
config base 0x0200 mask 0x000f last_index 0x07
cftable_entry 0x00 [default]
[rdybsy] [mwait] [pwrdown]
Vcc Vnom 5V Vmin 4500mV Vmax 5500mV Ipeak 80mA
memory 0x0000-0x07ff @ 0x0000
cftable_entry 0x00
Vcc Vnom 3300mV Ipeak 45mA
cftable_entry 0x01 [default]
[rdybsy] [pwrdown]
Vcc Vnom 5V Vmin 4500mV Vmax 5500mV Ipeak 80mA
io 0x0000-0x000f [lines=4] [8bit] [16bit]
irq mask 0xffff [level] [pulse] [shared]
cftable_entry 0x01
Vcc Vnom 3300mV Ipeak 45mA
cftable_entry 0x02 [default]
[rdybsy] [pwrdown]
Vcc Vnom 5V Vmin 4500mV Vmax 5500mV Ipeak 80mA
io 0x01f0-0x01f7, 0x03f6-0x03f7 [lines=10] [8bit] [16bit] [range]
irq 14 [level] [pulse] [shared]
cftable_entry 0x02
Vcc Vnom 3300mV Ipeak 45mA
cftable_entry 0x03 [default]
[rdybsy] [pwrdown]
Vcc Vnom 5V Vmin 4500mV Vmax 5500mV Ipeak 80mA
io 0x0170-0x0177, 0x0376-0x0377 [lines=10] [8bit] [16bit] [range]
irq 14 [level] [pulse] [shared]
cftable_entry 0x03
Vcc Vnom 3300mV Ipeak 45mA
cftable_entry 0x07
#
# lspci -vv
0000:00:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 168, Cache Line Size: 0x08 (32 bytes)
Interrupt: pin A routed to IRQ 39
Region 0: Memory at 34010000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=01, subordinate=04, sec-latency=176
Memory window 0: 34400000-347ff000 (prefetchable)
Memory window 1: 34800000-34bff000
I/O window 0: 00000000-000000ff
I/O window 1: 00000400-000004ff
BridgeCtl: Parity+ SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
16-bit legacy interface ports at 0001
0000:00:01.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 255 (63750ns min, 63750ns max)
Interrupt: pin A routed to IRQ 39
Region 0: I/O ports at 20002000 [size=256]
Region 1: Memory at 34011000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at 34000000 [disabled] [size=64K]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 PME-Enable+ DSel=0 DScale=0 PME-
# cat /proc/ioports
Unable to handle kernel NULL pointer dereference at virtual address 00000010
pgd = c6550000
[00000010] *pgd=075b8031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
Modules linked in: pcmcia yenta_socket rsrc_nonstatic pcmcia_core
CPU: 0
PC is at r_show+0x2c/0x94
LR is at seq_read+0x280/0x3e0
pc : [<c003e46c>] lr : [<c009035c>] Not tainted
sp : c6a35ed4 ip : c025baac fp : c6a35efc
r10: beffdea8 r9 : c6a35f10 r8 : c6c20e30
r7 : 00000077 r6 : 00000000 r5 : 00000008 r4 : c07b0da0
r3 : 00000000 r2 : 00000003 r1 : c07b0da0 r0 : c6c20e20
Flags: Nzcv IRQs on FIQs on Mode SVC_32 Segment user
Control: C000717F Table: 07550000 DAC: 00000015
Process cat (pid: 983, stack limit = 0xc6a34194)
Stack: (0xc6a35ed4 to 0xc6a36000)
5ec0: 00000008 20000400 00000008
5ee0: 200004ff c0426a14 c07b0da0 c6c20e20 c6a35f48 c6a35f00 c009035c c003e450
5f00: c6c20e38 00000000 c6a35f74 00002000 00000003 00000000 00000002 00000000
5f20: 00002000 beffdea8 c07ace00 00000000 c6a34000 00000000 c6a35f74 c6a35f70
5f40: c6a35f4c c006f234 c00900ec c07ace24 fffffff7 c07ace00 c6a35f74 00000000
5f60: 00000003 c6a35fa4 c6a35f74 c006f518 c006f178 00000000 00000000 00000000
5f80: 00002000 00002000 beffdea8 00000003 c00219a4 c6a34000 00000000 c6a35fa8
5fa0: c0021820 c006f4d8 00002000 c0029164 00000003 beffdea8 00002000 00002000
5fc0: 00002000 00002000 beffdea8 00000003 00000001 ffffffff 00000003 00000000
5fe0: 00000000 beffde7c 00001920 4018d400 60000010 00000003 00000000 00000000
Backtrace:
[<c003e440>] (r_show+0x0/0x94) from [<c009035c>] (seq_read+0x280/0x3e0)
r5 = C6C20E20 r4 = C07B0DA0
[<c00900dc>] (seq_read+0x0/0x3e0) from [<c006f234>] (vfs_read+0xcc/0x13c)
[<c006f168>] (vfs_read+0x0/0x13c) from [<c006f518>] (sys_read+0x50/0x7c)
[<c006f4c8>] (sys_read+0x0/0x7c) from [<c0021820>] (ret_fast_syscall+0x0/0x2c)
r9 = C6A34000 r8 = C00219A4 r7 = 00000003 r6 = BEFFDEA8
r5 = 00002000 r4 = 00002000
Code: e3530801 23a05008 33a05004 e1a03001 (e5933010)
Segmentation fault
#
thanks,
Iain
--
Iain Barker Software platform architecture and VoIP engineering
Aastra Network Access, 8 Federal Street, Billerica, MA 01821, USA
More information about the linux-pcmcia
mailing list