Skip to contentSkip to conversation

dt-bindings: nvmem: add Broadcom's NVRAM

PATCH In review Rafał Miłecki 3 participants 4 messages Mar 5, 2021 – Mar 10, 2021

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

PATCH v2 1/2 dt-bindings: nvmem: add Broadcom's NVRAM

From: Rafał Miłecki <[email protected]>

Broadcom's NVRAM structure contains device data and can be accessed using I/O mapping.

---
V2: Use Broadcom's NVRAM specific binding. Generic "nvmem-iomap" binding
didn't make much sense. Thanks Srinivas!

---
 .../devicetree/bindings/nvmem/brcm,nvram.yaml | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml
Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml new file +34 -0
new file mode 100644
index 000000000000..58ff6b0bdb1a
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/brcm,nvram.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom's NVRAM
+
+description: |
+  Broadcom's NVRAM is a structure containing device specific environment
+  variables. It is used for storing device configuration, booting parameters
+  and calibration data.
+
+  NVRAM can be accessed on Broadcom BCM47xx MIPS and Northstar ARM Cortex-A9
+  devices usiong I/O mapped memory.
+
+maintainers:
+  - Rafał Miłecki <[email protected]>
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  compatible:
+    const: brcm,nvram
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    nvram@1eff0000 {
+            compatible = "brcm,nvram";
+            reg = <0x1eff0000 0x10000>;
+    };
Signature · 7 lines
2.26.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH v2 2/2 nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM

From: Rafał Miłecki <[email protected]>

This driver provides access to Broadcom's NVRAM.

---
V2: Applied Srinivas's suggestions:
* Simplified brcm_nvram_read
* Drop unneeded check & prints from probe
* Fixed MODULE_LICENSE
* Switched to Broadcom specific binding & driver. This is such a trivial driver that even if we get another similar one, it probably won't be worth it to share their code.
Thank you Srinivas!

---
 drivers/nvmem/Kconfig      |  9 +++++
 drivers/nvmem/Makefile     |  2 +
 drivers/nvmem/brcm_nvram.c | 78 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+)
 create mode 100644 drivers/nvmem/brcm_nvram.c
drivers/nvmem/Kconfig +9 -0
index 75d2594c16e1..d2a848fab82a 100644
@@ -278,4 +278,13 @@ config NVMEM_RMEM
 
 	  This driver can also be built as a module. If so, the module
 	  will be called nvmem-rmem.
+
+config NVMEM_BRCM_NVRAM
+	tristate "Broadcom's NVRAM support"
+	depends on ARCH_BCM_5301X || COMPILE_TEST
+	depends on HAS_IOMEM
+	help
+	  This driver provides support for Broadcom's NVRAM that can be accessed
+	  using I/O mapping.
+
 endif
drivers/nvmem/Makefile +2 -0
index 5376b8e0dae5..bbea1410240a 100644
@@ -57,3 +57,5 @@ obj-$(CONFIG_SPRD_EFUSE)	+= nvmem_sprd_efuse.o
 nvmem_sprd_efuse-y		:= sprd-efuse.o
 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
drivers/nvmem/brcm_nvram.c new file +78 -0

78 lines not on this page · raw message

Signature · 7 lines
2.26.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Reviewed-by on v2 1/2
#2 lore raw
In reply to Rafał Miłecki
Quoted 5 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Broadcom's NVRAM structure contains device data and can be accessed using I/O mapping.

Quoted 9 lines

---
V2: Use Broadcom's NVRAM specific binding. Generic "nvmem-iomap" binding
didn't make much sense. Thanks Srinivas!

---
 .../devicetree/bindings/nvmem/brcm,nvram.yaml | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml
#3 lore raw
In reply to Rafał Miłecki
Quoted 7 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Broadcom's NVRAM structure contains device data and can be accessed using I/O mapping.

---

Applied both patches!

thanks
-srini

Quoted 48 lines

V2: Use Broadcom's NVRAM specific binding. Generic "nvmem-iomap" binding
didn't make much sense. Thanks Srinivas!

---
  .../devicetree/bindings/nvmem/brcm,nvram.yaml | 34 +++++++++++++++++++
  1 file changed, 34 insertions(+)

create mode 100644 Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml

Documentation/devicetree/bindings/nvmem/brcm,nvram.yaml new file +34 -0
new file mode 100644
index 000000000000..58ff6b0bdb1a
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/brcm,nvram.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom's NVRAM
+
+description: |
+  Broadcom's NVRAM is a structure containing device specific environment
+  variables. It is used for storing device configuration, booting parameters
+  and calibration data.
+
+  NVRAM can be accessed on Broadcom BCM47xx MIPS and Northstar ARM Cortex-A9
+  devices usiong I/O mapped memory.
+
+maintainers:
+  - Rafał Miłecki <[email protected]>
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  compatible:
+    const: brcm,nvram
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    nvram@1eff0000 {
+            compatible = "brcm,nvram";
+            reg = <0x1eff0000 0x10000>;
+    };