public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nandor Han <nandor.han@vaisala.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 0/3] Add reboot mode support
Date: Mon,  4 May 2020 12:18:41 +0300	[thread overview]
Message-ID: <cover.1588582823.git.nandor.han@vaisala.com> (raw)

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

             reply	other threads:[~2020-05-04  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  9:18 Nandor Han [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1588582823.git.nandor.han@vaisala.com \
    --to=nandor.han@vaisala.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox