* [PATCH 1/8] dt-bindings: vendor-prefixes: Add AAEON vendor prefix
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 2/8] dt-bindings: gpio: Add AAEON embedded controller GPIO binding Thomas Perrot (Schneider Electric)
` (6 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add the AAEON vendor prefix to support the AAEON SRG-IMX8PL MCU driver
devicetree bindings.
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index c7591b2aec2a74560a4f687fe7a2070ca21b0752..0f84ee93b3a8473719ee92f8c046e350c4a20825 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -32,6 +32,8 @@ patternProperties:
description: 8devices, UAB
"^9tripod,.*":
description: Shenzhen 9Tripod Innovation and Development CO., LTD.
+ "^aaeon,.*":
+ description: AAEON
"^abb,.*":
description: ABB
"^abilis,.*":
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 2/8] dt-bindings: gpio: Add AAEON embedded controller GPIO binding
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 1/8] dt-bindings: vendor-prefixes: Add AAEON vendor prefix Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 8:19 ` Krzysztof Kozlowski
2025-12-12 7:41 ` [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding Thomas Perrot (Schneider Electric)
` (5 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add device tree binding documentation for the GPIO controller functionality
provided by the AAEON embedded controller. This controller provides 7 GPOs
and 12 GPIOs for a total of 19 GPIO lines.
The GPIO controller is defined as a child node of the AAEON MCU device.
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
.../bindings/gpio/aaeon,srg-imx8pl-gpio.yaml | 54 ++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml b/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..8040dc0a36ee5650488520c2218f09fd08cdf64a
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/aaeon,srg-imx8pl-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AAEON Embedded Controller GPIO
+
+maintainers:
+ - Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ - Thomas Perrot <thomas.perrot@bootlin.com>
+
+description: |
+ GPIO controller functionality provided by the AAEON embedded controller.
+ This controller provides 7 GPOs and 12 GPIOs.
+
+ The GPIO controller is a sub-device of the AAEON MCU and must be defined
+ as a child node of the MCU device.
+
+properties:
+ compatible:
+ const: aaeon,srg-imx8pl-gpio
+
+ gpio-controller: true
+
+ "#gpio-cells":
+ const: 2
+ description: |
+ The first cell is the GPIO number (0-6 for GPOs, 7-18 for
+ general-purpose GPIOs).
+ The second cell is the GPIO flags as defined in
+ <dt-bindings/gpio/gpio.h>.
+
+ ngpios:
+ description: |
+ Total number of GPIOs available (GPOs + GPIOs).
+ This should be 19 (7 GPOs + 12 GPIOs).
+ const: 19
+
+required:
+ - compatible
+ - gpio-controller
+ - "#gpio-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ gpio {
+ compatible = "aaeon,srg-imx8pl-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <19>;
+ };
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 2/8] dt-bindings: gpio: Add AAEON embedded controller GPIO binding
2025-12-12 7:41 ` [PATCH 2/8] dt-bindings: gpio: Add AAEON embedded controller GPIO binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 8:19 ` Krzysztof Kozlowski
0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-12 8:19 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
> Add device tree binding documentation for the GPIO controller functionality
> provided by the AAEON embedded controller. This controller provides 7 GPOs
> and 12 GPIOs for a total of 19 GPIO lines.
>
> The GPIO controller is defined as a child node of the AAEON MCU device.
>
> Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
> ---
> .../bindings/gpio/aaeon,srg-imx8pl-gpio.yaml | 54 ++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml b/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..8040dc0a36ee5650488520c2218f09fd08cdf64a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/aaeon,srg-imx8pl-gpio.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/aaeon,srg-imx8pl-gpio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AAEON Embedded Controller GPIO
> +
> +maintainers:
> + - Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
> + - Thomas Perrot <thomas.perrot@bootlin.com>
> +
> +description: |
> + GPIO controller functionality provided by the AAEON embedded controller.
> + This controller provides 7 GPOs and 12 GPIOs.
> +
> + The GPIO controller is a sub-device of the AAEON MCU and must be defined
> + as a child node of the MCU device.
> +
> +properties:
> + compatible:
> + const: aaeon,srg-imx8pl-gpio
> +
> + gpio-controller: true
That's not really separate node if you do not have any resources. Fold
it into the parent.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 1/8] dt-bindings: vendor-prefixes: Add AAEON vendor prefix Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 2/8] dt-bindings: gpio: Add AAEON embedded controller GPIO binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 8:20 ` Krzysztof Kozlowski
2025-12-12 7:41 ` [PATCH 4/8] dt-bindings: mfd: Add AAEON embedded controller binding Thomas Perrot (Schneider Electric)
` (4 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add device tree binding documentation for the watchdog timer functionality
provided by the AAEON embedded controller. The watchdog has a maximum
hardware heartbeat of 25 seconds and supports a timeout of up to 240
seconds through automatic pinging.
The watchdog is defined as a child node of the AAEON MCU device.
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
.../bindings/watchdog/aaeon,srg-imx8pl-wdt.yaml | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/watchdog/aaeon,srg-imx8pl-wdt.yaml b/Documentation/devicetree/bindings/watchdog/aaeon,srg-imx8pl-wdt.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d19a2f4fd38826ff4d1ce6b0b7f12e8b6879445f
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/aaeon,srg-imx8pl-wdt.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/aaeon,srg-imx8pl-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AAEON Embedded Controller Watchdog Timer
+
+maintainers:
+ - Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ - Thomas Perrot <thomas.perrot@bootlin.com>
+
+description: |
+ Watchdog timer functionality provided by the AAEON embedded controller.
+ The watchdog has a fixed maximum hardware heartbeat of 25 seconds and supports
+ a timeout of 240 seconds through automatic pinging. The timeout is not
+ programmable and cannot be changed via device tree properties.
+
+ The watchdog is a sub-device of the AAEON MCU and must be defined as a
+ child node of the MCU device.
+
+allOf:
+ - $ref: watchdog.yaml#
+
+properties:
+ compatible:
+ const: aaeon,srg-imx8pl-wdt
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ watchdog {
+ compatible = "aaeon,srg-imx8pl-wdt";
+ };
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding
2025-12-12 7:41 ` [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 8:20 ` Krzysztof Kozlowski
2025-12-12 11:46 ` Guenter Roeck
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-12 8:20 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + watchdog {
> + compatible = "aaeon,srg-imx8pl-wdt";
No, that was discussed many times on the mailing list already. Fold the
child into the parent. Your driver model really do not matter for DT.
> + };
>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding
2025-12-12 8:20 ` Krzysztof Kozlowski
@ 2025-12-12 11:46 ` Guenter Roeck
2025-12-13 3:05 ` Krzysztof Kozlowski
0 siblings, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2025-12-12 11:46 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thomas Perrot (Schneider Electric),
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/25 00:20, Krzysztof Kozlowski wrote:
> On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + watchdog {
>> + compatible = "aaeon,srg-imx8pl-wdt";
>
> No, that was discussed many times on the mailing list already. Fold the
> child into the parent. Your driver model really do not matter for DT.
>
Theoretically there could be a 'timeout' property since this is
a watchdog driver, but that isn't supported by the driver, so
I agree.
Guenter
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding
2025-12-12 11:46 ` Guenter Roeck
@ 2025-12-13 3:05 ` Krzysztof Kozlowski
0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-13 3:05 UTC (permalink / raw)
To: Guenter Roeck, Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/2025 12:46, Guenter Roeck wrote:
> On 12/12/25 00:20, Krzysztof Kozlowski wrote:
>> On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + watchdog {
>>> + compatible = "aaeon,srg-imx8pl-wdt";
>>
>> No, that was discussed many times on the mailing list already. Fold the
>> child into the parent. Your driver model really do not matter for DT.
>>
>
> Theoretically there could be a 'timeout' property since this is
> a watchdog driver, but that isn't supported by the driver, so
> I agree.
>
Timeout can be added to the parent node. The most differentiating factor
are dedicated resources and none are here.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/8] dt-bindings: mfd: Add AAEON embedded controller binding
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (2 preceding siblings ...)
2025-12-12 7:41 ` [PATCH 3/8] dt-bindings: watchdog: Add AAEON embedded controller watchdog binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 8:22 ` Krzysztof Kozlowski
2025-12-12 7:41 ` [PATCH 5/8] mfd: aaeon: Add SRG-IMX8PL MCU driver Thomas Perrot (Schneider Electric)
` (3 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add device tree binding documentation for the AAEON embedded controller
(MCU). This microcontroller is found on AAEON embedded boards and provides
system features such as GPIO control, watchdog timer, and LED management.
The MCU is connected via I2C and acts as a multi-function device with
GPIO and watchdog as child nodes.
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
.../bindings/mfd/aaeon,srg-imx8pl-mcu.yaml | 58 ++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml b/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..680d06a7e7cb3754bdfc67a1b8c484811eba55d1
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/aaeon,srg-imx8pl-mcu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AAEON Embedded Controller
+
+maintainers:
+ - Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ - Thomas Perrot <thomas.perrot@bootlin.com>
+
+description: |
+ AAEON embeds a microcontroller on their embedded boards providing system
+ features such as GPIO control, watchdog timer, and LED management.
+ The MCU is connected via I2C bus.
+
+properties:
+ compatible:
+ const: aaeon,srg-imx8pl-mcu
+
+ reg:
+ maxItems: 1
+
+ gpio:
+ $ref: /schemas/gpio/aaeon,srg-imx8pl-gpio.yaml
+
+ watchdog:
+ $ref: /schemas/watchdog/aaeon,srg-imx8pl-wdt.yaml
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ aaeon_mcu: embedded-controller@62 {
+ compatible = "aaeon,srg-imx8pl-mcu";
+ reg = <0x62>;
+
+ gpio {
+ compatible = "aaeon,srg-imx8pl-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <19>;
+ };
+
+ watchdog {
+ compatible = "aaeon,srg-imx8pl-wdt";
+ };
+ };
+ };
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 4/8] dt-bindings: mfd: Add AAEON embedded controller binding
2025-12-12 7:41 ` [PATCH 4/8] dt-bindings: mfd: Add AAEON embedded controller binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 8:22 ` Krzysztof Kozlowski
0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-12 8:22 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
> Add device tree binding documentation for the AAEON embedded controller
> (MCU). This microcontroller is found on AAEON embedded boards and provides
> system features such as GPIO control, watchdog timer, and LED management.
A nit, subject: drop second/last, redundant "binding". The "dt-bindings"
prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
>
> The MCU is connected via I2C and acts as a multi-function device with
> GPIO and watchdog as child nodes.
>
> Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
> ---
> .../bindings/mfd/aaeon,srg-imx8pl-mcu.yaml | 58 ++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml b/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..680d06a7e7cb3754bdfc67a1b8c484811eba55d1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/aaeon,srg-imx8pl-mcu.yaml
> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/aaeon,srg-imx8pl-mcu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AAEON Embedded Controller
> +
> +maintainers:
> + - Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
> + - Thomas Perrot <thomas.perrot@bootlin.com>
> +
> +description: |
Do not need '|' unless you need to preserve formatting.
> + AAEON embeds a microcontroller on their embedded boards providing system
> + features such as GPIO control, watchdog timer, and LED management.
> + The MCU is connected via I2C bus.
> +
> +properties:
> + compatible:
> + const: aaeon,srg-imx8pl-mcu
What is srg? Why isn't this explained anywhere here?
> +
> + reg:
> + maxItems: 1
> +
> + gpio:
Drop the child, properties go here directly.
> + $ref: /schemas/gpio/aaeon,srg-imx8pl-gpio.yaml
> +
> + watchdog:
Same here
> + $ref: /schemas/watchdog/aaeon,srg-imx8pl-wdt.yaml
> +
> +required:
> + - compatible
> + - reg
> +
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 5/8] mfd: aaeon: Add SRG-IMX8PL MCU driver
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (3 preceding siblings ...)
2025-12-12 7:41 ` [PATCH 4/8] dt-bindings: mfd: Add AAEON embedded controller binding Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add Multi-Function Device (MFD) driver for the Aaeon SRG-IMX8PL
embedded controller. This driver provides the core I2C communication
interface and registers child devices (GPIO and watchdog controllers).
The MCU firmware version is queried during probe and logged for
diagnostic purposes. All I2C transactions are serialized using a mutex
to ensure proper communication with the microcontroller.
Co-developed-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
drivers/mfd/Kconfig | 10 ++++
drivers/mfd/aaeon-mcu.c | 133 ++++++++++++++++++++++++++++++++++++++++++
include/linux/mfd/aaeon-mcu.h | 30 ++++++++++
3 files changed, 173 insertions(+)
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index aace5766b38aa5e46e32a8a7b42eea238159fbcf..9195115c7bcd619439cb9ff71d70e46629291867 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1574,6 +1574,16 @@ config AB8500_CORE
the irq_chip parts for handling the Mixed Signal chip events.
This chip embeds various other multimedia functionalities as well.
+config MFD_AAEON_MCU
+ tristate "Aaeon SRG-IMX8PL MCU Driver"
+ depends on I2C
+ select MFD_CORE
+ help
+ Select this option to enable support for the Aaeon SRG-IMX8PL
+ onboard microcontroller (MCU). This driver provides the core
+ functionality to communicate with the MCU over I2C. The MCU
+ provides various sub-devices including GPIO and watchdog controllers.
+
config MFD_DB8500_PRCMU
bool "ST-Ericsson DB8500 Power Reset Control Management Unit"
depends on UX500_SOC_DB8500
diff --git a/drivers/mfd/aaeon-mcu.c b/drivers/mfd/aaeon-mcu.c
new file mode 100644
index 0000000000000000000000000000000000000000..472d44d5e8627f46806015599542753a5bda4526
--- /dev/null
+++ b/drivers/mfd/aaeon-mcu.c
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Aaeon MCU MFD driver
+ *
+ * Copyright (C) 2025 Bootlin
+ * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ * Author: Thomas Perrot <thomas.perrot@bootlin.com>
+ */
+
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/mfd/core.h>
+#include <linux/mfd/aaeon-mcu.h>
+
+#define AAEON_MCU_GET_FW_VERSION 0x76
+
+static struct mfd_cell aaeon_mcu_devs[] = {
+ {
+ .name = "aaeon-mcu-wdt",
+ .of_compatible = "aaeon,srg-imx8pl-wdt",
+ },
+ {
+ .name = "aaeon-mcu-gpio",
+ .of_compatible = "aaeon,srg-imx8pl-gpio",
+ },
+};
+
+static int aaeon_mcu_print_fw_version(struct i2c_client *client)
+{
+ u8 cmd[3], version[2];
+ int ret;
+
+ /* Major version number */
+ cmd[0] = AAEON_MCU_GET_FW_VERSION;
+ cmd[1] = 0x00;
+ cmd[2] = 0x00;
+
+ ret = aaeon_mcu_i2c_xfer(client, cmd, 3, &version[0], 1);
+ if (ret < 0)
+ return ret;
+
+ /* Minor version number */
+ cmd[0] = AAEON_MCU_GET_FW_VERSION;
+ cmd[1] = 0x01;
+ /* cmd[2] = 0x00; */
+
+ ret = aaeon_mcu_i2c_xfer(client, cmd, 3, &version[1], 1);
+ if (ret < 0)
+ return ret;
+
+ dev_info(&client->dev, "firmware version: v%d.%d\n",
+ version[0], version[1]);
+
+ return 0;
+}
+
+static int aaeon_mcu_probe(struct i2c_client *client)
+{
+ struct aaeon_mcu_dev *mcu;
+ int ret;
+
+ mcu = devm_kzalloc(&client->dev, sizeof(*mcu), GFP_KERNEL);
+ if (!mcu)
+ return -ENOMEM;
+
+ i2c_set_clientdata(client, mcu);
+ mcu->dev = &client->dev;
+ mcu->i2c_client = client;
+ mutex_init(&mcu->i2c_lock);
+
+ ret = aaeon_mcu_print_fw_version(client);
+ if (ret) {
+ dev_err(&client->dev, "unable to read firmware version\n");
+ return ret;
+ }
+
+ return devm_mfd_add_devices(mcu->dev, PLATFORM_DEVID_NONE, aaeon_mcu_devs,
+ ARRAY_SIZE(aaeon_mcu_devs), NULL, 0, NULL);
+}
+
+int aaeon_mcu_i2c_xfer(struct i2c_client *client,
+ const u8 *cmd, int cmd_len,
+ u8 *rsp, int rsp_len)
+{
+ struct aaeon_mcu_dev *mcu = i2c_get_clientdata(client);
+ int ret;
+
+ mutex_lock(&mcu->i2c_lock);
+
+ ret = i2c_master_send(client, cmd, cmd_len);
+ if (ret < 0)
+ goto unlock;
+
+ ret = i2c_master_recv(client, rsp, rsp_len);
+ if (ret < 0)
+ goto unlock;
+
+ if (ret != rsp_len) {
+ dev_err(&client->dev,
+ "i2c recv count error (expected: %d, actual: %d)\n",
+ rsp_len, ret);
+ ret = -EIO;
+ goto unlock;
+ }
+
+ ret = 0;
+
+unlock:
+ mutex_unlock(&mcu->i2c_lock);
+ return ret;
+}
+EXPORT_SYMBOL_GPL(aaeon_mcu_i2c_xfer);
+
+static const struct of_device_id aaeon_mcu_of_match[] = {
+ { .compatible = "aaeon,srg-imx8pl-mcu" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, aaeon_mcu_of_match);
+
+static struct i2c_driver aaeon_mcu_driver = {
+ .driver = {
+ .name = "aaeon_mcu",
+ .of_match_table = aaeon_mcu_of_match,
+ },
+ .probe = aaeon_mcu_probe,
+};
+
+module_i2c_driver(aaeon_mcu_driver);
+
+MODULE_DESCRIPTION("Aaeon MCU MFD Driver");
+MODULE_AUTHOR("Jérémie Dautheribes");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/aaeon-mcu.h b/include/linux/mfd/aaeon-mcu.h
new file mode 100644
index 0000000000000000000000000000000000000000..89632cb46bc6c9518755dc43afb87faa94acb6f5
--- /dev/null
+++ b/include/linux/mfd/aaeon-mcu.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Aaeon MCU driver definitions
+ *
+ * Copyright (C) 2025 Bootlin
+ * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ * Author: Thomas Perrot <thomas.perrot@bootlin.com>
+ */
+
+#ifndef __LINUX_MFD_AAEON_MCU_H
+#define __LINUX_MFD_AAEON_MCU_H
+
+/**
+ * struct aaeon_mcu_dev - Internal representation of the Aaeon MCU
+ * @dev: Pointer to kernel device structure
+ * @i2c_client: Pointer to the Aaeon MCU I2C client
+ * @i2c_lock: Mutex to serialize I2C bus access
+ */
+
+struct aaeon_mcu_dev {
+ struct device *dev;
+ struct i2c_client *i2c_client;
+ struct mutex i2c_lock;
+};
+
+int aaeon_mcu_i2c_xfer(struct i2c_client *client,
+ const u8 *cmd, int cmd_len,
+ u8 *rsp, int rsp_len);
+
+#endif /* __LINUX_MFD_AAEON_MCU_H */
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (4 preceding siblings ...)
2025-12-12 7:41 ` [PATCH 5/8] mfd: aaeon: Add SRG-IMX8PL MCU driver Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 10:11 ` Bartosz Golaszewski
` (2 more replies)
2025-12-12 7:41 ` [PATCH 7/8] watchdog: aaeon: Add watchdog " Thomas Perrot (Schneider Electric)
2025-12-12 7:41 ` [PATCH 8/8] MAINTAINERS: Add entry for AAEON SRG-IMX8PL MCU driver Thomas Perrot (Schneider Electric)
7 siblings, 3 replies; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add GPIO driver for the Aaeon SRG-IMX8PL embedded controller. This
driver supports 7 GPO (General Purpose Output) pins and 12 GPIO pins
that can be configured as inputs or outputs.
The driver implements proper state management for GPO pins (which are
output-only) and full direction control for GPIO pins. During probe,
all pins are reset to a known state (GPOs low, GPIOs as inputs) to
prevent undefined behavior across system reboots, as the MCU does not
reset GPIO states on soft reboot.
Co-developed-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
drivers/gpio/Kconfig | 10 ++
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-aaeon-mcu.c | 248 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 259 insertions(+)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index c74da29253e810b51540684b1186e8f274066b69..7e0f675b664fa25243fc2802edc3380572c94c41 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -157,6 +157,16 @@ config GPIO_74XX_MMIO
8 bits: 74244 (Input), 74273 (Output)
16 bits: 741624 (Input), 7416374 (Output)
+config GPIO_AAEON_MCU
+ tristate "Aaeon MCU GPIO support"
+ depends on MFD_AAEON_MCU && OF_GPIO
+ select GPIO_GENERIC
+ help
+ Select this option to enable GPIO support for the Aaeon SRG-IMX8PL
+ onboard MCU. This driver provides access to GPIO pins and GPO
+ (General Purpose Output) pins controlled by the microcontroller.
+ The driver handles both input and output configuration.
+
config GPIO_ALTERA
tristate "Altera GPIO"
select GPIOLIB_IRQCHIP
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 2421a8fd3733e0b06c2581262aaa9cd629f66c7d..1ba6318bc558743fbe5910966c2c8fc3f792efe9 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_GPIO_104_IDI_48) += gpio-104-idi-48.o
obj-$(CONFIG_GPIO_104_IDIO_16) += gpio-104-idio-16.o
obj-$(CONFIG_GPIO_74X164) += gpio-74x164.o
obj-$(CONFIG_GPIO_74XX_MMIO) += gpio-74xx-mmio.o
+obj-$(CONFIG_GPIO_AAEON_MCU) += gpio-aaeon-mcu.o
obj-$(CONFIG_GPIO_ADNP) += gpio-adnp.o
obj-$(CONFIG_GPIO_ADP5520) += gpio-adp5520.o
obj-$(CONFIG_GPIO_ADP5585) += gpio-adp5585.o
diff --git a/drivers/gpio/gpio-aaeon-mcu.c b/drivers/gpio/gpio-aaeon-mcu.c
new file mode 100644
index 0000000000000000000000000000000000000000..cebd17d1877147b987ea673b081334c8062f5fc0
--- /dev/null
+++ b/drivers/gpio/gpio-aaeon-mcu.c
@@ -0,0 +1,248 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Aaeon MCU GPIO driver
+ *
+ * Copyright (C) 2025 Bootlin
+ * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ * Author: Thomas Perrot <thomas.perrot@bootlin.com>
+ */
+
+#include <linux/bitmap.h>
+#include <linux/gpio/driver.h>
+#include <linux/mfd/aaeon-mcu.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#define AAEON_MCU_CONFIG_GPIO_INPUT 0x69
+#define AAEON_MCU_CONFIG_GPIO_OUTPUT 0x6F
+#define AAEON_MCU_READ_GPIO 0x72
+#define AAEON_MCU_WRITE_GPIO 0x77
+
+#define AAEON_MCU_CONTROL_GPO 0x6C
+
+#define MAX_GPIOS 12
+#define MAX_GPOS 7
+
+struct aaeon_mcu_gpio {
+ struct gpio_chip gc;
+ struct aaeon_mcu_dev *mfd;
+ DECLARE_BITMAP(dir_in, MAX_GPOS + MAX_GPIOS);
+ DECLARE_BITMAP(gpo_state, MAX_GPOS);
+};
+
+static int aaeon_mcu_gpio_config_input_cmd(struct aaeon_mcu_gpio *data,
+ unsigned int offset)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_CONFIG_GPIO_INPUT;
+ cmd[1] = offset - 7;
+ cmd[2] = 0x00;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
+{
+ struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
+ int ret;
+
+ if (offset < MAX_GPOS) {
+ dev_err(gc->parent, "GPIO offset (%d) must be an output GPO\n", offset);
+ return -EOPNOTSUPP;
+ }
+
+ ret = aaeon_mcu_gpio_config_input_cmd(data, offset);
+ if (ret < 0)
+ return ret;
+
+ set_bit(offset, data->dir_in);
+
+ return 0;
+}
+
+static int aaeon_mcu_gpio_config_output_cmd(struct aaeon_mcu_gpio *data,
+ unsigned int offset,
+ int value)
+{
+ u8 cmd[3], rsp;
+ int ret;
+
+ cmd[0] = AAEON_MCU_CONFIG_GPIO_OUTPUT;
+ cmd[1] = offset - 7;
+ cmd[2] = 0x00;
+
+ ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+ if (ret < 0)
+ return ret;
+
+ cmd[0] = AAEON_MCU_WRITE_GPIO;
+ /* cmd[1] = offset - 7; */
+ cmd[2] = !!value;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value)
+{
+ struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
+ int ret;
+
+ if (offset < MAX_GPOS)
+ return 0;
+
+ ret = aaeon_mcu_gpio_config_output_cmd(data, offset, value);
+ if (ret < 0)
+ return ret;
+
+ clear_bit(offset, data->dir_in);
+
+ return 0;
+}
+
+static int aaeon_mcu_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
+{
+ struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
+
+ return test_bit(offset, data->dir_in) ?
+ GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
+}
+
+static int aaeon_mcu_gpio_get(struct gpio_chip *gc, unsigned int offset)
+{
+ struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
+ u8 cmd[3], rsp;
+ int ret;
+
+ if (offset < MAX_GPOS)
+ return test_bit(offset, data->gpo_state);
+
+ cmd[0] = AAEON_MCU_READ_GPIO;
+ cmd[1] = offset - 7;
+ cmd[2] = 0x00;
+
+ ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+ if (ret < 0)
+ return ret;
+
+ return rsp;
+}
+
+static int aaeon_mcu_gpo_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_CONTROL_GPO;
+ cmd[1] = offset + 1;
+ cmd[2] = !!value;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_gpio_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_WRITE_GPIO;
+ cmd[1] = offset - 7;
+ cmd[2] = !!value;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_gpio_set(struct gpio_chip *gc, unsigned int offset,
+ int value)
+{
+ struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
+
+ if (offset < MAX_GPOS) {
+ if (aaeon_mcu_gpo_set_cmd(data, offset, value) == 0)
+ assign_bit(offset, data->gpo_state, value);
+ } else {
+ return aaeon_mcu_gpio_set_cmd(data, offset, value);
+ }
+ return 0;
+}
+
+static const struct gpio_chip aaeon_mcu_chip = {
+ .label = "gpio-aaeon-mcu",
+ .owner = THIS_MODULE,
+ .get_direction = aaeon_mcu_gpio_get_direction,
+ .direction_input = aaeon_mcu_gpio_direction_input,
+ .direction_output = aaeon_mcu_gpio_direction_output,
+ .get = aaeon_mcu_gpio_get,
+ .set = aaeon_mcu_gpio_set,
+ .base = -1,
+ .ngpio = MAX_GPOS + MAX_GPIOS,
+ .can_sleep = true,
+};
+
+static void aaeon_mcu_gpio_reset(struct aaeon_mcu_gpio *data, struct device *dev)
+{
+ unsigned int i;
+ int ret;
+
+ /* Reset all GPOs */
+ for (i = 0; i < MAX_GPOS; i++) {
+ ret = aaeon_mcu_gpo_set_cmd(data, i, 0);
+ if (ret < 0)
+ dev_warn(dev, "Failed to reset GPO %u state: %d\n", i, ret);
+ clear_bit(i, data->dir_in);
+ }
+
+ /* Reset all GPIOs */
+ for (i = MAX_GPOS; i < MAX_GPOS + MAX_GPIOS; i++) {
+ ret = aaeon_mcu_gpio_config_input_cmd(data, i);
+ if (ret < 0)
+ dev_warn(dev, "Failed to reset GPIO %u state: %d\n", i, ret);
+ set_bit(i, data->dir_in);
+ }
+}
+
+static int aaeon_mcu_gpio_probe(struct platform_device *pdev)
+{
+ struct aaeon_mcu_dev *mfd = dev_get_drvdata(pdev->dev.parent);
+ struct aaeon_mcu_gpio *data;
+
+ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->mfd = mfd;
+ data->gc = aaeon_mcu_chip;
+ data->gc.parent = &pdev->dev;
+
+ /*
+ * Reset all GPIO states to a known configuration. The MCU does not
+ * reset GPIO state on soft reboot, only on power cycle (hard reboot).
+ * Without this reset, GPIOs would retain their previous state across
+ * reboots, which could lead to unexpected behavior.
+ */
+ aaeon_mcu_gpio_reset(data, &pdev->dev);
+
+ platform_set_drvdata(pdev, data);
+
+ return devm_gpiochip_add_data(&pdev->dev, &data->gc,
+ data);
+}
+
+static const struct of_device_id aaeon_mcu_gpio_of_match[] = {
+ { .compatible = "aaeon,srg-imx8pl-gpio" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, aaeon_mcu_gpio_of_match);
+
+static struct platform_driver aaeon_mcu_gpio_driver = {
+ .driver = {
+ .name = "aaeon-mcu-gpio",
+ .of_match_table = aaeon_mcu_gpio_of_match,
+ },
+ .probe = aaeon_mcu_gpio_probe,
+};
+
+module_platform_driver(aaeon_mcu_gpio_driver);
+
+MODULE_DESCRIPTION("GPIO interface for Aaeon MCU");
+MODULE_AUTHOR("Jérémie Dautherbes <jeremie.dautheribes@bootlin.com>");
+MODULE_LICENSE("GPL");
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
2025-12-12 7:41 ` [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
@ 2025-12-12 10:11 ` Bartosz Golaszewski
2025-12-13 6:22 ` kernel test robot
2025-12-13 22:38 ` kernel test robot
2 siblings, 0 replies; 19+ messages in thread
From: Bartosz Golaszewski @ 2025-12-12 10:11 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric)
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
On Fri, 12 Dec 2025 08:41:09 +0100, "Thomas Perrot (Schneider
Electric)" <thomas.perrot@bootlin.com> said:
> Add GPIO driver for the Aaeon SRG-IMX8PL embedded controller. This
> driver supports 7 GPO (General Purpose Output) pins and 12 GPIO pins
> that can be configured as inputs or outputs.
>
> The driver implements proper state management for GPO pins (which are
> output-only) and full direction control for GPIO pins. During probe,
> all pins are reset to a known state (GPOs low, GPIOs as inputs) to
> prevent undefined behavior across system reboots, as the MCU does not
> reset GPIO states on soft reboot.
>
> Co-developed-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
> Signed-off-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
> Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
> ---
> drivers/gpio/Kconfig | 10 ++
> drivers/gpio/Makefile | 1 +
> drivers/gpio/gpio-aaeon-mcu.c | 248 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 259 insertions(+)
>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index c74da29253e810b51540684b1186e8f274066b69..7e0f675b664fa25243fc2802edc3380572c94c41 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -157,6 +157,16 @@ config GPIO_74XX_MMIO
> 8 bits: 74244 (Input), 74273 (Output)
> 16 bits: 741624 (Input), 7416374 (Output)
>
> +config GPIO_AAEON_MCU
> + tristate "Aaeon MCU GPIO support"
> + depends on MFD_AAEON_MCU && OF_GPIO
You don't need OF_GPIO, please drop it.
> + select GPIO_GENERIC
> + help
> + Select this option to enable GPIO support for the Aaeon SRG-IMX8PL
> + onboard MCU. This driver provides access to GPIO pins and GPO
> + (General Purpose Output) pins controlled by the microcontroller.
> + The driver handles both input and output configuration.
> +
> config GPIO_ALTERA
> tristate "Altera GPIO"
> select GPIOLIB_IRQCHIP
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index 2421a8fd3733e0b06c2581262aaa9cd629f66c7d..1ba6318bc558743fbe5910966c2c8fc3f792efe9 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -29,6 +29,7 @@ obj-$(CONFIG_GPIO_104_IDI_48) += gpio-104-idi-48.o
> obj-$(CONFIG_GPIO_104_IDIO_16) += gpio-104-idio-16.o
> obj-$(CONFIG_GPIO_74X164) += gpio-74x164.o
> obj-$(CONFIG_GPIO_74XX_MMIO) += gpio-74xx-mmio.o
> +obj-$(CONFIG_GPIO_AAEON_MCU) += gpio-aaeon-mcu.o
> obj-$(CONFIG_GPIO_ADNP) += gpio-adnp.o
> obj-$(CONFIG_GPIO_ADP5520) += gpio-adp5520.o
> obj-$(CONFIG_GPIO_ADP5585) += gpio-adp5585.o
> diff --git a/drivers/gpio/gpio-aaeon-mcu.c b/drivers/gpio/gpio-aaeon-mcu.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..cebd17d1877147b987ea673b081334c8062f5fc0
> --- /dev/null
> +++ b/drivers/gpio/gpio-aaeon-mcu.c
> @@ -0,0 +1,248 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Aaeon MCU GPIO driver
> + *
> + * Copyright (C) 2025 Bootlin
> + * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
> + * Author: Thomas Perrot <thomas.perrot@bootlin.com>
> + */
> +
> +#include <linux/bitmap.h>
> +#include <linux/gpio/driver.h>
> +#include <linux/mfd/aaeon-mcu.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
You need more headers than that. At least device.h for devm_kzalloc(),
mod_devicetable.h, bitops.h and probably some more.
> +
> +#define AAEON_MCU_CONFIG_GPIO_INPUT 0x69
> +#define AAEON_MCU_CONFIG_GPIO_OUTPUT 0x6F
> +#define AAEON_MCU_READ_GPIO 0x72
> +#define AAEON_MCU_WRITE_GPIO 0x77
> +
> +#define AAEON_MCU_CONTROL_GPO 0x6C
> +
> +#define MAX_GPIOS 12
> +#define MAX_GPOS 7
> +
> +struct aaeon_mcu_gpio {
> + struct gpio_chip gc;
> + struct aaeon_mcu_dev *mfd;
> + DECLARE_BITMAP(dir_in, MAX_GPOS + MAX_GPIOS);
> + DECLARE_BITMAP(gpo_state, MAX_GPOS);
> +};
> +
> +static int aaeon_mcu_gpio_config_input_cmd(struct aaeon_mcu_gpio *data,
> + unsigned int offset)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_CONFIG_GPIO_INPUT;
> + cmd[1] = offset - 7;
> + cmd[2] = 0x00;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
> +{
> + struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
> + int ret;
> +
> + if (offset < MAX_GPOS) {
> + dev_err(gc->parent, "GPIO offset (%d) must be an output GPO\n", offset);
> + return -EOPNOTSUPP;
> + }
> +
> + ret = aaeon_mcu_gpio_config_input_cmd(data, offset);
> + if (ret < 0)
> + return ret;
> +
> + set_bit(offset, data->dir_in);
> +
> + return 0;
> +}
> +
> +static int aaeon_mcu_gpio_config_output_cmd(struct aaeon_mcu_gpio *data,
> + unsigned int offset,
> + int value)
> +{
> + u8 cmd[3], rsp;
> + int ret;
> +
> + cmd[0] = AAEON_MCU_CONFIG_GPIO_OUTPUT;
> + cmd[1] = offset - 7;
> + cmd[2] = 0x00;
> +
> + ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> + if (ret < 0)
> + return ret;
> +
> + cmd[0] = AAEON_MCU_WRITE_GPIO;
> + /* cmd[1] = offset - 7; */
> + cmd[2] = !!value;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value)
> +{
> + struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
> + int ret;
> +
> + if (offset < MAX_GPOS)
> + return 0;
> +
> + ret = aaeon_mcu_gpio_config_output_cmd(data, offset, value);
> + if (ret < 0)
> + return ret;
> +
> + clear_bit(offset, data->dir_in);
> +
> + return 0;
> +}
> +
> +static int aaeon_mcu_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
> +{
> + struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
> +
> + return test_bit(offset, data->dir_in) ?
> + GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
> +}
> +
> +static int aaeon_mcu_gpio_get(struct gpio_chip *gc, unsigned int offset)
> +{
> + struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
> + u8 cmd[3], rsp;
> + int ret;
> +
> + if (offset < MAX_GPOS)
> + return test_bit(offset, data->gpo_state);
Are you sure the bit ops in this driver need to be atomic?
> +
> + cmd[0] = AAEON_MCU_READ_GPIO;
> + cmd[1] = offset - 7;
> + cmd[2] = 0x00;
> +
> + ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> + if (ret < 0)
> + return ret;
> +
> + return rsp;
> +}
> +
> +static int aaeon_mcu_gpo_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_CONTROL_GPO;
> + cmd[1] = offset + 1;
> + cmd[2] = !!value;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_gpio_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_WRITE_GPIO;
> + cmd[1] = offset - 7;
> + cmd[2] = !!value;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_gpio_set(struct gpio_chip *gc, unsigned int offset,
> + int value)
> +{
> + struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
> +
> + if (offset < MAX_GPOS) {
> + if (aaeon_mcu_gpo_set_cmd(data, offset, value) == 0)
> + assign_bit(offset, data->gpo_state, value);
> + } else {
> + return aaeon_mcu_gpio_set_cmd(data, offset, value);
> + }
> + return 0;
It would be much cleaner if you did it like:
if (offset >= MAX_GPOS)
return aaeon_mcu_gpio_set_cmd(data, offset, value);
if (aaeon_mcu_gpo_set_cmd(data, offset, value) == 0)
assign_bit(offset, data->gpo_state, value);
return 0;
> +}
> +
> +static const struct gpio_chip aaeon_mcu_chip = {
> + .label = "gpio-aaeon-mcu",
> + .owner = THIS_MODULE,
> + .get_direction = aaeon_mcu_gpio_get_direction,
> + .direction_input = aaeon_mcu_gpio_direction_input,
> + .direction_output = aaeon_mcu_gpio_direction_output,
> + .get = aaeon_mcu_gpio_get,
> + .set = aaeon_mcu_gpio_set,
> + .base = -1,
> + .ngpio = MAX_GPOS + MAX_GPIOS,
> + .can_sleep = true,
> +};
There's no point in keeping it in memory if you copy it into data->gc anyway.
Use compound literals in aaeon_mcu_gpio_probe() if you want to initialize
members explicitly.
> +
> +static void aaeon_mcu_gpio_reset(struct aaeon_mcu_gpio *data, struct device *dev)
> +{
> + unsigned int i;
> + int ret;
> +
> + /* Reset all GPOs */
> + for (i = 0; i < MAX_GPOS; i++) {
> + ret = aaeon_mcu_gpo_set_cmd(data, i, 0);
> + if (ret < 0)
> + dev_warn(dev, "Failed to reset GPO %u state: %d\n", i, ret);
> + clear_bit(i, data->dir_in);
> + }
> +
> + /* Reset all GPIOs */
> + for (i = MAX_GPOS; i < MAX_GPOS + MAX_GPIOS; i++) {
> + ret = aaeon_mcu_gpio_config_input_cmd(data, i);
> + if (ret < 0)
> + dev_warn(dev, "Failed to reset GPIO %u state: %d\n", i, ret);
> + set_bit(i, data->dir_in);
> + }
> +}
> +
> +static int aaeon_mcu_gpio_probe(struct platform_device *pdev)
> +{
> + struct aaeon_mcu_dev *mfd = dev_get_drvdata(pdev->dev.parent);
> + struct aaeon_mcu_gpio *data;
> +
> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + data->mfd = mfd;
It looks like all you need is the i2c_client, maybe just store its address and
avoid constant dereferencing.
> + data->gc = aaeon_mcu_chip;
> + data->gc.parent = &pdev->dev;
> +
> + /*
> + * Reset all GPIO states to a known configuration. The MCU does not
> + * reset GPIO state on soft reboot, only on power cycle (hard reboot).
> + * Without this reset, GPIOs would retain their previous state across
> + * reboots, which could lead to unexpected behavior.
> + */
> + aaeon_mcu_gpio_reset(data, &pdev->dev);
> +
> + platform_set_drvdata(pdev, data);
Where is the corresponding call to platform_get_drvdata()?
> +
> + return devm_gpiochip_add_data(&pdev->dev, &data->gc,
> + data);
> +}
> +
> +static const struct of_device_id aaeon_mcu_gpio_of_match[] = {
> + { .compatible = "aaeon,srg-imx8pl-gpio" },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, aaeon_mcu_gpio_of_match);
> +
> +static struct platform_driver aaeon_mcu_gpio_driver = {
> + .driver = {
> + .name = "aaeon-mcu-gpio",
> + .of_match_table = aaeon_mcu_gpio_of_match,
> + },
> + .probe = aaeon_mcu_gpio_probe,
> +};
> +
> +module_platform_driver(aaeon_mcu_gpio_driver);
> +
> +MODULE_DESCRIPTION("GPIO interface for Aaeon MCU");
> +MODULE_AUTHOR("Jérémie Dautherbes <jeremie.dautheribes@bootlin.com>");
> +MODULE_LICENSE("GPL");
>
> --
> 2.52.0
>
>
Bart
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
2025-12-12 7:41 ` [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
2025-12-12 10:11 ` Bartosz Golaszewski
@ 2025-12-13 6:22 ` kernel test robot
2025-12-13 22:38 ` kernel test robot
2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2025-12-13 6:22 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: oe-kbuild-all, devicetree, linux-kernel, linux-gpio, imx,
linux-arm-kernel, linux-watchdog,
Thomas Perrot (Schneider Electric), Thomas Petazzoni
Hi Thomas,
kernel test robot noticed the following build errors:
[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]
url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Perrot-Schneider-Electric/dt-bindings-vendor-prefixes-Add-AAEON-vendor-prefix/20251212-154458
base: d358e5254674b70f34c847715ca509e46eb81e6f
patch link: https://lore.kernel.org/r/20251212-dev-b4-aaeon-mcu-driver-v1-6-6bd65bc8ef12%40bootlin.com
patch subject: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
config: arc-randconfig-r132-20251213 (https://download.01.org/0day-ci/archive/20251213/202512131342.1nkKkryD-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251213/202512131342.1nkKkryD-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512131342.1nkKkryD-lkp@intel.com/
All errors (new ones prefixed by >>):
`.exit.text' referenced in section `__jump_table' of lib/test_dynamic_debug.o: defined in discarded section `.exit.text' of lib/test_dynamic_debug.o
`.exit.text' referenced in section `__jump_table' of lib/test_dynamic_debug.o: defined in discarded section `.exit.text' of lib/test_dynamic_debug.o
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o: in function `aaeon_mcu_gpio_get':
>> drivers/gpio/gpio-aaeon-mcu.c:124:(.text+0x4c): undefined reference to `aaeon_mcu_i2c_xfer'
>> arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:124:(.text+0x4c): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o: in function `aaeon_mcu_gpio_set':
drivers/gpio/gpio-aaeon-mcu.c:139:(.text+0x100): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:139:(.text+0x100): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:150:(.text+0x172): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o:drivers/gpio/gpio-aaeon-mcu.c:150: more undefined references to `aaeon_mcu_i2c_xfer' follow
`.exit.text' referenced in section `__jump_table' of drivers/target/target_core_configfs.o: defined in discarded section `.exit.text' of drivers/target/target_core_configfs.o
`.exit.text' referenced in section `__jump_table' of drivers/target/target_core_configfs.o: defined in discarded section `.exit.text' of drivers/target/target_core_configfs.o
sparse warnings: (new ones prefixed by >>)
>> drivers/gpio/gpio-aaeon-mcu.c:246:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:246:1: sparse: sparse: static assertion failed: "MODULE_INFO(description, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:247:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:247:1: sparse: sparse: static assertion failed: "MODULE_INFO(author, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: static assertion failed: "MODULE_INFO(file, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: static assertion failed: "MODULE_INFO(license, ...) contains embedded NUL byte"
vim +124 drivers/gpio/gpio-aaeon-mcu.c
110
111 static int aaeon_mcu_gpio_get(struct gpio_chip *gc, unsigned int offset)
112 {
113 struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
114 u8 cmd[3], rsp;
115 int ret;
116
117 if (offset < MAX_GPOS)
118 return test_bit(offset, data->gpo_state);
119
120 cmd[0] = AAEON_MCU_READ_GPIO;
121 cmd[1] = offset - 7;
122 cmd[2] = 0x00;
123
> 124 ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
125 if (ret < 0)
126 return ret;
127
128 return rsp;
129 }
130
131 static int aaeon_mcu_gpo_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
132 {
133 u8 cmd[3], rsp;
134
135 cmd[0] = AAEON_MCU_CONTROL_GPO;
136 cmd[1] = offset + 1;
137 cmd[2] = !!value;
138
139 return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
140 }
141
142 static int aaeon_mcu_gpio_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
143 {
144 u8 cmd[3], rsp;
145
146 cmd[0] = AAEON_MCU_WRITE_GPIO;
147 cmd[1] = offset - 7;
148 cmd[2] = !!value;
149
150 return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
151 }
152
153 static int aaeon_mcu_gpio_set(struct gpio_chip *gc, unsigned int offset,
154 int value)
155 {
156 struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
157
158 if (offset < MAX_GPOS) {
159 if (aaeon_mcu_gpo_set_cmd(data, offset, value) == 0)
160 assign_bit(offset, data->gpo_state, value);
161 } else {
162 return aaeon_mcu_gpio_set_cmd(data, offset, value);
163 }
164 return 0;
165 }
166
167 static const struct gpio_chip aaeon_mcu_chip = {
168 .label = "gpio-aaeon-mcu",
169 .owner = THIS_MODULE,
170 .get_direction = aaeon_mcu_gpio_get_direction,
171 .direction_input = aaeon_mcu_gpio_direction_input,
172 .direction_output = aaeon_mcu_gpio_direction_output,
173 .get = aaeon_mcu_gpio_get,
174 .set = aaeon_mcu_gpio_set,
175 .base = -1,
176 .ngpio = MAX_GPOS + MAX_GPIOS,
177 .can_sleep = true,
178 };
179
180 static void aaeon_mcu_gpio_reset(struct aaeon_mcu_gpio *data, struct device *dev)
181 {
182 unsigned int i;
183 int ret;
184
185 /* Reset all GPOs */
186 for (i = 0; i < MAX_GPOS; i++) {
187 ret = aaeon_mcu_gpo_set_cmd(data, i, 0);
188 if (ret < 0)
189 dev_warn(dev, "Failed to reset GPO %u state: %d\n", i, ret);
190 clear_bit(i, data->dir_in);
191 }
192
193 /* Reset all GPIOs */
194 for (i = MAX_GPOS; i < MAX_GPOS + MAX_GPIOS; i++) {
195 ret = aaeon_mcu_gpio_config_input_cmd(data, i);
196 if (ret < 0)
197 dev_warn(dev, "Failed to reset GPIO %u state: %d\n", i, ret);
198 set_bit(i, data->dir_in);
199 }
200 }
201
202 static int aaeon_mcu_gpio_probe(struct platform_device *pdev)
203 {
204 struct aaeon_mcu_dev *mfd = dev_get_drvdata(pdev->dev.parent);
205 struct aaeon_mcu_gpio *data;
206
207 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
208 if (!data)
209 return -ENOMEM;
210
211 data->mfd = mfd;
212 data->gc = aaeon_mcu_chip;
213 data->gc.parent = &pdev->dev;
214
215 /*
216 * Reset all GPIO states to a known configuration. The MCU does not
217 * reset GPIO state on soft reboot, only on power cycle (hard reboot).
218 * Without this reset, GPIOs would retain their previous state across
219 * reboots, which could lead to unexpected behavior.
220 */
221 aaeon_mcu_gpio_reset(data, &pdev->dev);
222
223 platform_set_drvdata(pdev, data);
224
225 return devm_gpiochip_add_data(&pdev->dev, &data->gc,
226 data);
227 }
228
229 static const struct of_device_id aaeon_mcu_gpio_of_match[] = {
230 { .compatible = "aaeon,srg-imx8pl-gpio" },
231 {},
232 };
233
234 MODULE_DEVICE_TABLE(of, aaeon_mcu_gpio_of_match);
235
236 static struct platform_driver aaeon_mcu_gpio_driver = {
237 .driver = {
238 .name = "aaeon-mcu-gpio",
239 .of_match_table = aaeon_mcu_gpio_of_match,
240 },
241 .probe = aaeon_mcu_gpio_probe,
242 };
243
244 module_platform_driver(aaeon_mcu_gpio_driver);
245
> 246 MODULE_DESCRIPTION("GPIO interface for Aaeon MCU");
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
2025-12-12 7:41 ` [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
2025-12-12 10:11 ` Bartosz Golaszewski
2025-12-13 6:22 ` kernel test robot
@ 2025-12-13 22:38 ` kernel test robot
2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2025-12-13 22:38 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: oe-kbuild-all, devicetree, linux-kernel, linux-gpio, imx,
linux-arm-kernel, linux-watchdog,
Thomas Perrot (Schneider Electric), Thomas Petazzoni
Hi Thomas,
kernel test robot noticed the following build errors:
[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]
url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Perrot-Schneider-Electric/dt-bindings-vendor-prefixes-Add-AAEON-vendor-prefix/20251212-154458
base: d358e5254674b70f34c847715ca509e46eb81e6f
patch link: https://lore.kernel.org/r/20251212-dev-b4-aaeon-mcu-driver-v1-6-6bd65bc8ef12%40bootlin.com
patch subject: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
config: mips-randconfig-r051-20251213 (https://download.01.org/0day-ci/archive/20251214/202512140637.VrfgC1Tj-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251214/202512140637.VrfgC1Tj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512140637.VrfgC1Tj-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "aaeon_mcu_i2c_xfer" [drivers/gpio/gpio-aaeon-mcu.ko] undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 7/8] watchdog: aaeon: Add watchdog driver for SRG-IMX8PL MCU
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (5 preceding siblings ...)
2025-12-12 7:41 ` [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 11:44 ` Guenter Roeck
2025-12-12 7:41 ` [PATCH 8/8] MAINTAINERS: Add entry for AAEON SRG-IMX8PL MCU driver Thomas Perrot (Schneider Electric)
7 siblings, 1 reply; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add watchdog driver for the Aaeon SRG-IMX8PL embedded controller.
This driver provides system monitoring and recovery capabilities
through the MCU's watchdog timer.
The watchdog supports start, stop, and ping operations with a maximum
hardware heartbeat of 25 seconds and a default timeout of 240 seconds.
The driver assumes the watchdog is already running at probe time, as
the MCU typically enables it by default.
Co-developed-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
drivers/watchdog/Kconfig | 10 +++
drivers/watchdog/Makefile | 1 +
drivers/watchdog/aaeon_mcu_wdt.c | 140 +++++++++++++++++++++++++++++++++++++++
3 files changed, 151 insertions(+)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d3b9df7d466b0b7215ee87b3040811d44ee53d2a..1bd4a7bee303e5e2508f540dc2c16e9e19ed18b0 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -168,6 +168,16 @@ config SOFT_WATCHDOG_PRETIMEOUT
watchdog. Be aware that governors might affect the watchdog because it
is purely software, e.g. the panic governor will stall it!
+config AAEON_MCU_WATCHDOG
+ tristate "Aaeon MCU Watchdog"
+ depends on MFD_AAEON_MCU
+ select WATCHDOG_CORE
+ help
+ Select this option to enable watchdog timer support for the Aaeon
+ SRG-IMX8PL onboard microcontroller (MCU). This driver provides
+ watchdog functionality through the MCU, allowing system monitoring
+ and automatic recovery from system hangs.
+
config BD957XMUF_WATCHDOG
tristate "ROHM BD9576MUF and BD9573MUF PMIC Watchdog"
depends on MFD_ROHM_BD957XMUF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index ba52099b125398a32f80dad23317e223cc4af028..2deec425d3eafb6b208e061fda9f216f4baa8ecc 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
# ALPHA Architecture
# ARM Architecture
+obj-$(CONFIG_AAEON_MCU_WATCHDOG) += aaeon_mcu_wdt.o
obj-$(CONFIG_ARM_SP805_WATCHDOG) += sp805_wdt.o
obj-$(CONFIG_ARM_SBSA_WATCHDOG) += sbsa_gwdt.o
obj-$(CONFIG_ARMADA_37XX_WATCHDOG) += armada_37xx_wdt.o
diff --git a/drivers/watchdog/aaeon_mcu_wdt.c b/drivers/watchdog/aaeon_mcu_wdt.c
new file mode 100644
index 0000000000000000000000000000000000000000..8413ea3bce99585d989cf13e4494e8daff2d9e4c
--- /dev/null
+++ b/drivers/watchdog/aaeon_mcu_wdt.c
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Aaeon MCU Watchdog driver
+ *
+ * Copyright (C) 2025 Bootlin
+ * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+ * Author: Thomas Perrot <thomas.perrot@bootlin.com>
+ */
+
+#include <linux/i2c.h>
+#include <linux/mfd/aaeon-mcu.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/watchdog.h>
+
+#define AAEON_MCU_CONTROL_WDT 0x63
+#define AAEON_MCU_PING_WDT 0x73
+
+#define AAEON_MCU_WDT_TIMEOUT 240
+#define AAEON_MCU_WDT_HEARTBEAT_MS 25000
+
+struct aaeon_mcu_wdt {
+ struct watchdog_device wdt;
+ struct aaeon_mcu_dev *mfd;
+};
+
+static int aaeon_mcu_wdt_start_cmd(struct aaeon_mcu_wdt *data)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_CONTROL_WDT;
+ cmd[1] = 0x01;
+ cmd[2] = 0x00;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_wdt_start(struct watchdog_device *wdt)
+{
+ struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
+
+ return aaeon_mcu_wdt_start_cmd(data);
+}
+
+static int aaeon_mcu_wdt_stop_cmd(struct aaeon_mcu_wdt *data)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_CONTROL_WDT;
+ cmd[1] = 0x00;
+ cmd[2] = 0x00;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_wdt_stop(struct watchdog_device *wdt)
+{
+ struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
+
+ return aaeon_mcu_wdt_stop_cmd(data);
+}
+
+static int aaeon_mcu_wdt_ping_cmd(struct aaeon_mcu_wdt *data)
+{
+ u8 cmd[3], rsp;
+
+ cmd[0] = AAEON_MCU_PING_WDT;
+ cmd[1] = 0x00;
+ cmd[2] = 0x00;
+
+ return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
+}
+
+static int aaeon_mcu_wdt_ping(struct watchdog_device *wdt)
+{
+ struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
+
+ return aaeon_mcu_wdt_ping_cmd(data);
+}
+
+static const struct watchdog_info aaeon_mcu_wdt_info = {
+ .identity = "Aaeon MCU Watchdog",
+ .options = WDIOF_KEEPALIVEPING
+};
+
+static const struct watchdog_ops aaeon_mcu_wdt_ops = {
+ .owner = THIS_MODULE,
+ .start = aaeon_mcu_wdt_start,
+ .stop = aaeon_mcu_wdt_stop,
+ .ping = aaeon_mcu_wdt_ping,
+};
+
+static int aaeon_mcu_wdt_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct aaeon_mcu_dev *mcu = dev_get_drvdata(dev->parent);
+ struct watchdog_device *wdt;
+ struct aaeon_mcu_wdt *data;
+
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->mfd = mcu;
+
+ wdt = &data->wdt;
+ wdt->parent = dev;
+
+ wdt->info = &aaeon_mcu_wdt_info;
+ wdt->ops = &aaeon_mcu_wdt_ops;
+ wdt->max_hw_heartbeat_ms = AAEON_MCU_WDT_HEARTBEAT_MS;
+ watchdog_init_timeout(wdt, AAEON_MCU_WDT_TIMEOUT, dev);
+
+ watchdog_set_drvdata(wdt, data);
+ platform_set_drvdata(pdev, data);
+ set_bit(WDOG_HW_RUNNING, &wdt->status);
+
+ return devm_watchdog_register_device(dev, wdt);
+}
+
+static const struct of_device_id aaeon_mcu_wdt_of_match[] = {
+ { .compatible = "aaeon,srg-imx8pl-wdt" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, aaeon_mcu_wdt_of_match);
+
+static struct platform_driver aaeon_mcu_wdt_driver = {
+ .driver = {
+ .name = "aaeon-mcu-wdt",
+ .of_match_table = aaeon_mcu_wdt_of_match,
+ },
+ .probe = aaeon_mcu_wdt_probe,
+};
+
+module_platform_driver(aaeon_mcu_wdt_driver);
+
+MODULE_DESCRIPTION("Aaeon MCU Watchdog Driver");
+MODULE_AUTHOR("Jérémie Dautheribes");
+MODULE_LICENSE("GPL");
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 7/8] watchdog: aaeon: Add watchdog driver for SRG-IMX8PL MCU
2025-12-12 7:41 ` [PATCH 7/8] watchdog: aaeon: Add watchdog " Thomas Perrot (Schneider Electric)
@ 2025-12-12 11:44 ` Guenter Roeck
0 siblings, 0 replies; 19+ messages in thread
From: Guenter Roeck @ 2025-12-12 11:44 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/11/25 23:41, Thomas Perrot (Schneider Electric) wrote:
> Add watchdog driver for the Aaeon SRG-IMX8PL embedded controller.
> This driver provides system monitoring and recovery capabilities
> through the MCU's watchdog timer.
>
> The watchdog supports start, stop, and ping operations with a maximum
> hardware heartbeat of 25 seconds and a default timeout of 240 seconds.
> The driver assumes the watchdog is already running at probe time, as
> the MCU typically enables it by default.
>
> Co-developed-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
> Signed-off-by: Jérémie Dautheribes (Schneider Electric) <jeremie.dautheribes@bootlin.com>
> Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
> ---
> drivers/watchdog/Kconfig | 10 +++
> drivers/watchdog/Makefile | 1 +
> drivers/watchdog/aaeon_mcu_wdt.c | 140 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 151 insertions(+)
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index d3b9df7d466b0b7215ee87b3040811d44ee53d2a..1bd4a7bee303e5e2508f540dc2c16e9e19ed18b0 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -168,6 +168,16 @@ config SOFT_WATCHDOG_PRETIMEOUT
> watchdog. Be aware that governors might affect the watchdog because it
> is purely software, e.g. the panic governor will stall it!
>
> +config AAEON_MCU_WATCHDOG
> + tristate "Aaeon MCU Watchdog"
> + depends on MFD_AAEON_MCU
> + select WATCHDOG_CORE
> + help
> + Select this option to enable watchdog timer support for the Aaeon
> + SRG-IMX8PL onboard microcontroller (MCU). This driver provides
> + watchdog functionality through the MCU, allowing system monitoring
> + and automatic recovery from system hangs.
> +
> config BD957XMUF_WATCHDOG
> tristate "ROHM BD9576MUF and BD9573MUF PMIC Watchdog"
> depends on MFD_ROHM_BD957XMUF
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index ba52099b125398a32f80dad23317e223cc4af028..2deec425d3eafb6b208e061fda9f216f4baa8ecc 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -37,6 +37,7 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
> # ALPHA Architecture
>
> # ARM Architecture
> +obj-$(CONFIG_AAEON_MCU_WATCHDOG) += aaeon_mcu_wdt.o
> obj-$(CONFIG_ARM_SP805_WATCHDOG) += sp805_wdt.o
> obj-$(CONFIG_ARM_SBSA_WATCHDOG) += sbsa_gwdt.o
> obj-$(CONFIG_ARMADA_37XX_WATCHDOG) += armada_37xx_wdt.o
> diff --git a/drivers/watchdog/aaeon_mcu_wdt.c b/drivers/watchdog/aaeon_mcu_wdt.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..8413ea3bce99585d989cf13e4494e8daff2d9e4c
> --- /dev/null
> +++ b/drivers/watchdog/aaeon_mcu_wdt.c
> @@ -0,0 +1,140 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Aaeon MCU Watchdog driver
> + *
> + * Copyright (C) 2025 Bootlin
> + * Author: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
> + * Author: Thomas Perrot <thomas.perrot@bootlin.com>
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/mfd/aaeon-mcu.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/watchdog.h>
> +
> +#define AAEON_MCU_CONTROL_WDT 0x63
> +#define AAEON_MCU_PING_WDT 0x73
tab after the macro name, please.
> +
> +#define AAEON_MCU_WDT_TIMEOUT 240
> +#define AAEON_MCU_WDT_HEARTBEAT_MS 25000
> +
> +struct aaeon_mcu_wdt {
> + struct watchdog_device wdt;
> + struct aaeon_mcu_dev *mfd;
mfd is not used anywhere. Just store and use the i2c client.
> +};
> +
> +static int aaeon_mcu_wdt_start_cmd(struct aaeon_mcu_wdt *data)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_CONTROL_WDT;
> + cmd[1] = 0x01;
> + cmd[2] = 0x00;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_wdt_start(struct watchdog_device *wdt)
> +{
> + struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
> +
> + return aaeon_mcu_wdt_start_cmd(data);
> +}
> +
> +static int aaeon_mcu_wdt_stop_cmd(struct aaeon_mcu_wdt *data)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_CONTROL_WDT;
> + cmd[1] = 0x00;
> + cmd[2] = 0x00;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
> +}
> +
> +static int aaeon_mcu_wdt_stop(struct watchdog_device *wdt)
> +{
> + struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
> +
> + return aaeon_mcu_wdt_stop_cmd(data);
> +}
> +
> +static int aaeon_mcu_wdt_ping_cmd(struct aaeon_mcu_wdt *data)
> +{
> + u8 cmd[3], rsp;
> +
> + cmd[0] = AAEON_MCU_PING_WDT;
> + cmd[1] = 0x00;
> + cmd[2] = 0x00;
> +
> + return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
This code is pretty much always the same. It would be much simpler to just pass
i2c_client and the opcodes (first two bytes of the 3-byte message) as parameters
to a single function.
> +}
> +
> +static int aaeon_mcu_wdt_ping(struct watchdog_device *wdt)
> +{
> + struct aaeon_mcu_wdt *data = watchdog_get_drvdata(wdt);
> +
> + return aaeon_mcu_wdt_ping_cmd(data);
> +}
> +
> +static const struct watchdog_info aaeon_mcu_wdt_info = {
> + .identity = "Aaeon MCU Watchdog",
> + .options = WDIOF_KEEPALIVEPING
> +};
> +
> +static const struct watchdog_ops aaeon_mcu_wdt_ops = {
> + .owner = THIS_MODULE,
> + .start = aaeon_mcu_wdt_start,
> + .stop = aaeon_mcu_wdt_stop,
> + .ping = aaeon_mcu_wdt_ping,
> +};
> +
> +static int aaeon_mcu_wdt_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct aaeon_mcu_dev *mcu = dev_get_drvdata(dev->parent);
> + struct watchdog_device *wdt;
> + struct aaeon_mcu_wdt *data;
> +
> + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + data->mfd = mcu;
> +
> + wdt = &data->wdt;
> + wdt->parent = dev;
> +
> + wdt->info = &aaeon_mcu_wdt_info;
> + wdt->ops = &aaeon_mcu_wdt_ops;
> + wdt->max_hw_heartbeat_ms = AAEON_MCU_WDT_HEARTBEAT_MS;
> + watchdog_init_timeout(wdt, AAEON_MCU_WDT_TIMEOUT, dev);
Calling watchdog_init_timeout() only makes sense if an (optional)
module parameter is passed to it. Passing a constant is pointless.
Just set wdt->timeout.
> +
> + watchdog_set_drvdata(wdt, data);
> + platform_set_drvdata(pdev, data);
> + set_bit(WDOG_HW_RUNNING, &wdt->status);
The driver does not know if that is the case. Guessing is insufficient.
Either stop the watchdog or start it explicitly if the status can not
be retrieved from the MCU.
> +
> + return devm_watchdog_register_device(dev, wdt);
> +}
> +
> +static const struct of_device_id aaeon_mcu_wdt_of_match[] = {
> + { .compatible = "aaeon,srg-imx8pl-wdt" },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, aaeon_mcu_wdt_of_match);
> +
> +static struct platform_driver aaeon_mcu_wdt_driver = {
> + .driver = {
> + .name = "aaeon-mcu-wdt",
> + .of_match_table = aaeon_mcu_wdt_of_match,
> + },
> + .probe = aaeon_mcu_wdt_probe,
> +};
> +
> +module_platform_driver(aaeon_mcu_wdt_driver);
> +
> +MODULE_DESCRIPTION("Aaeon MCU Watchdog Driver");
> +MODULE_AUTHOR("Jérémie Dautheribes");
> +MODULE_LICENSE("GPL");
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 8/8] MAINTAINERS: Add entry for AAEON SRG-IMX8PL MCU driver
2025-12-12 7:41 [PATCH 0/8] Add support for AAEON SRG-IMX8PL MCU Thomas Perrot (Schneider Electric)
` (6 preceding siblings ...)
2025-12-12 7:41 ` [PATCH 7/8] watchdog: aaeon: Add watchdog " Thomas Perrot (Schneider Electric)
@ 2025-12-12 7:41 ` Thomas Perrot (Schneider Electric)
2025-12-12 8:23 ` Krzysztof Kozlowski
7 siblings, 1 reply; 19+ messages in thread
From: Thomas Perrot (Schneider Electric) @ 2025-12-12 7:41 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Perrot (Schneider Electric),
Thomas Petazzoni
Add maintainer entry for the Aaeon SRG-IMX8PL MCU MFD driver and its
sub-device drivers (GPIO and watchdog).
Signed-off-by: Thomas Perrot (Schneider Electric) <thomas.perrot@bootlin.com>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index c9e416ba74c64e90629c0b7d7941f879c9ac589e..13a4eced229acd970b9e5de864a441f28fa2aa91 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -186,6 +186,15 @@ W: http://www.adaptec.com/
F: Documentation/scsi/aacraid.rst
F: drivers/scsi/aacraid/
+AAEON SRG-IMX8PL CONTROLLER MFD DRIVER
+M: Thomas Perrot <thomas.perrot@bootlin.com>
+R: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
+S: Maintained
+F: drivers/gpio/gpio-aaeon-mcu.c
+F: drivers/mfd/aaeon-mcu.c
+F: drivers/watchdog/aaeon_mcu_wdt.c
+F: include/linux/mfd/aaeon-mcu.h
+
AAEON UPBOARD FPGA MFD DRIVER
M: Thomas Richard <thomas.richard@bootlin.com>
S: Maintained
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 8/8] MAINTAINERS: Add entry for AAEON SRG-IMX8PL MCU driver
2025-12-12 7:41 ` [PATCH 8/8] MAINTAINERS: Add entry for AAEON SRG-IMX8PL MCU driver Thomas Perrot (Schneider Electric)
@ 2025-12-12 8:23 ` Krzysztof Kozlowski
0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-12 8:23 UTC (permalink / raw)
To: Thomas Perrot (Schneider Electric), Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam,
Jérémie Dautheribes, Wim Van Sebroeck, Guenter Roeck,
Lee Jones
Cc: devicetree, linux-kernel, linux-gpio, imx, linux-arm-kernel,
linux-watchdog, Thomas Petazzoni
On 12/12/2025 08:41, Thomas Perrot (Schneider Electric) wrote:
> +AAEON SRG-IMX8PL CONTROLLER MFD DRIVER
> +M: Thomas Perrot <thomas.perrot@bootlin.com>
> +R: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
> +S: Maintained
> +F: drivers/gpio/gpio-aaeon-mcu.c
> +F: drivers/mfd/aaeon-mcu.c
> +F: drivers/watchdog/aaeon_mcu_wdt.c
> +F: include/linux/mfd/aaeon-mcu.h
Incomplete - missing bindings.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread