Skip to contentSkip to conversation

usb: gadget: udc: add UDC driver for NPCM SoCs

PATCH New Tomer Maimon 1 participant 3 messages Aug 11, 2022

Subsystems (3)
lore
Share & tools
lore

Tomer Maimon

author maintainer
#0 lore raw

cover usb: gadget: udc: add UDC driver for NPCM SoCs

This patch set add NPCM USB device controller(UDC) Baseboard Management Controller(BMC) support.

This patchset was tested on the Arbel NPCM8XX evaluation board that running Arbel OpenBMC.

Tomer Maimon (2):
dt-binding: usb: Add NPCM UDC binding documentation
usb: gadget: udc: add NPCM UDC support

 .../devicetree/bindings/usb/npcm-udc.txt      |   33 +
 drivers/usb/gadget/udc/Kconfig                |   11 +
 drivers/usb/gadget/udc/Makefile               |    1 +
 drivers/usb/gadget/udc/npcm_udc.c             | 3250 +++++++++++++++++
 4 files changed, 3295 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/npcm-udc.txt
 create mode 100644 drivers/usb/gadget/udc/npcm_udc.c
Signature · 1 line
2.33.0
author maintainer
#1 lore raw

PATCH 1/2 dt-binding: usb: Add NPCM UDC binding documentation

This patch adds device tree binding documentation for the NPCM BMC USB Device Controller (UDC).

---
 .../devicetree/bindings/usb/npcm-udc.txt      | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/npcm-udc.txt
Documentation/devicetree/bindings/usb/npcm-udc.txt new file +33 -0
new file mode 100644
index 000000000000..938d163ad681
@@ -0,0 +1,33 @@
+Nuvoton NPCM USB Device controller.
+
+This DT-binding describe Nuvoton NPCM USB Device controller (UDC) device node.
+The UDC is based on Chipidea Subsystem Device Controller IP.
+
+Required properties:
+- compatible	  : "nuvoton,npcm750-udc" for Poleg NPCM7XX.
+		    "nuvoton,npcm845-udc" for Arbel NPCM8XX.
+- reg             : Offset and length of the register set for the device,
+		    Offset and length of the DTD buffer.
+- interrupts      : Contain the UDC interrupt.
+- clocks          : phandle of UDC reference clock.
+- clock-names     : Should be "clk_usb_bridge".
+
+Note: Each npcm-udc which should have an alias correctly numbered
+in "aliases" node.
+
+e.g.
+aliases {
+	udc1 = &udc1;
+};
+
+Example:
+		udc0:udc@f0830000 {
+			compatible = "nuvoton,npcm750-udc";
+			reg = <0xf0830000 0x1000
+			       0xfffd0000 0x800>;
+			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+			clocks = <&clk NPCM7XX_CLK_SU>;
+			clock-names = "clk_usb_bridge";
+		};
+
Signature · 1 line
2.33.0
author maintainer
#2 lore raw

PATCH 2/2 usb: gadget: udc: add NPCM UDC support

In reply to Tomer Maimon

This patch adds NPCM USB Device controller (UDC) support to NPCM BMC SoC.

---
 drivers/usb/gadget/udc/Kconfig    |   11 +
 drivers/usb/gadget/udc/Makefile   |    1 +
 drivers/usb/gadget/udc/npcm_udc.c | 3250 +++++++++++++++++++++++++++++
 3 files changed, 3262 insertions(+)
 create mode 100644 drivers/usb/gadget/udc/npcm_udc.c
drivers/usb/gadget/udc/Kconfig +11 -0
index 69394dc1cdfb..bc2b5c116796 100644
@@ -463,6 +463,17 @@ config USB_TEGRA_XUDC
 	 dynamically linked module called "tegra_xudc" and force all
 	 gadget drivers to also be dynamically linked.
 
+config USB_NPCM_UDC
+	bool "NPCM USB Device Controller"
+	depends on ARCH_NPCM
+	depends on USB_GADGET
+	help
+	 Enables Nuvoton NPCM USB device controller driver.
+
+	 Say "y" to link the driver statically, or "m" to build a
+	 dynamically linked module called "npcm-udc" and force
+	 all gadget drivers to also be dynamically linked.
+
 source "drivers/usb/gadget/udc/aspeed-vhub/Kconfig"
 
 #
drivers/usb/gadget/udc/Makefile +1 -0
index a21f2224e7eb..4867b7fcb8bc 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_MV_U3D)	+= mv_u3d_core.o
 obj-$(CONFIG_USB_GR_UDC)	+= gr_udc.o
 obj-$(CONFIG_USB_GADGET_XILINX)	+= udc-xilinx.o
 obj-$(CONFIG_USB_SNP_UDC_PLAT) += snps_udc_plat.o
+obj-$(CONFIG_USB_NPCM_UDC)	+= npcm_udc.o
 obj-$(CONFIG_USB_ASPEED_VHUB)	+= aspeed-vhub/
 obj-$(CONFIG_USB_BDC_UDC)	+= bdc/
 obj-$(CONFIG_USB_MAX3420_UDC)	+= max3420_udc.o
drivers/usb/gadget/udc/npcm_udc.c new file +3250 -0

2,976 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.33.0

Part of the diff is not shown here. View the raw message.