mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fsl_udc: add imx6_barebox_(load/start)_usb
@ 2022-09-01 10:41 Ahmad Fatoum
  2022-09-01 11:48 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2022-09-01 10:41 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

These can be called from barebox PBL when booted from USB to continue
USB boot. This isn't necessary in the general case when RAM setup is
done via DCD, but for cases where setup is done in PBL, these helpers
come in handy. Tested on i.MX6Q.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/gadget/fsl_udc_pbl.c | 11 +++++++++++
 include/soc/fsl/fsl_udc.h        |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/drivers/usb/gadget/fsl_udc_pbl.c b/drivers/usb/gadget/fsl_udc_pbl.c
index 0fbe941b1222..8b714d4c8b02 100644
--- a/drivers/usb/gadget/fsl_udc_pbl.c
+++ b/drivers/usb/gadget/fsl_udc_pbl.c
@@ -4,6 +4,7 @@
 #include <usb/ch9.h>
 #include <soc/fsl/fsl_udc.h>
 #include <mach/imx8mm-regs.h>
+#include <mach/imx6-regs.h>
 
 static void fsl_queue_td(struct usb_dr_device *dr, struct ep_td_struct *dtd,
 			 int ep_is_in)
@@ -199,6 +200,16 @@ int imx_barebox_start_usb(void __iomem *dr, void *dest)
 	bb();
 }
 
+int imx6_barebox_load_usb(void *dest)
+{
+	return imx_barebox_load_usb(IOMEM(MX6_OTG_BASE_ADDR), dest);
+}
+
+int imx6_barebox_start_usb(void *dest)
+{
+	return imx_barebox_start_usb(IOMEM(MX6_OTG_BASE_ADDR), dest);
+}
+
 int imx8mm_barebox_load_usb(void *dest)
 {
 	return imx_barebox_load_usb(IOMEM(MX8MM_USB1_BASE_ADDR), dest);
diff --git a/include/soc/fsl/fsl_udc.h b/include/soc/fsl/fsl_udc.h
index 9fb6da58a146..aa1db2fb3816 100644
--- a/include/soc/fsl/fsl_udc.h
+++ b/include/soc/fsl/fsl_udc.h
@@ -382,6 +382,9 @@ struct ep_td_struct {
 int imx_barebox_load_usb(void __iomem *dr, void *dest);
 int imx_barebox_start_usb(void __iomem *dr, void *dest);
 
+int imx6_barebox_load_usb(void *dest);
+int imx6_barebox_start_usb(void *dest);
+
 int imx8mm_barebox_load_usb(void *dest);
 int imx8mm_barebox_start_usb(void *dest);
 
-- 
2.30.2




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

* Re: [PATCH] usb: gadget: fsl_udc: add imx6_barebox_(load/start)_usb
  2022-09-01 10:41 [PATCH] usb: gadget: fsl_udc: add imx6_barebox_(load/start)_usb Ahmad Fatoum
@ 2022-09-01 11:48 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-09-01 11:48 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Sep 01, 2022 at 12:41:53PM +0200, Ahmad Fatoum wrote:
> These can be called from barebox PBL when booted from USB to continue
> USB boot. This isn't necessary in the general case when RAM setup is
> done via DCD, but for cases where setup is done in PBL, these helpers
> come in handy. Tested on i.MX6Q.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/usb/gadget/fsl_udc_pbl.c | 11 +++++++++++
>  include/soc/fsl/fsl_udc.h        |  3 +++
>  2 files changed, 14 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/drivers/usb/gadget/fsl_udc_pbl.c b/drivers/usb/gadget/fsl_udc_pbl.c
> index 0fbe941b1222..8b714d4c8b02 100644
> --- a/drivers/usb/gadget/fsl_udc_pbl.c
> +++ b/drivers/usb/gadget/fsl_udc_pbl.c
> @@ -4,6 +4,7 @@
>  #include <usb/ch9.h>
>  #include <soc/fsl/fsl_udc.h>
>  #include <mach/imx8mm-regs.h>
> +#include <mach/imx6-regs.h>
>  
>  static void fsl_queue_td(struct usb_dr_device *dr, struct ep_td_struct *dtd,
>  			 int ep_is_in)
> @@ -199,6 +200,16 @@ int imx_barebox_start_usb(void __iomem *dr, void *dest)
>  	bb();
>  }
>  
> +int imx6_barebox_load_usb(void *dest)
> +{
> +	return imx_barebox_load_usb(IOMEM(MX6_OTG_BASE_ADDR), dest);
> +}
> +
> +int imx6_barebox_start_usb(void *dest)
> +{
> +	return imx_barebox_start_usb(IOMEM(MX6_OTG_BASE_ADDR), dest);
> +}
> +
>  int imx8mm_barebox_load_usb(void *dest)
>  {
>  	return imx_barebox_load_usb(IOMEM(MX8MM_USB1_BASE_ADDR), dest);
> diff --git a/include/soc/fsl/fsl_udc.h b/include/soc/fsl/fsl_udc.h
> index 9fb6da58a146..aa1db2fb3816 100644
> --- a/include/soc/fsl/fsl_udc.h
> +++ b/include/soc/fsl/fsl_udc.h
> @@ -382,6 +382,9 @@ struct ep_td_struct {
>  int imx_barebox_load_usb(void __iomem *dr, void *dest);
>  int imx_barebox_start_usb(void __iomem *dr, void *dest);
>  
> +int imx6_barebox_load_usb(void *dest);
> +int imx6_barebox_start_usb(void *dest);
> +
>  int imx8mm_barebox_load_usb(void *dest);
>  int imx8mm_barebox_start_usb(void *dest);
>  
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2022-09-01 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 10:41 [PATCH] usb: gadget: fsl_udc: add imx6_barebox_(load/start)_usb Ahmad Fatoum
2022-09-01 11:48 ` Sascha Hauer

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