Subject: Re: patch cardbus pccbb.c
To: Xning Lee <xning@soforge.com>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 12/04/2005 19:32:49
Just out of a desire for improved readability, is there a reason you are
using a numeric 0x00004000, instead of a symbolic definition. (I don't
have any experience/knowledge with these bridges, but the pccbb.c file
seems to use mostly symbolic values, which I think is a very good
thing.) I guess you need to add a define below CB_SOCKET_FORCE_BADVCC
in pccbbreg.h.
-- Garrett
Xning Lee wrote:
>Problem: My usb 2.0 cardbus, if insert it before boot my laptop pc,
> then get bad vcc error using NetBSD.
> (if insert it after boot NetBSD, then everything is ok.)
>
>My patch:
>=========
>
>--- sys/dev/pci/pccbb.c 14 Sep 2005 21:39:59 +0800 1.125
>+++ sys/dev/pci/pccbb.c 05 Dec 2005 09:50:12 +0800
>@@ -916,6 +916,10 @@
> bus_space_write_1(bmt, bmh, 0x800 + PCIC_INTR,
> bus_space_read_1(bmt, bmh, 0x800 + PCIC_INTR) & ~PCIC_INTR_RESET);
>
>+ /* Redo card voltage interrogation */
>+ if (bus_space_read_4(bmt, bmh, CB_SOCKET_STAT) & CB_SOCKET_STAT_BADVCC)
>+ bus_space_write_4(bmt, bmh, CB_SOCKET_FORCE, 0x00004000);
>+
> /* turn off power */
> pccbb_power((cardbus_chipset_tag_t)sc, CARDBUS_VCC_0V | CARDBUS_VPP_0V);
>
>
>
--
Garrett D'Amore http://www.tadpolecomputer.com/
Sr. Staff Engineer Extending the Power of 64-bit UNIX Computing
Tadpole Computer, Inc. Phone: (951) 325-2134