Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Dec 2004 00:14:03 +0900
From:      Colin Peters <colinp@mx3.canvas.ne.jp>
To:        freebsd-mobile <freebsd-mobile@freebsd.org>
Subject:   Re: corega FEtherII PCC-TXD
Message-ID:  <41B71A3B.90705@mx3.canvas.ne.jp>
In-Reply-To: <41B4813D.8080402@mx3.canvas.ne.jp>
References:  <41B4813D.8080402@mx3.canvas.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
Followup report: Success!

A messy kind of success, but I have managed to get it pinging anyway.

More comments below, for those who are interested. (Yes, I will get
around to filing a PR for this sooner or later.)

Colin Peters wrote:

>I've been trying to get FreeBSD 5.3-RELEASE going on a somewhat
>old Japanese laptop I have. Mostly it works well, but I have had no
>luck with the PCCard ethernet adapter. It is a Corega FEtherII
>PCC-TXD.
>  
>
[snip]

>Two things I have noticed:
>
>First, my old Windows98 hardware info had this assigned on IRQ 11.
>IRQ 9 appears to be the same as the PCI bridge:
>
>cbb0: <TI1221 PCI-CardBus Bridge> irq 9 at device 19.0 on pci0
>  
>
This was apparently not a problem.

>Second, I have done a lot of searching and have found some discussions
>of this card on Japanese lists such as bsd-nomads (for example
>http://www.clave.gr.jp/ml/bsd-nomads/200211/msg00020.html ). The
>suggestion there was to add a line in if_ed_pccards.c (see
>http://home.jp.freebsd.org/cgi-bin/showmail/bsd-nomads/16468 ):
>
>                      ed_pccard_memwrite(dev, 0x3c2, 0x4);
>
>Which apparently does some twiddling of the PHY power down mode flag.
>
>Since I am brave/desperate/stupid I went ahead and simply hacked this
>into the ed driver to see if it would work. It did not.
>  
>
I still have this fix, basically, in my if_ed_pccard.c, along with a
bunch of extra
device_printf calls I used to figure out what was going on (though not
why, yet).
I'm not actually sure it is necessary, but the card does work with it in
there.

The real problem, after getting the card type recognized to start with,
was that
the special config function for AX88190 chipsets in ed_pccard_probe wasn't
getting called (note how my original ed1: lines were followed by
"type NE2000 (16 bit)"). I simply commented out the if that decided
whether to
call that startup function, and called it unconditionally. Now the card
reports
"type AX88190 (16 bit)", the link and 100M lights come on, and DHCP
configuration
and pinging works.

Now I am going to go back and remove some of those device_printfs, and maybe
experiment to see if that memwrite is actually necessary. I'd also like
to figure out
why that special code wasn't being called. This would seem to be the
main point,
actually, and it might be related to this other PR I noticed:

http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/73658


In the meantime, here are the diffs, in case I should be hit by a bus
tomorrow, or
before I can do a proper PR, so that others may benefit:

*** pccarddevs.orig Wed Dec 8 23:14:52 2004
--- pccarddevs Sun Dec 5 20:53:58 2004
***************
*** 542,545 ****
--- 542,546 ----
product COREGA FETHER_PCC_TXD { "corega&spK.K.",
"corega&spFEther&spPCC-TXD", NULL, NULL } Corega FEther PCC-TXD
product COREGA FETHER_PCC_TXF { "corega", "FEther&spPCC-TXF", NULL, NULL
} Corega FEther PCC-TXF
+ product COREGA FETHER_II_PCC_TXD { "corega&spK.K.",
"corega&spFEtherII&spPCC-TXD", NULL, NULL } Corega FEtherII PCC-TXD
product COREGA WIRELESS_LAN_PCC_11 { "corega&spK.K.",
"Wireless&spLAN&spPCC-11", NULL, NULL } Corega Wireless LAN PCC-11
product COREGA WIRELESS_LAN_PCCA_11 { "corega&spK.K.",
"Wireless&spLAN&spPCCA-11", NULL, NULL } Corega Wireless LAN PCCA-11


*** if_edreg.h.orig Wed Dec 8 23:19:10 2004
--- if_edreg.h Tue Dec 7 23:33:03 2004
***************
*** 1126,1129 ****
--- 1126,1136 ----

/*
+ * AX88790 registers.
+ */
+ #define ED_ASIX_TEST 0x05
+ #define ED_AX88790_CSR 0x3c2
+ #define ED_AX88790_CSR_PWRDWN 0x04
+
+ /*
* MII bus definitions.
*/


*** if_ed_pccard.c.orig Wed Dec 8 23:55:04 2004
--- if_ed_pccard.c Wed Dec 8 22:50:52 2004
***************
*** 140,143 ****
--- 140,144 ----
{ PCMCIA_CARD(COREGA, FETHER_PCC_TXD, 0), NE2000DVF_AX88190 },
{ PCMCIA_CARD(COREGA, FETHER_PCC_TXF, 0), NE2000DVF_DL10019 },
+ { PCMCIA_CARD(COREGA, FETHER_II_PCC_TXD, 0), NE2000DVF_AX88190 },
{ PCMCIA_CARD(DAYNA, COMMUNICARD_E_1, 0), 0},
{ PCMCIA_CARD(DAYNA, COMMUNICARD_E_2, 0), 0},
***************
*** 218,225 ****
int flags = device_get_flags(dev);

! if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_AX88190) {
error = ed_pccard_ax88190(dev);
goto end2;
! }

error = ed_probe_Novell(dev, 0, flags);
--- 219,227 ----
int flags = device_get_flags(dev);

! device_printf(dev, "pccard probe.\n");
! /* if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_AX88190) { */
error = ed_pccard_ax88190(dev);
goto end2;
! /* } */

error = ed_probe_Novell(dev, 0, flags);
***************
*** 253,256 ****
--- 255,259 ----
u_char sum;
u_char ether_addr[ETHER_ADDR_LEN];
+ device_printf(dev, "pccard attach.\n");

if (sc->port_used > 0)
***************
*** 334,337 ****
--- 337,342 ----
sc->arpcom.ac_enaddr[4] = prom[2] & 0xff;
sc->arpcom.ac_enaddr[5] = prom[2] >> 8;
+
+ printf("ax88190_geteprom ends.\n");
}

***************
*** 408,411 ****
--- 413,418 ----
int iobase;
struct ed_softc *sc = device_get_softc(dev);
+ device_printf(dev, "ed_pccard_ax88190 begins.\n");
+ printf("ed_pccard_ax88190 begins.\n");

/* Allocate the port resource during setup. */
***************
*** 425,428 ****
--- 432,445 ----
ed_pccard_memwrite(dev, ED_AX88190_IOBASE0, iobase & 0xff);
ed_pccard_memwrite(dev, ED_AX88190_IOBASE1, (iobase >> 8) & 0xff);
+
+ /*
+ * HACK! PHY power down mode disabled for AX88790?
+ */
+ device_printf(dev, "checking for AX88790.\n");
+ if(ed_asic_inb(sc, ED_ASIX_TEST) != 0) {
+ device_printf(dev, "Attempting AX88790 fix.\n");
+ ed_pccard_memwrite(dev, ED_AX88790_CSR, ED_AX88790_CSR_PWRDWN);
+ }
+
ax88190_geteprom(sc);
ed_release_resources(dev);





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41B71A3B.90705>