boothang: Reset the board when we can't boot from anything
Additionally enables debugging output from
mmc_load_image_raw_sector.
Change-Id: I278ae63a71ce67712fe6fc916250ce3bc9a91aed
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 766fb3d..aad1898 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -314,7 +314,16 @@
if (boot_from_devices(&spl_image, spl_boot_list,
ARRAY_SIZE(spl_boot_list))) {
puts("SPL: failed to boot from all boot devices\n");
- hang();
+ puts ("resetting ...\n");
+
+ udelay (50000); /* wait 50 ms */
+ disable_interrupts();
+
+ reset_misc();
+ reset_cpu(0);
+
+ /*NOTREACHED*/
+ return 0;
}
switch (spl_image.os) {
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 18c1b59..49d56fa 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -64,7 +64,7 @@
/* read image header to find the image size & load address */
count = blk_dread(mmc_get_blk_desc(mmc), sector, 1, header);
- debug("hdr read sector %lx, count=%lu\n", sector, count);
+ printf("hdr read sector %lx, count=%lu\n", sector, count);
if (count == 0) {
ret = -EIO;
goto end;