Skip to contentSkip to conversation

documentation: Add nvmem bindings documentation

RFC In review [email protected] 2 participants 4 messages Mar 23, 2018 – May 11, 2018

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

RFC 1/2 documentation: Add nvmem bindings documentation

From: Nava kishore Manne <[email protected]>

This patch add the bindings document of zynqmp silicon id driver.

---
 .../devicetree/bindings/nvmem/zynqmp_nvmem.txt     | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/zynqmp_nvmem.txt
Documentation/devicetree/bindings/nvmem/zynqmp_nvmem.txt new file +32 -0
new file mode 100644
index 000000000000..94332f160a92
@@ -0,0 +1,32 @@
+=  Zynq UltraScale+ MPSoC nvmem firmware driver binding =
+
+Required properties:
+- compatible: should be "xlnx,zynqmp-nvmem-fw"
+
+= Data cells =
+Are child nodes of silicon id, bindings of which as described in
+bindings/nvmem/nvmem.txt
+
+Example:
+
+	nvmem_firmware {
+		compatible = "xlnx,zynqmp-nvmem-fw";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		 /* Data cells */
+		soc_revision: soc_revision@0 {
+			reg = <0x0 0x4>;
+		};
+	};
+
+= Data consumers =
+Are device nodes which consume nvmem data cells.
+
+For example:
+
+	pcap {
+		...
+		nvmem-cells = <&soc_revision>;
+		nvmem-cell-names = "soc_revision";
+	};
Signature · 1 line
2.16.1
#1 lore raw

RFC 2/2 nvmem: zynqmp: Added zynqmp nvmem firmware driver

From: Nava kishore Manne <[email protected]>

This patch adds zynqmp nvmem firmware driver to access the SoC revision information from the hardware register.

---
 drivers/nvmem/Kconfig        |  9 +++++
 drivers/nvmem/Makefile       |  2 ++
 drivers/nvmem/zynqmp_nvmem.c | 85 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 drivers/nvmem/zynqmp_nvmem.c
drivers/nvmem/Kconfig +9 -0
index ff505af064ba..a9349281d05a 100644
@@ -175,4 +175,13 @@ config NVMEM_SNVS_LPGPR
 	  This driver can also be built as a module. If so, the module
 	  will be called nvmem-snvs-lpgpr.
 
+config NVMEM_ZYNQMP
+        bool "Xilinx ZYNQMP SoC nvmem firmware support"
+        depends on ARCH_ZYNQMP
+        help
+          This is a driver to access hardware related data like soc revision,
+          IDCODE... etc.
+
+          If sure, say yes. If unsure, say no.
+
 endif
drivers/nvmem/Makefile +2 -0
index e54dcfa6565a..932b4cebcb6c 100644
@@ -37,3 +37,5 @@ obj-$(CONFIG_MESON_MX_EFUSE)	+= nvmem_meson_mx_efuse.o
 nvmem_meson_mx_efuse-y		:= meson-mx-efuse.o
 obj-$(CONFIG_NVMEM_SNVS_LPGPR)	+= nvmem_snvs_lpgpr.o
 nvmem_snvs_lpgpr-y		:= snvs_lpgpr.o
+obj-$(CONFIG_NVMEM_ZYNQMP)	+= nvmem_zynqmp_nvmem.o
+nvmem_zynqmp_nvmem-y		:= zynqmp_nvmem.o
drivers/nvmem/zynqmp_nvmem.c new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.16.1
#2 lore raw

RFC 2/2 nvmem: zynqmp: Added zynqmp nvmem firmware driver

Quoted 42 lines · On 24/03/18 17:46, chinnikishore369 at gmail.com wrote:

From: Nava kishore Manne <[email protected]>

This patch adds zynqmp nvmem firmware driver to access the SoC revision information from the hardware register.

---
  drivers/nvmem/Kconfig        |  9 +++++
  drivers/nvmem/Makefile       |  2 ++
  drivers/nvmem/zynqmp_nvmem.c | 85 ++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 96 insertions(+)

create mode 100644 drivers/nvmem/zynqmp_nvmem.c

drivers/nvmem/Kconfig +9 -0
index ff505af064ba..a9349281d05a 100644
@@ -175,4 +175,13 @@ config NVMEM_SNVS_LPGPR
  	  This driver can also be built as a module. If so, the module
  	  will be called nvmem-snvs-lpgpr.
 
+config NVMEM_ZYNQMP
+        bool "Xilinx ZYNQMP SoC nvmem firmware support"
+        depends on ARCH_ZYNQMP
+        help
+          This is a driver to access hardware related data like soc revision,
+          IDCODE... etc.
+
+          If sure, say yes. If unsure, say no.
+
  endif
drivers/nvmem/Makefile +2 -0
index e54dcfa6565a..932b4cebcb6c 100644
@@ -37,3 +37,5 @@ obj-$(CONFIG_MESON_MX_EFUSE)	+= nvmem_meson_mx_efuse.o
  nvmem_meson_mx_efuse-y		:= meson-mx-efuse.o
  obj-$(CONFIG_NVMEM_SNVS_LPGPR)	+= nvmem_snvs_lpgpr.o
  nvmem_snvs_lpgpr-y		:= snvs_lpgpr.o
+obj-$(CONFIG_NVMEM_ZYNQMP)	+= nvmem_zynqmp_nvmem.o
+nvmem_zynqmp_nvmem-y		:= zynqmp_nvmem.o
drivers/nvmem/zynqmp_nvmem.c +0 -0

...

drivers/nvmem/zynqmp_nvmem.c line 59

Quoted 12 lines
drivers/nvmem/zynqmp_nvmem.c +12 -0
+
+static int zynqmp_nvmem_probe(struct platform_device *pdev)
+{
+	struct nvmem_device *nvmem;
+
+	econfig.dev = &pdev->dev;
+	econfig.reg_read = zynqmp_nvmem_read;
+
+	nvmem = nvmem_register(&econfig);
+	if (IS_ERR(nvmem))
+		return PTR_ERR(nvmem);
+

You could use devm version of this..

Quoted 5 lines
drivers/nvmem/zynqmp_nvmem.c +4 -0
+	platform_set_drvdata(pdev, nvmem);
+
+	return 0;
+}

...

Quoted 6 lines
drivers/nvmem/zynqmp_nvmem.c +5 -0
+module_platform_driver(zynqmp_nvmem_driver);
+
+MODULE_AUTHOR("Michal Simek <[email protected]>, Nava kishore Manne <[email protected]>");
+MODULE_DESCRIPTION("ZynqMP NVMEM driver");
+MODULE_LICENSE("GPL");
#3 lore raw
In reply to [email protected]
Quoted 5 lines · On 24/03/18 17:46, chinnikishore369 at gmail.com wrote:

From: Nava kishore Manne <[email protected]>

This patch add the bindings document of zynqmp silicon id driver.

I see that you have not included DT maintainers in to/cc list, I can not accept new drivers whose bindings are not Acked/Reviewed by DT maintainers.

Overall the driver looks fine for me.

thanks,
srini

Quoted 44 lines
---
  .../devicetree/bindings/nvmem/zynqmp_nvmem.txt     | 32 ++++++++++++++++++++++
  1 file changed, 32 insertions(+)

create mode 100644 Documentation/devicetree/bindings/nvmem/zynqmp_nvmem.txt

Documentation/devicetree/bindings/nvmem/zynqmp_nvmem.txt new file +32 -0
new file mode 100644
index 000000000000..94332f160a92
@@ -0,0 +1,32 @@
+=  Zynq UltraScale+ MPSoC nvmem firmware driver binding =
+
+Required properties:
+- compatible: should be "xlnx,zynqmp-nvmem-fw"
+
+= Data cells =
+Are child nodes of silicon id, bindings of which as described in
+bindings/nvmem/nvmem.txt
+
+Example:
+
+	nvmem_firmware {
+		compatible = "xlnx,zynqmp-nvmem-fw";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		 /* Data cells */
+		soc_revision: soc_revision at 0 {
+			reg = <0x0 0x4>;
+		};
+	};
+
+= Data consumers =
+Are device nodes which consume nvmem data cells.
+
+For example:
+
+	pcap {
+		...
+		nvmem-cells = <&soc_revision>;
+		nvmem-cell-names = "soc_revision";
+	};