| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The LZO compression hasn't been updated since 2017 and embedded build
tools like Yocto dropping the support for it [1]. So switch to LZ4 as
default since this seems to be the most comparable compression standard
according Ahmads measurements [2] and the kernel suggestion [3].
[1] https://lore.kernel.org/all/20220524152401.1663317-9-ross.burton@arm.com/
[2] https://lore.barebox.org/barebox/20220713100922.1880282-1-a.fatoum@pengutronix.de/
[3] https://lkml.org/lkml/2020/7/1/848
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221206112614.2612071-1-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With DEBUG_LL enabled, hashes are printed to show mismatches, but each
byte is padded with 6 or 14 zeroes and has a line just for itself.
Rework this, so it now looks a lot cleaner:
CH 40e941dfcf53087b86e549fbc279cbc1d4fd87c64febb42af6324c5b3ec64e03
IH 3aa627d34b97f4a6af6a4ebf022236dc4b025c5902296b694a65eb6b92f8d66d
While at it, print a hexdump of the first 64 bytes of the buffer
that could not be verified. This is only printed when DEBUG is
enabled and serves as a first aid to debugging as verification failure
is not an expected occurrence with firmware baked into barebox PBL.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221019123817.1659468-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like U-Boot, barebox has two standard output streams:
CONSOLE_STDOUT and CONSOLE_STDERR in addition to the input stream
CONSOLE_STDIN.
>From a consumer view, the console.active device parameter allows
restricting which of these streams interact with a given console.
>From a provider view, only CONSOLE_STDOUT is ever used. dputs
dputc allow passing in CONSOLE_STDERR instead, but nothing in-tree
does so.
Change this by having all log messages (e.g. pr_debug or dev_err)
go to CONSOLE_STDERR. For nearly all systems that just use the default
of console.active="ioe" or "oe", there is no difference. But now
systems that use either "o" or "e" can use different console
devices for barebox log messages and for standard output by commands.
This is especially useful to debug interactive applications like edit
or for monitoring barebox debug messages during execution of payloads
when barebox acts as EFI loader.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220930154145.754181-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no downside to always build the digest verification code in PBL
and export pbl_barebox_verify to access it. This allows board code to
use the function for verifying other firmware blobs and
CONFIG_PBL_VERIFY_PIGGY=y will remain to enable the verification at
barebox proper extraction time. Code not using it will have the function
sections garbage collected by the linker, so no functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220818050447.2072932-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lzop hasn't seen any activity since 2017 and has been recently removed
from OpenEmbedded, which is unfortunate as we unconditionally use LZO
for compressing device trees that are referenced via __dtb_z_.
To make barebox easier to integrate, use the same compression algorithm
for both barebox and compressed DTB.
Note that the decompressor code will be in the image twice: Once in PBL
in uncompressed form to decompress barebox proper and once in compressed
form to decompress the DTB.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220713095730.1878941-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
LZO_DECOMPRESS as well as all other decompress options already select
UNCOMPRESS, so selecting it again is unnecessary.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220713095730.1878941-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All in-tree boards that reference __dtb_z_ symbols are already
multi-image capable and allow us to compress barebox proper by having
the prebootloader decompress it using the algorithm specified by the
CONFIG_IMAGE_COMPRESSION_* option.
DTB on the other hand, is handled specially and the optional compression
is always using LZO. It makes sense to use the same
CONFIG_IMAGE_COMPRESSION_* options for the DT too to make build system
integration easier.
To avoid special casing non-PBL support which lacks this options, just
drop USE_COMPRESSED_DTB there. If linking barebox for your downstream
board is broken by this:
- If not multi-image capable, consider porting it to use
ENTRY_FUNCTION(_WITHSTACK) instead
- If you are using __dtb_z_* in barebox proper, use normal __dtb_
and compress barebox as a whole instead with
CONFIG_IMAGE_COMPRESSION_*
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220713095730.1878941-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Due to a typo, this code assumed so far ignored #size-cells and assumed
it to be equal to #address-cells. This breaks using the
barebox-dt-2nd.img with some 64-bit device trees like the Raspberry Pi's.
Fixes: ffb0344b7410 ("ARM: Add generic device tree 2nd stage support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220530074102.632341-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of duplicating the loop for each of base and size, move it into
a helper function. This may come in handy later when extending the
function, e.g. to have the generic-dt-2nd image take /reserved-memory
entries into account and not rely on CONFIG_OPTEE_SIZE.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220220124736.3052502-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Record GPL-2.0-only as license for all files lacking an explicit license
statement.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-12-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To verify only Kconfig/Makefile is touched:
git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile'
will print only arch/powerpc/Kbuild.
To verify nothing unexpected is added:
git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Including <stdio.h> for printf is a bit problematic, because it pulls in
other headers for <console.h>, which includes quite a few more headers
as well. To make it easier to share code between barebox and host tools
make <printk.h> the new minimal header for printf and move the extra
logging stuff into <linux/printk.h>.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Link: https://lore.barebox.org/20210929120558.1424-1-jmaselbas@kalray.eu
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, the generic DT image can't properly have a PBL console,
because it's only known at runtime what system we are running on.
As we already parse the FDT in the PBL to get the memory regions, we
could extract the board compatible as well and determine which UART to
use. Add a helper to achieve this.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20210410110638.2106658-1-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Replace the *sprintf to their *snprintf version when printing
to the fixed size printbuffer.
Reported-by: Neeraj Pal <neerajpal09@gmail.com>
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Link: https://lore.barebox.org/20210417211144.26466-1-jmaselbas@kalray.eu
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We now have everything in place to migrate erizo to PBL.
As currently, this is the only board, we can drop all non-PBL support
in the same go.
Cc: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Other architectures would benefit from the generic DT image too.
Add a new arch-agnostic symbol that arches besides ARM can select.
The new symbol itself should not have a prompt as the help text for
each architecture likely differs (e.g. device tree handoff register).
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
of_find_mem can be used for generic DT images for other architectures as
well. To support this, move the definition, so it can be used by others
in the future.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
With KASan the memcpy/memset functions are instrumented as well, but
some code will still have to call the non instrumented versions __memcpy
and __memset. Add aliases for them to PBL to make them available.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
This option is unused in the tree, remove it for now. If you need this
option, let me know, we'll find another solution.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
strrchr is needed for libfdt. Add support for it to the pbl.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
piggy verification is a direct prerequisite of uncompressing the
piggydata, so move the verification there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
| |
If panic is called with a string in the PBL, print the panic string
before falling into the busy loop.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Extract the necessary functions from sha256 into a PBL headder and add a
verification function to the PBL. The function will be called before the
individual architectures decompress functions is run.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
it is needed for multiimage support
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The PBL console support may be configured before the BSS segment
is cleared. Put the pointer into the data section so that it is
not affected by the BSS clearing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
console_puts uses console_putc() to output characters, so the carriage
return should be output with the same function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
With more stuff being done in PBL regular console support gets more and more
useful. This makes the PBL console independent of DEBUG_LL which is only
meant for early debugging but not regular output.
To use the regular PBL console a board must call pbl_set_putc() which stores
a pointer to the putc function to be used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
PBL never calls start_barebox(). If it does, it is a bug.
Without this stub function, we can detect such a bug at link time.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
The PBL has console support now, so add memory_display support aswell
which can be a good debugging aid.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This adds simple console support to the PBL which makes it
possible to print more complex messages in the PBL than just
strings or hex numbers. For now puts_ll is used to print the
messages, so it depends on CONFIG_DEBUG_LL which makes it
more a debugging option. However, this could be extended later
to get regular output from the PBL if desired.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
vsprintf needs strnlen, so in oder to add console support to
the PBL we need a strnlen implementation.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
This adds xz decompression support from the kernel. Both compressing
the barebox binary with xz and decompressing xz files on the commandline
is supported.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the make infrastructure to build multiple SoC or
board specific images from a single barebox binary.
The basic idea is that we no longer have a single pbl, but instead
multiple pbls, one per image if necessary. Each pbl is defined
by its entry function so that each pbl can do exactly what a given
board needs. Additionally the pbls together with a self extracting
barebox binary can be encapsulated in specific image formats.
squashed in build fixes from Lucas Stach for make version >= 3.82:
Split Multimage Makefile rule in explicit and implicit parts
Fixes build with make version >=3.82
Frome the make 3.82 NEWS file:
* WARNING: Backward-incompatibility!
In previous versions of make it was acceptable to list one or more explicit
targets followed by one or more pattern targets in the same rule and it
worked "as expected". However, this was not documented as acceptable and if
you listed any explicit targets AFTER the pattern targets, the entire rule
would be mis-parsed. This release removes this ability completely: make
will generate an error message if you mix explicit and pattern targets in
the same rule.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lucas Stach <dev@lynxeye.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For making the same binary executable on different SoCs which have
different DRAM addresses we have to be independent of the compile
time link address.
This patch adds relocatable binary support for the ARM architecture.
With this two new functions are available. relocate_to_current_adr
will fixup the binary to continue executing from the current position.
relocate_to_adr will copy the binary to a given address, fixup the
binary and continue executing from there.
For the PBL and the real image relocatable support can be enabled
independently. This is done to (hopefully) better cope with setups
where the PBL runs from SRAM or ROM and the real binary does not.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| | |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
so it more easy to add new entry and to maintain
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \
| |/
|/|
| |
| |
| |
| |
| | |
Conflicts:
arch/arm/boards/at91rm9200ek/init.c
arch/arm/boards/pm9263/init.c
arch/arm/configs/at91sam9n12ek_defconfig
arch/arm/mach-at91/Kconfig
|
| |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
This allows for creating a pre-bootloader binary for
- nand boot
- mmc boot
- compressed image
The pbl will be incharge of the lowlevel init if needed.
The barebox will skip it.
Import string functions from linux 3.4 (arch/arm/boot/compressed/string.c) and
implement a dummy panic.
For now on introduce dummy zbarebox* targets and c code that will contain later
the decompressor. This only implemeted on ARM.
This patch is based on Sascha Hauer <s.hauer@pengutronix.de>
Add compressed image support patch
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
|