NetBSD Problem Report #26508
Received: (qmail 14960 invoked by uid 605); 2 Aug 2004 03:15:52 -0000
Message-Id: <20040802005135.D56BC11153@narn.netbsd.org>
Date: Mon, 2 Aug 2004 00:51:35 +0000 (UTC)
From: ctribo@college.dtcc.edu
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: ctribo@college.dtcc.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: Cardbus does not attach on Powerbook G3 Wallstreet
X-Send-Pr-Version: www-1.0
>Number: 26508
>Category: port-macppc
>Synopsis: Cardbus does not attach on Powerbook G3 Wallstreet
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-macppc-maintainer
>State: dead
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 02 03:18:00 +0000 2004
>Closed-Date: Wed Feb 28 04:06:59 +0000 2007
>Last-Modified: Sun Mar 04 12:25:00 +0000 2007
>Originator: Chris Tribo
>Release: 2.0 beta
>Organization:
>Environment:
NetBSD HackBox 2.0_BETA NetBSD 2.0_BETA (HackBox) #4: Sun Aug 1 18:37:51 EDT 2004 root@HackBox:/usr/src/sys/arch/macppc/compile/HackBox macppc
>Description:
PCMCIA at least partially works. I'm unable to get the pcmcia Cisco card to do much more than ping things, but that's probably unrelated. Cardbus doesn't seem to attach to the controllers properly. I'm unsure if this is a macppc specific issue or the MI code.
The only difference between generic and my kernel config is that I have an* at pcmcia* function ? and debug,diagnostic,cardbus_debug,and pcmciadebug defined.
NetBSD 2.0_BETA (HackBox) #5: Sun Aug 1 23:55:42 EDT 2004
root@HackBox:/usr/src/sys/arch/macppc/compile/HackBox
total memory = 256 MB
avail memory = 242 MB
mainbus0 (root)
cpu0 at mainbus0: 750 (Revision 3.2), ID 0 (primary)
cpu0: HID0 8290c0a4<EMCP,ECLK,DOZE,DPM,ICE,DCE,SGE,BTIC,BHT>
cpu0: 500.00 MHz, no-parity 1MB WB L2 cache (PB SRAM) at 2:1 ratio
grackle0 at mainbus0
pci0 at grackle0 bus 0
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Motorola MPC106 "Grackle" Host Bridge (rev. 0x40)
obio0 at pci0 dev 13 function 0: addr 0xf3000000
mesh0 at obio0 offset 0x10000 irq 12: 50MHz, SCSI ID 7
scsibus0 at mesh0: 8 targets, 8 luns per target
zsc0 at obio0 offset 0x13000: irq 15,16
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
bm0 at obio0 offset 0x11000 irq 42,33: address 00:05:02:f3:79:d2
awacs0 at obio0 offset 0x14000: irq 17,8,9
audio0 at awacs0: full duplex
mediabay0 at obio0 offset 0x34 irq 29 level-triggered
wdc0 at mediabay0 offset 0x21000 irq 14
atabus0 at wdc0 channel 0
wdc1 at obio0 offset 0x20000 irq 13: DMA transfer
atabus1 at wdc1 channel 0
adb0 at obio0 offset 0x16000 irq 18: 3 targets
aed0 at adb0 addr 0: ADB Event device
akbd0 at adb0 addr 2: PowerBook G3 keyboard
wskbd0 at akbd0: console keyboard
ams0 at adb0 addr 3: EMP trackpad <tpad> 2-button, 400 dpi
wsmouse0 at ams0 mux 0
abtn0 at adb0 addr 7: buttons
apm0 at adb0: battery flags 0x7, 28% charged
Apple Computer MAC-IO I/O Controller (Paddington) (undefined subclass 0x00) at pci0 dev 16 function 0 not configured
ofb0 at pci0 dev 17 function 0: ATI Technologies 3D Rage LT Pro
ofb0: 1024 x 768, 8bpp
wsdisplay0 at ofb0 kbdmux 1: console (std, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0cbb0 at pci0 dev 19 function 0: Texas Instruments PCI1131 PCI-CardBus Bridge (re
v. 0x01)
cbb1 at pci0 dev 19 function 1: Texas Instruments PCI1131 PCI-CardBus Bridge (re
v. 0x01)
cbb0: interrupting at irq 22
cbb0: secondary bus number uninitialized; try PCIBIOS_BUS_FIXUP
cardslot0 at cbb0 slot 0 flags 0
cardbusmatch: busname differs pcmcia <=> cardbus
pcmcia0 at cardslot0
cbb1: interrupting at irq 23
cbb1: secondary bus number uninitialized; try PCIBIOS_BUS_FIXUP
cardslot1 at cbb1 slot 1 flags 0
cardbusmatch: busname differs pcmcia <=> cardbus
pcmcia1 at cardslot1
scsibus0: waiting 2 seconds for devices to settle...
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <MATSHITA CR-174, , A011> cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2
cd0(wdc0:0:0): using PIO mode 4
pcmcia1: CIS version PCMCIA 2.0 or 2.1
pcmcia1: CIS info: Cisco Systems, 350 Series Wireless LAN Adapter
pcmcia1: Manufacturer code 0x15f, product 0xa
pcmcia1: function 0: network adapter, ccr addr 3e0 mask 7
pcmcia1: function 0, config table entry 5: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqlevel
an0 at pcmcia1 function 0: Cisco Systems, 350 Series Wireless LAN Adapter
an0: Cisco Systems 350 Series (firmware 4.25.30)
an0: 802.11 address: 00:0e:84:b4:5f:2e, channel: 1-11
an0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
>How-To-Repeat:
boot a generic kernel on a Powerbook G3 Wallstreet
>Fix:
The attachment code seems to be getting something wrong. Cardbus should be attaching to cardslot* not attempting to attach to pcmcia*. I'm at a loss to figure out where to look up the chain of attachments to see where this is going wrong.
>Release-Note:
>Audit-Trail:
From: Chris Tribo <ctribo@college.dtcc.edu>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-macppc/26508
Date: Mon, 2 Aug 2004 15:13:41 -0400 (EDT)
Test to see if the NetBSD mail server is dropping my followup email or if
it is just slow.
--
The nice thing about Windows is - It does not just crash, it displays a
dialog box and lets you press 'OK' first.
-- Arno Schaefer
From: Chris Tribo <ctribo@college.dtcc.edu>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-macppc/26508
Date: Mon, 2 Aug 2004 14:59:15 -0400 (EDT)
Cardbus appears to attach in 1.6.1 correctly on the same machine:
cbb0 at pci0 dev 19 function 0: vendor 0x104c product 0xac15 (rev. 0x01)
cbb1 at pci0 dev 19 function 1: vendor 0x104c product 0xac15 (rev. 0x01)
cbb0: interrupting at irq 22
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 0 device 0
pcmcia0 at cardslot0
cbb1: interrupting at irq 23
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 0 device 0
pcmcia1 at cardslot1
In src/sys/dev/pci/pccbb.c line 726 there is a check if the bus number is
0. These seems to be an error judging from the above dmesg from 1.6.1 in
which the bus number is 0 for both chips. Perhaps this check should only
be enabled on i386 and platforms where pcibios actually works?
I commented out that block of code and recompiled. Now I get cardbus at
cardslot but the attach code still bails with cardbusmatch: busname
differs pcmcia <=> cardbus. src/sys/dev/cardbus/cardbus.c line 105 is
doing: if (strcmp(cba->cba_busname, cf->cf_name)) so cf_name must be
pointing at the wrong structure element?
cbb0: interrupting at irq 22
PCI config regs:
0x00: ac15104c 02000007 06070001 00822008
0x10: 81803000 02000000 20000000 fffff000
0x20: 00000000 fffff000 00000000 fffffffc
0x30: 00000000 fffffffc 00000000 07c00116
0x40: 00000000 00000001 00000000 00000000
0x80: 00041020 00000000 00000000 00000000
0x90: 00702800 00000000 00001000 00000000
0xa0: 00000000 00000000 00000000 00000000
socket regs: 00000000 00000006 30000006 00000000 00000000
ExCA regs: 84 00 00 00 00 00 00 00
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 0 device 0
cardbusmatch: busname differs pcmcia <=> cardbus
pcmcia0 at cardslot0
pccbb_pcmcia_card_detect
pccbbattach: found cardslot
CardBus latency timer 0x20 (20000000)
PCI latency timer 0x20 (822008)
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [0x44]
--
The nice thing about Windows is - It does not just crash, it displays a
dialog box and lets you press 'OK' first.
-- Arno Schaefer
From: Chris Tribo <ctribo@college.dtcc.edu>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-macppc/26508: Cardbus does not attach on Powerbook G3
Wallstreet
Date: Mon, 2 Aug 2004 16:33:27 -0400 (EDT)
OK, trying this again for the third time. Even shorter now.
Cardbus appears to attach in 1.6.1 correctly on the same machine:
cardbus0 at cardslot0: bus 0 device 0
cardbus1 at cardslot1: bus 0 device 0
In src/sys/dev/pci/pccbb.c line 726 there is a check if the bus number is
0. These seems to be an error judging from the above dmesg from 1.6.1 in
which the bus number is 0 for both chips. Perhaps this check should be
recoded or only be enabled on platforms where pcibios works?
I commented out that block of code and recompiled. Now I get cardbus at
cardslot but the attach code still bails with cardbusmatch: busname
differs pcmcia <=> cardbus. src/sys/dev/cardbus/cardbus.c line 105 is
doing: if (strcmp(cba->cba_busname, cf->cf_name)). If that logic is
correct, then cf* is pointing to the pcmcia structure instead of the cbb
structure?
From: Chris Tribo <ctribo@college.dtcc.edu>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-macppc/26508
Date: Tue, 26 Oct 2004 13:37:09 -0400 (EDT)
OK, I think I'm beginning to see the light again.
So much has changed in pci, cardbus, and the macppc machdep files that it
bogles my mind so I'm not going to try to attack that route anymore.
pccbb.c is definitely correct in its assertion that the secondary bus
number is uninitialized. OpenFirmware doesn't appear to set up the bridge
at initial power up, probably for power consumption reasons.
If I do a .properties on ata2 and ata3 (pccard socket A and B
respectively) at cold boot. I can see the following variables of interest:
AAPL,slot-name PC Card A
AAPL,pmu-socket-number 1
if I then do load-ata (one of the device node words)
AAPL,bus-id 00000002
AAPL,removable
show up in the open firmware .properties
I'm guessing what's happening is that load-ata doesn't rewrite the
pci config space of the device. So even if I do this before loading the
kernel, cardbus doesn't attach. There's a command named pci1130-config
word that looks promising but I'm not sure how to use forth or what it
does.
That leaves a few options I guess
1.) add a check to bandit.c and grackle.c that walks the device tree
looking for device_type pccard and looks at the secondary bus number. If
it's not valid (null,-1,zero,>255), run load-ata on the socket, read
AAPL,bus-id and shove that into pci config space. (and pray)
1a.) Figure out if pci1130-config will do it for us
2.) add crude hacks to the cardbus code (bad idea because of #4)
3.) come up with some kind of pci fixup code similar to what OpenBSD uses
and or import it.
4.) The general idea is that the BIOS/Firmware is supposed to handle this
before the kernel attempts to probe it. I'm not entirely sure why
openfirmware doesn't do it here. It'd be interesting to see what the
Darwin code does to make PCIC work correctly.
From: Michael Lorenz <macallan@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/26508 CVS commit: src/sys/arch/macppc/pci
Date: Wed, 3 Jan 2007 22:28:30 +0000 (UTC)
Module Name: src
Committed By: macallan
Date: Wed Jan 3 22:28:30 UTC 2007
Modified Files:
src/sys/arch/macppc/pci: pci_machdep.c
Log Message:
if we encounter a cardbus bridge with bogus bus number try to get OF to
assign it a bus number so cardbus* will attach properly.
Should fix PR26508
To generate a diff of this commit:
cvs rdiff -r1.32 -r1.33 src/sys/arch/macppc/pci/pci_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: macallan@netbsd.org
State-Changed-When: Sat, 06 Jan 2007 22:07:48 +0000
State-Changed-Why:
committed a (hopefully working) fix
From: Chris Tribo <ctribo@dtcc.edu>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-macppc/26508 (Cardbus does not attach on Powerbook G3 Wallstreet)
Date: Sun, 7 Jan 2007 00:12:15 -0500
I haven't had this laptop in over two years. There's no way for me to
test. Feel free to close this, and all of my other open PRs on all
ports.
State-Changed-From-To: feedback->dead
State-Changed-By: macallan@netbsd.org
State-Changed-When: Wed, 28 Feb 2007 04:06:59 +0000
State-Changed-Why:
a fix was committed but the submitter doesn't have the hardware anymore so it can't be tested in the original context
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/26508 CVS commit: [netbsd-4] src/sys/arch/macppc/pci
Date: Sun, 4 Mar 2007 12:21:28 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Sun Mar 4 12:21:28 UTC 2007
Modified Files:
src/sys/arch/macppc/pci [netbsd-4]: pci_machdep.c
Log Message:
Pull up following revision(s) (requested by macallan in ticket #471):
sys/arch/macppc/pci/pci_machdep.c: revision 1.33
if we encounter a cardbus bridge with bogus bus number try to get OF to
assign it a bus number so cardbus* will attach properly.
Should fix PR26508
To generate a diff of this commit:
cvs rdiff -r1.32 -r1.32.2.1 src/sys/arch/macppc/pci/pci_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
>Quarter:
>Keywords:
>Date-Required:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.