From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 10/10] ARM: dts: i.MX6qdl: define BootROM reboot-mode on top of SRC_GPR{9, 10}
Date: Wed, 16 Sep 2020 15:50:35 +0200 [thread overview]
Message-ID: <20200916135035.7089-11-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200916135035.7089-1-a.fatoum@pengutronix.de>
The SRC general purpose registers of the i.MX6 keep their values after a
warm reset and are used for communication between the BootROM and upper
level software.
SRC_GPR9 allows software override of SRC_SBMR1, e.g. to boot via
serial download protocol. Define a suitable syscon-reboot-mode
node to use it.
To have SRC_GPR9 take effect, bit 28 in SRC_GPR10 has to be set as well.
To support this, we use the backward-compatible barebox-specific binding
for having multiple 32-bit values for a single mode.
This node will _not_ be fixed up into the kernel device tree due to
the barebox-specific compatible, but as with all reboot mode storage,
the referenced locations will be cleared to the normal (here all-zero)
mode. User software that expects exclusive access to GPR9 while GPR10
bit 28 is zero will be broken.
Rebooting into serial download is now possible via:
barebox@board:/ gpr.reboot_mode.next=serial reset
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/dts/imx6qdl.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/dts/imx6qdl.dtsi b/arch/arm/dts/imx6qdl.dtsi
index 828be9ce0dbb..c3e02d2117b3 100644
--- a/arch/arm/dts/imx6qdl.dtsi
+++ b/arch/arm/dts/imx6qdl.dtsi
@@ -6,5 +6,26 @@
pwm2 = &pwm3;
pwm3 = &pwm4;
ipu0 = &ipu1;
+ gpr.reboot_mode = &reboot_mode_gpr;
+ };
+};
+
+&src {
+ compatible = "fsl,imx6q-src", "fsl,imx51-src", "syscon", "simple-mfd";
+
+ reboot_mode_gpr: reboot-mode {
+ compatible = "barebox,syscon-reboot-mode";
+ offset = <0x40>, <0x44>; /* SRC_GPR{9,10} */
+ mask = <0xffffffff>, <0x10000000>;
+ mode-normal = <0>, <0>;
+ mode-serial = <0x00000010>, <0x10000000>;
+ mode-spi0-0 = <0x08000030>, <0x10000000>;
+ mode-spi0-1 = <0x18000030>, <0x10000000>;
+ mode-spi0-2 = <0x28000030>, <0x10000000>;
+ mode-spi0-3 = <0x38000030>, <0x10000000>;
+ mode-mmc0 = <0x00002040>, <0x10000000>;
+ mode-mmc1 = <0x00002840>, <0x10000000>;
+ mode-mmc2 = <0x00003040>, <0x10000000>;
+ mode-mmc3 = <0x00003840>, <0x10000000>;
};
};
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2020-09-16 13:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ahmad Fatoum [this message]
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=20200916135035.7089-11-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