[PATCH v14 00/18] pinctrl: add support of Airoha SoCs

Mikhail Kshevetskiy mikhail.kshevetskiy at iopsys.eu
Thu Jul 2 07:57:26 CEST 2026


This patch series add pin controller and gpio driver support for EN7523/
AN7581/AN7583 SoCs. The driver based on official linux airoha pinctrl and
gpio driver with Matheus Sampaio Queiroga changes.

The original Matheus Sampaio Queiroga driver can be taken from the repo:
  https://sirherobrine23.com.br/airoha_en7523/kernel/src/branch/airoha_en7523_pinctrl

Additionally in the EN7523 case the patches removes existing gpio dts nodes
and replaces them with pinctrl node. It should not be very dangerous, because:
 * No official EN7523 gpio support present in U-Boot
 * Legacy Linux EN7523 GPIO driver is mostly abandoned
 * The same driver is planned for upstream linux/openwrt

This patchset includes bitfield.h patches created for Linux kernel
by Geert Uytterhoeven. It suits U-Boot fine. I preserve original author
and original commit messages. It might be not a best strategy, because
these patches refers to other linux kernel commits not added to U-Boot.
Please note me, if there is a better way.

The patches were tested on EN7523/AN7581/AN7583 boards.

Changes v2:
 * pinctrl driver was split on common and per SoC parts
 * EN7523 SoC support was added
 * EN7523/AN7581 defconfigs were updated to activate
   pinctrl/gpio support
 * Board/SoC independent pinconf/pinctrl definitions
   were moved to global includes

Changes v3:
 * add non-constant field_{prep,get}() helpers
 * put airoha common code to a separate patch
 * put en7523 dts change to a separate patch
 * add support of "pinmux status" command
 * address a lot of comments from David Lechner

Changes v4:
 * minor refactoring
 * fix gpio initialization, so gpio driver becomes probed

Changes v5:
 * more bitfield changes
 * sort contents of pinctrl makefile
 * address more issues found by David Lechner

Changes v6:
 * pinctrl makefile sorting/formatting was moved to separate commit
 * replace 'tristate' by 'bool' in airoha Kconfig (thanks to Peng Fan)
 * a bit improve menu entry names
 * add an explanation why en7581 prefix used for an7581 chips.
 * add reviewed by David Lechner line to all patches

Changes v7:
 * an7583: add missed gpio22 pin group

Changes v8:
 * replace en7581 prefix by an7581 in the an7581 pinctrl driver
 * sync en7523 driver with latest Matheus Sampaio Queiroga work

Changes v9:
 * Remove an7581/an7583 prefixes from an7581/an7583 drivers. No point to keep
   it in the chip specific code.
 * Minor refactoring of an7583 drivers to make it more similar to an7581 one.
 * Fixed few bugs in an7581/an7583 drivers.
 * Sync code with latest Matheus Sampaio Queiroga work.
 * Remove en7523 driver by request of Matheus Sampaio Queiroga, because of
   linux en7523 driver is not ready (and currently broken)

Changes v10:
 * Add back en7523 pinctrl driver. The driver was tested/debugged together
   with Matheus Sampaio Queiroga. Pin numbers were changed according to
   the table provided by Benjamin Larsson.
 * Added myself to the list of en7523 pinctrl driver authors.
 * gpio-range property was added to pinctrl dts node.

Changes v11:
 * fix mdio pinctrl function for en7523

Changes v12:
 * code was synced with corresponding linux patchset
   https://lore.kernel.org/lkml/20260616041939.2587012-1-mikhail.kshevetskiy@iopsys.eu/

Changes v13:
 * code was synced with corresponding linux patchset v4
   https://lore.kernel.org/lkml/20260617043654.2790253-1-mikhail.kshevetskiy@iopsys.eu/

Changes v14:
 * code was synced with corresponding linux patchset v6
   https://lore.kernel.org/lkml/20260628143733.273651-1-mikhail.kshevetskiy@iopsys.eu/
 * Convert drivers to common field_{get,prep}() helpers. This should fix
   build failures of many renesas boards.

Geert Uytterhoeven (2):
  bitfield: Add less-checking __FIELD_{GET,PREP}()
  bitfield: Add non-constant field_{prep,get}() helpers

Mikhail Kshevetskiy (16):
  bitops: import BITS_PER_TYPE() macro from linux
  watchdog: renesas_wwdt: Convert to common field_{get,prep}() helpers
  power: domain: renesas-r8a78000: Convert to common field_{get,prep}()
    helpers
  net: hifemac: Convert to common field_{get,prep}() helpers
  mtd: nand: raw: sunxi: Convert to common field_{get,prep}() helpers
  clk: renesas: rcar-cpg-lib: Convert to common field_{get,prep}()
    helpers
  board: renesas: gen5-cm33: Convert to common field_{get,prep}()
    helpers
  pinctrl: add more pinconf/pinctrl definitions
  pinctrl: sort and format the contents of the makefile
  pinctrl: airoha: add shared pinctrl code
  pinctrl: airoha: add pin controller and gpio driver for AN7581 SoC
  pinctrl: airoha: add pin controller and gpio driver for AN7583 SoC
  pinctrl: airoha: add pin controller and gpio driver for EN7523 SoC
  configs: airoha: an7581: enable pinctrl/gpio support
  configs: airoha: en7523: enable pinctrl/gpio support
  arm: dts: en7523: add pinctrl/gpio support, drop legacy gpio support

 arch/arm/dts/en7523-u-boot.dtsi               |   23 +
 board/renesas/common/gen5-cm33.c              |    3 -
 configs/an7581_evb_defconfig                  |    2 +-
 configs/en7523_evb_defconfig                  |    2 +-
 drivers/clk/renesas/rcar-cpg-lib.c            |    4 -
 drivers/mtd/nand/raw/sunxi_nand.h             |    5 +-
 drivers/net/hifemac.c                         |    3 -
 drivers/pinctrl/Kconfig                       |    1 +
 drivers/pinctrl/Makefile                      |   61 +-
 drivers/pinctrl/airoha/Kconfig                |   26 +
 drivers/pinctrl/airoha/Makefile               |    7 +
 drivers/pinctrl/airoha/airoha-common.h        |  144 ++
 drivers/pinctrl/airoha/pinctrl-airoha.c       |  958 +++++++++++
 drivers/pinctrl/airoha/pinctrl-an7581.c       | 1484 ++++++++++++++++
 drivers/pinctrl/airoha/pinctrl-an7583.c       | 1492 +++++++++++++++++
 drivers/pinctrl/airoha/pinctrl-en7523.c       | 1118 ++++++++++++
 .../domain/renesas-r8a78000-power-domain.c    |    4 +-
 drivers/watchdog/renesas_wwdt.c               |    2 -
 include/dm/pinctrl.h                          |   28 +
 include/linux/bitfield.h                      |   95 +-
 include/linux/bitops.h                        |    1 +
 include/linux/pinctrl/pinctrl.h               |   74 +
 22 files changed, 5479 insertions(+), 58 deletions(-)
 create mode 100644 drivers/pinctrl/airoha/Kconfig
 create mode 100644 drivers/pinctrl/airoha/Makefile
 create mode 100644 drivers/pinctrl/airoha/airoha-common.h
 create mode 100644 drivers/pinctrl/airoha/pinctrl-airoha.c
 create mode 100644 drivers/pinctrl/airoha/pinctrl-an7581.c
 create mode 100644 drivers/pinctrl/airoha/pinctrl-an7583.c
 create mode 100644 drivers/pinctrl/airoha/pinctrl-en7523.c
 create mode 100644 include/linux/pinctrl/pinctrl.h

-- 
2.53.0



More information about the U-Boot mailing list