Skip to contentSkip to conversation

i.MX6: Engicam fixes/updates

PATCH New Jagan Teki 3 participants 13 messages Dec 30, 2019 – Jan 3, 2020

Subsystems (4)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

cover i.MX6: Engicam fixes/updates

Series of patches that fixes dt and board changes in i.MX6 based Engicam board.

Any inputs?
Jagan.

Jagan Teki (3):
dt-bindings: sound: Add fsl-imx-audmux.h from v5.4
ARM: dts: icorem6: Sync engicam device trees from v5.4
ARM: dts: imx6q-icore-mipi: Use 1.5 version of i.Core MX6DL

Michael Trimarchi (5):
board: engicam: Cleanup fdt file and board mapping
board: engicam: Fix the ethernet clock initialization
configs: imx6-engicam: Drop fec phy address and mode
ARM: dts: imx6qdl-icore-1.5: Remove duplicate phy reset methods
ARM: dts: imx6qdli-icore: Add fec phy-handle

 arch/arm/dts/imx6dl-icore-mipi.dts         |  13 +-
 arch/arm/dts/imx6dl-icore-rqs.dts          |  43 +--
 arch/arm/dts/imx6dl-icore.dts              |  47 +--
 arch/arm/dts/imx6q-icore-mipi.dts          |  19 +-
 arch/arm/dts/imx6q-icore-ofcap10.dts       |  40 +++
 arch/arm/dts/imx6q-icore-ofcap12.dts       |  43 +++
 arch/arm/dts/imx6q-icore-rqs.dts           |  43 +--
 arch/arm/dts/imx6q-icore.dts               |  72 +++--
 arch/arm/dts/imx6qdl-icore-1.5.dtsi        |  32 ++
 arch/arm/dts/imx6qdl-icore-rqs.dtsi        | 326 ++++++++++++++++++---
 arch/arm/dts/imx6qdl-icore.dtsi            | 270 ++++++++++++++---
 board/engicam/common/board.c               |  96 +++++-
 include/configs/imx6-engicam.h             |  11 -
 include/dt-bindings/sound/fsl-imx-audmux.h |  64 ++++
 14 files changed, 850 insertions(+), 269 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-icore-ofcap10.dts
 create mode 100644 arch/arm/dts/imx6q-icore-ofcap12.dts
 create mode 100644 arch/arm/dts/imx6qdl-icore-1.5.dtsi
 create mode 100644 include/dt-bindings/sound/fsl-imx-audmux.h
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#1 lore raw

PATCH 1/8 board: engicam: Cleanup fdt file and board mapping

From: Michael Trimarchi <[email protected]>

Make easy to map fdt file to board in order to use this information later to apply specific change to specific board combination.

---
 board/engicam/common/board.c | 67 ++++++++++++++++++++++++++++++------
 1 file changed, 56 insertions(+), 11 deletions(-)
board/engicam/common/board.c +56 -11
index e5358b47f3..992d209cbd 100644
@@ -35,35 +35,76 @@ static void mmc_late_init(void)
 }
 #endif
 
-static void setenv_fdt_file(void)
+enum engicam_boards {
+	IMX6Q_ICORE,
+	IMX6DL_ICORE,
+	IMX6Q_ICORE_MIPI,
+	IMX6DL_ICORE_MIPI,
+	IMX6Q_ICORE_RQS,
+	IMX6DL_ICORE_RQS,
+	IMX6UL_GEAM,
+	IMX6UL_ISIOT_EMMC,
+	IMX6UL_ISIOT_NAND,
+	ENGICAM_BOARDS,
+};
+
+static const char * const board_fdt_file[ENGICAM_BOARDS] = {
+	[IMX6Q_ICORE] = "imx6q-icore.dtb",
+	[IMX6DL_ICORE] = "imx6dl-icore.dtb",
+	[IMX6Q_ICORE_MIPI] = "imx6q-icore-mipi.dtb",
+	[IMX6DL_ICORE_MIPI] = "imx6dl-icore-mipi.dtb",
+	[IMX6Q_ICORE_RQS] = "imx6q-icore-rqs.dtb",
+	[IMX6DL_ICORE_RQS] = "imx6dl-icore-rqs.dtb",
+	[IMX6UL_GEAM] = "imx6ul-geam.dtb",
+	[IMX6UL_ISIOT_EMMC] = "imx6ul-isiot-emmc.dtb",
+	[IMX6UL_ISIOT_NAND] = "imx6ul-isiot-nand.dtb",
+};
+
+static int setenv_fdt_file(int board_detected)
+{
+	if (board_detected < 0 || board_detected >= ENGICAM_BOARDS)
+		return -EINVAL;
+
+	if (!board_fdt_file[board_detected])
+		return -ENODEV;
+
+	env_set("fdt_file", board_fdt_file[board_detected]);
+	return 0;
+}
+
+static enum engicam_boards engicam_board_detect(void)
 {
 	const char *cmp_dtb = CONFIG_DEFAULT_DEVICE_TREE;
 
 	if (!strcmp(cmp_dtb, "imx6q-icore")) {
 		if (is_mx6dq())
-			env_set("fdt_file", "imx6q-icore.dtb");
+			return IMX6Q_ICORE;
 		else if (is_mx6dl() || is_mx6solo())
-			env_set("fdt_file", "imx6dl-icore.dtb");
+			return IMX6DL_ICORE;
 	} else if (!strcmp(cmp_dtb, "imx6q-icore-mipi")) {
 		if (is_mx6dq())
-			env_set("fdt_file", "imx6q-icore-mipi.dtb");
+			return IMX6Q_ICORE_MIPI;
 		else if (is_mx6dl() || is_mx6solo())
-			env_set("fdt_file", "imx6dl-icore-mipi.dtb");
+			return IMX6DL_ICORE_MIPI;
 	} else if (!strcmp(cmp_dtb, "imx6q-icore-rqs")) {
 		if (is_mx6dq())
-			env_set("fdt_file", "imx6q-icore-rqs.dtb");
+			return IMX6Q_ICORE_RQS;
 		else if (is_mx6dl() || is_mx6solo())
-			env_set("fdt_file", "imx6dl-icore-rqs.dtb");
+			return IMX6DL_ICORE_RQS;
 	} else if (!strcmp(cmp_dtb, "imx6ul-geam"))
-		env_set("fdt_file", "imx6ul-geam.dtb");
+			return IMX6UL_GEAM;
 	else if (!strcmp(cmp_dtb, "imx6ul-isiot-emmc"))
-		env_set("fdt_file", "imx6ul-isiot-emmc.dtb");
+			return IMX6UL_ISIOT_EMMC;
 	else if (!strcmp(cmp_dtb, "imx6ul-isiot-nand"))
-		env_set("fdt_file", "imx6ul-isiot-nand.dtb");
+			return IMX6UL_ISIOT_NAND;
+
+	return -EINVAL;
 }
 
 int board_late_init(void)
 {
+	enum engicam_boards board_detected = IMX6Q_ICORE;
+
 	switch ((imx6_src_get_boot_mode() & IMX6_BMODE_MASK) >>
 			IMX6_BMODE_SHIFT) {
 	case IMX6_BMODE_SD:
@@ -88,7 +129,11 @@ int board_late_init(void)
 	else
 		env_set("console", "ttymxc3");
 
-	setenv_fdt_file();
+	board_detected = engicam_board_detect();
+	if (board_detected < 0)
+		hang();
+
+	setenv_fdt_file(board_detected);
 
 #ifdef CONFIG_HW_WATCHDOG
 	hw_watchdog_init();
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#2 lore raw

PATCH 2/8 board: engicam: Fix the ethernet clock initialization

In reply to Jagan Teki

From: Michael Trimarchi <[email protected]>

According to the SOM and reference board the clock can be taken from the external pin or provided from ENET_REF_CLK. Add a new function that make the proper set according the board type.

---
 board/engicam/common/board.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
board/engicam/common/board.c +29 -0
index 992d209cbd..6472d382c9 100644
@@ -10,6 +10,8 @@
 #include <env.h>
 #include <init.h>
 #include <mmc.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <watchdog.h>
 
@@ -101,6 +103,32 @@ static enum engicam_boards engicam_board_detect(void)
 	return -EINVAL;
 }
 
+static int fixup_enet_clock(enum engicam_boards board_detected)
+{
+	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
+	int clk_internal = 0;
+
+	switch (board_detected) {
+	case IMX6Q_ICORE_MIPI:
+	case IMX6DL_ICORE_MIPI:
+		clk_internal = 1;
+		break;
+	default:
+		break;
+	}
+
+	/* set gpr1[21] to select anatop clock */
+	debug("fixup_enet_clock %d\n", clk_internal);
+	clrsetbits_le32(&iomuxc_regs->gpr[1], 0x1 << 21, clk_internal << 21);
+
+	if (!clk_internal) {
+		/* clock is external */
+		return 0;
+	}
+
+	return enable_fec_anatop_clock(0, ENET_50MHZ);
+}
+
 int board_late_init(void)
 {
 	enum engicam_boards board_detected = IMX6Q_ICORE;
@@ -133,6 +161,7 @@ int board_late_init(void)
 	if (board_detected < 0)
 		hang();
 
+	fixup_enet_clock(board_detected);
 	setenv_fdt_file(board_detected);
 
 #ifdef CONFIG_HW_WATCHDOG
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#3 lore raw

PATCH 3/8 configs: imx6-engicam: Drop fec phy address and mode

In reply to Jagan Teki

From: Michael Trimarchi <[email protected]>

Now all the fec related phy properties are now accessible via dts. So drop the explicit config items from common config file, imx6-engicam.h

---
 include/configs/imx6-engicam.h | 11 -----------
 1 file changed, 11 deletions(-)
include/configs/imx6-engicam.h +0 -11
index 46529a61da..18327fb4c3 100644
@@ -156,17 +156,6 @@
 /* MTD device */
 #endif
 
-/* Ethernet */
-#ifdef CONFIG_FEC_MXC
-# ifdef CONFIG_TARGET_MX6Q_ICORE_RQS
-#  define CONFIG_FEC_MXC_PHYADDR	3
-#  define CONFIG_FEC_XCV_TYPE		RGMII
-# else
-#  define CONFIG_FEC_MXC_PHYADDR	0
-#  define CONFIG_FEC_XCV_TYPE		RMII
-# endif
-#endif
-
 /* Falcon Mode */
 #ifdef CONFIG_SPL_OS_BOOT
 # define CONFIG_SPL_FS_LOAD_ARGS_NAME	"args"
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#4 lore raw

PATCH 4/8 dt-bindings: sound: Add fsl-imx-audmux.h from v5.4

In reply to Jagan Teki

Sync fsl-imx-audmux.h from v5.4 linux-next.

---
 include/dt-bindings/sound/fsl-imx-audmux.h | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 include/dt-bindings/sound/fsl-imx-audmux.h
include/dt-bindings/sound/fsl-imx-audmux.h new file +64 -0
new file mode 100644
index 0000000000..15f138bebe
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DT_FSL_IMX_AUDMUX_H
+#define __DT_FSL_IMX_AUDMUX_H
+
+#define MX27_AUDMUX_HPCR1_SSI0		0
+#define MX27_AUDMUX_HPCR2_SSI1		1
+#define MX27_AUDMUX_HPCR3_SSI_PINS_4	2
+#define MX27_AUDMUX_PPCR1_SSI_PINS_1	3
+#define MX27_AUDMUX_PPCR2_SSI_PINS_2	4
+#define MX27_AUDMUX_PPCR3_SSI_PINS_3	5
+
+#define MX31_AUDMUX_PORT1_SSI0		0
+#define MX31_AUDMUX_PORT2_SSI1		1
+#define MX31_AUDMUX_PORT3_SSI_PINS_3	2
+#define MX31_AUDMUX_PORT4_SSI_PINS_4	3
+#define MX31_AUDMUX_PORT5_SSI_PINS_5	4
+#define MX31_AUDMUX_PORT6_SSI_PINS_6	5
+#define MX31_AUDMUX_PORT7_SSI_PINS_7	6
+
+#define MX51_AUDMUX_PORT1_SSI0		0
+#define MX51_AUDMUX_PORT2_SSI1		1
+#define MX51_AUDMUX_PORT3		2
+#define MX51_AUDMUX_PORT4		3
+#define MX51_AUDMUX_PORT5		4
+#define MX51_AUDMUX_PORT6		5
+#define MX51_AUDMUX_PORT7		6
+
+/*
+ * TFCSEL/RFCSEL (i.MX27) or TFSEL/TCSEL/RFSEL/RCSEL (i.MX31/51/53/6Q)
+ * can be sourced from Rx/Tx.
+ */
+#define IMX_AUDMUX_RXFS			0x8
+#define IMX_AUDMUX_RXCLK		0x8
+
+/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
+#define IMX_AUDMUX_V1_PCR_INMMASK(x)	((x) & 0xff)
+#define IMX_AUDMUX_V1_PCR_INMEN		(1 << 8)
+#define IMX_AUDMUX_V1_PCR_TXRXEN	(1 << 10)
+#define IMX_AUDMUX_V1_PCR_SYN		(1 << 12)
+#define IMX_AUDMUX_V1_PCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define IMX_AUDMUX_V1_PCR_RFCSEL(x)	(((x) & 0xf) << 20)
+#define IMX_AUDMUX_V1_PCR_RCLKDIR	(1 << 24)
+#define IMX_AUDMUX_V1_PCR_RFSDIR	(1 << 25)
+#define IMX_AUDMUX_V1_PCR_TFCSEL(x)	(((x) & 0xf) << 26)
+#define IMX_AUDMUX_V1_PCR_TCLKDIR	(1 << 30)
+#define IMX_AUDMUX_V1_PCR_TFSDIR	(1 << 31)
+
+/* Register definitions for the i.MX25/31/35/51 Digital Audio Multiplexer */
+#define IMX_AUDMUX_V2_PTCR_TFSDIR	(1 << 31)
+#define IMX_AUDMUX_V2_PTCR_TFSEL(x)	(((x) & 0xf) << 27)
+#define IMX_AUDMUX_V2_PTCR_TCLKDIR	(1 << 26)
+#define IMX_AUDMUX_V2_PTCR_TCSEL(x)	(((x) & 0xf) << 22)
+#define IMX_AUDMUX_V2_PTCR_RFSDIR	(1 << 21)
+#define IMX_AUDMUX_V2_PTCR_RFSEL(x)	(((x) & 0xf) << 17)
+#define IMX_AUDMUX_V2_PTCR_RCLKDIR	(1 << 16)
+#define IMX_AUDMUX_V2_PTCR_RCSEL(x)	(((x) & 0xf) << 12)
+#define IMX_AUDMUX_V2_PTCR_SYN		(1 << 11)
+
+#define IMX_AUDMUX_V2_PDCR_RXDSEL(x)	(((x) & 0x7) << 13)
+#define IMX_AUDMUX_V2_PDCR_TXRXEN	(1 << 12)
+#define IMX_AUDMUX_V2_PDCR_MODE(x)	(((x) & 0x3) << 8)
+#define IMX_AUDMUX_V2_PDCR_INMMASK(x)	((x) & 0xff)
+
+#endif /* __DT_FSL_IMX_AUDMUX_H */
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#5 lore raw

PATCH 5/8 ARM: dts: icorem6: Sync engicam device trees from v5.4

In reply to Jagan Teki

Sync Engicam device tree file from v5.4 linux-next.

---
 arch/arm/dts/imx6dl-icore-mipi.dts   |  11 +-
 arch/arm/dts/imx6dl-icore-rqs.dts    |  43 +---
 arch/arm/dts/imx6dl-icore.dts        |  47 +---
 arch/arm/dts/imx6q-icore-mipi.dts    |  19 +-
 arch/arm/dts/imx6q-icore-ofcap10.dts |  40 ++++
 arch/arm/dts/imx6q-icore-ofcap12.dts |  43 ++++
 arch/arm/dts/imx6q-icore-rqs.dts     |  43 +---
 arch/arm/dts/imx6q-icore.dts         |  72 +++---
 arch/arm/dts/imx6qdl-icore-1.5.dtsi  |  34 +++
 arch/arm/dts/imx6qdl-icore-rqs.dtsi  | 326 +++++++++++++++++++++++----
 arch/arm/dts/imx6qdl-icore.dtsi      | 255 +++++++++++++++++----
 11 files changed, 688 insertions(+), 245 deletions(-)
 create mode 100644 arch/arm/dts/imx6q-icore-ofcap10.dts
 create mode 100644 arch/arm/dts/imx6q-icore-ofcap12.dts
 create mode 100644 arch/arm/dts/imx6qdl-icore-1.5.dtsi
arch/arm/dts/imx6dl-icore-mipi.dts +8 -3
index 39bdf2d55b..e43bccb78a 100644
@@ -1,7 +1,7 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// SPDX-License-Identifier: GPL-2.0 OR X11
 /*
- * Copyright (C) 2017 Engicam S.r.l.
- * Copyright (C) 2017 Amarula Solutions B.V.
+ * Copyright (C) 2018 Engicam S.r.l.
+ * Copyright (C) 2018 Amarula Solutions B.V.
  * Author: Jagan Teki <[email protected]>
  */
 
@@ -15,6 +15,11 @@
 	compatible = "engicam,imx6-icore", "fsl,imx6dl";
 };
 
+&hdmi {
+	ddc-i2c-bus = <&i2c2>;
+	status = "okay";
+};
+
 &usdhc3 {
 	status = "okay";
 };
arch/arm/dts/imx6dl-icore-rqs.dts +4 -39

51 lines not on this page · raw message

arch/arm/dts/imx6dl-icore.dts +10 -37

56 lines not on this page · raw message

arch/arm/dts/imx6q-icore-mipi.dts +16 -3
index e7c5616a63..d51745268d 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// SPDX-License-Identifier: GPL-2.0 OR X11
 /*
  * Copyright (C) 2017 Engicam S.r.l.
  * Copyright (C) 2017 Amarula Solutions B.V.
@@ -8,13 +8,26 @@
 /dts-v1/;
 
 #include "imx6q.dtsi"
-#include "imx6qdl-icore.dtsi"
+#include "imx6qdl-icore-1.5.dtsi"
 
 / {
-	model = "Engicam i.CoreM6 Quad/Dual MIPI Starter Kit";
+	model = "Engicam i.CoreM6 1.5 Quad/Dual MIPI Starter Kit";
 	compatible = "engicam,imx6-icore", "fsl,imx6q";
 };
 
+&hdmi {
+	ddc-i2c-bus = <&i2c2>;
+	status = "okay";
+};
+
+&mipi_csi {
+	status = "okay";
+};
+
+&ov5640 {
+	status = "okay";
+};
+
 &usdhc3 {
 	status = "okay";
 };
arch/arm/dts/imx6q-icore-ofcap10.dts new file +40 -0
new file mode 100644
index 0000000000..81cc346dd1
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ */
+
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-icore.dtsi"
+
+/ {
+	model = "Engicam i.CoreM6 Quad/Dual OpenFrame Capacitive touch 10.1 Kit";
+	compatible = "engicam,imx6-icore", "fsl,imx6q";
+};
+
+&ldb {
+	status = "okay";
+
+	lvds-channel at 0 {
+		fsl,data-mapping = "spwg";
+		fsl,data-width = <24>;
+		status = "okay";
+
+		display-timings {
+			native-mode = <&timing0>;
+			timing0: timing0 {
+				clock-frequency = <60000000>;
+				hactive = <1280>;
+				vactive = <800>;
+				hback-porch = <40>;
+				hfront-porch = <40>;
+				vback-porch = <10>;
+				vfront-porch = <3>;
+				hsync-len = <80>;
+				vsync-len = <10>;
+			};
+		};
+	};
+};
arch/arm/dts/imx6q-icore-ofcap12.dts new file +43 -0

43 lines not on this page · raw message

arch/arm/dts/imx6q-icore-rqs.dts +6 -37

51 lines not on this page · raw message

arch/arm/dts/imx6q-icore.dts +35 -37

81 lines not on this page · raw message

arch/arm/dts/imx6qdl-icore-1.5.dtsi new file +34 -0
new file mode 100644
index 0000000000..d91d46b589
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Jacopo Mondi <[email protected]>
+ */
+
+#include "imx6qdl-icore.dtsi"
+
+&iomuxc {
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN	0x1b0b0
+			MX6QDL_PAD_GPIO_16__ENET_REF_CLK	0x4001b0b0
+			MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN	0x1b0b0
+			MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1	0x1b0b0
+			MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0	0x1b0b0
+			MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1	0x1b0b0
+			MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0	0x1b0b0
+			MX6QDL_PAD_ENET_MDC__ENET_MDC		0x1b0b0
+			MX6QDL_PAD_ENET_MDIO__ENET_MDIO		0x1b0b0
+			MX6QDL_PAD_GPIO_17__GPIO7_IO12		0x1b0b0
+		>;
+	};
+};
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+	clocks = <&clks IMX6QDL_CLK_ENET>,
+		 <&clks IMX6QDL_CLK_ENET>,
+		 <&clks IMX6QDL_CLK_ENET_REF>;
+	phy-mode = "rmii";
+	status = "okay";
+};
arch/arm/dts/imx6qdl-icore-rqs.dtsi +280 -46

401 lines not on this page · raw message

arch/arm/dts/imx6qdl-icore.dtsi +212 -43

317 lines not on this page · raw message

Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#6 lore raw

PATCH 6/8 ARM: dts: imx6q-icore-mipi: Use 1.5 version of i.Core MX6DL

In reply to Jagan Teki

The EDIMM STARTER KIT i.Core 1.5 MIPI Evaluation is based on the 1.5 version of the i.Core MX6 cpu module. The 1.5 version differs from the original one for a few details, including the ethernet PHY interface clock provider.

With this commit, the ethernet interface works properly:
SMSC LAN8710/LAN8720 2188000.ethernet-1:00: attached PHY driver

While before using the 1.5 version, ethernet failed to startup do to un-clocked PHY interface:
fec 2188000.ethernet eth0: could not attach to PHY

Similar fix has merged for i.Core MX6Q but missed to update for DL.

---
 arch/arm/dts/imx6dl-icore-mipi.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/imx6dl-icore-mipi.dts +1 -1
index e43bccb78a..d8f3821a0f 100644
@@ -8,7 +8,7 @@
 /dts-v1/;
 
 #include "imx6dl.dtsi"
-#include "imx6qdl-icore.dtsi"
+#include "imx6qdl-icore-1.5.dtsi"
 
 / {
 	model = "Engicam i.CoreM6 DualLite/Solo MIPI Starter Kit";
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#7 lore raw

PATCH 7/8 ARM: dts: imx6qdl-icore-1.5: Remove duplicate phy reset methods

In reply to Jagan Teki

From: Michael Trimarchi <[email protected]>

Engicam i.CoreM6 1.5 Quad/Dual MIPI dtsi is reusing fec node from Engicam i.CoreM6 dtsi but have sampe copy of phy-reset-gpio and phy-mode properties.

So, drop this phy reset methods from imx6qdl-icore-1.5 dsti file.

---
 arch/arm/dts/imx6qdl-icore-1.5.dtsi | 2 --
 1 file changed, 2 deletions(-)
arch/arm/dts/imx6qdl-icore-1.5.dtsi +0 -2
index d91d46b589..0fd7f2e24d 100644
@@ -25,10 +25,8 @@
 &fec {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_enet>;
-	phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
 	clocks = <&clks IMX6QDL_CLK_ENET>,
 		 <&clks IMX6QDL_CLK_ENET>,
 		 <&clks IMX6QDL_CLK_ENET_REF>;
-	phy-mode = "rmii";
 	status = "okay";
 };
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#8 lore raw

PATCH 8/8 ARM: dts: imx6qdli-icore: Add fec phy-handle

In reply to Jagan Teki

From: Michael Trimarchi <[email protected]>

LAN8720 needs a reset of every clock enable. The reset needs to be done at device level, due the flag PHY_RST_AFTER_CLK_EN.

So, add phy-handle by creating mdio child node inside fec. This will eventually move the phy-reset-gpio which is defined in fec node.

---
 arch/arm/dts/imx6qdl-icore.dtsi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/dts/imx6qdl-icore.dtsi +14 -1
index 7814f1ef08..756f3a9f1b 100644
@@ -150,10 +150,23 @@
 &fec {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_enet>;
-	phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
 	clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>, <&rmii_clk>;
 	phy-mode = "rmii";
+	phy-handle = <&eth_phy>;
 	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		eth_phy: ethernet-phy at 0 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <0>;
+			reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+			reset-assert-us = <4000>;
+			reset-deassert-us = <4000>;
+		};
+	};
 };
 
 &gpmi {
Signature · 1 line
2.18.0.321.gffc6fa0e3
#9 lore raw

PATCH 8/8 ARM: dts: imx6qdli-icore: Add fec phy-handle

Hi

Quoted 33 lines · Jagan Teki

From: Michael Trimarchi <[email protected]>

LAN8720 needs a reset of every clock enable. The reset needs to be done at device level, due the flag PHY_RST_AFTER_CLK_EN.

So, add phy-handle by creating mdio child node inside fec. This will eventually move the phy-reset-gpio which is defined in fec node.

---
 arch/arm/dts/imx6qdl-icore.dtsi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/dts/imx6qdl-icore.dtsi +5 -1
index 7814f1ef08..756f3a9f1b 100644
@@ -150,10 +150,23 @@
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
-       phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
        clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>, <&rmii_clk>;
        phy-mode = "rmii";
+       phy-handle = <&eth_phy>;
        status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;

arch/arm/dts/imx6qdl-icore.dtsi line 170

Quoted 10 lines
arch/arm/dts/imx6qdl-icore.dtsi +9 -0
+
+               eth_phy: ethernet-phy at 0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <4000>;
+                       reset-deassert-us = <4000>;
+               };
+       };
 };

This work in linux but not in uboot. I don't think that we have this kind of connection.

Michael

Quoted 5 lines
arch/arm/dts/imx6qdl-icore.dtsi +0 -1
 &gpmi {
--

2.18.0.321.gffc6fa0e3

Signature · 4 lines
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
author
#10 lore raw

PATCH 8/8 ARM: dts: imx6qdli-icore: Add fec phy-handle

Quoted 42 lines · Michael Nazzareno Trimarchi

Hi

Quoted 38 lines · Jagan Teki

From: Michael Trimarchi <[email protected]>

LAN8720 needs a reset of every clock enable. The reset needs to be done at device level, due the flag PHY_RST_AFTER_CLK_EN.

So, add phy-handle by creating mdio child node inside fec. This will eventually move the phy-reset-gpio which is defined in fec node.

---
 arch/arm/dts/imx6qdl-icore.dtsi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/dts/imx6qdl-icore.dtsi +10 -1
index 7814f1ef08..756f3a9f1b 100644
@@ -150,10 +150,23 @@
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
-       phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
        clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>, <&rmii_clk>;
        phy-mode = "rmii";
+       phy-handle = <&eth_phy>;
        status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               eth_phy: ethernet-phy at 0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
Quoted 8 lines

arch/arm/dts/imx6qdl-icore.dtsi line 170

Quoted 5 lines
arch/arm/dts/imx6qdl-icore.dtsi +4 -0
+                       reset-assert-us = <4000>;
+                       reset-deassert-us = <4000>;
+               };
+       };
 };

This work in linux but not in uboot. I don't think that we have this kind of connection.

Okay. Missed to check will drop this from series.

#11 lore raw

PATCH 8/8 ARM: dts: imx6qdli-icore: Add fec phy-handle

Hi Jagan, Michael,

Quoted 53 lines · Jagan Teki
Quoted 42 lines · Michael Nazzareno Trimarchi

Hi

Quoted 38 lines · Jagan Teki

From: Michael Trimarchi <[email protected]>

LAN8720 needs a reset of every clock enable. The reset needs to be done at device level, due the flag PHY_RST_AFTER_CLK_EN.

So, add phy-handle by creating mdio child node inside fec. This will eventually move the phy-reset-gpio which is defined in fec node.

---
 arch/arm/dts/imx6qdl-icore.dtsi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/dts/imx6qdl-icore.dtsi +10 -1
index 7814f1ef08..756f3a9f1b 100644
@@ -150,10 +150,23 @@
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
-       phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
        clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>, <&rmii_clk>;
        phy-mode = "rmii";
+       phy-handle = <&eth_phy>;
        status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               eth_phy: ethernet-phy at 0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
Quoted 8 lines

arch/arm/dts/imx6qdl-icore.dtsi line 170

Quoted 5 lines
arch/arm/dts/imx6qdl-icore.dtsi +4 -0
+                       reset-assert-us = <4000>;
+                       reset-deassert-us = <4000>;
+               };
+       };
 };

This work in linux but not in uboot. I don't think that we have this kind of connection.

Quoted 2 lines

Okay. Missed to check will drop this from series.

So is it ok if I merge the series with the exception of 8/8 ?

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
author
#12 lore raw

PATCH 8/8 ARM: dts: imx6qdli-icore: Add fec phy-handle

Hi Stefano,

Quoted 57 lines · Stefano Babic

Hi Jagan, Michael,

Quoted 53 lines · Jagan Teki
Quoted 50 lines · Michael Nazzareno Trimarchi

Hi

Quoted 33 lines · Jagan Teki

From: Michael Trimarchi <[email protected]>

LAN8720 needs a reset of every clock enable. The reset needs to be done at device level, due the flag PHY_RST_AFTER_CLK_EN.

So, add phy-handle by creating mdio child node inside fec. This will eventually move the phy-reset-gpio which is defined in fec node.

---
 arch/arm/dts/imx6qdl-icore.dtsi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/arm/dts/imx6qdl-icore.dtsi +5 -1
index 7814f1ef08..756f3a9f1b 100644
@@ -150,10 +150,23 @@
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
-       phy-reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
        clocks = <&clks IMX6QDL_CLK_ENET>, <&clks IMX6QDL_CLK_ENET>, <&rmii_clk>;
        phy-mode = "rmii";
+       phy-handle = <&eth_phy>;
        status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;

arch/arm/dts/imx6qdl-icore.dtsi line 170

Quoted 10 lines
arch/arm/dts/imx6qdl-icore.dtsi +9 -0
+
+               eth_phy: ethernet-phy at 0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <4000>;
+                       reset-deassert-us = <4000>;
+               };
+       };
 };

This work in linux but not in uboot. I don't think that we have this kind of connection.

Quoted 4 lines
Quoted 2 lines

Okay. Missed to check will drop this from series.

So is it ok if I merge the series with the exception of 8/8 ?

Yes, please.