You are on the right track. The PHY addresses changed from old to new boot. We are using the 2.4 kernel so some name may have changed/moved. The PHY mapping for your hardware is defined in ixp425_eth.c (probably ixp400_eth.c in 2.6).

There is a large ifdef at the top of the file that defines the mapping. Check that your platform definition is correct/present in the list. It is likely your system is using the default PHY addresses. If you modify the PHY definition, make sure to update the corresponding information in the default PHY configuration array.

You also need to make sure the PHY device type is defined in the PHY detect code in IxEthMii.c. Check that ixEthMiiPhyScan is finding your device.

Brian

> Joakim Wennergren wrote:
Message: 1
Date: Thu, 20 Dec 2007 18:14:52 +0100
From: Joakim Wennergren <[EMAIL PROTECTED]>
Subject: Re: [uClinux-dev] ixp400_eth: ixEthMiiLinkStatus failed
To: uClinux development list <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi again,

Hmm, I think your're right. I managed to "fix" the PCI stuff (which it turns out wasn't a bug but how 2.6.19 is supposed to function) and that did nothing.

So, back to the "ixEthMiiLinkStatus failed on PHY0." error. I added a bunch of debug data, and compared the old working code with the new one. It seems the parameters sent to the IxEthMii-functions differ a lot! And I get almost the same errors in the old version, but It happly ignores them. However, I can then use the MII interface to talk to the other components on the card, which I can't now.

There is some oddities though, when the interfaces goes up, I get an additional "wifi0" which I didn't get before

Also, I'm getting different PHY numbers ("ixp0 is using NPEB and the PHY at address 0" below). Does this matter?

Another odd thing, In the old release it seams I managed to use madwifi wlan driver 0.8.6.0 which isn't released yet! The lastest version in the SVN is lower...


Old, working boot (excerpt):

Watchdog Ticking Away!
Check reset script started
Reset pin inactive
ixp400: module license 'unspecified' taints kernel.
ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.4A
ixp400_eth: CPU clock speed (approx) = 266 MHz
[warning] Warning: the NPE A component you specified does not exist
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (5,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=10485760 (0xa00000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Failed
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (4,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=8388608 (0x800000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Failed
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (0,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=0 (0x0)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Failed
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (1,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=2097152 (0x200000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x1000
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (2,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=4194304 (0x400000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Failed
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (3,0,37020 (0x909c))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=6291456 (0x600000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Failed
ixp400_eth: ixp0 is using NPEB and the PHY at address 5
ixp400_eth: ixp1 is using NPEC and the PHY at address 4
ixp400_eth: Use default MAC address 00:02:b3:01:01:01 for port 0
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1
wlan: 0.8.6.0 (EXPERIMENTAL)
wlan: mac acl policy registered
ath_hal: 0.9.14.9 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, REGOPS_FUNC)
ath_rate_sample: 1.2
ath_pci: 0.9.6.0 (EXPERIMENTAL)
PCI: enabling device 0000:00:0c.0 (0140 -> 0142)
Build date: May 21 2007
Debugging version (IEEE80211)
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: H/W encryption support: WEP AES AES_CCM TKIP
ath0: mac 7.8 phy 4.5 radio 5.6
ath0: Use hw queue 1 for WME_AC_BE traffic
ath0: Use hw queue 0 for WME_AC_BK traffic
ath0: Use hw queue 2 for WME_AC_VI traffic
ath0: Use hw queue 3 for WME_AC_VO traffic
ath0: Use hw queue 8 for CAB traffic
ath0: Use hw queue 9 for beacons
Debugging version (ATH)
ath0: Atheros 5212: mem=0x4a000000, irq=24



New, not working:

Watchdog device not enabled.
Check reset script started
Reset pin inactive
ixp400: module license 'unspecified' taints kernel.
ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.5.1A
ixp400_eth: CPU clock speed (approx) = 266 MHz
ixEthMii.c-DEBUG: ixEthMiiPhyScan: Function start 1
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (0,0,37552 (0x92b0))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=0 (0x0)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x8000ffff
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: Failed: IX_ETH_ACC_MII_READ_FAIL
ixEthMii.c-DEBUG: ixEthMiiPhyConfig: Function start 1
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: parameters ok (1,0,37552 (0x92b0))
ixEthAccMii.c-DEBUG: ixEthAccMiiReadRtn: ixEthAccMdioCmdRead OK, regval=2097152 (0x200000)
ixEthAccMii.c-DEBUG: ixEthAccMdioStatusRead: STS_4, data=0x1000
ixp400_eth: ixp0 is using NPEB and the PHY at address 0
ixp400_eth: ixp1 is using NPEC and the PHY at address 1
ixp400_eth: Use default MAC address 00:02:b3:01:01:01 for port 0
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1
DEBUG insmod wlan.ko
wlan: 0.8.4.2 (svn r2750)
DEBUG insmod wlan_wep.ko
DEBUG insmod wlan_acl.ko
wlan: mac acl policy registered
DEBUG insmod ath_hal.ko
ath_hal: 0.9.30.13 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, REGOPS_FUNC)
DEBUG insmod ath_rate_sample.ko
ath_rate_sample: 1.2 (svn r2750)
DEBUG insmod wlan_scan_sta.ko
DEBUG insmod ath_pci.ko
ath_pci: 0.9.4.5 (svn r2750)
PCI: enabling device 0000:00:0c.0 (0140 -> 0142)
ath_pci: switching rfkill capability off
ath_pci: switching per-packet transmit power control off
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 7.8 phy 4.5 radio 5.6
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5212: mem=0x4a000000, irq=24


Oh, and thanks for all the help so far


best regards
Jocke


Doug Kehn wrote:
Hi Joakim,

--- Joakim Wennergren wrote:

I've tracked down the problem to an earlier issue in
the boot, the PCI bus doesn't seem to initialize properly. I've attached the start of the boot sequence both before and after I switched
kernel.

The first row that really differs (except the PID
tables and stuff, I assume that's just new default sizes in the kernel)
is the new line

"IXP4xx: Using 16MiB expansion bus window size"

I don't know if this matters, but after that the PCI
initialization goes wrong, at the line

"PCI: Failed to allocate mem resource
#0:[EMAIL PROTECTED] for 0000:00:0c.0"

And after that the memory addresses are all worng,
and later all initializations of PCI devices seem to fail.

Where do I set up these things? Any ideas how to fix
them?

The internal ethernets and PCI are separate.  I would
think that a PCI error, although bad, would not affect
the operation of the internal ethernet.  I would
compare (or re-compare) config.linux-2.6.x and
config.modules between the working and not-working
trees.

Regards,
....doug

Old kernel:

Uncompressing
Linux...............................................................................................
done, booting the kernel.
Linux version 2.6.14.2 ([EMAIL PROTECTED]) (gcc
version 3.3.2) #38 Thu Dec 20 11:49:33 CET 2007
CPU: XScale-IXP42x Family [690541f1] revision 1
(ARMv5TE)
Machine: Intel IXDPG425
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32
byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32
byte lines, 32 sets
Built 1 zonelists
Kernel command line: console=ttyS0,115200
root=/dev/mtdblock4 rootfstype=cramfs [EMAIL PROTECTED]
PID hash table entries: 256 (order: 8, 4096 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3,
32768 bytes)
Inode-cache hash table entries: 4096 (order: 2,
16384 bytes)
Memory: 32MB = 32MB total
Memory: 29312KB available (2440K code, 523K data,
100K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
PCI: IXP4xx is host
PCI: IXP4xx Using indirect access for memory space
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:0c.0 on pci bus
dmabounce: registered device 0000:00:0d.0 on pci bus
PCI: Bus 1, cardbus bridge: 0000:00:0d.0
   IO window: 00001000-000010ff
   IO window: 00001400-000014ff
   PREFETCH window: 48000000-48ffffff
   MEM window: 49000000-49ffffff
Generic PHY: Registered new driver



New kernel:

Uncompressing
Linux.........................................................................................
done, booting the kernel.
Linux version 2.6.19-uc1 ([EMAIL PROTECTED]) (gcc
version 3.4.4) #169 Thu Dec 20 11:07:40 CET 2007
CPU: XScale-IXP42x Family [690541f1] revision 1
(ARMv5TE), cr=000039ff
Machine: Intel IXDPG425
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32
byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32
byte lines, 32 sets
Built 1 zonelists.  Total pages: 8128
Kernel command line: console=ttyS0,115200
root=/dev/mtdblock4 rootfstype=squashfs [EMAIL PROTECTED]
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2,
16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192
bytes)
Memory: 32MB = 32MB total
Memory: 29592KB available (2276K code, 472K data,
100K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
IXP4xx: Using 16MiB expansion bus window size
PCI: IXP4xx is host
PCI: IXP4xx Using direct access for memory space
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:0c.0 on pci bus
dmabounce: registered device 0000:00:0d.0 on pci bus
PCI: Failed to allocate mem resource
#0:[EMAIL PROTECTED] for 0000:00:0c.0
PCI: Failed to allocate mem resource
#0:[EMAIL PROTECTED] for 0000:00:0d.0
PCI: Bus 1, cardbus bridge: 0000:00:0d.0
   IO window: 00001000-000010ff
   IO window: 00001400-000014ff
   PREFETCH window: 48000000-49ffffff
   MEM window: 4a000000-4bffffff
pci 0000:00:0d.0: Error creating sysfs bridge
symlink, continuing...
Generic PHY: Registered new driver


/jocke

Doug Kehn wrote:
Hi Joakim,

--- Joakim Wennergren wrote:

Doug Kehn wrote:
Hi Joakim,

--- Joakim Wennergren wrote:

I'm getting an error when trying to ifconfig up
interface eth0:

xp400_eth: ixEthMiiLinkStatus failed on PHY0.
          Can't determine
        the auto negotiated parameters. Using
default
values.


I'm using snapgear 3.5.0 with ixp400 Access
library
2.1, with the patches from snapgear applied.

There was a previous mail here with the same
problem
(http://mailman.uclinux.org/pipermail/uclinux-dev/2006-January/036476.html),
but I have already applied the patches
mentioned
in
his solution...

Any ideas?

What target are you building for?
Regards,
....doug


The target platform is an IXP422, and I've chosen
the target IXDPG425 in the kernel configuration (MACH_IXDPG425).

I had a working previous version of snapgear with
this configuration, so I guess it's correct.


Try poking some printk in ixEthMiiLinkStatus
(IxEthMii.c).  There are only a couple of things
that
would cause ixEthMiiLinkStatus to return failure.

One is the reading of the PHY MII register(s).  An
indication that the PHY may not be working
properly.
The other is the setting of phyNum/phyAddr.  In
your
case phyNum/phyAddr is 0.  Is this consistent with
the
working version?  If not, maybe the configuration
isn't what you expect it to be.

Regards,
....doug
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to