From patchwork Fri Oct 27 09:34:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 831153 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yNdyx4Q8Kz9t2h for ; Fri, 27 Oct 2017 20:35:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C2967C21CEC; Fri, 27 Oct 2017 09:35:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9821BC21C4E; Fri, 27 Oct 2017 09:35:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A5BA9C21C4E; Fri, 27 Oct 2017 09:35:28 +0000 (UTC) Received: from cockroach.ash.relay.mailchannels.net (cockroach.ash.relay.mailchannels.net [23.83.222.37]) by lists.denx.de (Postfix) with ESMTPS id 5A5C3C21C46 for ; Fri, 27 Oct 2017 09:35:22 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 724FB5C1E6C; Fri, 27 Oct 2017 09:35:17 +0000 (UTC) Received: from hermes.aosc.io (unknown [100.96.131.5]) (Authenticated sender: lmn-TZDUIOWCRQMW) by relay.mailchannels.net (Postfix) with ESMTPA id CC8DC5C20DC; Fri, 27 Oct 2017 09:35:16 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from hermes.aosc.io (hermes.aosc.io [172.20.88.133]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.14); Fri, 27 Oct 2017 09:35:17 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io X-MailChannels-Auth-Id: lmn-TZDUIOWCRQMW X-Invention-Robust: 43c6e37f5ede736d_1509096917212_1005991272 X-MC-Loop-Signature: 1509096917212:2501762701 X-MC-Ingress-Time: 1509096917211 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id D3BEB4BF8F; Fri, 27 Oct 2017 09:35:12 +0000 (UTC) From: Icenowy Zheng To: Jagan Teki , Maxime Ripard Date: Fri, 27 Oct 2017 17:34:39 +0800 Message-Id: <20171027093439.12414-1-icenowy@aosc.io> Cc: u-boot@lists.denx.de, Icenowy Zheng Subject: [U-Boot] [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Sometimes some ethernet aliases do not exist in U-Boot FDT but they exist in the FDT used to boot the system. In this situation setup_environment is called again in ft_board_setup to generate macaddr environment variable for them. However now the call to fdt_fixup_ethernet is moved before the call of ft_board_setup. Call fdt_fixup_ethernet again to add MAC addresses for the extra ethernet aliases. Signed-off-by: Icenowy Zheng --- board/sunxi/board.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 6e13ee32c1..616a5f77f0 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -745,10 +745,12 @@ int ft_board_setup(void *blob, bd_t *bd) int __maybe_unused r; /* - * Call setup_environment again in case the boot fdt has - * ethernet aliases the u-boot copy does not have. + * Call setup_environment and fdt_fixup_ethernet again + * in case the boot fdt has ethernet aliases the u-boot + * copy does not have. */ setup_environment(blob); + fdt_fixup_ethernet(blob); #ifdef CONFIG_VIDEO_DT_SIMPLEFB r = sunxi_simplefb_setup(blob);