Commit graph

320 commits

Author SHA1 Message Date
Sascha Hauer
1b099f06ca imx-usb-loader: whitespace fixup
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-16 09:46:39 +01:00
Florian Vallee
79942715f0 imx-usb-loader: Add i.MX6ul support
Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-16 09:46:11 +01:00
Sergey Koshechkin
13226470af docproc: drop unused utility
Signed-off-by: Sergey Koshechkin <serge.koshechkin@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 07:56:02 +01:00
Sergey Koshechkin
d7f29650e4 mk-omap-image: make some locally used functions static
Signed-off-by: Sergey Koshechkin <serge.koshechkin@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-10 08:41:13 +01:00
Sascha Hauer
b5c7b09c8a Merge branch 'for-next/mvebu' 2015-11-06 16:10:44 +01:00
Sascha Hauer
1d9295b344 Merge branch 'for-next/misc' 2015-11-06 16:10:42 +01:00
Alexander Aring
ad0aadfda3 checkpatch: fix left brace warning
Running checkpatch with perl version 5.22 occur the following warnings:

Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2017.
Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2267.
Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2268.
...
lot of weird things
...
)\(.*\).*\s{ <-- HERE / at ./scripts/checkpatch.pl line 2016.

This patch fix these warning, an similar commit was done in linux kernel
commit: 4e5d56bdf892e18832a6540b63ebf709966bce2a ("checkpatch: fix left
brace warning").

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 16:45:42 +01:00
Sascha Hauer
58eae8361c ARM: Allow compressed dtb binaries
In the current multi image build process the DTBs end up uncompressed
in the PBL. This can be annoying because the PBL is often very size
constrained.
This patch allows to put the DTBs in as lzo compressed binary into
the PBL. Since lzo offers quite good compression ratios for DTBs no
other compression algorithm has been implemented for now.
Boards which want to use the compressed DTBs only have to change
the __dtb_ prefix in the DTB name to __dtb_z_. Also they should select
ARM_USE_COMPRESSED_DTB to make sure barebox supports uncompressing
the DTB.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 10:02:28 +01:00
Sascha Hauer
fe89df4ed9 scripts/kwbimage: Make BINARY files relative to config file
The BINARY files given in the config files are expected to be relative
to the place kwbimage is called from. This is bad since it breaks where
kwbimage is called from the build directory and not the source
directory.
It makes more sense to make the paths in the config files relative
to the config files which works with out of tree builds and is also
more what a user normally expects.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-19 08:39:25 +02:00
Sascha Hauer
119f75f23a scripts/kwbimage: Move configfile opening to the function that reads it
The configfile is read in image_create_config_parse(), so move opening
the file to there aswell and pass the configfile as filename instead of
FILE *.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-19 08:39:18 +02:00
Sascha Hauer
4ee01d2b46 Merge branch 'for-next/misc' 2015-08-06 12:33:15 +02:00
Sascha Hauer
71a2ad25b1 scripts: imx-image: Make in-place capable
Read in the source image completely before starting to write the output
image. This makes it possible to pass the same file as input and output.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:00 +02:00
Sascha Hauer
99b591a779 scripts: imx-image: Do not pad image
We have to pad the load size to the next 4k boundary, but only for the
HAB4 case we actually care what data is loaded in the rest of the image.
This lets the padding depend on the prepare_sign option.

Background for this patch is a new yet-to-be-introduced image loading
mechanism for i.MX. This new mechanism only loads the PBL portion of
the image to memory, and not the whole image anymore. This means that
the image in this case changes from:

i.MX header (with loadsize: whole image), PBL, payload, padding

to:

i.MX header (with loadsize: header + PBL + padding), PBL, padding, payload

With the padding between PBL and payload we are no longer able to find
the payload, so we cannot add the padding there.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:37:53 +02:00
Sascha Hauer
2afe71f567 socfpga_mkimage: Fix/clarify error message
The actual max_image_size may be smaller than the define MAX_IMAGE_SIZE
due to the additional header needed, so print max_image_size in the
error message. Also, when complaining about a too big image say how big
the image actually is.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-08 08:19:31 +02:00
Sascha Hauer
1d7c8ec143 ARM: OMAP: Add omap3 USB loader tool
The OMAP3 supports uploading the first stage bootloader via USB.
The ROM leaves the MUSB controller enabled and it can then be used
to upload a 2nd stage image. This patch adds the omap3-usb-loader tool
and the necessary barebox support to upload the 2nd stage image.

The omap usb loader tool is downloaded from https://github.com/grant-h/omap_loader
and changed to also accept CHSETTINGS images.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 08:20:48 +02:00
Sascha Hauer
e544ffd123 scripts: Add mxs-usb-loader to .gitignore
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 07:59:40 +02:00
Wadim Egorov
cb50b4ed51 scripts/omap_signGP: Fix image size in GP header
The size field in the GP header has to include its own size.
This can be easily misread in the TRM.

Sometimes, when the gp_header size is not included, the ROM code
will not copy the complete MLO into the SRAM. This happens when the MLO file
size is 98823 bytes (and the value of GP header size field is 98303 bytes).

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-17 07:46:48 +02:00
Sascha Hauer
61c7946448 Merge branch 'for-next/socfpga' 2015-06-09 09:26:44 +02:00
Steffen Trumtrar
eb963c6c28 scripts: update socfpga_sequencer importer to Quartus 15.0
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:12:53 +02:00
Andrey Smirnov
6f1d94b889 imx-image: Correctly fill image size in prepended header
If called with '-b' option 'imx-image' tool prepends barebox header to
the image, but the tool does not fill the data at image size offset
correctly. Fix that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov
c66574342d Makefile.lib: Make 'check_file_size' more flexible
Make 'check_file_size' more flexible by not hardcoding the file whose
size is going to be checked to '$@'. This way it is possible to use
this subroutine to check the size of files other than the target of
the rule.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:40 +02:00
Sascha Hauer
3975737a7d Merge branch 'for-next/misc' 2015-05-06 21:36:13 +02:00
Antony Pavlov
9496896fbf checkpatch: add DT compatible string documentation checks
This adds a simple check that any compatible strings in DeviceTree dts
files are present in Documentation/devicetree/bindings and
in dts/Bindings/.

Vendor prefixes are also checked for existing in vendor-prefixes.txt.

This code is based on linux v4.0-rc6 checkpatch.pl dt-checking code by
Rob Herring & Florian Vaussard:

    Rob Herring (2):
        checkpatch: add DT compatible string documentation checks
        checkpatch: fix wildcard DT compatible string checking

    Florian Vaussard (3):
        checkpatch: fix spurious vendor compatible warnings
        checkpatch: check compatible strings in .c and .h too
        checkpatch: improve the compatible vendor match

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Florian Vaussard <florian.vaussard@epfl.ch>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-28 10:33:17 +02:00
Marc Kleine-Budde
d3be1ab1fc images: add HABv4 support for i.MX6
This patch adds high assurance boot support (HABv4) image generation to
barebox, currently tested on i.MX6 only.

In order to build a signed barebox image, add a new image target to
images/Makefile.imx as illustrated in the diff below:

- - - a/images/Makefile.imx
+ + + b/images/Makefile.imx
@@ -163,10 +163,14 @@ image-$(CONFIG_MACH_SABRELITE) += barebox-freescale-imx6dl-sabrelite.img
 pblx-$(CONFIG_MACH_SABRESD) += start_imx6q_sabresd
 CFG_start_imx6q_sabresd.pblx.imximg = $(board)/freescale-mx6-sabresd/flash-header-mx6-sabresd.imxcfg
 FILE_barebox-freescale-imx6q-sabresd.img = start_imx6q_sabresd.pblx.imximg
 image-$(CONFIG_MACH_SABRESD) += barebox-freescale-imx6q-sabresd.img

+CSF_start_imx6q_sabresd.pblx.imximg = $(havb4_imx6csf)
+FILE_barebox-freescale-imx6q-sabresd-signed.img = start_imx6q_sabresd.pblx.imximg.signed
+image-$(CONFIG_MACH_SABRESD) += barebox-freescale-imx6q-sabresd-signed.img
+

Here the default i.MX6 CSF file $(havb4_imx6csf) is used, it's generated during
build on from the template "scripts/habv4/habv4-imx6.csf.in". You can configure
the paths to the SRK table and certificates via: System Type -> i.MX specific
settings -> HABv4 support.

The proprietary tool "cst" by Freescale tool is expected in the PATH.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Marc Kleine-Budde
b6c786528b imx-image: add option to prepare image for HAB signing
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Marc Kleine-Budde
7cb4778e7f imx-image: pad generated image to 4k
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde
4a50ffc746 imx-image: main: make use of round_up instead of open coding it
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde
5e5ced6073 imx-image: mx35: increase load image size, due to dobule header
Since commit:

    690e392027 imx-image: handle i.MX35 special case

the IVT+DCD header is placed both at 0x0 and 0x1000, this patch reflects this
change and increases the load image size accordingly.

Cc: Eric Bénard <eric@eukrea.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde
8acb4e65ce imx-image: introduce HEADER_LEN and replace several 0x1000 and 4096
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde
15034f8fa8 imx-image: replace 0x400 by FLASH_HEADER_OFFSET
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde
01e879bcdf imx-image: add_header_v2(): replace hardcoded 0x400 by offset parameter
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Sascha Hauer
5544581e98 Merge branch 'for-next/socfpga' 2015-03-09 08:30:38 +01:00
Steffen Trumtrar
d957339439 scripts: socfpga: statify sys_mgr_init_table
The preloader import-script misses the sys_mgr_init_table variable.
When multiple boards are build, this will lead to compile errors,
because the variable exists multiple times.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-06 07:43:10 +01:00
Jan Luebbe
12888ae902 scripts/dtc: Update to upstream version 1.4.1
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-05 08:46:05 +01:00
Jan Luebbe
c1ab1e22c7 scripts/dtc: import update-dtc-source.sh from kernel v4.0-rc1
The original script was written by Grant Likely <grant.likely@linaro.org>.
The version for barebox also imports some libfdt sources, so that we are
able to compile the fdtget host tool. Also remove the unused non-kconfig
makefiles.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-05 08:46:05 +01:00
Steffen Trumtrar
093dd1e7be scripts: socfpga: add coccinelle magic
Use coccinelle to cleanup the imported u-boot code some more.
This will remove:
	- debugging macros (TCL_RPT, BFM_STAGE, ALTERA_ASSERT)
	- empty if/else/for blocks resulting from macro deletion
	- some unused functions (scc_mgr_xxx)

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-02 07:43:25 +01:00
Steffen Trumtrar
e9cd1542cc scripts: add socfpga preloader-files importer
Add script to automatically import and fixup the autogenerated handoff files
into the board folder.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-02 07:43:25 +01:00
Lucas Stach
603ba8c1ba scripts: fix warning generated by glibc 2.20
Defining only _BSD_SOURCE is deprecated with version 2.20 of
glibc. It has been replaced by _DEFAULT_SOURCE. The manpage says
that code which wants to work in the same way on both old and new
versions of glibc should simply define both symbols.

Also move the definition up in fix_size as those feature flags
should be defined before including any standard headers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-02 07:32:01 +01:00
Sascha Hauer
35405138c8 Merge branch 'for-next/socfpga' 2015-02-04 19:09:16 +01:00
Sascha Hauer
ce961e3412 Merge branch 'for-next/misc' 2015-02-04 19:09:15 +01:00
Wadim Egorov
f0f6a7477b Fix spelling: pathes -> paths
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-28 10:02:56 +01:00
Antony Pavlov
ad3c55fbf2 scripts/checkpatch.pl: don't search for CREDITS when checking top_of_kernel_tree()
The CREDITS file is removed in the commit

    commit 6570288f2d
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    Date:   Tue Jan 13 14:27:07 2015 +0900

        Remove the CREDITS file

But checkpatch.pl still trying to check it presence.
There is not such CREDITS file and checkpatch.pl exits with
'Must be run from the top-level dir. of a kernel tree' message.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-20 07:57:19 +01:00
Jean-Christophe PLAGNIOL-VILLARD
616b343493 kconfig/menu.c:590: fix warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-13 08:47:30 +01:00
Markus Pargmann
4e6ab1a1fa scripts: socfpga sequencer extraction tool
This script extracts the socfpga sequencer from a generated u-boot
automagically. The resulting changes of the barebox tree should be
enough to compile with the new sequencer.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-13 08:42:16 +01:00
Sascha Hauer
27114b30bc scripts: Add mxs-usb-loader tool
This is directly taken from the rockbox projects sbloader tool,
just renamed to mxs-usb-loader to avoid confusion with bareboxes
several different image tools.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer
2b50a12c1e scripts: Add mxsboot tool
Copied from U-Boot v2014.10 and changed to use getopt instead
of handcrafted parsing.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer
d19dff8f15 scripts: add mxsimage tool
This is copied from U-Boot v2014.10 and modified for use with
barebox:

- Add a main() function to make it a standalone tool
- Add option to pass in the prepare stage and bootloader
  image as options. If the config file contains @PREP@ or
  @BOOTLOADER@ the string will be replaced with the actual
  image file passed via the -p and -b options.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer
d3933bd350 Merge branch 'for-next/marvell' 2014-12-08 14:53:59 +01:00
Sascha Hauer
4b59e92dc7 Merge branch 'for-next/kconfig' 2014-12-08 14:53:59 +01:00
Sascha Hauer
18895514dc kconfig: update to v3.18-rc6
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 15:42:07 +01:00