From bdde03ece9ba29e381aa2f9dcd1bf7b6e62ebb37 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 3 Aug 2021 18:59:37 +0200 Subject: ARM: i.MX8MM: add reboot to serial download mode The i.MX8MM reference manual follows long established tradition in not documenting BootROM magic reboot codes. For older i.MX variants, the values can be seen in the bmode tables of Freescale's U-Boot patches. There are no such patches for the i.MX8M, but testing shows that mw 0x30390094 0x10 ; mw 0x30390098 0x40000000 is one of the configurations that trigger serial download on next warm reset on an i.MX8MM. Describe this in the device tree, so gpr.reboot_mode.next=serial reset -r imxwd-warm does the right thing for that SoC. This all might work for other i.MX8M variants as well, but the dtsi can be genericized later on when tested. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20210803165937.31608-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- arch/arm/dts/imx8mm-evk.dts | 1 + arch/arm/dts/imx8mm-prt8mm.dts | 1 + arch/arm/dts/imx8mm.dtsi | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 arch/arm/dts/imx8mm.dtsi (limited to 'arch/arm/dts') diff --git a/arch/arm/dts/imx8mm-evk.dts b/arch/arm/dts/imx8mm-evk.dts index 1e8619ccf5..304f150307 100644 --- a/arch/arm/dts/imx8mm-evk.dts +++ b/arch/arm/dts/imx8mm-evk.dts @@ -7,6 +7,7 @@ /dts-v1/; #include +#include "imx8mm.dtsi" / { chosen { diff --git a/arch/arm/dts/imx8mm-prt8mm.dts b/arch/arm/dts/imx8mm-prt8mm.dts index bdcdd08062..abd758f285 100644 --- a/arch/arm/dts/imx8mm-prt8mm.dts +++ b/arch/arm/dts/imx8mm-prt8mm.dts @@ -7,6 +7,7 @@ /dts-v1/; #include +#include "imx8mm.dtsi" / { model = "Protonic PRT8MM"; diff --git a/arch/arm/dts/imx8mm.dtsi b/arch/arm/dts/imx8mm.dtsi new file mode 100644 index 0000000000..78bbacb2b1 --- /dev/null +++ b/arch/arm/dts/imx8mm.dtsi @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/ { + aliases { + gpr.reboot_mode = &reboot_mode_gpr; + }; +}; + +&src { + compatible = "fsl,imx8mm-src", "fsl,imx8mq-src", "syscon", "simple-mfd"; + + reboot_mode_gpr: reboot-mode { + compatible = "barebox,syscon-reboot-mode"; + offset = <0x94>, <0x98>; /* SRC_GPR{9,10} */ + mask = <0xffffffff>, <0x40000000>; + mode-normal = <0>, <0>; + mode-serial = <0x00000010>, <0x40000000>; + }; +}; -- cgit v1.2.3