summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-10-17 09:10:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-27 11:13:29 +0200
commit8b6338227e06a0ca2b31a974a99e81bae084ffe4 (patch)
tree2994982251af95e0771882dd019b9b3fe4874262
parent93ee59c68b33c856b0d6ce05f4fa87c3aa6ce56c (diff)
downloadbarebox-8b6338227e06a0ca2b31a974a99e81bae084ffe4.tar.gz
barebox-8b6338227e06a0ca2b31a974a99e81bae084ffe4.tar.xz
usb: gadget: fsl_udc: add imx7_barebox_(load/start)_usb
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.MX7D revision 1.2. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221017071036.1458761-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/gadget/fsl_udc_pbl.c11
-rw-r--r--include/soc/fsl/fsl_udc.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_udc_pbl.c b/drivers/usb/gadget/fsl_udc_pbl.c
index 8b714d4c8b..d2f2b9e195 100644
--- a/drivers/usb/gadget/fsl_udc_pbl.c
+++ b/drivers/usb/gadget/fsl_udc_pbl.c
@@ -5,6 +5,7 @@
#include <soc/fsl/fsl_udc.h>
#include <mach/imx8mm-regs.h>
#include <mach/imx6-regs.h>
+#include <mach/imx7-regs.h>
static void fsl_queue_td(struct usb_dr_device *dr, struct ep_td_struct *dtd,
int ep_is_in)
@@ -210,6 +211,16 @@ int imx6_barebox_start_usb(void *dest)
return imx_barebox_start_usb(IOMEM(MX6_OTG_BASE_ADDR), dest);
}
+int imx7_barebox_load_usb(void *dest)
+{
+ return imx_barebox_load_usb(IOMEM(MX7_OTG1_BASE_ADDR), dest);
+}
+
+int imx7_barebox_start_usb(void *dest)
+{
+ return imx_barebox_start_usb(IOMEM(MX7_OTG1_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 aa1db2fb38..c1abe222ba 100644
--- a/include/soc/fsl/fsl_udc.h
+++ b/include/soc/fsl/fsl_udc.h
@@ -385,6 +385,9 @@ 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 imx7_barebox_load_usb(void *dest);
+int imx7_barebox_start_usb(void *dest);
+
int imx8mm_barebox_load_usb(void *dest);
int imx8mm_barebox_start_usb(void *dest);