mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/10] power: reset: add support for syscon reboot modes
@ 2020-09-16 13:50 Ahmad Fatoum
  2020-09-16 13:50 ` [PATCH 01/10] usbgadget: autostart: support delayed usbgadget.autostart=1 Ahmad Fatoum
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2020-09-16 13:50 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

With this patch set, we have a framework to generically support passing
reboot modes to previous bootloader stages as well as process them.
Stuff you can do with this:

  linux$ reboot recovery
  * fall into barebox menu prompt, unless overridden *

  linux$ reboot emmc
  * sources /env/bmode/emmc if available *

  barebox$ gpr.reboot_mode.next=serial reset
  * fall into imx-usb-loader mode *

To enable this, besides having kernel and bootloader driver support,
you'll need to describe in the device tree where the reboot mode is
to be stored and what reboot modes there are.
This patch set implements it for two SoC families:

stm32mp15x:
  - All now support `reboot loader` and `reboot recovery` from Linux,
    if the syscon exists (The reboot mode itself is fixed up).

i.MX6Q/DL:
  - No OS communication by default, but you can now easily tell the
    BootROM where to boot from after warm reset

One thing missing in this series is support for nvmem-reboot-mode.
I ported the kernel driver[], but didn't come around to test it.

Details inside. Feedback appreciated. :-)

[1]: https://github.com/a3f/barebox/tree/reboot_mode

Ahmad Fatoum (10):
  usbgadget: autostart: support delayed usbgadget.autostart=1
  drivers: add reboot-mode infrastructure
  power: reset: reboot-mode: port syscon-reboot-mode support
  power: reset: reboot-mode: fix up node into boot device tree
  defaultenv: provide defaults for generic reboot modes
  ARM: dts: stm32mp: setup syscon-reboot-mode on TAMP general purpose
    register
  ARM: stm32mp: remove custom reboot mode logic from arch code
  power: reset: reboot-mode: support multi-word magic
  power: reset: syscon-reboot-mode: support multi-word reboot modes
  ARM: dts: i.MX6qdl: define BootROM reboot-mode on top of SRC_GPR{9,10}

 Documentation/user/defaultenv-2.rst           |  18 +-
 Documentation/user/reboot-mode.rst            |  95 ++++++++
 arch/arm/dts/imx6qdl.dtsi                     |  21 ++
 arch/arm/dts/stm32mp151.dtsi                  |  15 ++
 .../mach-stm32mp/include/mach/bootsource.h    |  12 -
 arch/arm/mach-stm32mp/init.c                  |  16 +-
 common/Kconfig                                |   5 +
 common/startup.c                              |  16 ++
 common/usbgadget.c                            |   6 +-
 defaultenv/Makefile                           |   1 +
 .../defaultenv-2-reboot-mode/bmode/bootloader |   3 +
 .../defaultenv-2-reboot-mode/bmode/loader     |   2 +
 .../defaultenv-2-reboot-mode/bmode/recovery   |   2 +
 defaultenv/defaultenv.c                       |   2 +
 drivers/Kconfig                               |   1 +
 drivers/Makefile                              |   1 +
 drivers/power/Kconfig                         |   2 +
 drivers/power/Makefile                        |   2 +
 drivers/power/reset/Kconfig                   |  16 ++
 drivers/power/reset/Makefile                  |   3 +
 drivers/power/reset/reboot-mode.c             | 229 ++++++++++++++++++
 drivers/power/reset/syscon-reboot-mode.c      | 129 ++++++++++
 include/linux/reboot-mode.h                   |  38 +++
 include/of.h                                  |   2 +
 24 files changed, 604 insertions(+), 33 deletions(-)
 create mode 100644 Documentation/user/reboot-mode.rst
 create mode 100644 defaultenv/defaultenv-2-reboot-mode/bmode/bootloader
 create mode 100755 defaultenv/defaultenv-2-reboot-mode/bmode/loader
 create mode 100644 defaultenv/defaultenv-2-reboot-mode/bmode/recovery
 create mode 100644 drivers/power/Kconfig
 create mode 100644 drivers/power/Makefile
 create mode 100644 drivers/power/reset/Kconfig
 create mode 100644 drivers/power/reset/Makefile
 create mode 100644 drivers/power/reset/reboot-mode.c
 create mode 100644 drivers/power/reset/syscon-reboot-mode.c
 create mode 100644 include/linux/reboot-mode.h

-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2020-10-07  8:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 13:50 [PATCH 00/10] power: reset: add support for syscon reboot modes Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 01/10] usbgadget: autostart: support delayed usbgadget.autostart=1 Ahmad Fatoum
2020-09-16 13:55   ` Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 02/10] drivers: add reboot-mode infrastructure Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 03/10] power: reset: reboot-mode: port syscon-reboot-mode support Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 04/10] power: reset: reboot-mode: fix up node into boot device tree Ahmad Fatoum
2020-09-21  8:40   ` Sascha Hauer
2020-09-21  9:11     ` Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 05/10] defaultenv: provide defaults for generic reboot modes Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 06/10] ARM: dts: stm32mp: setup syscon-reboot-mode on TAMP general purpose register Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 07/10] ARM: stm32mp: remove custom reboot mode logic from arch code Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 08/10] power: reset: reboot-mode: support multi-word magic Ahmad Fatoum
2020-09-16 13:50 ` [PATCH 09/10] power: reset: syscon-reboot-mode: support multi-word reboot modes Ahmad Fatoum
2020-10-07  8:18   ` Sascha Hauer
2020-09-16 13:50 ` [PATCH 10/10] ARM: dts: i.MX6qdl: define BootROM reboot-mode on top of SRC_GPR{9, 10} Ahmad Fatoum

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