diff options
author | Peng Fan <peng.fan@nxp.com> | 2021-05-26 17:44:41 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2022-04-06 18:04:31 +0800 |
commit | 301db6b357a62de23cf41081afe3064f465aa1b9 (patch) | |
tree | 91d87ad71a2979281a2af687eb193e41a0d87130 /arch/arm/mach-imx/imx8m | |
parent | 9c8f6a02686457e4898983a4308a5f5e4006666d (diff) |
LF-3898-3 imx: imx8m: soc: runtime drop extcon property from usbotg node
The extcon is an decrepted property and not used by upstream Linux and
NXP 5.10 kernel, so we remove it before kicking linux in case it is in
dts. Otherwise distro kernel will not able to have usb function.
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 929b72a960a925ca429d04de770ffe7eb0c968df)
Diffstat (limited to 'arch/arm/mach-imx/imx8m')
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 69ef645023..2e4b70a405 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1131,6 +1131,37 @@ 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" + }; + int nodeoff, i, rc; + + for (i = 0; i < ARRAY_SIZE(usbotg_path); i++) { + nodeoff = fdt_path_offset(blob, usbotg_path[i]); + if (nodeoff < 0) + continue; /* Not found, skip it */ + debug("Found %s node\n", usbotg_path[i]); + + rc = fdt_delprop(blob, nodeoff, "extcon"); + 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)); + return rc; + } + + printf("Remove %s:%s\n", usbotg_path[i], "extcon"); + } + + return 0; +} +#endif + int ft_system_setup(void *blob, struct bd_info *bd) { #ifdef CONFIG_IMX8MQ @@ -1225,6 +1256,8 @@ 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); |