How to support an Ethernet PHY without ID registers?

2008-10-07 Thread Bruce M Simpson

Hi,

I have been trying to get FreeBSD onto the Freecom FSG3 Storage Gateway.
It is an xScale based ARM system.

Whilst the npe(4) driver appears to attach, the PHY does not. It is a 
Realtel RTL8305SB switch chip in dual miibus mode. Unfortunately the 
RTL8305SB does not have ID registers. The RTL8305SC does, but it's a 
totally different chip.


We do have a driver in the tree for the RTL8305SC, however these chips 
are different enough for this to cause problems.


Is there any way I could for example force ukphy(4) to attach?

Note: Because there are no ID registers, mii_phy_probe_gen() WILL NOT 
work. It looks like I'd have to override this by hacking if_npe.c 
itself. Can anyone clarify?


cheers
BMS
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to support an Ethernet PHY without ID registers?

2008-10-07 Thread Sepherosa Ziehau
On Wed, Oct 8, 2008 at 3:09 AM, Bruce M Simpson <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have been trying to get FreeBSD onto the Freecom FSG3 Storage Gateway.
> It is an xScale based ARM system.
>
> Whilst the npe(4) driver appears to attach, the PHY does not. It is a
> Realtel RTL8305SB switch chip in dual miibus mode. Unfortunately the
> RTL8305SB does not have ID registers. The RTL8305SC does, but it's a totally

Are you sure you could read from BMSR?  Return invalid value from BMSR
is the usual cause of miibus attaching/probing failure.  For ID1/ID2
reading, you could just fake some values in npe(4)'s miibus_readreg
implementation.

Best Regards,
sephe

-- 
Live Free or Die
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to support an Ethernet PHY without ID registers?

2008-10-11 Thread Bruce M. Simpson

Sepherosa Ziehau wrote:

Are you sure you could read from BMSR?  Return invalid value from BMSR
is the usual cause of miibus attaching/probing failure.  For ID1/ID2
reading, you could just fake some values in npe(4)'s miibus_readreg
implementation.
  


Thanks for the tip (from you and Pyun). I had to spoof the BMSR read to 
get npe(4) to attach just to begin with. For whatever reason the chip 
doesn't seem to respond on any of the PHY IDs which the Linux folk are 
using (5 and 4 for npe0 (-B) and npe1 (-C) respectively).


I noticed the ucLinux folk needed a similar patch to force driver attach 
under Linux w/the IXP: 
http://mailman.uclinux.org/pipermail/uclinux-dev/2005-March/031419.html


The switch pretty much disappears after npe(4) attaches, I don't see any 
activity lights or link lights at that point. This seems to happen after 
any mii register access.


If I frob things to allow rlswitch to attach, by using hints and hacking 
if_npe.c, I can get dumps of the PHY register space, but it's all ones, 
suggesting that it failed at xScale register level -- that would suggest 
the PHY IDs are *wrong*, or something else isn't right.


Pyun also suggested trying to manually take the PHYs out of power-down 
mode. I tried that with a code snippet I sent him, but still no dice. I 
can't even be sure that the PHYs are being addressed right.


At this point I kind of have to go, whoah, wish I had a logic analyzer 
and grabbers! I believe the firmware configures the switch chip in a 
certain VLAN configuration which isn't meant to be disrupted, although 
Freecom's own SnapGear-based distro apparently does the right thing.


I've looked through all of their GPL materials and cannot find the 
driver for the switch.


I suppose one thing I could try is re-flashing the box with the official 
Freecom firmware, and using mii-diag to dump out what Linux thinks the 
registers are.


thanks
BMS
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to support an Ethernet PHY without ID registers?

2008-10-14 Thread Sepherosa Ziehau
On Sat, Oct 11, 2008 at 4:46 PM, Bruce M. Simpson <[EMAIL PROTECTED]> wrote:
> Sepherosa Ziehau wrote:
>>
>> Are you sure you could read from BMSR?  Return invalid value from BMSR
>> is the usual cause of miibus attaching/probing failure.  For ID1/ID2
>> reading, you could just fake some values in npe(4)'s miibus_readreg
>> implementation.
>>
>
> Thanks for the tip (from you and Pyun). I had to spoof the BMSR read to get
> npe(4) to attach just to begin with. For whatever reason the chip doesn't
> seem to respond on any of the PHY IDs which the Linux folk are using (5 and
> 4 for npe0 (-B) and npe1 (-C) respectively).
>
> I noticed the ucLinux folk needed a similar patch to force driver attach
> under Linux w/the IXP:
> http://mailman.uclinux.org/pipermail/uclinux-dev/2005-March/031419.html
>
> The switch pretty much disappears after npe(4) attaches, I don't see any
> activity lights or link lights at that point. This seems to happen after any
> mii register access.
>
> If I frob things to allow rlswitch to attach, by using hints and hacking
> if_npe.c, I can get dumps of the PHY register space, but it's all ones,
> suggesting that it failed at xScale register level -- that would suggest the
> PHY IDs are *wrong*, or something else isn't right.
>
> Pyun also suggested trying to manually take the PHYs out of power-down mode.
> I tried that with a code snippet I sent him, but still no dice. I can't even
> be sure that the PHYs are being addressed right.

Realtek's 8211[BC] PHY has a "page selector" register (0x1f), BMSR and
other GMII standard registers are in page0.  Does the PHY you are
working with has something like the "page selector"?

Best Regards,
sephe

-- 
Live Free or Die
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to support an Ethernet PHY without ID registers?

2008-11-22 Thread Bernd Walter
On Tue, Oct 07, 2008 at 08:09:10PM +0100, Bruce M Simpson wrote:
> Hi,
> 
> I have been trying to get FreeBSD onto the Freecom FSG3 Storage Gateway.
> It is an xScale based ARM system.
> 
> Whilst the npe(4) driver appears to attach, the PHY does not. It is a 
> Realtel RTL8305SB switch chip in dual miibus mode. Unfortunately the 
> RTL8305SB does not have ID registers. The RTL8305SC does, but it's a 
> totally different chip.
> 
> We do have a driver in the tree for the RTL8305SC, however these chips 
> are different enough for this to cause problems.
> 
> Is there any way I could for example force ukphy(4) to attach?

A late response...
rlswitch is there for two reasons: forcing speed independed of port0
autoselect and setting VLAN (using hardcoded values though).
I never worked with the SB, but read the datasheet a while back
before I ordered the SC for my project.
IIRC the SB has no VLAN support.
Not sure about registers - maybe it really hasn't any or MDIO isn't
connected with your hardware.
I would suggest that you localy patch the rlswitch driver to always
attach and be done with it.
ukphy would try to read link parameters, which will fail and report
wrong speed - MII speed of course is always 100/FDX.

> Note: Because there are no ID registers, mii_phy_probe_gen() WILL NOT 
> work. It looks like I'd have to override this by hacking if_npe.c 
> itself. Can anyone clarify?

This is possible as well, you can patch if_npe.c to return faked phy
register values.

-- 
B.Walter <[EMAIL PROTECTED]> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"