From: srini@kernel.org
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org,
Demeter Barna <me@fromdisposition.org>,
Srinivas Kandagatla <srini@kernel.org>
Subject: [PATCH 3/8] nvmem: qfprom: Add the SM8350 keepout regions
Date: Tue, 1 Dec 2026 23:27:31 +0000 [thread overview]
Message-ID: <20261201232736.537847-4-srini@kernel.org> (raw)
In-Reply-To: <20261201232736.537847-1-srini@kernel.org>
From: Demeter Barna <me@fromdisposition.org>
Some SM8350 fuse ranges are protected by the XPU, so the AP cannot read
them: a read in 0x0-0x11f, 0x128-0x147, 0x640-0x8df or 0x2110-0x216f
resets the SoC. The nvmem file in sysfs is readable by every user, so
once the QFPROM is described, anyone who reads the whole file resets the
device.
Keep those regions out, as for SC7180 and SC7280, which share the
0x128-0x147 one; they read as zeros.
The regions were measured on a Razer Edge 5G one 32-bit word at a time,
and each boundary was checked from both sides.
Signed-off-by: Demeter Barna <me@fromdisposition.org>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
---
drivers/nvmem/qfprom.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
index bc66cbf0eaa0..6a750191674e 100644
--- a/drivers/nvmem/qfprom.c
+++ b/drivers/nvmem/qfprom.c
@@ -124,6 +124,18 @@ static const struct qfprom_soc_compatible_data sc7280_qfprom = {
.nkeepout = ARRAY_SIZE(sc7280_qfprom_keepout)
};
+static const struct nvmem_keepout sm8350_qfprom_keepout[] = {
+ {.start = 0x0, .end = 0x120},
+ {.start = 0x128, .end = 0x148},
+ {.start = 0x640, .end = 0x8e0},
+ {.start = 0x2110, .end = 0x2170}
+};
+
+static const struct qfprom_soc_compatible_data sm8350_qfprom = {
+ .keepout = sm8350_qfprom_keepout,
+ .nkeepout = ARRAY_SIZE(sm8350_qfprom_keepout)
+};
+
/**
* qfprom_disable_fuse_blowing() - Undo enabling of fuse blowing.
* @priv: Our driver data.
@@ -460,6 +472,7 @@ static const struct of_device_id qfprom_of_match[] = {
{ .compatible = "qcom,qfprom",},
{ .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom},
{ .compatible = "qcom,sc7280-qfprom", .data = &sc7280_qfprom},
+ { .compatible = "qcom,sm8350-qfprom", .data = &sm8350_qfprom},
{/* sentinel */},
};
MODULE_DEVICE_TABLE(of, qfprom_of_match);
--
2.53.0
next prev parent reply other threads:[~2026-12-01 23:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 23:27 [PATCH 0/8] nvmem: patches for v7.5 srini
2026-12-01 23:27 ` [PATCH 1/8] dt-bindings: nvmem: Add compatible for MSM8952 srini
2026-12-01 23:27 ` [PATCH 2/8] dt-bindings: nvmem: qfprom: Add SM8350 compatible srini
2026-12-01 23:27 ` srini [this message]
2026-12-01 23:27 ` [PATCH 4/8] nvmem: m24lr: Remove use of i2c_match_id() srini
2026-12-01 23:27 ` [PATCH 5/8] dt-bindings: nvmem: st,stm32-romem: align patternProperties regex on nvmem-deprecated-cells.yaml srini
2026-12-01 23:27 ` [PATCH 6/8] nvmem: don't use devres in subsystem code srini
2026-12-01 23:27 ` [PATCH 7/8] nvmem: use const APIs for legacy sysfs attributes srini
2026-12-01 23:27 ` [PATCH 8/8] dt-bindings: nvmem: SID: Add binding for A733 SID controller srini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201232736.537847-4-srini@kernel.org \
--to=srini@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@fromdisposition.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox