Subject: Re: Gigabit Marvell ethernet card not configured
To: None <netbsd-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-users
Date: 04/30/2006 23:11:31
In article <20060430183600.4bf8ecf6@ktinos.gov>,
Eye of the Beholder  <eye.of.the.8eholder@gmail.com> wrote:
>-=-=-=-=-=-
>
>Hello.
>
>I tried to port the linux driver (sky2.{c,h}) as mr. Rizzo suggested,
>but the only things i understood were the printfs and the comments :)
>The unified driver from SysKonnect is way more mess than the sky2 one.
>So, i tried the OpenBSD driver which is almost the same as the NetBSD one.
>
>Result: It works ok for me with some glitches.
>
>I have attached the necessary files for the change (I used -current sources).
>
>If anynone having this card wants to try it, the steps are the following:
>
>1) cd /usr/src/sys/dev/pci
>2) patch -p0 -i 1-pcidevs.diff
>3) make -f Makefile.pcidevs
>4) patch -p0 -i 2-if_sk.diff
>5) config and compile as usual.
>
>I tried to use the minimum code from OpenBSD that worked. There was
>other code too but i didn't understand it and when applied it
>didn't have any obvious difference, so maybe the code i include is
>incomplete and/or buggy. /* disclaimer part incase it blows any computer :) */
>
>My dmesg output is the following:
>
>ppb2 at pci0 dev 28 function 1: Intel 82801FB/FR PCI Express Port #1(rev. 0x03)
>pci3 at ppb2 bus 3
>pci3: i/o space, memory space enabled, rd/line, wr/inv ok
>skc0 at pci3 dev 0 function 0: irq 11
>skc0: interrupt moderation is 0 us
>skc0: Marvell Yukon-2 EC rev. A2(0x1)
>sk0 at skc0 port A: Ethernet address 00:11:2f:58:fa:03
>makphy0 at sk0 phy 0: Marvell 88E1111 Gigabit PHY, rev. 2
>makphy0: 10baseT, 10baseT-FDX, 100baseTX,
>100baseTX-FDX,1000baseT,1000baseT-FDX, auto
>ppb3 at pci0 dev 28 function 2: Intel 82801FB/FR PCI Express Port #2(rev. 0x03)
>pci4 at ppb3 bus 2
>pci4: i/o space, memory space enabled, rd/line, wr/inv ok
>skc1 at pci4 dev 0 function 0: irq 10
>skc1: interrupt moderation is 0 us
>skc1: Marvell Yukon-2 EC rev. A2(0x1)
>sk1 at skc1 port A: Ethernet address 00:11:2f:59:02:98
>makphy1 at sk1 phy 0: Marvell 88E1111 Gigabit PHY, rev. 2
>makphy1: 10baseT, 10baseT-FDX, 100baseTX,
>100baseTX-FDX,1000baseT,1000baseT-FDX, auto
>sk0: link state changed to UP
>sk1: link state changed to DOWN
>
>This is after boot (with cable connected to sk0) .
>The following happens after running ifconfig
>
>sk0: link state changed to DOWN
>skc0: interrupt moderation is 100 us
>sk0: link state changed to UP
>sk0: watchdog timeout (every some secs)
>
>My ifconfig output is the following:
>sk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>        address: 00:11:2f:58:fa:03
>        media: Ethernet autoselect (100baseTX full-duplex)
>        status: active
>        inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
>        inet6 fe80::211:2fff:fe58:fa03%sk0 prefixlen 64 scopeid 0x1
>
>I disconnected my DSL router from the rtk0 card and connected it to the
>sk0 and i could ping ok the
>router and internet, so i guess it works. I haven't tested it enough though.
>Glitches:
>1) Every some secs watchdog timeout is printed in the console.
>2) When using the "shutdownhook_establish" hook, when running
>reboot/halt the kernel crashes.
>When the "shutdownhook_establish" is removed reboot works ok, so i guess
>there is something wrong
>with the sk_shutdown function. (Hint: the OpenBSD code had sk_stop
>removed from the sk_shutdown, but
>it does the same without it)
>
>I am not keen in hardware/NetBSD programming, so please someone with the
>required knowledge
>(mr. Rizzo, mr. Zoulas ?) have a look at it.
>
>I can test any patch that you will apply.

Please send-pr this so it does not get lost. I cannot test this, because
I don't have the hardware...

christos