[PATCH v8 0/5] Add support for AAEON SRG-IMX8P MCU
"Thomas Perrot (Schneider Electric)" <[email protected]> Fri, 31 Jul 2026 11:51:40 +0200
| Newsgroups | org.kernel.vger.linux-watchdog,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
This patch series introduces support for the AAEON SRG-IMX8P embedded controller (MCU). The MCU is connected via I2C and provides GPIO and watchdog functionality for the SRG-IMX8P board. The series includes: - Device tree binding for the MFD driver - MFD driver that serves as the core driver for the MCU - GPIO driver implementing the GPIO functionality - Watchdog driver for system monitoring - MAINTAINERS entry for the new drivers The drivers follow the standard Linux kernel subsystem patterns, with the MFD driver registering the sub-devices (GPIO and watchdog) which are then handled by their respective subsystem drivers. Signed-off-by: Thomas Perrot (Schneider Electric) <[email protected]> --- Changes in v8: - mfd: add .use_single_read = true to regmap config; the MCU produces exactly one response byte per command and a bulk read passing val_size > 1 to the bus callback would be incorrect - watchdog: call watchdog_stop_ping_on_suspend() in probe so the kthread ping worker is cancelled before platform devices are suspended, preventing I2C transfers on a suspended bus - watchdog: check watchdog_hw_running() alongside watchdog_active() in the suspend/resume callbacks so watchdog is stopped before sleep and restarted on wake, preventing a spurious MCU reset if suspend exceeds the 25-second hardware timeout - Link to v7: https://lore.kernel.org/r/[email protected] Changes in v7: - mfd: fix select REGMAP Kconfig entry indented with spaces instead of a tab - mfd: use devm_kcalloc() instead of devm_kzalloc() for the cmd buffer allocation - mfd: add .use_single_write = true to the regmap config to prevent regcache sync or debugfs from issuing multi-register writes that would overflow the fixed 3-byte cmd buffer - watchdog: remove max_timeout; it is documented as irrelevant when max_hw_heartbeat_ms is set and is silently ignored by the watchdog core - watchdog: pass dev->parent to watchdog_init_timeout() so that the timeout-sec DT property is correctly read from the MCU I2C node; the MFD child platform device has no of_node of its own - watchdog: add suspend/resume PM hooks to stop the watchdog before entering sleep and restart it on resume, preventing spurious resets if suspend lasts longer than the 25-second hardware heartbeat - Link to v6: https://lore.kernel.org/r/[email protected] Changes in v6: - mfd: rename local variable to ddata in probe - mfd: fix driver name from "aaeon_mcu" to "aaeon-mcu" - mfd: set I2C_M_DMA_SAFE on all i2c_msg flags so the host driver skips bounce-buffering the heap-allocated DMA-safe buffers - mfd: drop COMPILE_TEST - gpio: replace __set/__clear/__assign_bit with atomic set_bit/ clear_bit/assign_bit to fix potential races on shared bitmaps - gpio: write output value before switching pin to output mode to avoid a potential glitch on direction_output - gpio: add MODULE_ALIAS("platform:aaeon-mcu-gpio") - watchdog: add WDIOF_SETTIMEOUT and watchdog_init_timeout() so the software timeout is configurable via ioctl, DT timeout-sec or the watchdog_timeout boot parameter - watchdog: add watchdog_stop_on_reboot() to prevent a spurious reset from the external MCU during system shutdown - watchdog: add MODULE_ALIAS("platform:aaeon-mcu-wdt") - Link to v5: https://lore.kernel.org/r/[email protected] Changes in v5: - mfd: use heap-allocated DMA-safe buffers for I2C transfers, replacing stack-allocated buffers in the regmap bus callbacks - mfd: switch from REGCACHE_NONE to REGCACHE_MAPLE; add volatile_reg callback marking GPIO input read registers (opcode 0x72) as volatile; add max_register - mfd: use PLATFORM_DEVID_AUTO instead of PLATFORM_DEVID_NONE - mfd: use MFD_CELL_BASIC() macro for cell definitions - mfd: use dev_err_probe() for regmap initialization error - Link to v4: https://lore.kernel.org/r/[email protected] Changes in v4: - mfd: switch to a custom regmap bus; remove aaeon_mcu_i2c_xfer() and the aaeon_mcu_dev struct - mfd: locking delegated to regmap's built-in mutex; drop explicit mutex - mfd: remove firmware version reading at probe time - gpio, watchdog: use regmap_read()/regmap_write() via dev_get_regmap() - include: replace aaeon_mcu_i2c_xfer() declaration with AAEON_MCU_REG() macro - dt-bindings: remove unused label from example node - Link to v3: https://lore.kernel.org/r/[email protected] Changes in v3: - Renamed SRG-IMX8PL to SRG-IMX8P - dt-bindings: add gpio-controller properties as required - mfd: move struct aaeon_mcu_dev from header to .c file (private) - mfd: use guard(mutex) and devm_mutex_init() for cleanup - mfd: firmware version log changed to dev_dbg() - mfd: add select MFD_CORE to Kconfig - Kconfig: add || COMPILE_TEST to all three drivers - watchdog: add comments explaining hardware timeout and WDOG_HW_RUNNING - watchdog: remove unused platform_set_drvdata() - watchdog: add a function to query the status - Link to v2: https://lore.kernel.org/r/[email protected] Changes in v2: - Fold GPIO and watchdog bindings into MFD binding - Drop OF_GPIO dependency in GPIO Kconfig - Use __set_bit/__clear_bit/__assign_bit instead of atomic variants - Various driver cleanups and improvements - Link to v1: https://lore.kernel.org/r/[email protected] --- Thomas Perrot (Schneider Electric) (5): dt-bindings: vendor-prefixes: Add AAEON vendor prefix dt-bindings: mfd: Add AAEON embedded controller mfd: aaeon: Add SRG-IMX8P MCU driver gpio: aaeon: Add GPIO driver for SRG-IMX8P MCU watchdog: aaeon: Add watchdog driver for SRG-IMX8P MCU .../bindings/mfd/aaeon,srg-imx8p-mcu.yaml | 67 ++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 10 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-aaeon-mcu.c | 230 +++++++++++++++++++++ drivers/mfd/Kconfig | 11 + drivers/mfd/Makefile | 1 + drivers/mfd/aaeon-mcu.c | 207 +++++++++++++++++++ drivers/watchdog/Kconfig | 10 + drivers/watchdog/Makefile | 1 + drivers/watchdog/aaeon_mcu_wdt.c | 168 +++++++++++++++ include/linux/mfd/aaeon-mcu.h | 40 ++++ 13 files changed, 757 insertions(+) --- base-commit: d358e5254674b70f34c847715ca509e46eb81e6f change-id: 20251211-dev-b4-aaeon-mcu-driver-e0e89ebf4afb Best regards, -- Thomas Perrot (Schneider Electric) <[email protected]>