* [U-Boot] net: gpio PHY driver
@ 2009-07-01 12:28 Darius Augulis
2009-07-01 12:37 ` Jerry Van Baren
0 siblings, 1 reply; 10+ messages in thread
From: Darius Augulis @ 2009-07-01 12:28 UTC (permalink / raw)
To: u-boot
Hi,
I need to control RGMII PHY connected to GPIO.
Seems there isn't such driver in u-boot.
I would like to discuss how is better to implement this?
I could port mdio_gpio driver from Linux Kernel,
but u-boot does not have universal gpio driver.
Off course I could make this very board specific, but It may be useful for
other boards, interfacing PHY with GPIO's.
Any ideas welcome!
Darius A.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 12:28 [U-Boot] net: gpio PHY driver Darius Augulis
@ 2009-07-01 12:37 ` Jerry Van Baren
2009-07-01 16:31 ` Darius Augulis
0 siblings, 1 reply; 10+ messages in thread
From: Jerry Van Baren @ 2009-07-01 12:37 UTC (permalink / raw)
To: u-boot
Darius Augulis wrote:
> Hi,
>
> I need to control RGMII PHY connected to GPIO.
> Seems there isn't such driver in u-boot.
> I would like to discuss how is better to implement this?
> I could port mdio_gpio driver from Linux Kernel,
> but u-boot does not have universal gpio driver.
> Off course I could make this very board specific, but It may be useful for
> other boards, interfacing PHY with GPIO's.
>
> Any ideas welcome!
>
> Darius A.
It sounds like you are looking for CONFIG_BITBANGMII.
Best regards,
gvb
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 12:37 ` Jerry Van Baren
@ 2009-07-01 16:31 ` Darius Augulis
2009-07-01 18:12 ` Richard Retanubun
0 siblings, 1 reply; 10+ messages in thread
From: Darius Augulis @ 2009-07-01 16:31 UTC (permalink / raw)
To: u-boot
On 07/01/2009 03:37 PM, Jerry Van Baren wrote:
> Darius Augulis wrote:
>> Hi,
>>
>> I need to control RGMII PHY connected to GPIO.
>> Seems there isn't such driver in u-boot.
>> I would like to discuss how is better to implement this?
>> I could port mdio_gpio driver from Linux Kernel,
>> but u-boot does not have universal gpio driver.
>> Off course I could make this very board specific, but It may be useful for
>> other boards, interfacing PHY with GPIO's.
>>
>> Any ideas welcome!
>>
>> Darius A.
>
> It sounds like you are looking for CONFIG_BITBANGMII.
Probably. Even it has MPC specific things, I guess should be easy to
re-use it in my system.
>
> Best regards,
> gvb
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 16:31 ` Darius Augulis
@ 2009-07-01 18:12 ` Richard Retanubun
2009-07-01 18:19 ` Darius Augulis
0 siblings, 1 reply; 10+ messages in thread
From: Richard Retanubun @ 2009-07-01 18:12 UTC (permalink / raw)
To: u-boot
Darius Augulis wrote:
> On 07/01/2009 03:37 PM, Jerry Van Baren wrote:
>> Darius Augulis wrote:
>>> Hi,
>>>
>>> I need to control RGMII PHY connected to GPIO.
>>> Seems there isn't such driver in u-boot.
>>> I would like to discuss how is better to implement this?
>>> I could port mdio_gpio driver from Linux Kernel,
>>> but u-boot does not have universal gpio driver.
>>> Off course I could make this very board specific, but It may be useful for
>>> other boards, interfacing PHY with GPIO's.
>>>
>>> Any ideas welcome!
>>>
>>> Darius A.
>> It sounds like you are looking for CONFIG_BITBANGMII.
>
> Probably. Even it has MPC specific things, I guess should be easy to
> re-use it in my system.
Wow, what a coincidence!
Just in case you system is MPC83XX based, I just submitted a patch for consideration
that adds bitbang SMI to uec_phy.c <stolen from gvb's implementation, of course>
see: http://article.gmane.org/gmane.comp.boot-loaders.u-boot/62640
- Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 18:12 ` Richard Retanubun
@ 2009-07-01 18:19 ` Darius Augulis
2009-07-01 18:43 ` Richard Retanubun
2009-07-01 19:02 ` Ben Warren
0 siblings, 2 replies; 10+ messages in thread
From: Darius Augulis @ 2009-07-01 18:19 UTC (permalink / raw)
To: u-boot
On 07/01/2009 09:12 PM, Richard Retanubun wrote:
> Darius Augulis wrote:
>> On 07/01/2009 03:37 PM, Jerry Van Baren wrote:
>>> Darius Augulis wrote:
>>>> Hi,
>>>>
>>>> I need to control RGMII PHY connected to GPIO.
>>>> Seems there isn't such driver in u-boot.
>>>> I would like to discuss how is better to implement this?
>>>> I could port mdio_gpio driver from Linux Kernel,
>>>> but u-boot does not have universal gpio driver.
>>>> Off course I could make this very board specific, but It may be useful for
>>>> other boards, interfacing PHY with GPIO's.
>>>>
>>>> Any ideas welcome!
>>>>
>>>> Darius A.
>>> It sounds like you are looking for CONFIG_BITBANGMII.
>> Probably. Even it has MPC specific things, I guess should be easy to
>> re-use it in my system.
>
> Wow, what a coincidence!
> Just in case you system is MPC83XX based, I just submitted a patch for consideration
> that adds bitbang SMI to uec_phy.c<stolen from gvb's implementation, of course>
No, my system is not MPC based. I'm working on new board and CPU
(Gemini) support in u-boot. My SoC has two GMAC controllers.
btw, what is the right way to add new Ethernet driver?
Should I define CONFIG_CMD_NET and CONFIG_NET_MULTI in my board config?
Or should I define eth_* funtions right in the driver code?
>
> see: http://article.gmane.org/gmane.comp.boot-loaders.u-boot/62640
>
> - Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 18:19 ` Darius Augulis
@ 2009-07-01 18:43 ` Richard Retanubun
2009-07-01 18:54 ` Darius Augulis
2009-07-01 19:02 ` Ben Warren
1 sibling, 1 reply; 10+ messages in thread
From: Richard Retanubun @ 2009-07-01 18:43 UTC (permalink / raw)
To: u-boot
Darius Augulis wrote:
[snip]
> No, my system is not MPC based. I'm working on new board and CPU
> (Gemini) support in u-boot. My SoC has two GMAC controllers.
> btw, what is the right way to add new Ethernet driver?
> Should I define CONFIG_CMD_NET and CONFIG_NET_MULTI in my board config?
> Or should I define eth_* funtions right in the driver code?
I'm not an expert on the network code, but here's what I know
*I think* CONFIG_CMD_NET just turns on network commands, CONFIG_NET_MULTI says you have more than one MAC?
I recall some conversations about it being discussed recently in the mailing list, try grep-ing it for that
and check the README.
(If you haven't already)
look at u-boot/include/net.h, I think this is the functions that and ethernet driver needs to have defined.
look at u-boot/drivers/net/Makefile to see how to make u-boot build your driver by defining a new
#define CONFIG_MY_DRIVER_NAME and adding and entry there.
my exposure to the code have been mostly for powerpc and coldfire, for coldfire their ethernet driver
code is drivers/net/mcffec.c and /drivers/net/mcfmii.c, obviously this would not be what you need
but it is an example.
As always, check with the git tree on kernel.org, someone might have already done it for linux, in which case
you can try porting it into u-boot.
cheers,
- Richard
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 18:43 ` Richard Retanubun
@ 2009-07-01 18:54 ` Darius Augulis
0 siblings, 0 replies; 10+ messages in thread
From: Darius Augulis @ 2009-07-01 18:54 UTC (permalink / raw)
To: u-boot
On 07/01/2009 09:43 PM, Richard Retanubun wrote:
> Darius Augulis wrote:
> [snip]
>> No, my system is not MPC based. I'm working on new board and CPU
>> (Gemini) support in u-boot. My SoC has two GMAC controllers.
>> btw, what is the right way to add new Ethernet driver?
>> Should I define CONFIG_CMD_NET and CONFIG_NET_MULTI in my board config?
> > Or should I define eth_* funtions right in the driver code?
>
> I'm not an expert on the network code, but here's what I know
>
> *I think* CONFIG_CMD_NET just turns on network commands,
> CONFIG_NET_MULTI says you have more than one MAC?
I found #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
statement in net/eth.c
Under this ifdef, are eth_* functions, which are needed by net.c
If my driver does not have these plain eth functions and I don't define
these two labels, u-boot build fails when linking, because no eth_*
functions there.
So, it's strange. If I don't need NET commands but have such a multi-eth
driver, it would not work?...
> I recall some conversations about it being discussed recently in the
> mailing list, try grep-ing it for that
> and check the README.
>
> (If you haven't already)
> look at u-boot/include/net.h, I think this is the functions that and
> ethernet driver needs to have defined.
> look at u-boot/drivers/net/Makefile to see how to make u-boot build your
> driver by defining a new
> #define CONFIG_MY_DRIVER_NAME and adding and entry there.
>
> my exposure to the code have been mostly for powerpc and coldfire, for
> coldfire their ethernet driver
> code is drivers/net/mcffec.c and /drivers/net/mcfmii.c, obviously this
> would not be what you need
> but it is an example.
yes, I saw this driver allready. May be I will use this as example.
>
> As always, check with the git tree on kernel.org, someone might have
> already done it for linux, in which case
> you can try porting it into u-boot.
Unfortunately there isn't ethernet driver for Gemini in Linux.
We are working on this now (both for u-boot and for Linux).
regards,
Darius
>
> cheers,
>
> - Richard
>
>
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 18:19 ` Darius Augulis
2009-07-01 18:43 ` Richard Retanubun
@ 2009-07-01 19:02 ` Ben Warren
2009-07-01 19:07 ` Darius Augulis
2009-07-01 19:18 ` Scott Wood
1 sibling, 2 replies; 10+ messages in thread
From: Ben Warren @ 2009-07-01 19:02 UTC (permalink / raw)
To: u-boot
Hi Darius,
Darius Augulis wrote:
> On 07/01/2009 09:12 PM, Richard Retanubun wrote:
>
>> Darius Augulis wrote:
>>
>>> On 07/01/2009 03:37 PM, Jerry Van Baren wrote:
>>>
>>>> Darius Augulis wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I need to control RGMII PHY connected to GPIO.
>>>>> Seems there isn't such driver in u-boot.
>>>>> I would like to discuss how is better to implement this?
>>>>> I could port mdio_gpio driver from Linux Kernel,
>>>>> but u-boot does not have universal gpio driver.
>>>>> Off course I could make this very board specific, but It may be useful for
>>>>> other boards, interfacing PHY with GPIO's.
>>>>>
>>>>> Any ideas welcome!
>>>>>
>>>>> Darius A.
>>>>>
>>>> It sounds like you are looking for CONFIG_BITBANGMII.
>>>>
>>> Probably. Even it has MPC specific things, I guess should be easy to
>>> re-use it in my system.
>>>
>> Wow, what a coincidence!
>> Just in case you system is MPC83XX based, I just submitted a patch for consideration
>> that adds bitbang SMI to uec_phy.c<stolen from gvb's implementation, of course>
>>
>
>
It sure would be nice to see a patch that gets the CPU-specific crap out
of the miiphybb driver. This type of problem has been dealt with in
other places such as I2C and SPI. Any takers?
> No, my system is not MPC based. I'm working on new board and CPU
> (Gemini) support in u-boot. My SoC has two GMAC controllers.
> btw, what is the right way to add new Ethernet driver?
> Should I define CONFIG_CMD_NET and CONFIG_NET_MULTI in my board config?
> Or should I define eth_* funtions right in the driver code?
>
>
I'm looking forward to your submission.
As Richard mentioned, CONFIG_CMD_NET enables networking.
CONFIG_NET_MULTI really means "use the networking code that supports
multiple interfaces". It doesn't mean "my board has more than one
interface". Going forward, this is mandatory for all Ethernet
drivers. Support for the old-style API (eth_* in drivers) is
deprecated and is scheduled for removal this fall:
http://git.denx.de/?p=u-boot.git;a=blob;f=doc/feature-removal-schedule.txt;h=9bbdc0a83226aa1158ddd73d253e4742c0124159;hb=HEAD
regards,
Ben
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 19:02 ` Ben Warren
@ 2009-07-01 19:07 ` Darius Augulis
2009-07-01 19:18 ` Scott Wood
1 sibling, 0 replies; 10+ messages in thread
From: Darius Augulis @ 2009-07-01 19:07 UTC (permalink / raw)
To: u-boot
Hi Ben,
On 07/01/2009 10:02 PM, Ben Warren wrote:
> Hi Darius,
>
> Darius Augulis wrote:
>> On 07/01/2009 09:12 PM, Richard Retanubun wrote:
>>> Darius Augulis wrote:
>>>> On 07/01/2009 03:37 PM, Jerry Van Baren wrote:
>>>>> Darius Augulis wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I need to control RGMII PHY connected to GPIO.
>>>>>> Seems there isn't such driver in u-boot.
>>>>>> I would like to discuss how is better to implement this?
>>>>>> I could port mdio_gpio driver from Linux Kernel,
>>>>>> but u-boot does not have universal gpio driver.
>>>>>> Off course I could make this very board specific, but It may be
>>>>>> useful for
>>>>>> other boards, interfacing PHY with GPIO's.
>>>>>>
>>>>>> Any ideas welcome!
>>>>>>
>>>>>> Darius A.
>>>>> It sounds like you are looking for CONFIG_BITBANGMII.
>>>> Probably. Even it has MPC specific things, I guess should be easy to
>>>> re-use it in my system.
>>> Wow, what a coincidence!
>>> Just in case you system is MPC83XX based, I just submitted a patch
>>> for consideration
>>> that adds bitbang SMI to uec_phy.c<stolen from gvb's implementation,
>>> of course>
>>
> It sure would be nice to see a patch that gets the CPU-specific crap out
> of the miiphybb driver. This type of problem has been dealt with in
> other places such as I2C and SPI. Any takers?
>> No, my system is not MPC based. I'm working on new board and CPU
>> (Gemini) support in u-boot. My SoC has two GMAC controllers.
>> btw, what is the right way to add new Ethernet driver?
>> Should I define CONFIG_CMD_NET and CONFIG_NET_MULTI in my board config?
>> Or should I define eth_* funtions right in the driver code?
>>
> I'm looking forward to your submission.
>
> As Richard mentioned, CONFIG_CMD_NET enables networking.
>
> CONFIG_NET_MULTI really means "use the networking code that supports
> multiple interfaces". It doesn't mean "my board has more than one
> interface". Going forward, this is mandatory for all Ethernet drivers.
> Support for the old-style API (eth_* in drivers) is deprecated and is
> scheduled for removal this fall:
>
> http://git.denx.de/?p=u-boot.git;a=blob;f=doc/feature-removal-schedule.txt;h=9bbdc0a83226aa1158ddd73d253e4742c0124159;hb=HEAD
thank you for this information. I will add CONFIG_NET_MULTI temporary in
my board, and will remove for 2009-11 release.
Darius.
>
>
> regards,
> Ben
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] net: gpio PHY driver
2009-07-01 19:02 ` Ben Warren
2009-07-01 19:07 ` Darius Augulis
@ 2009-07-01 19:18 ` Scott Wood
1 sibling, 0 replies; 10+ messages in thread
From: Scott Wood @ 2009-07-01 19:18 UTC (permalink / raw)
To: u-boot
Ben Warren wrote:
> It sure would be nice to see a patch that gets the CPU-specific crap out
> of the miiphybb driver. This type of problem has been dealt with in
> other places such as I2C and SPI. Any takers?
There's a version of this driver in Linux which has been more abstracted
(and cleaned up a bit), in drivers/net/phy/mdio-bitbang.c.
-Scott
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-07-01 19:18 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 12:28 [U-Boot] net: gpio PHY driver Darius Augulis
2009-07-01 12:37 ` Jerry Van Baren
2009-07-01 16:31 ` Darius Augulis
2009-07-01 18:12 ` Richard Retanubun
2009-07-01 18:19 ` Darius Augulis
2009-07-01 18:43 ` Richard Retanubun
2009-07-01 18:54 ` Darius Augulis
2009-07-01 19:02 ` Ben Warren
2009-07-01 19:07 ` Darius Augulis
2009-07-01 19:18 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox