Skip to contentSkip to conversation

arm: imx8: added usbphy_regs struct

PATCH New Oliver Graute 4 participants 5 messages Feb 19, 2021 – Feb 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: imx8: added usbphy_regs struct

FROM: Ye Li <[email protected]>

imx8: added usbphy_regs struct

Cc Stefano Babic <[email protected]>
Cc Peng Fan <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc uboot-imx <[email protected]>

---

This code snippet is from here:

https://source.codeaurora.org/external/imx/uboot-imx/commit/arch/arm/include/asm/arch-imx8/imx-regs.h?h=imx_v2020.04_5.4.70_2.3.0&id=6affb545f2ef857f63cfa1a14a5c67a3dea6a678

 arch/arm/include/asm/arch-imx8/imx-regs.h | 78 +++++++++++++++++++++++
 1 file changed, 78 insertions(+)
arch/arm/include/asm/arch-imx8/imx-regs.h +78 -0
index 6333ff4686..1156346b51 100644
@@ -45,4 +45,82 @@
 #define USB_BASE_ADDR		0x5b0d0000
 #define USB_PHY0_BASE_ADDR	0x5b100000
 
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
+#include <asm/types.h>
+#include <stdbool.h>
+
+bool is_usb_boot(void);
+void disconnect_from_pc(void);
+#define is_boot_from_usb  is_usb_boot
+
+struct usbphy_regs {
+	u32	usbphy_pwd;			/* 0x000 */
+	u32	usbphy_pwd_set;			/* 0x004 */
+	u32	usbphy_pwd_clr;			/* 0x008 */
+	u32	usbphy_pwd_tog;			/* 0x00c */
+	u32	usbphy_tx;			/* 0x010 */
+	u32	usbphy_tx_set;			/* 0x014 */
+	u32	usbphy_tx_clr;			/* 0x018 */
+	u32	usbphy_tx_tog;			/* 0x01c */
+	u32	usbphy_rx;			/* 0x020 */
+	u32	usbphy_rx_set;			/* 0x024 */
+	u32	usbphy_rx_clr;			/* 0x028 */
+	u32	usbphy_rx_tog;			/* 0x02c */
+	u32	usbphy_ctrl;			/* 0x030 */
+	u32	usbphy_ctrl_set;		/* 0x034 */
+	u32	usbphy_ctrl_clr;		/* 0x038 */
+	u32	usbphy_ctrl_tog;		/* 0x03c */
+	u32	usbphy_status;			/* 0x040 */
+	u32	reserved0[3];
+	u32	usbphy_debug0;			/* 0x050 */
+	u32	usbphy_debug0_set;		/* 0x054 */
+	u32	usbphy_debug0_clr;		/* 0x058 */
+	u32	usbphy_debug0_tog;		/* 0x05c */
+	u32	reserved1[4];
+	u32	usbphy_debug1;			/* 0x070 */
+	u32	usbphy_debug1_set;		/* 0x074 */
+	u32	usbphy_debug1_clr;		/* 0x078 */
+	u32	usbphy_debug1_tog;		/* 0x07c */
+	u32	usbphy_version;			/* 0x080 */
+	u32	reserved2[7];
+	u32	usb1_pll_480_ctrl;		/* 0x0a0 */
+	u32	usb1_pll_480_ctrl_set;		/* 0x0a4 */
+	u32	usb1_pll_480_ctrl_clr;		/* 0x0a8 */
+	u32	usb1_pll_480_ctrl_tog;		/* 0x0ac */
+	u32	reserved3[4];
+	u32	usb1_vbus_detect;		/* 0xc0 */
+	u32	usb1_vbus_detect_set;		/* 0xc4 */
+	u32	usb1_vbus_detect_clr;		/* 0xc8 */
+	u32	usb1_vbus_detect_tog;		/* 0xcc */
+	u32	usb1_vbus_det_stat;		/* 0xd0 */
+	u32	reserved4[3];
+	u32	usb1_chrg_detect;		/* 0xe0 */
+	u32	usb1_chrg_detect_set;		/* 0xe4 */
+	u32	usb1_chrg_detect_clr;		/* 0xe8 */
+	u32	usb1_chrg_detect_tog;		/* 0xec */
+	u32	usb1_chrg_det_stat;		/* 0xf0 */
+	u32	reserved5[3];
+	u32	usbphy_anactrl;			/* 0x100 */
+	u32	usbphy_anactrl_set;		/* 0x104 */
+	u32	usbphy_anactrl_clr;		/* 0x108 */
+	u32	usbphy_anactrl_tog;		/* 0x10c */
+	u32	usb1_loopback;			/* 0x110 */
+	u32	usb1_loopback_set;		/* 0x114 */
+	u32	usb1_loopback_clr;		/* 0x118 */
+	u32	usb1_loopback_tog;		/* 0x11c */
+	u32	usb1_loopback_hsfscnt;		/* 0x120 */
+	u32	usb1_loopback_hsfscnt_set;	/* 0x124 */
+	u32	usb1_loopback_hsfscnt_clr;	/* 0x128 */
+	u32	usb1_loopback_hsfscnt_tog;	/* 0x12c */
+	u32	usphy_trim_override_en;		/* 0x130 */
+	u32	usphy_trim_override_en_set;	/* 0x134 */
+	u32	usphy_trim_override_en_clr;	/* 0x138 */
+	u32	usphy_trim_override_en_tog;	/* 0x13c */
+	u32	usb1_pfda_ctrl1;		/* 0x140 */
+	u32	usb1_pfda_ctrl1_set;		/* 0x144 */
+	u32	usb1_pfda_ctrl1_clr;		/* 0x148 */
+	u32	usb1_pfda_ctrl1_tog;		/* 0x14c */
+};
+#endif
+
 #endif /* __ASM_ARCH_IMX8_REGS_H__ */
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 arm: imx8: added usbphy_regs struct

Quoted 1 line

Subject: [PATCH v1] arm: imx8: added usbphy_regs struct

Only a structure?

-Peng

Quoted 119 lines

FROM: Ye Li <[email protected]>

imx8: added usbphy_regs struct

Cc Stefano Babic <[email protected]>
Cc Peng Fan <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc uboot-imx <[email protected]>

---

This code snippet is from here:

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource
.codeaurora.org%2Fexternal%2Fimx%2Fuboot-imx%2Fcommit%2Farch%2Far m%2Finclude%2Fasm%2Farch-imx8%2Fimx-regs.h%3Fh%3Dimx_v2020.04_5 .4.70_2.3.0%26id%3D6affb545f2ef857f63cfa1a14a5c67a3dea6a678&amp;da ta=04%7C01%7Cpeng.fan%40nxp.com%7C17d333d7ba0e46cc94b808d8d4b7 3564%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63749323062 5813111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=8c2y0QuF p%2FdlnhqLk3HAN2CBjT3BVbng2GHrRyaMuFA%3D&amp;reserved=0

 arch/arm/include/asm/arch-imx8/imx-regs.h | 78
+++++++++++++++++++++++
 1 file changed, 78 insertions(+)
arch/arm/include/asm/arch-imx8/imx-regs.h +77 -1
index 6333ff4686..1156346b51 100644
@@ -45,4 +45,82 @@
 #define USB_BASE_ADDR		0x5b0d0000
 #define USB_PHY0_BASE_ADDR	0x5b100000
 
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
 #include
+<asm/types.h> #include <stdbool.h>
+
+bool is_usb_boot(void);
+void disconnect_from_pc(void);
+#define is_boot_from_usb  is_usb_boot
+
+struct usbphy_regs {
+	u32	usbphy_pwd;			/* 0x000 */
+	u32	usbphy_pwd_set;			/* 0x004 */
+	u32	usbphy_pwd_clr;			/* 0x008 */
+	u32	usbphy_pwd_tog;			/* 0x00c */
+	u32	usbphy_tx;			/* 0x010 */
+	u32	usbphy_tx_set;			/* 0x014 */
+	u32	usbphy_tx_clr;			/* 0x018 */
+	u32	usbphy_tx_tog;			/* 0x01c */
+	u32	usbphy_rx;			/* 0x020 */
+	u32	usbphy_rx_set;			/* 0x024 */
+	u32	usbphy_rx_clr;			/* 0x028 */
+	u32	usbphy_rx_tog;			/* 0x02c */
+	u32	usbphy_ctrl;			/* 0x030 */
+	u32	usbphy_ctrl_set;		/* 0x034 */
+	u32	usbphy_ctrl_clr;		/* 0x038 */
+	u32	usbphy_ctrl_tog;		/* 0x03c */
+	u32	usbphy_status;			/* 0x040 */
+	u32	reserved0[3];
+	u32	usbphy_debug0;			/* 0x050 */
+	u32	usbphy_debug0_set;		/* 0x054 */
+	u32	usbphy_debug0_clr;		/* 0x058 */
+	u32	usbphy_debug0_tog;		/* 0x05c */
+	u32	reserved1[4];
+	u32	usbphy_debug1;			/* 0x070 */
+	u32	usbphy_debug1_set;		/* 0x074 */
+	u32	usbphy_debug1_clr;		/* 0x078 */
+	u32	usbphy_debug1_tog;		/* 0x07c */
+	u32	usbphy_version;			/* 0x080 */
+	u32	reserved2[7];
+	u32	usb1_pll_480_ctrl;		/* 0x0a0 */
+	u32	usb1_pll_480_ctrl_set;		/* 0x0a4 */
+	u32	usb1_pll_480_ctrl_clr;		/* 0x0a8 */
+	u32	usb1_pll_480_ctrl_tog;		/* 0x0ac */
+	u32	reserved3[4];
+	u32	usb1_vbus_detect;		/* 0xc0 */
+	u32	usb1_vbus_detect_set;		/* 0xc4 */
+	u32	usb1_vbus_detect_clr;		/* 0xc8 */
+	u32	usb1_vbus_detect_tog;		/* 0xcc */
+	u32	usb1_vbus_det_stat;		/* 0xd0 */
+	u32	reserved4[3];
+	u32	usb1_chrg_detect;		/* 0xe0 */
+	u32	usb1_chrg_detect_set;		/* 0xe4 */
+	u32	usb1_chrg_detect_clr;		/* 0xe8 */
+	u32	usb1_chrg_detect_tog;		/* 0xec */
+	u32	usb1_chrg_det_stat;		/* 0xf0 */
+	u32	reserved5[3];
+	u32	usbphy_anactrl;			/* 0x100 */
+	u32	usbphy_anactrl_set;		/* 0x104 */
+	u32	usbphy_anactrl_clr;		/* 0x108 */
+	u32	usbphy_anactrl_tog;		/* 0x10c */
+	u32	usb1_loopback;			/* 0x110 */
+	u32	usb1_loopback_set;		/* 0x114 */
+	u32	usb1_loopback_clr;		/* 0x118 */
+	u32	usb1_loopback_tog;		/* 0x11c */
+	u32	usb1_loopback_hsfscnt;		/* 0x120 */
+	u32	usb1_loopback_hsfscnt_set;	/* 0x124 */
+	u32	usb1_loopback_hsfscnt_clr;	/* 0x128 */
+	u32	usb1_loopback_hsfscnt_tog;	/* 0x12c */
+	u32	usphy_trim_override_en;		/* 0x130 */
+	u32	usphy_trim_override_en_set;	/* 0x134 */
+	u32	usphy_trim_override_en_clr;	/* 0x138 */
+	u32	usphy_trim_override_en_tog;	/* 0x13c */
+	u32	usb1_pfda_ctrl1;		/* 0x140 */
+	u32	usb1_pfda_ctrl1_set;		/* 0x144 */
+	u32	usb1_pfda_ctrl1_clr;		/* 0x148 */
+	u32	usb1_pfda_ctrl1_tog;		/* 0x14c */
+};
+#endif
+
 #endif /* __ASM_ARCH_IMX8_REGS_H__ */
--

2.17.1

#2 lore raw

PATCH 1/1 arm: imx8: added usbphy_regs struct

Quoted 3 lines · Peng Fan (OSS)
Quoted 1 line

Subject: [PATCH v1] arm: imx8: added usbphy_regs struct

Only a structure?

What do you mean exaclty?

I have some more patches here to get the ehci-mx6 usb working on imx8. The hard work was done by Ye Li. I just splitted them up and rebased to be able to use them. How do I have to proceed to get them in?

Best regards,

Oliver

#3 lore raw

PATCH 1/1 arm: imx8: added usbphy_regs struct

Quoted 5 lines

Subject: Re: [PATCH v1] arm: imx8: added usbphy_regs struct

Quoted 2 lines · Peng Fan (OSS)
Quoted 1 line

Subject: [PATCH v1] arm: imx8: added usbphy_regs struct

Quoted 7 lines
Quoted 1 line

Only a structure?

What do you mean exaclty?

I have some more patches here to get the ehci-mx6 usb working on imx8. The hard work was done by Ye Li. I just splitted them up and rebased to be able to use them. How do I have to proceed to get them in?

https://patchwork.ozlabs.org/project/uboot/cover/20200916125705.4341-1-peng.fan at nxp.com/

Marek rejected the patchset, he wanna a good shape of echi-mx6.c driver.

Regards,
Peng.

Quoted 4 lines

Best regards,

Oliver

#4 lore raw

PATCH 1/1 arm: imx8: added usbphy_regs struct

Quoted 9 lines · Peng Fan (OSS)
Quoted 9 lines

Subject: Re: [PATCH v1] arm: imx8: added usbphy_regs struct

Quoted 3 lines · Peng Fan (OSS)
Quoted 1 line

Subject: [PATCH v1] arm: imx8: added usbphy_regs struct

Only a structure?

What do you mean exaclty?

Quoted 7 lines
Quoted 3 lines

I have some more patches here to get the ehci-mx6 usb working on imx8. The hard work was done by Ye Li. I just splitted them up and rebased to be able to use them. How do I have to proceed to get them in?

https://patchwork.ozlabs.org/project/uboot/cover/20200916125705.4341-1-peng.fan at nxp.com/

Marek rejected the patchset, he wanna a good shape of echi-mx6.c driver.

Right, we cannot just keep adding more stuff into the ehci-mx6, it needs thorough cleanup first.

btw I tested those patches above on mx8mn evk, they don't compile at first, but when I fixed those errors they hang the entire platform, so more work is clearly needed.