]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agoMerge branch 'v2021.07-rc1' of https://github.com/lftan/u-boot
Tom Rini [Fri, 9 Apr 2021 17:10:38 +0000 (13:10 -0400)]
Merge branch 'v2021.07-rc1' of https://github.com/lftan/u-boot

3 years agoMerge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 9 Apr 2021 11:41:32 +0000 (07:41 -0400)]
Merge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20210409
-------------------

- Secure Boot :
- HAB for MX8M / MX7ULP
- CAAM fixes
- Fixes for imxrt1020
- Fixes for USDHC driver
- Fixes for Toradex (Colibri / Apalis)
- Switch to DM for several boards
- mx23 olinuxo
- usbarmory
- marsboard / riotboard
- Gateworks GW Ventana
- NXP upstream patches (LPDDR / CAAM / HAB)

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7089

3 years agoimx: bootaux fix elf loading
Max Krummenacher [Thu, 11 Mar 2021 17:18:07 +0000 (18:18 +0100)]
imx: bootaux fix elf loading

This reverts the arch/arm/mach-imx/imx_bootaux.c changes of commit
805b3cac1e0c. The loader function name was changed so that it does
not clash with the generically available function in lib/elf.c.

imx-bootaux loads an elf file linked for an auxilary core. Thus the
loader function requires address translation from the auxilary core's
address space to where those are mapped into U-Boot's address space.

So the elf loader is specific and must not be replaced with a generic
loader which doesn't provide the address translation functionality.

Fixes commit 805b3cac1e0c ("lib: elf: Move the generic elf
loading/validating functions to lib")

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agopico-imx6ul: Pass the PMIC I2C address in pmic_get()
Fabio Estevam [Fri, 5 Mar 2021 22:11:49 +0000 (19:11 -0300)]
pico-imx6ul: Pass the PMIC I2C address in pmic_get()

Pass "pfuze3000@8" in pmic_get() so that the PMIC node can
be found in the devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary
Haibo Chen [Mon, 22 Mar 2021 10:55:38 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary

Some board like imx8mm-evkb, IO voltage switch from 3.3v to 1.8v need
around 18ms, common code only delay 10ms, so need to delay extra 8ms.
Otherwise voltage switch will timeout when wait for data0 line.

This IO voltage switch time depends on board design, depend on the
PMIC and capacitance. imx8mm-evkb board use PCA9450(PMIC) and 10uF
capacitance.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agommc: fsl_esdhc_imx: remove redundant cmd11 related code.
Haibo Chen [Mon, 22 Mar 2021 10:55:37 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: remove redundant cmd11 related code.

Common code already handle the voltage switch sequence based on spec,
so remove the redundant voltage switch code.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agoimx6: icorem6: chmod 644 enigcam.bmp
Heinrich Schuchardt [Tue, 16 Mar 2021 20:46:39 +0000 (21:46 +0100)]
imx6: icorem6: chmod 644 enigcam.bmp

Bitmap files should not be executable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
3 years agoimx: imx6ull: fix pinmux sel_input value for uart5 pins
Yuichiro Goto [Mon, 29 Mar 2021 00:14:02 +0000 (09:14 +0900)]
imx: imx6ull: fix pinmux sel_input value for uart5 pins

sel_input value for the following uart5 pins is
different between i.MX6UL and i.MX6ULL:

MX6_PAD_UART5_TX_DATA__UART5_DTE_RX
MX6_PAD_UART5_RX_DATA__UART5_DCE_RX
MX6_PAD_ENET1_RX_EN__UART5_DCE_RTS
MX6_PAD_ENET1_TX_DATA0__UART5_DTE_RTS
MX6_PAD_CSI_DATA02__UART5_DCE_RTS

As sel_input value for the second one is fixed by
the previous commit, fix the rest.

Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp>
3 years agodoc: imx: psb: Document usage of SRC_GPR10 PERSIST_SECONDARY_BOOT for A/B switching
Marek Vasut [Thu, 25 Mar 2021 00:20:48 +0000 (01:20 +0100)]
doc: imx: psb: Document usage of SRC_GPR10 PERSIST_SECONDARY_BOOT for A/B switching

Document SRC_GPR10 PERSIST_SECONDARY_BOOT functionality. This is useful for
reliable bootloader A/B updates, as it permits switching between two copies
of bootloader at different offsets of the same storage. The switch happens
in case one copy is corrupted OR can be enforced by user. This functionality
is present at least since i.MX53, however is poorly documented in all known
SoC datasheets, hence this document aims to clarify the usage, currently on
i.MX7D and i.MX8MM.

Signed-off-by: Marek Vasut <marex@denx.de> # Original MX7D work, this document
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> # All the MX8M work
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@foundries.io>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoARM: pcm058: Match mainline Linux NAND ECC layout/behaviour
Niel Fourie [Mon, 22 Mar 2021 13:05:11 +0000 (14:05 +0100)]
ARM: pcm058: Match mainline Linux NAND ECC layout/behaviour

Enabled "fsl,legacy-bch-geometry" in U-Boot device tree overlay
to match the legacy BCH geometry layout, which mainline Linux
applies when "fsl,use-minimum-ecc" is not specified in the device
tree.

Reinstated SYS_NAND_ONFI_DETECTION, which when disabled, masked
the mismatch on SOMs with Winbond NAND flash chips.

Signed-off-by: Niel Fourie <lusus@denx.de>
3 years agomx23_olinuxino: convert MMC to driver model
Trevor Woerner [Mon, 22 Mar 2021 15:31:29 +0000 (11:31 -0400)]
mx23_olinuxino: convert MMC to driver model

Convert the Olimex Olinuxino board's support for MMC to driver model following
Fabio Estevam's excellent example from:

commit: 23013aa9619881290dbeb6217f1fab863869050e:
mx23evk: Convert to driver model

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
3 years agomx23_olinuxino: enable device tree
Trevor Woerner [Mon, 22 Mar 2021 15:31:28 +0000 (11:31 -0400)]
mx23_olinuxino: enable device tree

Add the dts file for the Olimex Olinuxino from the linux kernel, and enable
its use in this machine's defconfig.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
3 years agommc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output
Haibo Chen [Wed, 3 Mar 2021 09:05:46 +0000 (17:05 +0800)]
mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output

For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these
are reserved bits. Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the
card clock output.

After commit b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support"),
we meet SD3.0 card can't work at UHS mode, mmc_switch_voltage() fail because
the second mmc_wait_dat0 return -ETIMEDOUT. According to SD spec, during
voltage switch, need to gate off/on the card clock. If not set the FRC_SDCLK_ON,
after CMD11, hardware will gate off the card clock automatically, so card do
not detect the clock off/on behavior, so will draw the data0 line low until
next command.

Fixes: b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support")
Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agoARM: imx: udoo: convert to DM_ETH
Peter Robinson [Fri, 2 Apr 2021 16:52:51 +0000 (17:52 +0100)]
ARM: imx: udoo: convert to DM_ETH

Convert the UDOO board to use DM_ETH.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: Convert block devices to DM
Peter Robinson [Fri, 2 Apr 2021 16:52:50 +0000 (17:52 +0100)]
ARM: imx: udoo: Convert block devices to DM

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

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: drop MTD config
Peter Robinson [Fri, 2 Apr 2021 16:52:49 +0000 (17:52 +0100)]
ARM: imx: udoo: drop MTD config

The UDOO doesn't have any MTD storage so drop the config.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 16:52:48 +0000 (17:52 +0100)]
ARM: imx: udoo: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6 based Udoo boards.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: board: udoo: Import UDOO dts files
Peter Robinson [Fri, 2 Apr 2021 16:52:47 +0000 (17:52 +0100)]
ARM: board: udoo: Import UDOO dts files

Import the i.MX6 based UDOO dts files from Linux 5.12-rc1.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoARM: embestmx6boards: convert the mars/riot boards to DM SPI
Peter Robinson [Fri, 2 Apr 2021 14:52:33 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert the mars/riot boards to DM SPI

Enable DM_SPI and DM_SPI_FLASH on the mars/riot boards.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert mars/riot boards to DM_ETH
Peter Robinson [Fri, 2 Apr 2021 14:52:32 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert mars/riot boards to DM_ETH

Convert the boards to use DM_ETH.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert mars/riot boards to DM_USB
Peter Robinson [Fri, 2 Apr 2021 14:52:31 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert mars/riot boards to DM_USB

Convert the marsboard/riotboard to use DM_USB.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert the mars/riot boards to DM_MMC
Peter Robinson [Fri, 2 Apr 2021 14:52:30 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert the mars/riot boards to DM_MMC

Convert the two Embest boards to use DM MMC.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: riotboard: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 14:52:29 +0000 (15:52 +0100)]
ARM: riotboard: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6D based riotboard.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: merge the riotboard's configs together
Peter Robinson [Fri, 2 Apr 2021 14:52:28 +0000 (15:52 +0100)]
ARM: embestmx6boards: merge the riotboard's configs together

It doesn't make much sense to have two separate configs for
the riotboard so let's merge the SPL config into the main one
for less duplication.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: marsboard: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 14:52:27 +0000 (15:52 +0100)]
ARM: marsboard: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6Q based embestmx6boards marsboard.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: Import the marsboard/riotboard. dts files
Peter Robinson [Fri, 2 Apr 2021 14:52:26 +0000 (15:52 +0100)]
ARM: embestmx6boards: Import the marsboard/riotboard. dts files

Import the iMX6 based marsboard and riotboard. dts files from Linux 5.12-rc1

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: st: stm32f746-disco: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:35 +0000 (20:21 +0200)]
board: st: stm32f746-disco: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoboard: freescale: imxrt1050-evk: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:34 +0000 (20:21 +0200)]
board: freescale: imxrt1050-evk: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoboard: freescale: imxrt1020-evk: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:33 +0000 (20:21 +0200)]
board: freescale: imxrt1020-evk: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoconfigs: imx8mn_beacon: Enable QSPI Support
Adam Ford [Sat, 3 Apr 2021 03:17:18 +0000 (22:17 -0500)]
configs: imx8mn_beacon: Enable QSPI Support

There is a QSPI chip connected to the FSPI.  Enable the defconfig
to support it.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoarm: dts: imx8mn, imx8mn-beacon: Sync dts files with Kernel 5.12-rc5
Adam Ford [Sat, 3 Apr 2021 03:17:17 +0000 (22:17 -0500)]
arm: dts: imx8mn, imx8mn-beacon: Sync dts files with Kernel 5.12-rc5

There have been a few updates including flexspi, so it's necessary
to re-sync.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoARM: board: usbarmory: Convert to OF_CONTROL and DM
Peter Robinson [Thu, 1 Apr 2021 21:17:06 +0000 (22:17 +0100)]
ARM: board: usbarmory: Convert to OF_CONTROL and DM

Convert usbarmory to OF_CONTROL and DM for gpio, pin
usb support on the i.MX53 based usbarmory.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Andrej Rosano <andrej@inversepath.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: board: usbarmory: Import the usbarmory dts file
Peter Robinson [Thu, 1 Apr 2021 21:17:05 +0000 (22:17 +0100)]
ARM: board: usbarmory: Import the usbarmory dts file

Import the iMX53 based usbarmory dts files from Linux 5.12-rc1

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Andrej Rosano <andrej@inversepath.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: toradex: apalis-imx8x: fix build instructions
Oleksandr Suvorov [Thu, 11 Mar 2021 20:00:37 +0000 (22:00 +0200)]
board: toradex: apalis-imx8x: fix build instructions

Fix an URL for downloading the SCFW binary for an Apalis iMX8X
and improve u-boot image build instructions.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoapalis/colibri_imx6: remove video= settings
Oleksandr Suvorov [Thu, 11 Mar 2021 20:00:36 +0000 (22:00 +0200)]
apalis/colibri_imx6: remove video= settings

Since Toradex provides the full set of overlays for Linux kernel
for display interfaces for both Apalis iMX6Q and Colibri iMX6DL
modules, the video= settings are obsolete. Remove them.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agocolibri_imx6ull/imx7: add missing tdxargs variable
Philippe Schenker [Thu, 11 Mar 2021 20:00:35 +0000 (22:00 +0200)]
colibri_imx6ull/imx7: add missing tdxargs variable

All the other boards have tdxargs specified for setting manual kernel
command-line arguments. Add them also to NAND-based boards.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agocolibri_imx6: adjust boot order
Igor Opaniuk [Thu, 11 Mar 2021 20:00:34 +0000 (22:00 +0200)]
colibri_imx6: adjust boot order

Remove duplicate of mmc0, set this boot order:
1) SD
2) eMMC
3) USB
4) DHCP boot

Fixes: 0e15165bc4e0 ("colibri_imx6: boot env configuration updates")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoboard: gateworks: venice: increase CONFIG_SYS_SPL_MALLOC_SIZE
Tim Harvey [Mon, 8 Mar 2021 21:52:36 +0000 (13:52 -0800)]
board: gateworks: venice: increase CONFIG_SYS_SPL_MALLOC_SIZE

commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading images")'
changed the way buffer allocation worked for SPL to a more flexible
method.

For venice this caused breakage that is resolved by increasing the size
of CONFIG_SYS_SPL_MALLOC_SIZE as the current FIT slighly exceeds 512KiB.

Additionally remove the unnecessary comment on CONFIG_SPL_BSS_MAX_SIZE
and CONFIG_SYS_SPL_MALLOC_SIZE as the size is obvious from the define.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: gateworks: venice: fix gsc_get_dev
Tim Harvey [Mon, 8 Mar 2021 21:52:35 +0000 (13:52 -0800)]
board: gateworks: venice: fix gsc_get_dev

use dm_i2c_probe instead of i2c_get_chip which appears to be more
reliable.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoMAINTAINERS: Use my personal e-mail address
Fabio Estevam [Thu, 4 Mar 2021 17:09:34 +0000 (14:09 -0300)]
MAINTAINERS: Use my personal e-mail address

Use my personal e-mail address for U-Boot related work.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agoimx: ventana: enable dm for SPI
Tim Harvey [Mon, 1 Mar 2021 22:33:37 +0000 (14:33 -0800)]
imx: ventana: enable dm for SPI

Enable driver model for SPI which allows us to remove the iomux
and init.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm for MTD and NAND
Tim Harvey [Mon, 1 Mar 2021 22:33:36 +0000 (14:33 -0800)]
imx: ventana: enable dm for MTD and NAND

Enable driver model for MTD and NAND support allowing us to remove
the iomux, init, and most of the static configuration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm support for MMC and SATA
Tim Harvey [Mon, 1 Mar 2021 22:33:35 +0000 (14:33 -0800)]
imx: ventana: enable dm support for MMC and SATA

Enable driver model support for MMC and SATA.

Note that DM_MMC requires aliases for your mmc devices so
they are added to the dts. Linux does not support enumerating mmc
devices by alias so these are not present in the Linux dts.

Note that we still need board_mmc_init() and board_mmc_getcd() for
not DM SPL to support MMC.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm support for USB
Tim Harvey [Mon, 1 Mar 2021 22:33:34 +0000 (14:33 -0800)]
imx: ventana: enable dm support for USB

Enable dm support for USB (which also requires dm support for fixed
regulators used for vbus enable) and remove usb iomux which is no
longer needed.

We can remove the handling of otgpwr_en gpio as this is defined in
dt as usbotg vbus-supply but we need to keep the handling of
USB_HUB_RST# for boards that have a USB HUB as that isn't defined in
the dt's currently.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: add pinctrl and remove unneeded UART init and config
Tim Harvey [Mon, 1 Mar 2021 22:33:33 +0000 (14:33 -0800)]
imx: ventana: add pinctrl and remove unneeded UART init and config

Once the IMX6 pinctrl driver is added UART is fully using driver mode
so we no longer need to config and initialize it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: convert U-Boot to OF_CONTROL using FIT image
Tim Harvey [Mon, 1 Mar 2021 22:33:32 +0000 (14:33 -0800)]
imx: ventana: convert U-Boot to OF_CONTROL using FIT image

In preparation for dm conversion convert to OF_CONTROL by adding FIT image
support and multi dtb.

Add a board_fit_config_name_match to match the dtb based off of EEPROM
model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoarm: dts: imx6qdl-gw*: add dr_mode prop to dt to avoid error
Tim Harvey [Mon, 1 Mar 2021 22:33:31 +0000 (14:33 -0800)]
arm: dts: imx6qdl-gw*: add dr_mode prop to dt to avoid error

The fsl-usb dt bindings in Linux default dr_mode to 'host' for
backward compatibility however U-Boot prints an error if
this property does not exist. Declare it in the Gateworks
Ventana device-trees to avoid the error.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: add Gateworks Ventana dts
Tim Harvey [Mon, 1 Mar 2021 22:33:30 +0000 (14:33 -0800)]
imx: ventana: add Gateworks Ventana dts

Add Gateworks Ventana dts/dtsi files from Linux 5.11 in preparation for
conversion to driver-model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agodt-bindings: add tda1997x and bindings
Tim Harvey [Mon, 1 Mar 2021 22:33:29 +0000 (14:33 -0800)]
dt-bindings: add tda1997x and bindings

Add td1997x header from Linux to be included by dts files.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agospl: fit: nand: allow for non-page-aligned elements
Tim Harvey [Mon, 1 Mar 2021 22:33:28 +0000 (14:33 -0800)]
spl: fit: nand: allow for non-page-aligned elements

Add a weak nand_get_mtd function for nand drivers to provide mtd info
and use this to set pagesize such that reading of non page-aligned
elements can succeed.

The spl_load_simple_fit already handles block block access so all we
need to do is provide the nand writesize as the block length.

Further cleanup of the drivers which use nand_spl_loaders.c such as
am335x_spl_bch.c, atmel_nand.c, and nand_spl_simple.c could be done
using info from mtd_info instead of statically defined details.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agospl: fit: nand: skip bad block handling if NAND chip not fully defined
Tim Harvey [Mon, 1 Mar 2021 22:33:27 +0000 (14:33 -0800)]
spl: fit: nand: skip bad block handling if NAND chip not fully defined

commit 9f6a14c47ff9 ("spl: fit: nand: fix fit loading in case of bad blocks")
added support for adjusting the image offset to account for bad blocks.
However this requires nand_spl_adjust_offset() which requires fully defined
specifics of the NAND chip being used may not be avialable.

Allow skipping this support for drivers or configs which don't specify
the NAND chip details statically with defines.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoARM: imx: Add OCRAM_S into iMX8M MMU tables
Marek Vasut [Thu, 25 Feb 2021 20:52:26 +0000 (21:52 +0100)]
ARM: imx: Add OCRAM_S into iMX8M MMU tables

The OCRAM_S is regular memory, just like the OCRAM, add it to the MMU
tables so it can be used and cached.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agodoc: imx8mp-evk: update after using binman
Peng Fan [Tue, 6 Apr 2021 03:59:03 +0000 (11:59 +0800)]
doc: imx8mp-evk: update after using binman

update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mp-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:59:02 +0000 (11:59 +0800)]
imx8mp-evk: switch to use binman

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agodoc: imx8mn_evk: update doc after using binman
Peng Fan [Tue, 6 Apr 2021 03:59:01 +0000 (11:59 +0800)]
doc: imx8mn_evk: update doc after using binman

Update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mn-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:59:00 +0000 (11:59 +0800)]
imx8mn-evk: switch to use binman

Use binman to pack images.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mn-ddr4-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:58:59 +0000 (11:58 +0800)]
imx8mn-ddr4-evk: switch to use binman

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agodoc: imx8mm_evk: update doc after using binman
Peng Fan [Tue, 6 Apr 2021 03:58:58 +0000 (11:58 +0800)]
doc: imx8mm_evk: update doc after using binman

Update doc after switch to binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mm_evk: switch to use binman to pack images
Peng Fan [Tue, 6 Apr 2021 03:58:57 +0000 (11:58 +0800)]
imx8mm_evk: switch to use binman to pack images

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: fsl: refactor for 32 bit version CAAM support on ARM64
Ye Li [Thu, 25 Mar 2021 09:30:36 +0000 (17:30 +0800)]
crypto: fsl: refactor for 32 bit version CAAM support on ARM64

Previous patch "MLK-18044-4: crypto: caam: Fix pointer size to 32bit
for i.MX8M" breaks the 64 bits CAAM.

Since i.MX CAAM are all 32 bits no matter the ARM arch (32 or 64),
to adapt and not break 64 bits CAAM support,  add a new config
CONFIG_CAAM_64BIT and new relevant type "caam_dma_addr_t".

This config is default enabled when CONFIG_PHYS_64BIT is set except
for iMX8M.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agofsl_mfgprot: Fix typo in sign_mppubk()
Breno Lima [Thu, 25 Mar 2021 09:30:35 +0000 (17:30 +0800)]
fsl_mfgprot: Fix typo in sign_mppubk()

The signature is generated using manufacturing protection private key.

Fix typo in fsl_mfgprot.c.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8: Add DEK blob encapsulation
Clement Faure [Thu, 25 Mar 2021 09:30:34 +0000 (17:30 +0800)]
imx8: Add DEK blob encapsulation

Add DEK encapsulation support for imx8. The DEK blob is generated by the
SECO through the SCFW API.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8m: Add DEK blob encapsulation for imx8m
Clement Faure [Thu, 25 Mar 2021 09:30:33 +0000 (17:30 +0800)]
imx8m: Add DEK blob encapsulation for imx8m

Add DEK blob encapsulation support for IMX8M through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application call.
U-boot sends and receives the DEK and the DEK blob binaries through OP-TEE
dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx: caam: new u-boot command to set PRIBLOB bitfield from CAAM SCFGR register to 0x3
Clement Le Marquis [Thu, 25 Mar 2021 09:30:32 +0000 (17:30 +0800)]
imx: caam: new u-boot command to set PRIBLOB bitfield from CAAM SCFGR register to 0x3

It is highly recommended to set the PRIBLOB bitfield to 0x3 once your
encrypted boot image has booted up, this prevents the generation of new
blobs that can be used to decrypt an encrypted boot image. The PRIBLOB is
a sticky type bit and cannot be changed until the next power on reset.

Add the set_priblob_bitfield U-Boot command to prevent the generation of
new blobs.

Signed-off-by: Clement Le Marquis <clement.lemarquis@nxp.com>
Acked-by: Ye Li <Ye.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 8 Apr 2021 11:33:14 +0000 (07:33 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- Watchdog, Unleashed and Icicle improvements

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 8 Apr 2021 11:32:54 +0000 (07:32 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Add Armada 38x RTC driver (Marek)
- turris_omnia: Misc updates (enable RTC and other cmds) (Marek)
- ds414: Misc updates (enable XHCI_PCI USB support etc) (Phil)
- Convert MVEBU MMC driver to DM (Harm)
- kirkwood: Misc updates and cleanups to some boards (Harm)

3 years agoarm: socfpga: smc: Add function to get usercode
Siew Chin Lim [Thu, 25 Mar 2021 06:07:45 +0000 (14:07 +0800)]
arm: socfpga: smc: Add function to get usercode

Add function to send mailbox command via SMC to get usercode from SDM.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoarm: socfpga: Enable FIT signature with crc32 for SOC64 devices
Siew Chin Lim [Wed, 24 Mar 2021 15:56:37 +0000 (23:56 +0800)]
arm: socfpga: Enable FIT signature with crc32 for SOC64 devices

Add signature with crc32 value for all images in binman node for FIT
image in device tree. And, enable FIT signature checking for Stratix10
and Agilex ATF and VAB sdmmc boot.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Changed to store QSPI reference clock in kHz
Siew Chin Lim [Wed, 24 Mar 2021 09:16:50 +0000 (17:16 +0800)]
arm: socfpga: Changed to store QSPI reference clock in kHz

Changed to store QSPI reference clock in kHz instead of Hz in
boot scratch cold0 register for Stratix10 and Agilex.

This patch is in preparation for Intel N5X SDRAM driver
support. Reserved 4 bits for Intel N5X SDRAM driver,
and there will be 28 bits to store QSPI reference clock.
Due to limited bits, QSPI reference clock frequency is
converted to kHz from Hz.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: Move Stratix10 and Agilex clock manager common code
Siew Chin Lim [Wed, 24 Mar 2021 09:16:49 +0000 (17:16 +0800)]
arm: socfpga: Move Stratix10 and Agilex clock manager common code

Move duplicated function cm_get_qspi_controller_clk_hz to clock_manager.c.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoarm: socfpga: Restructure Stratix10 and Agilex handoff code
Siew Chin Lim [Wed, 24 Mar 2021 05:11:38 +0000 (13:11 +0800)]
arm: socfpga: Restructure Stratix10 and Agilex handoff code

Restructure Stratix10 and Agilex handoff code to used by
all SOC64 devices, in preparation to support handoff for
Diamond Mesa.

Remove wrap_pinmux_config_s10.c. Add wrap_handoff_soc64.c
which contains the generic function to parse the handoff
data.

Update system_manager_soc64.c to use generic handoff
function in wrap_handoff_soc64.c.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoarm: socfpga: Rearrange sequence of macros in handoff_soc64.h
Siew Chin Lim [Wed, 24 Mar 2021 05:11:37 +0000 (13:11 +0800)]
arm: socfpga: Rearrange sequence of macros in handoff_soc64.h

Rearrange sequence of macros in handoff_soc64.h without any functionality
change. In preparation for Stratix10 and Agilex handoff function
restructuring.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Changed system_manager_s10.c to system_manager_soc64.c
Siew Chin Lim [Wed, 24 Mar 2021 05:11:36 +0000 (13:11 +0800)]
arm: socfpga: Changed system_manager_s10.c to system_manager_soc64.c

Rename to common file name to used by all SOC64 devices.
No functionality change.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c
Siew Chin Lim [Wed, 24 Mar 2021 05:11:35 +0000 (13:11 +0800)]
arm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c

Rename to common file name to used by all SOC64 devices.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Rename Stratix10 and Agilex handoff common macros
Siew Chin Lim [Wed, 24 Mar 2021 05:11:34 +0000 (13:11 +0800)]
arm: socfpga: Rename Stratix10 and Agilex handoff common macros

Rename handoff_s10.h to handoff_soc64.h. Changed macros prefix from
S10_HANDOFF to SOC64_HANDOFF.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Move Stratix10 and Agilex SPL common code
Siew Chin Lim [Mon, 15 Mar 2021 07:59:16 +0000 (15:59 +0800)]
arm: socfpga: Move Stratix10 and Agilex SPL common code

Move Stratix10 and Agilex SPL common code to spl_soc64.c.
We are in preparation for new n5x device support.
No functional change in this patch.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoarm: socfpga: smc: Remove unused SMC function ID
Siew Chin Lim [Fri, 12 Mar 2021 09:51:10 +0000 (17:51 +0800)]
arm: socfpga: smc: Remove unused SMC function ID

Remove unused SMC function ID 61 and 62.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoriscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes
Bin Meng [Wed, 31 Mar 2021 07:24:50 +0000 (15:24 +0800)]
riscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes

The uart nodes already provide <clocks> property for the driver to
dynamically calculate the correct clock frequency. There is no need
to keep the hard-coded <clock-frequency> property.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agoclk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag
Bin Meng [Wed, 31 Mar 2021 07:24:49 +0000 (15:24 +0800)]
clk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag

This driver is needed in the pre-relocation phase as the serial
driver depends on it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agoriscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN
Bin Meng [Wed, 31 Mar 2021 07:24:48 +0000 (15:24 +0800)]
riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

The RISC-V architecture default value of CONFIG_SYS_MALLOC_F_LEN
(0x1000) would not provide enough memory for devices like mpfs
clock and ns16550 serial to bind well before relocation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agotimer: sifive_clint: Support the official clint DT bindings
Bin Meng [Sat, 27 Mar 2021 11:57:35 +0000 (19:57 +0800)]
timer: sifive_clint: Support the official clint DT bindings

Linux kernel commit a2770b57d083 ("dt-bindings: timer: Add CLINT bindings")
adds the official DT bindings for CLINT, which uses "sifive,clint0"
as the compatible string. "riscv,clint0" is now legacy and has to
be kept for backward compatibility of legacy systems.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: assembler versions of memcpy, memmove, memset
Heinrich Schuchardt [Sat, 27 Mar 2021 11:37:04 +0000 (12:37 +0100)]
riscv: assembler versions of memcpy, memmove, memset

Provide optimized versions of memcpy(), memmove(), memset() copied from
the Linux kernel.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agotest: unit test for longjmp
Heinrich Schuchardt [Tue, 23 Mar 2021 18:11:27 +0000 (19:11 +0100)]
test: unit test for longjmp

Provide a unit test for the longjmp() library function

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Sean Anderson <seanga2@gmail.com>
3 years agoriscv: simplify longjmp
Heinrich Schuchardt [Tue, 23 Mar 2021 18:11:26 +0000 (19:11 +0100)]
riscv: simplify longjmp

The value returned by setjmp must be nonzero. If zero is passed as
parameter it must be replaced by 1.

This patch reduces the code size a bit.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: sifive: Rename fu540 board to unleashed
Bin Meng [Wed, 17 Mar 2021 03:10:58 +0000 (11:10 +0800)]
riscv: sifive: Rename fu540 board to unleashed

In preparation to add SiFive Unmatched board support, let's rename
the existing fu540 board to unleashed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoconfigs: EXT4, FAT, hush shell, env on S-mode MAIX
Heinrich Schuchardt [Sat, 6 Mar 2021 08:20:32 +0000 (08:20 +0000)]
configs: EXT4, FAT, hush shell, env on S-mode MAIX

* enable storing the environment in the SPI flash
* enable EXT4 and FAT file system
* enable hush shell
* run k210_bootcmd as default boot command

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
3 years agoriscv: Remove unused define in maix header
Sean Anderson [Thu, 11 Mar 2021 01:51:31 +0000 (20:51 -0500)]
riscv: Remove unused define in maix header

This define was left over from a previous revision, and was never used.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
3 years agoriscv: Enable watchdog for the k210
Sean Anderson [Thu, 11 Mar 2021 02:02:22 +0000 (21:02 -0500)]
riscv: Enable watchdog for the k210

This enables the necessary config options.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoriscv: Add watchdog bindings for the k210
Sean Anderson [Thu, 11 Mar 2021 02:02:21 +0000 (21:02 -0500)]
riscv: Add watchdog bindings for the k210

This adds the necessary bindings. Most of them are already there.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Acked-by: Rick Chen <rick@andestech.com>
3 years agowdt: dw: Free the clock on error
Sean Anderson [Thu, 11 Mar 2021 02:02:20 +0000 (21:02 -0500)]
wdt: dw: Free the clock on error

The clock subsystem requires that clk_free be called on clocks obtained via
clk_get_*.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agowdt: dw: Enable the clock before using it
Sean Anderson [Thu, 11 Mar 2021 02:02:19 +0000 (21:02 -0500)]
wdt: dw: Enable the clock before using it

The watchdog won't work if the clock isn't enabled.

Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agowdt: dw: Switch to if(CONFIG()) instead of using #if
Sean Anderson [Thu, 11 Mar 2021 02:02:18 +0000 (21:02 -0500)]
wdt: dw: Switch to if(CONFIG()) instead of using #if

This is preferred over #if because the compiler can check syntax even if
the feature is disabled. This cannot be used for CONFIG_CLK because
CONFIG_DW_WDT_CLOCK_KHZ is not defined on all platforms.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agowdt: dw: Switch to using fls for log2
Sean Anderson [Thu, 11 Mar 2021 02:02:17 +0000 (21:02 -0500)]
wdt: dw: Switch to using fls for log2

log_2_n_round_up is only found in arm. fls performs the same job and is
generic.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocrypto: caam: Add secure memory vid 3 support
Aymen Sghaier [Thu, 25 Mar 2021 09:30:29 +0000 (17:30 +0800)]
crypto: caam: Add secure memory vid 3 support

In i.MX8M platforms the secure memory block has a newer version
than those used in i.MX6/7 platforms, this patch update the driver
to use the correct registers offsets.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: caam: Fix pointer size to 32bit for i.MX8M
Aymen Sghaier [Thu, 25 Mar 2021 09:30:28 +0000 (17:30 +0800)]
crypto: caam: Fix pointer size to 32bit for i.MX8M

  The CAAM block used in i.MX8M is 32 bits address size but when the flag
 PHYS_64BIT is enabled for armv8, the CAAM driver will try to use a
 wrong pointer size.
  This patch fixes this issue.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: Add blob command support for i.MX8M platforms
Aymen Sghaier [Thu, 25 Mar 2021 09:30:27 +0000 (17:30 +0800)]
crypto: Add blob command support for i.MX8M platforms

 This patch enable blob command for mScale platforms.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: caam: Fix build warnings pointer casting
Aymen Sghaier [Thu, 25 Mar 2021 09:30:26 +0000 (17:30 +0800)]
crypto: caam: Fix build warnings pointer casting

  Enabling CAAM driver for i.MX8M platforms, a 64 bits architecture,
 lead to casting warnings: from/to pointer to/from integer with
 different size. This patch fix these warnings

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: caam: Add CAAM support to i.MX8M platforms
Aymen Sghaier [Thu, 25 Mar 2021 09:30:25 +0000 (17:30 +0800)]
crypto: caam: Add CAAM support to i.MX8M platforms

This patch enable CAAM support for i.MX8M platforms.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx7ulp: Enable support for cmd blob
Franck LENORMAND [Thu, 25 Mar 2021 09:30:24 +0000 (17:30 +0800)]
imx7ulp: Enable support for cmd blob

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocaam: enable support for iMX7ULP
Franck LENORMAND [Thu, 25 Mar 2021 09:30:23 +0000 (17:30 +0800)]
caam: enable support for iMX7ULP

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>