Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 16043C77B61 for ; Mon, 24 Apr 2023 11:14:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BEA8886157; Mon, 24 Apr 2023 13:13:02 +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="KQfoycRS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD571860A8; Mon, 24 Apr 2023 13:12:45 +0200 (CEST) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (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 CC954860FC for ; Mon, 24 Apr 2023 13:12:40 +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-oi1-x232.google.com with SMTP id 5614622812f47-38e0a37594eso44740b6e.0 for ; Mon, 24 Apr 2023 04:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682334759; x=1684926759; 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=TLkxQiJJNdSCojz5lyWh/8R2EAxyggMOMia+bRH445Q=; b=KQfoycRSGu0yBwyK7q6mma5FBo2YlFrTPd0PLGIin8q1opiLOl9cgYNhd8QSH6IEFt wM0n48kHfrEWmCWk9k3qgbeQvA8l5Tt7XCjUbKPwUFj/Uz8Twf9G3XjKb8OvD701jRhe AMqgqw7WhSOj/5P4q+Dxrv6AGSRIuD68YcobIpo4SXsyzBL3gRYNDQ+ILcE/fVja6CIJ W7JTEkSloGabSZQ0m8d5gMekWLrLAk1axAe5Xg/A/mGOgcQlkFMVxBkLE+FHxEMhUg9M mEurJq150GymfAQHEx7810js3RxPeF9cc4pxmymQmSSLSJqzuXu6vxsRolVZTmSZ6R+x Iz5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682334759; x=1684926759; 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=TLkxQiJJNdSCojz5lyWh/8R2EAxyggMOMia+bRH445Q=; b=L40r2fhpLbx+bHMNS4kVBU0MJvW8P7uqrnyGjC4R7INdQHbrAP9iGTaXxsbZdwaZn6 3Smw5JFHTrLXr3C5AfteI3qw3uc50Ub68IPPbfaGILv62Gim8Kxi19PGbD4ufOjR6wy4 QiF0xCSc23tmHh9ZvY4QMMVwrV/40u/Y4zTYB76nBRIk6e0v4Q9Q3y+ocbuu/62vN8bW Q5L/I+RZWdlurwvi4SA773ZmaWwPPgCasz6DTpEm90/+6J+CyQLhEDMM0i4B1aEGLhw/ bxZCOqELs1JO7iLWv3XwJIC3hbPc+xh29BFnYbCR3g1AVGnSIeIXIZETZmPg4X948vPJ 93pA== X-Gm-Message-State: AAQBX9coVtzx7RBH+Vow1CdFba8GCMwiYwdBqNdl9Zfwowkbf4rQuK4P Lc8EZpD3faVie9LjrMl4MXCJnn+SFm+2LQ== X-Google-Smtp-Source: AKy350bx51nMEwhCl75yFTSIW5JTsOKIKn/wCet0l0bmfgFH/gh9f1qiCnP35VOZ7AxiZNXAOHKB6w== X-Received: by 2002:a4a:e04c:0:b0:547:12df:5daa with SMTP id v12-20020a4ae04c000000b0054712df5daamr7065792oos.1.1682334757530; Mon, 24 Apr 2023 04:12:37 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:1d84:e533:11fa:26c6]) by smtp.gmail.com with ESMTPSA id 27-20020a4ae1bb000000b00541fbbbcd31sm2294678ooy.5.2023.04.24.04.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 04:12:36 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Cc: eduard@lionizers.com, u-boot@lists.denx.de, Fabio Estevam Subject: [PATCH v3 11/13] smegw01: Read the second MAC address Date: Mon, 24 Apr 2023 08:12:04 -0300 Message-Id: <20230424111206.1438983-11-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230424111206.1438983-1-festevam@gmail.com> References: <20230424111206.1438983-1-festevam@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v2: - Fixed typo in the Subject "smegw01". 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 e786429476..605253ead3 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; } -- 2.38.1