Message ID | 20190421190913.1478-3-nandor.han@vaisala.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | [v3,1/2] power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface | expand |
On Sun, Apr 21, 2019 at 07:09:30PM +0000, Han Nandor wrote: > Add the device tree bindings document for the NVMEM based reboot-mode > driver. > > Signed-off-by: Nandor Han <nandor.han@vaisala.com> > --- > .../power/reset/nvmem-reboot-mode.txt | 32 +++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt > > diff --git a/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt > new file mode 100644 > index 000000000000..2e1b86c31cb3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt > @@ -0,0 +1,32 @@ > +NVMEM reboot mode driver > + > +This driver gets reboot mode magic value from reboot-mode driver > +and stores it in a NVMEM cell named "reboot-mode". Then the bootloader > +can read it and take different action according to the magic > +value stored. This is also assuming the nvmem is writeable which is more often not the case. Is your usecase a platform that supports pstore? Adding on to that binding might be a better fit. > + > +This DT node should be represented as a sub-node of a "simple-mfd" > +node. > + > +Required properties: > +- compatible: should be "nvmem-reboot-mode". > +- nvmem-cells: A phandle to the reboot mode provided by a nvmem device. > +- nvmem-cell-names: Should be "reboot-mode". > + > +The rest of the properties should follow the generic reboot-mode description > +found in reboot-mode.txt > + > +Example: > + reboot-mode-nvmem@0 { What's this node for? > + compatible = "simple-mfd"; I only see 1 function. > + reboot-mode { > + compatible = "nvmem-reboot-mode"; > + nvmem-cells = <&reboot_mode>; > + nvmem-cell-names = "reboot-mode"; > + > + mode-normal = <0xAAAA5501>; > + mode-bootloader = <0xBBBB5500>; > + mode-recovery = <0xCCCC5502>; > + mode-test = <0xDDDD5503>; > + }; > + }; > -- > 2.17.2 >
On 5/1/19 1:47 AM, Rob Herring wrote: Hi Rob, Thanks for review. >> @@ -0,0 +1,32 @@ >> +NVMEM reboot mode driver >> + >> +This driver gets reboot mode magic value from reboot-mode driver >> +and stores it in a NVMEM cell named "reboot-mode". Then the bootloader >> +can read it and take different action according to the magic >> +value stored. > > This is also assuming the nvmem is writeable which is more often not the > case. > > Is your usecase a platform that supports pstore? Adding on to that > binding might be a better fit. > I'm using an RTC persistent memory for storing this data. The available memory is low and don't think pstore will fit in this case. >> +The rest of the properties should follow the generic reboot-mode description >> +found in reboot-mode.txt >> + >> +Example: >> + reboot-mode-nvmem@0 { > > What's this node for? > >> + compatible = "simple-mfd"; > > I only see 1 function. > No need to this. Will remove Nandor
diff --git a/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt new file mode 100644 index 000000000000..2e1b86c31cb3 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt @@ -0,0 +1,32 @@ +NVMEM reboot mode driver + +This driver gets reboot mode magic value from reboot-mode driver +and stores it in a NVMEM cell named "reboot-mode". Then the bootloader +can read it and take different action according to the magic +value stored. + +This DT node should be represented as a sub-node of a "simple-mfd" +node. + +Required properties: +- compatible: should be "nvmem-reboot-mode". +- nvmem-cells: A phandle to the reboot mode provided by a nvmem device. +- nvmem-cell-names: Should be "reboot-mode". + +The rest of the properties should follow the generic reboot-mode description +found in reboot-mode.txt + +Example: + reboot-mode-nvmem@0 { + compatible = "simple-mfd"; + reboot-mode { + compatible = "nvmem-reboot-mode"; + nvmem-cells = <&reboot_mode>; + nvmem-cell-names = "reboot-mode"; + + mode-normal = <0xAAAA5501>; + mode-bootloader = <0xBBBB5500>; + mode-recovery = <0xCCCC5502>; + mode-test = <0xDDDD5503>; + }; + };
Add the device tree bindings document for the NVMEM based reboot-mode driver. Signed-off-by: Nandor Han <nandor.han@vaisala.com> --- .../power/reset/nvmem-reboot-mode.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt