mbox series

[v4,0/7] riscv: sophgo: Add pinctrl support for CV1800 series SoC

Message ID IA1PR20MB4953DC78BB0FE0C57EA94F91BBB32@IA1PR20MB4953.namprd20.prod.outlook.com
Headers show
Series riscv: sophgo: Add pinctrl support for CV1800 series SoC | expand

Message

Inochi Amaoto Aug. 2, 2024, 12:33 a.m. UTC
Add basic pinctrl driver for Sophgo CV1800 series SoCs.
This patch series aims to replace the previous patch from Jisheng [1].
Since the pinctrl of cv1800 has nested mux and its pin definination
is discrete, it is not suitable to use "pinctrl-single" to cover the
pinctrl device.

This patch require another patch [2] that provides standard attribute
"input-schmitt-microvolt"

Note: As current documentation is not enough to guess the pin
configuration of Huashan Pi, only the pinctrl node is added.

[1] https://lore.kernel.org/linux-riscv/20231113005702.2467-1-jszhang@kernel.org/
[2] https://lore.kernel.org/all/IA1PR20MB495346246245074234D337A6BBAC2@IA1PR20MB4953.namprd20.prod.outlook.com/

Changed from v3:
1. binding: drop unnecessary type
2. binding: use right ref for pin node.
3. binding: remove mixed spaces and tabs.

Changed from v2:
1. remove unused export function.
2. drop "drive-strength" and only use "drive-strength-microamp" in
the binding.
3. drop unnecessary ref in the binding.
4. drop unnecessary entry for binding example.

Changed from v1:
1. replace attribute "sophgo,bus-holder" with standard "bias-bus-hold".
2. replace attribute "input-schmitt" with "input-schmitt-microvolt".
3. add vddio operations support to report pin state.

Inochi Amaoto (7):
  dt-bindings: pinctrl: Add pinctrl for Sophgo CV1800 series SoC.
  pinctrl: sophgo: add support for CV1800B SoC
  pinctrl: sophgo: add support for CV1812H SoC
  pinctrl: sophgo: add support for SG2000 SoC
  pinctrl: sophgo: add support for SG2002 SoC
  riscv: dts: sophgo: cv1800b: add pinctrl support
  riscv: dts: sophgo: cv1812h: add pinctrl support

 .../pinctrl/sophgo,cv1800-pinctrl.yaml        | 122 +++
 .../boot/dts/sophgo/cv1800b-milkv-duo.dts     |  49 ++
 arch/riscv/boot/dts/sophgo/cv1800b.dtsi       |  10 +
 arch/riscv/boot/dts/sophgo/cv1812h.dtsi       |  10 +
 drivers/pinctrl/Kconfig                       |   1 +
 drivers/pinctrl/Makefile                      |   1 +
 drivers/pinctrl/sophgo/Kconfig                |  54 ++
 drivers/pinctrl/sophgo/Makefile               |   7 +
 drivers/pinctrl/sophgo/pinctrl-cv1800b.c      | 462 +++++++++++
 drivers/pinctrl/sophgo/pinctrl-cv1812h.c      | 771 ++++++++++++++++++
 drivers/pinctrl/sophgo/pinctrl-cv18xx.c       | 765 +++++++++++++++++
 drivers/pinctrl/sophgo/pinctrl-cv18xx.h       | 155 ++++
 drivers/pinctrl/sophgo/pinctrl-sg2000.c       | 771 ++++++++++++++++++
 drivers/pinctrl/sophgo/pinctrl-sg2002.c       | 542 ++++++++++++
 include/dt-bindings/pinctrl/pinctrl-cv1800b.h |  63 ++
 include/dt-bindings/pinctrl/pinctrl-cv1812h.h | 127 +++
 include/dt-bindings/pinctrl/pinctrl-cv18xx.h  |  19 +
 include/dt-bindings/pinctrl/pinctrl-sg2000.h  | 127 +++
 include/dt-bindings/pinctrl/pinctrl-sg2002.h  |  79 ++
 19 files changed, 4135 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/sophgo,cv1800-pinctrl.yaml
 create mode 100644 drivers/pinctrl/sophgo/Kconfig
 create mode 100644 drivers/pinctrl/sophgo/Makefile
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-cv1800b.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-cv1812h.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-cv18xx.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-cv18xx.h
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2000.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2002.c
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-cv1800b.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-cv1812h.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-cv18xx.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2000.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2002.h


base-commit: 0066cdb6d7427d785e1a878070c4990384b93508
prerequisite-patch-id: 11fce0bb5b2e9784ec7d6086d5d5e9979360384f
prerequisite-patch-id: 3d5f38fdb9d8250dd9872ab72ab7a438281b4a03
--
2.46.0

Comments

Linus Walleij Aug. 23, 2024, 3:44 p.m. UTC | #1
On Fri, Aug 2, 2024 at 2:34 AM Inochi Amaoto <inochiama@outlook.com> wrote:

> Add basic pinctrl driver for Sophgo CV1800 series SoCs.
> This patch series aims to replace the previous patch from Jisheng [1].
> Since the pinctrl of cv1800 has nested mux and its pin definination
> is discrete, it is not suitable to use "pinctrl-single" to cover the
> pinctrl device.
>
> This patch require another patch [2] that provides standard attribute
> "input-schmitt-microvolt"
>
> Note: As current documentation is not enough to guess the pin
> configuration of Huashan Pi, only the pinctrl node is added.
>
> [1] https://lore.kernel.org/linux-riscv/20231113005702.2467-1-jszhang@kernel.org/
> [2] https://lore.kernel.org/all/IA1PR20MB495346246245074234D337A6BBAC2@IA1PR20MB4953.namprd20.prod.outlook.com/
>
> Changed from v3:
> 1. binding: drop unnecessary type
> 2. binding: use right ref for pin node.
> 3. binding: remove mixed spaces and tabs.

This v4 looks good to me and has necessary ACKs.

It contains device tree patches which I am icky to merge but
I can merge the rest and give you an immutable branch in the
pinctrl tree that the ARM SoC maintainers can pull in to
merge the device trees, does this work for you?

Yours,
Linus Walleij
Inochi Amaoto Aug. 24, 2024, 11:25 a.m. UTC | #2
On Fri, Aug 23, 2024 at 05:44:17PM GMT, Linus Walleij wrote:
> On Fri, Aug 2, 2024 at 2:34 AM Inochi Amaoto <inochiama@outlook.com> wrote:
> 
> > Add basic pinctrl driver for Sophgo CV1800 series SoCs.
> > This patch series aims to replace the previous patch from Jisheng [1].
> > Since the pinctrl of cv1800 has nested mux and its pin definination
> > is discrete, it is not suitable to use "pinctrl-single" to cover the
> > pinctrl device.
> >
> > This patch require another patch [2] that provides standard attribute
> > "input-schmitt-microvolt"
> >
> > Note: As current documentation is not enough to guess the pin
> > configuration of Huashan Pi, only the pinctrl node is added.
> >
> > [1] https://lore.kernel.org/linux-riscv/20231113005702.2467-1-jszhang@kernel.org/
> > [2] https://lore.kernel.org/all/IA1PR20MB495346246245074234D337A6BBAC2@IA1PR20MB4953.namprd20.prod.outlook.com/
> >
> > Changed from v3:
> > 1. binding: drop unnecessary type
> > 2. binding: use right ref for pin node.
> > 3. binding: remove mixed spaces and tabs.
> 
> This v4 looks good to me and has necessary ACKs.
> 
> It contains device tree patches which I am icky to merge but
> I can merge the rest and give you an immutable branch in the
> pinctrl tree that the ARM SoC maintainers can pull in to
> merge the device trees, does this work for you?
> 
> Yours,
> Linus Walleij

Hi, Linus

It is OK for me, Thanks for taking it.

Regard,
Inochi
Linus Walleij Aug. 26, 2024, 9:16 a.m. UTC | #3
On Sat, Aug 24, 2024 at 1:26 PM Inochi Amaoto <inochiama@outlook.com> wrote:
> On Fri, Aug 23, 2024 at 05:44:17PM GMT, Linus Walleij wrote:
> > On Fri, Aug 2, 2024 at 2:34 AM Inochi Amaoto <inochiama@outlook.com> wrote:
> >
> > > Add basic pinctrl driver for Sophgo CV1800 series SoCs.
> > > This patch series aims to replace the previous patch from Jisheng [1].
> > > Since the pinctrl of cv1800 has nested mux and its pin definination
> > > is discrete, it is not suitable to use "pinctrl-single" to cover the
> > > pinctrl device.
> > >
> > > This patch require another patch [2] that provides standard attribute
> > > "input-schmitt-microvolt"
> > >
> > > Note: As current documentation is not enough to guess the pin
> > > configuration of Huashan Pi, only the pinctrl node is added.
> > >
> > > [1] https://lore.kernel.org/linux-riscv/20231113005702.2467-1-jszhang@kernel.org/
> > > [2] https://lore.kernel.org/all/IA1PR20MB495346246245074234D337A6BBAC2@IA1PR20MB4953.namprd20.prod.outlook.com/
> > >
> > > Changed from v3:
> > > 1. binding: drop unnecessary type
> > > 2. binding: use right ref for pin node.
> > > 3. binding: remove mixed spaces and tabs.
> >
> > This v4 looks good to me and has necessary ACKs.
> >
> > It contains device tree patches which I am icky to merge but
> > I can merge the rest and give you an immutable branch in the
> > pinctrl tree that the ARM SoC maintainers can pull in to
> > merge the device trees, does this work for you?
> >
> > Yours,
> > Linus Walleij
>
> Hi, Linus
>
> It is OK for me, Thanks for taking it.

OK! The pinctrl base patches are merged to this immutable branch:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=ib-sophgo-pinctrl

The SoC tree can pull this in to get the binding files.

I have then merged this into the main pinctrl "devel" branch.

Yours,
Linus Walleij
Inochi Amaoto Aug. 29, 2024, 5:08 a.m. UTC | #4
On Fri, 2 Aug 2024 08:33:58 +0800, Inochi Amaoto wrote:
> Add basic pinctrl driver for Sophgo CV1800 series SoCs.
> This patch series aims to replace the previous patch from Jisheng [1].
> Since the pinctrl of cv1800 has nested mux and its pin definination
> is discrete, it is not suitable to use "pinctrl-single" to cover the
> pinctrl device.
> 
> This patch require another patch [2] that provides standard attribute
> "input-schmitt-microvolt"
> 
> [...]

Applied to for-next, thanks!

[6/7] riscv: dts: sophgo: cv1800b: add pinctrl support
      https://github.com/sophgo/linux/commit/1728c7e408c6e5ef1c6f3a2c7f75bd20139c2e13
[7/7] riscv: dts: sophgo: cv1812h: add pinctrl support
      https://github.com/sophgo/linux/commit/2926c05f9cb7b5bb0374fb7a53bffd65937a454f

Thanks,
Inochi
Inochi Amaoto Sept. 10, 2024, 12:10 p.m. UTC | #5
On Thu, Aug 29, 2024 at 01:08:41PM GMT, Inochi Amaoto wrote:
> On Fri, 2 Aug 2024 08:33:58 +0800, Inochi Amaoto wrote:
> > Add basic pinctrl driver for Sophgo CV1800 series SoCs.
> > This patch series aims to replace the previous patch from Jisheng [1].
> > Since the pinctrl of cv1800 has nested mux and its pin definination
> > is discrete, it is not suitable to use "pinctrl-single" to cover the
> > pinctrl device.
> > 
> > This patch require another patch [2] that provides standard attribute
> > "input-schmitt-microvolt"
> > 
> > [...]
> 
> Applied to for-next, thanks!
> 
> [6/7] riscv: dts: sophgo: cv1800b: add pinctrl support
>       https://github.com/sophgo/linux/commit/1728c7e408c6e5ef1c6f3a2c7f75bd20139c2e13
> [7/7] riscv: dts: sophgo: cv1812h: add pinctrl support
>       https://github.com/sophgo/linux/commit/2926c05f9cb7b5bb0374fb7a53bffd65937a454f
> 
> Thanks,
> Inochi
> 

Drop the apply and favor the v6 version:
https://lore.kernel.org/all/IA1PR20MB495301A1A08224486DD0239BBB9A2@IA1PR20MB4953.namprd20.prod.outlook.com/T/#m4acc4e2a9652cb3f5a3ce54deaff52a827b80649

Regards,
Inochi