mbox series

[v4,0/2] Use NVMEM as reboot-mode write interface

Message ID 20190515104658.25535-1-nandor.han@vaisala.com (mailing list archive)
Headers show
Series Use NVMEM as reboot-mode write interface | expand

Message

Nandor Han May 15, 2019, 10:47 a.m. UTC
Description
-----------
Extend the reboot mode driver to use a NVMEM cell as writing interface.

Testing
-------
The testing is done by configuring DT from a custom board.
The NVMEM cell is configured in an RTC non-volatile memory.
Kernel: 4.14.60 (the patchset was rebased on kernel master)

DT configurations:
`
...
reboot-mode-nvmem@0 {
    compatible = "simple-mfd";
    reboot-mode {
        compatible = "nvmem-reboot-mode";
        nvmem-cells = <&reboot_mode>;
        nvmem-cell-names = "reboot-mode";

        mode-test       = <0x21969147>;
    };
};
...
reboot_mode: nvmem_reboot_mode@0 {
        reg = <0x00 0x4>;
};
...
`

1. Reboot the system using the command `reboot test`

2. Verify that kernel logs show that reboot was done in mode `test`:
PASS
`[  413.957172] reboot: Restarting system with command 'test' `

3. Stop in U-Boot and verify that mode `test` magic value is present
in RTCs non-volatile memory: PASS

Kernel: 5.1.0-rc3

1. Configure `arch/arm/configs/imx_v6_v7_defconfig` to contain 
`CONFIG_NVMEM_REBOOT_MODE=y`
2. Verify that Kernel compiles successful: PASS
`
make ARCH=arm CROSS_COMPILE=arm-linux-gnu- imx_v6_v7_defconfig zImage
...
CC      drivers/power/reset/nvmem-reboot-mode.o
...
Kernel: arch/arm/boot/zImage is ready
`
Changes since v1:
-----------------
 - split the documentation on a separate patch
 - add a missing header

Changes since v2:
----------------
 - change the module license to GPL since GPL v2 is deprecated

Changes since v3:
----------------
 - documentation updated according to the comments

Nandor Han (2):
  power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write
    interface
  dt-bindings: power: reset: add document for NVMEM based reboot-mode

 .../power/reset/nvmem-reboot-mode.txt         | 26 +++++++
 drivers/power/reset/Kconfig                   |  9 +++
 drivers/power/reset/Makefile                  |  1 +
 drivers/power/reset/nvmem-reboot-mode.c       | 76 +++++++++++++++++++
 4 files changed, 112 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.txt
 create mode 100644 drivers/power/reset/nvmem-reboot-mode.c

Comments

Sebastian Reichel June 27, 2019, 6:33 p.m. UTC | #1
Hi,

On Wed, May 15, 2019 at 10:47:14AM +0000, Han Nandor wrote:
> Description
> -----------
> Extend the reboot mode driver to use a NVMEM cell as writing interface.
> 
> Testing
> -------
> The testing is done by configuring DT from a custom board.
> The NVMEM cell is configured in an RTC non-volatile memory.
> Kernel: 4.14.60 (the patchset was rebased on kernel master)
> 
> DT configurations:
> `
> ...
> reboot-mode-nvmem@0 {
>     compatible = "simple-mfd";
>     reboot-mode {
>         compatible = "nvmem-reboot-mode";
>         nvmem-cells = <&reboot_mode>;
>         nvmem-cell-names = "reboot-mode";
> 
>         mode-test       = <0x21969147>;
>     };
> };
> ...
> reboot_mode: nvmem_reboot_mode@0 {
>         reg = <0x00 0x4>;
> };
> ...
> `
> 
> 1. Reboot the system using the command `reboot test`
> 
> 2. Verify that kernel logs show that reboot was done in mode `test`:
> PASS
> `[  413.957172] reboot: Restarting system with command 'test' `
> 
> 3. Stop in U-Boot and verify that mode `test` magic value is present
> in RTCs non-volatile memory: PASS
> 
> Kernel: 5.1.0-rc3
> 
> 1. Configure `arch/arm/configs/imx_v6_v7_defconfig` to contain 
> `CONFIG_NVMEM_REBOOT_MODE=y`
> 2. Verify that Kernel compiles successful: PASS
> `
> make ARCH=arm CROSS_COMPILE=arm-linux-gnu- imx_v6_v7_defconfig zImage
> ...
> CC      drivers/power/reset/nvmem-reboot-mode.o
> ...
> Kernel: arch/arm/boot/zImage is ready
> `
> Changes since v1:
> -----------------
>  - split the documentation on a separate patch
>  - add a missing header
> 
> Changes since v2:
> ----------------
>  - change the module license to GPL since GPL v2 is deprecated
> 
> Changes since v3:
> ----------------
>  - documentation updated according to the comments

Thanks, queued. Please fix your git/mail setup, I had to fix the
line endings (\r\n -> \n) to apply this.

-- Sebastian
Nandor Han June 28, 2019, 4:49 a.m. UTC | #2
Hi,

>> Changes since v3:
>> ----------------
>>   - documentation updated according to the comments
> 
> Thanks, queued. Please fix your git/mail setup, I had to fix the
> line endings (\r\n -> \n) to apply this.
> 
> -- Sebastian
> 

Ok. Thanks Sebastian.

--
Nandor