diff mbox

[1/5] davinci: omapl138_lcdk: fixup mac address in dtb

Message ID 20161125101127.15260-2-fparent@baylibre.com
State New
Headers show

Commit Message

Fabien Parent Nov. 25, 2016, 10:11 a.m. UTC
In order to avoid having a random mac address assigned by Linux, let's
fixup the dtb with the mac address that was programmed in the EEPROM.

Signed-off-by: Fabien Parent <fparent@baylibre.com>

---
 board/davinci/da8xxevm/omapl138_lcdk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.10.2

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Tom Rini Nov. 28, 2016, 4:56 p.m. UTC | #1
On Fri, Nov 25, 2016 at 11:11:23AM +0100, Fabien Parent wrote:
> In order to avoid having a random mac address assigned by Linux, let's

> fixup the dtb with the mac address that was programmed in the EEPROM.

> 

> Signed-off-by: Fabien Parent <fparent@baylibre.com>

> ---

>  board/davinci/da8xxevm/omapl138_lcdk.c | 10 ++++++++++

>  1 file changed, 10 insertions(+)

> 

> diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c

> index 9c1a483..8a29748 100644

> --- a/board/davinci/da8xxevm/omapl138_lcdk.c

> +++ b/board/davinci/da8xxevm/omapl138_lcdk.c

> @@ -10,6 +10,7 @@

>   */

>  

>  #include <common.h>

> +#include <fdt_support.h>

>  #include <i2c.h>

>  #include <net.h>

>  #include <netdev.h>

> @@ -371,3 +372,12 @@ int board_mmc_init(bd_t *bis)

>  	return davinci_mmc_init(bis, &mmc_sd0);

>  }

>  #endif

> +

> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_SYSTEM_SETUP)

> +int ft_system_setup(void *blob, bd_t *bd)

> +{

> +	fdt_fixup_ethernet(blob);

> +

> +	return 0;

> +}

> +#endif


I don't understand why this is needed.  CONFIG_LMB should be set so
image_setup_linux will be called which will call image_setup_libfdt
which will call fdt_fixup_ethernet along with other stuff we'd want done
as well.  I suspect we have some bug somewhere along the line with
regards to pre ARMv7 platforms and FDT where some knob or another that
should be set, is not set.

-- 
Tom
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Fabien Parent Nov. 29, 2016, 10:31 a.m. UTC | #2
On Mon, Nov 28, 2016 at 5:56 PM, Tom Rini <trini@konsulko.com> wrote:
> On Fri, Nov 25, 2016 at 11:11:23AM +0100, Fabien Parent wrote:

>> In order to avoid having a random mac address assigned by Linux, let's

>> fixup the dtb with the mac address that was programmed in the EEPROM.

>>

>> Signed-off-by: Fabien Parent <fparent@baylibre.com>

>> ---

>>  board/davinci/da8xxevm/omapl138_lcdk.c | 10 ++++++++++

>>  1 file changed, 10 insertions(+)

>>

>> diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c

>> index 9c1a483..8a29748 100644

>> --- a/board/davinci/da8xxevm/omapl138_lcdk.c

>> +++ b/board/davinci/da8xxevm/omapl138_lcdk.c

>> @@ -10,6 +10,7 @@

>>   */

>>

>>  #include <common.h>

>> +#include <fdt_support.h>

>>  #include <i2c.h>

>>  #include <net.h>

>>  #include <netdev.h>

>> @@ -371,3 +372,12 @@ int board_mmc_init(bd_t *bis)

>>       return davinci_mmc_init(bis, &mmc_sd0);

>>  }

>>  #endif

>> +

>> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_SYSTEM_SETUP)

>> +int ft_system_setup(void *blob, bd_t *bd)

>> +{

>> +     fdt_fixup_ethernet(blob);

>> +

>> +     return 0;

>> +}

>> +#endif

>

> I don't understand why this is needed.  CONFIG_LMB should be set so

> image_setup_linux will be called which will call image_setup_libfdt

> which will call fdt_fixup_ethernet along with other stuff we'd want done

> as well.  I suspect we have some bug somewhere along the line with

> regards to pre ARMv7 platforms and FDT where some knob or another that

> should be set, is not set.


Indeed, this was not necessary to make it work. I misread the code and
thought this was necessary. Just applying PATCH 2 & 3 is enough and
the other patches from the series can be dropped. Do you want me to
send a series again that includes only PATCH 2 & 3?

>

> --

> Tom

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Tom Rini Nov. 29, 2016, 2:20 p.m. UTC | #3
On Tue, Nov 29, 2016 at 11:31:09AM +0100, Fabien Parent wrote:
> On Mon, Nov 28, 2016 at 5:56 PM, Tom Rini <trini@konsulko.com> wrote:

> > On Fri, Nov 25, 2016 at 11:11:23AM +0100, Fabien Parent wrote:

> >> In order to avoid having a random mac address assigned by Linux, let's

> >> fixup the dtb with the mac address that was programmed in the EEPROM.

> >>

> >> Signed-off-by: Fabien Parent <fparent@baylibre.com>

> >> ---

> >>  board/davinci/da8xxevm/omapl138_lcdk.c | 10 ++++++++++

> >>  1 file changed, 10 insertions(+)

> >>

> >> diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c

> >> index 9c1a483..8a29748 100644

> >> --- a/board/davinci/da8xxevm/omapl138_lcdk.c

> >> +++ b/board/davinci/da8xxevm/omapl138_lcdk.c

> >> @@ -10,6 +10,7 @@

> >>   */

> >>

> >>  #include <common.h>

> >> +#include <fdt_support.h>

> >>  #include <i2c.h>

> >>  #include <net.h>

> >>  #include <netdev.h>

> >> @@ -371,3 +372,12 @@ int board_mmc_init(bd_t *bis)

> >>       return davinci_mmc_init(bis, &mmc_sd0);

> >>  }

> >>  #endif

> >> +

> >> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_SYSTEM_SETUP)

> >> +int ft_system_setup(void *blob, bd_t *bd)

> >> +{

> >> +     fdt_fixup_ethernet(blob);

> >> +

> >> +     return 0;

> >> +}

> >> +#endif

> >

> > I don't understand why this is needed.  CONFIG_LMB should be set so

> > image_setup_linux will be called which will call image_setup_libfdt

> > which will call fdt_fixup_ethernet along with other stuff we'd want done

> > as well.  I suspect we have some bug somewhere along the line with

> > regards to pre ARMv7 platforms and FDT where some knob or another that

> > should be set, is not set.

> 

> Indeed, this was not necessary to make it work. I misread the code and

> thought this was necessary. Just applying PATCH 2 & 3 is enough and

> the other patches from the series can be dropped. Do you want me to

> send a series again that includes only PATCH 2 & 3?


Yeah, retest with just 2 and 3 and re-send, thanks!

-- 
Tom
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c
index 9c1a483..8a29748 100644
--- a/board/davinci/da8xxevm/omapl138_lcdk.c
+++ b/board/davinci/da8xxevm/omapl138_lcdk.c
@@ -10,6 +10,7 @@ 
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <net.h>
 #include <netdev.h>
@@ -371,3 +372,12 @@  int board_mmc_init(bd_t *bis)
 	return davinci_mmc_init(bis, &mmc_sd0);
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_SYSTEM_SETUP)
+int ft_system_setup(void *blob, bd_t *bd)
+{
+	fdt_fixup_ethernet(blob);
+
+	return 0;
+}
+#endif