u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board
@ 2021-09-11 22:39 Marek Vasut
  2021-09-11 22:39 ` [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build " Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Marek Vasut @ 2021-09-11 22:39 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Stefano Babic

The board can do primary/secondary boot switching, enable the bmode command.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 board/menlo/m53menlo/m53menlo.c | 5 +++++
 configs/m53menlo_defconfig      | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index 2b331b32df5..9545e633a3d 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -17,6 +17,7 @@
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
+#include <asm/mach-imx/boot_mode.h>
 #include <asm/mach-imx/mx5_video.h>
 #include <asm/mach-imx/video.h>
 #include <asm/gpio.h>
@@ -334,6 +335,10 @@ int splash_screen_prepare(void)
 
 int board_late_init(void)
 {
+#ifdef CONFIG_CMD_BMODE
+	add_board_boot_modes(NULL);
+#endif
+
 #if defined(CONFIG_VIDEO_IPUV3)
 	struct udevice *dev;
 	int xpos, ypos, ret;
diff --git a/configs/m53menlo_defconfig b/configs/m53menlo_defconfig
index 505dd078b0c..97605b2711b 100644
--- a/configs/m53menlo_defconfig
+++ b/configs/m53menlo_defconfig
@@ -18,7 +18,6 @@ CONFIG_SYS_BOOTCOUNT_ADDR=0x53FA401C
 CONFIG_SPL=y
 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
 CONFIG_ENV_OFFSET_REDUND=0x180000
-# CONFIG_CMD_BMODE is not set
 CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/menlo/m53menlo/imximage.cfg"
-- 
2.33.0


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

* [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build on MX53 Menlo board
  2021-09-11 22:39 [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board Marek Vasut
@ 2021-09-11 22:39 ` Marek Vasut
  2021-10-20 12:20   ` sbabic
  2021-09-11 22:40 ` [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo Marek Vasut
  2021-10-20 12:20 ` [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board sbabic
  2 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2021-09-11 22:39 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Stefano Babic

Build U-Boot in Thumb2 mode for M53Menlo board, this makes better
use of the CPU since the instruction density is higher.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 configs/m53menlo_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/m53menlo_defconfig b/configs/m53menlo_defconfig
index 97605b2711b..0656cd86816 100644
--- a/configs/m53menlo_defconfig
+++ b/configs/m53menlo_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_MX5=y
 CONFIG_SYS_TEXT_BASE=0x71000000
 CONFIG_SPL_GPIO=y
-- 
2.33.0


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

* [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo
  2021-09-11 22:39 [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board Marek Vasut
  2021-09-11 22:39 ` [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build " Marek Vasut
@ 2021-09-11 22:40 ` Marek Vasut
  2021-10-20 12:21   ` sbabic
  2021-10-20 12:20 ` [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board sbabic
  2 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2021-09-11 22:40 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Stefano Babic

Bulletproof the default boot command with reset statements in case
any command in the chain would fail. In case a failure were to happen,
the board will reset, increment boot counter and retry the procedure.
In case the failures persist and the boot counter reaches the bootlimit,
U-Boot starts altbootcmd instead of the default bootcmd boot command.

The altbootcmd swaps the default boot partition for the other boot
partition, which is an identical copy or an older copy, and tries
booting from that one instead.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 include/configs/m53menlo.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index bd117daf063..9bec05bf0bd 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -184,6 +184,13 @@
 	"splashfile=boot/usplash.bmp.gz\0"				\
 	"splashimage=0x88000000\0"					\
 	"splashpos=m,m\0"						\
+	"altbootcmd="							\
+		"if test ${mmcpart} -eq 1 ; then "			\
+			"setenv mmcpart 2 ; "				\
+		"else "							\
+			"setenv mmcpart 1 ; "				\
+		"fi ; "							\
+		"boot\0"						\
 	"stdout=serial,vidconsole\0"					\
 	"stderr=serial,vidconsole\0"					\
 	"addcons="							\
@@ -198,14 +205,14 @@
 		"setenv bootargs ${bootargs} ${miscargs}\0"		\
 	"addargs=run addcons addmisc addmtd\0"				\
 	"mmcload="							\
-		"mmc rescan ; load mmc ${mmcdev}:${mmcpart} "		\
-		"${kernel_addr_r} ${bootfile}\0"			\
+		"mmc rescan || reset ; load mmc ${mmcdev}:${mmcpart} "	\
+		"${kernel_addr_r} ${bootfile} || reset\0"		\
 	"miscargs=nohlt panic=1\0"					\
 	"mmcargs=setenv bootargs root=/dev/mmcblk0p${mmcpart} rw "	\
 		"rootwait\0"						\
 	"mmc_mmc="							\
-		"run mmcload mmcargs addargs ; "			\
-		"bootm ${kernel_addr_r}\0"				\
+		"run mmcload mmcargs addargs || reset ; "		\
+		"bootm ${kernel_addr_r} ; reset\0"			\
 	"netload=tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"	\
 	"net_nfs="							\
 		"run netload nfsargs addip addargs ; "			\
-- 
2.33.0


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

* [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board
  2021-09-11 22:39 [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board Marek Vasut
  2021-09-11 22:39 ` [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build " Marek Vasut
  2021-09-11 22:40 ` [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo Marek Vasut
@ 2021-10-20 12:20 ` sbabic
  2 siblings, 0 replies; 6+ messages in thread
From: sbabic @ 2021-10-20 12:20 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> The board can do primary/secondary boot switching, enable the bmode command.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

* [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build on MX53 Menlo board
  2021-09-11 22:39 ` [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build " Marek Vasut
@ 2021-10-20 12:20   ` sbabic
  0 siblings, 0 replies; 6+ messages in thread
From: sbabic @ 2021-10-20 12:20 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> Build U-Boot in Thumb2 mode for M53Menlo board, this makes better
> use of the CPU since the instruction density is higher.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

* [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo
  2021-09-11 22:40 ` [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo Marek Vasut
@ 2021-10-20 12:21   ` sbabic
  0 siblings, 0 replies; 6+ messages in thread
From: sbabic @ 2021-10-20 12:21 UTC (permalink / raw)
  To: Marek Vasut, u-boot

> Bulletproof the default boot command with reset statements in case
> any command in the chain would fail. In case a failure were to happen,
> the board will reset, increment boot counter and retry the procedure.
> In case the failures persist and the boot counter reaches the bootlimit,
> U-Boot starts altbootcmd instead of the default bootcmd boot command.
> The altbootcmd swaps the default boot partition for the other boot
> partition, which is an identical copy or an older copy, and tries
> booting from that one instead.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

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

end of thread, other threads:[~2021-10-20 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 22:39 [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board Marek Vasut
2021-09-11 22:39 ` [PATCH 2/3] ARM: imx: mx5: Enable Thumb2 build " Marek Vasut
2021-10-20 12:20   ` sbabic
2021-09-11 22:40 ` [PATCH 3/3] ARM: imx: mx5: Add altbootcmd and resets to M53Menlo Marek Vasut
2021-10-20 12:21   ` sbabic
2021-10-20 12:20 ` [PATCH 1/3] ARM: imx: mx5: Enable BMODE command on MX53 Menlo board sbabic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).