[U-Boot] [RFC PATCH 0/4] RFC: FIT images and device tree on x86

This little series adds support for booting FITs on x86. A FIT is a single file that can contain a kernel, device tree and ramdisk.
This is a bit of an experiment, and is work in progress. I would like to get feedback on the approach.
x86 kernels require a setup.bin file to boot. Rather than try to pack this into the image in a clever way, this series just adds it as another image in the FIT. At present compression is not supported for the setup binary.
The kernel image can be compressed using FIT's normal compression options, such as bzip2 and lzo. U-Boot will decompress it as part of the 'bootm' command.
More work is needed to make this implementation also support a zImage (which contains a setup.bin and a compressed kernel in a single image), and to pass the correct device tree binary to the kernel.
This series builds on the image and FIT code improvements that were done for verified boot. The full series is available at:
http://git.denx.de/u-boot-x86.git
in branch 'setup'.
Simon Glass (4): x86: Enable LMB and RAMDISK_HIGH by default x86: Rewrite bootm.c to make it similar to ARM x86: Allow cmdline setup in setup_zimage() to be optional x86: Support loading kernel setup from a FIT
arch/x86/include/asm/bootm.h | 24 +++++ arch/x86/include/asm/config.h | 2 + arch/x86/lib/bootm.c | 152 +++++++++++++++++++++++++-------- arch/x86/lib/zimage.c | 37 +++----- common/cmd_bootm.c | 22 +++++- common/image-fit.c | 20 +++++ common/image.c | 11 +++ doc/uImage.FIT/kernel.its | 50 +++++++++++ doc/uImage.FIT/source_file_format.txt | 23 +++-- include/bootstage.h | 3 + include/image.h | 13 +++ 11 files changed, 285 insertions(+), 72 deletions(-) create mode 100644 arch/x86/include/asm/bootm.h

These options are used by the image code. To allow us to use the generic code more easily, define these for x86.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/x86/include/asm/config.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/config.h b/arch/x86/include/asm/config.h index 049c44e..c60dba2 100644 --- a/arch/x86/include/asm/config.h +++ b/arch/x86/include/asm/config.h @@ -21,4 +21,6 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_
+#define CONFIG_LMB +#define CONFIG_SYS_BOOT_RAMDISK_HIGH #endif

The x86 bootm code is quite special, and geared to zimage. Adjust it to support device tree and make it more like the ARM code, with separate bootm stages and functions for each stage.
Create a function announce_and_cleanup() to handle printing the "Starting kernel ..." message and put it in bootm so it is in one place and can be used by any loading code. Also move the board_final_cleanup() function into bootm.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/x86/include/asm/bootm.h | 24 +++++++ arch/x86/lib/bootm.c | 152 +++++++++++++++++++++++++++++++---------- arch/x86/lib/zimage.c | 16 +---- 3 files changed, 141 insertions(+), 51 deletions(-) create mode 100644 arch/x86/include/asm/bootm.h
diff --git a/arch/x86/include/asm/bootm.h b/arch/x86/include/asm/bootm.h new file mode 100644 index 0000000..abc90e3 --- /dev/null +++ b/arch/x86/include/asm/bootm.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2013, Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef ARM_BOOTM_H +#define ARM_BOOTM_H + +void bootm_announce_and_cleanup(void); + +#endif diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 83caf6b..72f571d 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -26,84 +26,162 @@
#include <common.h> #include <command.h> +#include <fdt_support.h> #include <image.h> #include <u-boot/zlib.h> #include <asm/bootparam.h> #include <asm/byteorder.h> #include <asm/zimage.h> +#ifdef CONFIG_SYS_COREBOOT +#include <asm/arch/timestamp.h> +#endif
#define COMMAND_LINE_OFFSET 0x9000
-/*cmd_boot.c*/ -int do_bootm_linux(int flag, int argc, char * const argv[], - bootm_headers_t *images) +/* + * Implement a weak default function for boards that optionally + * need to clean up the system before jumping to the kernel. + */ +__weak void board_final_cleanup(void) { - struct boot_params *base_ptr = NULL; - ulong os_data, os_len; - image_header_t *hdr; - void *load_address; +}
-#if defined(CONFIG_FIT) - const void *data; - size_t len; +void bootm_announce_and_cleanup(void) +{ + printf("\nStarting kernel ...\n\n"); + +#ifdef CONFIG_SYS_COREBOOT + timestamp_add_now(TS_U_BOOT_START_KERNEL); #endif + bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel"); + board_final_cleanup(); +}
- if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; +#if defined(CONFIG_OF_LIBFDT) && !defined(CONFIG_OF_NO_KERNEL) +static int fixup_memory_node(void *blob) +{ + bd_t *bd = gd->bd; + int bank; + u64 start[CONFIG_NR_DRAM_BANKS]; + u64 size[CONFIG_NR_DRAM_BANKS]; + + for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { + start[bank] = bd->bi_dram[bank].start; + size[bank] = bd->bi_dram[bank].size; + }
+ return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS); +} +#endif + +/* Subcommand: PREP */ +static int boot_prep_linux(bootm_headers_t *images) +{ + char *cmd_line_dest = NULL; + image_header_t *hdr; + int is_zimage = 0; + void *data = NULL; + size_t len; + int ret; + +#ifdef CONFIG_OF_LIBFDT + if (images->ft_len) { + debug("using: FDT\n"); + if (image_create_fdt(images)) { + puts("FDT creation failed! hanging..."); + hang(); + } + } +#endif if (images->legacy_hdr_valid) { hdr = images->legacy_hdr_os; if (image_check_type(hdr, IH_TYPE_MULTI)) { + ulong os_data, os_len; + /* if multi-part image, we need to get first subimage */ image_multi_getimg(hdr, 0, &os_data, &os_len); + data = (void *)os_data; + len = os_len; } else { /* otherwise get image data */ - os_data = image_get_data(hdr); - os_len = image_get_data_size(hdr); + data = (void *)image_get_data(hdr); + len = image_get_data_size(hdr); } + is_zimage = 1; #if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { + } else if (images->fit_uname_setup) { + /* The entry point is already set */ + } else if (images->fit_uname_os && is_zimage) { ret = fit_image_get_data(images->fit_hdr_os, - images->fit_noffset_os, &data, &len); + images->fit_noffset_os, + (const void **)&data, &len); if (ret) { puts("Can't get image data/size!\n"); goto error; } - os_data = (ulong)data; - os_len = (ulong)len; + is_zimage = 1; #endif - } else { - puts("Could not find kernel image!\n"); - goto error; }
-#ifdef CONFIG_CMD_ZBOOT - base_ptr = load_zimage((void *)os_data, os_len, &load_address); -#endif + if (is_zimage) { + void *load_address; + char *base_ptr; + + base_ptr = (char *)load_zimage(data, len, &load_address); + images->os.load = (ulong)load_address; + cmd_line_dest = base_ptr + COMMAND_LINE_OFFSET; + images->ep = (ulong)base_ptr; + }
- if (NULL == base_ptr) { - printf("## Kernel loading failed ...\n"); + if (!images->ep) { + printf("## Kernel loading failed (no setup) ...\n"); goto error; }
- if (setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET, + printf("Setup at %#08lx\n", images->ep); + ret = setup_zimage((void *)images->ep, cmd_line_dest, 0, images->rd_start, - images->rd_end - images->rd_start)) { + images->rd_end - images->rd_start); + + if (ret) { printf("## Setting up boot parameters failed ...\n"); - goto error; + return 1; }
-#ifdef DEBUG - printf("## Transferring control to Linux (at address %08x) ...\n", - (u32)base_ptr); -#endif + return 0;
- /* we assume that the kernel is in place */ - printf("\nStarting kernel ...\n\n"); +error: + return 1; +}
- boot_zimage(base_ptr, load_address); +/* Subcommand: GO */ +static int boot_jump_linux(bootm_headers_t *images) +{ + debug("## Transferring control to Linux (at address %08lx," + " kernel %08lx) ...\n", images->ep, images->os.load); + + boot_zimage((struct boot_params *)images->ep, (void *)images->os.load); /* does not return */
-error: return 1; } + +int do_bootm_linux(int flag, int argc, char * const argv[], + bootm_headers_t *images) +{ + /* No need for those on x86 */ + if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE) + return -1; + + if (flag & BOOTM_STATE_OS_PREP) + return boot_prep_linux(images); + + if (flag & BOOTM_STATE_OS_GO) { + boot_jump_linux(images); + return 0; + } + + if (boot_prep_linux(images)) + return 1; + return boot_jump_linux(images); +} diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 46af391..8819afd 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -35,6 +35,7 @@ #include <asm/zimage.h> #include <asm/realmode.h> #include <asm/byteorder.h> +#include <asm/bootm.h> #include <asm/bootparam.h> #ifdef CONFIG_SYS_COREBOOT #include <asm/arch/timestamp.h> @@ -283,23 +284,10 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, return 0; }
-/* - * Implement a weak default function for boards that optionally - * need to clean up the system before jumping to the kernel. - */ -__weak void board_final_cleanup(void) -{ -} - void boot_zimage(void *setup_base, void *load_address) { - board_final_cleanup(); - - printf("\nStarting kernel ...\n\n"); + bootm_announce_and_cleanup();
-#ifdef CONFIG_SYS_COREBOOT - timestamp_add_now(TS_U_BOOT_START_KERNEL); -#endif #if defined CONFIG_ZBOOT_32 /* * Set %ebx, %ebp, and %edi to 0, %esi to point to the boot_params

If we are passing this using the device tree then we may not want to set this up here. TBD.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/x86/lib/zimage.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 8819afd..9fc450a 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -269,18 +269,21 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, hdr->loadflags |= HEAP_FLAG; }
- if (bootproto >= 0x0202) { - hdr->cmd_line_ptr = (uintptr_t)cmd_line; - } else if (bootproto >= 0x0200) { - setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; - setup_base->screen_info.cl_offset = - (uintptr_t)cmd_line - (uintptr_t)setup_base; + if (cmd_line) { + if (bootproto >= 0x0202) { + hdr->cmd_line_ptr = (uintptr_t)cmd_line; + } else if (bootproto >= 0x0200) { + setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; + setup_base->screen_info.cl_offset = + (uintptr_t)cmd_line - (uintptr_t)setup_base; + + hdr->setup_move_size = 0x9100; + }
- hdr->setup_move_size = 0x9100; + /* build command line at COMMAND_LINE_OFFSET */ + build_command_line(cmd_line, auto_boot); }
- /* build command line at COMMAND_LINE_OFFSET */ - build_command_line(cmd_line, auto_boot); return 0; }

Hi Simon,
On Sun, Jan 13, 2013 at 4:48 AM, Simon Glass sjg@chromium.org wrote:
If we are passing this using the device tree then we may not want to set this up here. TBD.
Signed-off-by: Simon Glass sjg@chromium.org
arch/x86/lib/zimage.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 8819afd..9fc450a 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -269,18 +269,21 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, hdr->loadflags |= HEAP_FLAG; }
if (bootproto >= 0x0202) {
hdr->cmd_line_ptr = (uintptr_t)cmd_line;
} else if (bootproto >= 0x0200) {
setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC;
setup_base->screen_info.cl_offset =
(uintptr_t)cmd_line - (uintptr_t)setup_base;
if (cmd_line) {
if (bootproto >= 0x0202) {
hdr->cmd_line_ptr = (uintptr_t)cmd_line;
} else if (bootproto >= 0x0200) {
To be honest, I think it would be simpler if older kernels are just completely unsupported and get rid of all this logic
Regards,
Graeme

Add a new setup@ section to the FIT which can be used to provide a setup binary for booting Linux on x86. This makes it possible to boot x86 from a FIT.
Signed-off-by: Simon Glass sjg@chromium.org --- common/cmd_bootm.c | 22 +++++++++++++- common/image-fit.c | 20 +++++++++++++ common/image.c | 11 +++++++ doc/uImage.FIT/kernel.its | 50 +++++++++++++++++++++++++++++++++ doc/uImage.FIT/source_file_format.txt | 23 ++++++++------ include/bootstage.h | 3 ++ include/image.h | 13 ++++++++ 7 files changed, 130 insertions(+), 12 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index de3dfc5..35fc4bf 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -36,6 +36,7 @@ #include <lmb.h> #include <linux/ctype.h> #include <asm/byteorder.h> +#include <asm/errno.h> #include <asm/io.h> #include <linux/compiler.h>
@@ -215,6 +216,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
images.os.end = image_get_image_end(os_hdr); images.os.load = image_get_load(os_hdr); + images.os.arch = image_get_arch(os_hdr); break; #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: @@ -239,6 +241,12 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] return 1; }
+ if (fit_image_get_arch(images.fit_hdr_os, + images.fit_noffset_os, &images.os.arch)) { + puts("Can't get image ARCH!\n"); + return 1; + } + images.os.end = fit_get_end(images.fit_hdr_os);
if (fit_image_get_load(images.fit_hdr_os, images.fit_noffset_os, @@ -254,8 +262,18 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] return 1; }
- /* find kernel entry point */ - if (images.legacy_hdr_valid) { + /* If we have a valid setup.bin, we will use that for entry (x86) */ + if (images.os.arch == IH_ARCH_I386) { + ulong len; + + puts("Looking for setup\n"); + ret = boot_get_setup(&images, IH_ARCH_I386, &images.ep, &len); + if (ret < 0 && ret != -ENOENT) { + puts("Could not find a valid setup.bin for x86n"); + return 1; + } + /* Kernel entry point is the setup.bin */ + } else if (images.legacy_hdr_valid) { images.ep = image_get_ep(&images.legacy_hdr_os_copy); #if defined(CONFIG_FIT) } else if (images.fit_uname_os) { diff --git a/common/image-fit.c b/common/image-fit.c index 9f3ece2..04093a0 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1654,3 +1654,23 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
return noffset; } + +int boot_get_setup_fit(bootm_headers_t *images, uint8_t arch, + ulong *setup_start, ulong *setup_len) +{ + int noffset; + ulong addr; + ulong len; + int ret; + + addr = map_to_sysmem(images->fit_hdr_os); + noffset = fit_get_node_from_config(images, FIT_SETUP_PROP, addr); + if (noffset < 0) + return noffset; + + ret = fit_image_load(images, FIT_SETUP_PROP, addr, NULL, NULL, + arch, IH_TYPE_X86_SETUP, BOOTSTAGE_ID_FIT_SETUP_START, + FIT_LOAD_REQUIRED, setup_start, &len); + + return ret; +} diff --git a/common/image.c b/common/image.c index 26b9653..7c44bc7 100644 --- a/common/image.c +++ b/common/image.c @@ -151,6 +151,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_SCRIPT, "script", "Script", }, { IH_TYPE_STANDALONE, "standalone", "Standalone Program", }, { IH_TYPE_UBLIMAGE, "ublimage", "Davinci UBL image",}, + { IH_TYPE_X86_SETUP, "x86_setup", "x86 setup.bin", }, { -1, "", "", }, };
@@ -1064,6 +1065,16 @@ error: } #endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
+int boot_get_setup(bootm_headers_t *images, uint8_t arch, + ulong *setup_start, ulong *setup_len) +{ +#if defined(CONFIG_FIT) + return boot_get_setup_fit(images, arch, setup_start, setup_len); +#else + return -ENOENT; +#endif +} + #ifdef CONFIG_SYS_BOOT_GET_CMDLINE /** * boot_get_cmdline - allocate and initialize kernel cmdline diff --git a/doc/uImage.FIT/kernel.its b/doc/uImage.FIT/kernel.its index ef3ab8f..1b662aa 100644 --- a/doc/uImage.FIT/kernel.its +++ b/doc/uImage.FIT/kernel.its @@ -35,3 +35,53 @@ }; }; }; + + + +For x86 a setup node is also required: + +/dts-v1/; + +/ { + description = "Simple image with single Linux kernel on x86"; + #address-cells = <1>; + + images { + kernel@1 { + description = "Vanilla Linux kernel"; + data = /incbin/("./Image"); + type = "kernel"; + arch = "x86"; + os = "linux"; + compression = "lzo"; + load = <00000000>; + entry = <00000000>; + hash@2 { + algo = "sha1"; + }; + }; + + setup@1 { + description = "Linux setup.bin"; + data = /incbin/("./setup.bin"); + type = "setup"; + arch = "x86"; + os = "linux"; + compression = "none"; + load = <00100000>; + entry = <00100000>; + hash@2 { + algo = "sha1"; + }; + }; + }; + + configurations { + default = "config@1"; + config@1 { + description = "Boot Linux kernel"; + kernel = "kernel@1"; + setup = "setup@1"; + }; + }; +}; diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt index 6d20707..b0d9a71 100644 --- a/doc/uImage.FIT/source_file_format.txt +++ b/doc/uImage.FIT/source_file_format.txt @@ -55,7 +55,7 @@ FIT is formally a flattened device tree (in the libfdt meaning), which conforms to bindings defined in this document.
.its - image tree source -.itb - image tree blob +.fit - flattened image tree blob
c) Image building procedure
@@ -101,15 +101,15 @@ Root node of the uImage Tree should have the following layout: | o images | | - | o img@1 {...} - | o img@2 {...} + | o image@1 {...} + | o image@2 {...} | ... | o configurations - |- default = "cfg@1" + |- default = "conf@1" | - o cfg@1 {...} - o cfg@2 {...} + o conf@1 {...} + o conf@2 {...} ...
@@ -159,11 +159,11 @@ the '/images' node should have the following layout: - description : Textual description of the component sub-image - type : Name of component sub-image type, supported types are: "standalone", "kernel", "ramdisk", "firmware", "script", "filesystem", - "fdt". + "fdt" and others (see uimage_type in common/images.c). - data : Path to the external file which contains this node's binary data. - compression : Compression used by included data. Supported compressions - are "gzip" and "bzip2". If no compression is used compression property - should be set to "none". + include "gzip" and "bzip2" (see uimage_comp in common/images.c). If no + compression is used, the compression property should be set to "none".
Conditionally mandatory property: - os : OS name, mandatory for type="kernel", valid OS names are: "openbsd", @@ -173,7 +173,8 @@ the '/images' node should have the following layout: - arch : Architecture name, mandatory for types: "standalone", "kernel", "firmware", "ramdisk" and "fdt". Valid architecture names are: "alpha", "arm", "i386", "ia64", "mips", "mips64", "ppc", "s390", "sh", "sparc", - "sparc64", "m68k", "microblaze", "nios2", "blackfin", "avr32", "st200". + "sparc64", "m68k", "microblaze", "nios2", "blackfin", "avr32", "st200", + "sandbox". - entry : entry point address, address size is determined by '#address-cells' property of the root node. Mandatory for for types: "standalone" and "kernel". @@ -246,6 +247,8 @@ o config@1 node of a "ramdisk" type). - fdt : Unit name of the corresponding fdt blob (component image node of a "fdt type"). + - setup : Unit name of the corresponding setup binary (used for booting + an x86 kernel). This contains the setup.bin file built by the kernel.
The FDT blob is required to properly boot FDT based kernel, so the minimal configuration for 2.6 FDT kernel is (kernel, fdt) pair. diff --git a/include/bootstage.h b/include/bootstage.h index 2a28e23..a7f41ce 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -174,6 +174,9 @@ enum bootstage_id { /* Next 10 IDs used by BOOTSTAGE_SUB_... */ BOOTSTAGE_ID_FIT_RD_START = 120, /* Ramdisk stages */
+ /* Next 10 IDs used by BOOTSTAGE_SUB_... */ + BOOTSTAGE_ID_FIT_SETUP_START = 130, /* x86 setup stages */ + BOOTSTAGE_ID_IDE_FIT_READ = 140, BOOTSTAGE_ID_IDE_FIT_READ_OK,
diff --git a/include/image.h b/include/image.h index a724926..dc61823 100644 --- a/include/image.h +++ b/include/image.h @@ -201,6 +201,7 @@ struct lmb; #define IH_TYPE_AISIMAGE 13 /* TI Davinci AIS Image */ #define IH_TYPE_KERNEL_NOLOAD 14 /* OS Kernel Image, can run from any load address */ #define IH_TYPE_PBLIMAGE 15 /* Freescale PBL Boot Image */ +#define IH_TYPE_X86_SETUP 16 /* x86 setup.bin Image */
/* * Compression Types @@ -241,6 +242,7 @@ typedef struct image_info { ulong image_start, image_len; /* start of image within blob, len of image */ ulong load; /* load addr for the image */ uint8_t comp, type, os; /* compression, type of image, os type */ + uint8_t arch; /* CPU architecture */ } image_info_t;
/* @@ -271,6 +273,10 @@ typedef struct bootm_headers { void *fit_hdr_fdt; /* FDT blob FIT image header */ const char *fit_uname_fdt; /* FDT blob subimage node unit name */ int fit_noffset_fdt;/* FDT blob subimage node offset */ + + void *fit_hdr_setup; /* x86 setup FIT image header */ + const char *fit_uname_setup; /* x86 setup subimage node name */ + int fit_noffset_setup;/* x86 setup subimage node offset */ #endif
#ifndef USE_HOSTCC @@ -381,6 +387,9 @@ enum fit_load_op { FIT_LOAD_REQUIRED, /* Must be provided */ };
+int boot_get_setup(bootm_headers_t *images, uint8_t arch, ulong *setup_start, + ulong *setup_len); + #ifndef USE_HOSTCC /* Image format types, returned by _get_format() routine */ #define IMAGE_FORMAT_INVALID 0x00 @@ -394,6 +403,9 @@ ulong genimg_get_image(ulong img_addr); int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, uint8_t arch, ulong *rd_start, ulong *rd_end);
+int boot_get_setup_fit(bootm_headers_t *images, uint8_t arch, + ulong *setup_start, ulong *setup_len); + /** * fit_image_load() - load an image from a FIT * @@ -662,6 +674,7 @@ int image_setup_linux(bootm_headers_t *images); #define FIT_RAMDISK_PROP "ramdisk" #define FIT_FDT_PROP "fdt" #define FIT_DEFAULT_PROP "default" +#define FIT_SETUP_PROP "setup"
#define FIT_MAX_HASH_LEN 20 /* max(crc32_len(4), sha1_len(20)) */
participants (2)
-
Graeme Russ
-
Simon Glass