[U-Boot] [PATCH v2 08/13] usb: gadget: ether: Provide a way to read MAC address

Lukasz Majewski lukma at denx.de
Wed Jun 21 07:33:56 UTC 2017


Hi Vignesh,

> Hi Lukasz,
> 
> On Thursday 15 June 2017 10:28 PM, Marek Vasut wrote:
> > On 06/14/2017 02:24 PM, Vignesh R wrote:
> >>
> >>
> >> On Tuesday 13 June 2017 07:36 PM, Marek Vasut wrote:
> >>> On 06/13/2017 02:10 PM, Vignesh R wrote:
> >>>> Provide a way to read MAC address for usb_ether device from board
> >>>> function. Board files can override board_set_usbnet_devaddr() to
> >>>> populate MAC address to be used by usb_ether as device address.
> >>>>
> >>>> Signed-off-by: Vignesh R <vigneshr at ti.com>
> >>>
> >>> This patch is totally unrelated to this series. 
> >>
> >> This series converts dwc3 peripheral to device model and the best
> >> way to test this on TI platform to use it on ether gadget and test
> >> RNDIS boot. Hence, I had to do patches 8 to 13. Therefore I posted
> >> them together for completeness, if somebody wanted to test this
> >> out.
> > 
> > Testing is great, but this is probably a fix and it's unrelated to
> > the series anyway.
> > 
> >>> Moreover, just set eth*addr using setenv() to achieve the same
> >>> iirc .
> >>>
> >>
> >> eth*addr is used for regular ethernet interface and usually set by
> >> regular ethernet driver, but I could not find a way to set MAC
> >> address for usb ethernet interface
> >> Board file will now override board_set_usbnet_devaddr() to read
> >> MAC and then call setenv()
> > 
> > Lukasz should be able to jump in and help.
> > 
> 
> Any preference on how to handle this?
> Basically, I need a way to pass MAC address to usb_ether driver. MAC
> address is available in specific efuse registers.

It seems to me like we need to read some board specific code anyway
(because the efused data can be placed at different addresses for
different SoC - e.g. am4xx or dra7).

The __weak function could check if e.g. "ethusbaddr" is set and read eth
addr (if one would like to override it from envs).

And as far as I remember TI even for "ordinary" ETH driver reads data
(MAC addr) in board file, so there should be no problem for also
reading ETH data from there.

> Previously, this was
> handled by board_eth_init(), this is no longer available when using DM
> based ethernet driver.
> 
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de


More information about the U-Boot mailing list