]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 years agoboard: stm32mp1: remove board.c
Patrick Delaunay [Thu, 30 Jul 2020 11:57:34 +0000 (13:57 +0200)]
board: stm32mp1: remove board.c

Remove the file board/st/stm32mp1/board.c which is not more
compiled since commit 156732cc8939 ("board: stm32mp1: move the
function board_debug_uart_init in spl.c")

Fixes: 4fb46816c7e2 ("board: stm32mp1: move the function board_debug_uart_init in spl.c")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32: Update eth1addr from EEPROM if eth1 present
Marek Vasut [Thu, 30 Jul 2020 23:34:50 +0000 (01:34 +0200)]
ARM: dts: stm32: Update eth1addr from EEPROM if eth1 present

The STM32MP1 DHCOM has two ethernet interfaces, the on-SoM DWMAC and KS8851.
Set eth1addr for the KS8851 to a MAC address of the DWMAC incremented by 1.
The MAC of the DWMAC is set from on-SoM EEPROM already, but the MAC address
of KS8851 was left uninitialized, so fix this.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: stm32: Add fitImage its entry for 587-200 DHCOR SoM
Marek Vasut [Thu, 30 Jul 2020 23:35:51 +0000 (01:35 +0200)]
ARM: stm32: Add fitImage its entry for 587-200 DHCOR SoM

The new 587-200 DHCOR SoM is compatible with the 587-100 prototype,
hence just replicate the entries, as there is no pattern matching.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: stm32: Add both PDK2 and DRC02 DT into DHCOM fitImage its
Marek Vasut [Thu, 30 Jul 2020 23:35:33 +0000 (01:35 +0200)]
ARM: stm32: Add both PDK2 and DRC02 DT into DHCOM fitImage its

Include both PDK2 and DRC02 DTs in the DHCOM fitImage .its and implement
support in SPL to select the correct configuration entry for U-Boot by
using the machine compatible string from SPL DT.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32: add FMC2 EBI support for stm32mp157c
Christophe Kerello [Fri, 31 Jul 2020 07:53:44 +0000 (09:53 +0200)]
ARM: dts: stm32: add FMC2 EBI support for stm32mp157c

This patch adds FMC2 External Bus Interface support on stm32mp157c.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs: stm32mp: add CONFIG_STM32_FMC2_EBI
Christophe Kerello [Fri, 31 Jul 2020 07:53:43 +0000 (09:53 +0200)]
configs: stm32mp: add CONFIG_STM32_FMC2_EBI

This patch enables the support of FMC2 EBI.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: update fdt fixup partitions table
Christophe Kerello [Fri, 31 Jul 2020 07:53:42 +0000 (09:53 +0200)]
board: stm32mp1: update fdt fixup partitions table

This patch adds "st,stm32mp1-fmc2-nfc" compatible string in the
fdt fixup partitions table.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: get resources from parent node
Christophe Kerello [Fri, 31 Jul 2020 07:53:41 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: get resources from parent node

FMC2 EBI support has been added. Common resources (registers base
address and clock) can now be shared between the 2 drivers using
"st,stm32mp1-fmc2-nfc" compatible string. It means that the
common resources should now be found in the parent device when EBI
node is available.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomemory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver
Christophe Kerello [Fri, 31 Jul 2020 07:53:40 +0000 (09:53 +0200)]
memory: stm32-fmc2-ebi: add STM32 FMC2 EBI controller driver

The driver adds the support for the STMicroelectronics FMC2 EBI controller
found on STM32MP SOCs.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: use clrsetbits_le32
Christophe Kerello [Fri, 31 Jul 2020 07:53:39 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: use clrsetbits_le32

This patch uses clrsetbits_le32 function instead of multiple instructions.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: use FIELD_PREP/FIELD_GET macros
Christophe Kerello [Fri, 31 Jul 2020 07:53:38 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: use FIELD_PREP/FIELD_GET macros

This patch removes custom macros and uses FIELD_PREP and FIELD_GET macros.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: cosmetic change to use nfc instead of fmc2 where relevant
Christophe Kerello [Fri, 31 Jul 2020 07:53:37 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: cosmetic change to use nfc instead of fmc2 where relevant

This patch renames functions and local variables.
This cleanup is done to get all functions starting by stm32_fmc2_nfc
in the FMC2 raw NAND driver when all functions will start by
stm32_fmc2_ebi in the FMC2 EBI driver.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: use FMC2_TIMEOUT_5S for timeouts
Christophe Kerello [Fri, 31 Jul 2020 07:53:36 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: use FMC2_TIMEOUT_5S for timeouts

FMC2_TIMEOUT_5S will be used each time that we need to wait.
It was seen, during stress tests in an overloaded system,
that we could be close to 1 second, even if we never met this
value. To be safe, FMC2_TIMEOUT_MS is set to 5 seconds.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: remove useless inline comments
Christophe Kerello [Fri, 31 Jul 2020 07:53:35 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: remove useless inline comments

Remove inline comments that are useless since function label are
self explanatory.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomtd: rawnand: stm32_fmc2: fix a buffer overflow
Christophe Kerello [Fri, 31 Jul 2020 07:53:34 +0000 (09:53 +0200)]
mtd: rawnand: stm32_fmc2: fix a buffer overflow

The chip select defined in the device tree could only be 0 or 1.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: stm32prog: use IS_ENABLED to prevent ifdef
Patrick Delaunay [Fri, 31 Jul 2020 14:31:52 +0000 (16:31 +0200)]
arm: stm32mp: stm32prog: use IS_ENABLED to prevent ifdef

Use IS_ENABLED to prevent ifdef in stm32prog command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: bsec: use IS_ENABLED to prevent ifdef
Patrick Delaunay [Fri, 31 Jul 2020 14:31:51 +0000 (16:31 +0200)]
arm: stm32mp: bsec: use IS_ENABLED to prevent ifdef

Use IS_ENABLED to prevent ifdef in bsec driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in ft_board_setup
Patrick Delaunay [Fri, 31 Jul 2020 14:31:50 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in ft_board_setup

Use IS_ENABLED to prevent ifdef in ft_board_setup.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in env functions
Patrick Delaunay [Fri, 31 Jul 2020 14:31:49 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in env functions

Use IS_ENABLED to prevent ifdef in env functions:
- env_get_location
- env_ext4_get_intf
- mmc_get_env_dev

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in board_late_init
Patrick Delaunay [Fri, 31 Jul 2020 14:31:48 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in board_late_init

Use IS_ENABLED to prevent ifdef in board_late_init.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in dk2_i2c1_fix
Patrick Delaunay [Fri, 31 Jul 2020 14:31:47 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in dk2_i2c1_fix

Use IS_ENABLED to prevent ifdef in dk2_i2c1_fix.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_inf
Patrick Delaunay [Fri, 31 Jul 2020 14:31:46 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_inf

Use CONFIG_IS_ENABLED to prevent ifdef in set_dfu_alt_inf.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_init
Patrick Delaunay [Fri, 31 Jul 2020 14:31:45 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_init

Use IS_ENABLED to prevent ifdef in sysconf_init.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in board_check_usb_power
Patrick Delaunay [Fri, 31 Jul 2020 14:31:44 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in board_check_usb_power

Use IS_ENABLED to prevent ifdef in board_check_usb_power.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in g_dnl_board_usb_cable_connected
Patrick Delaunay [Fri, 31 Jul 2020 14:31:43 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in g_dnl_board_usb_cable_connected

Use IS_ENABLED to prevent ifdef in g_dnl_board_usb_cable_connected
and in g_dnl_bind_fixup

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: use IS_ENABLED to prevent ifdef in board_key_check
Patrick Delaunay [Fri, 31 Jul 2020 14:31:42 +0000 (16:31 +0200)]
board: stm32mp1: use IS_ENABLED to prevent ifdef in board_key_check

Use IS_ENABLED to prevent ifdef in board_key_check

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agousb: host: dwc3-sti-glue: Fix ofnode_valid() parameter
Patrice Chotard [Mon, 29 Jun 2020 09:19:02 +0000 (11:19 +0200)]
usb: host: dwc3-sti-glue: Fix ofnode_valid() parameter

node varaible is used as iterator into ofnode_for_each_subnode()
loop, when exiting of it, node is no more a valid ofnode.
Use dwc3_node instead as parameter of ofnode_valid()

Fixes: ac28e59a574d ("usb: Migrate to support live DT for some driver")
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
4 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 10 Aug 2020 19:31:07 +0000 (15:31 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotest/py: fix SquashFS tests
Joao Marcos Costa [Mon, 10 Aug 2020 12:37:27 +0000 (14:37 +0200)]
test/py: fix SquashFS tests

Use "cons.config.build_dir" instead of writing to the source directory
(read-only). This will fix the test failures in Azure.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agoConvert CONFIG_SYS_MMC_ENV_DEV et al to Kconfig
Tom Rini [Fri, 24 Jul 2020 21:14:47 +0000 (17:14 -0400)]
Convert CONFIG_SYS_MMC_ENV_DEV et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MMC_ENV_DEV
   CONFIG_SYS_MMC_ENV_PART

Note that with this conversion we now have consistent behavior with
respect to ensuring that we have always selected the correct MMC
device and hardware partition.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMakefile: sunxi: Don't use binman to build ATF image
Simon Glass [Fri, 7 Aug 2020 15:44:11 +0000 (09:44 -0600)]
Makefile: sunxi: Don't use binman to build ATF image

At present with sunxi 64-bit, the Makefile builds
u-boot-sunxi-with-spl.bin and then binman overwrites it with its own
version. But the binman definition lacks some parts, in particular
BL31.

For now, work around this with a hack.

Tested-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 42b18df80fd ("x86: Makefile: Drop explicit targets built by binman")
4 years agotest/py: serial# cannot be overwritten on some devices
Heinrich Schuchardt [Fri, 7 Aug 2020 21:11:35 +0000 (23:11 +0200)]
test/py: serial# cannot be overwritten on some devices

On some devices the environment variable serial# cannot be overwritten.
Set the variable only if it is not set.

For our unit test it is sufficient to test if any value for serial-number
is set.

Fixes: 8a5cdf601f8d ("test: efi_selftest: Do not force serial# setting")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge branch '2020-08-07-misc-improvements'
Tom Rini [Sat, 8 Aug 2020 12:28:53 +0000 (08:28 -0400)]
Merge branch '2020-08-07-misc-improvements'

- SquashFS support
- Assorted bugfixes

4 years agotest: py: test_shell_run() with CONFIG_HUSH_PARSER=n
Heinrich Schuchardt [Wed, 5 Aug 2020 16:31:42 +0000 (18:31 +0200)]
test: py: test_shell_run() with CONFIG_HUSH_PARSER=n

The hush parser not enabled for some boards, e.g.
sipeed_maix_bitm_defconfig.

With CONFIG_HUSH_PARSER=n a double quotation mark is not interpreted as the
beginning of a string. Use a single quotation mark instead.

Furthermore without the hush parser variables have to be referenced as
${varname}. Add the missing braces.

Reported-by: Sean Anderson <seanga2@gmail.com>
Fixes: 8b86c609b860 ("test/py: add test of basic shell functionality")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotests: support mkfs.ext4 without metadata_csum
Stephen Warren [Tue, 4 Aug 2020 17:28:33 +0000 (11:28 -0600)]
tests: support mkfs.ext4 without metadata_csum

Modify various test/py filesystem creation routines to support systems
that don't implement the metadata_csum ext4 feature.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
4 years agoboard: presidio: add LED support
Jway Lin [Wed, 1 Jul 2020 04:08:07 +0000 (21:08 -0700)]
board: presidio: add LED support

Add LED support for Cortina Access Presidio Engineering Board

Signed-off-by: Jway Lin <jway.lin@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
CC: Simon Glass <sjg@chromium.org>
4 years agoled: led_cortina: Add CAxxx LED support
Jway Lin [Wed, 1 Jul 2020 04:08:06 +0000 (21:08 -0700)]
led: led_cortina: Add CAxxx LED support

Add Cortina Access LED controller support for CAxxxx SOCs

Signed-off-by: Jway Lin <jway.lin@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
CC: Simon Glass <sjg@chromium.org>
Add head file fixed link error and remove unused flashing function
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoTravis: Add squashfs-tools
Tom Rini [Fri, 7 Aug 2020 16:33:39 +0000 (12:33 -0400)]
Travis: Add squashfs-tools

So that the tests we now have for squashfs can run, add squashfs-tools
for mksquashfs.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotest/py: Add tests for the SquashFS commands
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:52 +0000 (15:33 +0200)]
test/py: Add tests for the SquashFS commands

Add Python scripts to test 'ls' and 'load' commands. The scripts
generate a SquashFS image and clean the directory after the assertions,
or if an exception is raised.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agofs/fs.c: add symbolic link case to fs_ls_generic()
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:51 +0000 (15:33 +0200)]
fs/fs.c: add symbolic link case to fs_ls_generic()

Adds an 'else if' statement inside the loop to check for symbolic links.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agofs/squashfs: add support for zlib decompression
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:50 +0000 (15:33 +0200)]
fs/squashfs: add support for zlib decompression

Add call to zlib's 'uncompress' function. Add function to display the
right error message depending on the decompression's return value.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agoinclude/u-boot, lib/zlib: add sources for zlib decompression
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:49 +0000 (15:33 +0200)]
include/u-boot, lib/zlib: add sources for zlib decompression

Add zlib (v1.2.11) uncompr() function to U-Boot. SquashFS depends on
this function to decompress data from a raw disk image. The actual
support for zlib into SquashFS sources will be added in a follow-up
commit.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agofs/squashfs: add filesystem commands
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:48 +0000 (15:33 +0200)]
fs/squashfs: add filesystem commands

Add 'ls' and 'load' commands.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agofs/squashfs: new filesystem
Joao Marcos Costa [Thu, 30 Jul 2020 13:33:47 +0000 (15:33 +0200)]
fs/squashfs: new filesystem

Add support for SquashFS filesystem. Right now, it does not support
compression but support for zlib will be added in a follow-up commit.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
4 years agocmd: Update the memory-search command
Simon Glass [Wed, 29 Jul 2020 01:41:14 +0000 (19:41 -0600)]
cmd: Update the memory-search command

Add various fixes and improvements to this command that were missed in
the original version. Unfortunately I forgot to send v2.

- Fix Kconfig name
- Use a separate variable for the remaining search length
- Correct a minor bug
- Move into a separate test suite
- Add -q flag to the 'quiet' test to test operation when console is enabled
- Enable the feature for sandbox

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotest: Add a flag for tests that need console recording
Simon Glass [Wed, 29 Jul 2020 01:41:13 +0000 (19:41 -0600)]
test: Add a flag for tests that need console recording

Allow tests that need console recording to be marked, so they can be
skipped if it is not available.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: Rename DM test flags to make them more generic
Simon Glass [Wed, 29 Jul 2020 01:41:12 +0000 (19:41 -0600)]
dm: Rename DM test flags to make them more generic

The test flags used by driver model are currently not available to other
tests. Rather than creating two sets of flags, make these flags generic
by changing the DM_ prefix to UT_ and moving them to the test.h header.

This will allow adding other test flags without confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoconsole: Always define the console-recording functions
Simon Glass [Wed, 29 Jul 2020 01:41:11 +0000 (19:41 -0600)]
console: Always define the console-recording functions

On boards without console recording these function are currently missing.
It is more convenient for them to be present but to return dummy values.
That way if we know that a test needs recording, we can check if it is
available, and skip the test if not, while avoiding #ifdefs.

Update the header file according and adjust console_record_reset_enable()
to return an error if recording is not available.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotest: Add a way to check part of a console line or skip it
Simon Glass [Wed, 29 Jul 2020 01:41:10 +0000 (19:41 -0600)]
test: Add a way to check part of a console line or skip it

Some lines of the output are not worth testing, or not worth testing in
their entirety. For example, when checking a hex dump we know that the
hex-dump routine can display ASCII so we only need to check the hex bytes,
not the ASCII dump. Add a new test macros which can check only part of
a console line.

Sometimes it is useful to skip a line altogether, so add a macro for that
also.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMerge branch '2020-08-07-mkimage-improvements'
Tom Rini [Fri, 7 Aug 2020 15:56:34 +0000 (11:56 -0400)]
Merge branch '2020-08-07-mkimage-improvements'

- Assorted mkimage improvements related to FIT images and verified boot

4 years agomkimage: fit: fix import of external data
Patrick Oppenlander [Thu, 30 Jul 2020 04:31:48 +0000 (14:31 +1000)]
mkimage: fit: fix import of external data

The external data is located after the mmapped FDT pointed to by
'old_fdt', not in the newly created FDT we are importing into at 'fdt'.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
4 years agomkimage: fit: include image cipher in configuration signature
Patrick Oppenlander [Thu, 30 Jul 2020 04:30:47 +0000 (14:30 +1000)]
mkimage: fit: include image cipher in configuration signature

This patch addresses issue #2 for signed configurations.

-----8<-----

Including the image cipher properties in the configuration signature
prevents an attacker from modifying cipher, key or iv properties.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agomkimage: fit: don't cipher ciphered data
Patrick Oppenlander [Thu, 30 Jul 2020 04:22:15 +0000 (14:22 +1000)]
mkimage: fit: don't cipher ciphered data

Previously, mkimage -F could be run multiple times causing already
ciphered image data to be ciphered again.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agomkimage: fit: handle FDT_ERR_NOSPACE when ciphering
Patrick Oppenlander [Thu, 30 Jul 2020 04:22:14 +0000 (14:22 +1000)]
mkimage: fit: handle FDT_ERR_NOSPACE when ciphering

Also replace fdt_delprop/fdt_setprop with fdt_setprop as fdt_setprop can
replace an existing property value.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agomkimage: fit: only process one cipher node
Patrick Oppenlander [Thu, 30 Jul 2020 04:22:13 +0000 (14:22 +1000)]
mkimage: fit: only process one cipher node

Previously mkimage would process any node matching the regex cipher.*
and apply the ciphers to the image data in the order they appeared in
the FDT. This meant that data could be inadvertently ciphered multiple
times.

Switch to processing a single cipher node which exactly matches
FIT_CIPHER_NODENAME.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 7 Aug 2020 03:09:32 +0000 (23:09 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- XHCI updates to support MIPS better

4 years agoMerge branch '2020-08-06-Kconfig-sram-options'
Tom Rini [Fri, 7 Aug 2020 00:57:55 +0000 (20:57 -0400)]
Merge branch '2020-08-06-Kconfig-sram-options'

- Migrate a few SRAM related options to Kconfig, related cleanups.

4 years agocommon/board_r: Move blkcache_init call earlier in the boot sequence
Ovidiu Panait [Fri, 24 Jul 2020 11:12:25 +0000 (14:12 +0300)]
common/board_r: Move blkcache_init call earlier in the boot sequence

blkcache_init manually relocates blkcache list pointers when
CONFIG_NEEDS_MANUAL_RELOC is enabled. However, it is called very late in
the boot sequence, which could be a problem if previous boot calls execute
blkcache operations with the non-relocated pointers. For example, mmc is
initialized earlier and might call blkcache_invalidate (in
mmc_select_hwpart()) when trying to load the environment from mmc via
env_load().

To fix this issue, move blkcache_init boot call earlier, before mmc gets
initialized.

Acked-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoblkcache: Extend blkcache_init to cover CONFIG_NEEDS_MANUAL_RELOC
Ovidiu Panait [Fri, 24 Jul 2020 11:12:24 +0000 (14:12 +0300)]
blkcache: Extend blkcache_init to cover CONFIG_NEEDS_MANUAL_RELOC

Extend manual relocation of block_cache list pointers to all platforms that
enable CONFIG_NEEDS_MANUAL_RELOC. Remove m68k-specific checks and provide a
single implementation that adds gd->reloc_off to the pre-relocation
pointers.

Acked-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Eric Nelson <eric@nelint.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
[trini: Add guard around DECLARE_GLOBAL_DATA_PTR to avoid size growth]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agocommon/board_r: Remove initr_serial wrapper
Ovidiu Panait [Fri, 24 Jul 2020 11:12:23 +0000 (14:12 +0300)]
common/board_r: Remove initr_serial wrapper

Remove the initr_serial->serial_initialize indirection and call
serial_initialize directly.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agodrivers: serial: Make serial_initialize return int
Ovidiu Panait [Fri, 24 Jul 2020 11:12:22 +0000 (14:12 +0300)]
drivers: serial: Make serial_initialize return int

serial_initialize is called only during the common init sequence, after
relocation (in common/board_r.c). Because it has a void return value, it
has to wrapped in initr_serial. In order to be able to get rid of this
indirection, make serial_initialize return int.

Remove extern from prototype in order to silence the following checkpatch
warning:
check: extern prototypes should be avoided in .h files

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agodm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probe
Ovidiu Panait [Fri, 24 Jul 2020 11:12:21 +0000 (14:12 +0300)]
dm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probe

Use IS_ENABLED() instead of #ifdef in blk_post_probe function.

No functional change intended.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
[trini: Fix thinko and use CONFIG_HAVE_BLOCK_DEVICE in IS_ENABLED()]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoboard_f: Remove setup_board_part1
Ovidiu Panait [Fri, 24 Jul 2020 11:12:20 +0000 (14:12 +0300)]
board_f: Remove setup_board_part1

Now that all arch specific code was converted to setup_bdinfo, we can
remove setup_board_part1.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_f: ppc: Factor out ppc-specific bdinfo setup
Ovidiu Panait [Fri, 24 Jul 2020 11:12:19 +0000 (14:12 +0300)]
board_f: ppc: Factor out ppc-specific bdinfo setup

Factor out ppc-specific bdinfo setup from generic init sequence to
arch_setup_bdinfo in arch/powerpc/lib/bdinfo.c.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_f: m68k: Factor out m68k-specific bdinfo setup
Ovidiu Panait [Fri, 24 Jul 2020 11:12:18 +0000 (14:12 +0300)]
board_f: m68k: Factor out m68k-specific bdinfo setup

Factor out m68k-specific bdinfo setup to arch_setup_bdinfo in
arch/m68k/lib/bdinfo.c. Also, use if(IS_ENABLED()) instead of #ifdef where
possible.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_f: Move sram bdinfo assignments to generic code
Ovidiu Panait [Fri, 24 Jul 2020 11:12:17 +0000 (14:12 +0300)]
board_f: Move sram bdinfo assignments to generic code

Move sram related bdinfo from arch-specific setup_board_part1 to generic
code in setup_bdinfo. Also use "if (IS_ENABLED(CONFIG_SYS_HAS_SRAM))"
instead of "#ifdef CONFIG_SYS_SRAM_BASE".

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo
Ovidiu Panait [Fri, 24 Jul 2020 11:12:16 +0000 (14:12 +0300)]
board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo

Move all assignments to gd->bd->bi_mem{start,size} to generic code in
setup_bdinfo.

Xtensa architecture is special in this regard as it defines its own
handling of gd->bd->bi_mem{start,size} fields. In order to avoid defining
a weak SDRAM function, let arch_setup_bdinfo overwrite the generic flags.

For ARC architecture, remove ARCH_EARLY_INIT_R from Kconfig since it is
not needed anymore.

Also, use gd->ram_base to populate bi_memstart to avoid an ifdef.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Acked-by: Alexey Brodkin <abrokdin@synopsys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard_f: Introduce arch_setup_bdinfo initcall
Ovidiu Panait [Fri, 24 Jul 2020 11:12:15 +0000 (14:12 +0300)]
board_f: Introduce arch_setup_bdinfo initcall

Certain architectures (ppc, mips, sh, m68k) use setup board_part1 and
setup_board_part2 calls during pre-relocation init to populate gd->bd
boardinfo fields. This makes the generic init sequence cluttered with
arch-specific ifdefs.

In order to clean these arch-specific sequences from generic init,
introduce arch_setup_bdinfo weak initcall so that everyone can define their
own bdinfo setup routines.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_f: Introduce setup_bdinfo initcall
Ovidiu Panait [Fri, 24 Jul 2020 11:12:14 +0000 (14:12 +0300)]
board_f: Introduce setup_bdinfo initcall

Introduce setup_bdinfo initcall as a generic routine to populate bdinfo
fields.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agocmd: bdinfo: Move sram info prints to generic code
Ovidiu Panait [Fri, 24 Jul 2020 11:12:13 +0000 (14:12 +0300)]
cmd: bdinfo: Move sram info prints to generic code

bi_sramstart and bi_sramsize are generic members of the bd_info structure,
so move the m68k/powerpc-specific prints to generic code. Also, print them
only if SRAM support is enabled via CONFIG_SYS_HAS_SRAM.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoKconfig: Remove CONFIG_SYS_SRAM_START
Ovidiu Panait [Fri, 24 Jul 2020 11:12:12 +0000 (14:12 +0300)]
Kconfig: Remove CONFIG_SYS_SRAM_START

Remove ad-hoc CONFIG_SYS_SRAM_START and use CONFIG_SYS_SRAM_BASE instead.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoKconfig: Convert CONFIG_SYS_SRAM_SIZE to Kconfig
Ovidiu Panait [Fri, 24 Jul 2020 11:12:11 +0000 (14:12 +0300)]
Kconfig: Convert CONFIG_SYS_SRAM_SIZE to Kconfig

This converts ad-hoc CONFIG_SYS_SRAM_SIZE to Kconfig.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoKconfig: Convert CONFIG_SYS_SRAM_BASE to Kconfig
Ovidiu Panait [Fri, 24 Jul 2020 11:12:10 +0000 (14:12 +0300)]
Kconfig: Convert CONFIG_SYS_SRAM_BASE to Kconfig

This converts ad-hoc CONFIG_SYS_SRAM_BASE to Kconfig.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoKconfig: Introduce CONFIG_SYS_HAS_SRAM
Ovidiu Panait [Fri, 24 Jul 2020 11:12:09 +0000 (14:12 +0300)]
Kconfig: Introduce CONFIG_SYS_HAS_SRAM

In order to be able to replace "#ifdef CONFIG_SYS_SRAM_BASE" sequences
with the IS_ENABLED() equivalent, introduce a new boolean Kconfig option
that signals whether the platform has SRAM support.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 6 Aug 2020 15:06:02 +0000 (11:06 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Cleanup in Marvell bubt cmd (Tom & Jagan)
- Add a series of MikroTik CRS3xx, 98DX3236 based switches (Luka)

4 years agomvebu: bubt: Drop dead code
Tom Rini [Fri, 24 Jul 2020 21:13:17 +0000 (17:13 -0400)]
mvebu: bubt: Drop dead code

The code around CONFIG_SYS_MMC_ENV_PART has been untested since merge.
This can be seen by it referencing 'mmc->part_num' which was migrated
elsewhere prior to this code being merged.

Cc: Joel Johnson <mrjoel@lixil.net>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Update CRS305-1G-4S board flash layout
Luka Kovacic [Thu, 23 Jul 2020 08:56:40 +0000 (10:56 +0200)]
arm: mvebu: Update CRS305-1G-4S board flash layout

Update the MikroTik CRS305-1G-4S flash layout to support redundant UBI
partitions.
Additionally enable the UBI commands in crs305-1g-4s_defconfig.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: crs3xx-98dx3236: Add a maintainer
Luka Kovacic [Thu, 23 Jul 2020 08:56:39 +0000 (10:56 +0200)]
arm: mvebu: crs3xx-98dx3236: Add a maintainer

Add Luka Perkov to CRS3xx-98DX3236 MAINTAINERS.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Add CRS328-4C-20S-4S board
Luka Kovacic [Thu, 23 Jul 2020 08:56:38 +0000 (10:56 +0200)]
arm: mvebu: Add CRS328-4C-20S-4S board

MikroTik CRS328-4C-20S-4S board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

This commit includes two board variants, namely the factory
default one and a Bit variant. The Bit board variant has a
bigger Macronix flash.

Add basic U-Boot, UART and SPI flash support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Add CRS326-24G-2S board
Luka Kovacic [Thu, 23 Jul 2020 08:56:37 +0000 (10:56 +0200)]
arm: mvebu: Add CRS326-24G-2S board

MikroTik CRS326-24G-2S board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

This commit includes two board variants, namely the factory
default one and a Bit variant. The Bit board variant has a
bigger Macronix flash.

Add basic U-Boot, UART and SPI flash support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Add CRS305-1G-4S Bit board
Luka Kovacic [Thu, 23 Jul 2020 08:56:36 +0000 (10:56 +0200)]
arm: mvebu: Add CRS305-1G-4S Bit board

MikroTik CRS305-1G-4S Bit board has a switch chip with an integrated
Marvell Prestera 98DX3236 CPU.

The Bit board variant is added, which has a bigger Macronix flash.

Add basic U-Boot, UART and Winbond SPI flash support.

Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Jakov Petrina <jakov.petrina@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agocmd: mvebu/bubt: Drop unused SPI_FLASH_PROTECTION
Jagan Teki [Sun, 12 Jul 2020 17:59:01 +0000 (23:29 +0530)]
cmd: mvebu/bubt: Drop unused SPI_FLASH_PROTECTION

SPI_FLASH_PROTECTION config item is never used in anywhere
in the U-Boot tree.

Drop it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoAzure/Travis: Update to latest Docker image
Tom Rini [Wed, 5 Aug 2020 23:28:49 +0000 (19:28 -0400)]
Azure/Travis: Update to latest Docker image

- New bionic snapshot
- Updated sbsigntool
- Include SH4 in qemu

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Wed, 5 Aug 2020 20:06:42 +0000 (16:06 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sh

- r2dplus updates

4 years agoMerge branch '2020-08-05-misc-fixes'
Tom Rini [Wed, 5 Aug 2020 20:05:33 +0000 (16:05 -0400)]
Merge branch '2020-08-05-misc-fixes'

- A large number of assorted fixes and minor improvements

4 years agotools: env: Avoid an uninited warning with was_locked
Simon Glass [Sat, 1 Aug 2020 16:30:39 +0000 (10:30 -0600)]
tools: env: Avoid an uninited warning with was_locked

Set this variable to 0 to avoid a warning about an unused variable. This
happens on gcc 7.5.0 for me.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotools: env: Fix printf() warning in fw_env
Simon Glass [Sat, 1 Aug 2020 16:30:38 +0000 (10:30 -0600)]
tools: env: Fix printf() warning in fw_env

The printf() string produces a warning about %d not matching size_t. Fix
it and put the format string on one line to avoid a checkpatch warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoARM: add Kconfig option for PSCI 0.1
Icenowy Zheng [Fri, 31 Jul 2020 18:56:45 +0000 (02:56 +0800)]
ARM: add Kconfig option for PSCI 0.1

We still have some platforms that only implements functionalities in
PSCI 0.1 (e.g. Allwinner ARMv7 SoCs).

Add a Kconfig option for exporting only PSCI 0.1. The code to export
PSCI 0.1 is still available and gets activated by this patch.

In addition, default ARCH_SUNXI U-Boot PSCI implementation to export
PSCI 0.1, to fix poweroff/reboot regression on Allwinner multi-core
ARMv7 SoCs.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
4 years agocmd: bdinfo: cleanup phys_addr_t output
Heinrich Schuchardt [Tue, 28 Jul 2020 15:56:33 +0000 (17:56 +0200)]
cmd: bdinfo: cleanup phys_addr_t output

We currently print the memory size with at least 8 hexadecimal digits.
This creates a ragged output on 64 bit boards, e.g. on a Kendryte K210:

DRAM bank   = 0x0000000000000002
-> start    = 0x0000000080600000
-> size     = 0x0000000000200000
memstart    = 0x0000000000000000
memsize     = 0x00000000
flashstart  = 0x0000000000000000
flashsize   = 0x0000000000000000
flashoffset = 0x0000000000000000

All other numbers are printed with the number of digits needed for the type
ulong. So use this value as minimum number of digits (precision) for
printing physical addresses.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocmd: bootz: fix device-tree overlap test
Baruch Siach [Tue, 28 Jul 2020 14:57:48 +0000 (17:57 +0300)]
cmd: bootz: fix device-tree overlap test

The address of the kernel image is stored in images->ep. zi_start is the
offset of execution entry in the image, which is usually 0 for ARM
zImage.

Fixes boot error when ftd is stored near RAM address 0x0:

ERROR: FDT image overlaps OS image (OS=0x0..0x5fd608)

Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
4 years agofit_image: Use calloc() to fix reproducibility issue
Fabio Estevam [Tue, 28 Jul 2020 00:03:13 +0000 (21:03 -0300)]
fit_image: Use calloc() to fix reproducibility issue

Vagrant Cascadian reported that mx6cuboxi target no longer builds
reproducibility on Debian.

One example of builds mismatches:

00096680: 696e 6700 736f 756e 642d 6461 6900 6465  ing.sound-dai.de
-00096690: 7465 6374 2d67 7069 6f73 0000            tect-gpios..
+00096690: 7465 6374 2d67 7069 6f73 0061            tect-gpios.a

This problem happens because all the buffers in fit_image.c are
allocated via malloc(), which does not zero out the allocated buffer.

Using calloc() fixes this unpredictable behaviour as it guarantees
that the allocated buffer are zero initialized.

Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
4 years agousb: xhci: Add virt_to_phys() to support mapped platforms
Stefan Roese [Tue, 21 Jul 2020 08:46:05 +0000 (10:46 +0200)]
usb: xhci: Add virt_to_phys() to support mapped platforms

Some platforms, like MIPS Octeon, use mapped addresses (virtual address
!= physical address). On these platforms we need to make sure, that the
local virtual addresses are converted to physical (DMA) addresses for
the xHCI controller. This patch adds the missing virt_to_phys() calls,
so that the correct addresses are used.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
4 years agousb: usb-uclass.c: Drop le16_to_cpu() as values are already swapped
Stefan Roese [Tue, 21 Jul 2020 08:46:04 +0000 (10:46 +0200)]
usb: usb-uclass.c: Drop le16_to_cpu() as values are already swapped

These values are already swapped to CPU endianess, so swapping them
again is a bug. Let's remove the swap here instead.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
4 years agousb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()
Stefan Roese [Tue, 21 Jul 2020 08:46:03 +0000 (10:46 +0200)]
usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()

xhci_writeq() makes the CPU->LE swapping only when addressing registers
in the xHCI controller address range and not in the local memory (RAM).
We need to use cpu_to_le64() here to ensure that the conversion is done
correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
4 years agousb: xhci: Add missing endian conversions (cpu_to_leXX / leXX_to_cpu)
Stefan Roese [Tue, 21 Jul 2020 08:46:02 +0000 (10:46 +0200)]
usb: xhci: Add missing endian conversions (cpu_to_leXX / leXX_to_cpu)

While trying to use the U-Boot xHCI driver on the MIPS Octeon platform,
which is big endian, I noticed that the driver is missing a few endian
conversion calls. This patch adds these missing endian conversion
calls.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
4 years agoarm: Add SPL build check to SPL early bss clear
Brian Moyer [Sun, 26 Jul 2020 20:17:53 +0000 (13:17 -0700)]
arm: Add SPL build check to SPL early bss clear

SPL_CLEAR_BSS is called regardless of build type if
CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD
to fix.

Signed-off-by: Brian Moyer <bdm310@gmail.com>
4 years agodoc: move Clang documentation to HTML
Heinrich Schuchardt [Sat, 25 Jul 2020 07:55:46 +0000 (09:55 +0200)]
doc: move Clang documentation to HTML

* Move README.clang to doc/build/clang.rst and reformat as
  reStructeredText.
* Indicate that -ffixed-r9 and -ffixed-x18 are used to reserve registers
  for gd.
* Minor editing.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agopinctrl: aspeed: Fix Kconfig entry indentation
Michal Simek [Thu, 23 Jul 2020 07:00:40 +0000 (09:00 +0200)]
pinctrl: aspeed: Fix Kconfig entry indentation

Fix Kconfig entry indentation for Aspeed ast2500 pin control driver.

Fixes: 4f0e44e46615 ("aspeed: AST2500 Pinctrl Driver")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMakefile.lib: Build all DTS with -@ if OF_LIBFDT_OVERLAY is enabled
Michal Simek [Wed, 22 Jul 2020 12:58:25 +0000 (14:58 +0200)]
Makefile.lib: Build all DTS with -@ if OF_LIBFDT_OVERLAY is enabled

The commit 47818e23a228 ("Makefile.lib: include /__symbols__ in dtb if
SPL_LOAD_FIT_APPLY_OVERLAY is enabled") enables DT building as overlays
based on symbols which depends on SPL. But there is already an option to
apply overlays in full U-Boot too.
And there are platforms which are not using SPL and there is no option to
build DTs with -@ parameter.
That's why change dependency on OF_LIBFDT_OVERLAY which is already symbol
which is selected when SPL_LOAD_FIT_APPLY_OVERLAY is enabled but also
adding support for platforms which don't enable SPL and want to work with
overlays on U-Boot prompt.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: Sync include/dt-bindings/phy/phy.h from Linux
Michal Simek [Wed, 22 Jul 2020 11:58:54 +0000 (13:58 +0200)]
dt-bindings: Sync include/dt-bindings/phy/phy.h from Linux

Add 4 new phy types which are present in Linux kernel.
DP and SGMII types are used on Xilinx ZynqMP devices.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>