From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93881C433F5 for ; Sat, 11 Sep 2021 17:39:36 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E067F6109F for ; Sat, 11 Sep 2021 17:39:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E067F6109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6F1580ECB; Sat, 11 Sep 2021 19:39:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="arkkn/yf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F13B831D8; Sat, 11 Sep 2021 19:39:30 +0200 (CEST) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 42E2D8032E for ; Sat, 11 Sep 2021 19:39:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jernej.skrabec@gmail.com Received: by mail-wm1-x330.google.com with SMTP id k5-20020a05600c1c8500b002f76c42214bso3768796wms.3 for ; Sat, 11 Sep 2021 10:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=50ycPeIKxWM32FP7lw0USVE+nCVaQdzyGR+eZye/qnI=; b=arkkn/yfd+iF7v+ETb9MgD9oamYRiQ2XWwsgb0zaGlXFcNhrZd7oAU4kXNrKI/+A2E K5HNYdqARmYupu4YHEua40VQn4ZSIioBb8fvoeERBBjvM+n3Xo7nF3qVpQCjynGgAG2h jNfnF+pDg0uSrP96vgOeS0UTlx+/OnhtwdHGeGIMJBDvBOTXOB8mL/Y3LAMgHmRcQ13d 0fIxJU/9L0/LLPZ6Pdj2RQU2G1im4ON+fIDYycN9pyo51p8dBfin8pCtfmpmD8IJz+lx ddurFyAkGkyc9gJp/3qa0yfhNierMU1JfQ7ByQ2E7vrtvruPJhaar8bmedqOt8WleBnT tyzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=50ycPeIKxWM32FP7lw0USVE+nCVaQdzyGR+eZye/qnI=; b=ZPhKZyH98JYTLhId/TtQ1eGlHby2E4sjI3f9XXP8iFxnxl8L1LS8Jezp09c0jS6FJQ G0rAJQsNeyOuFl2P1Sm+2q6Go8lNka+WTqx6cfasCNU+dj8qGd9iCMf+qBAnZpSBreb0 PeKlwNU8bduCPZRNE+dM7+XbrDC7FZB2k3L1hJY1prTevEAlcOnewjNn06nkNbcH6rCH MUQyhzkgPH9mzftv+3MIRVGsh6SxcdRxLBzP9fNLj2LDqMT10D9qTcSC0ZjKNp1sKLtj Xg0JFhlOqaoth2KrIaF94uUKaOU8YXyAhSCULr77w9+orwOKcWY9lnVjEi7fPwKCn2Ut 63uA== X-Gm-Message-State: AOAM532HyAWUbouvwvrWa68mZ+CmJWAWy1dOcV2MAh2xNtpgPKDXzyLQ wqhY6JYk6+WCiVH7fYPuWxQ= X-Google-Smtp-Source: ABdhPJx9nveIZsagH/e3TUKfo2qZtbVPmU4K6vhna4zdaUPbtZqQnYoYqJuYm8u4A1+UUUOcRrzzKw== X-Received: by 2002:a7b:cd92:: with SMTP id y18mr3557430wmj.78.1631381965663; Sat, 11 Sep 2021 10:39:25 -0700 (PDT) Received: from kista.localdomain (cpe-86-58-29-253.static.triera.net. [86.58.29.253]) by smtp.gmail.com with ESMTPSA id s24sm2026936wmh.34.2021.09.11.10.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 10:39:25 -0700 (PDT) From: Jernej Skrabec To: jagan@amarulasolutions.com, andre.przywara@arm.com Cc: mripard@kernel.org, u-boot@lists.denx.de, linux-sunxi@lists.linux.dev, Icenowy Zheng , Jernej Skrabec Subject: [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases Date: Sat, 11 Sep 2021 19:39:16 +0200 Message-Id: <20210911173916.615928-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Icenowy Zheng Sometimes some ethernet aliases do not exist in U-Boot DT but they exist in the DT used to boot the system (for example, modified via DT overlays). 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 [updated commit message] Signed-off-by: Jernej Skrabec --- Hi all, this is effectively resend of: https://patchwork.ozlabs.org/project/uboot/patch/20171027093439.12414-1-icenowy@aosc.io/ On at least one board, namely BananaPi M2 Zero, adding ethernet connector is pretty popular after market modification. Since this is not something that is already present on the board, ethernet node will never be part of upstream DT. Thus, the only sensible solution is to use DT overlay, which adds node to DT (maintaining patches is tedious). However, when overlays are used, U-Boot misses injecting MAC address, as described in commit message. Please reconsider this patch for inclusion in upstream. Best regards, Jernej 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 1a46100e408d..97554d4642ed 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -997,10 +997,12 @@ int ft_board_setup(void *blob, struct bd_info *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); bluetooth_dt_fixup(blob); -- 2.33.0