diff options
author | Arnd Bergmann <arnd@arndb.de> | 2023-04-14 14:04:03 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2023-04-14 14:04:03 +0200 |
commit | a8739ac16342d49b6276ccdc85a133df8d8fde4f (patch) | |
tree | ce9b8a68bcd25848d8d51e1a5bce66679c739994 /arch/arm/mach-imx | |
parent | 27994cb07cca9203e9d5d6b9465e1e193ec0889a (diff) | |
parent | 614bef7e2727f35ff7edb7f41354e4e5c655590c (diff) | |
download | lwn-a8739ac16342d49b6276ccdc85a133df8d8fde4f.tar.gz lwn-a8739ac16342d49b6276ccdc85a133df8d8fde4f.zip |
Merge tag 'imx-soc-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/arm
i.MX SoC changes for 6.4:
- A couple of changes from Oleksij Rempel which make it possible
to configure Ethernet refclock from device tree.
- Use common DT helpers to test DT property presence and read boolean
properties.
* tag 'imx-soc-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
ARM: imx: Use of_property_read_bool() for boolean properties
ARM: mxs: Use of_property_present() for testing DT property presence
ARM: mach-imx: imx6ul: remove not optional ethernet refclock overwrite
ARM: imx6q: skip ethernet refclock reconfiguration if enet_clk_ref is present
Link: https://lore.kernel.org/r/20230408101928.280271-2-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/gpc.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6ul.c | 20 |
3 files changed, 10 insertions, 22 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index ebc4339b8be4..5909088d5482 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -275,7 +275,7 @@ void __init imx_gpc_check_dt(void) if (WARN_ON(!np)) return; - if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { + if (WARN_ON(!of_property_read_bool(np, "interrupt-controller"))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); /* map GPC, so that at least CPUidle and WARs keep working */ diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index c9d7c29d95e1..7f6200925752 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -79,7 +79,7 @@ static void __init imx6q_enet_phy_init(void) static void __init imx6q_1588_init(void) { struct device_node *np; - struct clk *ptp_clk; + struct clk *ptp_clk, *fec_enet_ref; struct clk *enet_ref; struct regmap *gpr; u32 clksel; @@ -90,6 +90,14 @@ static void __init imx6q_1588_init(void) return; } + /* + * If enet_clk_ref configured, we assume DT did it properly and . + * clk-imx6q.c will do needed configuration. + */ + fec_enet_ref = of_clk_get_by_name(np, "enet_clk_ref"); + if (!IS_ERR(fec_enet_ref)) + goto put_node; + ptp_clk = of_clk_get(np, 2); if (IS_ERR(ptp_clk)) { pr_warn("%s: failed to get ptp clock\n", __func__); diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index dbf8d19cef11..7a0299de1db6 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -4,8 +4,6 @@ */ #include <linux/irqchip.h> #include <linux/mfd/syscon.h> -#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> -#include <linux/micrel_phy.h> #include <linux/of_platform.h> #include <linux/phy.h> #include <linux/regmap.h> @@ -16,30 +14,12 @@ #include "cpuidle.h" #include "hardware.h" -static void __init imx6ul_enet_clk_init(void) -{ - struct regmap *gpr; - - gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr"); - if (!IS_ERR(gpr)) - regmap_update_bits(gpr, IOMUXC_GPR1, IMX6UL_GPR1_ENET_CLK_DIR, - IMX6UL_GPR1_ENET_CLK_OUTPUT); - else - pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n"); -} - -static inline void imx6ul_enet_init(void) -{ - imx6ul_enet_clk_init(); -} - static void __init imx6ul_init_machine(void) { imx_print_silicon_rev(cpu_is_imx6ull() ? "i.MX6ULL" : "i.MX6UL", imx_get_soc_revision()); of_platform_default_populate(NULL, NULL, NULL); - imx6ul_enet_init(); imx_anatop_init(); imx6ul_pm_init(); } |