Commit Graph

62811 Commits

Author SHA1 Message Date
Heinrich Schuchardt
94a8e83a60 crypto: make mod_exp_sw() static
Function mod_exp_sw() is only used via the operators of the uclass.
It is not defined in any include.

Make mod_exp_sw() static.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-25 12:04:36 -05:00
Heinrich Schuchardt
1611235b85 lib: Kconfig dependencies for pseudo-random library
drivers/rng/sandbox_rng.c requires rand() to be defined but configuration
option CONFIG_CONFIG_LIB_RAND selected in drivers/rng/Kconfig does not
exist.

test/lib/test_aes.c requires rand() to be defined.

Fix the selection criteria for choice "Pseudo-random library support type".

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-25 12:04:36 -05:00
Heinrich Schuchardt
1b27753a96 lib: rsa: consider CONFIG_SPL_RSA
CONFIG_SPL_RSA is meant to control if lib/rsa/* is used for SPL. Adjust
lib/Makefile to consider this setting.

This was correctly setup with commit 51c14cd128 ("verified-boot: Minimal
support for booting U-Boot proper from SPL") and got lost with commit
089df18bfe ("lib: move hash CONFIG options to Kconfig").

Fixes: 089df18bfe ("lib: move hash CONFIG options to Kconfig")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-25 12:04:36 -05:00
Patrick Delaunay
dae188e683 tools: ftdgrep: correct the find regions loop in do_fdtgrep
Use realloc and update the loop executed in do_fdtgrep to find all
the regions: only test count > max_region after the second pass.

This patch solve an issue if the number of region found (count)
is greater then the default value (max_region = count = 100):
the second pass is never executed, because the loop stops after
the first pass (i = 0, count > 100, max_regions = 100)
with error -1 and the error message
"Internal error with fdtgrep_find_region".

I also update the error message.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-01-24 12:33:08 -05:00
Michael Trimarchi
906e3cc552 arm: Add arm handoff header file
Add an arch-specific handoff header so that we can use the HANDOFF feature
on arm devices.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-01-24 11:19:52 -05:00
Patrik Dahlström
1c16606aac serial: ns16550: Use old baud rate divisor for flushing if not given
If baud_divisor is not set (i.e. == -1), we should use the baud divisor
already in use for flushing the xmit register. If we don't flush the
xmit register, then SPL will hang.

Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
2020-01-24 11:19:52 -05:00
Patrick Delaunay
b1b147f2b8 cmd: mtd: solve bad block support in erase command
This patch modify the loop in mtd erase command to erase one by one
the blocks in the requested area.

It solves issue on "mtd erase" command on nand with existing bad block,
the command is interrupted on the first bad block with the trace:
	"Skipping bad block at 0xffffffffffffffff"

In MTD driver (nand/raw), when a bad block is present on the MTD
device, the erase_op.fail_addr is not updated and we have the initial
value MTD_FAIL_ADDR_UNKNOWN = (ULL)-1.

This case seems normal in nand_base.c:nand_erase_nand(),
we have the 2 exit cases during the loop:

1/ we have a bad block (nand_block_checkbad)
	instr->state = MTD_ERASE_FAILED
	loop interrupted (goto erase_exit)

2/ if block erase failed (status & NAND_STATUS_FAIL)
	instr->state = MTD_ERASE_FAILED;
	instr->fail_addr =
				((loff_t)page << chip->page_shift);
	loop interrupted (goto erase_exit)

So erase_op.fail_addr can't be used if bad blocks were present
in the erased area; we need to use mtd_erase only one block to detect
and skip these existing bad blocks (as it is done in nand_util.c).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2020-01-24 11:19:52 -05:00
Fabien Dessenne
83b539cfd4 remoteproc: elf_loader: fix program header parsing
Fix an issue where some sections are never loaded : if p_type is
different from PT_LOAD the phdr pointer must be incremented.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Suman Anna <s-anna@ti.com>
2020-01-24 11:19:52 -05:00
Tom Rini
2c871f9e08 Merge branch '2020-01-22-master-imports'
- Re-add U8500 platform support
- Add bcm968360bg support
- Assorted Keymile fixes
- Other assorted bugfixes
2020-01-23 16:28:17 -05:00
Heinrich Schuchardt
a9d1c0e2bc disk: part: rename parameter of lba512_muldiv()
div_by is a misleading parameter name, when we are doing >> div_by.
Rename it to right_shift.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-23 07:29:58 -05:00
Dhananjay Phadke
c7c0233235 qemu-arm: set CONFIG_SYS_BOOTM_LEN to SZ_64M
FIT image contents can be larger than default bootm limit 8M
with initrd. Raise limit to 64MB which is commonly used
elsewhere.

Signed-off-by: Dhananjay Phadke <dphadke@linux.microsoft.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-01-23 07:29:58 -05:00
Holger Brunck
b0405e08f4 arm/km: remove unmaintained board kmsuv31
This target is out of maintenance and can be removed.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Valentin Longchamp <valentin.longchamp@ch.abb.com>
CC: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-01-23 07:29:58 -05:00
Holger Brunck
95e3ce6a7f arm/km: remove unmaintained board SUGP1
This target is out of maintenance and can be removed.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Valentin Longchamp <valentin.longchamp@ch.abb.com>
CC: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-01-23 07:29:58 -05:00
Holger Brunck
0e1c0f361e arm/km: add support for SUSE2
This board is similar to SUV31, but the FPGA is reset concept is quite
different.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Valentin Longchamp <valentin.longchamp@ch.abb.com>
CC: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-01-23 07:29:58 -05:00
Joel Johnson
17f084fa8c zfs: remove unused buf variable
Remove unused variable to silence compiler warning

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
2020-01-23 07:29:58 -05:00
Holger Brunck
d4348a8db7 km/scripts: product env and auto-reset for ramfs
This patch adds the possibility in both debug and ramfs modes to
optionally load an env file from /tftpboot/$tftppath (this is ignored if
not present, so the change is backward compatible). This gives the debug
and ramfs scripts the possibility to set uboot environment variables
that were previously asked the users to manually set (nfs path in debug
and rootfs size in ramfs).

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Tom Rini <trini@konsulko.com>
2020-01-23 07:29:58 -05:00
Holger Brunck
27a5f833ff km/scripts: fix run ramfs and COGE5 tftppath problem
The tftppath was not set in case of run ramfs. It worked only by chance
if was already set before.

Also check the boardname before setting the tftppath for COGE5.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Tom Rini <trini@konsulko.com>
2020-01-23 07:29:58 -05:00
Rainer Boschung
db4256f60d km/common: fix for CPUWD reset reason
The CPUWD reset reason is used for kmp204x.
And the qrio cpu reset request is configured to operate in
core reset mode.
But for the evaluation of the qrio's reset reason register
the CPUWD figures as a unit reset source rather than a core
reset source. This patch defines the CPUWD reset as a core
reset source when evaluating the reset reason register.

Signed-off-by: Rainer Boschung <rainer.boschung@ch.abb.com>
CC: Priyanka Jain <priyanka.jain@nxp.com>
2020-01-23 07:29:58 -05:00
Holger Brunck
78a408bb49 KM/kmp204x: qrio and i2c deblock code moved to common
This patch moves the qrio and i2c deblocking code to
keymile/common as it will also be used by the upcoming CENT2 board.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Priyanka Jain <priyanka.jain@nxp.com>
2020-01-23 07:29:58 -05:00
Holger Brunck
ac32e7d109 kmp204x: do not make FPGA config error fail board_early_init_r
This prevents the board from booting which is not the expected behavior.

Signed-off-by: Valentin Longchamp <valentin.longchamp@ch.abb.com>
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
CC: Priyanka Jain <priyanka.jain@nxp.com>
2020-01-23 07:29:58 -05:00
Sughosh Ganu
3e63598308 MAINTAINERS: Add entry for rng drivers
Take up maintainership of random number generator drivers with
Heinrich Schuchardt as the reviewer.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-23 07:29:58 -05:00
Matthias Schoepfer
04cd7108e6 removing fdt_high from default set of variables for, dragonboard410c config
When using fitImage in AARCH64, the fdt is only 4 byte aligned.
According to linux kernel -> Documentation/arm64/booting.txt, the
fdt *must* be 8 byte aligned. Therefore, it is somewhat random,
if you build a kernel that the fdt is 4 or 8 byte aligned.
Removing fdt_high (or changing it to a valid 8 byte aligned
address) solves this issue.

Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
CC: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
2020-01-23 07:29:58 -05:00
Masahiro Yamada
9086ab564b board_init: remove meaningless increment in board_init_f_init_reserve()
The base is not used in the code that follows this increment.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-23 07:29:58 -05:00
Philippe Reynes
645b7ec52c bcm968360bg: add initial support
This add the initial support of the broadcom reference
board bcm968360bg with a bcm68360 SoC.

This board has 512 MB of RAM, 256 MB of flash (nand),
2 USB port, 1 UART, and 4 ethernet ports.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
e520036f9d gpio: do not include <asm/arch/gpio.h> on ARCH_BCM68360
As no gpio.h is defined for this architecture, to avoid
compilation failure, do not include <asm/arch/gpio.h> for
arch bcm68360.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
17f34ca803 gpio: bcm6345: allow to use this driver on arm bcm68360
This IP is also used on some arm SoC, so we allow to
use it on arm bcm68360 too.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
5602e21ca7 led: bcm6858: allow to use this driver on arm bcm68360
This IP is also used on some arm SoC, so we allow to
use it on arm bcm68360 too.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
1453301122 nand: brcmnand: add bcm68360 support
This adds the nand support for chipset bcm68360.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
34fdacb07b spi: bcm63xx-hsspi: allow to use this driver on arm bcm68360
This IP is also used on some arm SoC, so we allow to
use it on arm bcm68360 too.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
d0edec667f watchdog: bcm6345: allow to use this driver on arm bcm68360
This IP is also used on some arm SoC, so we allow to
use it on arm bcm68360 too.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Philippe Reynes
6454e95f4f bcm68360: add initial support
This add the initial support of the broadcom bcm68360 SoC family.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-01-23 07:29:58 -05:00
Fabio Estevam
05bd943aa9 Makefile: Let mrproper remove flash.bin and flash.log
In order to generate a bootable U-Boot binary for i.MX8QXP MEK
we need to run:

$ make imx8qxp_mek_defconfig
$ make flash.bin

The resultant flash.bin and flash.log are not removed after
running 'make mrproper'.

Include these files into the CLEAN_FILES list entry so that
they can be properly deleted after 'make mrproper'.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-01-23 07:29:58 -05:00
Patrick Delaunay
e9c669867a cmd: pxe: execute the cls command only when supported
Execute the command cls (for clear screen), when the "menu background"
keyword is present in extlinux.conf file, only if the command is supported.

This patch avoid the warning "Unknown command 'cls'"
with "menu background" in extlinux.conf when CONFIG_CMD_BMP is activated
and CONFIG_CMD_CLS not activated (default for CONFIG_DM_VIDEO).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-01-22 17:49:25 -05:00
Heinrich Schuchardt
e605ab8483 trace: provide Sphinx style comments
Correct some function comments. Convert to Sphinx style.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-01-22 17:47:57 -05:00
Dario Binacchi
6124667cd8 lib: ignore oid_registry_data.c file
The file is generated by scripts/build_OID_registry based on the
include/linux/oid_registry.h file.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
2020-01-22 17:47:57 -05:00
Klaus H. Sorensen
602ce1d106 spl_fit.c: enable loading compressed u-boot from fit image
Allow reading compressed content from fit image, even if
CONFIG_SPL_OS_BOOT is not set.

This allow booting compressed 2nd stage u-boot from fit image.

Additionally, do not print warning message if compression node is not
found, since it simply implies the content is uncompressed.

Signed-off-by: Klaus H. Sorensen <khso@prevas.dk>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-22 17:47:57 -05:00
Stephan Gerhold
43d28855d8 board: Add new Samsung "stemmy" board based on ST-Ericsson U8500
The ST-Ericsson U8500 SoC has been used in mass-production for
some Android smartphones released around 2012.
In particular, Samsung has released more than 5 different
smartphones based on U8500, e.g.

  - Samsung Galaxy S III mini (GT-I8190) "golden"
  - Samsung Galaxy S Advance (GT-I9070)  "janice"
  - Samsung Galaxy Xcover 2 (GT-S7710)   "skomer"

and a few others.

Mainline Linux has great support for the Ux500 SoC, so these
smartphones can also run Linux mainline quite well.

Unfortunately, the original Samsung bootloader used on these devices
has limitations that prevent booting Linux mainline directly.
It keeps the L2 cache enabled, which causes Linux to crash very early,
shortly after decompressing the kernel.

Using U-Boot allows to circumvent these limitations. We can let the
Samsung bootloader chain-load U-Boot and U-Boot locks the L2 cache
before booting into Linux. U-Boot has several other advantages
- it supports device-trees directly and we are no longer limited to
flashing Android boot images through Samsung's proprietary download
mode.

The Samsung "stemmy" board covers all Samsung devices based on U8500.
Add minimal support for "stemmy". For now only UART is supported but
this will be extended later.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:57 -05:00
Stephan Gerhold
293f9ebb94 MAINTAINERS: Add ARM U8500
Add myself as maintainer for ST-Ericsson U8500 SoC to MAINTAINERS.
Linus Walleij usually reviews all Ux500 related patches,
so add him as a reviewer.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:57 -05:00
Stephan Gerhold
689088f9da arm: Add support for ST-Ericsson U8500 SoC
The NovaThor U8500 SoC was released by ST-Ericsson in 2011.
It was used for some development boards like the CALAO Systems
Snowball SBC, but mass production was primarily for Android
smartphones like the Samsung Galaxy S III mini.

Previous support for U8500 was removed in
commit 68282f55b8 ("arm: Remove unused ST-Ericsson u8500 arch")
since none of the boards were converted to generic boards
before the deadline.

The new code does not have much in common with the previous code.
I have completely rewritten everything, embracing the Driver Model
and device trees wherever possible.

The U8500 support is a bit more minimal for now - my primary
use case is to use U-Boot as alternative bootloader for some of the
U8500 Samsung smartphones. At the moment U-Boot is chain-loaded from
the original Samsung bootloader. A side effect of this is that we
can (temporarily) get away without implementing some functionality
- e.g. all clocks are already enabled by the original bootloader.

More functionality will be added in future patches.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: John Rigby <john.rigby@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:57 -05:00
Stephan Gerhold
f13dc8cbd9 arm: dts: Import device tree for ST-Ericsson Ux500
from https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git/
tag "ux500-armsoc-v5.6-2"
commit 224bf0fe7292 ("ARM: dts: ux500: samsung-golden: Add Bluetooth")

(queued for merge in Linux 5.6)

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:57 -05:00
Stephan Gerhold
057b613990 timer: Add driver for Nomadik Multi Timer Unit (MTU)
The Nomadik Multi Timer Unit (MTU) provides 4 decrementing
free-running timers. It is used in ST-Ericsson Ux500 SoCs.

The driver uses the first timer to implement UCLASS_TIMER.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:56 -05:00
Rasmus Villemoes
c82216803d env: another attempt at fixing SPL build failures
I'm also seeing the build failure that commit

7d4776545b env: solve compilation error in SPL

tried to fix, namely that the reference to env_flags_validate from
env_htab cannot be satisfied when flags.o is not built in. However,
that commit got reverted by

d90fc9c3de Revert "env: solve compilation error in SPL"

Necessary, but not sufficient conditions to see this are

CONFIG_SPL=y (obviously)
CONFIG_SPL_ENV_SUPPORT=n (so flags.o does not get compiled)
CONFIG_SPL_LIBCOMMON_SUPPORT=y (so env/built-in.o is part of the SPL link)

Now, these are satisfied for e.g. imx6q_logic_defconfig. But that
builds just fine, and spl/u-boot-spl.map lists .data.env_htab among
the discarded (garbage collected) sections. Yet, on our
mpc8309-derived board, we do see the build failure, so perhaps the
linker works a bit differently on ppc than on ARM, or there's yet some
other configuration option needed to observe the break.

This is another attempt at solving it, which also cleans up
env/Makefile a bit: Introduce a def_bool y symbol CONFIG_ENV_SUPPORT
which complements CONFIG_(SPL/TPL)_SUPPORT. Then use
CONFIG_$(SPL_TPL_)ENV_SUPPORT to decide whether to include the five
basic env/*.o files. For attr.o, flags.o and callback.o, this
shouldn't change anything. Also, common.o and env.o still get
unconditionally built for U-boot proper. But for TPL/SPL, those two
are only included if CONFIG_(SPL/TPL)_SUPPORT is set.

Having that symbol should also allow simplifying conditionals such as

#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(ENV_SUPPORT)

found in drivers/reset/reset-socfpga.c to just
CONFIG_IS_ENABLED(ENV_SUPPORT).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-22 17:47:56 -05:00
Tom Rini
052170c6a0 configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2020-01-22 13:38:00 -05:00
Tom Rini
75dd53055a Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- Clearfog: Add run-time board detection with TLV EEPROM support
  (Baruch)
2020-01-21 18:10:28 -05:00
Baruch Siach
584a3d2622 ARM: mvebu: clearfog: add Clearfog Base serdes configuration
Clearfog Base carrier uses serdes lane #5 as USB host. Use EEPROM stored
device identification to configure the serdes accordingly when
available.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-01-21 15:56:15 +01:00
Baruch Siach
5e9838450a ARM: mvebu: clearfog: add Clearfog GTR support
Select the serdes configuration table based on the platform identity
read from EEPROM TLV data. Clearfog GTR needs a slightly different
serdes configuration.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-01-21 15:56:15 +01:00
Baruch Siach
867572f09e ARM: mvebu: clearfog: run-time selection of DT file
Set the kernel device-tree file (fdtfile environment variable) based on
run-time detection of the platform.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-01-21 15:56:15 +01:00
Baruch Siach
7211fa6f5a ARM: mvebu: clearfog: print TLV stored product name
Use the data from EEPROM TLV to display the board identity.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-01-21 15:56:15 +01:00
Baruch Siach
a2e41ad2a9 ARM: mvebu: clearfog: read basic TLV data
Read RAM die capacity from the EEPROM TLV.

Follow the ONIE standard that defines the Vendor Extension entry type
for vendor specific data. We have no Private Enterprise Number at the
moment as the standard requires. Use the dummy all 0xff value for now.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-01-21 15:56:15 +01:00
Baruch Siach
cdb494962d ARM: mvebu: clearfog: add support for EEPROM TLV info
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-01-21 15:56:15 +01:00