Skip to content

[PW_SID:1068597] PolarFire SoC GPIO interrupt support#1636

Closed
linux-riscv-bot wants to merge 5 commits intoworkflow__riscv__fixesfrom
pw1068597
Closed

[PW_SID:1068597] PolarFire SoC GPIO interrupt support#1636
linux-riscv-bot wants to merge 5 commits intoworkflow__riscv__fixesfrom
pw1068597

Conversation

@linux-riscv-bot
Copy link

PR for series 1068597 applied to workflow__riscv__fixes

Name: PolarFire SoC GPIO interrupt support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1068597
Version: 13

The microchip,mpfs-gpio binding suffered greatly due to being written
with a narrow minded view of the controller, and the interrupt bits
ended up incorrect. It was mistakenly assumed that the interrupt
configuration was set by platform firmware, based on the FPGA
configuration, and that the GPIO DT nodes were the only way to really
communicate interrupt configuration to software.

Instead, the mux should be a device in its own right, and the GPIO
controllers should be connected to it, rather than to the PLIC.
Now that a binding exists for that mux, try to fix the misconceptions
in the GPIO controller binding.

Firstly, it's not possible for this controller to have fewer than 14
GPIOs, and thus 14 interrupts also. There are three controllers, with
14, 24 & 32 GPIOs each. The fabric core, CoreGPIO, can of course have
a customisable number of GPIOs.

The example is wacky too - it follows from the incorrect understanding
that the GPIO controllers are connected to the PLIC directly. They are
not however, with a mux sitting in between. Update the example to use
the mux as a parent, and the interrupt numbers at the mux for GPIO2 as
the example - rather than the strange looking, repeated <53>.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add support for interrupts to the PolarFire SoC GPIO driver. Each GPIO
has an independent interrupt that is wired to an interrupt mux that sits
between the controllers and the PLIC. The SoC has more GPIO lines than
connections from the mux to the PLIC, so some GPIOs must share PLIC
interrupts. The configuration is not static and is set at runtime,
conventionally by the platform's firmware. CoreGPIO, the version
intended for use in the FPGA fabric has two interrupt output ports, one
is IO_NUM bits wide, as is used in the hardened cores, and the other is
a single bit with all lines ORed together.

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
On PolarFire SoC there are more GPIO interrupts than there are interrupt
lines available on the PLIC, and a runtime configurable mux is used to
decide which interrupts are assigned direct connections to the PLIC &
which are relegated to sharing a line.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
On PolarFire SoC there are more GPIO interrupts than there are interrupt
lines available on the PLIC, and a runtime configurable mux is used to
decide which interrupts are assigned direct connections to the PLIC &
which are relegated to sharing a line.

Add a driver so that Linux can set the mux based on the interrupt
mapping in the devicetree.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…e SoC

There are 3 GPIO controllers on this SoC, of which:
- GPIO controller 0 has 14 GPIOs
- GPIO controller 1 has 24 GPIOs
- GPIO controller 2 has 32 GPIOs

All GPIOs are capable of generating interrupts, for a total of 70.
There are only 41 IRQs available however, so a configurable mux is used
to ensure all GPIOs can be used for interrupt generation.
38 of the 41 interrupts are in what the documentation calls "direct
mode", as they provide an exclusive connection from a GPIO to the PLIC.
The 3 remaining interrupts are used to mux the interrupts which do not
have a exclusive connection, one for each GPIO controller.

The mux was overlooked when the bindings and driver were originally
written for the GPIO controllers on Polarfire SoC, and the interrupts
property in the GPIO nodes used to try and convey what the mapping was.
Instead, the mux should be a device in its own right, and the GPIO
controllers should be connected to it, rather than to the PLIC.
Now that a binding exists for that mux, fix the inaccurate description
of the interrupt controller hierarchy.

GPIO controllers 0 and 1 do not have all 32 possible GPIO lines, so
ngpios needs to be set to match the number of lines/interrupts.

The m100pfsevp has conflicting interrupt mappings for controllers 0 and
2, as they cannot both be using an interrupt in "direct mode" at the
same time, so the default replaces this impossible configuration.

Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1001.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1360.05 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.12 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.82 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.70 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
kdoc
Desc: Detects for kdoc errors
Duration: 0.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v13,1/5] dt-bindings: gpio: fix microchip,mpfs-gpio interrupt documentation"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1130.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1654.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.24 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#113: FILE: drivers/gpio/gpio-mpfs.c:159:
+	regmap_update_bits(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index),
+			     MPFS_GPIO_EN_INT, MPFS_GPIO_EN_INT);

total: 0 errors, 0 warnings, 1 checks, 166 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 54c962aa9a27 ("gpio: mpfs: Add interrupt support") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 166 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v13,2/5] gpio: mpfs: Add interrupt support"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v13,3/5] dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.06 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v13,3/5] dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux"
kdoc
Desc: Detects for kdoc errors
Duration: 1.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v13,3/5] dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v13,3/5] dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v13,3/5] dt-bindings: soc: microchip: document PolarFire SoC's gpio interrupt mux"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.87 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1068597 branch March 18, 2026 14:24
@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1151.69 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1700.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 3.84 seconds
Result: WARNING
Output:

WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines
#45: FILE: drivers/soc/microchip/Kconfig:1:
+config POLARFIRE_SOC_IRQ_MUX
+	bool "Microchip PolarFire SoC's GPIO IRQ Mux"
+	depends on ARCH_MICROCHIP
+	select REGMAP
+	select REGMAP_MMIO
+	default y
+	help
+	  Support for the interrupt mux on Polarfire SoC. It sits between
+	  the GPIO controllers and the PLIC, as only 41 interrupts are shared
+	  between 3 GPIO controllers with a total of 70 interrupts.
+

CHECK: Alignment should match open parenthesis
#103: FILE: drivers/soc/microchip/mpfs-irqmux.c:31:
+	if (parent_args->args[0] < MPFS_IRQMUX_DIRECT_START ||
+			parent_args->args[0] > MPFS_IRQMUX_NONDIRECT_END) {

CHECK: Blank lines aren't necessary after an open brace '{'
#148: FILE: drivers/soc/microchip/mpfs-irqmux.c:76:
+	for_each_of_imap_item(&imap_parser, &imap_item) {
+

total: 0 errors, 1 warnings, 2 checks, 206 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 6755dfa54c76 ("soc: microchip: add mpfs gpio interrupt mux driver") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 2 checks, 206 lines checked
CHECK: Alignment should match open parenthesis
CHECK: Blank lines aren't necessary after an open brace '{'
WARNING: please write a help paragraph that fully describes the config symbol with at least 4 lines


@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.44 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
module-param
Desc: Detect module_param changes
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v13,4/5] soc: microchip: add mpfs gpio interrupt mux driver"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 141.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1088.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1479.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 85.68 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 5: "[v13,5/5] riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.28 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants