[PATCH v4 2/3] reboot-mode: read the boot mode from GPIOs status

Simon Glass sjg at chromium.org
Sat Jun 26 20:30:04 CEST 2021


On Thu, 10 Jun 2021 at 07:57, Nandor Han <nandor.han at vaisala.com> wrote:
>
> A use case for controlling the boot mode is when the user wants
> to control the device boot by pushing a button without needing to
> go in user-space.
>
> Add a new backed for reboot mode where GPIOs are used to control the
> reboot-mode. The driver is able to scan a predefined list of GPIOs
> and return the magic value. Having the modes associated with
> the magic value generated based on the GPIO values, allows the
> reboot mode uclass to select the proper mode.
>
> Signed-off-by: Nandor Han <nandor.han at vaisala.com>
> ---
>  arch/sandbox/dts/test.dts                     |   8 ++
>  configs/sandbox_defconfig                     |   2 +
>  .../reboot-mode/reboot-mode-gpio.txt          |  20 +++
>  drivers/reboot-mode/Kconfig                   |   9 ++
>  drivers/reboot-mode/Makefile                  |   1 +
>  drivers/reboot-mode/reboot-mode-gpio.c        | 128 ++++++++++++++++++
>  include/reboot-mode/reboot-mode-gpio.h        |  32 +++++
>  test/dm/Makefile                              |   1 +
>  test/dm/reboot-mode.c                         |  42 ++++++
>  9 files changed, 243 insertions(+)
>  create mode 100644 doc/device-tree-bindings/reboot-mode/reboot-mode-gpio.txt
>  create mode 100644 drivers/reboot-mode/reboot-mode-gpio.c
>  create mode 100644 include/reboot-mode/reboot-mode-gpio.h
>  create mode 100644 test/dm/reboot-mode.c

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list