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 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 6E2DEC7EE2E for ; Wed, 7 Jun 2023 10:07:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F20A8608C; Wed, 7 Jun 2023 12:07:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.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=microchip.com header.i=@microchip.com header.b="odzDzWt7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3AD6D8608C; Wed, 7 Jun 2023 12:07:23 +0200 (CEST) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E192786074 for ; Wed, 7 Jun 2023 12:07:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Conor.Dooley@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1686132440; x=1717668440; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YIBWl5bPJRuTOQGMhxxSguATqu+nmd3ir5UU5S6dsBM=; b=odzDzWt7zWvMIqfVz50+qMP1ZMtvKrkzV/auR39iRrfszsz50Z8R7W6Y +Hj8k3vwMJC9QO/kkaywbW8vfomWbpVVT4E087WcLGYPOewfB5isNwbtT 1gDrPMhBayY8NhfjSioG0yO7kLiT3j1RiEoeSf3db2bqFPKyaEPC8Pm+m 3QHMaN3Qbbg6VEOY79/BcALpLLY7TEImJHYgvjdjWGeIVZVnI0NYMmLdV h/+WjGN4uEZ062UJnfR/bpNfbJTTl1p/JpRxcs8Ik6Ox0se1tLwMaoC5v q32DWtiBiMwBi7u7AXrrX40g8sX7gY6Q2qDUNuUGOowDNvZLaGNe18Xma w==; X-IronPort-AV: E=Sophos;i="6.00,223,1681196400"; d="scan'208";a="215008993" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Jun 2023 03:07:18 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 7 Jun 2023 03:06:59 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Wed, 7 Jun 2023 03:06:58 -0700 From: Conor Dooley To: CC: Rick Chen , Leo , "Padmarao Begari" , Conor Dooley Subject: [PATCH v1 3/3] board: microchip: set mac address for ethernet1 on icicle Date: Wed, 7 Jun 2023 11:06:14 +0100 Message-ID: <20230607-boneless-evaluator-e681ce74deef@wendy> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607-sandlot-utility-0304dcbdaf43@wendy> References: <20230607-sandlot-utility-0304dcbdaf43@wendy> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2026; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=YIBWl5bPJRuTOQGMhxxSguATqu+nmd3ir5UU5S6dsBM=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDCkNYVPfWjaKHtPQSJphPvEvb6XGpFmy07zT7G61XnvQM2fD v2WuHaUsDGIcDLJiiiyJt/tapNb/cdnh3PMWZg4rE8gQBi5OAZjIjSWMDFc2zLz+vlv67NLpFydxXt Xefd3d8+7xnWtLbkz1kTWbbynEyLDuI3u/5OarzDb7lsnv3DR1p6Smh5DE+w4P70Pb58dIP+UBAA== X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 The dts sync from Linux leaves mac0/ethernet1 enabled on icicle, but U-Boot does not currently set a mac address for it. Expand on the code which currently sets the mac for mac1/ethernet0 to optionally set the mac address for the second ethernet. Signed-off-by: Conor Dooley --- board/microchip/mpfs_icicle/mpfs_icicle.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c index e74c9fb03c..b4072acb18 100644 --- a/board/microchip/mpfs_icicle/mpfs_icicle.c +++ b/board/microchip/mpfs_icicle/mpfs_icicle.c @@ -80,7 +80,7 @@ int board_late_init(void) char icicle_mac_addr[20]; void *blob = (void *)gd->fdt_blob; - node = fdt_path_offset(blob, "ethernet0"); + node = fdt_path_offset(blob, "/soc/ethernet@20112000"); if (node < 0) { printf("No ethernet0 path offset\n"); return -ENODEV; @@ -88,7 +88,7 @@ int board_late_init(void) ret = fdtdec_get_byte_array(blob, node, "local-mac-address", mac_addr, 6); if (ret) { - printf("No local-mac-address property\n"); + printf("No local-mac-address property for ethernet@20112000\n"); return -EINVAL; } @@ -104,7 +104,7 @@ int board_late_init(void) ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6); if (ret) { - printf("Error setting local-mac-address property\n"); + printf("Error setting local-mac-address property for ethernet@20112000\n"); return -ENODEV; } @@ -123,6 +123,15 @@ int board_late_init(void) mac_addr[5] = device_serial_number[0] + 1; + node = fdt_path_offset(blob, "/soc/ethernet@20110000"); + if (node >= 0) { + ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6); + if (ret) { + printf("Error setting local-mac-address property for ethernet@20112000\n"); + return -ENODEV; + } + } + icicle_mac_addr[0] = '['; sprintf(&icicle_mac_addr[1], "%pM", mac_addr); -- 2.40.1