06 Oct, 2014
1 commit
-
Like many platforms, the Altera socfpga platform requires that the
preloader be "signed" in a certain way or the built-in boot ROM will
not boot the code.This change automatically creates an appropriately signed preloader
from an SPL image.The signed image includes a CRC which must, of course, be generated
with a CRC generator that the SoCFPGA boot ROM agrees with otherwise
the boot ROM will reject the image.Unfortunately the CRC used in this boot ROM is not the same as the
Adler CRC in lib/crc32.c. Indeed the Adler code is not technically a
CRC but is more correctly described as a checksum.Thus, the appropriate CRC generator is added to lib/ as crc32_alt.c.
Signed-off-by: Charles Manning
Signed-off-by: Marek Vasut
Cc: Chin Liang See
Cc: Dinh Nguyen
Cc: Albert Aribaud
Cc: Tom Rini
Cc: Wolfgang Denk
Cc: Pavel Machek
Acked-by: Pavel MachekV2: - Zap unused constant
- Explicitly print an error message in case of error
- Rework the hdr_checksum() function to take the *header directly
instead of a plan buffer pointer
29 Aug, 2014
1 commit
-
Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if
a load address is provided in the FIT. The rationale was that a load address
of 0 should be considered to mean 'do not load'.Add a new load operation which supports this feature, so that the ramdisk
will be loaded if a non-zero load address is provided.Signed-off-by: Simon Glass
22 Aug, 2014
1 commit
-
Commit b3dd64f5d537 "bootm: use genimg_get_kernel_addr()" introduced
a bug for booting FIT image. It's because calling fit_parse_config()
twice will give us wrong value in img_addr.Add a new function genimg_get_kernel_addr_fit() whichl will always
return fit_uname_config and fit_uname_kernel for CONFIG_FIT.
genimg_get_kernel_addr() will ignore those to parameters.Reported-by: York Sun
Signed-off-by: Bryan Wu
09 Aug, 2014
1 commit
-
Kernel address is normally stored as a string argument of bootm or bootz.
This function is taken out from boot_get_kernel() of bootm.c, which can be
reused by others.Signed-off-by: Bryan Wu
[trini: Fix warnings with CONFIG_FIT]
Signed-off-by: Tom Rini
19 Jun, 2014
2 commits
-
commit 18b06652cd "tools: include u-boot version of sha256.h"
unconditionally forced the sha256.h from u-boot to be used
for tools instead of the host version. This is fragile though
as it will also include the host version. Therefore move it
to include/u-boot to join u-boot/md5.h etc which were renamed
for the same reason.cc: Simon Glass
Signed-off-by: Jeroen Hofstee -
This can be obtained by looking up the image type, so is redundant. It is
better to centralise this lookup to avoid errors.Signed-off-by: Simon Glass
06 Jun, 2014
1 commit
-
make the use of legacy image format configurable through
the config define CONFIG_IMAGE_FORMAT_LEGACY.When relying on signed FIT images with required signature check
the legacy image format should be disabled. Therefore introduce
this new define and enable legacy image format if CONFIG_FIT_SIGNATURE
is not set. If CONFIG_FIT_SIGNATURE is set disable per default
the legacy image format.Signed-off-by: Heiko Schocher
Cc: Simon Glass
Cc: Lars Steubesand
Cc: Mike Pearce
Cc: Wolfgang Denk
Cc: Tom Rini
Cc: Michal Simek
Acked-by: Simon Glass
27 May, 2014
1 commit
-
The new atmelimage converts a machine code BLOB to bootable ROM image. Atmel
ROM has no sophisticated image format, it only checks the first 7 ARM vectors.
The vectors can contain valid B or LDR opcodes, the 6'th vector contains the
image size to load.Additionally the PMECC header can be written by the atmelimage target. The
parameters must be given via the -n switch as a coma separated list. For
example:mkimage -T atmelimage \
-n usePmecc=1,sectorPerPage=4,sectorSize=512,spareSize=64,eccBits=4,eccOffset=36 \
-d spl/u-boot-spl.bin boot.binA provided image can be checked for correct header setup. It prints out the
PMECC header parameters if it has one and the 6'th interrupt vector content.---88---
A SPL binary modified with the atmelimage mkimage target was succesfully
booted on a sama5d34ek via MMC and NAND.Signed-off-by: Andreas Bießmann
Cc: Bo Shen
Cc: Heiko Schocher
Tested-by: Bo Shen
23 May, 2014
1 commit
08 May, 2014
1 commit
-
This patch adds support for the Android boot-image format. The header
file is from the Android project and got slightly alterted so the struct +
its defines are not generic but have something like a namespace. The
header file is from bootloader/legacy/include/boot/bootimg.h. The header
parsing has been written from scratch and I looked at
bootloader/legacy/usbloader/usbloader.c for some details.
The image contains the physical address (load address) of the kernel and
ramdisk. This address is considered only for the kernel image.
The "second image" defined in the image header is currently not
supported. I haven't found anything that is creating this.v3 (Rob Herring):
This is based on http://patchwork.ozlabs.org/patch/126797/ with the
following changes:
- Rebased to current mainline
- Moved android image handling to separate functions in
common/image-android.c
- s/u8/char/ in header to fix string function warnings
- Use SPDX identifiers for licenses
- Cleaned-up file source information:
android_image.h is from file include/boot/bootimg.h in repository:
https://android.googlesource.com/platform/bootable/bootloader/legacy
The git commit hash is 4205b865141ff2e255fe1d3bd16de18e217ef06a
usbloader.c would be from the same commit, but it does not appear
to have been used for any actual code.
v4:
- s/andriod/android/
- Use a separate flag ep_found to track if the entry point has been set
rather than using a magic value.Cc: Wolfgang Denk
Signed-off-by: Sebastian Andrzej Siewior
Signed-off-by: Rob Herring
Reviewed-by: Tom Rini
Reviewed-by: Lukasz Majewski
18 Apr, 2014
1 commit
-
This patch add support for gpimage format as a preparatory
patch for porting u-boot for keystone2 devices and is
based on omapimage format. It re-uses gph header to store the
size and loadaddr as done in omapimage.cSigned-off-by: Vitaly Andrianov
Signed-off-by: Murali Karicheri
Acked-by: Tom Rini
07 Feb, 2014
1 commit
-
Signed-off-by: Alexey Brodkin
Cc: Vineet Gupta
Cc: Francois Bedard
Cc: Wolfgang Denk
Cc: Heiko Schocher
14 Jan, 2014
1 commit
-
Otherwise, when booting VxWorks kernel, the incorrect message will
be seen:ARM Unknown OS Kernel Image (uncompressed)
Signed-off-by: Miao Yan
09 Jan, 2014
1 commit
-
Relocation code based on a patch by Scott Wood, which is:
Signed-off-by: Scott WoodSigned-off-by: David Feng
20 Sep, 2013
2 commits
-
Becuase fdt_check_header function takes (const void *)
type argument, the argument should be passed to it
without being casted to (char *).Signed-off-by: Masahiro Yamada
-
Fix various misspellings of things like "environment", "kernel",
"default" and "volatile", and throw in a couple grammar fixes.Signed-off-by: Robert P. J. Day
31 Aug, 2013
1 commit
-
Add mkimage support for generating and verifying MXS bootstream.
The implementation here is mostly a glue code between MXSSB v0.4
and mkimage, but the long-term goal is to rectify this and merge
MXSSB with mkimage more tightly. Once this code is properly in
U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage
support.Note that the mxsimage generator needs libcrypto from OpenSSL, I
therefore enabled the libcrypto/libssl unconditionally.MXSSB: http://git.denx.de/?p=mxssb.git;a=summary
The code is based on research presented at:
http://www.rockbox.org/wiki/SbFileFormatSigned-off-by: Marek Vasut
Cc: Tom Rini
Cc: Fabio Estevam
Cc: Stefano Babic
Cc: Otavio Salvador
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
13 Jul, 2013
1 commit
-
A FIT image with a ramdisk that sets the entry or load points to 0x0
must be treated as meaning "leave in place" and NOT "relocate to 0x0".
This regression was introduced in a51ec63.Signed-off-by: Stefano Babic
12 Jul, 2013
1 commit
-
If a specific configuraion is selected by the bootm command, e.g. with
'bootm 84000000#recoveryconf' we must honour this for not just the kernel,
but also the ramdisk and FDT.In the conversion to using a common fit_image_load() function for loading
images from FITs (commits a51ec63 and 53f375f) this feature was lost.
Reinstate it by passing the selected configuration back from
fit_image_load() to boot_get_kernel(), then use this configuration
(which is stored in images->fit_uname_cfg) in both boot_get_ramdisk()
and boot_get_fdt().Signed-off-by: Simon Glass
26 Jun, 2013
1 commit
-
At present the arguments to bootm are processed in a somewhat confusing
way. Sub-functions must know how many arguments their calling functions
have processed, and the OS boot function must also have this information.
Also it isn't obvious that 'bootm' and 'bootm start' provide arguments in
the same way.Adjust the code so that arguments are removed from the list before calling
a sub-function. This means that all functions can know that argv[0] is the
first argument of which they need to take notice.Signed-off-by: Simon Glass
05 Jun, 2013
1 commit
-
Use the new common code to load a ramdisk. The functionality should not
change.Signed-off-by: Simon Glass
15 May, 2013
8 commits
-
This seems to be a common function for several architectures, so create
a common function rather than duplicating the code in each arch.Also make an attempt to avoid introducing #ifdefs in the new code, partly
by removing useless #ifdefs around function declarations in the image.h
header.Signed-off-by: Simon Glass
-
The image file is still very large, and some of the code is only used when
libfdt is in use. Move this code into a new file.Signed-off-by: Simon Glass
-
There are only two left. One is unnecessary and the other can be moved
to the header file.Signed-off-by: Simon Glass
-
Much of the image code uses addresses as ulongs and pointers interchangeably,
casting between the two forms as needed.This doesn't work with sandbox, which has a U-Boot RAM buffer which is
separate from the host machine's memory.Adjust the cost so that translating from a U-Boot address to a pointer uses
map_sysmem(). This allows bootm to work correctly on sandbox.Note that there are no exhaustive tests for this code on sandbox, so it is
possible that some dark corners remain.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut (v1) -
This is the main entry point to the FIT image verification code. We will
be using it to handle image verification with signatures, so rename the
function.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
The FIT code is about half the size of the >3000-line image.c. Split this
code into its own file.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
One we split out the FIT code from image.c we will need this function.
Export it in the header.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
Rather than repeat the line
#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || \
defined(USE_HOSTCC)everywhere, put this in a header file and #define IMAGE_ENABLE_TIMESTAMP
to either 1 or 0. Then we can use a plain if() in most code and avoid
the #ifdefs.The compiler's dead code elimination ensures that the result is the same.
Signed-off-by: Simon Glass
Acked-by: Marek Vasut
28 Mar, 2013
1 commit
-
Signed-off-by: Steven Stallion
Cc: Tom Rini
Reviewed-by: Tom Rini
01 Mar, 2013
1 commit
-
We have an existing header which the crc32 definitions, so use it.
Signed-off-by: Simon Glass
08 Feb, 2013
1 commit
-
and, if including libfdt.h which includes libfdt_env.h in
the correct order, don't include fdt.h before libfdt.h.this is needed to get the fdt type definitions set from
the project environment before fdt.h uses them.Signed-off-by: Kim Phillips
Cc: Jerry Van Baren
14 Dec, 2012
2 commits
-
Remove the hard-coded loadaddr handler and use a callback instead
Signed-off-by: Joe Hershberger
-
Move the getenv_yesno() to env_common.c and change most checks for
'y' or 'n' to use this helper.Signed-off-by: Joe Hershberger
13 Nov, 2012
1 commit
-
When booting a fit image with multiple configurations, the user either has to
specify which configuration to use explicitly, or there has to be a default
defined which is chosen automatically. This change adds an option to change
that behavior so that a configuration can be selected explicitly, or the
configuration which has the device tree that claims to be compatible with the
earliest item in U-Boot's device tree.In other words, if U-Boot claimed to be compatible with A, B, and then C, and
the configurations claimed to be compatible with A, D and B, D and D, E, the
first configuration, A, D, would be chosen. Both the first and second
configurations match, but the first one matches a more specific entry in
U-Boot's device tree. The order in the kernel's device tree is ignored.Signed-off-by: Gabe Black
Commit-Ready: Gabe Black
Signed-off-by: Simon Glass
05 Nov, 2012
1 commit
-
command.c:44:38: error: bad constant expression
dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer
dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer
dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer
dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer
dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer
dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer
dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer
dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer
dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer
dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer
dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer
dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer
dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer
dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer
dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer
dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer
dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer
dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer
dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer
dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer
hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static?
hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static?
hush.c:2175:20: warning: Using plain integer as NULL pointer
hush.c:2175:34: warning: Using plain integer as NULL pointer
hush.c:2210:41: warning: Using plain integer as NULL pointer
hush.c:2216:45: warning: Using plain integer as NULL pointer
hush.c:2249:25: warning: Using plain integer as NULL pointer
hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static?
hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static?
hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static?
hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static?
hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static?
hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static?
hush.c:3295:34: warning: Using plain integer as NULL pointer
hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static
image.c:1282:29: warning: Using plain integer as NULL pointer
image.c:1315:41: warning: Using plain integer as NULL pointer
image.c:1330:25: warning: Using plain integer as NULL pointer
image.c:1706:25: warning: Using plain integer as NULL pointer
main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static?
main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static?
main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static?
usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static?
usb_storage.c:440:48: warning: Using plain integer as NULL pointer
usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static?
usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static?
usb_storage.c:629:55: warning: Using plain integer as NULL pointer
usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static?
usb_storage.c:675:43: warning: Using plain integer as NULL pointer
usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static?
usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static?
usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh
xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static?
xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static?
xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be statnote: hush.c's nesting_level deleted because not used.
Signed-off-by: Kim Phillips
16 Oct, 2012
2 commits
-
Allow the itb file to declare to u-boot that its hash should not be
checked automatically on bootm or iminfo. This allows an image to
either be checked automatically or to include a script which may
check it otherwise (such as after part of the itb has been relocated
to RAM by the script).Signed-off-by: Joe Hershberger
-
Before this patch, error codes returned from fdtlib were ignored and
continued access would cause a crash. Now just check if the image is
truncated and error if so.Signed-off-by: Joe Hershberger
26 Sep, 2012
1 commit