From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 C6F93450918; Fri, 22 May 2026 15:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464415; cv=none; b=rhvdHwbEsNfC7EwSloxDLGCTTHoeFt43Ha/o2CAh2X8TmClvwXjKpk/6j8zV6OT7PGN6Hxo1FIEtKfPYFqk8e+U8NW6eEKnh6Yjs9vkxSnEsoafhMjZRyn2Je+OXjMNCMXVTd2+nIPR0NDx/VwzT/Pa5DIIZ0bX1ddGhrRyyVxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464415; c=relaxed/simple; bh=+yF/ZOGATgT1knyeuTiskzGTPk9VvxbdwCVyBSDY6N4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QEeRBywk/7DxViPnqa9xlXW2dMaFu2KdByctfAv7m8PeNejJxAnfRp2No5dY18MLKR5hZ++LfqkNAjxiekVPYmwlkpn6dIidoOfwurE29yrfgrljnu0TxeiXkNUhQ+a/2whSQrcGQebb/VHWw2ZlW4Akk/KeFU5tgpqNRa/Js04= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kj3GdzKv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gNPPgvlH; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kj3GdzKv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gNPPgvlH" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ev2lsUYzchtqx04itc4WRveJiV+KtXF/+FGSTUlJCjc=; b=kj3GdzKv+tvO8VLWkvZbkt+rXeiTvoIyU0DG1IrGIjtH2aX79Bpqby7Oo+i4Hd/jb49Ukn PECz+aTg2dj3L4q1m34IVriaZK72PkQHkZ0aDnCpmEudOneUiG1bG1AlMRj+Vdg3ZhzNfa /fEaCkub91WTEAlG0u1WR2un5XBWw2VXXVmQDL8n6epEjiMBsjhklD5YMPM5+Myz8PKOIj HfGQRXbOu77l81Ndo+zpFaITqaexMkty04Wys0ENG3iTrczR+3kTbg/fklapb6u9TwSUgF bc73nzVrsYSpEiigcIa3Qhfnqwyq189kW4TBg/71HnUYR92ppZPrAKv8WrEfpA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ev2lsUYzchtqx04itc4WRveJiV+KtXF/+FGSTUlJCjc=; b=gNPPgvlHlTrdMFlqBfmn1BphNAqyf/TkB9WuDdtsQ/EKSxgRkBTs3w5HasA0nxs5Rv1n3h oW6klMniK+9vAyDA== Date: Fri, 22 May 2026 17:40:01 +0200 Subject: [PATCH v6 01/10] soc: bcm2835: Use IS_REACHABLE for function declaration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-1-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=1460; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=+yF/ZOGATgT1knyeuTiskzGTPk9VvxbdwCVyBSDY6N4=; b=iBRNzAlQd69QIz5xYGgMSpngrsfvUlezpxd+TjcIp9dNS/0nZ72sQWYLTAj2wt9qFhqMZPIK1 LQZHpvWw0XaAcJukNOejh/LfP6Iez/UUYSNnll/EQgc35e18HFRGZM0 X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= The drivers that depend on the RASPBERRYPI_FIRMWARE use depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) This should ensure that the driver is not compiled in when RASPBERRYPI_FIRMWARE is 'm' on COMPILE_TEST which leads to linker errors. The same can be achieved by using IS_REACHABLE in the raspberrypi-firmware header. This evaluates to false when invoked from built-in code. This way the Kconfig can be written as depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST Which is a more readable variant. Suggested-by: Thomas Wei=C3=9Fschuh Reviewed-by: Thomas Wei=C3=9Fschuh Signed-off-by: Gregor Herburger --- include/soc/bcm2835/raspberrypi-firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm28= 35/raspberrypi-firmware.h index e1f87fbfe5542..eb33838e0cd10 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -174,7 +174,7 @@ struct rpi_firmware_clk_rate_request { .id =3D cpu_to_le32(_id), \ } =20 -#if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE) +#if IS_REACHABLE(CONFIG_RASPBERRYPI_FIRMWARE) int rpi_firmware_property(struct rpi_firmware *fw, u32 tag, void *data, size_t len); int rpi_firmware_property_list(struct rpi_firmware *fw, --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 C2006314B6E; Fri, 22 May 2026 15:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464418; cv=none; b=JaPLaQNI0xi41wIcPipjfXw5BhxFnySZqt9y00B5XR3UJ2tolH6h4W6eJ2ecgAbcPaACVKVmPD2eWf1Y8Qsckz7L0GMS8fX9wz5/kE4mL7LJG+iq8shaPokjmn+MIGkJKDnmlomKyZKl3B6HIQ3sSQe8rFmZie0F4DoJEj5wqbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464418; c=relaxed/simple; bh=nkY5azp+A+UWoeeL2t0qgGKBeLRleS7Kpqh3++oUvvk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y2Hyj2+/PfDaMC0LpJ1vRcBCAP78bzrEHgXD9mbWeMPNDoAWXKrLetUyRtCW6h95rklVOZvgBfwudIYVo9j2ulz5nwrnjkCahifwPCXTeOBPng2ZKPMtiSYAEQQkLwjr1BEnsjvSllOvM/fRR5V5E2hiGiEG3POnmeE3yj+DiDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=N3RN5lZL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VGIyAPTw; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N3RN5lZL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VGIyAPTw" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fjBziMqP+PJLTJDATutLEWUFDXldiskQHavpB7dOOeQ=; b=N3RN5lZL4aOD6r+AFVYsY8Y3zHjc/I3HSKZNqV2+9ib4Mm8RrffjnCLwB3KccUzHyDGuEO kIUcpo6hY9H2+pkI0pjw0pQG47MHWmoJJeVseiXdbDaOFouZbVJ/uzqHB1ArUqwClpjkWD rwBupJH4iImSJmRkVi/2MRf99Yr59cfwCa3nrzH1E7di6cjNL5uoWDZcIw4b351fthZ3K0 5VHorA7cX4jMFq/7FOxthPxFuUUBQZ4HvfEd0fJxShh//q7tMxuXmGNE9jWWpvBaHBKGOz E41HP1Re26Zn7lWyUsp9OCUOhonZR2z3P4TBBEYCm+oH9B38l0P8xbIC50t2ew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fjBziMqP+PJLTJDATutLEWUFDXldiskQHavpB7dOOeQ=; b=VGIyAPTwMD+z+zuGsqkqk7L9GAVBvmOdg3uEu0IvwB57uRBaNe9T8P0zri+YAec7bRvBvU r3XgrIE0utb302Aw== Date: Fri, 22 May 2026 17:40:02 +0200 Subject: [PATCH v6 02/10] nvmem: core: Enforce stride and alignment checks for nvmem_device functions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-2-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=1407; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=nkY5azp+A+UWoeeL2t0qgGKBeLRleS7Kpqh3++oUvvk=; b=zkG55RPzfHGtmzKdBRW2aruMJWmpMYQRk47PUpceDJC9Tttp25pqOXFnTWLO+5hhrWm9OJiD5 ipba3TZfLHIDy4v14VDjidG+qdHikHZ7FpB6KigcQ5AccrT6CSVezhU X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= The stride and word_size attributes in the nvmem_config struct are currently only used when reading/writing through sysfs functions bin_attr_nvmem_read/bin_attr_nvmem_write and in the nvmem_cell api. Reads and writes with nvmem_device_write/nvmem_device_read still allow unaligned access. Add a check to these functions to enforce word_size and stride_length aligned reads and writes. Reviewed-by: Thomas Wei=C3=9Fschuh Signed-off-by: Gregor Herburger --- drivers/nvmem/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 311cb2e5a5c02..6b313f63d07ef 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -2068,6 +2068,12 @@ int nvmem_device_read(struct nvmem_device *nvmem, if (!nvmem) return -EINVAL; =20 + if (!IS_ALIGNED(offset, nvmem->stride)) + return -EINVAL; + + if (!IS_ALIGNED(bytes, nvmem->word_size)) + return -EINVAL; + rc =3D nvmem_reg_read(nvmem, offset, buf, bytes); =20 if (rc) @@ -2096,6 +2102,12 @@ int nvmem_device_write(struct nvmem_device *nvmem, if (!nvmem) return -EINVAL; =20 + if (!IS_ALIGNED(offset, nvmem->stride)) + return -EINVAL; + + if (!IS_ALIGNED(bytes, nvmem->word_size)) + return -EINVAL; + rc =3D nvmem_reg_write(nvmem, offset, buf, bytes); =20 if (rc) --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 890B944DB73; Fri, 22 May 2026 15:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464416; cv=none; b=g30x3acDb2lMb3bc2DZt7C5Mx67kSbOSXc/X4YCH9SiKqre/O5c7DKyU9neTuuo1heecITtiXDIN+NWtd19dcNXy+0w5CRtbieNaXlkPUJs4v7fWJxkflK/eSXOUxb0//OBenThyZn568ncqLDL++pPFUHxVDnriMjiFUb4IlL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464416; c=relaxed/simple; bh=qD30315sFDKvQ1zxeTxTP4/+d92pYx/4B3/nMfkSHxk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HPOjxf78LEGX6nXNr8CqDBiOC2dG02pm/P65lg1m+h8ovLCiFbZwYAqzW/JFT7hQk3Rta+kdEgQt9aagf8Mqocf7ZnKkG43/AKPBzBhKxh2W0o821ejDe+LW1JaHh0INxIw5ZOoiD5aYc4DV8HMCNywnurdTCHaHg9cRfSNPqFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=L3KHMcbP; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=izsKWg4L; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="L3KHMcbP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="izsKWg4L" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e571YxZZj8gyO1yRbMno9e5ALDgboYntuW/WsLJaO3E=; b=L3KHMcbPUskhBGOWh2gaa8GcGuh9MJC2yVWT3+AMIyei9r0ouNHbfDtK59o/3RYzrnbOB1 JGQbdQfSOe+/yqfRjQluIi5y+9N+fwzp444RKZeu/idOs0aFprmA3LwlIyqxDwsRzzLv8F 1hQpRlycKKxB5SIc+BedkgqIi1J4hR72Z/XDF5vqEtxmgqwMRJuse/lxpdZy+pBtT6qhZE aElU3yljCudT2s3wxVtMpcuyL9Mto9WZJKvyttq28s6rk+Xqn9CHYVFw+jke9njlrjTPX8 y1heWjwlc3Vy0Bc34CjhWozwLcfgXJOZBOCVPSUyWcsNtftt/13sEpgkmzsJAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e571YxZZj8gyO1yRbMno9e5ALDgboYntuW/WsLJaO3E=; b=izsKWg4LVCP4kDh5I5r9pM+zlCZOwAQfpCoTtMVoj4oGbfPbWAQGlQPPp5A0jjgan6WcDf uyCTgrXKyU00TTCQ== Date: Fri, 22 May 2026 17:40:03 +0200 Subject: [PATCH v6 03/10] dt-bindings: raspberrypi,bcm2835-firmware: Add bcm2712-firmware compatible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-3-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Conor Dooley , Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=1250; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=qD30315sFDKvQ1zxeTxTP4/+d92pYx/4B3/nMfkSHxk=; b=q/QVJSLY9Sm34v48tDRySt9gYiLoBmdLykB6cLhVZQtjLPjYUFeFJeiB6tPHnqKmY2iiAP6EW xtMh1bty8OsCFL7442lh571bGMJgMw9sQbgGD8ZoPRYRKpuy96Yvs6v X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= Add a compatible string for the bcm2712 firmware. The bcm2712-firmware is compatible with the bcm2835-firmware so allow the bcm2835-firmware as fallback. Acked-by: Conor Dooley Signed-off-by: Gregor Herburger --- .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml | 11 +++++++= +--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-= firmware.yaml b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm28= 35-firmware.yaml index 983ea80eaec97..a3a5243b91706 100644 --- a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmwar= e.yaml +++ b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmwar= e.yaml @@ -21,9 +21,14 @@ select: =20 properties: compatible: - items: - - const: raspberrypi,bcm2835-firmware - - const: simple-mfd + oneOf: + - items: + - const: raspberrypi,bcm2835-firmware + - const: simple-mfd + - items: + - const: raspberrypi,bcm2712-firmware + - const: raspberrypi,bcm2835-firmware + - const: simple-mfd =20 mboxes: maxItems: 1 --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 1699B375AC6; Fri, 22 May 2026 15:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464417; cv=none; b=d27/uKRUpVPM/YYU8MkpS6y4yyxqbcNNjck7L+/eStM8Xj9loBNatp+FuBitErpSY7wdddwbpH5jEgw5zwrLARKiSAElRKwQleaUeiz4R8esYhLbf4WveTN4k2bublSYjohKZNSpplZ61p0P4qgLVnRS16nDb39/CJFW0pwzT0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464417; c=relaxed/simple; bh=uNzLFiHaQjBoO92j1LwBdFQkIT/GTTSZLU95vkaKCJc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nYCx6X6dNU2rnfLe5s93sUivAUTs4Vk85/Gk9sXT4TSIuGb/COEVYvEtsRdDgQ12VwhMgqAXeHVyeOHfbZZ+b4eTUHkaii/3Q3Qu/4im6sft7uALOzvllQTXpqFwxA1gkb4LhvophsgycqKaRkTF00TJL9YbnuOF7YgrsAl4lZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=km971cT8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HskcJAtt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="km971cT8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HskcJAtt" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BkaDeaUAZedVzDQUaWbP9657qVgRtzIoXSwoIsOhWDs=; b=km971cT8FBE+hzbpR0W8Nq238hiRkL1IMWSFK8sl1tKCWg/dg/DGLyQZlgcEtL6pQw+SU9 D/Gb0ReWvXIwp/ERebv3qkkUv2ZfgNpBGdGmuzqrCdsAZXxk8sbghmFcdIHayNVDPQvUoL BFrFtCvU7sj/aGeggwEnbXejM0FsHvh7vGjjPR7M7pUyv0BNL/qJo73acK3+nYE8Bqlyl9 GTj3YxIOtXPW2GAwHeEyS/+4OOptf5poFmmQpZ/iqfKIHNOQCi3nK/dpOsRDrUrZjzP4RW ZDErEu4IFC4Iwu10IH2aE5phvrxoGvigMSSiYzoPFzk4leeihL7LE8cwXJoeZQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BkaDeaUAZedVzDQUaWbP9657qVgRtzIoXSwoIsOhWDs=; b=HskcJAttYlxkV+PSqpPdnTojpz4piHG4AvGSVtfas/gRwuUAWcaAZCsX7CQmSU9rog/i3R +R8hcvn5ozbTrrBQ== Date: Fri, 22 May 2026 17:40:04 +0200 Subject: [PATCH v6 04/10] nvmem: Add the Raspberry Pi OTP driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-4-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=6341; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=uNzLFiHaQjBoO92j1LwBdFQkIT/GTTSZLU95vkaKCJc=; b=L4ITpuvFZpneUid4ud77tPUswUttEKzG9NZQbxgoLqpoy7loL6xrUbGAzIsDjprh+de9gBtfs s9VFGJ9bR8HAPC9SFoRYFcr0+DMnJvvtYwIoiY4QSMDKHlH6DuJd+DK X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= Raspberry Pis have OTP registers which can be accessed through the videocore firmware. Add a nvmem driver to support these OTP registers. Reviewed-by: Stefan Wahren Signed-off-by: Gregor Herburger --- drivers/nvmem/Kconfig | 11 +++ drivers/nvmem/Makefile | 1 + drivers/nvmem/raspberrypi-otp.c | 131 +++++++++++++++++++++++++= ++++ include/soc/bcm2835/raspberrypi-firmware.h | 10 +++ 4 files changed, 153 insertions(+) diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 74ddbd0f79b0e..a1922b48d0c2e 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -483,4 +483,15 @@ config NVMEM_QORIQ_EFUSE This driver can also be built as a module. If so, the module will be called nvmem_qoriq_efuse. =20 +config NVMEM_RASPBERRYPI_OTP + tristate "Raspberry Pi OTP support" + depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST + help + This driver provides access to the Raspberry Pi OTP memory via the + nvmem subsystem. The driver supports the customer OTP as well as the + device specific private key OTP (BCM2712 only). + + This driver can also be built as a module. If so, the module + will be called raspberrypi-otp. + endif diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile index 7252b8ec88d46..8ca2095e068f3 100644 --- a/drivers/nvmem/Makefile +++ b/drivers/nvmem/Makefile @@ -95,3 +95,4 @@ obj-$(CONFIG_NVMEM_ZYNQMP) +=3D nvmem_zynqmp_nvmem.o nvmem_zynqmp_nvmem-y :=3D zynqmp_nvmem.o obj-$(CONFIG_NVMEM_QORIQ_EFUSE) +=3D nvmem-qoriq-efuse.o nvmem-qoriq-efuse-y :=3D qoriq-efuse.o +obj-$(CONFIG_NVMEM_RASPBERRYPI_OTP) +=3D raspberrypi-otp.o diff --git a/drivers/nvmem/raspberrypi-otp.c b/drivers/nvmem/raspberrypi-ot= p.c new file mode 100644 index 0000000000000..2e2537ee6793b --- /dev/null +++ b/drivers/nvmem/raspberrypi-otp.c @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include +#include +#include +#include +#include +#include +#include + +struct rpi_otp_priv { + struct rpi_firmware *fw; + u32 read_tag; + u32 write_tag; +}; + +struct rpi_otp_header { + __le32 start; + __le32 count; + __le32 data[] __counted_by_le(count); +}; + +static int rpi_otp_read(void *context, unsigned int offset, void *buf, siz= e_t bytes) +{ + struct rpi_otp_priv *priv =3D context; + struct rpi_otp_header *fwbuf; + u32 count; + int ret; + + count =3D bytes / 4; + + fwbuf =3D kzalloc(struct_size(fwbuf, data, count), GFP_KERNEL); + if (!fwbuf) + return -ENOMEM; + + fwbuf->start =3D cpu_to_le32(offset / 4); + fwbuf->count =3D cpu_to_le32(count); + + ret =3D rpi_firmware_property(priv->fw, priv->read_tag, fwbuf, + sizeof(struct rpi_otp_header) + bytes); + if (ret) + goto out; + + memcpy(buf, fwbuf->data, bytes); + +out: + kfree(fwbuf); + return ret; +} + +static int rpi_otp_write(void *context, unsigned int offset, void *val, si= ze_t bytes) +{ + struct rpi_otp_priv *priv =3D context; + struct rpi_otp_header *fwbuf; + u32 count; + int ret; + + count =3D bytes / 4; + + fwbuf =3D kzalloc(struct_size(fwbuf, data, count), GFP_KERNEL); + if (!fwbuf) + return -ENOMEM; + + fwbuf->start =3D cpu_to_le32(offset / 4); + fwbuf->count =3D cpu_to_le32(count); + memcpy(fwbuf->data, val, bytes); + + ret =3D rpi_firmware_property(priv->fw, priv->write_tag, fwbuf, + sizeof(struct rpi_otp_header) + bytes); + + kfree(fwbuf); + return ret; +} + +static int rpi_otp_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct nvmem_device *nvmem; + struct rpi_otp_priv *priv; + const struct rpi_otp_driver_data *data; + struct nvmem_config config =3D { + .read_only =3D false, + .word_size =3D 4, + .stride =3D 4, + .reg_read =3D rpi_otp_read, + .reg_write =3D rpi_otp_write, + .id =3D NVMEM_DEVID_NONE, + }; + + data =3D dev_get_platdata(dev); + if (!data) + return -ENODEV; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->fw =3D dev_get_drvdata(dev->parent); + priv->read_tag =3D data->read_tag; + priv->write_tag =3D data->write_tag; + config.dev =3D dev; + config.priv =3D priv; + config.name =3D data->name; + config.size =3D data->size; + config.root_only =3D data->root_only; + + nvmem =3D devm_nvmem_register(dev, &config); + if (IS_ERR(nvmem)) + return dev_err_probe(dev, PTR_ERR(nvmem), "error registering nvmem confi= g\n"); + + return 0; +} + +static const struct platform_device_id raspberrypi_otp_id[] =3D { + { "raspberrypi-otp" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(platform, raspberrypi_otp_id); + +static struct platform_driver raspberrypi_otp_driver =3D { + .probe =3D rpi_otp_probe, + .driver =3D { + .name =3D "raspberrypi-otp", + }, + .id_table =3D raspberrypi_otp_id, +}; +module_platform_driver(raspberrypi_otp_driver); + +MODULE_AUTHOR("Gregor Herburger "); +MODULE_DESCRIPTION("Raspberry Pi OTP driver"); +MODULE_LICENSE("GPL"); diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm28= 35/raspberrypi-firmware.h index eb33838e0cd10..1e5e5f7e378d0 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -92,6 +92,8 @@ enum rpi_firmware_property_tag { RPI_FIRMWARE_SET_POE_HAT_VAL =3D 0x00030050, RPI_FIRMWARE_NOTIFY_XHCI_RESET =3D 0x00030058, RPI_FIRMWARE_NOTIFY_DISPLAY_DONE =3D 0x00030066, + RPI_FIRMWARE_GET_PRIVATE_OTP =3D 0x00030081, + RPI_FIRMWARE_SET_PRIVATE_OTP =3D 0x00038081, =20 /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE =3D 0x00040001, @@ -174,6 +176,14 @@ struct rpi_firmware_clk_rate_request { .id =3D cpu_to_le32(_id), \ } =20 +struct rpi_otp_driver_data { + const char *name; + u32 read_tag; + u32 write_tag; + int size; + bool root_only; +}; + #if IS_REACHABLE(CONFIG_RASPBERRYPI_FIRMWARE) int rpi_firmware_property(struct rpi_firmware *fw, u32 tag, void *data, size_t len); --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 D1AB747278F; Fri, 22 May 2026 15:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; cv=none; b=axdsUgZ5l+u94cqzqL1SKa9ExfvvOAzJCrpxoi6hrvDKtOiDTsXrcqijCMdCaWtx7G+f6sXSDX/hFMiRV1UQg8t+Z9dRquoHh5RdABrteecPUlaiWedg3C0T0suAdR4szalu55ZAIo27dqcLe0Pza7u6TVuplTTunxuZ58+bW/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; c=relaxed/simple; bh=cDB1Q3lXgbhR8mOX9hP2JfVt3BP7PAd4G8RBXXHWMEo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ja+pBHZhye7y/A0rBDwQ7yLX5xpBLqEQit4Du57Zu+0x16hRnU9tjmHhIfmJh54JM96bnoIfT+XNStGxNdda11Be+0uK4aQtP5tbnc3PQnhfVR6RDr63jxB+pk5HGKDt56zdchCAjpiSAmxg25AW+0YA7hUiikU3QlXpOH3FTB8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Hb6j78ef; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9cDL0XAw; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Hb6j78ef"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9cDL0XAw" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PV2K3H+KHYzHX7vRsSVamrYLgjqDH6WEHqL+iSyUBeA=; b=Hb6j78efjk+fp1odwvNXm105cPdySDNPqtLWfwX9WTvWwLSMkNBJFKHyU7CTjX3RpyjP2f d32smxclp4yORZpSqrTDBz2W4c8dAd5HevAl5q8M2qXZgYCgv6+0ht2l2MfkBlIawOs4RO v5mJ1kMFTVxeqvji6sBnpscC79IUbXh/DvlOMASh/lxP5Z7UxMQSDPbwCLKc81KK5jliO0 /GIBWm/rKaTJJEcQWKYnlhpNdvpJb+OrzPO+G9t6GXQFV/g7LByRJ0M68DpeV6NEYx2zYV ZkouukuXaBJC0rGE+6TiF0sBdlszKckSnANuob1KWlcAgGU9mtPwyQWg0QdZiw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PV2K3H+KHYzHX7vRsSVamrYLgjqDH6WEHqL+iSyUBeA=; b=9cDL0XAwCBqzqo+hZvLkW3+0mzgtzxbE4mA6bl5boFdmsTILTRvG2Wi8kvtkv6p6Ladpu5 1SDRl4Hv+SBJuzAA== Date: Fri, 22 May 2026 17:40:05 +0200 Subject: [PATCH v6 05/10] firmware: raspberrypi: register nvmem driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-5-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=4313; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=cDB1Q3lXgbhR8mOX9hP2JfVt3BP7PAd4G8RBXXHWMEo=; b=G8dF5TkzpGGCAUTiBXooG8d+qzy09x4lhaUQtvqu7xCAOaovA+PzkhbmktebNq7TpdblPkG0y FpEQFMFCQelCyTc9JXqyNKV1p5Mbiga1nVxd69FUvbfV//69O84nPs5 X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= The Raspberry Pi firmware exposes two regions with otp registers. The first region called "customer otp" is available on all Raspberry Pi models. The second is only available on the Raspberry Pi 5 (bcm2712). Reviewed-by: Thomas Wei=C3=9Fschuh Signed-off-by: Gregor Herburger --- drivers/firmware/raspberrypi.c | 59 ++++++++++++++++++++++++++= +++- include/soc/bcm2835/raspberrypi-firmware.h | 5 +++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index 0aa322e9a2e73..1d3b8c190b2fd 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -24,12 +24,15 @@ =20 static struct platform_device *rpi_hwmon; static struct platform_device *rpi_clk; +static struct platform_device *rpi_otp_customer; +static struct platform_device *rpi_otp_private; =20 struct rpi_firmware { struct mbox_client cl; struct mbox_chan *chan; /* The property channel. */ struct completion c; u32 enabled; + enum rpi_firmware_soc soc; =20 struct kref consumers; }; @@ -231,6 +234,47 @@ static void rpi_register_clk_driver(struct device *dev) -1, NULL, 0); } =20 +static const struct rpi_otp_driver_data rpi_otp_customer_data =3D { + .name =3D "rpi-otp-customer", + .read_tag =3D RPI_FIRMWARE_GET_CUSTOMER_OTP, + .write_tag =3D RPI_FIRMWARE_SET_CUSTOMER_OTP, + .size =3D 32, + .root_only =3D false, +}; + +static const struct rpi_otp_driver_data rpi_otp_private_data =3D { + .name =3D "rpi-otp-private", + .read_tag =3D RPI_FIRMWARE_GET_PRIVATE_OTP, + .write_tag =3D RPI_FIRMWARE_SET_PRIVATE_OTP, + .size =3D 32, + .root_only =3D true, +}; + +static void rpi_register_otp_driver(struct device *dev) +{ + struct rpi_firmware *fw =3D dev_get_drvdata(dev); + + rpi_otp_customer =3D platform_device_register_data(dev, "raspberrypi-otp", + PLATFORM_DEVID_AUTO, + &rpi_otp_customer_data, + sizeof(rpi_otp_customer_data)); + + if (IS_ERR(rpi_otp_customer)) + dev_err(dev, "Failed to register customer OTP device: %pe\n", + rpi_otp_customer); + + if (fw->soc =3D=3D RPI_FIRMWARE_SOC_BCM2712) { + rpi_otp_private =3D platform_device_register_data(dev, "raspberrypi-otp", + PLATFORM_DEVID_AUTO, + &rpi_otp_private_data, + sizeof(rpi_otp_private_data)); + + if (IS_ERR(rpi_otp_private)) + dev_err(dev, "Failed to register private OTP device: %pe\n", + rpi_otp_private); + } +} + unsigned int rpi_firmware_clk_get_max_rate(struct rpi_firmware *fw, unsign= ed int id) { struct rpi_firmware_clk_rate_request msg =3D @@ -299,12 +343,14 @@ static int rpi_firmware_probe(struct platform_device = *pdev) =20 init_completion(&fw->c); kref_init(&fw->consumers); + fw->soc =3D (uintptr_t)device_get_match_data(dev); =20 platform_set_drvdata(pdev, fw); =20 rpi_firmware_print_firmware_revision(fw); rpi_register_hwmon_driver(dev, fw); rpi_register_clk_driver(dev); + rpi_register_otp_driver(dev); =20 return 0; } @@ -327,12 +373,23 @@ static void rpi_firmware_remove(struct platform_devic= e *pdev) rpi_hwmon =3D NULL; platform_device_unregister(rpi_clk); rpi_clk =3D NULL; + platform_device_unregister(rpi_otp_customer); + rpi_otp_customer =3D NULL; + platform_device_unregister(rpi_otp_private); + rpi_otp_private =3D NULL; =20 rpi_firmware_put(fw); } =20 static const struct of_device_id rpi_firmware_of_match[] =3D { - { .compatible =3D "raspberrypi,bcm2835-firmware", }, + { + .compatible =3D "raspberrypi,bcm2835-firmware", + .data =3D (void *)RPI_FIRMWARE_SOC_BCM2835, + }, + { + .compatible =3D "raspberrypi,bcm2712-firmware", + .data =3D (void *)RPI_FIRMWARE_SOC_BCM2712, + }, {}, }; MODULE_DEVICE_TABLE(of, rpi_firmware_of_match); diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm28= 35/raspberrypi-firmware.h index 1e5e5f7e378d0..a4c94b85b7aa9 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -9,6 +9,11 @@ #include #include =20 +enum rpi_firmware_soc { + RPI_FIRMWARE_SOC_BCM2835, + RPI_FIRMWARE_SOC_BCM2712, +}; + struct rpi_firmware; =20 enum rpi_firmware_property_status { --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 D1BDA477990; Fri, 22 May 2026 15:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; cv=none; b=o8cw28X2QSuAt3wQUQHSwr2y8/eflZV+YtO660kWIxWnPoFki3UdVoKEL3lWzMgkxQuYtbZZaGB+zET0di5bQ5UcukTFzELvxK2C2pjF6MfdpwJccXtXd+G8BNIO9oU2OZX9DeYiwyScehqBb58Fo8OvZyP2zi2cui3jqg1puBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; c=relaxed/simple; bh=dbam25rkEbN6V1TXAKuie6Ogixkx8DZyxneAOo0kOp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KvtE8btgRsXKLJccXFQ/dZO7MT3c7tVlIJI/37de7czD9U/NsvCd9QPGxv5z3kkN9yjjJxNV8HSXH+oC/kox653R4HZw55O6yTcsPDK87RGWUhegoFJfD2Qg34FqTcNBYTBX4iKvNUANq95rieB6m9zmLxQvoyojQlvMqubwv30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PxXz09F7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fYN3Madh; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PxXz09F7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fYN3Madh" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tfKfhvP2du3rzKmOjT1cyHP3hfhMUxY9/nQXytvqksg=; b=PxXz09F7qoDZWM8go/X2DhIqNwsSaJnic53ikfdN1+3R1bFwkU45pUAHGHziYsm/cu8y9R +FLWQTYW+LcVsHEY4a5dL59nDboNT05ercwdIs129hi7sI8qxwpchXswicKGQkvfnKFGN5 9O8WS0N5WcPfzpG+kraWMtidrSa14rrS7pCCrVqGmgb6/3zXjWms82/MHmtEwLUpH2q/z4 EcOKwcHE32Q+y/c+L3nwPOyYgVcL2MkU8IY9Wr1Xa+T6lLLWeep13peyOPcJl/JjqspDis hIVDaDBQRyeAosP791fJGOkBR7rPBdzw79f6/6h6R1UnxI7sAm9qHUV04ZpG/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tfKfhvP2du3rzKmOjT1cyHP3hfhMUxY9/nQXytvqksg=; b=fYN3MadhBZ0CfTScck+WjLZ08plOLj/rZ9Ki9yG7fWRXi96ngcTh8LDyVd/XY3wWspVwNw cERVoje3zj74SgDg== Date: Fri, 22 May 2026 17:40:06 +0200 Subject: [PATCH v6 06/10] arm64: dts: broadcom: bcm2712: add raspberrypi,bcm2712-firmware compatible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-6-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=1201; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=dbam25rkEbN6V1TXAKuie6Ogixkx8DZyxneAOo0kOp4=; b=5pPf1O9USa6M5UoDXP0qSrdputP8iNWGX81P62kddkh7ONmmg8NtP85QRW4JIs5y8K0wquHig VUhQAE9ItstCmYpCvy7NXYSOIAN+RCNtnw7sohGXWhJlBZHLGV/0mXz X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= The Raspberry Pi 5 (BCM2712) firmware exposes additional features such as the additional OTP register region called 'private OTP'. Add the raspberrypi,bcm2712-firmware compatible to allow drivers to distinguish this hardware variant while keeping raspberrypi,bcm2835-firmware as a fallback for backward compatibility with existing drivers. Reviewed-by: Stefan Wahren Signed-off-by: Gregor Herburger --- arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi b/arch/= arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi index b7a6bc34ae1ab..4aa8ec7601b84 100644 --- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi @@ -46,7 +46,9 @@ power_button: power-button { =20 firmware { firmware: rpi-firmware { - compatible =3D "raspberrypi,bcm2835-firmware", "simple-mfd"; + compatible =3D "raspberrypi,bcm2712-firmware", + "raspberrypi,bcm2835-firmware", + "simple-mfd"; =20 mboxes =3D <&mailbox>; =20 --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BEC78477E4E; Fri, 22 May 2026 15:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; cv=none; b=goQ4g8I21m3W1CWMxplqh7JMnPhrYukCbonfrgah5zJH2cg/bPZudVGlMsOgk9ZNpEm2bbGza9KtWfWLjz0VOI0NoLlZMAWdHTONoeE7hU+t50Xqcz+C7w2ufJAW8Antc088dbF5Mn2QdOvanMvUpGbTu9yPhGTeWJs0EAnOlHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464422; c=relaxed/simple; bh=IfrsMSCpNJWQEqfe46rlehUOfwK8xizeSOL7BdUbETY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A1NmYOVQIlCTou+joktq2ZgC1ArpB4k9O2E8/xBIgw4MfbFhl+uPy6L25mirsw8MBJ26ZHtvXNkvVRv6DFvxpG6cXCEF460BKwJEsbvebGLdL8BSkacY4zFF0f6TzuYFeycYuAie+mE2qIksjRDGo9YKLGnIbhtP1Mnow5/UFYg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GbrDk0/+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1HZycACm; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GbrDk0/+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1HZycACm" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6ObXh6kk4XunevPthCtxU9yhwucuotgK1jqwXTy/qtQ=; b=GbrDk0/+3zWfKH0IdzVUilm7KTRmyZqSyX+EsQl/5RdrVpCzHktcDRvUAuQIvJrHIYazaw 2rAvk+Y9nbJjuxe/x27prvp41nBnPaV1wbYie98/I2/I5g03Ho7gqhb6iRV/fPI8SFcAin YoNv5nZjZt8yAqwbMWIcFgKQidSmBGkssvmKKNvWtQGwSKzEwRXIWpj4c7C7taFHgj9iDM IhmCDwVzfha5iJWcNOy6mMNKCorywHLlPyDI2KaK7NEIiioEHjxjwNwpaAbO7mET8bzvGK cqpKJUw0mmKWoU3uqndqsUp2grPXTIwadmOis+5D3Z2r/TaWYNPvWrwXWoSuFA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6ObXh6kk4XunevPthCtxU9yhwucuotgK1jqwXTy/qtQ=; b=1HZycACm1rjGF/hGUUACNmMyMiDQHiBg+Gq9f2Pmb6/kd1uh72J6I83UYCbNva7noWpjAz cxQvLedQ6cE82NCg== Date: Fri, 22 May 2026 17:40:07 +0200 Subject: [PATCH v6 07/10] dt-bindings: raspberrypi,bcm2835-firmware: Drop unnecessary select Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-7-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Conor Dooley , Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=1090; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=IfrsMSCpNJWQEqfe46rlehUOfwK8xizeSOL7BdUbETY=; b=n26q+46/ZqDMYFZey78jD9XG/wo3dvjxG+HkjrhGRGCgwgUxSzxhDBQBQJJKmPN5PWSi64pHe QeILNf39v3MDliJUcnLKRu9UO6v2sDxix9Xj857BxIyDah5qLzDy6OC X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= The "select" in schema is not necessary anymore since dtschema drops simple-mfd when constructing the select/filter query for schemas with compatibles. Acked-by: Conor Dooley Signed-off-by: Gregor Herburger --- .../bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml | 9 -----= ---- 1 file changed, 9 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-= firmware.yaml b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm28= 35-firmware.yaml index a3a5243b91706..7cf9a6fa1e5be 100644 --- a/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmwar= e.yaml +++ b/Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmwar= e.yaml @@ -10,15 +10,6 @@ maintainers: - Eric Anholt - Stefan Wahren =20 -select: - properties: - compatible: - contains: - const: raspberrypi,bcm2835-firmware - - required: - - compatible - properties: compatible: oneOf: --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 D19B146AEC2; Fri, 22 May 2026 15:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464420; cv=none; b=ekqsnVyU2LTUFju0IdtslhcDnQxoBvkLfTdCyk7fhJZ1w0KKT8bQx9Zk4Gfw3PmEZqe9f3CE0aP3Eex3GEvSM9X1vSuo0gne/wOJkANQJTM8bMGOTa5CroKSxbLlnNgdNJYN2njpbcWuDw/9XWkPtUIIOb1qM/XYZ9CYL1AIYP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464420; c=relaxed/simple; bh=W3od+N7ms8LBhCXN/JpOtSic+LkKIcRVMQF9+TfNOg4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BZHVbvE6l7GaEZFd5oHWDm21HYc2pthhz6WFK5m0mxCZBjwHyf8vXRj0axr4Mg/pgBidOfpVdP0ziICDukYkyYxOoK5n7IjBSxZEjwBl315zZHJ15wlp5sp9KrqevMXrYH31LTY0Q+1fsyWWKSHMpNiwuDDaYGr37NdvSHTZFSw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PeW7RWXt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=FP20AERF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PeW7RWXt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FP20AERF" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vqxlm0R5Wd0RrDJc5qf7hWcJWc/FoDh8Mkn++k5Hxho=; b=PeW7RWXtB8dNpBjtqAuzknD6YIeNWIlj560/kokuYKeP2iZfGvG0ZyjC+K6m9aHmLAWtjY HGrSqN5ATspKKfezk3Z798vb/AnFsFS/cNAQKLEha4UMnu+vSHLo6HWdMWisu5K75sL3IZ vcHiTHA9A51VaN4c8WOzn+li1R+wLLp0MVA679JAiCuvBrOIXGdrBISOdx8lle7Fy0WGP9 KkP4bz6hB3+NxHhvTOnGxdj/7ui/VuFRocx5JvfNSkydi8Kba8VTm3E/pEU9wLEzJkdxt0 +N6TN0JK3oszZlI/6GcQUSULe6gTxkmUV5ofqmnKZ77CPYYtWVgbkIDnT98Y1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vqxlm0R5Wd0RrDJc5qf7hWcJWc/FoDh8Mkn++k5Hxho=; b=FP20AERFPEgsCyqxYTObObpLvBVoVITO2G4VKGk81EX0Ss4ym6WmwVvnBAQx9rMWhxEJx9 Xznhv0ohlYX3ROAA== Date: Fri, 22 May 2026 17:40:08 +0200 Subject: [PATCH v6 08/10] arm64: defconfig: Enable the raspberrypi otp driver as module Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-8-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=987; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=W3od+N7ms8LBhCXN/JpOtSic+LkKIcRVMQF9+TfNOg4=; b=El25Y3nV3USsdO3HnhHOD39+moGC7yQlHwDZobn7c5IdnDfIhTZ7J2pDbwLYYkAZGn36W34UG JRg3YhKIVJ7BjoGaB8DBBtdyq7P60+jVQ+6AWkc9K0gqRvbgf5iQDn6 X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= Enable the newly added Raspberry Pi OTP driver as module to allow access to the otp registers. This driver provides access to the OTP registers present on all Raspberry Pi boards and the private OTP registers present on the Raspberry Pi 5. Enabling this in the generic arm64 defconfig allows standard upstream kernels to use these registers on Raspberry Pi 3, 4 and 5 out of the box. Signed-off-by: Gregor Herburger --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index e44e83bc57812..3abb3ca34c708 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1849,6 +1849,7 @@ CONFIG_NVMEM_SPMI_SDAM=3Dm CONFIG_NVMEM_SUNXI_SID=3Dy CONFIG_NVMEM_UNIPHIER_EFUSE=3Dy CONFIG_NVMEM_ZYNQMP=3Dm +CONFIG_NVMEM_RASPBERRYPI_OTP=3Dm CONFIG_FPGA=3Dy CONFIG_FPGA_MGR_ALTERA_CVP=3Dm CONFIG_FPGA_MGR_STRATIX10_SOC=3Dm --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BE656477E4D; Fri, 22 May 2026 15:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464421; cv=none; b=QlAFNJTeBeU4Q5ryJlcNEGZg1hMqEPTnuAlMX+DJr808huK2tMG7ptnDJtGHffUnys3M+GxbG2DSxxSavZwh28Pn2PuCsazsWEAvONcYTVc6B0iRvtV7MV/+pDX3FAY05vU/kXPs6Qyq28/sSnS1FAMOTLvaODxs7AjH8ZCshz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464421; c=relaxed/simple; bh=4RYdMjibQW2/XaXdOtKYjooXgvg+7dGzfuDMj2Lhh80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K2HvY33/cae11Tv78EftTD5EGqOllc2QtCNbS4XQr0nufBbv9uRoQ3+4apmRglY5WTO0AOP/bYJs6jrCMO++b8qZ3xHpS0AjcRfrIpmNhK/5b6eV4CdKNUDrmrOnmQEHAUElLAq+WT4SJNfqJZrC3kjUeScOZeUaFdtxXSO5GHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gRLoE10a; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nT1NQABk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gRLoE10a"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nT1NQABk" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH1oKT414TlTCl2C+lV3L01K8kAHjponcj2ya0Cw6KI=; b=gRLoE10a/qZ+GP9kFYrL34oKHTONLFQwj39tJCo1QAfSuRNeBez3mK71mZ5ZC167gI0m2u VroDI4oOj5T+fw+ibHPZvx3AlVAFIaVr4pLj4Kh3hifampWUNxVnanfs8TShjlR9P4ulYj KnPrkBuczJ3nJFabqfqG8XpFy/jECe048x4HsyiiTttUQvRaw0zmrMH2+8t0U4bWwbbRWr cY8CJukg4Uck4EQrLO+V686PDVFPCq3m8i17IqkMSUGwZljgmc/Yrp3pqiYwMpWys1zlZk 4uOnmsLbD0+RriwOBjBe9JdeY3HplSWr9y0uwWfsowrs9miam9TiKvjCo1jSTQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH1oKT414TlTCl2C+lV3L01K8kAHjponcj2ya0Cw6KI=; b=nT1NQABk5MQRRkgcK10OumdbeOof4+Mha7NSWjVsLxpaSIpuXBOLOB0qxUQ2+GJbPFKV9Z K8uz6x9mDxXYhEAA== Date: Fri, 22 May 2026 17:40:09 +0200 Subject: [PATCH v6 09/10] ARM: bcm2835_defconfig: Enable the raspberrypi otp driver as module Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-9-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=912; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=4RYdMjibQW2/XaXdOtKYjooXgvg+7dGzfuDMj2Lhh80=; b=jxaFs44VX0BQ/NAzWDc37HASvUIs4J6XgZUmMwhXXrHLj40KDW2yxlbl4C966rFBXFC8PiXQU 6DAgR2Y3nadBNnDlBhHJ78385iBetnicGlGrQyIectCaZ4xoZJIzSLe X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= Enable the newly added Raspberry Pi OTP driver as module to allow access to the otp registers. This driver provides access to the OTP registers present on all Raspberry Pi boards. Enabling this in the bcm2835 defconfig allows standard upstream kernels to use these registers out of the box. Signed-off-by: Gregor Herburger --- arch/arm/configs/bcm2835_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_= defconfig index 4a8ac09843d73..fd83bda9cfaaf 100644 --- a/arch/arm/configs/bcm2835_defconfig +++ b/arch/arm/configs/bcm2835_defconfig @@ -151,6 +151,8 @@ CONFIG_BCM2835_MBOX=3Dy CONFIG_RASPBERRYPI_POWER=3Dy CONFIG_PWM=3Dy CONFIG_PWM_BCM2835=3Dy +CONFIG_NVMEM=3Dy +CONFIG_NVMEM_RASPBERRYPI_OTP=3Dm CONFIG_EXT2_FS=3Dy CONFIG_EXT2_FS_XATTR=3Dy CONFIG_EXT2_FS_POSIX_ACL=3Dy --=20 2.47.3 From nobody Sun May 24 19:35:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 21915477E43; Fri, 22 May 2026 15:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464421; cv=none; b=gW3S4vsLtQrXnGLnNr9UTZxd7DU3e4a8sor89v56NHiFlFt7WSdWncNtQiVUxs7dq5Zbt0zkkw5LOX+u9qPgiHjptdjBFLg56WOgZqu33FErlX1xXoVvv1mxPu4u1SQabnLTy8zVsQ1KLjwa888yw3m6RXBzwhbNjNdhM3ZRp8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779464421; c=relaxed/simple; bh=x+13aj+fO6ZA/JGj9Jo9udh3mNf/KuNcsTa207AzqWI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MmrgRVLppj3KgQRYSGQgM2Vof5Dm1vBQFia/8+dftUfO1xYucTCXIsz/ByP2KYA2ToTzLJrJiFELI97xZHx49TJROxyXzWf0N6JWvWMZU6HHD/djR/uCWsVmrJhYkoPm6XFx/qrhqo1NUky2S8m9K2UEm8VSkLikU/T/gzJ3PWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OC50Ii7O; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Fg4uuAAI; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OC50Ii7O"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Fg4uuAAI" From: Gregor Herburger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779464411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BoHgvDPKeXcPQBnOBITGVF8vm2/6C950dldMkcPVKXo=; b=OC50Ii7O1Pd9hTS26sCA+EdBU81Zieg+T6Qdpgum9TiU9I+QAhQt5orXKs4ddZVeU/AFi3 SP0BZ7xqy6c2LOUWff1wle8Ys1DV19zUO12GxCucG1DL96egy6k7Yy24/6rd2kg1c1AWFU FVWVefwNa77Ux6YUGqQLTEddJf5GfgSnee+h3ojbO5QVO0ypwHp+KgN149f8Cnlcuwipep SF4jR9KuK7VfC0k8ZIr/avEIJZmg2xPIXRz7YhhM42G+XQ+5AQU8enVqX3aqJQQI3p4ZDO T2MeIpMIBSvR/4V2C01Ym7KfAQgtRjDLXeZS0o+LTeOlir2pkNhKQEFwifPp1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779464411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BoHgvDPKeXcPQBnOBITGVF8vm2/6C950dldMkcPVKXo=; b=Fg4uuAAI0VgfdGlG6i/BnYsRt89DEAZhW7pj0T8KBccDdCx4dtEF0MkhKXNGgU4MlMpQw7 dLLWqha5lZR7ZgDw== Date: Fri, 22 May 2026 17:40:10 +0200 Subject: [PATCH v6 10/10] ARM: multi_v7_defconfig: Enable the raspberrypi otp driver as module Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260522-rpi-otp-driver-v6-10-b0eac97d1428@linutronix.de> References: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> In-Reply-To: <20260522-rpi-otp-driver-v6-0-b0eac97d1428@linutronix.de> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Eric Anholt , Stefan Wahren , Srinivas Kandagatla , Kees Cook , "Gustavo A. R. Silva" , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Russell King Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Gregor Herburger X-Developer-Signature: v=1; a=ed25519-sha256; t=1779464406; l=921; i=gregor.herburger@linutronix.de; s=20260226; h=from:subject:message-id; bh=x+13aj+fO6ZA/JGj9Jo9udh3mNf/KuNcsTa207AzqWI=; b=Ayat5s6ZaWUWlZX1i8MmjySEWOhxUprzvJ6DPCKatqQloXUG6sn6w8hZssiFmgO//xQx3+eJL nZ52/89KO9BDElMebvQM8yhwnpzSZCNuBcCoZE44VMStt2smc4vTDRf X-Developer-Key: i=gregor.herburger@linutronix.de; a=ed25519; pk=u72Lv7+/lS5CC1hmSrb17lv/6CK7HBh4Lvz77PHA5LM= Enable the newly added Raspberry Pi OTP driver as module to allow access to the otp registers. This driver provides access to the OTP registers present on all Raspberry Pi boards. Enabling this in the multi_v7_defconfg allows standard upstream kernels to use these registers out of the box. Signed-off-by: Gregor Herburger --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v= 7_defconfig index bcc9aabc12028..4b61ad5f46ce7 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -1281,6 +1281,7 @@ CONFIG_NVMEM_ROCKCHIP_EFUSE=3Dm CONFIG_NVMEM_STM32_ROMEM=3Dm CONFIG_NVMEM_SUNXI_SID=3Dy CONFIG_NVMEM_VF610_OCOTP=3Dy +CONFIG_NVMEM_RASPBERRYPI_OTP=3Dm CONFIG_FSI=3Dm CONFIG_FSI_MASTER_GPIO=3Dm CONFIG_FSI_MASTER_HUB=3Dm --=20 2.47.3