All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Axiado AX3000 and AX3005 USB Device Controller (UDC)
@ 2026-08-18  5:57 Naveen Kumar Rajgiri Bassappa
  2026-08-18  5:57 ` [PATCH v2 1/2] dt-bindings: usb: gadget: udc: add Axiado AX3000 and AX3005 UDC Naveen Kumar Rajgiri Bassappa
  2026-08-18  5:57 ` [PATCH v2 2/2] usb: gadget: udc: add Axiado AX3000 and AX3005 UDC driver Naveen Kumar Rajgiri Bassappa
  0 siblings, 2 replies; 4+ messages in thread
From: Naveen Kumar Rajgiri Bassappa @ 2026-08-18  5:57 UTC (permalink / raw)
  To: Krutik Shah, Prasad Bolisetty, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Tzu-Hao Wei,
	Karthikeyan Mitran, Philipp Zabel
  Cc: linux-usb, devicetree, linux-arm-kernel, linux-kernel, openbmc,
	Naveen Kumar Rajgiri Bassappa

Dear maintainers,

This series adds support for the USB device controller (UDC) integrated
into the Axiado AX3000 and AX3005 SoCs.

The controller is based on the Corigine USB 3.1 device IP core and uses an
xHCI-like programming model with a command ring, an event ring, and
per-endpoint transfer rings composed of Transfer Request Blocks (TRBs).

The driver integrates with the USB gadget framework and supports
High-Speed and SuperSpeed operation. It supports control, bulk, interrupt,
and isochronous transfers, including scatter-gather requests. It also
implements endpoint enable and disable, request queuing and dequeuing,
halt and wedge handling, and standard endpoint 0 control requests.

The standard |maximum-speed| Devicetree property can be used to limit the
controller to High-Speed operation. When the property is absent, the
driver defaults to SuperSpeed.

The driver was tested on AX3000 and AX3005 boards.

Signed-off-by: Naveen Kumar Rajgiri Bassappa <rbnaveenkumar@axiado.com>
---
Changes in v2:
- Drop the dual (GPL-2.0+ OR MIT) license; the driver and header are now
  GPL-2.0+ only.
- Register via module_platform_driver() and add MODULE_AUTHOR/MODULE_ALIAS
  instead of the hand-written module_init/module_exit pair.
- Acquire clock, reset and PHY through the driver model
  (devm_clk_get_optional, devm_reset_control_get_optional_exclusive,
  devm_phy_optional_get), with teardown wired up via
  devm_add_action_or_reset.
- Switch to devm_request_irq() and drop the manual free_irq() paths.
- Support multiple instances using an IDA (DEFINE_IDA/ida_alloc/ida_free)
  instead of a file-static device counter.
- Read match data with device_get_match_data() and move the former
  compile-time feature switches to DT properties (dis-u1u2-entry-quirk,
  dis-u1u2-initiation-quirk, reinit-ep0-on-bus-reset).
- Set the DMA mask via dma_set_mask_and_coherent() with a 32-bit fallback,
  and convert PM to SIMPLE_DEV_PM_OPS.
- Fix endianness handling for TRBs, events and endpoint contexts using
  cpu_to_le32()/le32_to_cpu(), and decode setup packets without casting.
- Locking: pass the caller's IRQ flags through the completion paths so the
  interrupt state is correctly restored across the unlock/lock window around
  gadget callbacks.
- Properly free all coherent DMA allocations and add
  dma_mapping_error() checks after dma_map_single()
- Fix DMA directions on the GET_STATUS/SET_SEL control transfers.
- Replace open-coded register busy-wait loops with
  readl_poll_timeout_atomic() so they time out instead of spinning forever,
  and return proper errnos (-EBUSY/-ETIMEDOUT/-EIO) instead of -1.
- Replace the custom SETF_VAR/GETF/MAKEF_VAR shift-and-mask macros with
  FIELD_PREP/FIELD_GET (include linux/bitfield.h), and use BIT()/GENMASK()
  and dma_wmb()/dma_rmb().
- Use DMA_MAPPING_ERROR instead of a private DMA_ADDR_INVALID.
- Remove the U-Boot-derived VBUS cable-detect routine, the VBUS-detect
  kthread and its wait queue, dead defines and struct fields, the unused
  interrupt-register-array macros, the mdelay()-based reset delays and the
  bulk of the dev_dbg() tracing.
- Implement the pullup(is_on == 0) path and route suspend/shutdown through
  pullup(0); mark crg_udc_ep_ops const and return IRQ_NONE from the shared
  IRQ handler when the interrupt is not ours.
- Use dev_err_probe() with structured goto-based unwinding in probe.
- Reword the Kconfig help text for USB_CRG_UDC to name the crg_udc module.
- Link to v1: https://lore.kernel.org/r/20260202-axiado-ax3000-usb-device-controller-v1-0-45ce0a8b014f@axiado.com

To: Naveen Kumar Rajgiri Bassappa <rbnaveenkumar@axiado.com>
To: Krutik Shah <krutikshah@axiado.com>
To: Prasad Bolisetty <pbolisetty@axiado.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Tzu-Hao Wei <twei@axiado.com>
To: Karthikeyan Mitran <kmitran@axiado.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-usb@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

---
Naveen Kumar Rajgiri Bassappa (2):
      dt-bindings: usb: gadget: udc: add Axiado AX3000 and AX3005 UDC
      usb: gadget: udc: add Axiado AX3000 and AX3005 UDC driver

 .../devicetree/bindings/usb/axiado,ax3000-udc.yaml |   72 +
 MAINTAINERS                                        |   10 +
 drivers/usb/gadget/udc/Kconfig                     |   14 +
 drivers/usb/gadget/udc/Makefile                    |    1 +
 drivers/usb/gadget/udc/crg_udc.c                   | 4491 ++++++++++++++++++++
 drivers/usb/gadget/udc/crg_udc.h                   |  355 ++
 6 files changed, 4943 insertions(+)
---
base-commit: 7bf68027b97bc94f6121448cb5a02ed9d04187c4
change-id: 20260128-axiado-ax3000-usb-device-controller-156d3f1840c9

Best regards,
--  
Naveen Kumar Rajgiri Bassappa <rbnaveenkumar@axiado.com>


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

end of thread, other threads:[~2026-08-18  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18  5:57 [PATCH v2 0/2] Axiado AX3000 and AX3005 USB Device Controller (UDC) Naveen Kumar Rajgiri Bassappa
2026-08-18  5:57 ` [PATCH v2 1/2] dt-bindings: usb: gadget: udc: add Axiado AX3000 and AX3005 UDC Naveen Kumar Rajgiri Bassappa
2026-08-18  5:57 ` [PATCH v2 2/2] usb: gadget: udc: add Axiado AX3000 and AX3005 UDC driver Naveen Kumar Rajgiri Bassappa
2026-08-18  6:12   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.