]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
6 years agoscripts/check-config.sh: fix "command not found" error handling
Luca Ceresoli [Thu, 15 Mar 2018 10:08:56 +0000 (11:08 +0100)]
scripts/check-config.sh: fix "command not found" error handling

scripts/check-config.sh exits successfully and silently without doing
any checks when the 'comm' command is not found.

The problem triggers from the command around line 39:

  comm -23 ${suspects} ${ok} >${new_adhoc}

This statement fails when 'comm' is not in $PATH, creating an empty
${new_adhoc} file. But the script continues and the following line,
which is supposed to detect an error:

  if [ -s ${new_adhoc} ]; then

will always be false since the file is empty, and the script will exit
successfully as if everything were OK.

The case where 'comm' in not in $PATH is not theoretical. It used to
happen on yocto until a recent fix [0], and still happens on the
current stable branch (rocko).

Fix by setting the errexit flag to exit with error when a statement
fails, so that at least the problem is noticed.

For additional safety also set the nounset flag to detect expansion
errors.

[0] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fe0b4cb5b48580d4a3f3c0eb82bfa6f1b13801e4

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agodavinci: omapl138_lcdk: fix PLL0 frequency
David Lechner [Thu, 15 Mar 2018 01:36:30 +0000 (20:36 -0500)]
davinci: omapl138_lcdk: fix PLL0 frequency

commit 1601dd97edc6 ("davinci: omapl138_lcdk: increase PLL0 frequency")
changed the PLL0 frequency to 456MHz, which is needed for the LCDC IP
block. However, in doing so, it caused the PLLOUT clock to be outside
of the allowable specifications given in the OMAP-L138 data sheet. (It
says PLLOUT must be 600MHz max). It also uses a PLLM value outside of
the range given in the TRM (it says PLLM must in the range 0 to 0x1f).

So here is what we have currently:

PLLOUT = 24 / (0 + 1) * (37 + 1) = 912MHz (out of spec)
         ^     ^         ^
       CLKIN PREDIV    PLLM (out of spec)

input to PLLDIVn = 912 / (1 + 1) = 456MHz (desired result)
                    ^     ^
                 PLLOUT POSTDIV

This changes the PLLM value to 18 and the POSTDIV value to 0 so that
PLLOUT is now within specification but we still get the desired
result.

PLLOUT = 24 / (0 + 1) * (18 + 1) = 456MHz (within spec)
         ^     ^         ^
       CLKIN PREDIV     PLLM

input to PLLDIVn = 456 / (0 + 1) = 456MHz (desired result)
                    ^     ^
                 PLLOUT POSTDIV

Fixes: 1601dd97edc6 ("davinci: omapl138_lcdk: increase PLL0 frequency")
Signed-off-by: David Lechner <david@lechnology.com>
Reported-by: Sekhar Nori <nsekhar@ti.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
6 years agotest/py: add spi_flash tests
Liam Beguin [Wed, 14 Mar 2018 23:15:16 +0000 (19:15 -0400)]
test/py: add spi_flash tests

Add basic tests for the spi_flash subsystem.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agotest/py: add generic CRC32 function
Liam Beguin [Wed, 14 Mar 2018 23:15:15 +0000 (19:15 -0400)]
test/py: add generic CRC32 function

Add a generic function which can be used to compute the CRC32 value of
a region of RAM.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agotest/py: do not import pytest multiple times
Liam Beguin [Wed, 14 Mar 2018 23:15:14 +0000 (19:15 -0400)]
test/py: do not import pytest multiple times

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agotest/py: README: add HOSTNAME to PYTHONPATH
Liam Beguin [Wed, 14 Mar 2018 23:15:13 +0000 (19:15 -0400)]
test/py: README: add HOSTNAME to PYTHONPATH

As opposed to PATH, HOSTNAME is not appended to PYTHONPATH
automatically. Lets add it to the examples to make it more
obvious to new users.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agotest/py: README: fix typo
Liam Beguin [Wed, 14 Mar 2018 23:15:12 +0000 (19:15 -0400)]
test/py: README: fix typo

Fix a minor typo causing vim (and possibly other) to get confused with
coloring.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agocmd: sf: fix map_physmem check
Liam Beguin [Wed, 14 Mar 2018 23:15:11 +0000 (19:15 -0400)]
cmd: sf: fix map_physmem check

Make sure 0x00 is a valid address to read to. If `addr` is 0x00 then
map_physmem() will return 0 which should be a valid address.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agospi: spi_flash: do not fail silently on bad user input
Liam Beguin [Wed, 14 Mar 2018 23:15:10 +0000 (19:15 -0400)]
spi: spi_flash: do not fail silently on bad user input

Make sure the user is notified instead of silently returning an error.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
6 years agotools: Make kwboot build if HOST_TOOLS_ALL=y
Tuomas Tynkkynen [Tue, 13 Mar 2018 13:23:04 +0000 (15:23 +0200)]
tools: Make kwboot build if HOST_TOOLS_ALL=y

The kwboot tool for Marvell devices isn't currently being built even if
HOST_TOOLS_ALL is set. It doesn't appear to depend on any CONFIG_
options, so it seems appropriate to enable building it here.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoMerge git://git.denx.de/u-boot-mips
Tom Rini [Wed, 21 Mar 2018 22:58:03 +0000 (18:58 -0400)]
Merge git://git.denx.de/u-boot-mips

6 years agomips: bmips: add ar-5315 usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:11:17 +0000 (21:11 +0100)]
mips: bmips: add ar-5315 usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6318 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:11:16 +0000 (21:11 +0100)]
mips: bmips: add support for bcm6318 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agophy: add support for bcm6318 usbh phy
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:11:15 +0000 (21:11 +0100)]
phy: add support for bcm6318 usbh phy

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
6 years agomips: bmips: add vr-3032u usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:21 +0000 (21:10 +0100)]
mips: bmips: add vr-3032u usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm63268 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:20 +0000 (21:10 +0100)]
mips: bmips: add support for bcm63268 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add dgnd3700v2 usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:19 +0000 (21:10 +0100)]
mips: bmips: add dgnd3700v2 usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6362 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:18 +0000 (21:10 +0100)]
mips: bmips: add support for bcm6362 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add ar-5387un usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:17 +0000 (21:10 +0100)]
mips: bmips: add ar-5387un usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6328 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:16 +0000 (21:10 +0100)]
mips: bmips: add support for bcm6328 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add wap-5813n usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:15 +0000 (21:10 +0100)]
mips: bmips: add wap-5813n usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6368 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:14 +0000 (21:10 +0100)]
mips: bmips: add support for bcm6368 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agophy: add support for bcm6368 usbh phy
Álvaro Fernández Rojas [Sun, 4 Feb 2018 20:10:13 +0000 (21:10 +0100)]
phy: add support for bcm6368 usbh phy

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
6 years agomips: bmips: add nb4-ser usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:19:14 +0000 (11:19 +0100)]
mips: bmips: add nb4-ser usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add hg556a usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:19:13 +0000 (11:19 +0100)]
mips: bmips: add hg556a usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6358 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:19:12 +0000 (11:19 +0100)]
mips: bmips: add support for bcm6358 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agophy: add support for bcm6358 usbh phy
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:19:11 +0000 (11:19 +0100)]
phy: add support for bcm6358 usbh phy

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
6 years agomips: bmips: add ct-5361 usb support
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:18:26 +0000 (11:18 +0100)]
mips: bmips: add ct-5361 usb support

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agomips: bmips: add support for bcm6348 usb
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:18:25 +0000 (11:18 +0100)]
mips: bmips: add support for bcm6348 usb

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
6 years agophy: add support for bcm6348 usbh phy
Álvaro Fernández Rojas [Sun, 4 Feb 2018 10:18:24 +0000 (11:18 +0100)]
phy: add support for bcm6348 usbh phy

Signed-off-by: Ã\81lvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
6 years agomips: micronas/vct: check array bounds before access
Heinrich Schuchardt [Sun, 18 Mar 2018 22:43:43 +0000 (23:43 +0100)]
mips: micronas/vct: check array bounds before access

If we check an index against array bounds, we should do so before
accessing the array and not afterwards.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agomips: bmips: select OF_EMBED for all boards
Álvaro Fernández Rojas [Sat, 3 Feb 2018 12:42:40 +0000 (13:42 +0100)]
mips: bmips: select OF_EMBED for all boards

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
6 years agoMIPS: add BMIPS Netgear DGND3700v2 board
Álvaro Fernández Rojas [Sat, 3 Feb 2018 09:30:28 +0000 (10:30 +0100)]
MIPS: add BMIPS Netgear DGND3700v2 board

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
6 years agoMIPS: add support for Broadcom MIPS BCM6362 SoC family
Álvaro Fernández Rojas [Sat, 3 Feb 2018 09:30:27 +0000 (10:30 +0100)]
MIPS: add support for Broadcom MIPS BCM6362 SoC family

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
6 years agodm: cpu: bmips: add BCM6362 support
Álvaro Fernández Rojas [Sat, 3 Feb 2018 09:30:26 +0000 (10:30 +0100)]
dm: cpu: bmips: add BCM6362 support

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
6 years agoMerge git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Tue, 20 Mar 2018 22:39:27 +0000 (18:39 -0400)]
Merge git://git.denx.de/u-boot-fsl-qoriq

6 years agoLS2088ARDB: Secure Boot: Fix fall back option failure
Vinitha V Pillai [Tue, 27 Feb 2018 07:27:31 +0000 (12:57 +0530)]
LS2088ARDB: Secure Boot: Fix fall back option failure

Fix NOR, SD and QSPI fallback option in case of secure boot failure.

Signed-off-by: Vinitha V Pillai <vinitha.pillai@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1088aqds: Add IFC-NOR as boot source for LS1088
Ashish Kumar [Mon, 19 Feb 2018 08:46:58 +0000 (14:16 +0530)]
armv8: ls1088aqds: Add IFC-NOR as boot source for LS1088

IFC-NOR and QSPI-NOR pins are multiplexed on SoC, so they cannot be
accessed simultaneously. IFC-NOR can be accessed along with SD-BOOT.

Ls1088aqds_sdcard_ifc_defconfig is default config for SD boot and
IFC-NOR to be used as flash. This allows writing to IFC-NOR flash.
QSPI and DSPI cannot be accessed in this defconfig.
IFC-NOR image is generated using ls1088aqds_defconfig.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1088a: Add i2c_early_init() func for LS1088AQDS
Ashish Kumar [Mon, 19 Feb 2018 08:44:53 +0000 (14:14 +0530)]
armv8: ls1088a: Add i2c_early_init() func for LS1088AQDS

This function is required for enabling access to early i2c function
for correct usage of QIXIS_READ and QIXIS_WRITE.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1088a: Add clock related function in CONFIG_SPL_BUILD
Ashish Kumar [Mon, 19 Feb 2018 08:44:52 +0000 (14:14 +0530)]
armv8: ls1088a: Add clock related function in CONFIG_SPL_BUILD

get_board_ddr_clk(), get_board_sys_clk() and if_board_diff_clk() is
now available for SPL build.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1088qds: Remove CONFIG_ from local defines for FPGA
Ashish Kumar [Mon, 19 Feb 2018 08:44:09 +0000 (14:14 +0530)]
armv8: ls1088qds: Remove CONFIG_ from local defines for FPGA

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoMerge git://git.denx.de/u-boot-usb
Tom Rini [Tue, 20 Mar 2018 00:10:15 +0000 (20:10 -0400)]
Merge git://git.denx.de/u-boot-usb

6 years agoMerge git://git.denx.de/u-boot-sunxi
Tom Rini [Mon, 19 Mar 2018 22:39:14 +0000 (18:39 -0400)]
Merge git://git.denx.de/u-boot-sunxi

6 years agobootm: optee: Add a bootm command for type IH_OS_TEE
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:36 +0000 (16:50 +0000)]
bootm: optee: Add a bootm command for type IH_OS_TEE

This patch makes it possible to verify the contents and location of an
OPTEE image in DRAM prior to handing off control to that image. If image
verification fails we won't try to boot any further.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Suggested-by: Andrew F. Davis <afd@ti.com>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
6 years agoimage: Add IH_OS_TEE for TEE chain-load boot
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:35 +0000 (16:50 +0000)]
image: Add IH_OS_TEE for TEE chain-load boot

This patch adds a new type IH_OS_TEE. This new OS type will be used for
chain-loading to Linux via a TEE.

With this patch in-place you can generate a bootable OPTEE image like this:

mkimage -A arm -T kernel -O tee -C none -d tee.bin uTee.optee

where "tee.bin" is the input binary prefixed with an OPTEE header and
uTee.optee is the output prefixed with a u-boot wrapper header.

This image type "-T kernel -O tee" is differentiated from the existing
IH_TYPE_TEE "-T tee" in that the IH_TYPE is installed by u-boot (flow
control returns to u-boot) whereas for the new IH_OS_TEE control passes to
the OPTEE firmware and the firmware chainloads onto Linux.

Andrew Davis gave the following ASCII diagram:

IH_OS_TEE: (mkimage -T kernel -O tee)
Non-Secure       Secure

                 BootROM
                   |
      -------------
     |
     v
    SPL
     |
     v
   U-Boot ------>
          <-----  OP-TEE
      |
      V
    Linux

IH_TYPE_TEE: (mkimage -T tee)
Non-Secure       Secure

                 BootROM
                   |
      -------------
     |
     v
    SPL ------->
         <-----  OP-TEE
     |
     v
   U-Boot
      |
      V
    Linux

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Suggested-by: Andrew F. Davis <afd@ti.com>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Link: http://mrvan.github.io/optee-imx6ul
6 years agooptee: Add error printout
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:34 +0000 (16:50 +0000)]
optee: Add error printout

When encountering an error in OPTEE verification print out various details
of the OPTEE header to aid in further debugging of encountered errors.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
6 years agooptee: Add optee_verify_bootm_image()
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:33 +0000 (16:50 +0000)]
optee: Add optee_verify_bootm_image()

This patch adds optee_verify_bootm_image() which will be subsequently used
to verify the parameters encoded in the OPTEE header match the memory
allocated to the OPTEE region, OPTEE header magic and version prior to
handing off control to the OPTEE image.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
6 years agooptee: Add optee_image_get_load_addr()
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:32 +0000 (16:50 +0000)]
optee: Add optee_image_get_load_addr()

This patch adds optee_image_get_load_addr() a helper function used to
calculate the load-address of an OPTEE image based on the lower
entry-point address given in the OPTEE header.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
6 years agooptee: Add optee_image_get_entry_point()
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:31 +0000 (16:50 +0000)]
optee: Add optee_image_get_entry_point()

Add a helper function for extracting the least significant 32 bits from the
OPTEE entry point address, which will be good enough to load OPTEE binaries
up to (2^32)-1 bytes.

We may need to extend this out later on but for now (2^32)-1 should be
fine.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
6 years agooptee: Add CONFIG_OPTEE_LOAD_ADDR
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:30 +0000 (16:50 +0000)]
optee: Add CONFIG_OPTEE_LOAD_ADDR

CONFIG_OPTEE_LOAD_ADDR is used to tell u-boot where to load the OPTEE
binary into memory prior to handing off control to OPTEE.

We need to pull this value out of u-boot in order to produce an IMX IVT/CSF
signed pair for the purposes of secure boot. The best way to do that is to
have CONFIG_OPTEE_LOAD_ADDR appear in u-boot.cfg.

Adding new CONFIG entires to u-boot should be kconfig driven so this patch
does just that.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
6 years agooptee: Add CONFIG_OPTEE_TZDRAM_BASE
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:29 +0000 (16:50 +0000)]
optee: Add CONFIG_OPTEE_TZDRAM_BASE

OPTEE is currently linked to a specific area of memory called the TrustZone
DRAM. This patch adds a CONFIG entry for the default address of TrustZone
DRAM that a board-port can over-ride. The region that U-Boot sets aside for
the OPTEE run-time should be verified before attempting to hand off to the
OPTEE run-time. Each board-port should carefully ensure that the TZDRAM
address specified in the OPTEE build and the TZDRAM address specified in
U-Boot match-up.

Further patches will use TZDRAM address with other defines and variables to
carry out a degree of automated verification in U-Boot prior to trying to
boot an OPTEE image.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agooptee: Add CONFIG_OPTEE_TZDRAM_SIZE
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:28 +0000 (16:50 +0000)]
optee: Add CONFIG_OPTEE_TZDRAM_SIZE

OPTEE is currently linked to a specific area of memory called the TrustZone
DRAM. This patch adds a CONFIG entry for the default size of TrustZone DRAM
that a board-port can over-ride. The region that U-Boot sets aside for the
OPTEE run-time should be verified before attempting to hand off to the
OPTEE run-time. Each board-port should carefully ensure that the TZDRAM
size specified in the OPTEE build and the TZDRAM size specified in U-Boot
match-up.

Further patches will use TZDRAM size with other defines and variables to
carry out a degree of automated verification in U-Boot prior to trying to
boot an OPTEE image.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
6 years agooptee: Add lib entries for sharing OPTEE code across ports
Bryan O'Donoghue [Tue, 13 Mar 2018 16:50:27 +0000 (16:50 +0000)]
optee: Add lib entries for sharing OPTEE code across ports

This patch adds code to lib to enable sharing of useful OPTEE code between
board-ports and architectures. The code on lib/optee/optee.c comes from the
TI omap2 port. Eventually the OMAP2 code will be patched to include the
shared code. The intention here is to add more useful OPTEE specific code
as more functionality gets added.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Harinarayan Bhatta <harinarayan@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com>
6 years agoMAINTAINERS: Remove unused ppc4xx entry
Stefan Roese [Tue, 13 Mar 2018 07:41:10 +0000 (08:41 +0100)]
MAINTAINERS: Remove unused ppc4xx entry

ppc4xx support was removed some time ago. Lets remove the now unused
entry in MAINTAINERS as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agopci: Remove unused ppc4xx variable from struct pci_controller
Stefan Roese [Tue, 13 Mar 2018 07:41:09 +0000 (08:41 +0100)]
pci: Remove unused ppc4xx variable from struct pci_controller

ppc4xx support was removed some time ago. Lets remove the now unused
"pci_fb" variable from "struct pci_controller" as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
6 years agonand: Remove unused ppc4xx NAND driver and references
Stefan Roese [Tue, 13 Mar 2018 07:41:08 +0000 (08:41 +0100)]
nand: Remove unused ppc4xx NAND driver and references

ppc4xx support was removed some time ago. Lets remove the now unused
NAND driver and all its references for this platform as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Scott Wood <oss@buserror.net>
6 years agoboard: st: add generic board for STM32MP1 family
Patrick Delaunay [Mon, 12 Mar 2018 09:46:18 +0000 (10:46 +0100)]
board: st: add generic board for STM32MP1 family

Add first support for STM32MP157C-ED1 board with "Basic" boot chain
1/ Boot Rom: load SPL with STM32 image header in SYSRAM
2/ SPL: power up and initialize the DDR and load U-Boot image
        from SDCARD in DDR
3/ U-Boot: search and load extlinux.conf in SDCARD
           (DISTRO activated)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agodts: add device tree for STM32MP157C-ED1 board
Patrick Delaunay [Mon, 12 Mar 2018 09:46:17 +0000 (10:46 +0100)]
dts: add device tree for STM32MP157C-ED1 board

Add minimal devicetree for STM32MP157C-ED1 board,
with only the devices to allow boot from SDCARD:
- RCC for clock and reset
- UART4 for console
- I2C and PMIC
- DDR
- SDMMC0 for SDCard

Waiting Kernel upstream for alignment.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoclk: stm32mp1: add clock tree initialization
Patrick Delaunay [Mon, 12 Mar 2018 09:46:16 +0000 (10:46 +0100)]
clk: stm32mp1: add clock tree initialization

add binding and code for clock tree initialization from device tree

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoclk: add driver for stm32mp1
Patrick Delaunay [Mon, 12 Mar 2018 09:46:15 +0000 (10:46 +0100)]
clk: add driver for stm32mp1

add RCC clock driver for STMP32MP157
- base on driver model = UCLASS_CLK
- support ops to enable, disable and get rate
  of all SOC clock needed by U-Boot

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoreset: stm32: adapt driver for stm32mp1
Patrick Delaunay [Mon, 12 Mar 2018 09:46:14 +0000 (10:46 +0100)]
reset: stm32: adapt driver for stm32mp1

- move to livetree and allow to get address to parent
- add stm32mp1 compatible for probe

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agopinctrl: stm32: update pincontrol for stmp32mp157
Patrick Delaunay [Mon, 12 Mar 2018 09:46:13 +0000 (10:46 +0100)]
pinctrl: stm32: update pincontrol for stmp32mp157

- add the 2 new compatible used by STM32MP157
"st,stm32mp157-pinctrl"
"st,stm32mp157-z-pinctrl"
- update the mask for the port

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agopmic: add stpmu1 support
Patrick Delaunay [Mon, 12 Mar 2018 09:46:12 +0000 (10:46 +0100)]
pmic: add stpmu1 support

This driver implements register read/write operations for STPMU1.

The STPMU1 PMIC provides 4 BUCKs, 6 LDOs, 1 VREF
and 2 power switches. It is accessed via an I2C interface.
This device is used with STM32MP1 SoCs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoram: stm32mp1: add driver
Patrick Delaunay [Mon, 12 Mar 2018 09:46:11 +0000 (10:46 +0100)]
ram: stm32mp1: add driver

Add driver and binding for stm32mp1 ddr controller and phy

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: stm32: add new architecture for STM32MP family
Patrick Delaunay [Mon, 12 Mar 2018 09:46:10 +0000 (10:46 +0100)]
arm: stm32: add new architecture for STM32MP family

- add new arch stm32mp for STM32 MPU/Soc based on Cortex A
- support for stm32mp157 SOC
- SPL is used as first boot stage loader
- using driver model for all the drivers, even in SPL
- all security feature are deactivated (ETZC and TZC)
- reused STM32 MCU drivers when it is possible

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agostm32mp: stm32f7_i2c: use calloc instead of kmalloc
Patrick Delaunay [Mon, 12 Mar 2018 09:46:09 +0000 (10:46 +0100)]
stm32mp: stm32f7_i2c: use calloc instead of kmalloc

Kmalloc is using memalign allocation function. It is not necessary to
align this structure so to save bytes, we move to calloc.

And kmalloc function can't be used in SPL early stage (in board_init_f())

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agogpio: stm32f7_gpio: handle node ngpios
Patrick Delaunay [Mon, 12 Mar 2018 09:46:08 +0000 (10:46 +0100)]
gpio: stm32f7_gpio: handle node ngpios

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agodm: gpio: Convert stm32f7 driver to livetree
Patrick Delaunay [Mon, 12 Mar 2018 09:46:07 +0000 (10:46 +0100)]
dm: gpio: Convert stm32f7 driver to livetree

Update the GPIO driver to support a live device tree.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: armv7: solve issue for timer_rate_hz in arch timer
Patrick Delaunay [Mon, 12 Mar 2018 09:46:06 +0000 (10:46 +0100)]
arm: armv7: solve issue for timer_rate_hz in arch timer

The current value timer_rate_hz causes a problem with function
timer_get_us() from lib time and then an issue with
readx_poll_timeout() function.

With corrected value for tbclk() = timer_rate_hz = CONFIG_SYS_HZ_CLOCK
the weak functions in lib timer can be used:
- get_timer()
- __udelay()
So the specific function in this file are removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agospl: add SPL_RESET_SUPPORT
Patrick Delaunay [Mon, 12 Mar 2018 09:46:05 +0000 (10:46 +0100)]
spl: add SPL_RESET_SUPPORT

Add option to include RESET driver and uclass in SPL.
That can be useful to handle IP reset with same driver
in U-Boot and in SPL.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agotools/mkimage: add support for STM32 image format
Patrick Delaunay [Mon, 12 Mar 2018 09:46:04 +0000 (10:46 +0100)]
tools/mkimage: add support for STM32 image format

STM32MP157 bootrom needs a specific header for first boot stage.
This patch adds support of this header in mkimage.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agotools: env: Implement atomic replace for filesystem
Alex Kiernan [Fri, 9 Mar 2018 12:13:02 +0000 (12:13 +0000)]
tools: env: Implement atomic replace for filesystem

If the U-Boot environment is stored in a regular file and redundant
operation isn't set, then write to a temporary file and perform an
atomic rename.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
6 years agotools: env: Refactor write path of flash_io()
Alex Kiernan [Fri, 9 Mar 2018 12:13:01 +0000 (12:13 +0000)]
tools: env: Refactor write path of flash_io()

Extract write path of flash_io() into a separate function. This patch
should be a functional no-op.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
6 years agotools: env: Fix CamelCasing style violation
Alex Kiernan [Fri, 9 Mar 2018 12:13:00 +0000 (12:13 +0000)]
tools: env: Fix CamelCasing style violation

Replace HaveRedundEnv with have_redund_env to fix style violation.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
6 years agotools: env: Pass through indent
Alex Kiernan [Fri, 9 Mar 2018 12:12:59 +0000 (12:12 +0000)]
tools: env: Pass through indent

Pass tools/env/fw_env.c through indent to correct style violations. This
commit consists of only one non-whitespace change:

  tools/env/fw_env.c:549: error: do not use assignment in if condition

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
6 years agoSPL: Add signature verification when loading image
Jun Nie [Tue, 27 Feb 2018 08:55:58 +0000 (16:55 +0800)]
SPL: Add signature verification when loading image

U-boot proper signature is not verified by SPL on most platforms
even config SPL_FIT_SIGNATURE is enabled. Only fsl-layerscape
platform support secure boot in platform specific code. So
verified boot cannot be achieved if u-boot proper is loaded by
SPL.

This patch add signature verification to u-boot proper images
when loading FIT image in SPL. It is tested on Allwinner bananapi
zero board with H2+ SoC.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
6 years agoMerge git://git.denx.de/u-boot-video
Tom Rini [Mon, 19 Mar 2018 13:56:34 +0000 (09:56 -0400)]
Merge git://git.denx.de/u-boot-video

6 years agosunxi: Add DRAM_SUN8I_A83T kconfig entry
Jagan Teki [Wed, 10 Jan 2018 10:50:26 +0000 (16:20 +0530)]
sunxi: Add DRAM_SUN8I_A83T kconfig entry

Add proper and simple kconfig option for dram_sun8i_a83t.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add DRAM_SUN8I_A33 kconfig entry
Jagan Teki [Wed, 10 Jan 2018 10:47:39 +0000 (16:17 +0530)]
sunxi: Add DRAM_SUN8I_A33 kconfig entry

Add proper and simple kconfig option for dram_sun8i_a33.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add DRAM_SUN8I_A23 kconfig entry
Jagan Teki [Wed, 10 Jan 2018 10:45:14 +0000 (16:15 +0530)]
sunxi: Add DRAM_SUN8I_A23 kconfig entry

Add proper and simple kconfig option for dram_sun8i_a23.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add DRAM_SUN9I kconfig entry
Jagan Teki [Fri, 16 Mar 2018 18:48:01 +0000 (00:18 +0530)]
sunxi: Add DRAM_SUN9I kconfig entry

Add proper and simple kconfig option for dram_sun9i.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add DRAM_SUN4I kconfig entry
Jagan Teki [Wed, 10 Jan 2018 10:33:34 +0000 (16:03 +0530)]
sunxi: Add DRAM_SUN4I kconfig entry

Add proper and simple kconfig option for dram_sun4i.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: add DRAM_SUN6I kconfig
Jagan Teki [Fri, 16 Mar 2018 18:46:36 +0000 (00:16 +0530)]
sunxi: add DRAM_SUN6I kconfig

Add proper and simple kconfig option for dram_sun6i.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add AXP_PMIC_BUS kconfig entry
Jagan Teki [Wed, 14 Feb 2018 16:58:30 +0000 (22:28 +0530)]
sunxi: Add AXP_PMIC_BUS kconfig entry

Add simple and meaningful kconfig option for pmic_bus.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add SUN8I_RSB kconfig entry
Jagan Teki [Thu, 11 Jan 2018 07:53:52 +0000 (13:23 +0530)]
sunxi: Add SUN8I_RSB kconfig entry

Add simple and meaningful kconfig option for rsb.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Use SUN6I_PRCM if used
Jagan Teki [Thu, 11 Jan 2018 07:53:02 +0000 (13:23 +0530)]
sunxi: Use SUN6I_PRCM if used

SUN6I_PRCM is also used for SUN8I and SUN9I, so
select the same on respective MACH types.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add SUN6I_P2WI kconfig entry
Jagan Teki [Thu, 11 Jan 2018 07:51:58 +0000 (13:21 +0530)]
sunxi: Add SUN6I_P2WI kconfig entry

Add simple and meaningful kconfig option for p2wi.c
instead of using MACH type on Makefile.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agosunxi: Add SUN6I_PRCM kconfig entry
Jagan Teki [Thu, 11 Jan 2018 07:51:15 +0000 (13:21 +0530)]
sunxi: Add SUN6I_PRCM kconfig entry

Add simple and meaningful kconfig option for prcm.c
instead of using MACH type on Makefile.

PRCM (Power/Reset/Clock Management) is considered as a
Multi-Functional Device, so used the same on Kconfig definition.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agoboard: Add display to STM32F746 SoC discovery board
yannick fertre [Fri, 2 Mar 2018 14:59:29 +0000 (15:59 +0100)]
board: Add display to STM32F746 SoC discovery board

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agostm32f7: board: add splash screen
yannick fertre [Fri, 2 Mar 2018 14:59:28 +0000 (15:59 +0100)]
stm32f7: board: add splash screen

Support several pixel format (8bits, 16bits, 24bits & 32bits).
Add new file st_logo_data.h which contains logo
stmicroelectronics_uboot_logo_8bit_rle.bmp.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agoarm: dts: stm32: add display for STM32F746 disco board
yannick fertre [Fri, 2 Mar 2018 14:59:27 +0000 (15:59 +0100)]
arm: dts: stm32: add display for STM32F746 disco board

Enable the display controller, panel & backlight.
Set panel display timings & set the RGB data bus.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agoarm: dts: stm32: add ltdc for STM32F746
Philippe CORNU [Fri, 2 Mar 2018 14:59:26 +0000 (15:59 +0100)]
arm: dts: stm32: add ltdc for STM32F746

Add display controller node in device-tree.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
[agust: rebased on master]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
6 years agovideo: stm32: stm32_ltdc: set the blending factor
yannick fertre [Fri, 2 Mar 2018 14:59:25 +0000 (15:59 +0100)]
video: stm32: stm32_ltdc: set the blending factor

Set the blending factor regarding the pixel format

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agovideo: stm32: stm32_ltdc: missing set of line interrupt position
yannick fertre [Fri, 2 Mar 2018 14:59:24 +0000 (15:59 +0100)]
video: stm32: stm32_ltdc: missing set of line interrupt position

Set LIPCR (line interrupt position conf) register with line length.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agovideo: stm32: stm32_ltdc: set rate of the pixel clock
yannick fertre [Fri, 2 Mar 2018 14:59:23 +0000 (15:59 +0100)]
video: stm32: stm32_ltdc: set rate of the pixel clock

pxclk is useless to set pixel clock.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agovideo: stm32: stm32_ltdc: update file header & footer
yannick fertre [Fri, 2 Mar 2018 14:59:22 +0000 (15:59 +0100)]
video: stm32: stm32_ltdc: update file header & footer

Modified copyright & driver name.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agovideo: stm32: stm32_ltdc: add reset
yannick fertre [Fri, 2 Mar 2018 14:59:21 +0000 (15:59 +0100)]
video: stm32: stm32_ltdc: add reset

Add reset of LTDC display controller.

Signed-off-by: yannick fertre <yannick.fertre@st.com>
6 years agovideo: exynos: remove redundant assignments
Heinrich Schuchardt [Mon, 19 Mar 2018 06:46:08 +0000 (07:46 +0100)]
video: exynos: remove redundant assignments

No need to initialize variables if the next usage is an assignment.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agovideo, da8xx-fb: fix time out in wait_for_event()
Heinrich Schuchardt [Sun, 18 Mar 2018 13:48:06 +0000 (14:48 +0100)]
video, da8xx-fb: fix time out in wait_for_event()

If an event does not occur the current coding stays in an endless loop.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agovideo: stb_truetype: simplify expression
Heinrich Schuchardt [Sun, 18 Mar 2018 13:31:43 +0000 (14:31 +0100)]
video: stb_truetype: simplify expression

Eliminate (x2 - x2) which is always zero.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>