* [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup()
@ 2017-04-28 7:33 Chen-Yu Tsai
2017-04-28 9:05 ` Maxime Ripard
0 siblings, 1 reply; 5+ messages in thread
From: Chen-Yu Tsai @ 2017-04-28 7:33 UTC (permalink / raw)
To: u-boot
The sunxi platform relies on the core boot sequence to load and process
device tree blobs, including writing back any MAC addresses we generate
by an implicit call to fdt_fixup_ethernet() within the image loading
mechanism. This call was removed in commit 3f66149d9fb4 ("Remove extra
fdt_fixup_ethernet() call"), resuling in Linux using random MAC
addresses.
This patch adds an explicit call to fdt_fixup_ethernet() in our
ft_board_setup() function.
Fixes: 3f66149d9fb4 ("Remove extra fdt_fixup_ethernet() call")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
I wonder, if every platform wants or needs to do this, maybe we should
just do this in a central place instead.
---
board/sunxi/board.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 04a629125e0f..e10239ca4550 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -29,6 +29,7 @@
#include <asm/io.h>
#include <crc.h>
#include <environment.h>
+#include <fdt_support.h>
#include <libfdt.h>
#include <nand.h>
#include <net.h>
@@ -743,6 +744,8 @@ int ft_board_setup(void *blob, bd_t *bd)
*/
setup_environment(blob);
+ fdt_fixup_ethernet(blob);
+
#ifdef CONFIG_VIDEO_DT_SIMPLEFB
r = sunxi_simplefb_setup(blob);
if (r)
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup()
2017-04-28 7:33 [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup() Chen-Yu Tsai
@ 2017-04-28 9:05 ` Maxime Ripard
2017-04-28 11:24 ` Tom Rini
2017-04-28 11:37 ` Joakim Tjernlund
0 siblings, 2 replies; 5+ messages in thread
From: Maxime Ripard @ 2017-04-28 9:05 UTC (permalink / raw)
To: u-boot
On Fri, Apr 28, 2017 at 03:33:53PM +0800, Chen-Yu Tsai wrote:
> The sunxi platform relies on the core boot sequence to load and process
> device tree blobs, including writing back any MAC addresses we generate
> by an implicit call to fdt_fixup_ethernet() within the image loading
> mechanism. This call was removed in commit 3f66149d9fb4 ("Remove extra
> fdt_fixup_ethernet() call"), resuling in Linux using random MAC
> addresses.
>
> This patch adds an explicit call to fdt_fixup_ethernet() in our
> ft_board_setup() function.
>
> Fixes: 3f66149d9fb4 ("Remove extra fdt_fixup_ethernet() call")
I would just revert that commit. The function mentionned in the commit
log is platform specific, it just doesn't make any sense to remove
some generic code just because it would work on your platform.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/65a3f02c/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup()
2017-04-28 9:05 ` Maxime Ripard
@ 2017-04-28 11:24 ` Tom Rini
2017-04-28 11:37 ` Joakim Tjernlund
1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2017-04-28 11:24 UTC (permalink / raw)
To: u-boot
On Fri, Apr 28, 2017 at 11:05:46AM +0200, Maxime Ripard wrote:
> On Fri, Apr 28, 2017 at 03:33:53PM +0800, Chen-Yu Tsai wrote:
> > The sunxi platform relies on the core boot sequence to load and process
> > device tree blobs, including writing back any MAC addresses we generate
> > by an implicit call to fdt_fixup_ethernet() within the image loading
> > mechanism. This call was removed in commit 3f66149d9fb4 ("Remove extra
> > fdt_fixup_ethernet() call"), resuling in Linux using random MAC
> > addresses.
> >
> > This patch adds an explicit call to fdt_fixup_ethernet() in our
> > ft_board_setup() function.
> >
> > Fixes: 3f66149d9fb4 ("Remove extra fdt_fixup_ethernet() call")
>
> I would just revert that commit. The function mentionned in the commit
> log is platform specific, it just doesn't make any sense to remove
> some generic code just because it would work on your platform.
It's not quite that easy. Part of the issue here is that in PowerPC we
expect to have ft_cpu_setup and ft_board_setup populated and performing
various fix-ups.
That said, 3f66149d9fb4 is fixing a problem we introduced in
13d06981a982. But, lets try again, Joakim, what is the problem of
calling fdt_fixup_ethernet a second time? And why not just drop the
call from the other locations? I don't see a problem with that, in a
quick read over of the other callers. Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/a63d68b3/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup()
2017-04-28 9:05 ` Maxime Ripard
2017-04-28 11:24 ` Tom Rini
@ 2017-04-28 11:37 ` Joakim Tjernlund
2017-04-28 12:36 ` Tom Rini
1 sibling, 1 reply; 5+ messages in thread
From: Joakim Tjernlund @ 2017-04-28 11:37 UTC (permalink / raw)
To: u-boot
On Fri, 2017-04-28 at 11:05 +0200, Maxime Ripard wrote:
> On Fri, Apr 28, 2017 at 03:33:53PM +0800, Chen-Yu Tsai wrote:
> > The sunxi platform relies on the core boot sequence to load and process
> > device tree blobs, including writing back any MAC addresses we generate
> > by an implicit call to fdt_fixup_ethernet() within the image loading
> > mechanism. This call was removed in commit 3f66149d9fb4 ("Remove extra
> > fdt_fixup_ethernet() call"), resuling in Linux using random MAC
> > addresses.
> >
> > This patch adds an explicit call to fdt_fixup_ethernet() in our
> > ft_board_setup() function.
> >
> > Fixes: 3f66149d9fb4 ("Remove extra fdt_fixup_ethernet() call")
>
> I would just revert that commit. The function mentionned in the commit
> log is platform specific, it just doesn't make any sense to remove
> some generic code just because it would work on your platform.
The Generic code was both added later and wrong so no need to restore that.
One could remove the platform specific code and add back a generic one but then
make sure it is called BEFORE any board setup.
Jocke
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup()
2017-04-28 11:37 ` Joakim Tjernlund
@ 2017-04-28 12:36 ` Tom Rini
0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2017-04-28 12:36 UTC (permalink / raw)
To: u-boot
On Fri, Apr 28, 2017 at 11:37:13AM +0000, Joakim Tjernlund wrote:
> On Fri, 2017-04-28 at 11:05 +0200, Maxime Ripard wrote:
> > On Fri, Apr 28, 2017 at 03:33:53PM +0800, Chen-Yu Tsai wrote:
> > > The sunxi platform relies on the core boot sequence to load and process
> > > device tree blobs, including writing back any MAC addresses we generate
> > > by an implicit call to fdt_fixup_ethernet() within the image loading
> > > mechanism. This call was removed in commit 3f66149d9fb4 ("Remove extra
> > > fdt_fixup_ethernet() call"), resuling in Linux using random MAC
> > > addresses.
> > >
> > > This patch adds an explicit call to fdt_fixup_ethernet() in our
> > > ft_board_setup() function.
> > >
> > > Fixes: 3f66149d9fb4 ("Remove extra fdt_fixup_ethernet() call")
> >
> > I would just revert that commit. The function mentionned in the commit
> > log is platform specific, it just doesn't make any sense to remove
> > some generic code just because it would work on your platform.
>
> The Generic code was both added later and wrong so no need to restore that.
>
> One could remove the platform specific code and add back a generic one but then
> make sure it is called BEFORE any board setup.
OK, let me see if I can come up with something then, test patch shortly.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170428/a0e58785/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-28 12:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28 7:33 [U-Boot] [PATCH] sunxi: Explicitly call fdt_fixup_ethernet() in our ft_board_setup() Chen-Yu Tsai
2017-04-28 9:05 ` Maxime Ripard
2017-04-28 11:24 ` Tom Rini
2017-04-28 11:37 ` Joakim Tjernlund
2017-04-28 12:36 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox