Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp584252lqd; Wed, 24 Apr 2024 10:38:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNobvA/WGVvaMdchOnbmNwuIS2Ewzn9GVNBbgwARgrAc2yeMtjaJjCkvIBL5DX9gkuZPk1RXyCcAjiwVU4eqw7qPl2e1H6ATkmFB4hmw== X-Google-Smtp-Source: AGHT+IH992Te6UqAZ4zGpmcyl4H1jy8oa49vXhzGdZbnW2RAlpsNkYegEcVjLPtbllNEMz9BMOfM X-Received: by 2002:a05:6870:1850:b0:220:873d:dbcc with SMTP id u16-20020a056870185000b00220873ddbccmr4078978oaf.49.1713980315887; Wed, 24 Apr 2024 10:38:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713980315; cv=pass; d=google.com; s=arc-20160816; b=PY0PFqAkH4S574OwR9D+gqtrRNEVR0hijRqhUREl/Sbo4+1uGSdl7VT170Ka5ZZDP4 hEXMSNQIoe2in+TmbnbHAf1YEWEWVm423mTVO6EUcWzXJ4ADV4/Gcidm/0alW7yD8ToM PMAGb3g+RVGaMR084qRm2qm0HOyms0ZFsf86qo9k+U8HDaKLbxm+LfRVfitZL+TLDQtn EN5KlE94SgbIq7QHGEFJ9QnQ3MEWCCPEGXVr2ENFBm65k+tGEXtIG8Mo6x0WRtP/264d o5k9fxToRz2M4HZozNEarkaU3gN/v1W67rmWBIrV1ceETlw/OEbOF5EjyebgdvekPbYB jKWQ== 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=Y5GWJhhaCgv9r9t2OQUY5JEPL7kIiUt1FOuq3tDQH/g=; fh=aqm1mi/4lbFGCCW5q/kLXzFGYiABj3zjII+pGIaAGTo=; b=q40COAQLBSxggPAse3N5OcrgqX7M0FNOgDn7ibPE5RxDfcI/kQGa+kMXPenlRVrHgY 5QkUdVFPrm825IQt12oarE37TLoa9OxO6nrUz4V7mQYV8vMK2a4zBKowLXQCbIPWGucq kmjagjL8JtPcxmAiBMw4SzjZYS72jrI5ZEBzJaDltW2Bk8ng7DKXWly1TvZGg2/WLqAT 4mscd3DXM/gHMs9Qx+hclThrMYumPpSOPU2+SrXvIKWTvcoI5RunYYYcfZdV8mwO4jNW rx3iBGe54Zx3EDCs8wb4dXGt7T5sT1oL5UPyfCM3l8saS1SQ1XPIK3PjwTCMKYqjGDi+ kXkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=HDG0W1y7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3821-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c68-20020a633547000000b005f80080585csi9222451pga.439.2024.04.24.10.38.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3821-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=HDG0W1y7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3821-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3821-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BC9292893EE for ; Wed, 24 Apr 2024 17:38:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36AFE16D4D5; Wed, 24 Apr 2024 17:38:20 +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="HDG0W1y7" 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 DCEF515B55C; Wed, 24 Apr 2024 17:38:19 +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=1713980300; cv=none; b=U5JtoKf/DQlYa094Xe7ebmcMmJzpG+lVD+sQmQ4JdTtxwJf6IZDFaEGopbUf94SOTuRotej6dGoQhmRBlsvYwcrAiYaV/zTEggKFxOcQBi1Len2wsFKd2n4i7jn03TTGtxHpqhsA7n5cJCjiZ6/2UkqBtDSE2JilDJV8LdE0WuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713980300; c=relaxed/simple; bh=aod6ewur68dhk71qakXSy0qZ7PztmoQeNVY9RZWrBCU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=FlniCpuocnP6KHl34KnMZZaAiXfxWPoTEOjlpguTXRf1lQq9X/s3ODImOqSEmTHKIhl720nDATQM8FEow+Mylk1pnZ/66mHfyQVJs7aAT4U7ZUYfCjlBS6qXK0irrjNy6quAZKWWm5qmVLSXCUKa71nn5xHdoLFknHAg86VbHHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HDG0W1y7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84AC5C113CD; Wed, 24 Apr 2024 17:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713980299; bh=aod6ewur68dhk71qakXSy0qZ7PztmoQeNVY9RZWrBCU=; h=From:List-Id:To:Cc:Subject:Date:From; b=HDG0W1y7dJs8jROaJ/vATkjVSzyAjoCUm+TErmO1j8gYqoSjV/n+N1UdArZSqTT0S Yy4S0CF2xmBBySJ5CNvdZ4gN3awJ/zPdFTxFL0id+DjOgaHTtdRwFSCFz/SL0Htd84 cR15vC+wO9i1c1Gvr1YZpDGGUCRLdwcKC2LkXN88Z/xH+Vc/hgfj6M5ENg24b2sLP5 /AFXu7OnXn00jivZ3aB7U3fBOSwmZvYCRVjSPhYRwX92KN8GmI6IHCspwjRa6zJkxu eFS+y3XWM0+Ilq6XsmipaFi6vxXWDliZV6+2RrJQig9WIR8TcR2J+YTwOfFqzWrULK SccO/07dU2yaw== 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 v7 0/9] Turris Omnia MCU driver Date: Wed, 24 Apr 2024 19:37:59 +0200 Message-ID: <20240424173809.7214-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 v7 of the series adding Turris Omnia MCU driver. This series 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, v2, v3, v4, v5 and v6: 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/ Changes since v6: - moved the DT binding from arm/cznic,turris-omnia-mcu.yaml to firmware/cznic,turris-omnia-mcu.yaml, as suggested by Conor Dooley (patch 1) - dropped the devm-helpers.h additions, for the reasons see https://lore.kernel.org/soc/20240423184346.37eb0915@thinkpad/ - use gpiod_to_irq(gpiochip_get_desc(...)) instead of irq_create_mapping(), as suggested by Andy Shevchenko (patches 6 and 7) - added a dummy read of TRNG entropy when registering TRNG, in case someone cleared the TRNG interrupt before probing the driver, but did not read the entropy (the MCU won't send a new TRNG interrupt if the entropy is not collected) (patch 6) - fixed a bug in TRNG probing, wherein if the Marek BehĂșn (9): dt-bindings: arm: 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 | 51 + drivers/platform/cznic/Makefile | 9 + .../platform/cznic/turris-omnia-mcu-base.c | 439 +++++++ .../platform/cznic/turris-omnia-mcu-debugfs.c | 216 ++++ .../platform/cznic/turris-omnia-mcu-gpio.c | 1047 +++++++++++++++++ .../cznic/turris-omnia-mcu-sys-off-wakeup.c | 258 ++++ .../platform/cznic/turris-omnia-mcu-trng.c | 109 ++ .../cznic/turris-omnia-mcu-watchdog.c | 123 ++ drivers/platform/cznic/turris-omnia-mcu.h | 188 +++ include/linux/turris-omnia-mcu-interface.h | 249 ++++ 17 files changed, 2956 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