public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add reboot mode support
@ 2020-05-04  9:18 Nandor Han
  2020-05-04  9:18 ` [PATCH v2 1/3] reboot-mode: add support for reboot mode control Nandor Han
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Nandor Han @ 2020-05-04  9:18 UTC (permalink / raw)
  To: u-boot

Description
-----------
Add support for reboot-mode configuration using GPIOs and RTC SRAM as
back-end.

Testing
-------

Tested on a Zynq based board where device tree was configured to contain
the reboot-mode configuration:

&amba {
    status = "okay";

    reboot-mode-gpio {
        compatible = "reboot-mode-gpio";
        gpios = <&gpio0 47 GPIO_ACTIVE_LOW>;
        mode-test = <0x1>;
    };

    reboot-mode-rtc {
        compatible = "reboot-mode-rtc";
        rtc = <&rtc_0>;
        reg = <0x14 4>;
        mode-test = <0x21969147>;
    };
};

In addition to this and not part of this patchset is a change to board.c
where GPIO or RTC SRAM backed is selected dynamically at runtime.

1. Test that the reboot mode configured in user-space is read in U-Boot and
environment configured: PASS

Userspace ~ # reboot test
....
[  177.335936] reboot: Restarting system with command 'test'

U-Boot SPL 2019.01 (Mar 29 2019 - 10:44:22 +0000)
...
U-Boot> print reboot-mode
reboot-mode=test

2. Reset the system using the reset command and stop in U-Boot.
3. Verify that reboot-mode env variable is not configured anymore: PASS

U-Boot> print reboot-mode
## Error: "reboot-mode" not defined

4. Toggle the GPIO configured for test mode to active and reset the system
with command reset.
5. Stop in U-Boot and check that reboot-mode env variable is configured:PASS

U-Boot> print reboot-mode
reboot-mode=test

Changes since v1:
----------------
- rebased

Nandor Han (3):
  reboot-mode: add support for reboot mode control
  reboot-mode: read the boot mode from GPIOs status
  reboot-mode: read the boot mode from RTC memory

 .../reboot-mode/reboot-mode-gpio.txt          |  20 +++
 .../reboot-mode/reboot-mode-rtc.txt           |  22 +++
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/reboot-mode/Kconfig                   |  36 +++++
 drivers/reboot-mode/Makefile                  |   9 ++
 drivers/reboot-mode/reboot-mode-gpio.c        | 125 +++++++++++++++++
 drivers/reboot-mode/reboot-mode-rtc.c         | 132 ++++++++++++++++++
 drivers/reboot-mode/reboot-mode-uclass.c      | 132 ++++++++++++++++++
 include/dm/uclass-id.h                        |   1 +
 include/reboot-mode/reboot-mode-gpio.h        |  32 +++++
 include/reboot-mode/reboot-mode-rtc.h         |  16 +++
 include/reboot-mode/reboot-mode.h             |  56 ++++++++
 13 files changed, 584 insertions(+)
 create mode 100644 doc/device-tree-bindings/reboot-mode/reboot-mode-gpio.txt
 create mode 100644 doc/device-tree-bindings/reboot-mode/reboot-mode-rtc.txt
 create mode 100644 drivers/reboot-mode/Kconfig
 create mode 100644 drivers/reboot-mode/Makefile
 create mode 100644 drivers/reboot-mode/reboot-mode-gpio.c
 create mode 100644 drivers/reboot-mode/reboot-mode-rtc.c
 create mode 100644 drivers/reboot-mode/reboot-mode-uclass.c
 create mode 100644 include/reboot-mode/reboot-mode-gpio.h
 create mode 100644 include/reboot-mode/reboot-mode-rtc.h
 create mode 100644 include/reboot-mode/reboot-mode.h

-- 
2.24.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-06 12:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04  9:18 [PATCH v2 0/3] Add reboot mode support Nandor Han
2020-05-04  9:18 ` [PATCH v2 1/3] reboot-mode: add support for reboot mode control Nandor Han
2020-05-04  9:18 ` [PATCH v2 2/3] reboot-mode: read the boot mode from GPIOs status Nandor Han
2020-05-04  9:18 ` [PATCH v2 3/3] reboot-mode: read the boot mode from RTC memory Nandor Han
2020-09-30 11:04 ` [PATCH v2 0/3] Add reboot mode support Nandor Han
2020-09-30 15:30   ` Tom Rini
2021-05-06 12:21     ` [PATCH v3 " Nandor Han
2021-05-06 12:21     ` [PATCH v3 1/3] reboot-mode: add support for reboot mode control Nandor Han
2021-05-06 12:21     ` [PATCH v3 2/3] reboot-mode: read the boot mode from GPIOs status Nandor Han
2021-05-06 12:21     ` [PATCH v3 3/3] reboot-mode: read the boot mode from RTC memory Nandor Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox