documentation: Add nvmem bindings documentation
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
@@ -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
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
@@ -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
@@ -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
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.
Signed-off-by Nava kishore Manne <[email protected]>--- 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.cdrivers/nvmem/Kconfig +9
-0@@ -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. + endifdrivers/nvmem/Makefile +2
-0@@ -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.odrivers/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" );
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.
Signed-off-by Nava kishore Manne <[email protected]>
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.txtDocumentation/devicetree/bindings/nvmem/zynqmp_nvmem.txt new file +32
-0@@ -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"; + };