Re: Support for BCM5720

2012-11-24 Thread Stuart Henderson
In gmane.os.openbsd.misc, you wrote:
 Hi all,
 i have bought 2 new dell R320 serveurs to replace my old dell 1650
 servers (7 years old). The problem is network card (unfortunately the
 machines will be routers/gateways).
 I tried to backport FreeBSD 9.1 RC3 driver, which works, but not totally
 succesful (card recognized, link negotiation ok, but no network trafic).
 Moreover, only the port 1 is partially functionnal. When i make ifconfig
 bge1 up, a kernel panic occurs. (no problem for dual port cards with
 intel pro 1000 PT)
 Dell choose to use BCM5720 for all its new servers (R530, R320), with
 dual ports. New Dell servers cannot be used if we don't buy/change the
 cards. Broadcom politics is very bad, i know.

 My question is, will you backport FreeBSD working driver to OpenBSD for
 a next OpenBSD release (5.3 or 5.4) ?

 Can i make a trunk with bge0 and em0 or must i do a trunk with bge0 and
 bge1 ? What's the impact ?

You can make a trunk between any working interfaces, there should be
no problems with doing this.

Not sure if it will help, but we may need something like this for
the MII driver, adapted from
http://svnweb.freebsd.org/base?view=revisionrevision=241437
For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
handling(jumbo, wire speed etc) in brgphy_reset().  Touching
BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
it couldn't establish a link.

BTW there were a bunch of changes to the linux tg3 driver fairly
recently which seem connected with the 5719/5720 devices.


Index: brgphy.c
===
RCS file: /cvs/src/sys/dev/mii/brgphy.c,v
retrieving revision 1.96
diff -u -p -r1.96 brgphy.c
--- brgphy.c9 Aug 2012 10:18:45 -   1.96
+++ brgphy.c24 Nov 2012 13:02:59 -
@@ -749,22 +749,35 @@ brgphy_reset(struct mii_softc *sc)
 
mii_phy_reset(sc);
 
-   switch (sc-mii_model) {
-   case MII_MODEL_BROADCOM_BCM5400:
-   brgphy_bcm5401_dspcode(sc);
-   break;
-   case MII_MODEL_BROADCOM_BCM5401:
-   if (sc-mii_rev == 1 || sc-mii_rev == 3)
+   switch (sc-mii_oui) {
+   case MII_OUI_BROADCOM:
+   switch (sc-mii_model) {
+   case MII_MODEL_BROADCOM_BCM5400:
brgphy_bcm5401_dspcode(sc);
+   break;
+   case MII_MODEL_BROADCOM_BCM5401:
+   if (sc-mii_rev == 1 || sc-mii_rev == 3)
+   brgphy_bcm5401_dspcode(sc);
+   break;
+   case MII_MODEL_BROADCOM_BCM5411:
+   brgphy_bcm5411_dspcode(sc);
+   break;
+   case MII_MODEL_xxBROADCOM_BCM5421:
+   brgphy_bcm5421_dspcode(sc);
+   break;
+   case MII_MODEL_xxBROADCOM_BCM54K2:
+   brgphy_bcm54k2_dspcode(sc);
+   break;
+   }
break;
-   case MII_MODEL_BROADCOM_BCM5411:
-   brgphy_bcm5411_dspcode(sc);
-   break;
-   case MII_MODEL_xxBROADCOM_BCM5421:
-   brgphy_bcm5421_dspcode(sc);
-   break;
-   case MII_MODEL_xxBROADCOM_BCM54K2:
-   brgphy_bcm54k2_dspcode(sc);
+   case MII_OUI_xxBROADCOM3:
+   switch (sc-mii_model) {
+   case MII_MODEL_xxBROADCOM3_BCM5717C:
+   case MII_MODEL_xxBROADCOM3_BCM5719C:
+   case MII_MODEL_xxBROADCOM3_BCM5720C:
+   case MII_MODEL_xxBROADCOM3_BCM57765:
+   return;
+   }
break;
}



Re: Support for BCM5720

2012-11-24 Thread Loïc BLOT
Hello all,
Thanks stuart for this link, if we add this the card is recognized by
the kernel, but does'nt work.
You must import more source code from FreeBSD 9.3RC3 because PHY is not
properly recognized.
Moreover some other code paths aren't followed when you add only the mii
code, because you need some more macros to check BCM5717.5719 and 5720.
When i get more time, i rewrite my source code from OpenBSD 5.2 and
FreeBSD 9.1 BCM, and tell you what doesn't work (PHY addr for network
card port 2 isn't recognized).

I suggest a thing for OpenBSD developpers, don't show the interface in
ifconfig and manipulate it if PHY addr isn't found by kernel, this cause
a kernel panic. This can happen when driver is miscoded (my problem
there, i think), or if there's a detection error from network card.
-- 
Cordialement,
Loïc BLOT, expertise en systèmes UNIX, sécurité et réseaux
Frost Sapphire Studios 

Le samedi 24 novembre 2012 à 13:11 +, Stuart Henderson a écrit :

 In gmane.os.openbsd.misc, you wrote:
  Hi all,
  i have bought 2 new dell R320 serveurs to replace my old dell 1650
  servers (7 years old). The problem is network card (unfortunately the
  machines will be routers/gateways).
  I tried to backport FreeBSD 9.1 RC3 driver, which works, but not totally
  succesful (card recognized, link negotiation ok, but no network trafic).
  Moreover, only the port 1 is partially functionnal. When i make ifconfig
  bge1 up, a kernel panic occurs. (no problem for dual port cards with
  intel pro 1000 PT)
  Dell choose to use BCM5720 for all its new servers (R530, R320), with
  dual ports. New Dell servers cannot be used if we don't buy/change the
  cards. Broadcom politics is very bad, i know.
 
  My question is, will you backport FreeBSD working driver to OpenBSD for
  a next OpenBSD release (5.3 or 5.4) ?
 
  Can i make a trunk with bge0 and em0 or must i do a trunk with bge0 and
  bge1 ? What's the impact ?
 
 You can make a trunk between any working interfaces, there should be
 no problems with doing this.
 
 Not sure if it will help, but we may need something like this for
 the MII driver, adapted from
 http://svnweb.freebsd.org/base?view=revisionrevision=241437
 For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
 handling(jumbo, wire speed etc) in brgphy_reset().  Touching
 BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
 it couldn't establish a link.
 
 BTW there were a bunch of changes to the linux tg3 driver fairly
 recently which seem connected with the 5719/5720 devices.
 
 
 Index: brgphy.c
 ===
 RCS file: /cvs/src/sys/dev/mii/brgphy.c,v
 retrieving revision 1.96
 diff -u -p -r1.96 brgphy.c
 --- brgphy.c  9 Aug 2012 10:18:45 -   1.96
 +++ brgphy.c  24 Nov 2012 13:02:59 -
 @@ -749,22 +749,35 @@ brgphy_reset(struct mii_softc *sc)
  
   mii_phy_reset(sc);
  
 - switch (sc-mii_model) {
 - case MII_MODEL_BROADCOM_BCM5400:
 - brgphy_bcm5401_dspcode(sc);
 - break;
 - case MII_MODEL_BROADCOM_BCM5401:
 - if (sc-mii_rev == 1 || sc-mii_rev == 3)
 + switch (sc-mii_oui) {
 + case MII_OUI_BROADCOM:
 + switch (sc-mii_model) {
 + case MII_MODEL_BROADCOM_BCM5400:
   brgphy_bcm5401_dspcode(sc);
 + break;
 + case MII_MODEL_BROADCOM_BCM5401:
 + if (sc-mii_rev == 1 || sc-mii_rev == 3)
 + brgphy_bcm5401_dspcode(sc);
 + break;
 + case MII_MODEL_BROADCOM_BCM5411:
 + brgphy_bcm5411_dspcode(sc);
 + break;
 + case MII_MODEL_xxBROADCOM_BCM5421:
 + brgphy_bcm5421_dspcode(sc);
 + break;
 + case MII_MODEL_xxBROADCOM_BCM54K2:
 + brgphy_bcm54k2_dspcode(sc);
 + break;
 + }
   break;
 - case MII_MODEL_BROADCOM_BCM5411:
 - brgphy_bcm5411_dspcode(sc);
 - break;
 - case MII_MODEL_xxBROADCOM_BCM5421:
 - brgphy_bcm5421_dspcode(sc);
 - break;
 - case MII_MODEL_xxBROADCOM_BCM54K2:
 - brgphy_bcm54k2_dspcode(sc);
 + case MII_OUI_xxBROADCOM3:
 + switch (sc-mii_model) {
 + case MII_MODEL_xxBROADCOM3_BCM5717C:
 + case MII_MODEL_xxBROADCOM3_BCM5719C:
 + case MII_MODEL_xxBROADCOM3_BCM5720C:
 + case MII_MODEL_xxBROADCOM3_BCM57765:
 + return;
 + }
   break;
   }



Support for BCM5720

2012-11-23 Thread Loïc Blot
Hi all,
i have bought 2 new dell R320 serveurs to replace my old dell 1650
servers (7 years old). The problem is network card (unfortunately the
machines will be routers/gateways).
I tried to backport FreeBSD 9.1 RC3 driver, which works, but not totally
succesful (card recognized, link negotiation ok, but no network trafic).
Moreover, only the port 1 is partially functionnal. When i make ifconfig
bge1 up, a kernel panic occurs. (no problem for dual port cards with
intel pro 1000 PT)
Dell choose to use BCM5720 for all its new servers (R530, R320), with
dual ports. New Dell servers cannot be used if we don't buy/change the
cards. Broadcom politics is very bad, i know.

My question is, will you backport FreeBSD working driver to OpenBSD for
a next OpenBSD release (5.3 or 5.4) ?

Can i make a trunk with bge0 and em0 or must i do a trunk with bge0 and
bge1 ? What's the impact ?

Thanks for advance
-- 
Cordialement,


Loïc BLOT,
Expert en Systèmes UNIX, Sécurité et Réseau