mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] added zynq 7000 usb support
@ 2025-05-23 16:21 Johannes Roith
  2025-05-26 13:45 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Roith @ 2025-05-23 16:21 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox, michael.graichen, a.fatoum, Johannes Roith

This adds support to use the USB interface on Zynq-7000 SoC.

Signed-off-by: Michael Graichen <michael.graichen@hotmail.com>
Signed-off-by: Johannes Roith <johannes@gnu-linux.rocks>
---
 drivers/usb/host/Kconfig     |  8 ++++++++
 drivers/usb/host/Makefile    |  1 +
 drivers/usb/host/ehci-zynq.c | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100644 drivers/usb/host/ehci-zynq.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index d38b4dcac4..812270f869 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -14,6 +14,14 @@ config USB_EHCI_ATMEL
 	select USB_OHCI_AT91
 	bool "Atmel EHCI driver"
 
+config USB_EHCI_ZYNQ
+	bool "Support for Xilinx Zynq on-chip EHCI USB controller"
+	depends on ARCH_ZYNQ
+	depends on USB_EHCI
+	select USB_ULPI
+	help
+	  Enable support for Zynq on-chip EHCI USB controller
+
 config USB_OHCI
 	bool "OHCI driver"
 	depends on !MMU && HAS_DMA
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index e55dff4580..cbddfbe923 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -2,6 +2,7 @@
 obj-$(CONFIG_USB_EHCI)		+= ehci-hcd.o
 obj-$(CONFIG_USB_EHCI_OMAP)	+= ehci-omap.o
 obj-$(CONFIG_USB_EHCI_ATMEL)	+= ehci-atmel.o
+obj-$(CONFIG_USB_EHCI_ZYNQ)	+= ehci-zynq.o
 obj-$(CONFIG_USB_OHCI)		+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_AT91)	+= ohci-at91.o
 obj-$(CONFIG_USB_XHCI)		+= xhci.o xhci-mem.o xhci-ring.o
diff --git a/drivers/usb/host/ehci-zynq.c b/drivers/usb/host/ehci-zynq.c
new file mode 100644
index 0000000000..13b551d091
--- /dev/null
+++ b/drivers/usb/host/ehci-zynq.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * USB Low level initialization(Specific to Zynq 7000)
+ */
+
+#include <common.h>
+#include <linux/usb/ulpi.h>
+
+static int zynq_ehci_probe(struct device_d *dev)
+{
+	struct resource *res;
+	void __iomem *base;
+
+	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
+	if (IS_ERR(res))
+		return PTR_ERR(res);
+
+	base = IOMEM(res->start);
+
+	ulpi_setup(base + 0x170, 1);
+	add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, (unsigned int)base, NULL);
+
+	return 0;
+}
+
+static const struct of_device_id zynq_ehci_dt_ids[] = {
+	{ .compatible = "xlnx,zynq-usb-2.20a" },
+	{ /* sentinel */ }
+};
+
+static struct driver_d zynq_ehci_driver = {
+	.name = "zynq-ehci",
+	.probe = zynq_ehci_probe,
+	.of_compatible = DRV_OF_COMPAT(zynq_ehci_dt_ids),
+};
+device_platform_driver(zynq_ehci_driver);
-- 
2.39.5




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

* Re: [PATCH v2] added zynq 7000 usb support
  2025-05-23 16:21 [PATCH v2] added zynq 7000 usb support Johannes Roith
@ 2025-05-26 13:45 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-05-26 13:45 UTC (permalink / raw)
  To: Johannes Roith; +Cc: barebox, michael.graichen, a.fatoum


On Fri, 23 May 2025 18:21:19 +0200, Johannes Roith wrote:
> This adds support to use the USB interface on Zynq-7000 SoC.
> 
> 

Applied, thanks!

[1/1] added zynq 7000 usb support
      https://git.pengutronix.de/cgit/barebox/commit/?id=c69d280f3137 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-05-26 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-23 16:21 [PATCH v2] added zynq 7000 usb support Johannes Roith
2025-05-26 13:45 ` Sascha Hauer

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