Merge branch 'sr@denx.de' of git://git.denx.de/u-boot-staging
* 'sr@denx.de' of git://git.denx.de/u-boot-staging: image: Don't detect XIP images as overlapping. image: Implement IH_TYPE_KERNEL_NOLOAD
This commit is contained in:
		
						commit
						4ebbba4425
					
				| 
						 | 
					@ -272,7 +272,13 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
 | 
				
			||||||
 | 
							images.os.load = images.os.image_start;
 | 
				
			||||||
 | 
							images.ep += images.os.load;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (((images.os.type == IH_TYPE_KERNEL) ||
 | 
						if (((images.os.type == IH_TYPE_KERNEL) ||
 | 
				
			||||||
 | 
						     (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
 | 
				
			||||||
	     (images.os.type == IH_TYPE_MULTI)) &&
 | 
						     (images.os.type == IH_TYPE_MULTI)) &&
 | 
				
			||||||
	    (images.os.os == IH_OS_LINUX)) {
 | 
						    (images.os.os == IH_OS_LINUX)) {
 | 
				
			||||||
		/* find ramdisk */
 | 
							/* find ramdisk */
 | 
				
			||||||
| 
						 | 
					@ -314,6 +320,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 | 
				
			||||||
	ulong image_start = os.image_start;
 | 
						ulong image_start = os.image_start;
 | 
				
			||||||
	ulong image_len = os.image_len;
 | 
						ulong image_len = os.image_len;
 | 
				
			||||||
	__maybe_unused uint unc_len = CONFIG_SYS_BOOTM_LEN;
 | 
						__maybe_unused uint unc_len = CONFIG_SYS_BOOTM_LEN;
 | 
				
			||||||
 | 
						int no_overlap = 0;
 | 
				
			||||||
#if defined(CONFIG_LZMA) || defined(CONFIG_LZO)
 | 
					#if defined(CONFIG_LZMA) || defined(CONFIG_LZO)
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
#endif /* defined(CONFIG_LZMA) || defined(CONFIG_LZO) */
 | 
					#endif /* defined(CONFIG_LZMA) || defined(CONFIG_LZO) */
 | 
				
			||||||
| 
						 | 
					@ -324,6 +331,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 | 
				
			||||||
	case IH_COMP_NONE:
 | 
						case IH_COMP_NONE:
 | 
				
			||||||
		if (load == blob_start || load == image_start) {
 | 
							if (load == blob_start || load == image_start) {
 | 
				
			||||||
			printf("   XIP %s ... ", type_name);
 | 
								printf("   XIP %s ... ", type_name);
 | 
				
			||||||
 | 
								no_overlap = 1;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			printf("   Loading %s ... ", type_name);
 | 
								printf("   Loading %s ... ", type_name);
 | 
				
			||||||
			memmove_wd((void *)load, (void *)image_start,
 | 
								memmove_wd((void *)load, (void *)image_start,
 | 
				
			||||||
| 
						 | 
					@ -418,7 +426,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 | 
				
			||||||
	if (boot_progress)
 | 
						if (boot_progress)
 | 
				
			||||||
		show_boot_progress(7);
 | 
							show_boot_progress(7);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((load < blob_end) && (*load_end > blob_start)) {
 | 
						if (!no_overlap && (load < blob_end) && (*load_end > blob_start)) {
 | 
				
			||||||
		debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
 | 
							debug("images.os.start = 0x%lX, images.os.end = 0x%lx\n",
 | 
				
			||||||
			blob_start, blob_end);
 | 
								blob_start, blob_end);
 | 
				
			||||||
		debug("images.os.load = 0x%lx, load_end = 0x%lx\n", load,
 | 
							debug("images.os.load = 0x%lx, load_end = 0x%lx\n", load,
 | 
				
			||||||
| 
						 | 
					@ -796,7 +804,8 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	show_boot_progress(106);
 | 
						show_boot_progress(106);
 | 
				
			||||||
	if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL)) {
 | 
						if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL) &&
 | 
				
			||||||
 | 
						    !fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) {
 | 
				
			||||||
		puts("Not a kernel image\n");
 | 
							puts("Not a kernel image\n");
 | 
				
			||||||
		show_boot_progress(-106);
 | 
							show_boot_progress(-106);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
| 
						 | 
					@ -874,6 +883,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
 | 
				
			||||||
		/* get os_data and os_len */
 | 
							/* get os_data and os_len */
 | 
				
			||||||
		switch (image_get_type(hdr)) {
 | 
							switch (image_get_type(hdr)) {
 | 
				
			||||||
		case IH_TYPE_KERNEL:
 | 
							case IH_TYPE_KERNEL:
 | 
				
			||||||
 | 
							case IH_TYPE_KERNEL_NOLOAD:
 | 
				
			||||||
			*os_data = image_get_data(hdr);
 | 
								*os_data = image_get_data(hdr);
 | 
				
			||||||
			*os_len = image_get_data_size(hdr);
 | 
								*os_len = image_get_data_size(hdr);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -136,6 +136,7 @@ static const table_entry_t uimage_type[] = {
 | 
				
			||||||
	{	IH_TYPE_FIRMWARE,   "firmware",	  "Firmware",		},
 | 
						{	IH_TYPE_FIRMWARE,   "firmware",	  "Firmware",		},
 | 
				
			||||||
	{	IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",	},
 | 
						{	IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",	},
 | 
				
			||||||
	{	IH_TYPE_KERNEL,	    "kernel",	  "Kernel 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",},
 | 
						{	IH_TYPE_KWBIMAGE,   "kwbimage",   "Kirkwood Boot Image",},
 | 
				
			||||||
	{	IH_TYPE_IMXIMAGE,   "imximage",   "Freescale i.MX Boot Image",},
 | 
						{	IH_TYPE_IMXIMAGE,   "imximage",   "Freescale i.MX Boot Image",},
 | 
				
			||||||
	{	IH_TYPE_INVALID,    NULL,	  "Invalid Image",	},
 | 
						{	IH_TYPE_INVALID,    NULL,	  "Invalid Image",	},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -162,6 +162,7 @@
 | 
				
			||||||
#define IH_TYPE_UBLIMAGE	11	/* Davinci UBL Image		*/
 | 
					#define IH_TYPE_UBLIMAGE	11	/* Davinci UBL Image		*/
 | 
				
			||||||
#define IH_TYPE_OMAPIMAGE	12	/* TI OMAP Config Header Image	*/
 | 
					#define IH_TYPE_OMAPIMAGE	12	/* TI OMAP Config Header Image	*/
 | 
				
			||||||
#define IH_TYPE_AISIMAGE	13	/* TI Davinci AIS Image		*/
 | 
					#define IH_TYPE_AISIMAGE	13	/* TI Davinci AIS Image		*/
 | 
				
			||||||
 | 
					#define IH_TYPE_KERNEL_NOLOAD	14	/* OS Kernel Image, can run from any load address */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Compression Types
 | 
					 * Compression Types
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,8 @@ static image_header_t header;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int image_check_image_types(uint8_t type)
 | 
					static int image_check_image_types(uint8_t type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if ((type > IH_TYPE_INVALID) && (type < IH_TYPE_FLATDT))
 | 
						if (((type > IH_TYPE_INVALID) && (type < IH_TYPE_FLATDT)) ||
 | 
				
			||||||
 | 
						    (type == IH_TYPE_KERNEL_NOLOAD))
 | 
				
			||||||
		return EXIT_SUCCESS;
 | 
							return EXIT_SUCCESS;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		return EXIT_FAILURE;
 | 
							return EXIT_FAILURE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue