mbox series

[v4,0/3] usb: ChipIdea: add Nuvoton NPCM UDC support

Message ID 20231003110130.229711-1-tmaimon77@gmail.com
Headers show
Series usb: ChipIdea: add Nuvoton NPCM UDC support | expand

Message

Tomer Maimon Oct. 3, 2023, 11:01 a.m. UTC
This patch set add USB device controller for the NPCM Baseboard
Management Controllers (BMC).

NPCM UDC driver is a part of the USB ChipIdea driver.

Adding CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag to modify the vbus_active
parameter to active in case the ChipIdea USB IP role is device-only and
there is no otgsc register.

BMC NPCM7XX and BMC NPCM8XX has ten identical NPCM UDC modules,

The NPCM UDC were tested on NPCM845 evaluation board.

Changes since version 3:
 - Add Acked-by Peter Chen.
 
Changes since version 2:
 - Use dev_err_probe.
 - Remove MODULE_ALIAS.

Changes since version 1:
 - Add SoC specific compatible.
 - Remove USB phy mux property from dt-binding, will be handled differently.
 - Add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS commit to this patch set.

Tomer Maimon (3):
  usb: chipidea: add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag
  dt-bindings: usb: ci-hdrc-usb2: add npcm750 and npcm845 compatible
  usb: chipidea: Add support for NPCM

 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml |   4 +
 drivers/usb/chipidea/Kconfig                  |   4 +
 drivers/usb/chipidea/Makefile                 |   1 +
 drivers/usb/chipidea/ci_hdrc_npcm.c           | 114 ++++++++++++++++++
 drivers/usb/chipidea/otg.c                    |   5 +-
 include/linux/usb/chipidea.h                  |   1 +
 6 files changed, 128 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/chipidea/ci_hdrc_npcm.c

Comments

Krzysztof Kozlowski Oct. 4, 2023, 8:03 a.m. UTC | #1
On 03/10/2023 13:01, Tomer Maimon wrote:
> Add a compatible string for Nuvoton BMC NPCM750 and Nuvoton BMC NPCM845.
> 
> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
> ---
>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> index 1394557517b1..a9e173432002 100644
> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> @@ -16,6 +16,8 @@ properties:
>        - enum:
>            - chipidea,usb2
>            - lsi,zevio-usb
> +          - nuvoton,npcm750-udc
> +          - nuvoton,npcm845-udc

Your driver clearly suggests these are compatible. If they are not, why
commit msg does no explain anything here?

Best regards,
Krzysztof
Tomer Maimon Oct. 5, 2023, 10:46 a.m. UTC | #2
Hi Krzysztof,

Thanks for your comment

On Wed, 4 Oct 2023 at 11:03, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 03/10/2023 13:01, Tomer Maimon wrote:
> > Add a compatible string for Nuvoton BMC NPCM750 and Nuvoton BMC NPCM845.
> >
> > Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
> > ---
> >  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> > index 1394557517b1..a9e173432002 100644
> > --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
> > @@ -16,6 +16,8 @@ properties:
> >        - enum:
> >            - chipidea,usb2
> >            - lsi,zevio-usb
> > +          - nuvoton,npcm750-udc
> > +          - nuvoton,npcm845-udc
>
> Your driver clearly suggests these are compatible. If they are not, why
> commit msg does no explain anything here?
Do you mean to add nuvoton,npcmxxx-udc as described below to the end
of the compatible property?
      - items:
          - enum:
              - nuvoton,npcm845-udc
          - const: nuvoton,npcm750-udc
>
> Best regards,
> Krzysztof
>

Best regards,

Tomer
Krzysztof Kozlowski Oct. 5, 2023, 11:27 a.m. UTC | #3
On 05/10/2023 12:46, Tomer Maimon wrote:
> Hi Krzysztof,
> 
> Thanks for your comment
> 
> On Wed, 4 Oct 2023 at 11:03, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 03/10/2023 13:01, Tomer Maimon wrote:
>>> Add a compatible string for Nuvoton BMC NPCM750 and Nuvoton BMC NPCM845.
>>>
>>> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
>>> ---
>>>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
>>> index 1394557517b1..a9e173432002 100644
>>> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
>>> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml
>>> @@ -16,6 +16,8 @@ properties:
>>>        - enum:
>>>            - chipidea,usb2
>>>            - lsi,zevio-usb
>>> +          - nuvoton,npcm750-udc
>>> +          - nuvoton,npcm845-udc
>>
>> Your driver clearly suggests these are compatible. If they are not, why
>> commit msg does no explain anything here?
> Do you mean to add nuvoton,npcmxxx-udc as described below to the end
> of the compatible property?
>       - items:
>           - enum:
>               - nuvoton,npcm845-udc
>           - const: nuvoton,npcm750-udc

For the 845 yes. Of course you also need enum entry for 750.

Best regards,
Krzysztof