drivers: udc_dwc2: use devicetree to configure endpoint capabilities

Although we can get the number of configured OUT and IN endpoints and
endpoint capabilities from the DWC GHWCFGn registers, we need to
configure the number of endpoint configuration structs at build time. On
some platforms, we cannot access the hardware register at pre-init, so
we use the GHWCFGn values from the devicetree to provide endpoint
capabilities. This can be considered a workaround, and we may change the
upper layer internals to avoid it in the future.

Also, add a new vendor quirk to fill in platform-specific controller
capabilities.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2024-05-14 12:22:06 +02:00 committed by Fabio Baltieri
commit 6d06a8cea9
6 changed files with 142 additions and 39 deletions

View file

@ -18,3 +18,36 @@ properties:
phys:
type: phandle
num-in-eps:
type: int
required: true
description: |
Number of configured OUT endpoints including control endpoint.
num-out-eps:
type: int
required: true
description: |
Number of configured IN endpoints including control endpoint.
ghwcfg1:
type: int
required: true
description: |
Value of the GHWCFG1 register. It is used to determine available endpoint
types during driver pre-initialization.
ghwcfg2:
type: int
required: true
description: |
Value of the GHWCFG2 register. It is used to determine available endpoint
types during driver pre-initialization.
ghwcfg4:
type: int
required: true
description: |
Value of the GHWCFG4 register. It is used to determine available endpoint
types during driver pre-initialization.