Skip to content

Add support for "kernel_noload" image types #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: odroidc-v2011.03
Choose a base branch
from
Open
8 changes: 7 additions & 1 deletion common/cmd_bootm.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]

/* find kernel entry point */
if (images.legacy_hdr_valid) {
images.ep = image_get_ep (&images.legacy_hdr_os_copy);
if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
images.ep = os_hdr + 0x40;
} else {
images.ep = image_get_ep (&images.legacy_hdr_os_copy);
}
#if defined(CONFIG_FIT)
} else if (images.fit_uname_os) {
ret = fit_image_get_entry (images.fit_hdr_os,
Expand All @@ -342,6 +346,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
}

if (((images.os.type == IH_TYPE_KERNEL) ||
(images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
(images.os.type == IH_TYPE_MULTI)) &&
(images.os.os == IH_OS_LINUX)) {
/* find ramdisk */
Expand Down Expand Up @@ -1064,6 +1069,7 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const
/* get os_data and os_len */
switch (image_get_type (hdr)) {
case IH_TYPE_KERNEL:
case IH_TYPE_KERNEL_NOLOAD:
*os_data = image_get_data (hdr);
*os_len = image_get_data_size (hdr);
break;
Expand Down
20 changes: 10 additions & 10 deletions common/cmd_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ int do_fat_exist (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf ("usage: fatexist <interface> <dev[:part]> <filepath>\n");
return 1;
}
dev = (int)simple_strtoul (argv[2], &ep, 16);
dev_desc=get_dev(argv[1],dev);
if (dev_desc==NULL) {
puts ("\n** Invalid boot device **\n");
dev = (int)simple_strtoul(argv[2], &ep, 16);
dev_desc = get_dev(argv[1],dev);
if (dev_desc == NULL) {
puts("\n** Invalid boot device **\n");
return 1;
}
if (*ep) {
if (*ep != ':') {
puts ("\n** Invalid boot device, use `dev[:part]' **\n");
puts("\n** Invalid boot device, use `dev[:part]' **\n");
return 1;
}
part = (int)simple_strtoul(++ep, NULL, 16);
Expand Down Expand Up @@ -175,7 +175,7 @@ int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
dev = (int)simple_strtoul(argv[2], &ep, 16);
dev_desc = get_dev(argv[1],dev);
dev_desc = get_dev(argv[1], dev);
if (dev_desc == NULL) {
puts("\n** Invalid boot device **\n");
return 1;
Expand Down Expand Up @@ -256,11 +256,11 @@ int do_fat_format(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
block_dev_desc_t *dev_desc = NULL;

if (argc < 2) {
printf ("usage : fatformat <interface> <dev[:part]>\n");
printf("usage : fatformat <interface> <dev[:part]>\n");
return(0);
}

dev = (int)simple_strtoul (argv[2], &ep, 16);
dev = (int)simple_strtoul(argv[2], &ep, 16);
dev_desc = get_dev(argv[1], dev);

if (dev_desc == NULL) {
Expand All @@ -270,12 +270,12 @@ int do_fat_format(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])

if (*ep) {
if (*ep != ':') {
puts ("\n **Invald boot device,use 'dev[:part]'**\n");
puts("\n **Invald boot device,use 'dev[:part]'**\n");
return 1;
}
part = (int)simple_strtoul(++ep, NULL, 16);
if (part > 4 || part <1) {
puts ("** Partition Number should be 1 ~ 4 **\n");
puts("** Partition Number should be 1 ~ 4 **\n");
}
}

Expand Down
1 change: 1 addition & 0 deletions common/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ static const table_entry_t uimage_type[] = {
{ IH_TYPE_FLATDT, "flat_dt", "Flat Device Tree", },
{ IH_TYPE_KWBIMAGE, "kwbimage", "Kirkwood Boot Image",},
{ IH_TYPE_IMXIMAGE, "imximage", "Freescale i.MX Boot Image",},
{ IH_TYPE_KERNEL_NOLOAD, "kernel_noload", "Kernel Image (XIP)",},
{ -1, "", "", },
};

Expand Down
Loading