Skip to contentSkip to conversation

nvmem: add Layerscape SFP support

PATCH Applied Michael Walle 3 participants 6 messages Feb 14, 2022 – Feb 21, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover nvmem: add Layerscape SFP support

Add support for the Security Fuse Processor found on Layerscape SoCs.

changes since v1:
- added Rob's Rb
- cleaned up the include files
- changed the module license to only "GPL"
- fix indendation, split lines longer than 80c

Michael Walle (3):
dt-bindings: nvmem: add fsl,layerscape-sfp binding
nvmem: add driver for Layerscape SFP (Security Fuse Processor)
arm64: dts: ls1028a: add efuse node

 .../bindings/nvmem/fsl,layerscape-sfp.yaml    | 38 ++++++++
 .../arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 11 +++
 drivers/nvmem/Kconfig                         | 12 +++
 drivers/nvmem/Makefile                        |  2 +
 drivers/nvmem/layerscape-sfp.c                | 89 +++++++++++++++++++
 5 files changed, 152 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/fsl,layerscape-sfp.yaml
 create mode 100644 drivers/nvmem/layerscape-sfp.c
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 1/3 dt-bindings: nvmem: add fsl,layerscape-sfp binding

The Security Fuse Processor provides efuses and is responsible for reading it at SoC startup and configuring it accordingly.

---
 .../bindings/nvmem/fsl,layerscape-sfp.yaml    | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/fsl,layerscape-sfp.yaml
Documentation/devicetree/bindings/nvmem/fsl,layerscape-sfp.yaml new file +38 -0
new file mode 100644
index 000000000000..80914b93638e
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/fsl,layerscape-sfp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Layerscape Security Fuse Processor
+
+maintainers:
+  - Michael Walle <[email protected]>
+
+description: |
+  SFP is the security fuse processor which among other things provide a
+  unique identifier per part.
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - fsl,ls1028a-sfp
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    efuse@1e80000 {
+        compatible = "fsl,ls1028a-sfp";
+        reg = <0x1e80000 0x8000>;
+    };
Signature · 1 line
2.30.2
#2 lore raw

PATCH v2 2/3 nvmem: add driver for Layerscape SFP (Security Fuse Processor)

In reply to Michael Walle

Add support for the Security Fuse Processor found on Layerscape SoCs. This driver implements basic read access.

---
 drivers/nvmem/Kconfig          | 12 +++++
 drivers/nvmem/Makefile         |  2 +
 drivers/nvmem/layerscape-sfp.c | 89 ++++++++++++++++++++++++++++++++++
 3 files changed, 103 insertions(+)
 create mode 100644 drivers/nvmem/layerscape-sfp.c
drivers/nvmem/Kconfig +12 -0
index 94dd60b2654e..63792082e476 100644
@@ -307,4 +307,16 @@ config NVMEM_BRCM_NVRAM
 	  This driver provides support for Broadcom's NVRAM that can be accessed
 	  using I/O mapping.
 
+config NVMEM_LAYERSCAPE_SFP
+	tristate "Layerscape SFP (Security Fuse Processor) support"
+	depends on ARCH_LAYERSCAPE || COMPILE_TEST
+	depends on HAS_IOMEM
+	help
+	  This driver provides support to read the eFuses on Freescale
+	  Layerscape SoC's. For example, the vendor provides a per part
+	  unique ID there.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called layerscape-sfp.
+
 endif
drivers/nvmem/Makefile +2 -0
index 4e6d877fdfaf..914358fcdb37 100644
@@ -62,3 +62,5 @@ obj-$(CONFIG_NVMEM_RMEM) 	+= nvmem-rmem.o
 nvmem-rmem-y			:= rmem.o
 obj-$(CONFIG_NVMEM_BRCM_NVRAM)	+= nvmem_brcm_nvram.o
 nvmem_brcm_nvram-y		:= brcm_nvram.o
+obj-$(CONFIG_NVMEM_LAYERSCAPE_SFP)	+= nvmem-layerscape-sfp.o
+nvmem-layerscape-sfp-y		:= layerscape-sfp.o
drivers/nvmem/layerscape-sfp.c new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
2.30.2
#3 lore raw

PATCH v2 3/3 arm64: dts: ls1028a: add efuse node

In reply to Michael Walle

Layerscape SoCs contain a Security Fuse Processor which is basically a efuse controller. Add the node, so userspace can read the efuses.

---
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +11 -0
index 7d44102d9c6c..4b248cee830a 100644
@@ -224,6 +224,17 @@ rst: syscon@1e60000 {
 			little-endian;
 		};
 
+		efuse@1e80000 {
+			compatible = "fsl,ls1028a-sfp";
+			reg = <0x0 0x1e80000 0x0 0x10000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			ls1028a_uid: unique-id@1c {
+				reg = <0x1c 0x8>;
+			};
+		};
+
 		scfg: syscon@1fc0000 {
 			compatible = "fsl,ls1028a-scfg", "syscon";
 			reg = <0x0 0x1fc0000 0x0 0x10000>;
Signature · 1 line
2.30.2
Applied
#4 lore raw

Re: [PATCH v2 3/3] arm64: dts: ls1028a: add efuse node

Quoted 4 lines · Michael Walle

Layerscape SoCs contain a Security Fuse Processor which is basically a efuse controller. Add the node, so userspace can read the efuses.

Applied, thanks!

#5 lore raw
In reply to Michael Walle
Quoted 9 lines · Michael Walle

Add support for the Security Fuse Processor found on Layerscape SoCs.

changes since v1:
- added Rob's Rb
- cleaned up the include files
- changed the module license to only "GPL"
- fix indendation, split lines longer than 80c

Quoted 3 lines

Michael Walle (3):
dt-bindings: nvmem: add fsl,layerscape-sfp binding
nvmem: add driver for Layerscape SFP (Security Fuse Processor)

Applied 1/3 and 2/3.

dts patch has to go via respective arm soc maintainer tree.

--srini

Quoted 11 lines
   arm64: dts: ls1028a: add efuse node
  .../bindings/nvmem/fsl,layerscape-sfp.yaml    | 38 ++++++++
  .../arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 11 +++
  drivers/nvmem/Kconfig                         | 12 +++
  drivers/nvmem/Makefile                        |  2 +
  drivers/nvmem/layerscape-sfp.c                | 89 +++++++++++++++++++
  5 files changed, 152 insertions(+)

create mode 100644 Documentation/devicetree/bindings/nvmem/fsl,layerscape-sfp.yaml create mode 100644 drivers/nvmem/layerscape-sfp.c