public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1] arm: imx8: added usbphy_regs struct
@ 2021-02-19  9:17 Oliver Graute
  2021-02-19  9:21 ` Peng Fan
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Graute @ 2021-02-19  9:17 UTC (permalink / raw)
  To: u-boot

FROM: Ye Li <ye.li@nxp.com>

imx8: added usbphy_regs struct

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
Cc: Ye Li <ye.li@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: uboot-imx <uboot-imx@nxp.com>
---

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(+)

diff --git a/arch/arm/include/asm/arch-imx8/imx-regs.h b/arch/arm/include/asm/arch-imx8/imx-regs.h
index 6333ff4686..1156346b51 100644
--- a/arch/arm/include/asm/arch-imx8/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8/imx-regs.h
@@ -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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1] arm: imx8: added usbphy_regs struct
  2021-02-19  9:17 [PATCH v1] arm: imx8: added usbphy_regs struct Oliver Graute
@ 2021-02-19  9:21 ` Peng Fan
  2021-02-22 15:22   ` Oliver Graute
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Fan @ 2021-02-19  9:21 UTC (permalink / raw)
  To: u-boot

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

Only a structure?

-Peng
> 
> FROM: Ye Li <ye.li@nxp.com>
> 
> imx8: added usbphy_regs struct
> 
> Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
> Cc: Ye Li <ye.li@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: uboot-imx <uboot-imx@nxp.com>
> ---
> 
> 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(+)
> 
> diff --git a/arch/arm/include/asm/arch-imx8/imx-regs.h
> b/arch/arm/include/asm/arch-imx8/imx-regs.h
> index 6333ff4686..1156346b51 100644
> --- a/arch/arm/include/asm/arch-imx8/imx-regs.h
> +++ b/arch/arm/include/asm/arch-imx8/imx-regs.h
> @@ -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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1] arm: imx8: added usbphy_regs struct
  2021-02-19  9:21 ` Peng Fan
@ 2021-02-22 15:22   ` Oliver Graute
  2021-02-23  1:26     ` Peng Fan
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Graute @ 2021-02-22 15:22 UTC (permalink / raw)
  To: u-boot

On 19/02/21, Peng Fan (OSS) wrote:
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1] arm: imx8: added usbphy_regs struct
  2021-02-22 15:22   ` Oliver Graute
@ 2021-02-23  1:26     ` Peng Fan
  2021-02-23  9:16       ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Fan @ 2021-02-23  1:26 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [PATCH v1] arm: imx8: added usbphy_regs struct
> 
> On 19/02/21, Peng Fan (OSS) wrote:
> > > 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?

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.

> 
> Best regards,
> 
> Oliver

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1] arm: imx8: added usbphy_regs struct
  2021-02-23  1:26     ` Peng Fan
@ 2021-02-23  9:16       ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2021-02-23  9:16 UTC (permalink / raw)
  To: u-boot

On 2/23/21 2:26 AM, Peng Fan (OSS) wrote:
>> Subject: Re: [PATCH v1] arm: imx8: added usbphy_regs struct
>>
>> On 19/02/21, Peng Fan (OSS) wrote:
>>>> 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?
> 
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-23  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-19  9:17 [PATCH v1] arm: imx8: added usbphy_regs struct Oliver Graute
2021-02-19  9:21 ` Peng Fan
2021-02-22 15:22   ` Oliver Graute
2021-02-23  1:26     ` Peng Fan
2021-02-23  9:16       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox