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 C4C50C77B78 for ; Wed, 26 Apr 2023 16:07:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5397A863E6; Wed, 26 Apr 2023 18:05:46 +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="NvNH4K70"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADF25863BF; Wed, 26 Apr 2023 18:05:38 +0200 (CEST) Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) (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 43EA58636B for ; Wed, 26 Apr 2023 18:05:36 +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-oa1-x35.google.com with SMTP id 586e51a60fabf-188090ebf84so1146455fac.1 for ; Wed, 26 Apr 2023 09:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682525136; x=1685117136; 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=LhZ6G6t2Tb7iE9Ad1DVpowFz5gqYDMXDEYRyT45Owm0=; b=NvNH4K709HfxxCMpjgtUJLVwdnwW2gLU6oIlCQHEGhXJZ8+IJzi0LAUNza4GxdpPUF 0cJKogBuYo7dIhJomUlxNzpurjypyaIRNobjhw7TUc9nigJLSc8Fr7HFs9sscQqvHzHy pDhXLC3VdZIEXDLfoMPxm+F/ClobckacXXEZdkUR7Hv400+Qz7/auZovQ7URwC10FS9A 0ZnMezTLSeVxceog9nr1x/oYUBByMrVy6m20ZBNokjsshnbrhZAJh7SfxQxZ12BVHsS2 irA4OIijRAH92mra3tx7y3TfyqQajmx0FQPG5Nc5gZjmxcLoiY4JYiPfsOKPzviHLNe/ rnvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682525136; x=1685117136; 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=LhZ6G6t2Tb7iE9Ad1DVpowFz5gqYDMXDEYRyT45Owm0=; b=bSzKyODVkz1XzmHqj1K530uA7Rn0q50js88hh/P1uLIb0jbj5VNwbUzhpOpgtAAopq ZlNNauRH66fUOgWbsynnhHXaFKbtDKaiboeXU8vJ2XFgo+kBaWTg3RCk4Q3aRJlFo4cX OJ2RQBIcALftIRDDUN8DKK6vZW8SWDHqtPghGabH3XfiUoXOp6B7mhAGIophoc4RCJGo eWDkNfzT97dlYtejCIRKIQ5WA2TsQy29zNeE35QOnqOLd9eN5xwyN4EDh4nZetaw3GSy CIuGdbS++QvlmPw/rX9W+XtlMJgbgzmCDioocBjU5IcjPvnJJE6c/543BrpYJWhA42uw p6cA== X-Gm-Message-State: AAQBX9cBIRdCZN3gLKKWG1g6KOcdxXTr+E+oKW8NeZ0/I5IIcWhm9QPI CG14CipIIox/mBnfHt0F9rM= X-Google-Smtp-Source: AKy350ZGGNwMb206ggZ74h7orz4O1gD1nSHnWzmatAruDWEUxik47GOsW8ABFbeD2S7wEbxxcVC7wg== X-Received: by 2002:a05:6870:2194:b0:18e:1d73:1022 with SMTP id l20-20020a056870219400b0018e1d731022mr12217917oae.2.1682525135755; Wed, 26 Apr 2023 09:05:35 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:f6e1:8741:de7a:38fc]) by smtp.gmail.com with ESMTPSA id u2-20020a05687036c200b00177c314a358sm6755325oak.22.2023.04.26.09.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 09:05:35 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Cc: eduard@lionizers.com, u-boot@lists.denx.de, Fabio Estevam Subject: [PATCH v5 11/14] smegw01: Read the second MAC address Date: Wed, 26 Apr 2023 13:04:58 -0300 Message-Id: <20230426160501.1199085-11-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426160501.1199085-1-festevam@gmail.com> References: <20230426160501.1199085-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 v4: - 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; } -- 2.34.1