All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: sbabic@denx.de
Cc: festevam@gmail.com, u-boot@lists.denx.de, uboot-imx@nxp.com,
	Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 5/6] imx8m: soc: drop phy-reset-gpios for fec
Date: Thu,  7 Apr 2022 15:55:55 +0800	[thread overview]
Message-ID: <20220407075556.16814-6-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20220407075556.16814-1-peng.fan@oss.nxp.com>

From: Peng Fan <peng.fan@nxp.com>

Need to drop phy-reset-gpios before booting linux, this property
is legacy property and replaced with reset-gpios.

If provide both, kernel would failed to request the same gpio twice
and cause fec not work.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/imx8m/soc.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index e76d75269d7..5a6872dda61 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -1148,36 +1148,36 @@ static int disable_cpu_nodes(void *blob, u32 disabled_cores)
 	return 0;
 }
 
-#if defined(CONFIG_IMX8MM)
 static int cleanup_nodes_for_efi(void *blob)
 {
-	static const char * const usbotg_path[] = {
-		"/soc@0/bus@32c00000/usb@32e40000",
-		"/soc@0/bus@32c00000/usb@32e50000"
-		};
+	static const char * const path[][2] = {
+		{ "/soc@0/bus@32c00000/usb@32e40000", "extcon" },
+		{ "/soc@0/bus@32c00000/usb@32e50000", "extcon" },
+		{ "/soc@0/bus@30800000/ethernet@30be0000", "phy-reset-gpios" },
+		{ "/soc@0/bus@30800000/ethernet@30bf0000", "phy-reset-gpios" }
+	};
 	int nodeoff, i, rc;
 
-	for (i = 0; i < ARRAY_SIZE(usbotg_path); i++) {
-		nodeoff = fdt_path_offset(blob, usbotg_path[i]);
+	for (i = 0; i < ARRAY_SIZE(path); i++) {
+		nodeoff = fdt_path_offset(blob, path[i][0]);
 		if (nodeoff < 0)
 			continue; /* Not found, skip it */
-		debug("Found %s node\n", usbotg_path[i]);
+		debug("Found %s node\n", path[i][0]);
 
-		rc = fdt_delprop(blob, nodeoff, "extcon");
+		rc = fdt_delprop(blob, nodeoff, path[i][1]);
 		if (rc == -FDT_ERR_NOTFOUND)
 			continue;
 		if (rc) {
 			printf("Unable to update property %s:%s, err=%s\n",
-			       usbotg_path[i], "extcon", fdt_strerror(rc));
+			       path[i][0], path[i][1], fdt_strerror(rc));
 			return rc;
 		}
 
-		printf("Remove %s:%s\n", usbotg_path[i], "extcon");
+		printf("Remove %s:%s\n", path[i][0], path[i][1]);
 	}
 
 	return 0;
 }
-#endif
 
 int ft_system_setup(void *blob, struct bd_info *bd)
 {
@@ -1273,8 +1273,6 @@ usb_modify_speed:
 	else if (is_imx8mms() || is_imx8mmsl())
 		disable_cpu_nodes(blob, 3);
 
-	cleanup_nodes_for_efi(blob);
-
 #elif defined(CONFIG_IMX8MN)
 	if (is_imx8mnl() || is_imx8mndl() ||  is_imx8mnsl())
 		disable_gpu_nodes(blob);
@@ -1322,6 +1320,7 @@ usb_modify_speed:
 		disable_cpu_nodes(blob, 2);
 #endif
 
+	cleanup_nodes_for_efi(blob);
 	return 0;
 }
 #endif
-- 
2.35.1


  parent reply	other threads:[~2022-04-07  7:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  7:55 [PATCH 0/6] imx8mp: misc update Peng Fan (OSS)
2022-04-07  7:55 ` [PATCH 1/6] imx: imx8mp: Add iMX8MP UltraLite Part cpu type Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-07  7:55 ` [PATCH 2/6] imx: imx8mp: detect i.MX8MP UltraLite when get cpu rev Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-07  7:55 ` [PATCH 3/6] imx: imx8mp: disable fused IP for UltraLite Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-07  7:55 ` [PATCH 4/6] imx: imx8m: soc: runtime drop extcon property from usbotg node Peng Fan (OSS)
2022-04-12 18:41   ` sbabic
2022-04-07  7:55 ` Peng Fan (OSS) [this message]
2022-04-12 18:45   ` [PATCH 5/6] imx8m: soc: drop phy-reset-gpios for fec sbabic
2022-04-07  7:55 ` [PATCH 6/6] imx8m: soc: Relocate u-boot to the top DDR in 4GB space Peng Fan (OSS)
2022-04-12 18:42   ` sbabic

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=20220407075556.16814-6-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.