nvmem: airoha: Add support for SMC eFUSE
Subsystems (2)
v4 cover nvmem: airoha: Add support for SMC eFUSE
Add simple driver to read eFUSES with SMC commands for Airoha AN7581.
Changes v4:
- Address review from Sashiko Bot
- Use u32 for bank_index
Changes v3:
- Rebase on top of linux-next
Changes v2:
- Add review tag from Rob
- Rebase on top of linux-next
Christian Marangi (2):
dt-bindings: nvmem: airoha: add SMC eFuses schema
nvmem: airoha: Add support for SMC eFUSE
.../bindings/nvmem/airoha,smc-efuses.yaml | 67 ++++++++++ drivers/nvmem/Kconfig | 13 ++ drivers/nvmem/Makefile | 2 + drivers/nvmem/airoha-smc-efuses.c | 125 ++++++++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml create mode 100644 drivers/nvmem/airoha-smc-efuses.c
Signature · 1 line
2.53.0
PATCH v4 1/2 dt-bindings: nvmem: airoha: add SMC eFuses schema
Add Airoha SMC eFuses schema to document new Airoha SoC AN7581/AN7583 way of accessing the 2 eFuse bank via the SMC command.
Each eFuse bank expose 64 eFuse cells of 32 bit used to give information on HW Revision, PHY Calibration, Device Model, Private Key and all kind of other info specific to the SoC or the running system.
--- .../bindings/nvmem/airoha,smc-efuses.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml new file +67 -0
@@ -0,0 +1,67 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/airoha,smc-efuses.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Airoha SMC eFuses + +description: | + Airoha new SoC AN7581 expose banks of eFuse accessible + via specific SMC commands. + + 2 different bank of eFuse or 64 cells of 32 bit are exposed + read-only used to give information on HW Revision, PHY Calibration, + Device Model, Private Key... + +maintainers: + - Christian Marangi <[email protected]> + +properties: + compatible: + enum: + - airoha,an7581-efuses + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + '^efuse-bank@[0-1]$': + type: object + + allOf: + - $ref: nvmem.yaml# + + properties: + reg: + description: Identify the eFuse bank. + enum: [0, 1] + + required: + - reg + + unevaluatedProperties: false + +required: + - compatible + - '#address-cells' + - '#size-cells' + +additionalProperties: false + +examples: + - | + efuse { + compatible = "airoha,an7581-efuses"; + #address-cells = <1>; + #size-cells = <0>; + + efuse-bank@0 { + reg = <0>; + }; + }; + +...
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v4 1/2] dt-bindings: nvmem: airoha: add SMC eFuses schema
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The schema is missing the compatible string for the Airoha AN7583 SoC, despite it being…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The schema is missing the compatible string for the Airoha AN7583 SoC, despite it being explicitly mentioned in the commit message. --
commit 4691b687a514217a385c7b7725536b71c206a6c2
Author: Christian Marangi <[email protected]>
dt-bindings: nvmem: airoha: add SMC eFuses schema
This commit adds a new device tree binding schema for the Airoha SMC eFuses. It documents the access method for the eFuse banks via SMC commands for the new Airoha SoCs.
Quoted 2 lines
Add Airoha SMC eFuses schema to document new Airoha SoC AN7581/AN7583 way of accessing the 2 eFuse bank via the SMC command.
[Severity: Medium]
Is the AN7583 SoC supposed to be included in the schema? The commit message mentions both AN7581 and AN7583, but the schema below only documents the AN7581.
Quoted 5 lines
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml new file +0
-0
[ ... ]
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml line 11
Quoted 5 lines
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml new file +5
-0+title: Airoha SMC eFuses + +description: | + Airoha new SoC AN7581 expose banks of eFuse accessible + via specific SMC commands.
[Severity: Medium]
Should AN7583 also be mentioned in the description here to match the details in the commit message?
[ ... ]
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml line 23
Quoted 4 lines
Documentation/devicetree/bindings/nvmem/airoha,smc-efuses.yaml new file +4
-0+properties: + compatible: + enum: + - airoha,an7581-efuses
[Severity: Medium]
Should airoha,an7583-efuses be included in this enum if the binding is intended to support the AN7583 SoC?
If AN7583 uses this block, omitting its specific compatible string might cause device tree validation to fail for valid AN7583 device trees.
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v4 2/2 nvmem: airoha: Add support for SMC eFUSE
In reply to Christian MarangiAdd support for SMC eFUSE on AN7581 SoC. The SoC have 2 set of 2048 bits of eFUSE that are used to read calibration value for PCIe, Thermal, USB and other specific info of the SoC like revision and HW device present.
eFuse value are taken by sending SMC command. ATF is responsible of validaing the data and rejecting reading protected data (like Private Key). In such case the SMC command will return non-zero value on a0 register.
--- drivers/nvmem/Kconfig | 13 ++++ drivers/nvmem/Makefile | 2 + drivers/nvmem/airoha-smc-efuses.c | 125 ++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/nvmem/airoha-smc-efuses.c
drivers/nvmem/Kconfig +13 -0
@@ -28,6 +28,19 @@ source "drivers/nvmem/layouts/Kconfig" # Devices +config NVMEM_AIROHA_SMC_EFUSES + tristate "Airoha SMC eFuse support" + depends on ARCH_AIROHA || COMPILE_TEST + depends on HAVE_ARM_SMCCC + default ARCH_AIROHA + help + Say y here to enable support for reading eFuses on Airoha AN7581 + SoCs. These are e.g. used to store factory programmed + calibration data required for the PCIe or the USB-C PHY or Thermal. + + This driver can also be built as a module. If so, the module will + be called nvmem-airoha-smc-efuses. + config NVMEM_AN8855_EFUSE tristate "Airoha AN8855 eFuse support" depends on COMPILE_TEST
drivers/nvmem/Makefile +2 -0
@@ -10,6 +10,8 @@ nvmem_layouts-y := layouts.o obj-y += layouts/ # Devices +obj-$(CONFIG_NVMEM_AIROHA_SMC_EFUSES) += nvmem-airoha-smc-efuses.o +nvmem-airoha-smc-efuses-y := airoha-smc-efuses.o obj-$(CONFIG_NVMEM_AN8855_EFUSE) += nvmem-an8855-efuse.o nvmem-an8855-efuse-y := an8855-efuse.o obj-$(CONFIG_NVMEM_APPLE_EFUSES) += nvmem-apple-efuses.o
drivers/nvmem/airoha-smc-efuses.c new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.53.0
Quoted 12 lines · Christian Marangi
Add simple driver to read eFUSES with SMC commands for Airoha AN7581.
Changes v4:
- Address review from Sashiko Bot
- Use u32 forbank_index
Changes v3:
- Rebase on top of linux-next
Changes v2:
- Add review tag from Rob
- Rebase on top of linux-next
Quoted 1 line
[...]
Applied, thanks!
[1/2] dt-bindings: nvmem: airoha: add SMC eFuses schema
commit: ecc54f3a10d07449d6024a43854e5f4bdfb1aa32
[2/2] nvmem: airoha: Add support for SMC eFUSE
commit: 46057692bcf960f376fb4e7665977163f91f0ebfBest regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>