public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: <u-boot@lists.denx.de>
Cc: Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	"Padmarao Begari" <padmarao.begari@microchip.com>,
	Conor Dooley <conor.dooley@microchip.com>
Subject: [PATCH v1 3/3] board: microchip: set mac address for ethernet1 on icicle
Date: Wed, 7 Jun 2023 11:06:14 +0100	[thread overview]
Message-ID: <20230607-boneless-evaluator-e681ce74deef@wendy> (raw)
In-Reply-To: <20230607-sandlot-utility-0304dcbdaf43@wendy>

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 <conor.dooley@microchip.com>
---
 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


  parent reply	other threads:[~2023-06-07 10:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 10:06 [PATCH v1 0/3] Sync PolarFire SoC dts with Linux Conor Dooley
2023-06-07 10:06 ` [PATCH v1 1/3] riscv: dts: drop microchip from dts filenames Conor Dooley
     [not found]   ` <SEZPR03MB80645427881E88E85F252B4EC155A@SEZPR03MB8064.apcprd03.prod.outlook.com>
2023-06-13  0:41     ` Rick Chen
2023-06-13  5:29   ` Padmarao.Begari
2023-06-07 10:06 ` [PATCH v1 2/3] riscv: dts: sync mpfs-icicle devicetree with linux Conor Dooley
2023-06-13  5:31   ` Padmarao.Begari
2023-06-07 10:06 ` Conor Dooley [this message]
2023-06-13  5:35   ` [PATCH v1 3/3] board: microchip: set mac address for ethernet1 on icicle Padmarao.Begari
2023-06-14  7:05     ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230607-boneless-evaluator-e681ce74deef@wendy \
    --to=conor.dooley@microchip.com \
    --cc=padmarao.begari@microchip.com \
    --cc=rick@andestech.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox