Subject: port-i386/29018: pcic power off on pccbb.c
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <keiji@hiemalis.org>
List: netbsd-bugs
Date: 01/20/2005 08:03:00
>Number:         29018
>Category:       port-i386
>Synopsis:       pcic power off on pccbb.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 20 08:03:00 +0000 2005
>Originator:     Wada Keiji
>Release:        NetBSD 2.99.14
>Organization:
--------
Wada Keiji
mailto:	keiji@hiemalis.org
>Environment:
	
	
System: NetBSD poker 2.99.14 NetBSD 2.99.14 (POKER) #2: Thu Jan 20 16:28:34 JST 2005 root@poker:/home/NetBSD/src/sys/arch/i386/compile/POKER i386
Architecture: i386
Machine: i386
>Description:
	
I can't use some pcmcia card from 2004/08/16. Because Mr.mycroft had changed
pccbb.c that related to pcic power off.
Jan 20 13:59:22 poker /netbsd: pcmcia0: card appears to have bogus CIS
>How-To-Repeat:
	
>Fix:
	
--- pccbb.c.1.112	2005-01-17 06:06:01.000000000 +0900
+++ pccbb.c	2005-01-20 16:25:45.000000000 +0900
@@ -2450,12 +2450,18 @@
 	/* zero out the address windows */
 	Pcic_write(ph, PCIC_ADDRWIN_ENABLE, 0);
 
+	/* disable socket: negate output enable bit and power off */
+	power = 0;
+	Pcic_write(ph, PCIC_PWRCTL, power);
+
 	/* power down the socket to reset it, clear the card reset pin */
 	pccbb_power(sc, CARDBUS_VCC_0V | CARDBUS_VPP_0V);
 
 	/* power off; assert output enable bit */
+/*
 	power = PCIC_PWRCTL_OE;
 	Pcic_write(ph, PCIC_PWRCTL, power);
+*/
 
 	/* power up the socket */
 	if (pccbb_power(sc, voltage) == 0)
@@ -2467,6 +2473,11 @@
 	 * RESET Width (Th (Hi-z RESET)) = 1ms
 	 * RESET Width (Tw (RESET)) = 10us
 	 */
+	pccbb_pcmcia_delay(ph, 100 + 20 + 300, "pccen1");
+	power = Pcic_read(ph, PCIC_PWRCTL);
+	power |= PCIC_PWRCTL_OE;
+	Pcic_write(ph, PCIC_PWRCTL, power);
+
 	pccbb_pcmcia_delay(ph, 1, "pccen1");
 
 	/* negate RESET */

>Unformatted: