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>
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>
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>
We assumed that there is a special image format for SPI. This is not
the case. The AM33xx can boot either images generated with omap_signGP
or raw images which only have the image size and load address in front
of the image. Whether these images are booted from SPI or another
boot medium doesn't matter. The only special thing about SPI is that
the image is in big endian format.
- renames mk-am3xxx-spi-image.c to mk-omap-image.c as the image format
is not only supported by AM3xxx but also by the OMAP SoCs
- removes the option to specify the SoC
- introduces -s to build a big endian image
- detects if an image already is an image generated with omap_signGP
So the behaviour is like this:
raw image -> mk-omap-image -> prepend size/address -> image for SD/MMC
raw image -> mk-omap-image -s -> prepend size/address, big endian swap -> image for SPI
CH image -> mk-omap-image -> nothing, input == output
CH image -> mk-omap-image -s -> big endian swap -> image for SPI
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It's often useful to get some information about a barebox image
before starting or flashing it. This patch introduces barebox
Image MetaData (IMD). When enabled a barebox image will contain
a list of tags containing the desired information. We have tags
for:
- the barebox release (2014.07.0-00160-g035de50-dirty)
- the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014)
- the board model the image is intended for
- the device tree toplevel compatible property
Also there is an additional generic key-value store which stores
parameters for which no dedicated tag exists. In this patch it
is used for the memory size an image supports.
Since there is no fixed offset in a barebox image which can be
used for storing the information, the metadata is stored somewhere
in the image and found by iterating over the image. This works
for most image types, but obviously not for SoC images which are
encoded or encrypted in some way.
There is a 'imd' tool compiled from the same sources for barebox,
for the compile host and for the target, so the metadata information
is available whereever needed.
For device tree boards the model and of_compatible tags are automatically
generated.
Example output of the imd tool for a Phytec phyFLEX image:
build: #889 Wed Jul 30 16:08:54 CEST 2014
release: 2014.07.0-00167-g6b2070d-dirty
parameter: memsize=1024
of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl
model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Needed to built the BCTs and bootable images.
Version 1.2 from https://github.com/NVIDIA/cbootimage.git
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
mk-am35xx-spi-image can only build AM35xx images. Rename
the tool to mk-am3xxx-spi-image and add support for the AM33xx.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds the crc32 command to be build
as host and optionally as target tool.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a tool for installing kernels according to the bootloader
spec. systemd already has a similar tool, but it is limited to installing
kernels on the currently running system. The barebox kernel-install
tool instead can also be used to install kernels on removable media on a
development host for cross development. It is compiled in two variants,
as 'kernel-install' for the host and as 'kernel-install-target' using
$CROSS_COMPILE.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
using obj-y for targetprogs only works until only a single program
is compiled. Adding the second one will end up in the linker trying
to link both together.
Add targetprogs-y to fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The Altera SoCFPGAs expect a simple header for their first stage
loaders. This adds a tool to generate images for the SoCFPGAs. The
header is either embedded into the image or optionally prepended
to the image. In this case code is added to jump over the image
header.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will allow to write the size of barebox at an offset of the binary
this is needed for ARM when using relocated binary
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds host tools for i.MX to generate the i.MX internal
flash header format and a tool to upload these images to an
i.MX SoC via USB.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This tool is used with Marvell EBU SoC to trigger the UART boot mode
provided by the SoC BootROM, and push the bootloader image to the
target using the Xmodem protocol.
It has been taken from the U-Boot source code, with minor
modifications to make it work with Armada 370/XP platforms.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The Marvell EBU SoCs (Kirkwood, Armada 370, Armada XP) have a BootROM
that understand a specific image format, composed of a main header,
several extension headers and a paylod. This image can be booted from
NAND, SPI, SATA, UART, NOR, etc.
This patch adds a tool that allows to extract the components and
configuration of existing images, and to create new images.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bootrom only reads an image if the correct checksum is present in the
header. The calculation is pretty simple:
sum over all words from 0x20 to 0x44
Two of this words are the image length. That is why the checksum can not be
calculated until barebox_image_size is known.
The easiest solution is a program that has to be run after make.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Booting from SPI on an AM35xx (and possibly other TI SOCs) requires
a special format:
- 32 bit image size in big-endian
- 32 bit load address in big-endian
- binary image converted from little- to big-endian
The mk-am35xx-spi-image tool converts barebox.bin to
this format.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This image header is used for booting from SPI using the TI User
Boot Loader (UBL).
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bareboxenv script build for the target does not work on
all architectures, so make it optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To use barebox as a BIOS based bootloader for x86 architectures, the binary
must be patched to get it bootstrapped at runtime. The 'setupmbr' tool installs
the barebox-binary to the given device node or image file and patch it in
accordance to the needed sector information at runtime.
Signed-off by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>