The rsa signature use a padding algorithm. By default, we use the
padding pkcs-1.5. In order to add some new padding algorithm, we
add a padding framework to manage several padding algorithm.
The choice of the padding is done in the file .its.
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 20031567e12bb312bff95b70767f6275e20f0346)
Conflicts:
common/image-fit.c
lib/rsa/rsa-sign.c
lib/rsa/rsa-verify.c
Change-Id: Ie522fec1ea69e6b86ebde0f7dad91a45670da66b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
rk3399_miniloader_v1.25 read ImageSize from ComponentData first now.
So copy ImageSize to ComponentData (named LoadSize).
For other chips, ComponentDate->LoadSize is reserved area, it no
inflence on other chips.
Signed-off-by: zain wang <wzz@rock-chips.com>
Change-Id: I51468aa3fad90d8999c1943ab9c720f7c90cefc1
It seems this check is default enabled in high version DTC,
so let's force disable this noisy check since we don't care
about "reg" property for fit image.
<stdout>: Warning (unit_address_vs_reg): Node /images/uboot@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /images/uboot@1/hash@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /images/optee@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /images/optee@1/hash@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /images/fdt@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /images/fdt@1/hash@1 has a unit name, but no reg property
<stdout>: Warning (unit_address_vs_reg): Node /configurations/conf@1 has a unit name, but no reg property
......
Change-Id: I7d934bce66742c76397c004def1919bf4c6e7672
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Support packing optional second level boot-loader:
$ ./tools/mkimage -n rk3399 -T rksd -d \
rk3399_ddr_800MHz_v1.24.bin:rk3399_miniloader_v1.19.bin out -v
Adding Image rk3399_ddr_800MHz_v1.24.bin
Size 116492(pad to 116736)
Adding Image rk3399_miniloader_v1.19.bin
Size 88060(pad to 88064)
Image Type: Rockchip RK33 (SD/MMC) boot image
Init Data Size: 116736 bytes
Boot Data Size: 88064 bytes
Mainly parse init file and boot file from datafile option, copy them to
the image, and padding each one to 2KB boundary.
NOTE:
I don't know much about rknand.c, and there's no way to verify it now.
The output image is unchanged though (with a few extra padding).
Haven't got any feedback from upstream yet...But whatever, let's do this!
Change-Id: I0ce98a44634cfcd8acfe9a3e2cfbe3ee0107fba4
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Muilt image bootflow requires ramdisk as a mandory component,
so that we have to pack a empty ramdisk into multi image at
some time.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I551ae832fbc68514ead0a3337148593e3113394f
Extract external data before adding verification data (must)
with '-p' args, and shrink fdt blob to minimum size excluding
the external data size.
Add more space for device tree to avoid failed when insert new
contents.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I202cba2b25306eb1023861bf8660d7ce6a1e4a34
Set 512 as default align size in order to access any image
by block unit.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I372ca7ff567816cb8369aff9d1fbe9865fa6d933
Merge all codes into resource_tool.c
Sync from kernel-4.4:
(0787850 rk: scripts/resource_tool: add sha1 for file entry)
Change-Id: Iff379458086f1623e7e5126dcb532b178d94c684
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The legacy chips like rk3188 maskrom require all IDB data with RC4,
the boot_merger pack the loader with a rc4 flag in header,
and the upgrade_tool will write the data with rc4 to IDB area.
usage:
boot_merger --rc4 RKBOOT/RK310BMINIALL.ini
and you can see log below if success with RC4:
* enable RC4 for IDB data(both ddr and preloader)
Test on rk3188.
Change-Id: If221a32a462bb43bef67aae802adff5e1e8436ac
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Usage:
(1) tools/mkimage -n rk3308 -T rksd -d tpl/u-boot-tpl.bin idbloader.img
(2) cat spl/u-boot-spl.bin >> idbloader.img
(3) upgrade_tool wl 0x40 idbloader.img
Note:
When use a ddr binary from rkbin as tpl, use it replace u-boot-tpl.bin in (1)
Change-Id: Ia6694754ed70d2d5cce04f62dcfac538291f7386
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
- still append prefix if not match legacy prefix;
- ignore append prefix for output;
Change-Id: I1a8fc77ce73cbf169af49ce40ce3a0731861c617
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.
This commit moves the header code:
include/libfdt.h -> include/linux/libfdt.h
include/libfdt_env.h -> include/linux/libfdt_env.h
and replaces include directives:
#include <libfdt.h> -> #include <linux/libfdt.h>
#include <libfdt_env.h> -> #include <linux/libfdt_env.h>
Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
There are no headers for libfdt in lib/libfdt, as they are instead
located in scripts/dtc/libfdt. Specifying lib/libfdt for headers
inclusion in host tools results in using the system libfdt headers,
which is not what we want. Change this to the proper path.
Change-Id: I3ad1329f563d1083828ce168e2c4ee791b553da8
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The only difference between scripts/dtc/libfdt/fdt_rw.c and
lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().
It is only used by fdtgrep, so we do not need to compile it for U-Boot
image. Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.
Change-Id: I6e2578d4bfdf75438d3aa1cb51f270f34527d37d
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Several host-tools use "bool" type without including <stdbool.h>.
This relies on the crappy header inclusion chain.
tools/Makefile has the following line:
HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \
All host-tools are forced to include libfdt_env.h even if they are
totally unrelated to FDT. Then, <stdbool.h> is indirectly included
as follows:
include/libfdt_env.h
-> include/linux/types.h
-> <stdbool.h>
I am fixing this horrible crap. In advance, I need to add necessary
include directives explicitly. tools/fdtgrep.c needs more; <fctl.h>
for open() and <errno.h> for errno.
Change-Id: Ic2b0e0d4c417841f7eeb152e486d63fdfd1a4eff
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
libfdt_env.h is supposed to provide system-dependent defines.
scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable
for user-space, so we should use this for USE_HOSTCC case.
For compiling U-Boot, we need to override such system-dependent
defines, so use <linux/libfdt_env.h> imported from Linux.
<libfdt.h> selects a proper one. Maybe, we should split header
inclusion completely, but I do not want too many patches at one.
I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS.
Change-Id: I6f5ea1067cd3ada1c8ece0c39b7bf43382c58ff6
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
- include: boot_merge/trust_merge/loaderimage/resource_tool/checksum;
- porting from rkdevelop and base on commit 8fd1d8f
(resource: get resource primary from boot partition);
- clean generated binary file when execute clean command;
Change-Id: I41c1893c2da0a0f25c2d39dbbd933f89fbb04948
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
this makes sure fw_printenv works normally on most
platforms without care about C library.
Change-Id: If3b942d2fadb293eeeb00695a10b708847a827ad
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Now, lib/libfdt/fdt_wip.c is the same as scripts/dtc/libfdt/fdt_wip.c
Change the former to a wrapper of the latter.
Change-Id: Ifce4c63db38146297c14218ef94d226bf6e3bb27
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 26e961c8cfdff00c5c9389d301d9a2eb10eb844c)
The patch is adding external pmufw "Platform Management Unit firmware"
to boot.bin image. Boot.bin is a Xilinx format which bootrom is capable
to read and boot the system. pmufw is copied to the header data section
follows by u-boot-spl.bin. pmufw is consumed by PMU unit (Microblaze)
and SPL runs on a53-0.
This is generated command line when PMUFW_INIT_FILE is setup.
./tools/mkimage -T zynqmpimage -R ./"" -n
./"board/xilinx/zynqmp/pmufw.bin" -d spl/u-boot-spl.bin spl/boot.bin
Change-Id: I74fc17513dd99b876ab9c08ded6ad41a7b0cd3de
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c85a6b79d10ed8a098997370cbc4fb233ddcb13b)
The tool has changed slightly since it was originally written. Update the
tests to suit.
Change-Id: I6935a7c4cc16e1a3e5c617133b12d1982e640c74
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit aab660fe18ac24ee859a203f517f939685af5e10)
The checkpatch tool was updated but the patman tests were not. Fix this.
Change-Id: Ia5ff7589c32205754eb9818ddd2ecafcc6b2b3c1
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6c328f29752224f15b7f098d8676f9eeed269a85)
Prior to this commit, tools/Makefile pulls all libfdt files from
lib/libfdt.
lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
followings 6 files:
fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
fdt_sw.c
This commit changes them to #include ones from scripts/dtc/libfdt.
Unfortunately, U-Boot locally modified the following 3 files:
fdt_ro.c fdt_wip.c fdt_rw.c
I did not touch them in order to avoid unpredictable impact.
The fdt_region.c is U-Boot own file. This is also borrowed from
lib/libfdt/.
Change-Id: I3e8fcd9f84cda502a0eca504896ab29d7f840d16
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b38ad663a4b4ccd91a43b12e2d65179dbd2b40cb)
The pylibfdt is used by dtoc (and, indirectly by binman), but there
is no reason why it must be generated in the tools/ directory.
Recently, U-Boot switched over to the bundled DTC, and the directory
structure under scripts/dtc/ now mirrors the upstream DTC project.
So, scripts/dtc/pylibfdt is the best location.
I also rewrote the Makefile in a cleaner Kbuild style.
The scripts from the upstream have been moved as follows:
lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py
lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped
The .i_shipped is coped to .i during building because the .i must be
located in the objtree when we build it out of tree.
Change-Id: I48233cbae93794809397b7160234469f66fa11dc
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 15b97f5c5e6d88e0560c6928f3acd01c999a494d)