summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-08-16 19:50:53 +0200
committerStefan Roese <sr@denx.de>2007-08-16 19:50:53 +0200
commitfc9970137c8f187b5938e4926224e0f3d46c3476 (patch)
tree8d7a004483b1ec71ab7779cab468dece8382d13b /common
parent07bc20560cb9d3d186cca268c05c82762e8c55ad (diff)
parentd35b508a55508535b6e8445b718585d27df733d3 (diff)
downloadu-boot-imx-fc9970137c8f187b5938e4926224e0f3d46c3476.zip
u-boot-imx-fc9970137c8f187b5938e4926224e0f3d46c3476.tar.gz
u-boot-imx-fc9970137c8f187b5938e4926224e0f3d46c3476.tar.bz2
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c11
-rw-r--r--common/cmd_nand.c37
-rw-r--r--common/fdt_support.c1
3 files changed, 42 insertions, 7 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index df1d038..bcb927f 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -932,7 +932,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
* so we flag it to be copied if it is not.
*/
if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
- of_data = of_flat_tree;
+ of_data = (ulong)of_flat_tree;
#endif
/* move of_flat_tree if needed */
@@ -987,6 +987,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
#endif
#endif /* CONFIG_OF_LIBFDT */
#if defined(CONFIG_OF_FLAT_TREE)
+#ifdef CFG_BOOTMAPSZ
+ /*
+ * The blob must be within CFG_BOOTMAPSZ,
+ * so we flag it to be copied if it is not.
+ */
+ if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
+ of_data = (ulong)of_flat_tree;
+#endif
+
/* move of_flat_tree if needed */
if (of_data) {
ulong of_start, of_len;
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index c72612d..254a775 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -468,14 +468,31 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
ulong offset, ulong addr, char *cmd)
{
int r;
- char *ep;
+ char *ep, *s;
ulong cnt;
image_header_t *hdr;
+ int jffs2 = 0;
+
+ s = strchr(cmd, '.');
+ if (s != NULL &&
+ (!strcmp(s, ".jffs2") || !strcmp(s, ".e") || !strcmp(s, ".i")))
+ jffs2 = 1;
printf("\nLoading from %s, offset 0x%lx\n", nand->name, offset);
cnt = nand->oobblock;
- r = nand_read(nand, offset, &cnt, (u_char *) addr);
+ if (jffs2) {
+ nand_read_options_t opts;
+ memset(&opts, 0, sizeof(opts));
+ opts.buffer = (u_char*) addr;
+ opts.length = cnt;
+ opts.offset = offset;
+ opts.quiet = 1;
+ r = nand_read_opts(nand, &opts);
+ } else {
+ r = nand_read(nand, offset, &cnt, (u_char *) addr);
+ }
+
if (r) {
puts("** Read error\n");
show_boot_progress (-56);
@@ -495,8 +512,18 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
print_image_hdr(hdr);
cnt = (ntohl(hdr->ih_size) + sizeof (image_header_t));
+ if (jffs2) {
+ nand_read_options_t opts;
+ memset(&opts, 0, sizeof(opts));
+ opts.buffer = (u_char*) addr;
+ opts.length = cnt;
+ opts.offset = offset;
+ opts.quiet = 1;
+ r = nand_read_opts(nand, &opts);
+ } else {
+ r = nand_read(nand, offset, &cnt, (u_char *) addr);
+ }
- r = nand_read(nand, offset, &cnt, (u_char *) addr);
if (r) {
puts("** Read error\n");
show_boot_progress (-58);
@@ -545,7 +572,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
if (argc > 3)
goto usage;
if (argc == 3)
- addr = simple_strtoul(argv[2], NULL, 16);
+ addr = simple_strtoul(argv[1], NULL, 16);
else
addr = CFG_LOAD_ADDR;
return nand_load_image(cmdtp, &nand_info[dev->id->num],
@@ -604,7 +631,7 @@ usage:
U_BOOT_CMD(nboot, 4, 1, do_nandboot,
"nboot - boot from NAND device\n",
- "[partition] | [[[loadAddr] dev] offset]\n");
+ "[.jffs2] [partition] | [[[loadAddr] dev] offset]\n");
#endif
diff --git a/common/fdt_support.c b/common/fdt_support.c
index caaa682..175d59e 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -46,7 +46,6 @@ struct fdt_header *fdt;
int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
{
- bd_t *bd = gd->bd;
int nodeoffset;
int err;
u32 tmp; /* used to set 32 bit integer properties */