From patchwork Fri May 10 10:18:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 13661251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 503D9C25B74 for ; Fri, 10 May 2024 10:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) id 1DF11C32781; Fri, 10 May 2024 10:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36AFEC113CC; Fri, 10 May 2024 10:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715336309; bh=3mgk/qKH2ybFNCBiVS1cLaPC0sYDQzDSpjzoyqxz4Ms=; h=From:List-Id:To:Cc:Subject:Date:From; b=QWHAMRwr0i2LHX4GA+obVtqai9FuSYUCoEERqCgeRrsZLQo14dQ13OXCz5dZwvUQK yIOv22lSKzIOMaVB0zGZsNYv0+r2pSm/TpsEkbhoSua8Ej00UfYLpQQL2AwFbu/Fki IktGBBQt5xtio0h8Clb522ehSoCvb1LA+eAGF3bXbCSclCmfdxQdUKQXPgZbV1H6Lr pVbIZVimzk3PLj8FtcU5dBCxhQ6E8GvzQrRk3KJqsVrFVTFbUmGWEk905XWpQChpiV uW8Oh1m8VwvHdUd1BQunByGx4JfS7YtxY3JT98/sd3qR+ZGAD8mrhRp7lTk0p2jsOu Zbmyi0CMPD3og== From: =?utf-8?q?Marek_Beh=C3=BAn?= List-Id: To: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Alessandro Zummo , Alexandre Belloni , Bartosz Golaszewski , Christophe JAILLET , Dan Carpenter , devicetree@vger.kernel.org, Greg Kroah-Hartman , Guenter Roeck , Herbert Xu , Krzysztof Kozlowski , Linus Walleij , linux-crypto@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, Olivia Mackall , Rob Herring , Wim Van Sebroeck Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , Andrew Lunn , Conor Dooley , Krzysztof Kozlowski , Rob Herring , Sebastian Hesselbarth , =?utf-8?q?Uwe_Klei?= =?utf-8?q?ne-K=C3=B6nig?= Subject: [PATCH v10 0/9] Turris Omnia MCU driver Date: Fri, 10 May 2024 12:18:10 +0200 Message-ID: <20240510101819.13551-1-kabel@kernel.org> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Hello Andy, Hans, Ilpo, Arnd, Gregory, and others, this is v10 of the series adding Turris Omnia MCU driver. This series still depends on the immutable branch between LEDs and locking, introducing devm_mutex_init(), see the PR https://lore.kernel.org/linux-leds/20240412084616.GR2399047@google.com/ See also cover letters for v1 to v9: https://patchwork.kernel.org/project/linux-soc/cover/20230823161012.6986-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20230919103815.16818-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20231023143130.11602-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20231026161803.16750-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20240323164359.21642-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20240418121116.22184-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20240424173809.7214-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20240430115111.3453-1-kabel@kernel.org/ https://patchwork.kernel.org/project/linux-soc/cover/20240508103118.23345-1-kabel@kernel.org/ Changes since v9: - in functions where mcu->client is referred to multiple times added a helper variable client = mcu->client, suggested by Andy - changed instances of if (!err) do_something; return err; patterns to the more traditional pattern if (err) return err; do_something; return 0; as suggested by Andy - fixed some typos reported by Andy - changed crc32_be(0xffffffff, ...) to crc32_be(~0, ...), as suggested by Andy - changed to use the DECI unit macro from units.h instead of hardcoded 10, as suggested by Andy - changed -EINTR to -ERESTARTSYS in trng read and signature read - changed the mutex lock in signature read to interruptible mutex lock, as pointed out by Andy Marek BehĂșn (9): dt-bindings: firmware: add cznic,turris-omnia-mcu binding platform: cznic: Add preliminary support for Turris Omnia MCU platform: cznic: turris-omnia-mcu: Add support for MCU connected GPIOs platform: cznic: turris-omnia-mcu: Add support for poweroff and wakeup platform: cznic: turris-omnia-mcu: Add support for MCU watchdog platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG platform: cznic: turris-omnia-mcu: Add support for digital message signing via debugfs ARM: dts: turris-omnia: Add MCU system-controller node ARM: dts: turris-omnia: Add GPIO key node for front button .../ABI/testing/debugfs-turris-omnia-mcu | 13 + .../sysfs-bus-i2c-devices-turris-omnia-mcu | 126 ++ .../firmware/cznic,turris-omnia-mcu.yaml | 86 ++ MAINTAINERS | 5 + .../dts/marvell/armada-385-turris-omnia.dts | 35 +- drivers/platform/Kconfig | 2 + drivers/platform/Makefile | 1 + drivers/platform/cznic/Kconfig | 50 + drivers/platform/cznic/Makefile | 9 + .../platform/cznic/turris-omnia-mcu-base.c | 450 +++++++ .../platform/cznic/turris-omnia-mcu-debugfs.c | 208 ++++ .../platform/cznic/turris-omnia-mcu-gpio.c | 1039 +++++++++++++++++ .../cznic/turris-omnia-mcu-sys-off-wakeup.c | 257 ++++ .../platform/cznic/turris-omnia-mcu-trng.c | 103 ++ .../cznic/turris-omnia-mcu-watchdog.c | 128 ++ drivers/platform/cznic/turris-omnia-mcu.h | 216 ++++ include/linux/turris-omnia-mcu-interface.h | 249 ++++ 17 files changed, 2976 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/debugfs-turris-omnia-mcu create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-turris-omnia-mcu create mode 100644 Documentation/devicetree/bindings/firmware/cznic,turris-omnia-mcu.yaml create mode 100644 drivers/platform/cznic/Kconfig create mode 100644 drivers/platform/cznic/Makefile create mode 100644 drivers/platform/cznic/turris-omnia-mcu-base.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu-debugfs.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu-gpio.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu-sys-off-wakeup.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu-trng.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu-watchdog.c create mode 100644 drivers/platform/cznic/turris-omnia-mcu.h create mode 100644 include/linux/turris-omnia-mcu-interface.h