Skip to content

Commit 1d58c47

Browse files
Avinash95francois-berder
authored andcommitted
pistachio: reset board on failure
failure cases include: 1. kernel not found 2. dtb not found 3. bootm command fails 4. rootfs mount fails it only works for dualnandboot. Change-Id: I66179672cf69e04d52bc6a484678a3583a86e79c Signed-off-by: Avinash Tahakik <[email protected]>
1 parent cc2005d commit 1d58c47

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

include/configs/pistachio_bub.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@
226226
#define CONFIG_ENV_SPI_BUS 1
227227
#define CONFIG_ENV_SPI_CS 0
228228

229+
#define UPGRADE_CHECK_RESET \
230+
"if test ${attempt_upgrade} -eq 1; then " \
231+
"reset; " \
232+
"fi;"
229233
#define USB_BOOTCOMMAND \
230234
"sf probe 1:0;" \
231235
"mtdparts default;" \
@@ -270,10 +274,14 @@
270274
"setenv bootargs $console $earlycon $nandroot $bootextra $mtdparts panic=2;" \
271275
"setenv verify n;" \
272276
"ubi part firmware${boot_partition};" \
273-
"ubifsmount ubi:rootfs;" \
274-
"ubifsload $loadaddr $bootdir$bootfile;" \
275-
"ubifsload $fdtaddr $bootdir$fdtfile;" \
276-
"bootm $loadaddr - $fdtaddr;"
277+
"setenv ubifs_bootm_cmd \"ubifsmount ubi:rootfs && " \
278+
"ubifsload $loadaddr $bootdir$bootfile && " \
279+
"ubifsload $fdtaddr $bootdir$fdtfile && " \
280+
"bootm $loadaddr - $fdtaddr\";" \
281+
"run ubifs_bootm_cmd"
282+
283+
#define DUAL_NAND_BOOTCOMMAND_RESET \
284+
DUAL_NAND_BOOTCOMMAND " || " UPGRADE_CHECK_RESET
277285

278286
#ifdef CONFIG_BOOTCOUNT_LIMIT
279287

@@ -329,7 +337,7 @@
329337

330338
#else
331339

332-
#define CONFIG_BOOTCOMMAND DUAL_NAND_BOOTCOMMAND
340+
#define CONFIG_BOOTCOMMAND DUAL_NAND_BOOTCOMMAND_RESET
333341

334342
#endif
335343

@@ -355,7 +363,7 @@
355363
"nandboot="NAND_BOOTCOMMAND"\0" \
356364
"ethboot="ETH_BOOTCOMMAND"\0" \
357365
"netboot="NET_BOOTCOMMAND"\0" \
358-
"dualnandboot="DUAL_NAND_BOOTCOMMAND"\0" \
366+
"dualnandboot="DUAL_NAND_BOOTCOMMAND_RESET"\0" \
359367
BOOTCOUNT_VARIABLES \
360368
"u_memload=0x00800000\0" \
361369
"u_memsize=0x08000000\0" \

0 commit comments

Comments
 (0)