Re: Seagate 4GB CF drive in pccard slot won't work

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Mon, 20 Mar 2006 11:54:38 -0700 (MST)
In message: <441ED6F2.3020504_at_centtech.com>
            Eric Anderson <anderson_at_centtech.com> writes:
: M. Warner Losh wrote:
: > In message: <441ED31B.6030500_at_centtech.com>
: >             Eric Anderson <anderson_at_centtech.com> writes:
: > : M. Warner Losh wrote:
: > : > In message: <441EBC32.2070508_at_centtech.com>
: > : >             Eric Anderson <anderson_at_centtech.com> writes:
: > : > : Warner Losh wrote:
: > : > : >> I'm running the latest 6.1-*, and inserting a cf->pccard reader with a 
: > : > : >> 4GB seagate cf drive installed gives me these messages:
: > : > : >>
: > : > : >> cbb0: ready never happened, status = 0d
: > : > : >> pcib3: pccard0 requested memory range 0xdfb00000-0xdfbfffff: good
: > : > : >> pccard0: Card has no functions!
: > : > : >> cbb0: PC Card card activation failed
: > : > : >>     
: > : > : >
: > : > : > Something bad happened on the way to the forum...  Please set
: > : > : > hw.cbb.debug=1 and hw.pccard.debug=1 and try again.
: > : > : >   
: > : > : 
: > : > : Here's the latest snippet from /var/log/messages with those two set:
: > : > : 
: > : > : Mar 20 08:27:47 neutrino kernel: Status is 0x30001911
: > : > : Mar 20 08:27:47 neutrino kernel: cbb0: card inserted: event=0x00000000, 
: > : > : state=30001911
: > : > : Mar 20 08:27:47 neutrino kernel: pccard0: chip_socket_enable
: > : > : Mar 20 08:27:47 neutrino kernel: cbb_pcic_socket_enable:
: > : > : Mar 20 08:27:47 neutrino kernel: cbb0: cbb_power: 2V
: > : > : Mar 20 08:27:47 neutrino kernel: cbb0: ready never happened, status = 0d
: > : > : Mar 20 08:27:47 neutrino kernel: pccard0: read_cis
: > : > : Mar 20 08:27:47 neutrino kernel: pcib3: pccard0 requested memory range 
: > : > : 0xdfb00000-0xdfbfffff: good
: > : > : Mar 20 08:27:47 neutrino kernel: pccard0: check_cis_quirks
: > : > : Mar 20 08:27:47 neutrino kernel: pccard0: Card has no functions!
: > : > : Mar 20 08:27:47 neutrino kernel: cbb0: PC Card card activation failed
: > : > : 
: > : > : 
: > : > : Anything else I can provide?
: > : > : 
: > : > : Also - when inserting this card in the slot, my system freezes for about 
: > : > : 5-6 seconds.
: > : >
: > : > hw.pccard.cis_debug=1 may help.
: > : >
: > : > The 2V cbb power looks very wrong, however...
: > : >
: > : > Warner
: > : >   
: > : 
: > : Here's what I get with that enabled:
: > : 
: > : Mar 20 10:06:16 neutrino kernel: Status is 0x30001911
: > : Mar 20 10:06:16 neutrino kernel: cbb0: card inserted: event=0x00000000, 
: > : state=30001911
: > : Mar 20 10:06:16 neutrino kernel: pccard0: chip_socket_enable
: > : Mar 20 10:06:16 neutrino kernel: cbb_pcic_socket_enable:
: > : Mar 20 10:06:16 neutrino kernel: cbb0: cbb_power: 2V
: > : Mar 20 10:06:16 neutrino kernel: cbb0: ready never happened, status = 0d
: > : Mar 20 10:06:16 neutrino kernel: pccard0: read_cis
: > : Mar 20 10:06:16 neutrino kernel: pcib3: pccard0 requested memory range 
: > : 0xdfb00000-0xdfbfffff: good
: > : Mar 20 10:06:16 neutrino kernel: cis mem map 0xe7642000 (resource: 
: > : 0xdfb10000)
: > : Mar 20 10:06:16 neutrino kernel: pccard0: CIS tuple chain:
: > : Mar 20 10:06:16 neutrino kernel: CISTPL_END
: > : Mar 20 10:06:16 neutrino kernel: ff
: > : Mar 20 10:06:16 neutrino kernel: cis mem map e7642000
: > : Mar 20 10:06:16 neutrino kernel: CISTPL_LINKTARGET expected, code ff 
: > : observed
: > : Mar 20 10:06:16 neutrino kernel: pccard0: check_cis_quirks
: > : Mar 20 10:06:16 neutrino kernel: pccard0: Card has no functions!
: > : Mar 20 10:06:16 neutrino kernel: cbb0: PC Card card activation failed
: > : 
: > : 
: > : Thanks for the quick reply!
: >
: > Based on what you've provided, here's my current theory of the crime:
: >
: > (1) The card is inserted.
: > (2) The bridge somehow thinks it is a X.X V card.  It reports this as
: >     2V in the dmesg because I arbitarily assigned numbers to X and Y.
: > (3) There's two ways this can happen.  One: is that new cards have been
: >     released that implement this standard and your bridge is detecting
: >     it, but either the card or bridge fails to implement it
: >     correctly.  Two: There is a problem with the bridge's memory
: >     allocation, so the cbb driver is really talking to something
: >     else.  Three: the bridge has a bug in detecting X.X V cards and
: >     they should be ignored.
: >
: > I'm guessing 'Three' is most likely.  How's your hacking skills?
: >   
: 
: :) well, I'm really good at breaking things.   Point in the direction, 
: and I'll start looking. 

Try apply the following (you'll have to do it by hand).  This turns
off the XV and YV bits always.  This code is src/sys/dev/pccbb/pccbb.c

Warner

static int
cbb_do_power(device_t brdev)
{
	struct cbb_softc *sc = device_get_softc(brdev);
	uint32_t voltage, curpwr;
	uint32_t status;

	/* Don't enable OE (output enable) until power stable */
	exca_clrb(&sc->exca[0], EXCA_PWRCTL, EXCA_PWRCTL_OE);

-	voltage = cbb_detect_voltage(brdev);
+	voltage = cbb_detect_voltage(brdev) & ~(CARD_XV_CARD | CARD_YV_CARD);
	curpwr = cbb_current_voltage(brdev);
	status = cbb_get(sc, CBB_SOCKET_STATE);
	if ((status & CBB_STATE_POWER_CYCLE) && (voltage & curpwr))
		return 0;
	/* Prefer lowest voltage supported */
	cbb_power(brdev, CARD_OFF);
	if (voltage & CARD_YV_CARD)
		cbb_power(brdev, CARD_VCC(YV));
	else if (voltage & CARD_XV_CARD)
		cbb_power(brdev, CARD_VCC(XV));
	else if (voltage & CARD_3V_CARD)
		cbb_power(brdev, CARD_VCC(3));
	else if (voltage & CARD_5V_CARD)
		cbb_power(brdev, CARD_VCC(5));
	else {
		device_printf(brdev, "Unknown card voltage\n");
		return (ENXIO);
	}
	return (0);
}
Received on Mon Mar 20 2006 - 17:55:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC