From b9c8ccaba77b24f7a1b4756a927f19dccf895954 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 28 Mar 2014 12:03:34 -0400 Subject: env_mmc.c: Allow environment to be used within SPL Inside of SPL we only concern ourself with one MMC device, so instead of being able to use CONFIG_SYS_MMC_ENV_DEV we need to use 0 in SPL. Switch the code to use a 'dev' variable to facilitate this. Signed-off-by: Tom Rini --- common/env_mmc.c | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/env_mmc.c b/common/env_mmc.c index 045428c..d42168b 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -64,6 +64,14 @@ int env_init(void) static int init_mmc_for_env(struct mmc *mmc) { +#ifdef CONFIG_SYS_MMC_ENV_PART + int dev = CONFIG_SYS_MMC_ENV_DEV; + +#ifdef CONFIG_SPL_BUILD + dev = 0; +#endif +#endif + if (!mmc) { puts("No MMC card found\n"); return -1; @@ -76,8 +84,7 @@ static int init_mmc_for_env(struct mmc *mmc) #ifdef CONFIG_SYS_MMC_ENV_PART if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num) { - if (mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV, - CONFIG_SYS_MMC_ENV_PART)) { + if (mmc_switch_part(dev, CONFIG_SYS_MMC_ENV_PART)) { puts("MMC partition switch failed\n"); return -1; } @@ -90,9 +97,13 @@ static int init_mmc_for_env(struct mmc *mmc) static void fini_mmc_for_env(struct mmc *mmc) { #ifdef CONFIG_SYS_MMC_ENV_PART + int dev = CONFIG_SYS_MMC_ENV_DEV; + +#ifdef CONFIG_SPL_BUILD + dev = 0; +#endif if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num) - mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV, - mmc->part_num); + mmc_switch_part(dev, mmc->part_num); #endif } @@ -174,12 +185,16 @@ static inline int read_env(struct mmc *mmc, unsigned long size, unsigned long offset, const void *buffer) { uint blk_start, blk_cnt, n; + int dev = CONFIG_SYS_MMC_ENV_DEV; + +#ifdef CONFIG_SPL_BUILD + dev = 0; +#endif blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len; blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len; - n = mmc->block_dev.block_read(CONFIG_SYS_MMC_ENV_DEV, blk_start, - blk_cnt, (uchar *)buffer); + n = mmc->block_dev.block_read(dev, blk_start, blk_cnt, (uchar *)buffer); return (n == blk_cnt) ? 0 : -1; } @@ -188,16 +203,23 @@ static inline int read_env(struct mmc *mmc, unsigned long size, void env_relocate_spec(void) { #if !defined(ENV_IS_EMBEDDED) - struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV); + struct mmc *mmc; u32 offset1, offset2; int read1_fail = 0, read2_fail = 0; int crc1_ok = 0, crc2_ok = 0; env_t *ep; int ret; + int dev = CONFIG_SYS_MMC_ENV_DEV; ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1); ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1); +#ifdef CONFIG_SPL_BUILD + dev = 0; +#endif + + mmc = find_mmc_device(dev); + if (tmp_env1 == NULL || tmp_env2 == NULL) { puts("Can't allocate buffers for environment\n"); ret = 1; @@ -274,9 +296,16 @@ void env_relocate_spec(void) { #if !defined(ENV_IS_EMBEDDED) ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); - struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV); + struct mmc *mmc; u32 offset; int ret; + int dev = CONFIG_SYS_MMC_ENV_DEV; + +#ifdef CONFIG_SPL_BUILD + dev = 0; +#endif + + mmc = find_mmc_device(dev); if (init_mmc_for_env(mmc)) { ret = 1; -- cgit v1.1 From 39b924a30465be6cc5ed009b4983cbc8c525e665 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 28 Mar 2014 12:03:35 -0400 Subject: env_mmc.c: Remove NULL check on tmp_env1/2 With 452a272 we moved to allocating these variables on the stack. So they will never now be NULL so remove these checks. Signed-off-by: Tom Rini --- common/env_mmc.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'common') diff --git a/common/env_mmc.c b/common/env_mmc.c index d42168b..f47bd77 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -220,12 +220,6 @@ void env_relocate_spec(void) mmc = find_mmc_device(dev); - if (tmp_env1 == NULL || tmp_env2 == NULL) { - puts("Can't allocate buffers for environment\n"); - ret = 1; - goto err; - } - if (init_mmc_for_env(mmc)) { ret = 1; goto err; -- cgit v1.1 From ae1590ed52256bb3bbb45506c005020075fbe49f Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 28 Mar 2014 12:03:42 -0400 Subject: spl_mmc/CONFIG_SPL_OS_BOOT: Allow environment to determine what to boot We add two new environment variables, falcon_args_file and falcon_image_file, which when set will override the compiled in default values for falcon mode. Signed-off-by: Tom Rini --- common/spl/spl_fat.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'common') diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index 1e532d5..56be943 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -74,11 +74,38 @@ end: int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition) { int err; + __maybe_unused char *file; err = spl_register_fat_device(block_dev, partition); if (err) return err; +#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT) + file = getenv("falcon_args_file"); + if (file) { + err = file_fat_read(file, (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); + if (err <= 0) { + printf("spl: error reading image %s, err - %d, falling back to default\n", + file, err); + goto defaults; + } + file = getenv("falcon_image_file"); + if (file) { + err = spl_load_image_fat(block_dev, partition, file); + if (err != 0) { + puts("spl: falling back to default\n"); + goto defaults; + } + + return 0; + } else + puts("spl: falcon_image_file not set in environment, falling back to default\n"); + } else + puts("spl: falcon_args_file not set in environment, falling back to default\n"); + +defaults: +#endif + err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME, (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); if (err <= 0) { -- cgit v1.1 From 00c200f137b60a04b137e0c7f9097f87ea2ee755 Mon Sep 17 00:00:00 2001 From: Vitaly Andrianov Date: Fri, 4 Apr 2014 13:16:47 -0400 Subject: fdt: call ft_board_setup_ex() at the end of image_setup_libfdt() The keystone2 SOC requires to fix all 32 bit aliased addresses to their 36 physical format. This has to happen after all fdt nodes are added or modified. Signed-off-by: Vitaly Andrianov Signed-off-by: Murali Karicheri Acked-by: Tom Rini --- common/image-fdt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/image-fdt.c b/common/image-fdt.c index a54a919..5d64009 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -487,5 +487,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, if (!ft_verify_fdt(blob)) return -1; +#ifdef CONFIG_SOC_K2HK + if (IMAGE_OF_BOARD_SETUP) + ft_board_setup_ex(blob, gd->bd); +#endif + return 0; } -- cgit v1.1 From bf411ea9f11a757cb3916f3a2e9753f4e0208672 Mon Sep 17 00:00:00 2001 From: "Karicheri, Muralidharan" Date: Fri, 4 Apr 2014 13:16:48 -0400 Subject: tools: mkimage: add support for gpimage format This patch add support for gpimage format as a preparatory patch for porting u-boot for keystone2 devices and is based on omapimage format. It re-uses gph header to store the size and loadaddr as done in omapimage.c Signed-off-by: Vitaly Andrianov Signed-off-by: Murali Karicheri Acked-by: Tom Rini --- common/image.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/image.c b/common/image.c index 9c6bec5..fcc5a9c 100644 --- a/common/image.c +++ b/common/image.c @@ -125,6 +125,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image", }, { IH_TYPE_FIRMWARE, "firmware", "Firmware", }, { IH_TYPE_FLATDT, "flat_dt", "Flat Device Tree", }, + { IH_TYPE_GPIMAGE, "gpimage", "TI Keystone SPL Image",}, { IH_TYPE_KERNEL, "kernel", "Kernel Image", }, { IH_TYPE_KERNEL_NOLOAD, "kernel_noload", "Kernel Image (no loading done)", }, { IH_TYPE_KWBIMAGE, "kwbimage", "Kirkwood Boot Image",}, -- cgit v1.1 From fd37dac9eb37b543fb1b82a733729514a67bd801 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 25 Oct 2013 23:01:31 -0600 Subject: sandbox: Support 'env import' and 'env export' Adjust the code for these commands so that they work on sandbox. Signed-off-by: Simon Glass (Adjusted to fix minor merge comflict, when applied) Change-Id: I987dee6194cd5c83f82604caf894fc85e4eb71a8 --- common/cmd_nvedit.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index c53601c..f4e306c 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -33,6 +33,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -846,7 +847,8 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char buf[32]; - char *addr, *cmd, *res; + ulong addr; + char *ptr, *cmd, *res; size_t size = 0; ssize_t len; env_t *envp; @@ -891,10 +893,11 @@ NXTARG: ; if (argc < 1) return CMD_RET_USAGE; - addr = (char *)simple_strtoul(argv[0], NULL, 16); + addr = simple_strtoul(argv[0], NULL, 16); + ptr = map_sysmem(addr, size); if (size) - memset(addr, '\0', size); + memset(ptr, '\0', size); argc--; argv++; @@ -902,7 +905,7 @@ NXTARG: ; if (sep) { /* export as text file */ len = hexport_r(&env_htab, sep, H_MATCH_KEY | H_MATCH_IDENT, - &addr, size, argc, argv); + &ptr, size, argc, argv); if (len < 0) { error("Cannot export environment: errno = %d\n", errno); return 1; @@ -913,12 +916,12 @@ NXTARG: ; return 0; } - envp = (env_t *)addr; + envp = (env_t *)ptr; if (chk) /* export as checksum protected block */ res = (char *)envp->data; else /* export as raw binary data */ - res = addr; + res = ptr; len = hexport_r(&env_htab, '\0', H_MATCH_KEY | H_MATCH_IDENT, @@ -960,7 +963,8 @@ sep_err: static int do_env_import(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - char *cmd, *addr; + ulong addr; + char *cmd, *ptr; char sep = '\n'; int chk = 0; int fmt = 0; @@ -1004,7 +1008,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, if (!fmt) printf("## Warning: defaulting to text format\n"); - addr = (char *)simple_strtoul(argv[0], NULL, 16); + addr = simple_strtoul(argv[0], NULL, 16); + ptr = map_sysmem(addr, 0); if (argc == 2) { size = simple_strtoul(argv[1], NULL, 16); @@ -1012,7 +1017,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, puts("## Error: external checksum format must pass size\n"); return CMD_RET_FAILURE; } else { - char *s = addr; + char *s = ptr; size = 0; @@ -1032,7 +1037,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, if (chk) { uint32_t crc; - env_t *ep = (env_t *)addr; + env_t *ep = (env_t *)ptr; size -= offsetof(env_t, data); memcpy(&crc, &ep->crc, sizeof(crc)); @@ -1041,11 +1046,11 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, puts("## Error: bad CRC, import failed\n"); return 1; } - addr = (char *)ep->data; + ptr = (char *)ep->data; } - if (himport_r(&env_htab, addr, size, sep, del ? 0 : H_NOCLEAR, - 0, NULL) == 0) { + if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, 0, + NULL) == 0) { error("Environment import failed: errno = %d\n", errno); return 1; } -- cgit v1.1 From 1992dbfdb9886c3dfc4a505091895c851f736f3a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 25 Oct 2013 23:01:32 -0600 Subject: Make 'run' use run_command_list() instead of run_command() In the case where an environment variable spans multiple lines, we should use run_command_list() so that all lines are executed. This shold be backwards compatible with existing behaviour for existing scripts. Signed-off-by: Simon Glass --- common/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/main.c b/common/main.c index e54f63b..9bee7bd 100644 --- a/common/main.c +++ b/common/main.c @@ -1550,7 +1550,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) return 1; } - if (run_command(arg, flag) != 0) + if (run_command_list(arg, -1, flag) != 0) return 1; } return 0; -- cgit v1.1 From 8e2615752ee6d5daf8ce2e1e599a0512750f24b9 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 4 Apr 2014 20:09:58 +0900 Subject: bd_info: remove bi_barudrate member from struct bd_info gd->bd->bi_baudrate is a copy of gd->baudrate. Since baudrate is a common feature for all architectures, keep gd->baudrate only. It is true that bi_baudrate was passed to the kernel in that structure but it was a long time ago. Signed-off-by: Masahiro Yamada Cc: Tom Rini Cc: Simon Glass Cc: Wolfgang Denk Cc: Heiko Schocher Acked-by: Michal Simek (For microblaze) --- common/board_f.c | 9 --------- common/cmd_bdinfo.c | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 23 deletions(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index cbdf06f..aea6bff 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -708,14 +708,6 @@ static int init_post(void) } #endif -static int setup_baud_rate(void) -{ - /* Ick, can we get rid of this line? */ - gd->bd->bi_baudrate = gd->baudrate; - - return 0; -} - static int setup_dram_config(void) { /* Ram is board specific, so move it to board code ... */ @@ -954,7 +946,6 @@ static init_fnc_t init_sequence_f[] = { INIT_FUNC_WATCHDOG_RESET setup_board_part2, #endif - setup_baud_rate, display_new_sp, #ifdef CONFIG_SYS_EXTBDINFO setup_board_extra, diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 238cadb..f283a16 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -148,7 +148,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_mhz("ethspeed", bd->bi_ethspeed); #endif printf("IP addr = %s\n", getenv("ipaddr")); - printf("baudrate = %6u bps\n", bd->bi_baudrate); + printf("baudrate = %6u bps\n", gd->baudrate); print_num("relocaddr", gd->relocaddr); board_detail(); return 0; @@ -176,7 +176,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -198,7 +198,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_CMD_NET) print_eths(); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -231,7 +231,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %6u bps\n", bd->bi_baudrate); + printf("baudrate = %6u bps\n", gd->baudrate); return 0; } @@ -277,7 +277,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -304,7 +304,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -324,7 +324,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -344,7 +344,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -368,7 +368,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_CMD_NET) print_eths(); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) print_num("TLB addr", gd->arch.tlb_addr); #endif @@ -406,7 +406,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -440,7 +440,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); print_mhz("ethspeed", bd->bi_ethspeed); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -490,7 +490,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -512,7 +512,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %u bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", gd->baudrate); return 0; } @@ -530,7 +530,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %d bps\n", gd->baudrate); return 0; } -- cgit v1.1 From 1d64377177d802436329d54b69183a9ca0d33247 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 18 Apr 2014 17:46:13 +0900 Subject: cmd_time: do not show ticks The command "time" shows the execution time of the command given to the argument, like this: time: 45.293 seconds, 45293 ticks Since we adopted CONFIG_SYS_HZ = 1000 for all boards, we always have a simple formula: "1 tick = 0.0001 second". Showing ticks looks almost redundant. Signed-off-by: Masahiro Yamada --- common/cmd_time.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_time.c b/common/cmd_time.c index 5180cb4..de57e3b 100644 --- a/common/cmd_time.c +++ b/common/cmd_time.c @@ -21,8 +21,7 @@ static void report_time(ulong cycles) printf("\ntime:"); if (minutes) printf(" %lu minutes,", minutes); - printf(" %lu.%03lu seconds, %lu ticks\n", - seconds, milliseconds, cycles); + printf(" %lu.%03lu seconds\n", seconds, milliseconds); } static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -- cgit v1.1 From 5c50a92bbea7e118ea4e4fb0945bf6707b010a80 Mon Sep 17 00:00:00 2001 From: Kristian Otnes Date: Fri, 25 Apr 2014 15:35:43 +0200 Subject: hush shell: Avoid string write overflow when entering max cmd length console_buffer array is defined to be CONFIG_SYS_CBSIZE + 1 long, whereas the_command array only CONFIG_SYS_CBSIZE long. Subsequent use of strcpy(the_command, console_buffer) will write final \0 terminating byte outside the_command array when entering a command of max length. Signed-off-by: Kristian Otnes cisco com> --- common/hush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/hush.c b/common/hush.c index df10267..5b43224 100644 --- a/common/hush.c +++ b/common/hush.c @@ -996,7 +996,7 @@ static void get_user_input(struct in_str *i) i->p = the_command; #else int n; - static char the_command[CONFIG_SYS_CBSIZE]; + static char the_command[CONFIG_SYS_CBSIZE + 1]; #ifdef CONFIG_BOOT_RETRY_TIME # ifndef CONFIG_RESET_TO_RETRY -- cgit v1.1 From 717ccc1d7f77b4d1177c098749adc07205a22fa1 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 1 May 2014 10:01:08 -0400 Subject: cmd_bootm.c: Only say XIP image when load is image_start We say we have an XIP (in this case, image loaded at desired execution address) when the image header has been offset in the load. It's possible that in some cases executing the header is non-fatal but that's not true in many other cases. Signed-off-by: Tom Rini --- common/cmd_bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index c243a5b..e683af3 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -388,7 +388,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end, image_buf = map_sysmem(image_start, image_len); switch (comp) { case IH_COMP_NONE: - if (load == blob_start || load == image_start) { + if (load == image_start) { printf(" XIP %s ... ", type_name); no_overlap = 1; } else { -- cgit v1.1 From 2a1680e30e3fa8257b60cb9dbd7add32539ac470 Mon Sep 17 00:00:00 2001 From: York Sun Date: Fri, 2 May 2014 17:28:04 -0700 Subject: common/board_f: Initialized global data for generic board Some platforms (tested on mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). The data should not be cleared later. Any arch which uses global data in generic board board_init_f() should define CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: York Sun CC: Scott Wood CC: Simon Glass CC: Albert ARIBAUD Acked-by: Simon Glass --- common/board_f.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index aea6bff..b6be386 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -961,20 +961,22 @@ static init_fnc_t init_sequence_f[] = { void board_init_f(ulong boot_flags) { -#ifndef CONFIG_X86 +#ifdef CONFIG_SYS_GENERIC_GLOBAL_DATA + /* + * For some archtectures, global data is initialized and used before + * calling this function. The data should be preserved. For others, + * CONFIG_SYS_GENERIC_GLOBAL_DATA should be defined and use the stack + * here to host global data until relocation. + */ gd_t data; gd = &data; -#endif /* * Clear global data before it is accessed at debug print * in initcall_run_list. Otherwise the debug print probably * get the wrong vaule of gd->have_console. */ -#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ - !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ - !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) zero_global_data(); #endif -- cgit v1.1 From fa39ffe5d61bd7f34b2ff579f5f6bb8f92a6b9b1 Mon Sep 17 00:00:00 2001 From: York Sun Date: Fri, 2 May 2014 17:28:05 -0700 Subject: common/board_f: Fix size variable DRAM size should use 64-bit variable when the size could be more than 4GB. Caught and verified on P4080DS with 4GB DDR. Signed-off-by: York Sun Acked-by: Simon Glass --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index b6be386..4ea4cb2 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -194,7 +194,7 @@ static int init_func_ram(void) static int show_dram_config(void) { - ulong size; + unsigned long long size; #ifdef CONFIG_NR_DRAM_BANKS int i; -- cgit v1.1