summaryrefslogtreecommitdiff
path: root/tools/rkimage.c
AgeCommit message (Collapse)Author
2018-10-04rockchip: Fix rkimage format for SPL boot over USBDaniel Gröber
The 'rkimage' format used for booting rockchip boards over USB seems to have been broken since commit 7bf274b9caab ("rockchip: mkimage: use imagename to select spl hdr & spl size"). That commit adds an offset of RK_SPL_HDR_START(=2048) to the location the 'RKxx' header is written at. However the bootrom expects this header to be the first four bytes of the image, not at offset 2048. This appears to have been a copy paste error since the 'rksd' and 'rkspi' image types do require this offset. Furthermore commit 111bcc4fb6cb ("rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for RK3399"), commit 3d54eabcafec9 ("rockchip: spl: RK3399: use boot0 hook to create space for SPL magic") and commit 308277569229 ("rockchip: mkimage: update rkimage to support pre-padded payloads") changed the way the space for the 'RKxx' header is allocated and written to the image without adjusting 'rkimage'. This commit fixes those mistakes and makes it possible to load u-boot SPL over USB once more. (Tested on RK3399) Signed-off-by: Daniel Gröber <daniel@dps.uibk.ac.at> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-05-10rockchip: mkimage: remove placeholder functions from rkimagePhilipp Tomsich
The imagetool framework checks whether function pointer for the verify, print and extract actions are available and will will handle their absence appropriately. This change removes the unnecessary functions and uses the driver structure to convey available functionality to imagetool. This is in fact better than having verify just return 0 (which previously broke dumpimage, as dumpimage assumed that we had handled the image and did not continue to probe further). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-03-16rockchip: mkimage: Allow encoding of loader code in spl imagesHeiko Stübner
Rockchip SoCs allow the spl code to be rc4-encoded, not only the image header, but only newer SoCs allow this encoding to be disabled. The rk3188 is not part of those and requires its boot code to be rc4-encoded with the regular key. So add the ability to do this encoding via a setting on a per-soc basis when building spl images. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com>
2016-05-27rockchip: Check image name for the rksd imageSimon Glass
We need a correct name (rk3288, rk3036) so check this to avoid a crash later. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-12-13rockchip: mkimage: use imagename to select spl hdr & spl sizeJeffy Chen
Our chips may have different spl size and spl header, so use imagename(passed by "mkimage -n") to select them now. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-12-13Revert "rockchip: Add max spl size & spl header configs"Jeffy Chen
This reverts commit 10b4615f9d7e177ec7fe644fbb2616e0e0956f6e Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-12-01rockchip: Add max spl size & spl header configsJeffy Chen
Our chips may have different max spl size and spl header, so we need to add configs for that. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org> Dropped CONFIG_ROCKCHIP_MAX_SPL_SIZE from rk3288_common.h, Added $(if...) to tools/Makefile to fix widespread build breakage Signed-off-by: Simon Glass <sjg@chromium.org> Series-changes: 8 - Drop CONFIG_ROCKCHIP_MAX_SPL_SIZE from rk3288_common.h, - Add $(if...) to tools/Makefile to fix widespread build breakage
2015-09-02rockchip: Add the rkimage format to mkimageSimon Glass
Rockchip SoCs require certain formats for code that they execute, The simplest format is a 4-byte header at the start of a binary file. Add support for this so that we can create images that the boot ROM understands. Signed-off-by: Simon Glass <sjg@chromium.org>