aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/xilinx/zynqmp/zynqmp.c71
1 files changed, 36 insertions, 35 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 309f24a5f43..0b6d4e57078 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -391,7 +391,7 @@ int board_late_init(void)
int bootseq = -1;
int bootseq_len = 0;
int env_targets_len = 0;
- const char *mode;
+ const char *mode = NULL;
char *new_targets;
char *env_targets;
int ret, multiboot;
@@ -442,8 +442,8 @@ int board_late_init(void)
"mmc@ff160000", &dev) &&
uclass_get_device_by_name(UCLASS_MMC,
"sdhci@ff160000", &dev)) {
- puts("Boot from EMMC but without SD0 enabled!\n");
- return -1;
+ debug("SD0 driver for SD0 device is not present\n");
+ break;
}
debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
@@ -457,8 +457,8 @@ int board_late_init(void)
"mmc@ff160000", &dev) &&
uclass_get_device_by_name(UCLASS_MMC,
"sdhci@ff160000", &dev)) {
- puts("Boot from SD0 but without SD0 enabled!\n");
- return -1;
+ debug("SD0 driver for SD0 device is not present\n");
+ break;
}
debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
@@ -475,8 +475,8 @@ int board_late_init(void)
"mmc@ff170000", &dev) &&
uclass_get_device_by_name(UCLASS_MMC,
"sdhci@ff170000", &dev)) {
- puts("Boot from SD1 but without SD1 enabled!\n");
- return -1;
+ debug("SD1 driver for SD1 device is not present\n");
+ break;
}
debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev));
@@ -490,39 +490,40 @@ int board_late_init(void)
env_set("modeboot", "nandboot");
break;
default:
- mode = "";
printf("Invalid Boot Mode:0x%x\n", bootmode);
break;
}
- if (bootseq >= 0) {
- bootseq_len = snprintf(NULL, 0, "%i", bootseq);
- debug("Bootseq len: %x\n", bootseq_len);
- env_set_hex("bootseq", bootseq);
- }
+ if (mode) {
+ if (bootseq >= 0) {
+ bootseq_len = snprintf(NULL, 0, "%i", bootseq);
+ debug("Bootseq len: %x\n", bootseq_len);
+ env_set_hex("bootseq", bootseq);
+ }
- /*
- * One terminating char + one byte for space between mode
- * and default boot_targets
- */
- env_targets = env_get("boot_targets");
- if (env_targets)
- env_targets_len = strlen(env_targets);
-
- new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
- bootseq_len);
- if (!new_targets)
- return -ENOMEM;
-
- if (bootseq >= 0)
- sprintf(new_targets, "%s%x %s", mode, bootseq,
- env_targets ? env_targets : "");
- else
- sprintf(new_targets, "%s %s", mode,
- env_targets ? env_targets : "");
-
- env_set("boot_targets", new_targets);
- free(new_targets);
+ /*
+ * One terminating char + one byte for space between mode
+ * and default boot_targets
+ */
+ env_targets = env_get("boot_targets");
+ if (env_targets)
+ env_targets_len = strlen(env_targets);
+
+ new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
+ bootseq_len);
+ if (!new_targets)
+ return -ENOMEM;
+
+ if (bootseq >= 0)
+ sprintf(new_targets, "%s%x %s", mode, bootseq,
+ env_targets ? env_targets : "");
+ else
+ sprintf(new_targets, "%s %s", mode,
+ env_targets ? env_targets : "");
+
+ env_set("boot_targets", new_targets);
+ free(new_targets);
+ }
reset_reason();