Using fixed_phy with gianfar

6 messages, 3 authors, 2007-01-10 · open the first message on its own page

Using fixed_phy with gianfar

From: Ben Warren <hidden>
Date: 2007-01-09 23:24:01

Hello,

My custom board has a couple of Ethernet switches attached via RvMII to
the 'Gianfar' controllers of an MPC8349 CPU.  We're using SPI instead of
MDIO for control of the switches, and it looked like the 'fixed.c' PHY
driver was the right thing to use.  BTW, I'm using a 2.6.19 kernel.

When I 'ifconfig up' one of the interfaces, the Gianfar driver tries to
find a device on the MDIO bus of the variety bus_id:phy_id, where both
bus_id and phy_id are numeric (defined in fsl_devices.h).  The Fixed PHY
driver creates devices on the MDIO bus with a bus_id that is a string,
for example "fixed_1@100:1".  Obviously, these will never match up.  The
very crude hack I made to get things working was to modify the Gianfar
driver to match the "fixed" string.  

I'm sure I'm missing something, and am wondering what the correct way to
do this is.  Should I have board-specific code that creates PHY devices
conforming to the Gianfar expectations instead of calling
'fixed_mdio_register_device()', or something else?

thanks,
Ben 

Re: Using fixed_phy with gianfar

From: Vitaly Bordug <hidden>
Date: 2007-01-10 13:13:20

On Tue, 09 Jan 2007 18:23:58 -0500
Ben Warren wrote:
Hello,

My custom board has a couple of Ethernet switches attached via RvMII
to the 'Gianfar' controllers of an MPC8349 CPU.  We're using SPI
instead of MDIO for control of the switches, and it looked like the
'fixed.c' PHY driver was the right thing to use.  BTW, I'm using a
2.6.19 kernel.

When I 'ifconfig up' one of the interfaces, the Gianfar driver tries
to find a device on the MDIO bus of the variety bus_id:phy_id, where
both bus_id and phy_id are numeric (defined in fsl_devices.h).  The
Fixed PHY driver creates devices on the MDIO bus with a bus_id that
is a string, for example "fixed_1@100:1".  Obviously, these will
never match up.  The very crude hack I made to get things working was
to modify the Gianfar driver to match the "fixed" string.  

I'm sure I'm missing something, and am wondering what the correct way
to do this is.  Should I have board-specific code that creates PHY
devices conforming to the Gianfar expectations instead of calling
'fixed_mdio_register_device()', or something else?
No, you do not miss - this is an issue. In fact MDIO bus was changed for numeric for gianfar-stuff, and has been remaining string for fs_enet. I think it makes sense to average this up, and will try to do that once will get 8349-mitx which is gianfar+ fixed user.

The point is that fixed should be updated to numeric MDIO address encoding. This has to come through netdev, so I'll try to get it fixed by the next merge window.

--
Sincerely, Vitaly

Re: Using fixed_phy with gianfar

From: Ben Warren <hidden>
Date: 2007-01-10 14:29:22

Thanks Vitaly!
--- Vitaly Bordug <vbordug@ru.mvista.com> wrote:
No, you do not miss - this is an issue. In fact MDIO
bus was changed for numeric for gianfar-stuff, and
has been remaining string for fs_enet. I think it
makes sense to average this up, and will try to do
that once will get 8349-mitx which is gianfar+ fixed
user.

The point is that fixed should be updated to numeric
MDIO address encoding. This has to come through
netdev, so I'll try to get it fixed by the next
merge window.

--
Sincerely, Vitaly
Ideally (for me anyway), we'd be able to pass some
fixed phy information via the device tree, for example
speed and duplexity.  This way a board could, for
example, connect to one switch via RvMII @100FD and
another via GMII @1000FD.  Having parameters as
numeric limits this capability, but presumably a
simple encoding scheme could be make it work.  

I'm sure you've already thought of this, though...

cheers,
Ben

Re: Using fixed_phy with gianfar

From: Vitaly Bordug <hidden>
Date: 2007-01-10 16:06:17

On Wed, 10 Jan 2007 06:22:40 -0800 (PST)
Ben Warren wrote:
quoted hunk
Thanks Vitaly!
--- Vitaly Bordug <vbordug@ru.mvista.com> wrote:
quoted
No, you do not miss - this is an issue. In fact MDIO
bus was changed for numeric for gianfar-stuff, and
has been remaining string for fs_enet. I think it
makes sense to average this up, and will try to do
that once will get 8349-mitx which is gianfar+ fixed
user.

The point is that fixed should be updated to numeric
MDIO address encoding. This has to come through
netdev, so I'll try to get it fixed by the next
merge window.

--
Sincerely, Vitaly
Ideally (for me anyway), we'd be able to pass some
fixed phy information via the device tree, for example
speed and duplexity.  This way a board could, for
example, connect to one switch via RvMII @100FD and
another via GMII @1000FD.  Having parameters as
numeric limits this capability, but presumably a
simple encoding scheme could be make it work.  

I'm sure you've already thought of this, though...
Yes, I was thinking about something like 0:1001 or 0:101 where 1 at the end respects duplexity.
Putting it into devtree is good but we'll need to unify the interface first.

--
Sincerely, Vitaly

Re: Using fixed_phy with gianfar

From: Ben Warren <hidden>
Date: 2007-01-10 17:01:49

Vitaly,
Yes, I was thinking about something like 0:1001 or
0:101 where 1 at the end respects duplexity.
Putting it into devtree is good but we'll need to
unify the interface first.
I'm sure you're working on lots of other things right
now, so I'll go ahead and code something like this up
and will pass it to you.  You can then
keep/modify/discard as you like.

regards,
Ben

Re: Using fixed_phy with gianfar

From: Andy Fleming <hidden>
Date: 2007-01-10 22:41:45

On Jan 9, 2007, at 17:23, Ben Warren wrote:
Hello,

My custom board has a couple of Ethernet switches attached via  
RvMII to
the 'Gianfar' controllers of an MPC8349 CPU.  We're using SPI  
instead of
MDIO for control of the switches, and it looked like the 'fixed.c' PHY
driver was the right thing to use.  BTW, I'm using a 2.6.19 kernel.

That sounds reasonable.

When I 'ifconfig up' one of the interfaces, the Gianfar driver  
tries to
find a device on the MDIO bus of the variety bus_id:phy_id, where both
bus_id and phy_id are numeric (defined in fsl_devices.h).  The  
Fixed PHY
driver creates devices on the MDIO bus with a bus_id that is a string,
for example "fixed_1@100:1".  Obviously, these will never match  
up.  The
very crude hack I made to get things working was to modify the Gianfar
driver to match the "fixed" string.

Yeah, that needs to be fixed.

*Adds to list*

Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help