Using fixed_phy with gianfar

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Using fixed_phy with gianfar

Ben Warren
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

_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Reply | Threaded
Open this post in threaded view
|

Re: Using fixed_phy with gianfar

Vitaly Bordug
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

_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using fixed_phy with gianfar

Ben Warren
Thanks Vitaly!

--- Vitaly Bordug <[hidden email]> 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


_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Reply | Threaded
Open this post in threaded view
|

Re: Using fixed_phy with gianfar

Vitaly Bordug
On Wed, 10 Jan 2007 06:22:40 -0800 (PST)
Ben Warren wrote:

> Thanks Vitaly!
>
> --- Vitaly Bordug <[hidden email]> 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...
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

_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using fixed_phy with gianfar

Ben Warren
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

_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Reply | Threaded
Open this post in threaded view
|

Re: Using fixed_phy with gianfar

Andy Fleming
In reply to this post by Ben Warren

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
_______________________________________________
Linuxppc-embedded mailing list
[hidden email]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded