Skip to contentSkip to conversation

imx6: iomux: Add generic function to set RGMII IO voltage on IMX6 SoCs

PATCH New Lukasz Majewski 2 participants 8 messages Oct 31, 2017 – Nov 9, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx6: iomux: Add generic function to set RGMII IO voltage on IMX6 SoCs

This commit provides generic function to set the RGMII/HSIC IO voltage level on iMX6 devices.

---

 arch/arm/include/asm/arch-mx6/iomux.h     | 13 +++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h | 11 +++++++++++
 2 files changed, 24 insertions(+)
arch/arm/include/asm/arch-mx6/iomux.h +13 -0
index 907cb408ff..ee3a56583b 100644
@@ -178,4 +178,17 @@
 				|IOMUXC_GPR13_SATA_PHY_3_MASK \
 				|IOMUXC_GPR13_SATA_PHY_2_MASK \
 				|IOMUXC_GPR13_SATA_PHY_1_MASK)
+
+/*
+ * Setup RGMII voltage levels on iMX6 SoC - the
+ *
+ * IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII - register
+ *
+ * 1P2V_IO - USB_HSIC, MIPI_HSI
+ * 1P5V_IO - ENET pins
+ */
+#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII	0x020e0790
+#define DDR_SEL_1P2V_IO (0x2 << 18)
+#define DDR_SEL_1P5V_IO (0x3 << 18)
+
 #endif	/* __ASM_ARCH_IOMUX_H__ */
arch/arm/include/asm/arch-mx6/sys_proto.h +11 -0
index b22a7a0f8b..72ab7d814f 100644
@@ -6,6 +6,7 @@
  */
 
 #include <asm/mach-imx/sys_proto.h>
+#include <asm/arch/iomux.h>
 
 #define USBPHY_PWD		0x00000000
 
@@ -16,3 +17,13 @@
 
 int imx6_pcie_toggle_power(void);
 int imx6_pcie_toggle_reset(void);
+
+/**
+ * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB pins
+ *
+ * @param io_vol - the voltage IO level of pins
+ */
+static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
+{
+	__raw_writel(io_vol, IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII);
+}
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 imx6: iomux: Add generic function to set RGMII IO voltage on IMX6 SoCs

Quoted 49 lines · Lukasz Majewski

This commit provides generic function to set the RGMII/HSIC IO voltage level on iMX6 devices.

---

 arch/arm/include/asm/arch-mx6/iomux.h     | 13 +++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h | 11 +++++++++++
 2 files changed, 24 insertions(+)
arch/arm/include/asm/arch-mx6/iomux.h +13 -0
index 907cb408ff..ee3a56583b 100644
@@ -178,4 +178,17 @@
 				|IOMUXC_GPR13_SATA_PHY_3_MASK \
 				|IOMUXC_GPR13_SATA_PHY_2_MASK \
 				|IOMUXC_GPR13_SATA_PHY_1_MASK)
+
+/*
+ * Setup RGMII voltage levels on iMX6 SoC - the
+ *
+ * IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII - register
+ *
+ * 1P2V_IO - USB_HSIC, MIPI_HSI
+ * 1P5V_IO - ENET pins
+ */
+#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII	0x020e0790
+#define DDR_SEL_1P2V_IO (0x2 << 18)
+#define DDR_SEL_1P5V_IO (0x3 << 18)
+
 #endif	/* __ASM_ARCH_IOMUX_H__ */
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index b22a7a0f8b..72ab7d814f 100644
@@ -6,6 +6,7 @@
  */
 
 #include <asm/mach-imx/sys_proto.h>
+#include <asm/arch/iomux.h>
 
 #define USBPHY_PWD		0x00000000
 
@@ -16,3 +17,13 @@
 
 int imx6_pcie_toggle_power(void);
 int imx6_pcie_toggle_reset(void);

arch/arm/include/asm/arch-mx6/sys_proto.h line 29

Quoted 10 lines
arch/arm/include/asm/arch-mx6/sys_proto.h +10 -0
+
+/**
+ * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB pins
+ *
+ * @param io_vol - the voltage IO level of pins
+ */
+static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
+{
+	__raw_writel(io_vol, IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII);
+}

Applied to u-boot-imx, -master, thanke !

Best regards,
Stefano Babic

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
=====================================================================
#2 lore raw

PATCH 1/1 imx6: iomux: Add generic function to set RGMII IO voltage on IMX6 SoCs

Quoted 47 lines · Stefano Babic
Quoted 46 lines · Lukasz Majewski

This commit provides generic function to set the RGMII/HSIC IO voltage level on iMX6 devices.

---

 arch/arm/include/asm/arch-mx6/iomux.h     | 13 +++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h | 11 +++++++++++
 2 files changed, 24 insertions(+)
arch/arm/include/asm/arch-mx6/iomux.h +13 -0
index 907cb408ff..ee3a56583b 100644
@@ -178,4 +178,17 @@
 				|IOMUXC_GPR13_SATA_PHY_3_MASK \
 				|IOMUXC_GPR13_SATA_PHY_2_MASK \
 				|IOMUXC_GPR13_SATA_PHY_1_MASK)
+
+/*
+ * Setup RGMII voltage levels on iMX6 SoC - the
+ *
+ * IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII - register
+ *
+ * 1P2V_IO - USB_HSIC, MIPI_HSI
+ * 1P5V_IO - ENET pins
+ */
+#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII	0x020e0790
+#define DDR_SEL_1P2V_IO (0x2 << 18)
+#define DDR_SEL_1P5V_IO (0x3 << 18)
+
 #endif	/* __ASM_ARCH_IOMUX_H__ */
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index b22a7a0f8b..72ab7d814f 100644
@@ -6,6 +6,7 @@
  */
 
 #include <asm/mach-imx/sys_proto.h>
+#include <asm/arch/iomux.h>
 
 #define USBPHY_PWD		0x00000000
 
@@ -16,3 +17,13 @@
 
Quoted 16 lines

arch/arm/include/asm/arch-mx6/sys_proto.h line 29

Quoted 13 lines
arch/arm/include/asm/arch-mx6/sys_proto.h +10 -0
 int imx6_pcie_toggle_power(void);
 int imx6_pcie_toggle_reset(void);
+
+/**
+ * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB pins
+ *
+ * @param io_vol - the voltage IO level of pins
+ */
+static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
+{
+	__raw_writel(io_vol, IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII);
+}

Applied to u-boot-imx, -master, thanke !

I was too optimistic. This breaks the "marsboard" board (same name for function). Can you review this and fix it, please ?

Thanks,
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
=====================================================================
#3 lore raw

PATCH 1/1 imx6: iomux: Add generic function to set RGMII IO voltage on IMX6 SoCs

Hi Stefano,

Quoted 66 lines · Stefano Babic
Quoted 47 lines · Lukasz Majewski
Quoted 46 lines

This commit provides generic function to set the RGMII/HSIC IO voltage level on iMX6 devices.

---

 arch/arm/include/asm/arch-mx6/iomux.h     | 13 +++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h | 11 +++++++++++
 2 files changed, 24 insertions(+)
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/iomux.h index 907cb408ff..ee3a56583b 100644 --- a/arch/arm/include/asm/arch-mx6/iomux.h +++ b/arch/arm/include/asm/arch-mx6/iomux.h @@ -178,4 +178,17 @@

arch/arm/include/asm/arch-mx6/iomux.h +13 -0
 				|IOMUXC_GPR13_SATA_PHY_3_MASK \
 				|IOMUXC_GPR13_SATA_PHY_2_MASK \
 				|IOMUXC_GPR13_SATA_PHY_1_MASK)
+
+/*
+ * Setup RGMII voltage levels on iMX6 SoC - the
+ *
+ * IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII - register
+ *
+ * 1P2V_IO - USB_HSIC, MIPI_HSI
+ * 1P5V_IO - ENET pins
+ */
+#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII	0x020e0790
+#define DDR_SEL_1P2V_IO (0x2 << 18)
+#define DDR_SEL_1P5V_IO (0x3 << 18)
+
 #endif	/* __ASM_ARCH_IOMUX_H__ */
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-mx6/sys_proto.h index b22a7a0f8b..72ab7d814f 100644 --- a/arch/arm/include/asm/arch-mx6/sys_proto.h +++ b/arch/arm/include/asm/arch-mx6/sys_proto.h @@ -6,6 +6,7 @@
*/

#include <asm/mach-imx/sys_proto.h>

arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
+#include <asm/arch/iomux.h>
 
 #define USBPHY_PWD		0x00000000
@@ -16,3 +17,13 @@
 
Quoted 17 lines
Quoted 12 lines
arch/arm/include/asm/arch-mx6/sys_proto.h +3 -0
 int imx6_pcie_toggle_power(void);
 int imx6_pcie_toggle_reset(void);
+
+/**
+ * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB

pins
+ *
+ * @param io_vol - the voltage IO level of pins
+ */

arch/arm/include/asm/arch-mx6/sys_proto.h +3 -0
+static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
+{
+	__raw_writel(io_vol,
Quoted 2 lines

IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII); +}

Applied to u-boot-imx, -master, thanke !

Quoted 2 lines

I was too optimistic. This breaks the "marsboard" board (same name for function). Can you review this and fix it, please ?

I've just sent the fix for "marsboard" (double inclusion of sys_proto.h)

Quoted 5 lines

Thanks,
Stefano

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171107/d65d3c11/attachment.sig>

#4 lore raw

PATCH 1/1 board: imx6: marsboard: Remove doubled #include <asm/arch/sys_proto.h>

In reply to Stefano Babic

The sys_proto.h file has been included earlier in this file.

---

 board/embest/mx6boards/mx6boards.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/embest/mx6boards/mx6boards.c +1 -1
index ae04f68445..965e4f1ec8 100644
@@ -36,7 +36,7 @@
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
 #include <asm/io.h>
-#include <asm/arch/sys_proto.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
Signature · 1 line
2.11.0
#5 lore raw

PATCH 1/1 board: imx6: marsboard: Remove doubled #include <asm/arch/sys_proto.h>

Hi Lukasz,

Quoted 15 lines · Lukasz Majewski

The sys_proto.h file has been included earlier in this file.

---

 board/embest/mx6boards/mx6boards.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/embest/mx6boards/mx6boards.c +0 -0
index ae04f68445..965e4f1ec8 100644

board/embest/mx6boards/mx6boards.c line 42

Quoted 8 lines
board/embest/mx6boards/mx6boards.c +1 -1
@@ -36,7 +36,7 @@
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
 #include <asm/io.h>
-#include <asm/arch/sys_proto.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\

Thanks for fix - applied to u-boot-imx, -master !

I have reapplied support for display5, and I am testing the build again. If it is ok, I'll send as my last PR to Tom for 2017.11.

Best 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
=====================================================================
#6 lore raw

PATCH 1/1 board: imx6: marsboard: Remove doubled #include <asm/arch/sys_proto.h>

Hi Stefano,

Quoted 24 lines

Hi Lukasz,

Quoted 21 lines · Lukasz Majewski

The sys_proto.h file has been included earlier in this file.

---

 board/embest/mx6boards/mx6boards.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/board/embest/mx6boards/mx6boards.c index ae04f68445..965e4f1ec8 100644 --- a/board/embest/mx6boards/mx6boards.c
+++ b/board/embest/mx6boards/mx6boards.c

board/embest/mx6boards/mx6boards.c +1 -1
@@ -36,7 +36,7 @@
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
 #include <asm/io.h>
-#include <asm/arch/sys_proto.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
Quoted 4 lines
Quoted 2 lines
(quoted diff) +0 -0
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP

| \

Thanks for fix - applied to u-boot-imx, -master !

You are welcome :-)

I've also sent a commit, which adds #ifdef guards to sys_proto.h.

Quoted 3 lines

I have reapplied support for display5, and I am testing the build again. If it is ok, I'll send as my last PR to Tom for 2017.11.

Great, thanks :)

Quoted 4 lines

Best regards,
Stefano

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171109/1040632c/attachment.sig>

#7 lore raw

PATCH 1/1 board: imx6: marsboard: Remove doubled #include <asm/arch/sys_proto.h>

Quoted 26 lines · Lukasz Majewski

Hi Stefano,

Quoted 24 lines

Hi Lukasz,

Quoted 21 lines · Lukasz Majewski

The sys_proto.h file has been included earlier in this file.

---

 board/embest/mx6boards/mx6boards.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/board/embest/mx6boards/mx6boards.c index ae04f68445..965e4f1ec8 100644 --- a/board/embest/mx6boards/mx6boards.c
+++ b/board/embest/mx6boards/mx6boards.c

board/embest/mx6boards/mx6boards.c +1 -1
@@ -36,7 +36,7 @@
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
 #include <asm/io.h>
-#include <asm/arch/sys_proto.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
(quoted diff) +0 -0
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP

| \

Thanks for fix - applied to u-boot-imx, -master !

You are welcome :-)

I've also sent a commit, which adds #ifdef guards to sys_proto.h.

They are applied, too

Regards,
Stefano

Quoted 23 lines
Quoted 3 lines

I have reapplied support for display5, and I am testing the build again. If it is ok, I'll send as my last PR to Tom for 2017.11.

Great, thanks :)

Quoted 4 lines

Best regards,
Stefano

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

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
=====================================================================