Linux-RISC-V Archive mirror
 help / color / mirror / Atom feed
From: Alex Soo <yuklin.soo@starfivetech.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Hal Feng <hal.feng@starfivetech.com>,
	Ley Foon Tan <leyfoon.tan@starfivetech.com>,
	Jianlong Huang <jianlong.huang@starfivetech.com>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Drew Fustini <drew@beagleboard.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alex Soo <yuklin.soo@starfivetech.com>
Subject: [RFC PATCH v3 0/7] Add Pinctrl driver for Starfive JH8100 SoC
Date: Fri,  3 May 2024 19:14:29 +0800	[thread overview]
Message-ID: <20240503111436.113089-1-yuklin.soo@starfivetech.com> (raw)

Starfive JH8100 SoC consists of 4 pinctrl domains - sys_east,
sys_west, sys_gmac, and aon. This patch series adds pinctrl
drivers for these 4 pinctrl domains and this patch series is
depending on the JH8100 base patch series in [1] and [2].
The relevant dt-binding documentation for each pinctrl domain has
been updated accordingly.

[1] https://lore.kernel.org/lkml/20231201121410.95298-1-jeeheng.sia@starfivetech.com/
[2] https://lore.kernel.org/lkml/20231206115000.295825-1-jeeheng.sia@starfivetech.com/

---

Changes in v3:
- Replace "additionalProperties: false" in dt-bindings docs by
  "unevaluatedProperties: false" to allow reference to properties in generic
  pinmux and pincfg schema.
- Remove redundant keyword "allOf" from the "compatible" property definition.
- Drop all PAD_GPIO*_* macros from dt-bindings header "starfive,jh8100-pinctrl.h"
  and move them to DTS header "jh8100-pinfunc.h".
- Drop "GPOUT_LOW", "GPOUT_HIGH", "GPOEN_ENABLE", "GPOEN_DISABLE", and "GPI_NONE"
  from dt-bindings header.
- Add macros "PAD_SLEW_RATE_FAST"and "PAD_SLEW_RATE_SLOW" to dt-bindings header.
- Change the commit message of the main driver and sys_east domain subdriver to
  inform what SoC they run on, and to explain that the main driver provides 
  common APIs to all domain subdrivers to perform their respective tasks,
  and how the main driver and domain drivers work together.
- Add macros JH8100_SYS_E_NGPIO, JH8100_SYS_W_NGPIO, JH8100_SYS_G_NGPIO,
  JH8100_AON_NGPIO to header pinctrl-starfive-jh8100.h to represent total
  number of GPIO_PADs in sys-east, sys-west, sys-gmac, and aon (always-on)
  domains.
- In function jh8100_get_padcfg_base() of main driver, macros: PAD_GPIO47_E,
  PAD_GPIO15_W, PAD_RGPIO15 are replaced by JH8100_SYS_E_NGPIO,
  JH8100_SYS_W_NGPIO, and JH8100_AON_NGPIO respectively.
- Add function jh8100_padcfg_ds_from_uA() to main driver to convert uA
  (microamperes) from dts property drive-strength-microamp to drive strength
  value when setting the pin configuration register.
- Add function jh8100_padcfg_ds_to_uA() to main driver to convert drive
  strength value from pin configuration register to uA (microamperes) when
  reading pin configuration.
- Remove "of_gpio.h" and use only the gpiod interfaces in
  <linux/gpio/consumer.h>. 
- Remove cross-include "../core.h" from the main driver and move it to
  header "pinctrl-starfive-jh8100.h".
- Remove cross-include "../pinctrl-utils.h" from the main driver and
  add the function prototype "pinctrl_utils_free_map()" to header
  "pinctrl-starfive-jh8100.h".
- Remove cross-include "../pinmux.h" from the main driver and add the
  "pinmux_generic_*" function prototypes to header "pinctrl-starfive-jh8100.h".
- Remove cross-include “../pinconf.h” from the main driver and add the
  function prototype "pinconf_generic_parse_dt_config()" to header
  "pinctrl-starfive-jh8100.h".
- Replace "GPOUT_LOW", "GPOUT_HIGH", "GPOEN_ENABLE", "GPOEN_DISABLE", and
  "GPI_NONE" in the main driver by constant numbers 0, 1, 0, 1, and 255
  respectively.
- Update function jh8100_get_padcfg_base() to return base address of pad
  configuration registers for sys-west and aon domains.
- Update function jh8100_set_one_pin_mux() to support pad function selection
  in sys-west domain.
- Update function jh8100_gpio_direction_output() to remove
  JH8100_PADCFG_BIAS_MASK from mask so that when gpioset configure a pin
  as output, the pin bias setting (pull-up/pull-down) will not be cleared
  by the driver.
- Remove function jh8100_gpio_irq_setup() and the GPIO wakeup irq
  enablement in probe function from main driver. It is replaced by 
  function gpiochip_wakeup_irq_setup() in gpiolib core
  "drivers/gpio/gpiolib.c".
  The function gpiochip_wakeup_irq_setup() is added as the wakeup gpio
  irq setup function in the gpiolib core.
- The interrupt handler jh8100_gpio_wake_irq_handler() in the main driver
  is removed. It is replaced by gpio_wake_irq_handler() in gpiolib core
  "drivers/gpio/gpiolib.c".
- Remove the inline function pin_to_hwirq() from driver header file
  "pinctrl-starfive-jh8100.h".
- Remove cross-include "../core.h", “../pinmux.h”, and “../pinconf.h” from
  the sys-east, sys-west, sys-gmac, and aon domain sub-drivers.
- In sys_east domain sub-driver, macros PAD_GPIO0_E through PAD_GPIO47_E are
  replaced by constant numbers 0 through 47.
- In sys_west domain sub-driver, macros PAD_GPIO0_W through PAD_GPIO15_W are
  replaced by constant numbers 0 through 15.
- In AON domain sub-driver, macros PAD_RGPIO0 through PAD_RGPIO15 are
  replaced by constant numbers 0 through 15.

Changes in v2:
- Add "(always-on)" to document title to clarify acronym AON.
- Replace "drive-strength" by "drive-strength-microamp".
- Update "slew-rate" property in sys-east, sys-west, and aon document.
- remove redundant "bindings" from commit subject and message.
- Change regular expression "-[0-9]+$"  to "-grp$" to standardize client
  node names to end with suffix "-grp" instead of "-<numerical _number>".
- Use 4 spaces indentation for DTS examples.
- Update DTS examples in sys-east, sys-west, and aon document with client
  driver pinmuxing.
- Remove redundant syscon and gmac macros from dt-binding header file.
- Remove redundant register macros from dt-binding header file.
- Add "wakeup-gpios" and "wakeup-source" to aon document.
- Add "gpio-line-names" to sys-east and sys-west document.
- Update the description of syscon register usage in each document.
- Update sys-gmac and aon document with information of GMAC voltage.
  reference syscon and GMAC pad syscon.
- Fix the pinctrl device nodes compatible string too long issue.
- Move all common codes from subdrivers to the main driver.
- Change the commit log to "add main and sys_east driver" to indicate
  the commit of both main and sys-east driver.
- Turn pin_to_hwirq macro to a static inline function to hide gpio
  internal detail, and also, for easier code readability.
- Change "JH8100_PADCFG_BIAS" to "JH8100_PADCFG_BIAS_MASK".
- Change "#define JH8100_PADCFG_DS_4MA   BIT(1)" to
  #define JH8100_PADCFG_DS_4MA   (1U << 1)".
- Replace "jh8100_gpio_request" by "pinctrl_gpio_request".
- Replace "jh8100_gpio_free" by "pinctrl_gpio_free".
- Replace "jh8100_gpio_set_config" by "gpiochip_generic_config".
- Use irq_print_chip function to display irqchip name to user space.
- Use girq to represent GPIO interrupt controller.
- Update code to ensure wakeup-gpios is always an input line.
- Remove the jh8100_gpio_add_pin_ranges function and use gpio-ranges
  in device tree to provide information for GPIO core to add pin range
  for each pinctrl.
- Change "StarFive GPIO chip registered" to "StarFive JH8100 GPIO chip
  registered".

---
Alex Soo (7):
  dt-bindings: pinctrl: starfive: Add JH8100 pinctrl
  pinctrl: starfive: jh8100: add main driver and sys_east domain
    sub-driver
  pinctrl: starfive: jh8100: add sys_west domain sub-driver
  pinctrl: starfive: jh8100: add sys_gmac domain sub-driver
  pinctrl: starfive: jh8100: add AON domain sub-driver
  gpiolib: enable GPIO interrupt to wake up a system from sleep
  riscv: dts: starfive: jh8100: add pinctrl device tree nodes

 .../pinctrl/starfive,jh8100-aon-pinctrl.yaml  |  260 ++++
 .../starfive,jh8100-sys-east-pinctrl.yaml     |  222 ++++
 .../starfive,jh8100-sys-gmac-pinctrl.yaml     |  162 +++
 .../starfive,jh8100-sys-west-pinctrl.yaml     |  219 ++++
 MAINTAINERS                                   |    7 +
 arch/riscv/boot/dts/starfive/jh8100-evb.dts   |    7 +
 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h |  504 ++++++++
 arch/riscv/boot/dts/starfive/jh8100.dtsi      |   46 +
 drivers/gpio/gpiolib.c                        |   87 ++
 drivers/pinctrl/starfive/Kconfig              |   59 +
 drivers/pinctrl/starfive/Makefile             |    6 +
 .../starfive/pinctrl-starfive-jh8100-aon.c    |  150 +++
 .../pinctrl-starfive-jh8100-sys-east.c        |  220 ++++
 .../pinctrl-starfive-jh8100-sys-gmac.c        |   89 ++
 .../pinctrl-starfive-jh8100-sys-west.c        |  164 +++
 .../starfive/pinctrl-starfive-jh8100.c        | 1103 +++++++++++++++++
 .../starfive/pinctrl-starfive-jh8100.h        |  125 ++
 .../pinctrl/starfive,jh8100-pinctrl.h         |   13 +
 18 files changed, 3443 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-east-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-gmac-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-west-pinctrl.yaml
 create mode 100644 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-aon.c
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-gmac.c
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-west.c
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c
 create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h
 create mode 100644 include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h

-- 
2.43.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2024-05-03 11:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 11:14 Alex Soo [this message]
2024-05-03 11:14 ` [RFC PATCH v3 1/7] dt-bindings: pinctrl: starfive: Add JH8100 pinctrl Alex Soo
2024-05-03 13:34   ` Rob Herring (Arm)
2024-05-03 16:07   ` Conor Dooley
2024-05-09  2:24     ` Yuklin Soo
2024-05-03 11:14 ` [RFC PATCH v3 2/7] pinctrl: starfive: jh8100: add main driver and sys_east domain sub-driver Alex Soo
2024-05-06 20:15   ` Andy Shevchenko
2024-05-03 11:14 ` [RFC PATCH v3 3/7] pinctrl: starfive: jh8100: add sys_west " Alex Soo
2024-05-03 11:14 ` [RFC PATCH v3 4/7] pinctrl: starfive: jh8100: add sys_gmac " Alex Soo
2024-05-03 11:14 ` [RFC PATCH v3 5/7] pinctrl: starfive: jh8100: add AON " Alex Soo
2024-05-03 11:14 ` [RFC PATCH v3 6/7] gpiolib: enable GPIO interrupt to wake up a system from sleep Alex Soo
2024-05-06 20:25   ` Andy Shevchenko
2024-05-27 12:31   ` Linus Walleij
2024-05-03 11:14 ` [RFC PATCH v3 7/7] riscv: dts: starfive: jh8100: add pinctrl device tree nodes Alex Soo
2024-05-06  6:35 ` [RFC PATCH v3 0/7] Add Pinctrl driver for Starfive JH8100 SoC Linus Walleij
2024-05-06  7:31   ` Leyfoon Tan
2024-05-06 12:09     ` Conor Dooley
2024-05-06 20:25 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240503111436.113089-1-yuklin.soo@starfivetech.com \
    --to=yuklin.soo@starfivetech.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=drew@beagleboard.org \
    --cc=hal.feng@starfivetech.com \
    --cc=jianlong.huang@starfivetech.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).