platform/kernel/u-boot.git
5 years agopico-imx6ul: MAINTAINERS: Add pico-dwarf entry
Fabio Estevam [Fri, 26 Apr 2019 16:56:34 +0000 (13:56 -0300)]
pico-imx6ul: MAINTAINERS: Add pico-dwarf entry

pico-dwarf-imx6ul_defconfig does not have an entry in MAINTAINERS file,
so add it to avoid a build warning.

Reported-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agopico-imx6ul: MAINTAINERS: Unify all board entries
Fabio Estevam [Fri, 26 Apr 2019 16:56:33 +0000 (13:56 -0300)]
pico-imx6ul: MAINTAINERS: Unify all board entries

It is easier to consolidate all boards into a single entry.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agopico-imx7d: MAINTAINERS: Unify all board entries
Fabio Estevam [Fri, 26 Apr 2019 16:56:32 +0000 (13:56 -0300)]
pico-imx7d: MAINTAINERS: Unify all board entries

It is easier to consolidate all boards into a single entry.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agocolibri_imx7: fastboot support
Igor Opaniuk [Fri, 31 May 2019 10:19:35 +0000 (13:19 +0300)]
colibri_imx7: fastboot support

Enable fastboot support (including "fastboot oem" subset of commands).

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
5 years agoARM: imx: novena: Convert to DM VIDEO
Marek Vasut [Fri, 17 May 2019 18:32:20 +0000 (20:32 +0200)]
ARM: imx: novena: Convert to DM VIDEO

Enable DM Video support on iMX6Q Novena and fix minor details
to restore previous behavior of the system.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agoARM: imx: novena: Enable DM USB
Marek Vasut [Fri, 17 May 2019 18:32:18 +0000 (20:32 +0200)]
ARM: imx: novena: Enable DM USB

Enable DM USB support on iMX6Q Novena.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agoARM: imx: novena: Convert block devices to DM
Marek Vasut [Fri, 17 May 2019 18:32:17 +0000 (20:32 +0200)]
ARM: imx: novena: Convert block devices to DM

Enable DM block, DM MMC and DM SATA support on iMX6Q Novena
convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agoARM: imx: novena: Enable DM GPIO
Marek Vasut [Fri, 17 May 2019 18:32:16 +0000 (20:32 +0200)]
ARM: imx: novena: Enable DM GPIO

Enable DM GPIO support on iMX6Q Novena and fix up board code
where applicable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agoARM: imx: novena: Enable DM pin control
Marek Vasut [Fri, 17 May 2019 18:32:15 +0000 (20:32 +0200)]
ARM: imx: novena: Enable DM pin control

Enable DM pin control support on iMX6Q Novena.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agoARM: dts: imx: novena: Import Novena DT from Linux
Marek Vasut [Fri, 17 May 2019 18:32:14 +0000 (20:32 +0200)]
ARM: dts: imx: novena: Import Novena DT from Linux

Import iMX6Q Novena device tree from Linux 5.1-rc7 37624b58542f .
Enable DT control in full U-Boot .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Vagrant Cascadian <vagrant@debian.org>
5 years agopico-imx7d: enable boot without PMIC
Jun Nie [Wed, 8 May 2019 06:38:36 +0000 (14:38 +0800)]
pico-imx7d: enable boot without PMIC

If PMIC is not probed successfully, it is still OK to boot
with default configuration although power is not optimized.

Default voltage of SW1A/SW1B is 1.1V/1.0V for PC32PF3000A1EP
on pico according to table 42 of spec of PF3000 ver 9.0.

Default mode of SW1A/SW1B is APS as expected(table 47).

Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agopico-imx7d: README: Add BL33 usage case
Jun Nie [Wed, 8 May 2019 06:38:35 +0000 (14:38 +0800)]
pico-imx7d: README: Add BL33 usage case

Add Documentation of BL33 usage case. U-boot is in
non-secure world in this case.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agopico-imx7d: Add bl33 config
Jun Nie [Wed, 8 May 2019 06:38:34 +0000 (14:38 +0800)]
pico-imx7d: Add bl33 config

Add default configuration to run u-boot as BL33 in the boot flow case
of ATF(ARM Trusted Firmware) -> OPTEE -> U-boot.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agopico-imx7d: Add boot option for verified boot
Jun Nie [Wed, 8 May 2019 06:38:33 +0000 (14:38 +0800)]
pico-imx7d: Add boot option for verified boot

Add boot option to boot from fitimage to support verified boot.
The boot script plain text file should be packed into fit blob as
image with name of bootscr.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agopico-imx7d: Reserve region of memory to OPTEE
Jun Nie [Wed, 8 May 2019 06:38:32 +0000 (14:38 +0800)]
pico-imx7d: Reserve region of memory to OPTEE

Subtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size so that
the OPTEE memory is not override during u-boot relocation.

Note the OPTEE live in the end part of DRAM and OPTEE boot process will
itself subtract the DRAM region it lives in from the memory map passed
to Linux.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agopico-imx7d: Correct uart clock root
Jun Nie [Wed, 8 May 2019 06:38:31 +0000 (14:38 +0800)]
pico-imx7d: Correct uart clock root

Correct uart clock root ID. Incorrect ID may result the
clock is gated because rate value 0 is returned in
imx_get_uartclk()

The ID can be ignored if CONFIG_SKIP_LOWLEVEL_INIT is not enabled
because init_clk_uart() will enable all uart clocks in that case.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agoimx: mx7: Skip secure init in arch_cpu_init
Jun Nie [Wed, 8 May 2019 06:38:30 +0000 (14:38 +0800)]
imx: mx7: Skip secure init in arch_cpu_init

Skip secure related initialization in arch_cpu_init if low level
init is skipped.  Because these should be done in early stage
firmware, such as ARM trusted firmware.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agomx7_common: Share configs to skip low level init
Jun Nie [Wed, 8 May 2019 06:38:29 +0000 (14:38 +0800)]
mx7_common: Share configs to skip low level init

Share configs in mx7 to skip low level init if we are in the case where
OPTEE is loaded already (maybe by ARM Trusted Firmware) and that most of
the low level initialization is already done and that we may/should skip
it doing them here.

Fix the definition detection with size detection to decide whether to skip
it.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agospi: imx: work with cs greater 0
Heiko Schocher [Sun, 26 May 2019 10:15:47 +0000 (12:15 +0200)]
spi: imx: work with cs greater 0

currently spi mxc driver can only handle cs 0.
Allow it to handle also cs > 0.

Signed-off-by: Heiko Schocher <hs@denx.de>
5 years agospi: imx: remove doubled pointer from mxc_spi_probe
Heiko Schocher [Sun, 26 May 2019 10:15:46 +0000 (12:15 +0200)]
spi: imx: remove doubled pointer from mxc_spi_probe

in mxc_spi_probe() plat and mxcs pointer are created:

struct mxc_spi_slave *plat = bus->platdata;
struct mxc_spi_slave *mxcs = dev_get_platdata(bus);

which have the same value. Remove plat pointer.

Signed-off-by: Heiko Schocher <hs@denx.de>
5 years agoarm, imx, Makefile: fix u-boot-dtb.imx build in CONFIG_MULTI_DTB_FIT case
Heiko Schocher [Tue, 28 May 2019 11:44:31 +0000 (13:44 +0200)]
arm, imx, Makefile: fix u-boot-dtb.imx build in CONFIG_MULTI_DTB_FIT case

in case CONFIG_MULTI_DTB_FIT is set and u-boot-dtb.imx
image is build, currently u-boot-dtb.bin is used for
generating the u-boot-dtb.imx binary, which is wrong, as
it contains only a dtb blob not the fit.blob

Use instead the u-boot-fit-dtb.bin for generating
u-boot-dtb.imx which contains the fit.blob.

Signed-off-by: Heiko Schocher <hs@denx.de>
5 years agowandboard: Rework Makefile to prevent spl.o from being built
Ezequiel Garcia [Sat, 25 May 2019 22:19:41 +0000 (19:19 -0300)]
wandboard: Rework Makefile to prevent spl.o from being built

The spl.c source was entirely conditioned by CONFIG_SPL_BUILD.
Change this moving CONFIG_SPL_BUILD to be used in the Makefile,
which is slightly cleaner and more readable.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
5 years agoARM: imx: dh-imx6: Convert SPI support to DM
Marek Vasut [Fri, 17 May 2019 14:58:54 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Convert SPI support to DM

Enable DM SPI and SF support on DHCOM iMX6 PDK2.
Convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: dh-imx6: Convert USB support to DM
Marek Vasut [Fri, 17 May 2019 14:58:53 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Convert USB support to DM

Enable DM USB host support on DHCOM iMX6 PDK2.
Convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: dh-imx6: Convert SATA support to DM
Marek Vasut [Fri, 17 May 2019 14:58:52 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Convert SATA support to DM

Enable DM SATA support on DHCOM iMX6 PDK2.
Convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: dh-imx6: Convert SD/MMC support to DM
Marek Vasut [Fri, 17 May 2019 14:58:51 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Convert SD/MMC support to DM

Enable DM block and DM MMC support on DHCOM iMX6 PDK2.
Convert board code to match the DM support.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: dh-imx6: Enable DM GPIO
Marek Vasut [Fri, 17 May 2019 14:58:50 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Enable DM GPIO

Enable DM GPIO support on DHCOM iMX6 PDK2 and fix up board code
where applicable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: dh-imx6: Enable DM pin control
Marek Vasut [Fri, 17 May 2019 14:58:49 +0000 (16:58 +0200)]
ARM: imx: dh-imx6: Enable DM pin control

Enable DM pin control support on DHCOM iMX6 PDK2.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: dts: imx: dh-imx6: Fix SPI CS polarity on DHCOM iMX6 PDK2
Marek Vasut [Fri, 17 May 2019 14:58:48 +0000 (16:58 +0200)]
ARM: dts: imx: dh-imx6: Fix SPI CS polarity on DHCOM iMX6 PDK2

The SPI nCS signal is active low, make it so.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: dts: imx: dh-imx6: Import DHCOM iMX6 PDK2 DTs from Linux
Marek Vasut [Fri, 17 May 2019 14:58:47 +0000 (16:58 +0200)]
ARM: dts: imx: dh-imx6: Import DHCOM iMX6 PDK2 DTs from Linux

Import DHCOM iMX6 PDK2 device tree from Linux 5.1.1 b724e9356404 .
Enable DT control in full U-Boot .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoRevert "drivers/crypto/fsl: assign job-rings to non-TrustZone"
Breno Matheus Lima [Tue, 4 Jun 2019 02:54:44 +0000 (02:54 +0000)]
Revert "drivers/crypto/fsl: assign job-rings to non-TrustZone"

Commit 22191ac35344 ("drivers/crypto/fsl: assign job-rings to
 non-TrustZone") breaks HABv4 encrypted boot support in the
following i.MX devices:

- i.MX6UL
- i.MX7S
- i.MX7D
- i.MX7ULP

For preparing a HABv4 encrypted boot image it's necessary to
encapsulate the generated DEK in a blob. In devices listed
above the blob generation function takes into consideration
the Job Ring TrustZone ownership configuration (JROWN_NS)
and can be only decapsulated by the same configuration.

The ROM code expects DEK blobs encapsulated by the Secure World
environments which commonly have JROWN_NS = 0.

As U-Boot is running in Secure World we must have JROWN_NS = 0
so the blobs generated by dek_blob tool can be decapsulated
by the ROM code.

Job-rings assignment is now handled in OP-TEE OS, this commit can
be safely reverted.
https://github.com/OP-TEE/optee_os/pull/2986

This reverts commit 22191ac353445ad8fafc5a78aefcd94e78963041.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5 years agoconfig: Update KP's imx53 HSC config to pass key pressed information
Lukasz Majewski [Wed, 8 May 2019 14:26:23 +0000 (16:26 +0200)]
config: Update KP's imx53 HSC config to pass key pressed information

The information about pressed key is relevant in performing correct
update and recovery scenarios via USB pendrive.

This commit modifies envs to provide it.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoconfig: Update KP's imx53 HSC config to support SWUpdate
Lukasz Majewski [Wed, 8 May 2019 14:26:22 +0000 (16:26 +0200)]
config: Update KP's imx53 HSC config to support SWUpdate

This commit updates envs responsible for using USB pendrive as a
SWUpdate based tool for recovery and update.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoimx: Use a convenient default value for SYS_MALLOC_F_LEN
Fabio Estevam [Fri, 3 May 2019 17:05:04 +0000 (14:05 -0300)]
imx: Use a convenient default value for SYS_MALLOC_F_LEN

Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
simple-bus driver") causes some i.MX boards that were converted
to DM, such as warp7, to fail to boot.

As explained by Lukas Auer:

"With the patch, U-Boot probes the drivers for devices under simple-bus
device tree nodes in the pre-relocation device model. The default value
of CONFIG_SYS_MALLOC_F_LEN (0x400) leaves U-Boot with not enough memory to
do this, causing it to hang."

Fix this problem by providing a convenient default value for
CONFIG_SYS_MALLOC_F_LEN.

Reported-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoopos6uldev: don't call enable_lcdif_clock
Sébastien Szymanski [Tue, 14 May 2019 11:46:20 +0000 (13:46 +0200)]
opos6uldev: don't call enable_lcdif_clock

The mxsfb driver already calls enable_lcdif_clock.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoopos6ul: set REFSEL and REFR fields
Sébastien Szymanski [Tue, 14 May 2019 11:33:46 +0000 (13:33 +0200)]
opos6ul: set REFSEL and REFR fields

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
5 years agoimx: hab: Increase CSF_SIZE for i.MX6 and i.MX7 devices
Breno Matheus Lima [Fri, 26 Apr 2019 02:56:48 +0000 (02:56 +0000)]
imx: hab: Increase CSF_SIZE for i.MX6 and i.MX7 devices

In certain i.MX devices the encrypted boot image is failing to boot.

According to AN12056 "Encrypted Boot on HABv4 and CAAM Enabled Devices"
it's necessary to pad CSF to 0x2000 and append DEK blob.

In this case the total image size in boot data structure must cover the
entire binary otherwise the dek_blob won't be copied to memory and image
won't be decrypted.

Increase CSF_SIZE to 0x4000 to avoid such issue when booting encrypted
boot images.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agocolibri-imx6ull: fix usb host mode
Marcel Ziswiler [Fri, 26 Apr 2019 18:48:14 +0000 (20:48 +0200)]
colibri-imx6ull: fix usb host mode

This fixes an issue with USB host mode.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agoARM: imx: apalis_imx6: Drop ad-hoc SATA binding
Marek Vasut [Sun, 12 May 2019 20:43:25 +0000 (22:43 +0200)]
ARM: imx: apalis_imx6: Drop ad-hoc SATA binding

Drop the ad-hoc AHCI binding code, this is superseded by
CONFIG_DWC_AHSATA_AHCI=y resp. drivers/ata/dwc_ahsata.c

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Stefan Agner <stefan.agner@toradex.com>
Cc: Stefano Babic <sbabic@denx.de>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
5 years agoregulator: bd71837: copy the bd71837 pmic driver from NXP imx u-boot
Matti Vaittinen [Tue, 7 May 2019 07:43:39 +0000 (10:43 +0300)]
regulator: bd71837: copy the bd71837 pmic driver from NXP imx u-boot

https://source.codeaurora.org/external/imx/uboot-imx

cherry picked, styled and merged commits:
- MLK-18387 pmic: Add pmic driver for BD71837: e9a3bec2e95a
- MLK-18590 pmic: bd71837: Change to use new fdt API: acdc5c297a96

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocolibri_imx7: migrate usb to driver model
Igor Opaniuk [Fri, 10 May 2019 09:35:29 +0000 (12:35 +0300)]
colibri_imx7: migrate usb to driver model

Migrate USB to Driver Model (CONFIG_DM_USB=y).

Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agoconfigs: imx6-engicam: Update the recoveryboot setting
Jagan Teki [Fri, 26 Apr 2019 09:01:46 +0000 (14:31 +0530)]
configs: imx6-engicam: Update the recoveryboot setting

Since recovery boot on mmc can get the mmcpart and mmcroot
dynamically, drop the static definitions and handle it
properly.

Tested-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agotoradex apalis/colibri: extend CONFIG_SYS_MALLOC_F_LEN
Igor Opaniuk [Fri, 17 May 2019 14:48:43 +0000 (17:48 +0300)]
toradex apalis/colibri: extend CONFIG_SYS_MALLOC_F_LEN

Extend size of the malloc() pool for use before relocation, from 0x400
(default one) to 0x2000 (CONFIG_SYS_MALLOC_F_LEN=0x2000),
as adding of DM_FLAG_PRE_RELOC flag to simple-bus driver introduced a
regression on multiple boards, because of more intensive usage of malloc()
pool and therefore a broken boot as the size of pool isn't sufficient.

Fixes: 3a7c45f6a7 ("simple-bus: add DM_FLAG_PRE_RELOC flag to simple-bus")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoapalis_imx6: add device tree to makefile
Marcel Ziswiler [Tue, 9 Apr 2019 15:21:48 +0000 (17:21 +0200)]
apalis_imx6: add device tree to makefile

Add device tree to Makefile to avoid newly introduced error:

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=<device_tree>' argument

make[1]: *** [dts/Makefile:28: arch/arm/dts/imx6-apalis.dtb] Error 1
make: *** [Makefile:1009: dts/dt.dtb] Error 2

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agoapalis/colibri imx6: provide proper fdtfile value
Igor Opaniuk [Thu, 23 May 2019 11:05:50 +0000 (11:05 +0000)]
apalis/colibri imx6: provide proper fdtfile value

Provide proper fdtfile env variable value before invoking distro_bootcmd
command.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agoARM: dts: i.MX6ULL: U-Boot specific dts for u-boot, dm-spl
Parthiban Nallathambi [Sun, 7 Apr 2019 18:32:42 +0000 (20:32 +0200)]
ARM: dts: i.MX6ULL: U-Boot specific dts for u-boot, dm-spl

u-boot,dm-spl property is specific to U-Boot, so created one
for i.MX6ULL platforms.

Signed-off-by: Parthiban Nallathambi <parthitce@gmail.com>
5 years agopower: pfuze100: Fix off by one error in voltage table handling
Trent Piepho [Thu, 4 Apr 2019 21:52:04 +0000 (21:52 +0000)]
power: pfuze100: Fix off by one error in voltage table handling

The code that sets a regulator by looking up the voltage in a table had
an off by one error.  vsel_mask is a bitmask, not the number of table
entries, so a vsel_mask value of 0x7 indicates there are 8, not 7,
entries in the table.

Cc: Peng Fan <Peng.Fan@freescale.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
5 years agomx7ulp: Add common plugin codes for mx7ulp
Ye Li [Thu, 16 May 2019 03:18:51 +0000 (03:18 +0000)]
mx7ulp: Add common plugin codes for mx7ulp

Add common plugin codes to call ROM's hwcnfg_setup and generate IVT2
header.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoboard: toradex: add colibri imx8qxp 2gb wb it v1.0b module support
Marcel Ziswiler [Fri, 31 May 2019 15:56:39 +0000 (18:56 +0300)]
board: toradex: add colibri imx8qxp 2gb wb it v1.0b module support

This commit adds initial support for the Toradex Colibri iMX8QXP 2GB WB
IT V1.0B module. Unlike the V1.0A early access samples exclusively
booting from SD card, they are now strapped to boot from eFuses which
are factory fused to properly boot from their on-module eMMC. U-Boot
supports either booting from the on-module eMMC or may be used for
recovery purpose using the universal update utility (uuu) aka mfgtools
3.0.

Functionality wise the following is known to be working:
- eMMC and MMC/SD card
- Ethernet
- GPIOs
- I2C

Unfortunately, there is no USB functionality for the i.MX 8QXP as of
yet.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
5 years agoimx: fix building for i.mx8 without spl
Marcel Ziswiler [Fri, 31 May 2019 15:56:38 +0000 (18:56 +0300)]
imx: fix building for i.mx8 without spl

Building with Travis CI complained and stopped with the following error:
+cc1: fatal error: opening output file spl/u-boot-spl.cfgout: No such
file or directory
+compilation terminated.

This fixes commit caceb739ea07 ("imx: build flash.bin for i.MX8") which
took SPL being enabled on i.MX8 for granted.

Reported-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoARM: imx6logic: Stop overwriting fdt_file if manually set
Adam Ford [Wed, 13 Mar 2019 15:49:22 +0000 (10:49 -0500)]
ARM: imx6logic: Stop overwriting fdt_file if manually set

The board file uses the processor type to determine what dtb file
is set.  Unfortunately, if the user wants to manually set this,
it get gets overwritten upon boot.  This patch adds a check to
see if the value is already set and only changes it if the value
is empty.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoPrepare v2019.07-rc4 v2019.07-rc4
Tom Rini [Tue, 11 Jun 2019 01:27:46 +0000 (21:27 -0400)]
Prepare v2019.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoefi_loader: implement event queue
Heinrich Schuchardt [Wed, 5 Jun 2019 19:00:39 +0000 (21:00 +0200)]
efi_loader: implement event queue

Up to now we have only been using a flag queued for events. But this does
not satisfy the requirements of the UEFI spec. Events must be notified in
the sequence of decreasing TPL level and within a TPL level in the sequence
of signaling.

Implement a queue for signaled events.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_selftest: correct event group test
Heinrich Schuchardt [Wed, 5 Jun 2019 20:50:42 +0000 (22:50 +0200)]
efi_selftest: correct event group test

If any member of the event group is signaled, all members must be set to
signaled and their notification functions have to be queued.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: event signaling in ExitBootServices
Heinrich Schuchardt [Fri, 7 Jun 2019 04:47:01 +0000 (06:47 +0200)]
efi_loader: event signaling in ExitBootServices

ExitBootServices() has to stop timer related activity before calling the
events of the EFI_EVENT_GROUP_EXIT_BOOT_SERVICES event group. But our
current implementation was stopping all other events.

All events have to observe the task priority level.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: SignalEvent for event in signaled state
Heinrich Schuchardt [Wed, 5 Jun 2019 23:51:50 +0000 (01:51 +0200)]
efi_loader: SignalEvent for event in signaled state

If an event is already in the signaled state, SignalEvent should not queue
the notification function but simply return EFI_SUCCESS.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: RegisterProtocolNotify event signaling
Heinrich Schuchardt [Fri, 7 Jun 2019 05:43:24 +0000 (07:43 +0200)]
efi_loader: RegisterProtocolNotify event signaling

In a following patch efi_signal_event() will only queue an event if it is
not signaled.

Set the is_signaled status to false before signaling the event.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Mon, 10 Jun 2019 13:43:11 +0000 (09:43 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

- mpc8xxx spi driver fixes (Mario)
- mpc8xxx spi dm conversion (Mario, Jagan)
- SPI DM Migration update (Jagan)

5 years agoMerge tag 'video-updates-for-2019.07-rc3' of git://git.denx.de/u-boot-video
Tom Rini [Mon, 10 Jun 2019 13:41:19 +0000 (09:41 -0400)]
Merge tag 'video-updates-for-2019.07-rc3' of git://git.denx.de/u-boot-video

- mxsfb DM_VIDEO conversion
- splash fix for DM_VIDEO configurations
- meson HDMI fix for boards without hdmi-supply regulator

5 years agoMerge tag 'u-boot-atmel-fixes-2019.07-a' of git://git.denx.de/u-boot-atmel
Tom Rini [Mon, 10 Jun 2019 13:41:00 +0000 (09:41 -0400)]
Merge tag 'u-boot-atmel-fixes-2019.07-a' of git://git.denx.de/u-boot-atmel

First set of u-boot-atmel fixes for 2019.07 cycle

5 years agodm: MIGRATION: Update migration status for SPI
Jagan Teki [Sun, 28 Apr 2019 20:28:54 +0000 (01:58 +0530)]
dm: MIGRATION: Update migration status for SPI

Now, we have few driver are fully converted into dm and few
are partially converted.

So, update the migration status accordingly.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Convert to DM
Jagan Teki [Sun, 28 Apr 2019 20:28:53 +0000 (01:58 +0530)]
spi: mpc8xxx: Convert to DM

Support DM in the MPC8xxx SPI driver, and remove the legacy SPI
interface.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Use get_timer
Mario Six [Sun, 28 Apr 2019 20:28:52 +0000 (01:58 +0530)]
spi: mpc8xxx: Use get_timer

The comment before the transmission loop in conjunction with the
definition of SPI_TIMEOUT as 1000 implies that the loop is supposed to
have a timeout value of 1000 ms. But since there is no mdelay(1) or
similar in the loop body, the loop just runs 1000 times, without regard
for the time elapsed.

To correct this, use the standard get_timer functionality to properly
time out the loop after 1000 ms.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Fix if check
Mario Six [Sun, 28 Apr 2019 20:28:51 +0000 (01:58 +0530)]
spi: mpc8xxx: Fix if check

Decreasing the bit length and increasing the write data pointer should
be done when there are more than 32 bit of data, not 16 bit.

This did not produce incorrect behavior, because the only time where the
two checks produce different outcomes is the case of 16 < bitlen < 32,
and in this case the subsequent transmission is the last one regardless,
hence the additional bit length decrease and write data pointer increase
has no effect anyway.

Still, the correct check is the check for "bitlen > 32", so correct this
behavior.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Re-order transfer setup
Mario Six [Sun, 28 Apr 2019 20:28:50 +0000 (01:58 +0530)]
spi: mpc8xxx: Re-order transfer setup

Minize the time the adapter is disabled (via SPI_MODE_EN
clearing/setting) to just the character length setting, and only set up
the temporary data writing variable right before we need it, so there is
a more clear distinction between setting up the SPI adapter, and setting
up the data to be written.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Document LEN setting better
Mario Six [Sun, 28 Apr 2019 20:28:49 +0000 (01:58 +0530)]
spi: mpc8xxx: Document LEN setting better

Instead of having a table right before the code implementing the length
setting for documentation, have inline comments for the if branches
actually implementing the length setting described table's entries
(which is readable thanks to the set_char_len function).

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Rename variable
Mario Six [Sun, 28 Apr 2019 20:28:48 +0000 (01:58 +0530)]
spi: mpc8xxx: Rename variable

The variable "char_size" holds the number of bits to be transferred in
the current loop iteration. A better name would be "xfer_bitlen", which
we rename this variable to.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Make code more readable
Mario Six [Sun, 28 Apr 2019 20:28:47 +0000 (01:58 +0530)]
spi: mpc8xxx: Make code more readable

Introduce the to_prescale_mod and set_char_len inline functions to make
the code more readable.

Note that the added "if (bitlen > 16)" check does not change the
semantics of the current code, and hence only preserves the current
error (this will be fixed in a later patch in the series).

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Reduce scope of loop variables
Mario Six [Sun, 28 Apr 2019 20:28:46 +0000 (01:58 +0530)]
spi: mpc8xxx: Reduce scope of loop variables

The transmission loop starts with setting some variables, which are only
used inside the loop. Reduce the scope to the loop to make the
declaration and initialization of these variables coincide.

In the case of char_size this also always initializes the variable
immediately with the final value actually used in the loop (instead of
the placeholder value 32).

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Simplify logic a bit
Mario Six [Sun, 28 Apr 2019 20:28:45 +0000 (01:58 +0530)]
spi: mpc8xxx: Simplify logic a bit

We do nothing in the loop if the "not empty" event was not detected. To
simplify the logic, check if this is the case, and skip the execution of
the loop early to reduce the nesting level and flag checking.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Get rid of is_read
Mario Six [Sun, 28 Apr 2019 20:28:44 +0000 (01:58 +0530)]
spi: mpc8xxx: Get rid of is_read

Get rid of the is_read variable, and just keep the state of the "not
empty" and "not full" events in two boolean variables within the loop
body.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Simplify if
Mario Six [Sun, 28 Apr 2019 20:28:43 +0000 (01:58 +0530)]
spi: mpc8xxx: Simplify if

Instead of having a nested if block, just have two branches within the
overarching if block to eliminate one nesting level.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Use IO accessors
Mario Six [Sun, 28 Apr 2019 20:28:42 +0000 (01:58 +0530)]
spi: mpc8xxx: Use IO accessors

Accesses to the register map are currently done by directly reading and
writing the structure.

Switch to the appropriate IO accessors instead.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Replace defines with enums
Mario Six [Sun, 28 Apr 2019 20:28:41 +0000 (01:58 +0530)]
spi: mpc8xxx: Replace defines with enums

Replace pre-processor defines with proper enums, and use the BIT macro
where applicable.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Fix function names in strings
Mario Six [Sun, 28 Apr 2019 20:28:40 +0000 (01:58 +0530)]
spi: mpc8xxx: Fix function names in strings

Replace the function name with a "%s" format string and the __func__
variable in debug statements (as proposed by checkpatch).

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Fix space after cast
Mario Six [Sun, 28 Apr 2019 20:28:39 +0000 (01:58 +0530)]
spi: mpc8xxx: Fix space after cast

Fix all "superfluous space after case" style errors.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Rename camel-case variables
Mario Six [Sun, 28 Apr 2019 20:28:38 +0000 (01:58 +0530)]
spi: mpc8xxx: Rename camel-case variables

There are three variables that have camel-case names, which is not the
preferred naming style.

Give those variables more compliant names instead.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Fix comments
Mario Six [Sun, 28 Apr 2019 20:28:37 +0000 (01:58 +0530)]
spi: mpc8xxx: Fix comments

There are some comments on the same line as the code they document. Put
comments above the code lines they document, so the line length is not
unnecessarily increased.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: mpc8xxx: Use short type names
Mario Six [Sun, 28 Apr 2019 20:28:36 +0000 (01:58 +0530)]
spi: mpc8xxx: Use short type names

The function signatures in the driver are quite long as is. Use short
type names (uint etc.) to make them more readable.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoids8313: Disable SPI
Mario Six [Fri, 7 Jun 2019 09:35:51 +0000 (11:35 +0200)]
ids8313: Disable SPI

With the recent SPI changes, the ids8313 board won't compile anymore.

Until further information from the manufacturer, disable SPI support, so
that the board will at least compile again.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-tegra
Tom Rini [Sat, 8 Jun 2019 13:10:31 +0000 (09:10 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-tegra

The bulk of these changes are an effort to unify Tegra186 builds with
builds of prior 64-bit Tegra generations. On top of that there are
various improvements that allow data (such as the MAC address and boot
arguments) to be passed through from early firmware to the kernel on
boot.

5 years agospl: Correct SPL_SIZE_LIMIT Kconfig option
Tom Rini [Sat, 8 Jun 2019 00:39:32 +0000 (20:39 -0400)]
spl: Correct SPL_SIZE_LIMIT Kconfig option

When introduced this limit was an int but was then changed to hex
without noting as much in the prompt nor changing existing users.  Put
this back to an int.

Reported-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
Fixes: 2577015dc5c4 ("spl: add overall SPL size check")
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge branch '2019-06-07-master-imports'
Tom Rini [Fri, 7 Jun 2019 22:03:18 +0000 (18:03 -0400)]
Merge branch '2019-06-07-master-imports'

- Include Heinrich's series to move the i.MX board size check function
  to be more widely available.
- Include Simon Goldschmidt's patch to make it possible to have a more
  accurate SPL size check applied.

5 years agospl: add overall SPL size check
Simon Goldschmidt [Fri, 24 May 2019 20:07:04 +0000 (22:07 +0200)]
spl: add overall SPL size check

This adds a size check for SPL that can dynamically check generated
SPL binaries (including devicetree) for a size limit that ensures
this image plus global data, heap and stack fit in initial SRAM.

Since some of these sizes are not available to make, a new host tool
'spl_size_limit' is added that dumps the resulting maximum size for
an SPL binary to stdout. This tool is used in toplevel Makefile to
implement the size check on SPL binaries.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agoconfigs: rk3288: Tinker Board SPL file must fit into 32 KiB
Heinrich Schuchardt [Tue, 2 Apr 2019 17:19:07 +0000 (19:19 +0200)]
configs: rk3288: Tinker Board SPL file must fit into 32 KiB

The SPL image for the Tinker Board has to fit into 32 KiB. This includes
up to 2 KiB for the file header.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoconfigs: define CONFIG_SPL_SIZE_LIMIT
Heinrich Schuchardt [Tue, 2 Apr 2019 17:19:06 +0000 (19:19 +0200)]
configs: define CONFIG_SPL_SIZE_LIMIT

A new configuration variable CONFIG_SPL_SIZE_LIMIT is introduced to define
the board specific maximum size for the SPL file.

Use Makefile function size_check() to implement the test.

Depending on the size of CONFIG_SPL_SIZE_LIMIT an error like the following
is thrown:

spl/u-boot-spl.bin exceeds file size limit:
  limit:  30720 bytes
  actual: 33426 bytes
  excess: 2706 bytes
make: *** [Makefile:1663: spl/u-boot-spl.bin] Error 1

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoimx: move BOARD_SIZE_CHECK to main Makefile
Heinrich Schuchardt [Tue, 2 Apr 2019 17:19:05 +0000 (19:19 +0200)]
imx: move BOARD_SIZE_CHECK to main Makefile

We currently have duplicate definitions for BOARD_SIZE_CHECK in Makefile
and arch/arm/mach-imx/Makefile.

Move the board size check from arch/arm/mach-imx/Makefile to Makefile.

Depending on the value of CONFIG_BOARD_SIZE_LIMIT an error like an error
like the following is thrown:

u-boot-dtb.imx exceeds file size limit:
  limit:  503696 bytes
  actual: 509720 bytes
  excess: 6024 bytes
make: *** [Makefile:1051: u-boot-dtb.imx] Error 1

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoMakefile: reusable function for BOARD_SIZE_CHECK
Heinrich Schuchardt [Tue, 2 Apr 2019 17:19:04 +0000 (19:19 +0200)]
Makefile: reusable function for BOARD_SIZE_CHECK

Carve out function size_check from macro BOARD_SIZE_CHECK. This will allow
us to reuse the function for other file size checks.

Depending on the value of CONFIG_BOARD_SIZE_LIMIT an error like the
following is thrown:

u-boot-dtb.img exceeds file size limit:
  limit:  409516 bytes
  actual: 444346 bytes
  excess: 34830 bytes
make: *** [Makefile:1212: u-boot-dtb.img] Error 1

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agolib/vsprintf: allow printing upper case GUIDs
Heinrich Schuchardt [Mon, 29 Apr 2019 06:08:43 +0000 (08:08 +0200)]
lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoconfigs: stm32mp15: Enable Ethernet feature
Christophe Roullier [Fri, 17 May 2019 13:08:47 +0000 (15:08 +0200)]
configs: stm32mp15: Enable Ethernet feature

This allows to enable Ethernet and use driver for
Synopsys Ethernet QoS device

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agostm32mp1: Add Ethernet support for stm32mp1 board
Christophe Roullier [Fri, 17 May 2019 13:08:46 +0000 (15:08 +0200)]
stm32mp1: Add Ethernet support for stm32mp1 board

Add default SERVERIP address
Enable noncached memory region required by ethernet driver
Add PXE support

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
5 years agoARM: dts: stm32: Add Ethernet support on stm32mp1
Christophe Roullier [Fri, 17 May 2019 13:08:45 +0000 (15:08 +0200)]
ARM: dts: stm32: Add Ethernet support on stm32mp1

This patch add Ethernet support on stm32mp157 eval board

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
5 years agonet: dwc_eth_qos: add Ethernet stm32mp1 support
Christophe Roullier [Fri, 17 May 2019 13:08:44 +0000 (15:08 +0200)]
net: dwc_eth_qos: add Ethernet stm32mp1 support

Synopsys GMAC 4.20 is used. And Phy mode for eval and disco is RMII
with PHY Realtek RTL8211 (RGMII)
We also support some other PHY config on stm32mp157c
PHY_MODE (MII,GMII, RMII, RGMII) and in normal,
PHY wo crystal (25Mhz and 50Mhz), No 125Mhz from PHY config

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoboard: stm32mp1: Add board_interface_eth_init
Christophe Roullier [Fri, 17 May 2019 13:08:43 +0000 (15:08 +0200)]
board: stm32mp1: Add board_interface_eth_init

Called to configure Ethernet PHY interface selection and
configure clock selection in RCC Ethernet clock tree.

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
5 years agostm32mp1: clk: use the correct identifier for ethck
Patrick Delaunay [Fri, 17 May 2019 13:08:42 +0000 (15:08 +0200)]
stm32mp1: clk: use the correct identifier for ethck

ETHCK_K is the identifier the kernel clock for ETH in kernel
binding, selected by ETHKSELR / gated by ETHCKEN = BIT(7).
U-Boot driver need to use the same identifier, so change ETHCK
to ETHCK_K.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
5 years agoconfigs: stm32mp15: Enable SPI relative flags
Patrice Chotard [Mon, 13 May 2019 09:02:08 +0000 (11:02 +0200)]
configs: stm32mp15: Enable SPI relative flags

Enable STM32_SPI, SPI, DM_SPI and CMD_SPI flags.
This enables the SPI support for STM32MP15.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agospi: stm32: Add Serial Peripheral Interface driver for STM32MP
Patrice Chotard [Tue, 30 Apr 2019 16:08:28 +0000 (18:08 +0200)]
spi: stm32: Add Serial Peripheral Interface driver for STM32MP

Add SPI driver support for STM32MP SoCs family.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoclk: stm32mp1: Add SPI1 clock entry
Patrice Chotard [Tue, 30 Apr 2019 16:08:27 +0000 (18:08 +0200)]
clk: stm32mp1: Add SPI1 clock entry

Add missing SPI1 clock needed by SPI1 instance.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoboard: stm32mp1: Update power supply check via USB TYPE-C
Patrice Chotard [Tue, 30 Apr 2019 16:09:38 +0000 (18:09 +0200)]
board: stm32mp1: Update power supply check via USB TYPE-C

Add 2 new checks:
 - detect when USB TYPE-C cable is not plugged correctly.
   In this case, GND and VBUS pins are connected but not CC1
   and CC2 pins.

 - detect is an USB Type-C charger supplies more than 3 Amps
   which is not compliant with the USB Type-C specification

In these 2 situations, stop the boot process and let red led
blinks forever.

   V cc1      |   V cc2     | power supply | red led | console message
range (Volts) |range (Volts)|   (Amps)     | blinks  |
--------------|-------------|--------------|---------|-----------------------------------
    > 2.15    |   < 0.2     |     > 3      | for ever| USB TYPE-C charger not compliant with specification
[2.15 - 1.23[ |   < 0.2     |     3        |   NO    | NO
[1.23 - 0.66[ |   < 0.2     |     1.5      | 3 times | WARNING 1.5A power supply detected
[0.66 - 0]    |   < 0.2     |     0.5      | 2 times | WARNING 500mA power supply detected
    < 0.2     |   < 0.2     |              | for ever| ERROR USB TYPE-C connection in unattached mode
    > 0.2     |   > 0.2     |              | for ever| ERROR USB TYPE-C connection in unattached mode

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoconfigs: stm32mp15: Enable WDT flags
Patrice Chotard [Tue, 30 Apr 2019 15:26:23 +0000 (17:26 +0200)]
configs: stm32mp15: Enable WDT flags

This allows to enable WATCHDOG and WDT flags to
be able to reset the watchdog and to support watchdog driver
model.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>