summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/protonic-imx6
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2020-12-04 11:20:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-12-07 10:38:33 +0100
commitd1e7a74b97fdb73936fecd4e07c2d32bbd2fd420 (patch)
tree100f25ac079ac02be515e90edb517f4397154b20 /arch/arm/boards/protonic-imx6
parentb68c3dddf74e89d88a7f4a8b30b45f547368ec0f (diff)
downloadbarebox-d1e7a74b97fdb73936fecd4e07c2d32bbd2fd420.tar.gz
barebox-d1e7a74b97fdb73936fecd4e07c2d32bbd2fd420.tar.xz
ARM i.MX6Q: fix network configuration for Protonic PRTI6G board
By default the iMX6UL is configured to output clock on the ENET1_TX_CLK pin. Since on the Protonic PRTI6G board the PHY is actual refclock provider, we should change the clock source to the external clock. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/protonic-imx6')
-rw-r--r--arch/arm/boards/protonic-imx6/board.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c
index daae9a527c..a718d54df4 100644
--- a/arch/arm/boards/protonic-imx6/board.c
+++ b/arch/arm/boards/protonic-imx6/board.c
@@ -11,8 +11,11 @@
#include <i2c/i2c.h>
#include <mach/bbu.h>
#include <mach/imx6.h>
+#include <mfd/imx6q-iomuxc-gpr.h>
+#include <mfd/syscon.h>
#include <net.h>
#include <of_device.h>
+#include <regmap.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -577,6 +580,27 @@ static int prt_imx6_init_victgo(struct prt_imx6_priv *priv)
return prt_imx6_init_kvg_power(priv, PW_MODE_KVG_NEW);
}
+static int prt_imx6_init_prti6g(struct prt_imx6_priv *priv)
+{
+ struct regmap *gpr;
+
+ gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr");
+ if (!IS_ERR(gpr)) {
+ int ret;
+
+ /* Configure FEC1 to use 50MHz clock provided by the PHY */
+ ret = regmap_update_bits(gpr, IOMUXC_GPR1,
+ IMX6UL_GPR1_ENET1_CLK_DIR | IMX6UL_GPR1_ENET1_CLK_SEL,
+ IMX6UL_GPR1_ENET1_CLK_SEL);
+ if (ret)
+ dev_err(priv->dev, "regmap error\n");
+ } else {
+ dev_err(priv->dev, "failed to find fsl,imx6ul-iomux-gpr regmap\n");
+ }
+
+ return 0;
+}
+
static int prt_imx6_init_kvg_new(struct prt_imx6_priv *priv)
{
return prt_imx6_init_kvg_power(priv, PW_MODE_KVG_NEW);
@@ -923,6 +947,7 @@ static const struct prt_machine_data prt_imx6_cfg_prti6g[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .init = prt_imx6_init_prti6g,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX