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.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmQxHpoUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7V+AgArHo+ztgKv4vCde0GanzBpRmxdJRd
 oE/DJzIXgbWM4yajJm25x7LQV02atxU2+ssw17/x/Ac2xMXg6NPkBrqXlyylbJQG
 +a8k/qX7pBipM3vjlIxJGBf3+BNCYDP/QPRemSQzmOY8kydGfympT0Ck/kuWsEca
 FsAe77W4WpcEBQcB/dj5D33K+kr6bkkEwm1Ip07taR1KFUpFNB3FV7CD8rXa1LHn
 SyFxk5SfdQZhuCArwZwUQjc6ZxJInECG8PBqfMSGOX/ueoByAY5I4GHB4GWRv0BD
 j7N2C/Eg9hvbKWJ+ErlPuqB/H2gVhncAYIwHzdlKyZTN3jN/ztuQ7JQhTg==
 =MjV8
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmQ5QTMACgkQYKtH/8kJ
 UidRzQ//d5rDB1e9SnXYHaStyDeJh/41nGL6PvAZYEWeejpnwT64Yu9UC0dNeU9g
 95LMsXYXwacxOeWby42u7e30Gt3KmPWWSNHGEczTceZjgcN8rAx6sbPSBWZJ+5k5
 wpyZBL/P2pNSEqZqLkg31UPIfWo/XZ0PIG1iZdjj1UCgeFkUb8dTXO3jMbKka4x0
 TNdof1aqLzGvtMcyiwY8BprW//NwDLo9wXWbhQOv00n5EhL2gBDnqrHYPm58H5AS
 uMMIYnu0+4VdH93ZHFQW5uL4aiKaaPA1yWHrnZ4H5oEMBAmqkyb/5VKfH56X7UaP
 XOG2dX5bL3CxQ4/DHTt58mjimDDfB9tMoCDyeRUHl+BZQ7QwAZaq9kCgK7smdhK0
 aEcSXw/yUXZFBU3gOqVdJFq++zpUR7ntnzgXABUAhYWch1dKWwW/uuCQ3YhDsB6U
 WO8nhDeeSl91/vnKCPGPIIZ3uF7FEHpAgK9Ork8lOmROHQtt33kDpaVemp9Ujxg2
 slEzaU9RYL07AJRlsWUrE5glCxixPyDyRS0URc5bh+dWG+X9m+HyUc7sPR57ESnS
 J62yEbk/3ZpH/O4op5GgciCIijqt5ZtAdmHA/UgNXFDMhrIU/8u982GwgPjvrLnR
 y5dwH1T9HYkqDpg3MpcQzCg+otHTeo8jxmLYwCAjRafFfBq0CZM=
 =G9TP
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Arnd Bergmann 2023-04-14 14:04:03 +02:00
commit a8739ac163
4 changed files with 11 additions and 23 deletions

View file

@ -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 */

View file

@ -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__);

View file

@ -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();
}

View file

@ -174,7 +174,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
from = np;
if (of_get_property(np, "local-mac-address", NULL))
if (of_property_present(np, "local-mac-address"))
continue;
newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);