* [PATCH v3 1/4] dt-bindings: nvmem: Add soc qfprom compatible strings
2020-10-29 0:28 [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions Evan Green
@ 2020-10-29 0:28 ` Evan Green
2020-11-02 15:32 ` Rob Herring
2020-10-29 0:28 ` [PATCH v3 2/4] arm64: dts: qcom: sc7180: Add soc-specific qfprom compat string Evan Green
2020-11-02 15:58 ` [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions Srinivas Kandagatla
2 siblings, 1 reply; 6+ messages in thread
From: Evan Green @ 2020-10-29 0:28 UTC (permalink / raw)
To: Rob Herring, Bjorn Andersson, Srinivas Kandagatla
Cc: Douglas Anderson, Stephen Boyd, Evan Green, Andy Gross,
devicetree, linux-arm-msm, linux-kernel
Add SoC-specific compatible strings so that data can be attached
to it in the driver.
Signed-off-by: Evan Green <evgreen@chromium.org>
---
Changes in v3:
- Fixed example (Doug and rob-bot)
Changes in v2:
- Add other soc compatible strings (Doug)
- Fix compatible string definition (Doug)
.../devicetree/bindings/nvmem/qcom,qfprom.yaml | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
index 1a18b6bab35e7..992777c90a0bf 100644
--- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
+++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
@@ -14,7 +14,18 @@ allOf:
properties:
compatible:
- const: qcom,qfprom
+ items:
+ - enum:
+ - qcom,apq8064-qfprom
+ - qcom,apq8084-qfprom
+ - qcom,msm8974-qfprom
+ - qcom,msm8916-qfprom
+ - qcom,msm8996-qfprom
+ - qcom,msm8998-qfprom
+ - qcom,qcs404-qfprom
+ - qcom,sc7180-qfprom
+ - qcom,sdm845-qfprom
+ - const: qcom,qfprom
reg:
# If the QFPROM is read-only OS image then only the corrected region
@@ -60,7 +71,7 @@ examples:
#size-cells = <2>;
efuse@784000 {
- compatible = "qcom,qfprom";
+ compatible = "qcom,sc7180-qfprom", "qcom,qfprom";
reg = <0 0x00784000 0 0x8ff>,
<0 0x00780000 0 0x7a0>,
<0 0x00782000 0 0x100>,
@@ -85,7 +96,7 @@ examples:
#size-cells = <2>;
efuse@784000 {
- compatible = "qcom,qfprom";
+ compatible = "qcom,sdm845-qfprom", "qcom,qfprom";
reg = <0 0x00784000 0 0x8ff>;
#address-cells = <1>;
#size-cells = <1>;
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 2/4] arm64: dts: qcom: sc7180: Add soc-specific qfprom compat string
2020-10-29 0:28 [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions Evan Green
2020-10-29 0:28 ` [PATCH v3 1/4] dt-bindings: nvmem: Add soc qfprom compatible strings Evan Green
@ 2020-10-29 0:28 ` Evan Green
2020-11-02 15:58 ` [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions Srinivas Kandagatla
2 siblings, 0 replies; 6+ messages in thread
From: Evan Green @ 2020-10-29 0:28 UTC (permalink / raw)
To: Rob Herring, Bjorn Andersson, Srinivas Kandagatla
Cc: Douglas Anderson, Stephen Boyd, Evan Green, Andy Gross,
devicetree, linux-arm-msm, linux-kernel
Add the soc-specific compatible string so that it can be matched
more specifically now that the driver cares which SoC it's on.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
(no changes since v1)
arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 6fcffd588a7d6..f5ef2cb6e68c2 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -660,7 +660,7 @@ gcc: clock-controller@100000 {
};
qfprom: efuse@784000 {
- compatible = "qcom,qfprom";
+ compatible = "qcom,sc7180-qfprom", "qcom,qfprom";
reg = <0 0x00784000 0 0x8ff>,
<0 0x00780000 0 0x7a0>,
<0 0x00782000 0 0x100>,
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions
2020-10-29 0:28 [PATCH v3 0/4] nvmem: qfprom: Avoid untouchable regions Evan Green
2020-10-29 0:28 ` [PATCH v3 1/4] dt-bindings: nvmem: Add soc qfprom compatible strings Evan Green
2020-10-29 0:28 ` [PATCH v3 2/4] arm64: dts: qcom: sc7180: Add soc-specific qfprom compat string Evan Green
@ 2020-11-02 15:58 ` Srinivas Kandagatla
2020-11-02 22:34 ` Bjorn Andersson
2 siblings, 1 reply; 6+ messages in thread
From: Srinivas Kandagatla @ 2020-11-02 15:58 UTC (permalink / raw)
To: Evan Green, Rob Herring, Bjorn Andersson
Cc: Douglas Anderson, Stephen Boyd, Andy Gross, devicetree,
linux-arm-msm, linux-kernel
On 29/10/2020 00:28, Evan Green wrote:
> Certain fuses are protected by the XPU such that the AP cannot
> access them. Attempting to do so causes an SError. Introduce an
> SoC-specific compatible string, and introduce support into the
> nvmem core to avoid accessing specified regions. Then use those
> new elements in the qfprom driver to avoid SErrors when usermode
> accesses certain registers.
>
> Changes in v3:
> - Fixed example (Doug and rob-bot)
> - Use min()/max() macros instead of defining my own (Doug)
> - Comment changes to indicate sorting (Doug)
> - Add function to validate keepouts are proper (Doug)
>
> Changes in v2:
> - Add other soc compatible strings (Doug)
> - Fix compatible string definition (Doug)
> - Introduced keepout regions into the core (Srini)
> - Use new core support in qfprom (Srini)
>
> Evan Green (4):
> dt-bindings: nvmem: Add soc qfprom compatible strings
> arm64: dts: qcom: sc7180: Add soc-specific qfprom compat string
> nvmem: core: Add support for keepout regions
> nvmem: qfprom: Don't touch certain fuses
Except dts patch, I have applied all the patches, dts patch should go
via arm-soc tree!
--srini
>
> .../bindings/nvmem/qcom,qfprom.yaml | 17 +-
> arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +-
> drivers/nvmem/core.c | 153 +++++++++++++++++-
> drivers/nvmem/qfprom.c | 30 ++++
> include/linux/nvmem-provider.h | 17 ++
> 5 files changed, 211 insertions(+), 8 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread