mbox series

[v5,0/3] pinctrl: pinctrl-zynqmp: Add Versal platform support

Message ID 20240906110113.3154327-1-sai.krishna.potthuri@amd.com
Headers show
Series pinctrl: pinctrl-zynqmp: Add Versal platform support | expand

Message

Potthuri, Sai Krishna Sept. 6, 2024, 11:01 a.m. UTC
Update the binding and pinctrl-zynqmp driver to add Versal platform
support.
Add Get Attribute ID in the Xilinx firmware driver to get the pin
information from Xilinx Platform Management Firmware.

Changes in v5:
-> 1/3 - Used the pins and groups properties references available in $defs
         for properties in "mux" (suggested by Rob).

Changes in v4:
-> 1/3 - Defined minItems for the properties, dropped the blank lines,
         dropped unused labels and unrelated nodes in example node, used
         correct email address (suggested by Krzysztof).

Changes in v3:
-> 1/3 - Mentioned all group names in conf node and also defined the
         conf node properties in $defs (suggested by Rob).

Changes in v2:
-> 1/3 - Created new binding doc for Versal platform (suggested by Rob).
-> 1/3 - Update regex for pins properties to make sure it always starts
         with "LPD" or "PMC" string.
-> 3/3 - Used firmware API to get platform information to differentiate
         platform specific code (suggested by Jay).

Sai Krishna Potthuri (3):
  dt-bindings: pinctrl: Add support for Xilinx Versal platform
  firmware: xilinx: Add Pinctrl Get Attribute ID
  pinctrl: pinctrl-zynqmp: Add support for Versal platform

 .../bindings/pinctrl/xlnx,versal-pinctrl.yaml | 278 ++++++++++++++++++
 drivers/pinctrl/pinctrl-zynqmp.c              |  97 +++++-
 include/linux/firmware/xlnx-zynqmp.h          |   1 +
 3 files changed, 371 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/xlnx,versal-pinctrl.yaml

Comments

Thangaraj, Senthil Nathan Sept. 9, 2024, 5:03 p.m. UTC | #1
Hi Sai Krishna,

Please find my review below.

Thanks,
Senthil

> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> Behalf Of Sai Krishna Potthuri
> Sent: Friday, September 6, 2024 4:01 AM
> To: Linus Walleij <linus.walleij@linaro.org>; Simek, Michal
> <michal.simek@amd.com>; Rob Herring <robh@kernel.org>; Krzysztof
> Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>;
> Buddhabhatti, Jay <jay.buddhabhatti@amd.com>; Kundanala, Praveen Teja
> <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> gpio@vger.kernel.org; devicetree@vger.kernel.org;
> saikrishna12468@gmail.com; git (AMD-Xilinx) <git@amd.com>; Potthuri, Sai
> Krishna <sai.krishna.potthuri@amd.com>
> Subject: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get Attribute ID
> 
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
> 
> 
> Add Pinctrl Get Attribute ID to the query ids list.
> 
> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
> ---
>  include/linux/firmware/xlnx-zynqmp.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/firmware/xlnx-zynqmp.h
> b/include/linux/firmware/xlnx-zynqmp.h
> index d7d07afc0532..3b4ce4ec5d3f 100644
> --- a/include/linux/firmware/xlnx-zynqmp.h
> +++ b/include/linux/firmware/xlnx-zynqmp.h
> @@ -238,6 +238,7 @@ enum pm_query_id {
>         PM_QID_PINCTRL_GET_PIN_GROUPS = 11,
>         PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
>         PM_QID_CLOCK_GET_MAX_DIVISOR = 13,
> +       PM_QID_PINCTRL_GET_ATTRIBUTES = 15,

Any reason why do you need to skip 14 and use 15 here ?

>  };
> 
>  enum rpu_oper_mode {
> --
> 2.25.1
>
Potthuri, Sai Krishna Sept. 10, 2024, 5:58 a.m. UTC | #2
Hi Senthil,

> -----Original Message-----
> From: Thangaraj, Senthil Nathan <SenthilNathan.Thangaraj@amd.com>
> Sent: Monday, September 9, 2024 10:33 PM
> To: Potthuri, Sai Krishna <sai.krishna.potthuri@amd.com>; Linus Walleij
> <linus.walleij@linaro.org>; Simek, Michal <michal.simek@amd.com>; Rob
> Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>;
> Conor Dooley <conor+dt@kernel.org>; Buddhabhatti, Jay
> <jay.buddhabhatti@amd.com>; Kundanala, Praveen Teja
> <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> linux-gpio@vger.kernel.org; devicetree@vger.kernel.org;
> saikrishna12468@gmail.com; git (AMD-Xilinx) <git@amd.com>; Potthuri, Sai
> Krishna <sai.krishna.potthuri@amd.com>
> Subject: RE: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get Attribute ID
> 
> Hi Sai Krishna,
> 
> Please find my review below.
> 
> Thanks,
> Senthil
> 
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org>
> > On Behalf Of Sai Krishna Potthuri
> > Sent: Friday, September 6, 2024 4:01 AM
> > To: Linus Walleij <linus.walleij@linaro.org>; Simek, Michal
> > <michal.simek@amd.com>; Rob Herring <robh@kernel.org>; Krzysztof
> > Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>;
> > Buddhabhatti, Jay <jay.buddhabhatti@amd.com>; Kundanala, Praveen Teja
> > <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org>
> > Cc: linux-arm-kernel@lists.infradead.org;
> > linux-kernel@vger.kernel.org; linux- gpio@vger.kernel.org;
> > devicetree@vger.kernel.org; saikrishna12468@gmail.com; git
> > (AMD-Xilinx) <git@amd.com>; Potthuri, Sai Krishna
> > <sai.krishna.potthuri@amd.com>
> > Subject: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get Attribute ID
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Add Pinctrl Get Attribute ID to the query ids list.
> >
> > Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
> > ---
> >  include/linux/firmware/xlnx-zynqmp.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/firmware/xlnx-zynqmp.h
> > b/include/linux/firmware/xlnx-zynqmp.h
> > index d7d07afc0532..3b4ce4ec5d3f 100644
> > --- a/include/linux/firmware/xlnx-zynqmp.h
> > +++ b/include/linux/firmware/xlnx-zynqmp.h
> > @@ -238,6 +238,7 @@ enum pm_query_id {
> >         PM_QID_PINCTRL_GET_PIN_GROUPS = 11,
> >         PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
> >         PM_QID_CLOCK_GET_MAX_DIVISOR = 13,
> > +       PM_QID_PINCTRL_GET_ATTRIBUTES = 15,
> 
> Any reason why do you need to skip 14 and use 15 here ?
This is based on the ID defined in the Xilinx Platform Management Firmware.
Whatever the ID defined by the Xilinx firmware to handle this functionality,
the same ID is used here. ID 14 might be used for another query function but
Linux use cases might not be using it.

Regards
Sai Krishna
Thangaraj, Senthil Nathan Sept. 11, 2024, 5:10 p.m. UTC | #3
Got it, LGTM thanks.

> -----Original Message-----
> From: Potthuri, Sai Krishna <sai.krishna.potthuri@amd.com>
> Sent: Monday, September 9, 2024 10:58 PM
> To: Thangaraj, Senthil Nathan <SenthilNathan.Thangaraj@amd.com>; Linus
> Walleij <linus.walleij@linaro.org>; Simek, Michal <michal.simek@amd.com>;
> Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>;
> Conor Dooley <conor+dt@kernel.org>; Buddhabhatti, Jay
> <jay.buddhabhatti@amd.com>; Kundanala, Praveen Teja
> <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> gpio@vger.kernel.org; devicetree@vger.kernel.org;
> saikrishna12468@gmail.com; git (AMD-Xilinx) <git@amd.com>
> Subject: RE: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get Attribute ID
> 
> Hi Senthil,
> 
> > -----Original Message-----
> > From: Thangaraj, Senthil Nathan <SenthilNathan.Thangaraj@amd.com>
> > Sent: Monday, September 9, 2024 10:33 PM
> > To: Potthuri, Sai Krishna <sai.krishna.potthuri@amd.com>; Linus
> > Walleij <linus.walleij@linaro.org>; Simek, Michal
> > <michal.simek@amd.com>; Rob Herring <robh@kernel.org>; Krzysztof
> > Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>;
> > Buddhabhatti, Jay <jay.buddhabhatti@amd.com>; Kundanala, Praveen Teja
> > <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org>
> > Cc: linux-arm-kernel@lists.infradead.org;
> > linux-kernel@vger.kernel.org; linux-gpio@vger.kernel.org;
> > devicetree@vger.kernel.org; saikrishna12468@gmail.com; git
> > (AMD-Xilinx) <git@amd.com>; Potthuri, Sai Krishna
> > <sai.krishna.potthuri@amd.com>
> > Subject: RE: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get
> > Attribute ID
> >
> > Hi Sai Krishna,
> >
> > Please find my review below.
> >
> > Thanks,
> > Senthil
> >
> > > -----Original Message-----
> > > From: linux-arm-kernel
> > > <linux-arm-kernel-bounces@lists.infradead.org>
> > > On Behalf Of Sai Krishna Potthuri
> > > Sent: Friday, September 6, 2024 4:01 AM
> > > To: Linus Walleij <linus.walleij@linaro.org>; Simek, Michal
> > > <michal.simek@amd.com>; Rob Herring <robh@kernel.org>; Krzysztof
> > > Kozlowski <krzk+dt@kernel.org>; Conor Dooley <conor+dt@kernel.org>;
> > > Buddhabhatti, Jay <jay.buddhabhatti@amd.com>; Kundanala, Praveen
> > > Teja <praveen.teja.kundanala@amd.com>; Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org>
> > > Cc: linux-arm-kernel@lists.infradead.org;
> > > linux-kernel@vger.kernel.org; linux- gpio@vger.kernel.org;
> > > devicetree@vger.kernel.org; saikrishna12468@gmail.com; git
> > > (AMD-Xilinx) <git@amd.com>; Potthuri, Sai Krishna
> > > <sai.krishna.potthuri@amd.com>
> > > Subject: [PATCH v5 2/3] firmware: xilinx: Add Pinctrl Get Attribute
> > > ID
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Add Pinctrl Get Attribute ID to the query ids list.
> > >
> > > Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
> > > ---
> > >  include/linux/firmware/xlnx-zynqmp.h | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/include/linux/firmware/xlnx-zynqmp.h
> > > b/include/linux/firmware/xlnx-zynqmp.h
> > > index d7d07afc0532..3b4ce4ec5d3f 100644
> > > --- a/include/linux/firmware/xlnx-zynqmp.h
> > > +++ b/include/linux/firmware/xlnx-zynqmp.h
> > > @@ -238,6 +238,7 @@ enum pm_query_id {
> > >         PM_QID_PINCTRL_GET_PIN_GROUPS = 11,
> > >         PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
> > >         PM_QID_CLOCK_GET_MAX_DIVISOR = 13,
> > > +       PM_QID_PINCTRL_GET_ATTRIBUTES = 15,
> >
> > Any reason why do you need to skip 14 and use 15 here ?
> This is based on the ID defined in the Xilinx Platform Management Firmware.
> Whatever the ID defined by the Xilinx firmware to handle this functionality, the
> same ID is used here. ID 14 might be used for another query function but Linux
> use cases might not be using it.
> 
> Regards
> Sai Krishna
Linus Walleij Sept. 23, 2024, 8:42 a.m. UTC | #4
On Fri, Sep 6, 2024 at 1:01 PM Sai Krishna Potthuri
<sai.krishna.potthuri@amd.com> wrote:

> Update the binding and pinctrl-zynqmp driver to add Versal platform
> support.
> Add Get Attribute ID in the Xilinx firmware driver to get the pin
> information from Xilinx Platform Management Firmware.
>
> Changes in v5:
> -> 1/3 - Used the pins and groups properties references available in $defs
>          for properties in "mux" (suggested by Rob).

Patches applied!

Yours,
Linus Walleij