Commit Graph

1405 Commits

Author SHA1 Message Date
Jon Lin 6520ac9cab rockchip: rkcommon: don't set image head for signed image
Reserve "RSAK" tag

Change-Id: Ibfe2e6d83bd89ce75dfa0b7fc97038037a181cab
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-12-13 15:16:21 +08:00
Joseph Chen 467d16db4b tools: rockchip: resource_tool: independent on other files
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>
2019-11-12 19:32:12 +08:00
Joseph Chen 5e817a0ea4 tools: rockchip: resource_tool: add sha1 for file entry
Change-Id: If7bd80d68019f6ea5ad737793ed996d47134b568
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 08:55:31 +08:00
Joseph Chen 3aff587f06 tools: rockchip: remove useless checksum
Change-Id: I0b40f0b0677920abfe873fd6b8db23475f113a78
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-05 12:25:19 +08:00
Jason Zhu a3ded4d4a1 rockchip: mkimage: add support for RK1808
Reserve 8K sram for maskrom.

Change-Id: I890d93b6c9a8f4ca50a2c0b30de9b07816e68e8f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-09-12 15:06:43 +08:00
Joseph Chen 24f9e652a5 tools: rockchip: boot_merger: add option to enable rc4 flag
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>
2019-06-25 08:30:37 +08:00
Joseph Chen 52243bce13 tools: rockchip: loaderimage: add "--prepath" support
Add prefix path of binary path.

Change-Id: I30fe03e0614c7724f452ad8b9d3800acd92db02c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:30:37 +08:00
Joseph Chen 5f0203b772 tools: rockchip: boot_merger: ignore "--prepath" for output path
Change-Id: I89335926cc161c484e813fbd8a699935762f1a34
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:30:37 +08:00
Joseph Chen 2e6f3f4c09 tool: rockchip: boot/trust_merger: ignore prepath when it's already exist
Change-Id: I33b1b14ba7b68ab08e1e61bf98e476da3b13b56a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-27 11:15:19 +08:00
Joseph Chen e311da2458 tools: rockchip: boot/trust_merger: add "--prepath" support
Add prefix path of binary path.

Change-Id: I576b9fa40f88a1ee0701f1ff776d25d4e3ed747b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-05-23 18:19:46 +08:00
Andy Yan 912343c03a rockchip: mkimage: add support for RK3308
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>
2019-05-09 16:48:47 +08:00
Joseph Chen 9ad3008a7c tools: rockchip: boot/trust_merger: fix prefix append error
- 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>
2019-04-11 14:28:27 +08:00
Joseph Chen 45c2a034cd tools: rockchip: boot/trust_merge: fix '--replace" missing append new path
Change-Id: Icddfb2ce9c7ba6f4b4e558eb5833ba79d0e7b976
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-11 12:15:20 +08:00
Joseph Chen 2bbbd780f8 tools: rockchip: loaderimage: print file size with KB
load addr is 0x600000!
pack input ./u-boot.bin
pack file size: 484551(473 KB)
crc = 0xfef42a0e
uboot version: U-Boot 2017.09-02804-ge3e39ee-dirty (Apr 10 2019 - 14:11:39)

Change-Id: If8fbdd943e328db41523ded47deeedfe8c6bde0e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-11 12:13:41 +08:00
Joseph Chen 7582895812 tools: rockchip: trust_merger: support "--ignore-bl32"
Change-Id: Ia8385dc1b41893d475b4f14c222dca98c9d52aba
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-13 16:54:03 +08:00
Masahiro Yamada 0e00a84cde UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
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>
2018-12-24 17:20:37 +08:00
Paul Kocialkowski fe47e2a1d2 UPSTREAM: tools: Include U-Boot libfdt headers from their actual path
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>
2018-12-24 17:20:37 +08:00
Masahiro Yamada 4e2c3b8c76 UPSTREAM: libfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c
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>
2018-12-24 17:20:37 +08:00
Masahiro Yamada 9862beb6eb UPSTREAM: tools: include necessary headers explicitly
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>
2018-12-24 17:20:37 +08:00
Masahiro Yamada fbedfcfba2 UPSTREAM: libfdt: migrate include/libfdt_env.h to a wrapper
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>
2018-12-24 17:20:37 +08:00
Joseph Chen 23ba6841cc tools: rockchip: support hostprogs for pack tools
- 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>
2018-09-28 10:12:53 +08:00
Kever Yang cab28f403d tool: rkcommon: add support for px30
PX30 have 10K sram available.

Change-Id: I67c565c84d00bc0141d79c437035993746ea9245
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-09-27 17:07:56 +08:00
Joseph Chen 0d889c3a8d tools: env: make fw_printenv statically linked
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>
2018-07-09 20:09:20 +08:00
Masahiro Yamada 70b70db64a UPSTREAM: libfdt: migrate fdt_wip.c to a wrapper of scripts/dtc/libfdt/fdt_wip.c
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)
2018-01-17 15:27:28 +08:00
Michal Simek 008a6da324 UPSTREAM: tools: mkimage: Extend mkimage to also include pmufw
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)
2018-01-17 15:27:28 +08:00
Simon Glass e71e2ceacf UPSTREAM: dtoc: Fix up tests
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)
2018-01-17 15:27:28 +08:00
Simon Glass 3abaad4c1f UPSTREAM: patman: Fix up tests to pass with newest checkpatch
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)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 141b078475 UPSTREAM: tools: use files from scripts/dtc/libfdt where possible
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)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 815366520a UPSTREAM: pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefile
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)
2018-01-17 15:27:28 +08:00
Jan Kundrát d8bee3a4c9 UPSTREAM: Do not attempt to use the systemwide libfdt
U-Boot bundles a patched copy of libfdt, so it's wrong to attempt to
include it <like/this>. This breaks the build for me when I have dtc
fully installed in my host -- as happened earlier tonight with
Buildroot, for example.

There are several other occurrences throughout the code where '<libfdt'
matches. I'm not modifying these because I have no clue why the
<systemwide> include style is being used -- IMHO wrongly.

Change-Id: Ie733b1454f8d76439abee770af54eca3699323f7
Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b95a5190ba9284a06f9d0c56589bcb4080b4710a)
2018-01-17 15:27:28 +08:00
Stefan Agner adf9b6dead UPSTREAM: tools: env: allow to print U-Boot version
The fw_env utility family has a default environment compiled in
which ties it quite strongly to the U-Boot source/config it has
been built with. Allow to display the U-Boot version it has been
built with using the -v/--version argument.

Change-Id: Iba67d9f520d9315874758ddafe9d277610719c9d
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 84d46e7e8948780d7ca20c24dfc7b653b900f728)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 710f83a718 UPSTREAM: tools: image: fix node name of signature node in FIT
Both "conf_name" and "sig_name" point to the name of config node.
The latter should be the name of the signature node.

Change-Id: I2be3ce4c9644a9dd6814d63cbc49f6e9348490d5
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 16067e6b87293eeb1fc4bac3edc0fd675b94d1a8)
2018-01-17 15:27:28 +08:00
Bin Meng 18a87e935e UPSTREAM: tools: env: Add embedded.c to .gitignore
Change-Id: I81b0fec8fef268598f054103e859250315218ef9
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3b306c37cdf7488254d078ce63f508eaedb2be41)
2018-01-17 15:27:28 +08:00
Tuomas Tynkkynen 9a544e36a8 UPSTREAM: env: Drop CONFIG_ENV_IS_IN_DATAFLASH
Last user of this option went away in commit:

fdc7718999 ("board: usb_a9263: Update to support DT and DM")

Change-Id: Ie6cec28e4daf26b669f3f35db026427bdb47a5b6
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7b7341d7f3ee915c89a7f8ab7054e39872057d90)
2018-01-17 15:27:28 +08:00
Mirza, Taimoor 8cc080c024 UPSTREAM: tools/mkimage: Fix DTC run command to handle file names with space
fit_handle_file function does not quote input and output files while preparing
command to run DTC to convert .its to .itb. This results in a failure if input
or output files contain spaces in their names. Quote input and output files in
DTC command to avoid this failure.

Change-Id: I866d740ef8e2c9f28059c55757bbcbdb017cd74a
Signed-off-by: Mirza, Taimoor <Taimoor_Mirza@mentor.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a6e9810495bc929b6beafb88f557cdaadf87fc83)
2018-01-17 15:27:28 +08:00
Tom Rini 017aad0449 UPSTREAM: cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity
The recent changes to these files did not completely fix the previous
issues, or introduced different (minor) issues.  In cmd/gpt.c we need to
dereference str_disk_guid to be sure that malloc worked.  In
cmd/nvedit.c we need to be careful that we can also fit in that leading
space when adding to the string.  And in tools/fit_image.c we need to
re-work the error handling slightly in fit_import_data() so that we only
call munmap() once.  We have two error paths here, one where we have an
fd to close and one where we do not.  Adjust labels to match this.

Change-Id: I66fafd0ed8d1c290a7773bba5ece8d11bfc15b50
Reported-by: Coverity (CID: 167366, 167367, 167370)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf52fcdef4aac242b5e6b6b9827acf6d69ce1951)
2018-01-17 15:27:28 +08:00
Tom Rini 0757e90bee UPSTREAM: tools/fit_image.c: Update some return code paths
Coverity has found some problems with the return paths in parts of this
code.  We have a case where we were going to the wrong part of the
unwind (open() failed so we cannot close the fd), a case where we were
only free()ing our buf on the error path and finally a case where we did
not munmap in the failure path.

Change-Id: I31ee7b7099b7f2a4ec0c11c247029df5eb9d8552
Reported-by: Coverity (CID: 138492, 138495, 143064)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3c2dff5490831f85f06aa78aad5ef537b661cecf)
2018-01-17 15:27:28 +08:00
Tom Rini f8470aee13 UPSTREAM: tools/mkimage: Make the path to the dtc binary that mkimage calls configurable
In some cases, such as FreeBSD, the path to an alternative dtc needs to
be used.  Rather than override the one given in the Makefile on the
command line, make this part of the build configuration.

Change-Id: Ib4e2b2603f22098edb11bf3f03be32a86b2d2f1a
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 1f6049e2501b5c35c61435dbc05ba96743202674)
2018-01-16 18:17:07 +08:00
Simon Glass d3aac30ed7 UPSTREAM: patman: Fix error when the email blacklist is missing
This section of the settings file may be missing. Handle that gracefully
rather than emitting an error.

Also update patman to write this section when a new settings file is
created.

Fixes: e11aa602 (patman: add support for omitting bouncing addresses)

Change-Id: I52174b84a9a28e3431fd039185f6e4d521bc037b
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Chris Packham <judge.pckham@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ad8931400b193f701a415e7f69f1ad454d1b0380)
2018-01-16 18:14:09 +08:00
Chris Packham ad6e7aa6ce UPSTREAM: patman: add support for omitting bouncing addresses
Add support for reading a list of bouncing addresses from a in-tree file
(doc/bounces) and from the ~/.patman config file. These addresses are
stripped from the Cc list.

Change-Id: I0b4b4107a579b344034c750d63b838ef7960f96e
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com <mailto:philipp.tomsich@theobroma-systems.com>>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit e11aa602abd3e8007dfd3ed23ebb829101abcfec)
2018-01-16 18:13:59 +08:00
Simon Glass 48545cfb07 UPSTREAM: moveconfig: Use fd.write() instead of print >>
Adjust this code so that it can work with Python 2 and 3.

Fixes: d73fcb1 (moveconfig: Support building a simple config database)
Change-Id: Ifad4813594adfaf6504cc85f2ee99afb9d1c0fd2
Reported-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c79d18c4b40d10c0a95b56e51f4517aca4515364)
2018-01-16 18:13:59 +08:00
Simon Glass 0c69cd527f UPSTREAM: genconfig.py: Print defconfig next to warnings
At present we sometimes see warnings of the form:

/tmp/tmpMA89kB:36: warning: overriding the value of CMD_SPL.
	Old value: "y", new value: "y".

This is not very useful as it does not show whch defconfig file it relates
to. Update the tool to show this.

Change-Id: Ib4e5c75fa4e7948744d293a8b4d8f07e4474a0ff
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 8639f69a61b47971dba47ab5ed72e47436729bb1)
2018-01-16 18:13:59 +08:00
Joseph Chen d2975239b8 rockchip: support pack resources into resource.img
This script supports pack charge pictures into resource.img

Usage:
 ./pack_resource.sh <input resource.img>

Change-Id: If0577a62d58a0c93826ac6c0db5df7872dced964
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Philipp Tomsich 6053e13978 UPSTREAM: rockchip: mkimage: remove unused code-paths (spl_boot0 is now implied)
With all targets converted to generate prepadded images, this removes
the spl_boot0 field from our config structure and removes the unused
code-path (for images that are not prepadded): i.e. spl_boot0 is now
implied as 'true' and the code is specialised by removing the other
case.

Change-Id: Ib3d90539acb72e01c31a9da819ba8b46134bcb5e
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2017-11-08 15:20:53 +08:00
Kever Yang 6bd5a2c444 UPSTREAM: rockchip: mkimage: use spl_boot0 for all Rockchip SoCs
Enable the spl_boot0 in SPL and use the pre-padding TAG memory,
the mkimage do not need to pad it but only need to replace the value
with correct TAG value.

Change-Id: I5ae7b402c9958774acd9eac95e9417c48854c035
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2017-11-08 10:39:56 +08:00
Paweł Jarosz 6f14746b0c rockchip: mkimage: add support for rockchip nand boot image
The Rockchip boot ROM requires a particular file format for booting from NAND:

* It starts with 512-byte, rc4 encoded header and is aligned to nand page size

* Then first 2KB of first stage loader (tpl) aligned to nand page size
* n empty pages

* second 2KB of first stage loader (tpl) aligned to nand page size
* n empty pages

* ...

* first 2KB of second stage loader (spl) aligned to nand page size
* n empty pages

* second 2KB of first stage loader (spl) aligned to nand page size
* n empty pages

* ...

Size of spl and tpl must be aligned to 2KB.

example usage for nand with page size 16384 and one empty page in iteration:

    # mkimage -n rk3066 -T rknand -d ./u-boot/tpl/u-boot-tpl.bin:./u-boot/spl/u-boot-spl.bin -X 16384,1 out

Change-Id: Ie4ecb50637449251956a868272ce51ef489c7a1e
Signed-off-by: Paweł Jarosz <paweljarosz3691@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-07 16:30:53 +08:00
Kever Yang 7c2f4ca09f rockchip: tool: update rk3328 spl_boot0
rk3328 is a 64bit SoC, do have spl_boot0.

Change-Id: I26a472213f7f9a66a2fc6167d7ff4986de5e3a33
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-07 11:06:47 +08:00
Kever Yang 7336d5ed65 rockchip: mkimage: add support for rk3128 soc
Add support for rk3128 package header in mkimage tool.

Change-Id: Ida30dda9c3bceccc81dad0780f2a46d97e13c38c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-09-29 09:36:13 +08:00
Simon Glass 3b103c4e39 dtoc: Add a header to the generated files
Add a header that indicates that the files generated by dtoc should not be
modified.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-12 16:04:38 +08:00
Simon Glass 54d1a4b76c dtoc: Support properties containing multiple phandle values
At present dtoc has a very simplistic view of phandles. It assumes that
a property has only a single phandle with a single argument (i.e. two
cells per property).

This is not true in many cases. Enhance the implementation to scan all
phandles in a property and to use the correct number of arguments (which
can be 0, 1, 2 or more) when generating the C code. For the struct
definitions, use a struct which can hold the maximum number of arguments
used by the property.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-12 16:04:37 +08:00