From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 00/10] power: reset: add support for syscon reboot
Date: Mon, 28 Sep 2020 16:45:04 +0200 [thread overview]
Message-ID: <20200928144514.14398-1-a.fatoum@pengutronix.de> (raw)
v1 -> v2:
- Fixed use-after-free when attempting to fix up barebox internal
device tree (Sascha)
- reworded commit message in last patch to explicitly indicate
that imxwd must be used as reset for syscon to maintain value
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 -r imxwd
* 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 | 233 ++++++++++++++++++
drivers/power/reset/syscon-reboot-mode.c | 129 ++++++++++
include/linux/reboot-mode.h | 38 +++
include/of.h | 2 +
24 files changed, 608 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
next reply other threads:[~2020-09-28 14:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 14:45 Ahmad Fatoum [this message]
2020-09-28 14:45 ` [PATCH v2 01/10] usbgadget: autostart: support delayed usbgadget.autostart=1 Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 02/10] drivers: add reboot-mode infrastructure Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 03/10] power: reset: reboot-mode: port syscon-reboot-mode support Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 04/10] power: reset: reboot-mode: fix up node into boot device tree Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 05/10] defaultenv: provide defaults for generic reboot modes Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 06/10] ARM: dts: stm32mp: setup syscon-reboot-mode on TAMP general purpose register Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 07/10] ARM: stm32mp: remove custom reboot mode logic from arch code Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 08/10] power: reset: reboot-mode: support multi-word magic Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 09/10] power: reset: syscon-reboot-mode: support multi-word reboot modes Ahmad Fatoum
2020-09-28 14:45 ` [PATCH v2 10/10] ARM: dts: i.MX6qdl: define BootROM reboot-mode on top of SRC_GPR{9, 10} Ahmad Fatoum
2020-09-29 8:25 ` [PATCH v2 00/10] power: reset: add support for syscon reboot Sascha Hauer
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=20200928144514.14398-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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