Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp395733lqo; Fri, 10 May 2024 03:18:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8qrhAPeLx/lYljxTQrtt7sppnfmBNElXh6P5a+4yr0gJjwEV04p8Da0aLA0tEMYsff9zIM5IXnCoVTEU4E3zvV2j/jZZn/c8wjETziQ== X-Google-Smtp-Source: AGHT+IG73HDFksAlGOEjF8b3WPkhezUj0XJ6dhLhr/LsaoHdQk52kvLlRAc8d5uKbXa7GK94C0jy X-Received: by 2002:a05:6214:3a09:b0:6a0:e0c9:edd with SMTP id 6a1803df08f44-6a168216d86mr23872916d6.50.1715336323531; Fri, 10 May 2024 03:18:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715336323; cv=pass; d=google.com; s=arc-20160816; b=hJBedtxDCRm/K8UJ3aJ/E7x6h7c+5iMbDcQTw3BEDPFQgK5TSGW/bFAZuDm8hRTaAh qK8F7C6J2XuoX1prOqq0Xp4oDEwkvxHR9rcsiafQiE13ZI7GILK7Y+q4PwsiFscl0lQf N+NwZigBocdbVr08Ui8h0voduoLYZAcPqdoDDSc1rR5sRN3rcrd4Ey01zzZXbEspUNZP Je7urNOhH/++DM3o4Z+bJyq1ZNCzVMrKXt3kKqkkHFZ7b6mCdNRmt1ReNSjaOwIPUnAj fciUmQ7J9Tj+flpP700/kXxH3KMMX5RUQ4P0QRwVgVOEdD6gPcZ2eBWXQEqlp7weCJ6N FVtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=z8MEiVZtnDMt8EZTd8vOJgPC8pPR0N3/CWzm4iIxCTI=; fh=aqm1mi/4lbFGCCW5q/kLXzFGYiABj3zjII+pGIaAGTo=; b=luq9nBFGFy0q8s4qnGkA6sOivBkUL5vD8n5ossHtQfNI/SewcRMUYEFeZKA5JhzzET bcJJToaXT+N2v5tBSSwu3WVrjnKtHTQpJzEjqpkprfQu85XjEGQHo6AN511IEqPUFg26 lNmXdZTF8E45vpGdEV9b9eo1T1CmRvWnlEai3Dl1resLvNVIPZccimQ5P3KXCxt+i9ZB ojYvUewYDgE9I0sFcQGS1F37vcs5QGzIFzZtuZfuaqNn1+rD93E8IfpwM0Qr6Yc9kpHm MLCfJWJKWq5H++51TzosqwFGaGLiuwWWGqd3rEB4AuWI6UgD8AaTxtYGJ4zz6N5hEnup GdJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=QWHAMRwr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1ff14dsi33552646d6.148.2024.05.10.03.18.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 03:18:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=QWHAMRwr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 45E5C1C20A6A for ; Fri, 10 May 2024 10:18:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C944D16C448; Fri, 10 May 2024 10:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QWHAMRwr" X-Original-To: linux-crypto@vger.kernel.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.subspace.kernel.org (Postfix) with ESMTPS id 748742233B; Fri, 10 May 2024 10:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715336309; cv=none; b=anGATSEBw/74KeAUNEFdj1w7J1fAIA4tJAXcn44tsEsz7RphsQ5yfd8T9b/Gkqq0/k97GTK49n2HjBNBjTTYSlyyaOOdf4/mqL8yxeEaAw238e5IxLNvymttXiufVKQvr9Ha23JTE/v0FLzaCs1xdsPHKL2G/Xe7D6oqpZDQPYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715336309; c=relaxed/simple; bh=3mgk/qKH2ybFNCBiVS1cLaPC0sYDQzDSpjzoyqxz4Ms=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NMiRXoZ+RUrzFfjivfbimRkA3RFGV1hoq2jc0NMazdhm2ZchsYuP99wzNa+34Us6NgUQT1WROCMwNK4uq+z3TF4NnisEmNeRY5p1yav1wfh9Av2fUW66Nz4jatKEkF7L2PsWogupiAIslW8HVOlF08dOsy6umfWtOgs/HV+PTvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QWHAMRwr; arc=none smtp.client-ip=10.30.226.201 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=20Beh=C3=BAn?= To: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , =?UTF-8?q?Ilpo=20J=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=20Beh=C3=BAn?= , Andrew Lunn , Conor Dooley , Krzysztof Kozlowski , Rob Herring , Sebastian Hesselbarth , =?UTF-8?q?Uwe=20Kleine-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 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 -- 2.43.2