12 May, 2017
3 commits
-
The function tpm_xfer returns int so make 'err' be int rather than
uint32_t so that we can catch an error condition. Reported by
clang-3.8.Signed-off-by: Tom Rini
-
The rsa_st struct has been made opaque in 1.1.x, add forward compatible
code to access the n, e, d members of rsa_struct.EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
called to reinitialise an already created structure. -
The value assigned to saved_offset is never used.
The problem was indicated by clang scan-build.
Signed-off-by: Heinrich Schuchardt
10 May, 2017
2 commits
-
In some boards like the Raspberry Pi the initial bootloader will pass
a DT to the kernel. When using U-Boot as such kernel, the board code in
U-Boot should be able to provide U-Boot with this, already assembled
device tree blob.This patch introduces a new config option CONFIG_OF_BOARD to use instead
of CONFIG_OF_EMBED or CONFIG_OF_SEPARATE which will initialize the DT
from a board-specific funtion instead of bundling one with U-Boot or as
a separated file. This allows boards like the Raspberry Pi to reuse the
device tree passed from the bootcode.bin and start.elf firmware
files, including the run-time selected device tree overlays.Signed-off-by: Alex Deymo
Reviewed-by: Simon Glass -
A common use of memmove() can be handled by memcpy(). Also memcpy()
includes an optimisation for large sizes: it copies a word at a time. So
we can get a speed-up by calling memcpy() to handle our move in this case.Update memmove() to call memcpy() if the destination is before the source.
Signed-off-by: Simon Glass
Reviewed-by: Tom Rini
06 May, 2017
1 commit
-
We should not first dereference p and afterwards assert that is
was not NULL. Instead do the assert first.The problem was indicated by cppcheck.
Signed-off-by: Heinrich Schuchardt
30 Apr, 2017
1 commit
-
This converts the following to Kconfig:
CONFIG_CMD_AES
CONFIG_AESSigned-off-by: Simon Glass
[trini: Add select AES to CMD_AES]
Signed-off-by: Tom Rini
14 Apr, 2017
4 commits
-
Add compatible strings for Intel Arria 10 SoCFPGA device.
Signed-off-by: Tien Fong Chee
Signed-off-by: Ley Foon Tan -
Here with some DM changes as well as the long-standing AT91 DM/DT
conversion patches which I have picked up via dm. -
With skeleton.dtsi being dropped it is more likely that the /aliases node
will be last in the device tree. Update fdtgrep to handle this.Signed-off-by: Simon Glass
Tested-by: Masahiro Yamada
13 Apr, 2017
3 commits
-
Sync with Linux commit ad0376eb1483b ("Merge tag 'edac_for_4.11_2'").
Signed-off-by: Peng Fan
Cc: Tom Rini -
Add support for %p, %pa[p], %pM, %pm and %pI4 formats to tiny-printf.
%pM and %pI4 are widely used by SPL networking stack and is required if
networking support is desired in SPL.
%p, %pa and %pap are mostly used by debug prints and hence supported
only when DEBUG is enabled.Before this patch:
$ size spl/u-boot-spl
text data bss dec hex filename
99325 4899 218584 322808 4ecf8 spl/u-boot-splAfter this patch (with CONFIG_SPL_NET_SUPPORT):
$ size spl/u-boot-spl
text data bss dec hex filename
99666 4899 218584 323149 4ee4d spl/u-boot-splSo, this patch adds ~350 bytes to code size.
If CONFIG_SPL_NET_SUPPORT is not enabled, this adds ~25 bytes.
If CONFIG_USE_TINY_PRINTF is disabled then:
$ size spl/u-boot-spl
text data bss dec hex filename
101116 4899 218584 324599 4f3f7 spl/u-boot-splSo, there is still ~1.4K space saved even with support for %pM/%pI4.
Compiler used is to build is:
arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016Signed-off-by: Vignesh R
Reviewed-by: Tom Rini
Reviewed-by: Simon Glass -
aes.h is a too generic name if this file can
be exported and used by a program.
Rename it to avoid any conflicts with
other files (for example, from openSSL).Signed-off-by: Stefano Babic
11 Apr, 2017
2 commits
-
For some reason Python 3 seems to think it does not need to build
the library. Using the --force parameter makes sure that the library
gets built always. This is especially important since we move the
library in the next step of the Makefile, hence forcing a rebuild
every time the higher level Makefile triggers a rebuild is required
to make sure the library is always there.Signed-off-by: Stefan Agner
Acked-by: Simon Glass -
This a few minor changes down from upstream since the last sync.
Signed-off-by: Simon Glass
07 Apr, 2017
3 commits
-
Create a new Kconfig entry to allow CMD_UBIFS selection from Kconfig and
add an hidden LZO option that can be selected by CMD_UBIFS.Signed-off-by: Boris Brezillon
Signed-off-by: Maxime Ripard
Acked-by: Jagan Teki -
Expose the RBTREE feature through Kconfig and select this option from the
MTD_UBI option.Signed-off-by: Boris Brezillon
Signed-off-by: Maxime Ripard
Acked-by: Jagan Teki
[Rebased on master]
Signed-off-by: Jagan Teki -
We will need the bch functions in the tool to generate the SPL images for
the Allwinner SoCs.Do the needed adjustments so that we can use it on the host.
Signed-off-by: Maxime Ripard
Reviewed-by: Tom Rini
Reviewed-by: Jagan Teki
05 Apr, 2017
1 commit
-
Most of the time the optimised memset() is what we want. For extreme
situations such as TPL it may be too large. For example on the 'rock'
board, using a simple loop saves a useful 48 bytes. With gcc 4.9 and
the rodata bug, this patch is enough to reduce the TPL image below the
limit.Signed-off-by: Simon Glass
Reviewed-by: Heiko Stuebner
27 Mar, 2017
2 commits
-
If we want to load a key into a TPM, we need to know the designated parent
key's handle, so that the TPM is able to insert the key at the correct place in
the key hierarchy.However, if we want to load a key whose designated parent key we also
previously loaded ourselves, we first need to memorize this parent key's handle
(since the handles for the key are chosen at random when they are inserted into
the TPM). If we are, however, unable to do so, for example if the parent key is
loaded into the TPM during production, and its child key during the actual
boot, we must find a different mechanism to identify the parent key.To solve this problem, we add a function that allows U-Boot to load a key into
the TPM using their designated parent key's SHA1 hash, and the corresponding
auth data.Signed-off-by: Mario Six
Reviewed-by: Simon Glass -
Use CONFIG_IS_ENABLED() macro to check whether OF_TRANSLATE is enabled, so
that code block is compiled irrespective of SPL or U-Boot build
and fdt address translation is used.Signed-off-by: Vignesh R
21 Mar, 2017
1 commit
-
The CAAM in IMX parts doesn't support public key hardware acceleration
(PKHA), so don't use RSA_FREESCALE_EXP. If you try to use it on IMX
(assuming you have the clocks enabled first) you will get back an
"Invalid KEY Command" error since PKHA isn't a valid key destination for
these parts.Signed-off-by: George McCollister
Reviewed-by: Tom Rini
17 Mar, 2017
2 commits
-
So far CONFIG_MD5SUM would need to be set by a board's include file.
Since the command is really generic, move it over to Kconfig to allow
it to be defined by either a board's defconfig, menuconfig or some
config snippet merged via mergeconfig.sh.Signed-off-by: Andre Przywara
Reviewed-by: Simon Glass
15 Mar, 2017
1 commit
-
These two functions are only used in lib/tiny-printf.c .
Signed-off-by: Masahiro Yamada
Tested-by: Andreas Färber
Reviewed-by: Stefan Roese
14 Mar, 2017
1 commit
-
Instead of adding all memory banks, add a hook so individual SoC/board
can has its own implementation.Signed-off-by: York Sun
CC: Alexander Graf
Reviewed-by: Alexander Graf
06 Feb, 2017
1 commit
-
We should use unsigned long rather than u32 for addresses. Update this so
that the table-generation code builds correctly on 64-bit machines.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
01 Feb, 2017
1 commit
-
This patch adds a function to the TPM library, which allows U-Boot to
flush resources, e.g. keys, from the TPM.Signed-off-by: Mario Six
Reviewed-by: Stefan Roese
Reviewed-by: Simon Glass
Signed-off-by: Stefan Roese
28 Jan, 2017
1 commit
-
Signed-off-by: Patrick Delaunay
Signed-off-by: Patrick Delaunay
15 Jan, 2017
4 commits
-
Add support for signing with the pkcs11 engine. This allows FIT images
to be signed with keys securely stored on a smartcard, hardware security
module, etc without exposing the keys.Support for other engines can be added in the future by modifying
rsa_engine_get_pub_key() and rsa_engine_get_priv_key() to construct
correct key_id strings.Signed-off-by: George McCollister
-
Ensure '.' is used to separate octets. If another character is seen
reject the string outright and return 0.0.0.0.Signed-off-by: Chris Packham
-
Previously values greater than 255 were implicitly truncated. Add some
stricter checking to reject addresses with components >255.With the input "1234192.168.1.1" the old behaviour would truncate the
address to 192.168.1.1. New behaviour rejects the string outright and
returns 0.0.0.0, which for the purposes of IP addresses can be
considered an error.Signed-off-by: Chris Packham
-
Currently, mdelay() and udelay() are declared in include/common.h,
while ndelay() in include/linux/compat.h. It would be nice to
collect them into include/linux/delay.h like Linux.While we are here, fix the ndelay() implementation; I used the
DIV_ROUND_UP() instead of (x)/1000 because it must wait *longer*
than the given period of time.Signed-off-by: Masahiro Yamada
Reviewed-by: Simon Glass
14 Jan, 2017
1 commit
-
The fdt_overlay_apply() function purports to support the edge cases where
an overlay has no fixups to be applied, or a base tree which has no
symbols (the latter can only work if the former is also true). However it
gets it wrong in a couple of small ways:* In the no fixups case, it doesn't fail immediately, but will attempt
fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
offset, which will fail. Instead it should succeed immediately, since
there's nothing to do.
* In the case of no symbols, it again doesn't fail immediately. However
if there is an actual fixup it will fail with an unexpected error,
because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
look up the symbols. We should instead return -FDT_ERR_NOTFOUND
directly.Both of these errors lead to the code returning misleading error codes in
failing cases.[ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]
Signed-off-by: David Gibson
Signed-off-by: Stefan Agner
Acked-by: Simon Glass
10 Jan, 2017
1 commit
09 Jan, 2017
1 commit
-
Signed-off-by: Ladislav Michl
04 Jan, 2017
2 commits
-
tiny-printf does not know about the "-" modifier, which aligns numbers.
This is used by some SPL code, but as it's purely cosmetical, we just
ignore this modifier here to avoid changing correct printf strings.Signed-off-by: Andre Przywara
Reviewed-by: Simon Glass
Reviewed-by: Jagan Teki -
tiny-printf does not know about the "l" modifier so far, which breaks
the crash dump on AArch64, because it uses %lx to print the registers.
Add an easy way of handling longs correctly.Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
the code size of tiny-printf.o for 32-bit builds (where long and int
are actually the same), actually it looses three (ARM Thumb2) instructions
from the actual SPL (numbers for orangepi_plus_defconfig):
text data bss dec hex filename
758 0 0 758 2f6 spl/lib/tiny-printf.o before
18839 488 232 19559 4c67 spl/u-boot-spl before
758 0 0 758 2f6 spl/lib/tiny-printf.o after
18833 488 232 19553 4c61 spl/u-boot-spl afterThis adds some substantial amount of code to a 64-bit build, though:
(taken after a later commit, which enables the ARM64 SPL build for sunxi)
text data bss dec hex filename
1542 0 0 1542 606 spl/lib/tiny-printf.o before
25830 392 360 26582 67d6 spl/u-boot-spl before
1758 0 0 1758 6de spl/lib/tiny-printf.o after
26040 392 360 26792 68a8 spl/u-boot-spl afterSigned-off-by: Andre Przywara
Reviewed-by: Simon Glass
Reviewed-by: Jagan Teki
20 Dec, 2016
1 commit
-
Add two functions for use by board implementations to decode the memory
banks of the /memory node so as to populate the global data with
ram_size and board info for memory banks.The fdtdec_setup_memory_size() function decodes the first memory bank
and sets up the gd->ram_size with the size of the memory bank. This
function should be called from the boards dram_init().The fdtdec_setup_memory_banksize() function decode the memory banks
(up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size
into the gd->bd->bi_dram array of banks. This function should be called
from the boards dram_init_banksize().Signed-off-by: Nathan Rossi
Cc: Simon Glass
Cc: Michal Simek
Reviewed-by: Simon Glass
Signed-off-by: Michal Simek