Re: [PATCH v2] usb: cdnsp: Add support for device-only configuration

From: Peter Chen (CIX)

Date: Wed May 06 2026 - 21:05:21 EST


On 26-05-06 10:31:48, Pawel Laszczak wrote:
> >I still concern this, CIX SoC has host-only configuration, and it needs to use
> >cdns3 driver for low power purpose, eg set D3 mode for controller.
>
> If dr_mode is set to 'host' or 'peripheral' and the OTG IRQ is not configured
> in the DTS, the driver will detect this as no_drd. This may be inconsistent
> with the actual hardware state, as the DRD component might still exist.
> It might be safer to revert to the version where no_drd is not detected
> based on the otg_irq, and instead add a no_drd property in cdnsp_pci.c.
> If necessary, this can also be added to the DTS.
> This should fully ensure the correct operation of existing platforms.
>
> With this approach, for the sake of completeness, we could set
> USB_DR_MODE_HOST or USB_DR_MODE_PERIPHERAL in the condition
> above based on dr_mode.

I agree with you that introduce one property for no OTG hardware
block, and make judgment in driver.

Peter
>
> >
> >> regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res);
> >> if (IS_ERR(regs))
> >> return PTR_ERR(regs);
> >> @@ -500,6 +515,9 @@ int cdns_drd_exit(struct cdns *cdns)
> >> /* Indicate the cdns3 core was power lost before */ bool
> >> cdns_power_is_lost(struct cdns *cdns) {
> >> + if (cdns->no_drd)
> >> + return false;
> >> +
> >
> >You may not just return false, would you please find one host and one device
> >register to compare, we need this feature.
>
> Also this condition will be correct for existing platforms.
>
> Does this look correct to you?
>
> Pawel
> >
> >Peter
> >
> >> if (cdns->version == CDNS3_CONTROLLER_V0) {
> >> if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0)))
> >> return true;
> >> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index
> >> 24cb42f66e4b..a6b9b6f6d8cc 100644
> >> --- a/include/linux/pci_ids.h
> >> +++ b/include/linux/pci_ids.h
> >> @@ -2424,6 +2424,7 @@
> >> #define PCI_DEVICE_ID_CDNS_USBSS 0x0100
> >> #define PCI_DEVICE_ID_CDNS_USB 0x0120
> >> #define PCI_DEVICE_ID_CDNS_USBSSP 0x0200
> >> +#define PCI_DEVICE_ID_CDNS_UDC_USBSSP 0x0400
> >>
> >> #define PCI_VENDOR_ID_ARECA 0x17d3
> >> #define PCI_DEVICE_ID_ARECA_1110 0x1110
> >>
> >> ---
> >> base-commit: 9d0d467c3572e93c5faa2e5906a8bbcd70b24efd
> >> change-id: 20260505-device_only_branch_v2-53692f329752
> >>
> >> Best regards,
> >> --
> >> Pawel Laszczak <pawell@xxxxxxxxxxx>
> >>
> >>
> >
> >--
> >
> >Best regards,
> >Peter

--

Best regards,
Peter