Subject: Re: AT-2700FX and NetBSD 1.6 - link problem (solved by hack)
To: Wojciech Puchar <wojtek@tensor.3miasto.net>
From: Michael Kukat <michael@unixiron.org>
List: netbsd-users
Date: 05/09/2003 22:33:04
Hi !

On Fri, 9 May 2003, Wojciech Puchar wrote:
> > Are there some hacks to get fibre working with this card?
>
> maybe stupid - but does "auto" works?

Of course tried that :)

But i have some "hack" after googleing around a bit and hitting PR kern/9183.
Modifying pci/if_pcn.c this way helps:

Changing the only line with mii_attach (line 2064 here) from

   mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
       MII_OFFSET_ANY, 0);

to

   mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
       MII_OFFSET_ANY, MIIF_HAVEFIBER);

does the job. How about making this configurable by flags in the kernel config
file? MIIF_HAVEFIBER is given from the device driver via MII to the PHY, so it
seems to be the only way to tell the PHY it has fiber, when coding something
into the device driver.

For those being interested:

pcn0 at pci0 dev 6 function 0: AMD PCnet-PCI Ethernet
pcn0: Am79c972 PCnet-FAST+ rev 6, Ethernet address 00:a0:d2:2f:29:07
pcn0: interrupting at irq 9
lxtphy0 at pcn0 phy 1: LXT970 10/100 media interface, rev. 3
lxtphy0: 100baseFX, 100baseFX-FDX, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FD
X, auto

(this is after my patch)

pcictl dump tells me:

PCI configuration registers:
  Common header:
    0x00: 0x20001022 0x02900107 0x02000036 0x0000c600

    Vendor Name: Advanced Micro Devices (0x1022)
    Device Name: PCnet-PCI Ethernet (0x2000)
    Command register: 0x0107
      I/O space accesses: on
      Memory space accesses: on
      Bus mastering: on
      Special cycles: off
      MWI transactions: off
      Palette snooping: off
      Parity error checking: off
      Address/data stepping: off
      System error (SERR): on
      Fast back-to-back transactions: off
    Status register: 0x0290
      Capability List support: on
      66 MHz capable: off
      User Definable Features (UDF) support: off
      Fast back-to-back capable: on
      Data parity error detected: off
      DEVSEL timing: medium (0x1)
      Slave signaled Target Abort: off
      Master received Target Abort: off
      Master received Master Abort: off
      Asserted System Error (SERR): off
      Parity error detected: off
    Class Name: network (0x02)
    Subclass Name: ethernet (0x00)
    Interface: 0x00
    Revision ID: 0x36
    BIST: 0x00
    Header Type: 0x00 (0x00)
    Latency Timer: 0xc6
    Cache Line Size: 0x00

  Type 0 ("normal" device) header:
    0x10: 0x0000fce1 0xfedffc00 0x00000000 0x00000000
    0x20: 0x00000000 0x00000000 0x00000000 0x27011259
    0x30: 0x00000000 0x00000040 0x00000000 0x18180109

    Base address register at 0x10
      type: i/o
      base: 0x0000fce0, not sized
    Base address register at 0x14
      type: 32-bit nonprefetchable memory
      base: 0xfedffc00, not sized
    Base address register at 0x18
      not implemented(?)
    Base address register at 0x1c
      not implemented(?)
    Base address register at 0x20
      not implemented(?)
    Base address register at 0x24
      not implemented(?)
    Cardbus CIS Pointer: 0x00000000
    Subsystem vendor ID: 0x1259
    Subsystem ID: 0x2701
    Expansion ROM Base Address: 0x00000000
    Capability list pointer: 0x40
    Reserved @ 0x38: 0x00000000
    Maximum Latency: 0x18
    Minimum Grant: 0x18
    Interrupt pin: 0x01 (pin A)
    Interrupt line: 0x09
    Capability register at 0x40
      type: 0x01 (Power Management, rev. 1.0)

  Device-dependent header:
    0x40: 0xfe110001 0x14002000 0x00000000 0x00000000
    0x50: 0x00000000 0x00000000 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00000000 0x00000000 0x00000000 0x00000000
    0x80: 0x00000000 0x00000000 0x00000000 0x00000000
    0x90: 0x00000000 0x00000000 0x00000000 0x00000000
    0xa0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xb0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xc0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xd0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xe0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xf0: 0x00000000 0x00000000 0x00000000 0x00000000

Could someone compare this to a non-FX AMD PCnet card? Maybe some difference
gets visible to decide about this flag automagically.

I have my solution, and i home, someone else finds this useful in any way, for
the others: sorry for spamming with such large text stuff :)

If desired, i could open a PR about this, but at first, maybe the above data is
useful for comparing other cards using this chipset to eventually find a way to
have an elegant solution.

...Michael

-- 
http://www.unixiron.org/    Home Powered by: (Net|Open|Free)BSD IRIX NonStop-UX
Solaris AIX HP-UX Tru64 MUNIX Ultrix VMS SINIX Dolphin_Unix OpenStep MacOS A/UX