projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common/Kconfig: Change the default BOOTDELAY to 2
[oweals/u-boot.git]
/
cmd
/
bootm.c
diff --git
a/cmd/bootm.c
b/cmd/bootm.c
index 555ccbc379f01697460981b0a00984e7c12e92b0..f5e91f40a9bf0a2a167d52ab7a215fbbd6b7ab23 100644
(file)
--- a/
cmd/bootm.c
+++ b/
cmd/bootm.c
@@
-372,8
+372,8
@@
next_bank: ;
#endif
#if defined(CONFIG_CMD_IMLS_NAND)
#endif
#if defined(CONFIG_CMD_IMLS_NAND)
-static int nand_imls_legacyimage(
nand_info_t *nand, int nand_dev, loff_t off
,
- size_t len)
+static int nand_imls_legacyimage(
struct mtd_info *mtd, int nand_dev
,
+
loff_t off,
size_t len)
{
void *imgdata;
int ret;
{
void *imgdata;
int ret;
@@
-386,8
+386,7
@@
static int nand_imls_legacyimage(nand_info_t *nand, int nand_dev, loff_t off,
return -ENOMEM;
}
return -ENOMEM;
}
- ret = nand_read_skip_bad(nand, off, &len,
- imgdata);
+ ret = nand_read_skip_bad(mtd, off, &len, imgdata);
if (ret < 0 && ret != -EUCLEAN) {
free(imgdata);
return ret;
if (ret < 0 && ret != -EUCLEAN) {
free(imgdata);
return ret;
@@
-413,8
+412,8
@@
static int nand_imls_legacyimage(nand_info_t *nand, int nand_dev, loff_t off,
return 0;
}
return 0;
}
-static int nand_imls_fitimage(
nand_info_t *nan
d, int nand_dev, loff_t off,
- size_t len)
+static int nand_imls_fitimage(
struct mtd_info *mt
d, int nand_dev, loff_t off,
+
size_t len)
{
void *imgdata;
int ret;
{
void *imgdata;
int ret;
@@
-427,8
+426,7
@@
static int nand_imls_fitimage(nand_info_t *nand, int nand_dev, loff_t off,
return -ENOMEM;
}
return -ENOMEM;
}
- ret = nand_read_skip_bad(nand, off, &len,
- imgdata);
+ ret = nand_read_skip_bad(mtd, off, &len, imgdata);
if (ret < 0 && ret != -EUCLEAN) {
free(imgdata);
return ret;
if (ret < 0 && ret != -EUCLEAN) {
free(imgdata);
return ret;
@@
-449,7
+447,7
@@
static int nand_imls_fitimage(nand_info_t *nand, int nand_dev, loff_t off,
static int do_imls_nand(void)
{
static int do_imls_nand(void)
{
-
nand_info_t *nan
d;
+
struct mtd_info *mt
d;
int nand_dev = nand_curr_device;
size_t len;
loff_t off;
int nand_dev = nand_curr_device;
size_t len;
loff_t off;
@@
-463,20
+461,20
@@
static int do_imls_nand(void)
printf("\n");
for (nand_dev = 0; nand_dev < CONFIG_SYS_MAX_NAND_DEVICE; nand_dev++) {
printf("\n");
for (nand_dev = 0; nand_dev < CONFIG_SYS_MAX_NAND_DEVICE; nand_dev++) {
-
nand = &
nand_info[nand_dev];
- if (!
nand->name || !nan
d->size)
+
mtd =
nand_info[nand_dev];
+ if (!
mtd->name || !mt
d->size)
continue;
continue;
- for (off = 0; off <
nand->size; off += nan
d->erasesize) {
+ for (off = 0; off <
mtd->size; off += mt
d->erasesize) {
const image_header_t *header;
int ret;
const image_header_t *header;
int ret;
- if (nand_block_isbad(
nan
d, off))
+ if (nand_block_isbad(
mt
d, off))
continue;
len = sizeof(buffer);
continue;
len = sizeof(buffer);
- ret = nand_read(
nan
d, off, &len, (u8 *)buffer);
+ ret = nand_read(
mt
d, off, &len, (u8 *)buffer);
if (ret < 0 && ret != -EUCLEAN) {
printf("NAND read error %d at offset %08llX\n",
ret, off);
if (ret < 0 && ret != -EUCLEAN) {
printf("NAND read error %d at offset %08llX\n",
ret, off);
@@
-489,13
+487,13
@@
static int do_imls_nand(void)
header = (const image_header_t *)buffer;
len = image_get_image_size(header);
header = (const image_header_t *)buffer;
len = image_get_image_size(header);
- nand_imls_legacyimage(
nan
d, nand_dev, off, len);
+ nand_imls_legacyimage(
mt
d, nand_dev, off, len);
break;
#endif
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
len = fit_get_size(buffer);
break;
#endif
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
len = fit_get_size(buffer);
- nand_imls_fitimage(
nan
d, nand_dev, off, len);
+ nand_imls_fitimage(
mt
d, nand_dev, off, len);
break;
#endif
}
break;
#endif
}
@@
-655,6
+653,7
@@
static int booti_setup(bootm_headers_t *images)
{
struct Image_header *ih;
uint64_t dst;
{
struct Image_header *ih;
uint64_t dst;
+ uint64_t image_size;
ih = (struct Image_header *)map_sysmem(images->ep, 0);
ih = (struct Image_header *)map_sysmem(images->ep, 0);
@@
-665,14
+664,19
@@
static int booti_setup(bootm_headers_t *images)
if (ih->image_size == 0) {
puts("Image lacks image_size field, assuming 16MiB\n");
if (ih->image_size == 0) {
puts("Image lacks image_size field, assuming 16MiB\n");
- ih->image_size = (16 << 20);
+ image_size = 16 << 20;
+ } else {
+ image_size = le64_to_cpu(ih->image_size);
}
/*
* If we are not at the correct run-time location, set the new
* correct location and then move the image there.
*/
}
/*
* If we are not at the correct run-time location, set the new
* correct location and then move the image there.
*/
- dst = gd->bd->bi_dram[0].start + le32_to_cpu(ih->text_offset);
+ dst = gd->bd->bi_dram[0].start + le64_to_cpu(ih->text_offset);
+
+ unmap_sysmem(ih);
+
if (images->ep != dst) {
void *src;
if (images->ep != dst) {
void *src;
@@
-680,7
+684,7
@@
static int booti_setup(bootm_headers_t *images)
src = (void *)images->ep;
images->ep = dst;
src = (void *)images->ep;
images->ep = dst;
- memmove((void *)dst, src,
le32_to_cpu(ih->image_size)
);
+ memmove((void *)dst, src,
image_size
);
}
return 0;
}
return 0;
@@
-717,6
+721,8
@@
static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
lmb_reserve(&images->lmb, images->ep, le32_to_cpu(ih->image_size));
lmb_reserve(&images->lmb, images->ep, le32_to_cpu(ih->image_size));
+ unmap_sysmem(ih);
+
/*
* Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
* have a header that provide this informaiton.
/*
* Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
* have a header that provide this informaiton.