U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] wanting to confirm i'm setting the MAC address the right way
@ 2016-05-24 16:31 Robert P. J. Day
  2016-05-25  2:18 ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2016-05-24 16:31 UTC (permalink / raw)
  To: u-boot


  i want to use the fdt_fixup_ethernet() routine to automate most of
the work of setting the MAC address in the FDT before passing it to
the kernel, so here's what i'm about to do, and i'd appreciate someone
saying, "yup, looks good" if it will indeed work.

  on either a MPC8280 or MPC8360 system, i will first set up the DTS
file with some variation of:

        aliases {
                ethernet0 = &ucc0;
        };

	... snip ...

                ucc0:ucc at 2000 {
                        device_type = "network";
                        compatible = "ucc_geth";
                        model = "UCC";
                        device-id = <1>;
                        reg = <0x2000 0x200>;
                        interrupts = <0x20>;
                        local-mac-address = [ 00 01 02 03 04 05 ];
                        rx-clock = <0x1c>;  // CLK12
                        tx-clock = <0x1b>;  // CLK11
                        phy-handle = <&PHY0>;
                };

at that point, given all the work done in fdt_fixup_ethernet(), i
*think* that all i need to do in the board's ft_board_setup() routine
is:

  eth_setenv_enetaddr("ethaddr", <physical addr of 6-byte MAC address>);

is that about it? it *looks* like all i have to do, and
fdt_fixup_etherhet() will do all the rest.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] wanting to confirm i'm setting the MAC address the right way
  2016-05-24 16:31 [U-Boot] wanting to confirm i'm setting the MAC address the right way Robert P. J. Day
@ 2016-05-25  2:18 ` Bin Meng
  2016-05-25 10:09   ` Robert P. J. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2016-05-25  2:18 UTC (permalink / raw)
  To: u-boot

On Wed, May 25, 2016 at 12:31 AM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
>
>   i want to use the fdt_fixup_ethernet() routine to automate most of
> the work of setting the MAC address in the FDT before passing it to
> the kernel, so here's what i'm about to do, and i'd appreciate someone
> saying, "yup, looks good" if it will indeed work.
>
>   on either a MPC8280 or MPC8360 system, i will first set up the DTS
> file with some variation of:
>

To make it clear, the DTS file is the Linux kernel's, not U-Boot's.

>         aliases {
>                 ethernet0 = &ucc0;
>         };
>
>         ... snip ...
>
>                 ucc0:ucc at 2000 {
>                         device_type = "network";
>                         compatible = "ucc_geth";
>                         model = "UCC";
>                         device-id = <1>;
>                         reg = <0x2000 0x200>;
>                         interrupts = <0x20>;
>                         local-mac-address = [ 00 01 02 03 04 05 ];

Make it all 00s

>                         rx-clock = <0x1c>;  // CLK12
>                         tx-clock = <0x1b>;  // CLK11
>                         phy-handle = <&PHY0>;
>                 };
>
> at that point, given all the work done in fdt_fixup_ethernet(), i
> *think* that all i need to do in the board's ft_board_setup() routine
> is:
>
>   eth_setenv_enetaddr("ethaddr", <physical addr of 6-byte MAC address>);
>
> is that about it? it *looks* like all i have to do, and
> fdt_fixup_etherhet() will do all the rest.
>

yup, looks good :)

Regards,
Bin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] wanting to confirm i'm setting the MAC address the right way
  2016-05-25  2:18 ` Bin Meng
@ 2016-05-25 10:09   ` Robert P. J. Day
  0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2016-05-25 10:09 UTC (permalink / raw)
  To: u-boot

On Wed, 25 May 2016, Bin Meng wrote:

> On Wed, May 25, 2016 at 12:31 AM, Robert P. J. Day
> <rpjday@crashcourse.ca> wrote:
> >
> >   i want to use the fdt_fixup_ethernet() routine to automate most
> > of the work of setting the MAC address in the FDT before passing
> > it to the kernel, so here's what i'm about to do, and i'd
> > appreciate someone saying, "yup, looks good" if it will indeed
> > work.
> >
> >   on either a MPC8280 or MPC8360 system, i will first set up the
> > DTS file with some variation of:
>
> To make it clear, the DTS file is the Linux kernel's, not U-Boot's.

  right, i knew that, should have been clearer.

> >         aliases {
> >                 ethernet0 = &ucc0;
> >         };
> >
> >         ... snip ...
> >
> >                 ucc0:ucc at 2000 {
> >                         device_type = "network";
> >                         compatible = "ucc_geth";
> >                         model = "UCC";
> >                         device-id = <1>;
> >                         reg = <0x2000 0x200>;
> >                         interrupts = <0x20>;
> >                         local-mac-address = [ 00 01 02 03 04 05 ];
>
> Make it all 00s

  point taken, as i see numerous other examples which also add a
comment "Filled in by U-Boot", which never hurts.

... snip ...

> > is that about it? it *looks* like all i have to do, and
> > fdt_fixup_etherhet() will do all the rest.
>
> yup, looks good :)

thanks.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-25 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24 16:31 [U-Boot] wanting to confirm i'm setting the MAC address the right way Robert P. J. Day
2016-05-25  2:18 ` Bin Meng
2016-05-25 10:09   ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox