Re: if_sis.c 1.61 breaks support for SiS630 chipset (fwd)

2003-01-20 Thread Mikko Työläjärvi

Hmm... my MUA dropped Cc: current somewhere along the line.

   /Mikko

On Mon, 20 Jan 2003, Martin Blapp wrote:

>
> Hi,
>
> And you just added this part ? Maybe we can then just check the
> revision and do the old read part for rev > rev 0x90. You should
> not use then the bitbang method then. If I get it right you do both
> in your patch, the first fails silently, the second works. Right ?
>
> Martin

I believe the chip does support the bitbang method, but for some
reason fails to work as the code expects in at least one place.

Not being overly familiar with neither the chip nor MII, I simply
added the smallest amount of code from the last working revision
in order to get my laptop back on line.

It is a workaround, not a solution.

   Regards,
   /Mikko

>
> Martin Blapp, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
> --
> ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
> Phone: +41 61 826 93 00 Fax: +41 61 826 93 01
> PGP: 
> PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
> --
>
> On Mon, 20 Jan 2003, Mikko Työläjärvi wrote:
>
> >
> > Hello,
> >
> > On Mon, 20 Jan 2003, Martin Blapp wrote:
> >
> > >
> > > hi,
> > >
> > > > Can you post me a "pciconf -lv" I need the revision number of your
> > > > integrated nic.
> >
> > Full pciconf output included for your reading pleasure :-)
> >
> > > Sorry, over read it.
> > >
> > > Can you post me the whole patch which you've made to get it
> > > working again ?
> >
> > Sure.  Seems like it is just the read code that does not work with my
> > chipset.  This is simply the chunk of code that was replaced in rev
> > 1.61, but wrapped inside an if-statement.  Dunno if the condition is
> > correct: I only have one sis-equipped computer to test with.
> >
> >  Regards,
> >  /Mikko
> >
> > --- if_sis.c.1.62   Sun Jan 19 14:35:57 2003
> > +++ if_sis.cSun Jan 19 15:14:54 2003
> > @@ -735,6 +735,39 @@
> > sc->sis_rev < SIS_REV_635 && phy != 0)
> > return(0);
> >
> > +#if 1
> > +   /*
> > +* Hack: The new code below does not work with my sis630S.
> > +*   Revive wokring code from r1.60
> > +*/
> > +
> > +   if (sc->sis_type == SIS_TYPE_900 && sc->sis_rev <= SIS_REV_630S) {
> > +   int i, val = 0;
> > +
> > +   CSR_WRITE_4(sc, SIS_PHYCTL,
> > +   (phy << 11) | (reg << 6) | SIS_PHYOP_READ);
> > +   SIS_SETBIT(sc, SIS_PHYCTL, SIS_PHYCTL_ACCESS);
> > +
> > +   for (i = 0; i < SIS_TIMEOUT; i++) {
> > +   if (!(CSR_READ_4(sc, SIS_PHYCTL) & SIS_PHYCTL_ACCESS))
> > +   break;
> > +   }
> > +
> > +   if (i == SIS_TIMEOUT) {
> > +   printf("sis%d: PHY failed to come ready\n",
> > +  sc->sis_unit);
> > +   return(0);
> > +   }
> > +
> > +   val = (CSR_READ_4(sc, SIS_PHYCTL) >> 16) & 0x;
> > +
> > +   if (val == 0x)
> > +   return(0);
> > +
> > +   return(val);
> > +   }
> > +#endif
> > +
> > bzero((char *)&frame, sizeof(frame));
> >
> > frame.mii_phyaddr = phy;
> >
> > sotec% pciconf -lv
> > hostb0@pci0:0:0:class=0x06 card=0x chip=0x06301039 rev=0x31 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS630 Host-to-PCI Bridge'
> > class= bridge
> > subclass = HOST-PCI
> > atapci0@pci0:0:1:   class=0x010180 card=0x120114ff chip=0x55131039 rev=0xd0 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS5513 EIDE Controller (A,B step)'
> > class= mass storage
> > subclass = ATA
> > isab0@pci0:1:0: class=0x060100 card=0x chip=0x00081039 rev=0x00 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS85C503/5513 PCI to ISA Bridge (LPC Bridge)'
> > class= bridge
> > subclass = PCI-ISA
> > sis0@pci0:1:1:  class=0x02 card=0x020114ff chip=0x09001039 rev=0x82 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS900 Fast Ethernet/Home Networking Ctrlr'
> > class= network
> > subclass = ethernet
> > ohci0@pci0:1:2: class=0x0c0310 card=0x70011039 chip=0x70011039 rev=0x07 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS5597/8 Universal Serial Bus Controller'
> > class= serial bus
> > subclass = USB
> > ohci1@pci0:1:3: class=0x0c0310 card=0x70001039 chip=0x70011039 rev=0x07 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems (SiS)'
> > device   = 'SiS5597/8 Universal Serial Bus Controller'
> > class= serial bus
> > subclass = USB
> > pcm0@pci0:1:4:  class=0x040100 card=0x040114ff chip=0x70181039 rev=0x02 
>hdr=0x00
> > vendor   = 'Silicon Integrated Systems 

Re: if_sis.c 1.61 breaks support for SiS630 chipset

2003-01-20 Thread Shizuka Kudo

--- Martin Blapp <[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
> Can you post me a "pciconf -lv" I need the revision number of your
> integrated nic.
> 

I got the same problem with my ASUS TSUI-M. Here's the pciconf -lv list related to the 
ethernet
entry. Please let me know if you need the full list.

sis0@pci0:1:1:  class=0x02 card=0x80e11043 chip=0x09001039 rev=0x84 hdr=0x00
vendor   = 'Silicon Integrated Systems (SiS)'
device   = 'SiS900 Fast Ethernet/Home Networking Ctrlr'
class= network
subclass = ethernet



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: if_sis.c 1.61 breaks support for SiS630 chipset

2003-01-20 Thread Martin Blapp

Hi,

> Version 1.61 of if_sis.c breaks support for SiS630, or at least the
> one on my laptop. This has been noted before, in

It seems that older SiS900 card don't work with this revision. Newer cards
tough, seem only to work with the "bitbang" code.

Can you post me a "pciconf -lv" I need the revision number of your
integrated nic.

Martin

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



if_sis.c 1.61 breaks support for SiS630 chipset

2003-01-19 Thread Mikko Työläjärvi

Hello,

Version 1.61 of if_sis.c breaks support for SiS630, or at least the
one on my laptop. This has been noted before, in

I just though I'd add some more details.

The device probe fails with:

  sis0: MII without any PHY!

pciconf reports the chip as:

 sis0@pci0:1:1:  class=0x02 card=0x020114ff chip=0x09001039 rev=0x82 hdr=0x00
vendor   = 'Silicon Integrated Systems (SiS)'
device   = 'SiS900 Fast Ethernet/Home Networking Ctrlr'
class= network
subclass = ethernet

Things start to go bad when sis_mii_readreg() ends up in the ack
failure case (around line 622):

/*
 * Now try reading data bits. If the ack failed, we still
 * need to clock through 16 cycles to keep the PHY(s) in sync.
 */
if (ack) {
for(i = 0; i < 16; i++) {
SIO_CLR(SIS_MII_CLK);
DELAY(1);
SIO_SET(SIS_MII_CLK);
DELAY(1);
}
goto fail;
}


Conditionally reverting part of sis_miibus_readreg() to r1.60 is
sufficient to make things work again:

--- if_sis.c.1.62   Sun Jan 19 14:35:57 2003
+++ if_sis.cSun Jan 19 15:14:54 2003
@@ -735,6 +735,39 @@
sc->sis_rev < SIS_REV_635 && phy != 0)
return(0);

+#if 1
+   /*
+* Hack: The new code below does not work with my sis630S.
+*   Revive working code from r1.60
+*/
+
+   if (sc->sis_type == SIS_TYPE_900 && sc->sis_rev <= SIS_REV_630S) {
+   int i, val = 0;
+
+   CSR_WRITE_4(sc, SIS_PHYCTL,
+   (phy << 11) | (reg << 6) | SIS_PHYOP_READ);
+   SIS_SETBIT(sc, SIS_PHYCTL, SIS_PHYCTL_ACCESS);
+
+   for (i = 0; i < SIS_TIMEOUT; i++) {
+   if (!(CSR_READ_4(sc, SIS_PHYCTL) & SIS_PHYCTL_ACCESS))
+   break;
+   }
+
+   if (i == SIS_TIMEOUT) {
+   printf("sis%d: PHY failed to come ready\n",
+  sc->sis_unit);
+   return(0);
+   }
+
+   val = (CSR_READ_4(sc, SIS_PHYCTL) >> 16) & 0x;
+
+   if (val == 0x)
+   return(0);
+
+   return(val);
+   }
+#endif
+
bzero((char *)&frame, sizeof(frame));

frame.mii_phyaddr = phy;


If anyone has theories for a more correct patch, I'll be happy to try
them out.

   $.02,
   /Mikko


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message