summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/bootm_os.c39
-rw-r--r--common/spl/Kconfig6
-rw-r--r--common/spl/spl_ymodem.c8
3 files changed, 46 insertions, 7 deletions
diff --git a/common/bootm_os.c b/common/bootm_os.c
index de0709f8ba0..d89ddc32b0d 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -319,8 +319,8 @@ static void do_bootvx_fdt(bootm_headers_t *images)
puts("## vxWorks terminated\n");
}
-int do_bootm_vxworks(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[],
+ bootm_headers_t *images)
{
if (flag != BOOTM_STATE_OS_GO)
return 0;
@@ -336,6 +336,41 @@ int do_bootm_vxworks(int flag, int argc, char * const argv[],
return 1;
}
+
+int do_bootm_vxworks(int flag, int argc, char * const argv[],
+ bootm_headers_t *images)
+{
+ char *bootargs;
+ int pos;
+ unsigned long vxflags;
+ bool std_dtb = false;
+
+ /* get bootargs env */
+ bootargs = env_get("bootargs");
+
+ if (bootargs != NULL) {
+ for (pos = 0; pos < strlen(bootargs); pos++) {
+ /* find f=0xnumber flag */
+ if ((bootargs[pos] == '=') && (pos >= 1) &&
+ (bootargs[pos - 1] == 'f')) {
+ vxflags = simple_strtoul(&bootargs[pos + 1],
+ NULL, 16);
+ if (vxflags & VXWORKS_SYSFLG_STD_DTB)
+ std_dtb = true;
+ }
+ }
+ }
+
+ if (std_dtb) {
+ if (flag & BOOTM_STATE_OS_PREP)
+ printf(" Using standard DTB\n");
+ return do_bootm_linux(flag, argc, argv, images);
+ } else {
+ if (flag & BOOTM_STATE_OS_PREP)
+ printf(" !!! WARNING !!! Using legacy DTB\n");
+ return do_bootm_vxworks_legacy(flag, argc, argv, images);
+ }
+}
#endif
#if defined(CONFIG_CMD_ELF)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 1f122833a77..e11faae9ee4 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -268,7 +268,7 @@ config SPL_BANNER_PRINT
default y
help
If this option is enabled, SPL will print the banner with version
- info. Disabling this option could be useful to reduce TPL boot time
+ info. Disabling this option could be useful to reduce SPL boot time
(e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
config TPL_BANNER_PRINT
@@ -276,8 +276,8 @@ config TPL_BANNER_PRINT
depends on TPL
default y
help
- If this option is enabled, SPL will not print the banner with version
- info. Disabling this option could be useful to reduce SPL boot time
+ If this option is enabled, TPL will print the banner with version
+ info. Disabling this option could be useful to reduce TPL boot time
(e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud).
config SPL_EARLY_BSS
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index c02c05624d4..8500ee8ba5d 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -37,7 +37,7 @@ static int getcymodem(void) {
static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset,
ulong size, void *addr)
{
- int res, err;
+ int res, err, buf_offset;
struct ymodem_fit_info *info = load->priv;
char *buf = info->buf;
@@ -51,7 +51,11 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset,
if (info->image_read > offset) {
res = info->image_read - offset;
- memcpy(addr, &buf[BUF_SIZE - res], res);
+ if (info->image_read % BUF_SIZE)
+ buf_offset = (info->image_read % BUF_SIZE);
+ else
+ buf_offset = BUF_SIZE;
+ memcpy(addr, &buf[buf_offset - res], res);
addr = addr + res;
}