From patchwork Wed Apr 26 13:25:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1774120 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=FSjod6jI; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q607F7591z23vH for ; Wed, 26 Apr 2023 23:28:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EEBA863AE; Wed, 26 Apr 2023 15:26: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="FSjod6jI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4805686395; Wed, 26 Apr 2023 15:26:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 125F8863B0 for ; Wed, 26 Apr 2023 15:26:11 +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=festevam@gmail.com Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6a603577a89so1511945a34.0 for ; Wed, 26 Apr 2023 06:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682515570; x=1685107570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SFPRmNhWeztfd0MT6ESJswI3luvzsIejbWVrqPRNiZw=; b=FSjod6jIgQy914EO9KmeSqLfBGamyBu7vyAdojeQvb3okkJ88OHgzVOSybrptaLRnu 5CqQgfULZ9lHM7ocVslqae7RavBHvNv3qdQG5GjieJa1TM4WndpUPoZlGwucGKqwSZ2H o/uisycKTgRSDMTJsRcJoDjxxyn1HpUee6m0bgaVlt00xVjLlVz4wwAY1cIcZYZ3o+zb 209U+XYfitEw3zLJoBOYVm+YJr4TJgKUO6WFP59wy0CYGY9RKWJdSO7XDfyLNm3aJ4qX EgZGE7fprMG+5+7DIYjzWqmj3nqdySRU12YIaVdVUYPpyWRqVpm5Z8/VEjXhPSUdH7qy oNhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682515570; x=1685107570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SFPRmNhWeztfd0MT6ESJswI3luvzsIejbWVrqPRNiZw=; b=YmGUfPb0YNRSTYKwEc75/cnWVXp7/rxIUyj7Ffp75/X7o2T3EcnUFrMtlF2XFWmyH0 ROcexYyFpGVZhm4PyWADv/3zOdppJmFbu2TZdTMOXZoomY615faYe8TSPcJW5dhqicHq RHR1ZPPDLRyTMxqcNIKOmabD0yG65Yv5NhbYRkbiNp7HULo4vxzQDrL1Ddg/MmOeCSPv DiBbdpkvGubIo0p1Z/YrkUbUKnLsJSmBXBh6yQ9hzXDlGX1jyc+mUTKrXQJLPHwOtZs7 25kQAEZ8hxlHcU1Fm7o+F3sE6XNdAwi6ERIWAz6JsPSxzlZT4Uar45+rHE+abSSnaJXz dr3g== X-Gm-Message-State: AAQBX9evtCTBQUb5nI9xi5dacEYBy/OnEs80+5C++S9ehpufD6/VM/Wd 7PTOWuS5WdqMnF3tr/tz58c= X-Google-Smtp-Source: AKy350aDDzz5SyQ8m/5B04+VP35C5+aVgG3bVzGhvrOe7GRIPMmonbq6ZQOkQCGKjdfkYm+xK5mQeQ== X-Received: by 2002:a05:6830:1c68:b0:6a5:e455:fa03 with SMTP id o40-20020a0568301c6800b006a5e455fa03mr10455163otg.2.1682515570592; Wed, 26 Apr 2023 06:26:10 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:f6e1:8741:de7a:38fc]) by smtp.gmail.com with ESMTPSA id h9-20020a056830164900b006a61bef7968sm6762384otr.53.2023.04.26.06.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 06:26:10 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Cc: eduard@lionizers.com, u-boot@lists.denx.de, Fabio Estevam Subject: [PATCH v4 11/14] smegw01: Read the second MAC address Date: Wed, 26 Apr 2023 10:25:30 -0300 Message-Id: <20230426132533.1145591-11-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426132533.1145591-1-festevam@gmail.com> References: <20230426132533.1145591-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean From: Fabio Estevam Currently, only the first MAC address is read from the fuses. The second MAC address is not read and Linux assigns a random one. To prevent this behavior, read the second MAC address from the fuses and store it into the eth1addr environment variable so that it can be passed to Linux. Signed-off-by: Fabio Estevam --- Changes since v3: - None board/storopack/smegw01/smegw01.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/storopack/smegw01/smegw01.c b/board/storopack/smegw01/smegw01.c index e648b196b9d1..20c09700bf0d 100644 --- a/board/storopack/smegw01/smegw01.c +++ b/board/storopack/smegw01/smegw01.c @@ -82,6 +82,7 @@ int board_init(void) int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; + unsigned char eth1addr[6]; imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads)); @@ -93,6 +94,11 @@ int board_late_init(void) */ clrsetbits_le16(&wdog->wcr, 0, 0x10); + /* Get the second MAC address */ + imx_get_mac_from_fuse(1, eth1addr); + if (!env_get("eth1addr") && is_valid_ethaddr(eth1addr)) + eth_env_set_enetaddr("eth1addr", eth1addr); + return 0; }