]> git.baikalelectronics.ru Git - uboot.git/log
uboot.git
2 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Fri, 22 Apr 2022 12:12:53 +0000 (08:12 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdog

- device-tree-bindings: watchdog: document common properties (Philippe)
- nuvoton: Add support for Nuvoton (Jim)

2 years agoMerge tag 'u-boot-imx-20220422' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 22 Apr 2022 12:12:20 +0000 (08:12 -0400)]
Merge tag 'u-boot-imx-20220422' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220422
-------------------

- Switch to DM_SERIAL
- Drop MMCROOT
- several cleanup

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

2 years agowdt: nuvoton: Add support for Nuvoton
Jim Liu [Fri, 1 Apr 2022 09:59:39 +0000 (17:59 +0800)]
wdt: nuvoton: Add support for Nuvoton

Add watchdog controller driver for NPCM7xx/npcm8xx

the wdt design of npcm750 and npcm845 is the same.
so the driver can work on npcm750 and npcm845.
about npcm845 wdt dtsi i will followed kernel dts name
to use nuvoton,npcm750-wdt.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodoc: device-tree-bindings: watchdog: document common properties
Philippe Reynes [Wed, 9 Mar 2022 13:56:19 +0000 (14:56 +0100)]
doc: device-tree-bindings: watchdog: document common properties

Adds simple documentation about common properties for watchdog
in the device tree.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge branch '2022-04-21-further-cleanups'
Tom Rini [Thu, 21 Apr 2022 23:55:38 +0000 (19:55 -0400)]
Merge branch '2022-04-21-further-cleanups'

- Fix SPL_SYS_MALLOC_SIMPLE and non-SPL_FRAMEWORK boards (a large number
  of PowerPC platforms)
- Remove duplication of crc16 functionality
- Migrate COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY and have it in
  Kconfig

2 years agoARM: imx: imx8mn-evk: change environment address variables
Heiko Thiery [Thu, 24 Feb 2022 20:07:14 +0000 (21:07 +0100)]
ARM: imx: imx8mn-evk: change environment address variables

Currently the space between kernel_addr_r and the fdt_addr_r is only 32MB.
To have enough space to load kernel images bigger than 32MB change the
variables to a feasible value.

The new environment variables layout is based on the scheme from
"include/configs/ti_armv7_common.h".

The CONFIG_SYS_LOAD_ADDR value is set to 0x42000000. With that we have
the same value as for the kernel_addr_r.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx: drop IMX_FEC_BASE
Peng Fan [Fri, 15 Apr 2022 04:23:43 +0000 (12:23 +0800)]
configs: imx: drop IMX_FEC_BASE

IMX_FEC_BASE is not used in these boards, so drop it.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8mm-cl-iot-gate: Remove redundant board_fix_fdt()
Ying-Chun Liu (PaulLiu) [Wed, 20 Apr 2022 15:37:07 +0000 (23:37 +0800)]
imx8mm-cl-iot-gate: Remove redundant board_fix_fdt()

In arch/arm/mach-imx/imx8m/soc.c there's an implementation of
board_fix_fdt() introduced by commit 3efdcc5fc335. Remove the
redundant one to avoid failed to build from source when enabling
CONFIG_OF_BOARD_FIXUP.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoarm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid
Peng Fan [Wed, 13 Apr 2022 09:47:22 +0000 (17:47 +0800)]
arm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid

Since COUNTER_FREQUENCY is obselete, so set cntfrq_el0 if
CONFIG_COUNTER_FREQUENCY is valid

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2 years agoinclude/configs: drop COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:21 +0000 (17:47 +0800)]
include/configs: drop COUNTER_FREQUENCY

Since we have CONFIG_COUNTER_FREQUENCY enabled, no need COUNTER_FREQUENCY

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: set CONFIG_COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:20 +0000 (17:47 +0800)]
configs: set CONFIG_COUNTER_FREQUENCY

Set CONFIG_COUNTER_FREQUENCY according to COUNTER_FREQUENCY in
config header file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
[trini: Re-run migration]

2 years agoarch: arm: Kconfig: set default COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:19 +0000 (17:47 +0800)]
arch: arm: Kconfig: set default COUNTER_FREQUENCY

Set default COUNTER_FREQUENCY according to config header file
under include/configs/
i.MX6UL/ULL/7D/8QM/8QXP all has system counter frequency run at 8MHz,
so set default value for them.
SUNXI/EXYNOS/ROCKCHIP_RK3128/ROCKCHIP_RK3288/ROCKCHIP_RK322X/ROCKCHIP_RK3036
at 24MHz. ARCH_LX2160A at 25MHz
ARCH_ZYNQMP at 100MHz

2 years agoarch: arm: move COUNTER_FREQUENCY from versal to arm
Peng Fan [Wed, 13 Apr 2022 09:47:18 +0000 (17:47 +0800)]
arch: arm: move COUNTER_FREQUENCY from versal to arm

Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to
versal. And update help message.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoxilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:17 +0000 (17:47 +0800)]
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY

Since versal has CONFIG_COUNTER_FREQUENCY, so use it. And
COUNTER_FREQUENCY will be dropped.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
2 years agomisc: atsha204a: Remove duplicate CRC-16 implementation
Pali Rohár [Tue, 12 Apr 2022 09:20:44 +0000 (11:20 +0200)]
misc: atsha204a: Remove duplicate CRC-16 implementation

ATSHA204A uses bit-reversed checksum of standard CRC-16 with polynomial
x^16 + x^15 + x^2 + 1.

This ATSHA204A specific checksum can be calculated just by using common
U-Boot functions bitrev16() and crc16().

So replace custom driver CRC-16 implementation by common U-Boot functions.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agofs: ext4: Use CRC-16 implementation from linux/crc16.h
Pali Rohár [Tue, 12 Apr 2022 09:20:43 +0000 (11:20 +0200)]
fs: ext4: Use CRC-16 implementation from linux/crc16.h

Implementation in linux/crc16.h provides standard CRC-16 algorithm with
polynomial x^16 + x^15 + x^2 + 1. Use it and remove duplicate ext4 CRC-16
specific code.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16: Move standard CRC-16 implementation from ubifs to lib
Pali Rohár [Tue, 12 Apr 2022 09:20:42 +0000 (11:20 +0200)]
crc16: Move standard CRC-16 implementation from ubifs to lib

This implementation provides standard CRC-16 algorithm with polynomial
x^16 + x^15 + x^2 + 1.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16: Rename fs/ubifs/crc16.h to include/linux/crc16.h
Pali Rohár [Tue, 12 Apr 2022 09:20:41 +0000 (11:20 +0200)]
crc16: Rename fs/ubifs/crc16.h to include/linux/crc16.h

File fs/ubifs/crc16.h is standard linux's crc16.h include file. So move it
from fs/ubifs to include/linux where are also other linux include files.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c
Pali Rohár [Tue, 12 Apr 2022 09:20:40 +0000 (11:20 +0200)]
crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c

U-Boot CRC-16 implementation uses polynomial x^16 + x^12 + x^5 + 1 which is
not standard CRC-16 algorithm, but it is known as CRC-16-CCITT. Rename file
crc16.c to crc16-ccitt.c to reduce confusion.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoSPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default
Pali Rohár [Fri, 8 Apr 2022 08:28:05 +0000 (10:28 +0200)]
SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default

On P2020 board is SPL malloc simple always failing with error and loops:

  SD boot...
  alloc space exhausted
  Bad trap at PC: f8f8b5f0, SR: 21200, vector=d00
  NIP: 00000000 XER: 00000000 LR: 00000000 REGS: f8f8b5f0 TRAP: 20000000 DAR: 00000000
  MSR: 00021200 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00

  GPR00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR08: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  Call backtrace:
  Exception in kernel pc f8f8b5f0 signal 0

Inspection showed that gd->malloc_limit is zero. And it is because
generally SPL_FRAMEWORK initialize SPL's gd->malloc_limit. But when
SPL_FRAMEWORK is not enabled then in most cases nobody initialize
gd->malloc_limit and so SPL malloc simple does not work.

So disable SPL_SYS_MALLOC_SIMPLE by default when SPL_FRAMEWORK is not
enabled. SPL_SYS_MALLOC_SIMPLE can be disabled only by setting
SPL_SYS_MALLOC_F_LEN to zero. So do it.

This change fixes SPL error "alloc space exhausted" on P2020 board.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 21 Apr 2022 15:44:54 +0000 (11:44 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mrvl_uart.sh: Remove script (Pali)
- Fix Espressobin build for configs where ENV is not in SPI (Rogier)
- mvebu: a37xx: Add support for reading OTP (Pali)
- mvebu: uDPU: Ethernet fixes and misc DT and defconfig changes (Robert)
- mvebu: Add support for reading LD0 and LD1 eFuse (Pali)
- kwboot: Replace fstat()+st_size by lseek()+SEEK_END (Pali)
- mvebu: turris_omnia: Enable CONFIG_CMD_FUSE (Pali)
- arm: Add CONFIG_SPL_SYS_NO_VECTOR_TABLE used on 32bit MVEBU (Pali)
- mvebu: a37xx: Add support for writing Security OTP values (Pali)
- mvebu: turris: Misc enhancements and cleanups / fixes (Pali)
- Sheevaplug : Use Marvell uclass mvgbe and PHY driver for Ethernet (Tony)

2 years agoMerge branch '2022-04-21-assorted-improvements'
Tom Rini [Thu, 21 Apr 2022 14:56:58 +0000 (10:56 -0400)]
Merge branch '2022-04-21-assorted-improvements'

- For the environment, add a arch_env_get_location hook and make use of
  it on some NXP platforms (so that boards can override SoCs).
- Remove some unused squashfs code from SPL
- Resync am335x beaglebone related DTS files
- Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used

2 years agoimx: Fix build error
Ye Li [Tue, 19 Apr 2022 09:13:25 +0000 (14:43 +0530)]
imx: Fix build error

Fix wrong environment.h and remove DECLARE_GLOBAL_DATA_PTR

Fixes: e6c156b4b5 (imx: imx7 Support for Manufacturing Protection)
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agoimx: Update FSL_MFGPROT config for iMX8M
Ye Li [Tue, 19 Apr 2022 09:13:24 +0000 (14:43 +0530)]
imx: Update FSL_MFGPROT config for iMX8M

Update the Kconfig and Makefile to allow build for iMX8M and
restrict the build only in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agocrypto/fsl: add invalidate_dcache_range for hash output buffer
Gaurav Jain [Tue, 19 Apr 2022 05:22:28 +0000 (10:52 +0530)]
crypto/fsl: add invalidate_dcache_range for hash output buffer

HW accelerated hash operations are giving incorrect hash output.
so invalidate cache lines to avoid cache overwriting in DDR memory region.

caam_hash()
 -moved address alignment check in the beginning of function.
 -added invalidate_dcache_range for pout buffer before running descriptor.

Fixes: b33dbb8714 (crypto/fsl: Fix HW accelerated hash commands)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agodoc: imx8mn_evk: Do not export ATF_LOAD_ADDR
Fabio Estevam [Mon, 18 Apr 2022 17:15:08 +0000 (14:15 -0300)]
doc: imx8mn_evk: Do not export ATF_LOAD_ADDR

The imx8mn_evk target have been converted to use binman.

With the binman approach the ATF load address is described via
devicetree, so remove the now unneeded instruction of exporting
ATF_LOAD_ADDR.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mn_evk: Enable cache in SPL
Fabio Estevam [Mon, 18 Apr 2022 17:15:07 +0000 (14:15 -0300)]
imx8mn_evk: Enable cache in SPL

There is no reason for disabling I-cache and D-cache
in SPL.

Remove the unneeded CONFIG_SPL_SYS_ICACHE_OFF and
CONFIG_SPL_SYS_DCACHE_OFF options.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoboard: bsh: imx8mn_bsh_smm_s2/s2pro: enable DM_SERIAL
Michael Trimarchi [Mon, 18 Apr 2022 06:53:36 +0000 (08:53 +0200)]
board: bsh: imx8mn_bsh_smm_s2/s2pro: enable DM_SERIAL

Enable DM_SERIAL for both U_Boot and the SPL. The uart4 and its pinmux
are already marked with u-boot,dm-spl but we need to move the call to
preloader_console_init() after spl_init() to avoid a board hang
as dm can't be used until after spl_init().

Remove the manual config of the UART pinmux now that it is no longer
needed.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Tested-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2 years agoarm: dts: imx8mp: add of-list support to common imx8mp-u-boot.dtsi
Tim Harvey [Fri, 15 Apr 2022 20:41:54 +0000 (13:41 -0700)]
arm: dts: imx8mp: add of-list support to common imx8mp-u-boot.dtsi

Add support for OF-LIST to common imx8mp-u-boot.dtsi so that it can
be used with boards that have multiple DTB's.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Teresa Remmet <t.remmet@phytec.de>
Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agocrypto/fsl: Clear the memory when blob decapsulation fails
Gaurav Jain [Fri, 15 Apr 2022 11:22:34 +0000 (16:52 +0530)]
crypto/fsl: Clear the memory when blob decapsulation fails

issue: blob decapsulation operation store the decrypted data
       in memory even if ICV check failed.

fix: clear the blob data output memory.

Fixes: c5de15cbc8 (crypto/fsl: Add command for encapsulating/decapsulating blobs)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Tested-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mq-evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:36 +0000 (12:35 +0800)]
imx: imx8mq-evk: enable CONFIG_DM_SERIAL

Marked related nodes as u-boot,dm-spl for serial driver model
Enable CONFIG_DM_SERIAL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mn_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:35 +0000 (12:35 +0800)]
imx: imx8mn_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

move the preloader_console_init() call after spl_init() to
avoid board hang

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mm_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:34 +0000 (12:35 +0800)]
imx: imx8mm_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

move the preloader_console_init() call after spl_early_init() to
avoid board hang

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mp_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:33 +0000 (12:35 +0800)]
imx: imx8mp_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoscripts: config_whitelist: drop CONFIG_MMCROOT
Peng Fan [Fri, 15 Apr 2022 04:23:42 +0000 (12:23 +0800)]
scripts: config_whitelist: drop CONFIG_MMCROOT

Drop CONFIG_MMCROOT, no users now.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: drop CONFIG_MMCROOT
Peng Fan [Fri, 15 Apr 2022 04:23:41 +0000 (12:23 +0800)]
configs: drop CONFIG_MMCROOT

CONFIG_MMCROOT is only used to set mmcroot, no need a dedicated macro.

Script as below
"
 for i in `ls include/configs/*.h`
 do
 mmcroot=`sed -n '/define.*MMCROOT/ p' $i  | awk -F\" '{ print $2;}'`

 if [ ! -n "$mmcroot" ]; then
  continue
 fi

 sed -i '/define.*MMCROOT/ d' $i
 sed -i 's,\" CONFIG_MMCROOT \",'$mmcroot',g' $i

 done
"

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agotreewide: Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used
Sean Anderson [Tue, 12 Apr 2022 14:59:04 +0000 (10:59 -0400)]
treewide: Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used

If .bss does not immediately follow the end of the image, then
CONFIG_SPL_SEPARATE_BSS must be selected. Typically, the location of bss
is specified by using CONFIG_SPL_BSS_START_ADDR in a linker script. On
these arches, CONFIG_SPL_SEPARATE_BSS should be enabled. If there is an
option to use an alternate boot script (e.g. CONFIG_SPL_LDSCRIPT is just
a default), just imply. If there is not, select.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2 years agoboard: ti: am335x: Add support for BBE Extended WiFi
Paul Barker [Mon, 11 Apr 2022 15:42:01 +0000 (15:42 +0000)]
board: ti: am335x: Add support for BBE Extended WiFi

The Sancloud BeagleBone Enhanced Extended WiFi (BBE Extended WiFi) has
its own devicetree file and the board can be identified by the 2nd
letter of the config string within the common EEPROM.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agoboard: ti: am335x: Add BBE Lite support
Paul Barker [Mon, 11 Apr 2022 15:42:00 +0000 (15:42 +0000)]
board: ti: am335x: Add BBE Lite support

The Sancloud BeagleBone Enhanced Lite (BBE Lite) has its own devicetree
file and the board can be identified by the 2nd letter of the config
string within the common EEPROM.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agoarm: dts: Resync dts for BeagleBone and derivatives
Paul Barker [Mon, 11 Apr 2022 15:41:59 +0000 (15:41 +0000)]
arm: dts: Resync dts for BeagleBone and derivatives

Sync BeagleBone dts files & TPS dtsi files with Linux v5.17 and include
the SanCloud BBE Extended WiFi dts added in v5.18-rc1. Also pull in
changes to am33xx-l4.dtsi needed to support the BeagleBone Blue.

The change to use the cpsw switch driver (commit c477358e66a3 in Linux)
is excluded from the sync as u-boot does not recognise the new
compatible string.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agofs: Allow to compile FS_SQUASHFS only for proper U-Boot
Pali Rohár [Wed, 6 Apr 2022 21:34:00 +0000 (23:34 +0200)]
fs: Allow to compile FS_SQUASHFS only for proper U-Boot

CONFIG_SPL_FS_SQUASHFS cannot be disabled when CONFIG_FS_SQUASHFS is
enabled. Fix it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoARM: imx: imx8m: env: Switch to arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:34 +0000 (02:21 +0200)]
ARM: imx: imx8m: env: Switch to arch_env_get_location()

Implement arch_env_get_location() instead of env_get_location(), so that
the env_get_location() can be implemented on board level and override the
arch_env_get_location() architecture defaults.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoarmv8: layerscape: env: Switch to arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:33 +0000 (02:21 +0200)]
armv8: layerscape: env: Switch to arch_env_get_location()

Implement arch_env_get_location() instead of env_get_location(), so that
the env_get_location() can be implemented on board level and override the
arch_env_get_location() architecture defaults.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoenv: Implement lower priority arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:32 +0000 (02:21 +0200)]
env: Implement lower priority arch_env_get_location()

Currently there is only one way to override desired environment location,
by implementing env_get_location(). This is increasingly being conflated
both on board level and architecture level, which leads to a problem on
boards where this function is already implemented on architecture level,
since those boards have no way to override this environment location on
board level anymore.

Implement arch_env_get_location() function which is architecture specific
and should only ever be implemented in architecture code. This function
has lower priority than env_get_location(), which should only ever be
implemented in board code, and which overrides the arch_env_get_location()
architecture environment selection.

This way, architecture can define its default environment chooser, while
board can now override it as needed at all times.

There is no functional change, since env_get_location() simply returns
arch_env_get_location(), and arch_env_get_location() implements the
current env_get_location() default content.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoconfigs: phycore_imx8mm/p: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:40 +0000 (12:23 +0800)]
configs: phycore_imx8mm/p: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-By: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mm/n_venice: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:39 +0000 (12:23 +0800)]
configs: imx8mm/n_venice: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-By: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: verdin-imx8m: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:38 +0000 (12:23 +0800)]
configs: verdin-imx8m: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8qm/qxp_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:37 +0000 (12:23 +0800)]
configs: imx8qm/qxp_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: mx7dsabresd: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:36 +0000 (12:23 +0800)]
configs: mx7dsabresd: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: mx6sxsabresd: drop CONFIG_SYS_FSL_USDHC_NUM
Peng Fan [Fri, 15 Apr 2022 04:23:35 +0000 (12:23 +0800)]
configs: mx6sxsabresd: drop CONFIG_SYS_FSL_USDHC_NUM

With DM_MMC, CONFIG_SYS_FSL_USDHC_NUM is not needed.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mn_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:34 +0000 (12:23 +0800)]
configs: imx8mn_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mp_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:33 +0000 (12:23 +0800)]
configs: imx8mp_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mm_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:32 +0000 (12:23 +0800)]
configs: imx8mm_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoARM: imx: imx8m: Fix board_get_usable_ram_top()
Marek Vasut [Thu, 14 Apr 2022 13:51:46 +0000 (15:51 +0200)]
ARM: imx: imx8m: Fix board_get_usable_ram_top()

The 4 GiB boundary is at 0xffffffff+1 , not at 0x80000000, fix this.

The PHYS_SDRAM of i.MX8M is at 0x40000000 , so to restrict ram_top
below 4 GiB, the ram_top has to be set to 0xffffffff as it is not
an offset from the start of PHYS_SDRAM, but rather a physical address
marking the topmost allowed DRAM address.

Fixes: 3dedf85a11b ("imx8m: Restrict usable memory to space below 4G boundary")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agoconfigs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO
Ian Ray [Thu, 14 Apr 2022 11:05:46 +0000 (14:05 +0300)]
configs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO

This GPIO is actually an input "Q7_3V3_PCIE_WAKE#_IN" not an output, so
remove the misleaading and incorrect definition.

Cc: Tim Harvey <tharvey@gateworks.com> (re: pci: imx: use vpcie-supply if defined by device-tree)
Signed-off-by: Ian Ray <ian.ray@ge.com>
2 years agopci: imx: remove weak overrides no longer used
Tim Harvey [Wed, 13 Apr 2022 22:57:37 +0000 (15:57 -0700)]
pci: imx: remove weak overrides no longer used

There are no users of the imx6_pcie_toggle_power and imx6_pcie_toggle_reset
weak overrides and as these functions are able to be handled now via dt
properties lets remove these.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agopci: imx: use vpcie-supply if defined by device-tree
Tim Harvey [Wed, 13 Apr 2022 22:54:37 +0000 (15:54 -0700)]
pci: imx: use vpcie-supply if defined by device-tree

If vpcie-supply is defined by device-tree use that if
CONFIG_PCIE_IMX_POWER_GPIO is not defined.

Note that after this the following boards which define
CONFIG_PCIE_IMX_POWER_GPIO in their board header file as well as their
device-tree should be able to remove CONFIG_PCIE_IMX_PERST_GPIO without
consequence:
 - mx6sabresd
 - mx6sxsabresd
 - novena

Note that the ge_bx50v3 board uses CONFIG_PCIE_IMX_POWER_GPIO and does
not have vpcie-supply defined in it's pcie node in the dt thus removing
CONFIG_PCIE_IMX_POWER_GPIO globally can't be done until that board adds
vpcie-supply.

Cc: Ian Ray <ian.ray@ge.com> (maintainer:GE BX50V3 BOARD)
Cc: Sebastian Reichel <sebastian.reichel@collabora.com> (maintainer:GE BX50V3 BOARD)
Cc: Fabio Estevam <festevam@gmail.com> (maintainer:MX6SABRESD BOARD)
Cc: Marek Vasut <marex@denx.de> (maintainer:NOVENA BOARD)
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoarm: kirkwood: Sheevaplug : Use Marvell uclass mvgbe and PHY driver for Ethernet
Tony Dinh [Sun, 17 Apr 2022 23:42:32 +0000 (16:42 -0700)]
arm: kirkwood: Sheevaplug : Use Marvell uclass mvgbe and PHY driver for Ethernet

The Globalscale Technologies Sheevaplug board has the network chip
Marvell 88E1116R. Use uclass mvgbe and the compatible driver M88E1310
driver to bring up Ethernet.

- Remove CONFIG_RESET_PHY_R symbol from all board files
- Use uclass mvgbe to bring up the network. And remove ad-hoc code.
- Enable CONFIG_PHY_MARVELL to properly configure the network.
- Miscellaneous changes: Move constants to .c file and remove header file
board/Marvell/sheevaplug/sheevaplug.h, use BIT macro, and add/cleanup
comments.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: mvebu: turris_omnia: Enable CONFIG_CMD_FUSE
Pali Rohár [Wed, 6 Apr 2022 13:26:35 +0000 (15:26 +0200)]
arm: mvebu: turris_omnia: Enable CONFIG_CMD_FUSE

This allows to read eFuse on Turris Omnia.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoboard: toradex: drop colibri pxa270 support
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:32 +0000 (11:33 +0200)]
board: toradex: drop colibri pxa270 support

The Colibri PXA270 has been end-of-life since quite a while and would
require more and more maintenance (e.g. DM conversions).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoboard: gateworks: venice: add imx8mp-venice-gw740x support
Tim Harvey [Wed, 13 Apr 2022 18:31:09 +0000 (11:31 -0700)]
board: gateworks: venice: add imx8mp-venice-gw740x support

The GW74xx is based on the i.MX 8M Plus SoC featuring:
 - LPDDR4 DRAM
 - eMMC FLASH
 - Gateworks System Controller
 - PCIe Gen 3.0 switch (build option)
 - USB 3.0 HUB
 - USB Type-C front panel connector
 - GPS
 - 3-axis accelerometer
 - CAN bus
 - 6x GbE RJ45 front-panel jacks
  - 1x IMX8M FEC RGMII GbE (with Passive PoE)
  - 5x IMX8M EQOS RGMII 6 port GbE Switch
    (1x with 802.3af class 5 Active PoE)
 - RS232/RS485/RS422 serial transceiver
 - MIPI header (DSI/CSI/GPIO/PWM/I2S)
 - DigI/O header (UART/GPIO/I2C/ADC)
 - 802.11ac WiFi
 - Bluetooth BLE
 - 3x MiniPCIe sockets with PCI/USB
 - 1x M.2 Socket with USB2.0, PCIe, and dual-SIM
 - PMIC
 - Wide range DC input supply (8V to 60V DC)

Do the following to add support for this and future imx8mp-venice boards:
 - add dts
 - add DRAM config
 - add PMIC config
 - add IMX8MP support in spl.c and venice.c

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: add additional levels for dtb name match
Tim Harvey [Wed, 13 Apr 2022 18:31:08 +0000 (11:31 -0700)]
board: gateworks: venice: add additional levels for dtb name match

Gateworks produces many products from a single PCB with subloaded
components. Add an additional two levels of dtb name matching so that
for example a GW7400-A matches the dtb name of gw74xx.dtb

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: gw_ventana: use comomn GSC driver
Tim Harvey [Wed, 13 Apr 2022 16:29:16 +0000 (09:29 -0700)]
board: gateworks: gw_ventana: use comomn GSC driver

Use the common GSC driver.

This allows us to do some additional cleanup:
 - use the GSC driver functions
 - move waiting for the EEPROM to the SPL int (it will always be ready
   after this)
 - move eeprom functions into eeprom file and elimate GSC_I2C_BUS
 - eliminate some redundant EEPROM reads (the EEPROM must be read in
   SPL before relocation, in SPL after relocation, and in U-Boot init.
   All subsequent uses can use the global structure)
 - remove unnecessary header files and alphabatize includes

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m, n}_venice_defconfig: enable md5sum and crc32 commands
Tim Harvey [Wed, 13 Apr 2022 16:12:10 +0000 (09:12 -0700)]
imx8m{m, n}_venice_defconfig: enable md5sum and crc32 commands

Enable the md5sum and crc32 commands.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}-venice-gw7902: add support for GPY111 phy
Tim Harvey [Wed, 13 Apr 2022 16:09:49 +0000 (09:09 -0700)]
imx8m{m,n}-venice-gw7902: add support for GPY111 phy

The TI DP83867 phy has been replaced with the MaxLinear GPY111 phy
due to part availability. Add support for it:
 - increase post-reset time to 300ms per datasheet
 - add tx-delay/rx-delay config

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}_venice_defconfig: add DT overlay support
Tim Harvey [Wed, 13 Apr 2022 16:05:04 +0000 (09:05 -0700)]
imx8m{m,n}_venice_defconfig: add DT overlay support

enable CONFIG_OF_LIBFDT_OVERLAY to support applying dt overlays in
U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoarm: dts: imx8m*-venice: add gpio hog support
Tim Harvey [Wed, 13 Apr 2022 16:02:44 +0000 (09:02 -0700)]
arm: dts: imx8m*-venice: add gpio hog support

Add gpio hog support for board-specific gpio lines:
- put hogs in u-boot.dtsi so as to keep the regular dts files
  in sync with the kernel. The hogs will not be put in the kernel
  as that makes them un-usable by userspace as well as
  re-initializes them to dt defaults overriding changes which may
  have been done by bootloader commands.
- specify gpio names and initial config
- enable GPIO_HOG

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: gateworks: venice: use common GSC driver
Tim Harvey [Wed, 13 Apr 2022 15:56:40 +0000 (08:56 -0700)]
board: gateworks: venice: use common GSC driver

Use the common GSC driver.

This allows us to do some additional cleanup:
 - rename gsc{.c,.h} to eeprom{.c.h} for clarity
 - collapse eeprom_get_dev
 - remove unnecessary header files and alphabatize includes

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: enable DM_SERIAL
Tim Harvey [Wed, 13 Apr 2022 15:47:19 +0000 (08:47 -0700)]
board: gateworks: venice: enable DM_SERIAL

Enable DM_SERIAL.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoconfigs: imx8m{m,n}_venice_defconfig: add usb support
Tim Harvey [Wed, 13 Apr 2022 15:42:52 +0000 (08:42 -0700)]
configs: imx8m{m,n}_venice_defconfig: add usb support

Enable USB support for host controller and various USB ethernet
devices.

Example usage of USB Mass Storage (UMS) support:
 u-boot=> mmc list
 FSL_SDHC: 0
 FSL_SDHC: 1
 FSL_SDHC: 2 (eMMC)
 u-boot=> ums 0 mmc 2
 UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe30000

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}_venice: update env memory layout
Tim Harvey [Wed, 13 Apr 2022 15:25:10 +0000 (08:25 -0700)]
imx8m{m,n}_venice: update env memory layout

Update distro config env memory layout:
 - loadaddr=0x48200000 allows for 130MB area for uncompressing (ie FIT
   images, kernel_comp_addr_r)
 - fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
 - scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
 - ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoconfigs: tdx: apalis/colibri_imx6: use preboot as well
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:35 +0000 (11:33 +0200)]
configs: tdx: apalis/colibri_imx6: use preboot as well

Use PREBOOT as well. This allows a customer to just set fdt_board as
on any other module to customize the device tree for his carrier
board.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: tdx: apalis_imx6: drop hw v1.0 support
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:34 +0000 (11:33 +0200)]
configs: tdx: apalis_imx6: drop hw v1.0 support

Drop optional support for the ancient Apalis iMX6 V1.0 hardware which
had the UART wired as DCE rather than DTE.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoboard: colibri_imx7: fix usb start on solo
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:33 +0000 (11:33 +0200)]
board: colibri_imx7: fix usb start on solo

This fixes the following crash when run on a Colibri iMX7S aka solo:

Colibri iMX7 # usb start
starting USB...
Bus usb@30b10000: USB EHCI 1.00
Bus usb@30b20000:

The i.MX 7Solo has only one single USB OTG1 but no USB host port. Trying
to initialize the nonexisting port just crashes.

While at it also drop board_usb_phy_mode() which is also no longer used
in the driver model age.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: tdx: Do not overwrite fdtfile if it got set manually
Philippe Schenker [Wed, 13 Apr 2022 09:33:31 +0000 (11:33 +0200)]
configs: tdx: Do not overwrite fdtfile if it got set manually

In case a customer wants to set fdtfile currently preboot overrides it
always with preboot just before the bootdelay. Use test -n to check
if fdtfile is already set and only set it if nothing got touched manually

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: colibri-imx7/-emmc: enable booting from usb sdp
Oleksandr Suvorov [Wed, 13 Apr 2022 09:33:30 +0000 (11:33 +0200)]
configs: colibri-imx7/-emmc: enable booting from usb sdp

For recovery purpose allow booting via SDP over USB as well.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: toradex: enable missing fit options
Oleksandr Suvorov [Wed, 13 Apr 2022 09:33:29 +0000 (11:33 +0200)]
configs: toradex: enable missing fit options

Add missing support of FIT-images and enable a verbosity for
this feature.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: drop legacy nfsboot script
Igor Opaniuk [Wed, 13 Apr 2022 09:33:28 +0000 (11:33 +0200)]
toradex: drop legacy nfsboot script

Drop legacy nfsboot script in favor of distroboot DHCP boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: set default dhcp distroboot scriptname
Igor Opaniuk [Wed, 13 Apr 2022 09:33:27 +0000 (11:33 +0200)]
toradex: set default dhcp distroboot scriptname

Use the same name of DHCP Distroboot script as in regular eMMC case.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: globally disable video support
Igor Opaniuk [Wed, 13 Apr 2022 09:33:26 +0000 (11:33 +0200)]
toradex: globally disable video support

As video support is very specific depending on the exact display
customisation we decided to disable video support for all out modules
by default.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: apalis-imx8x: drop support for apalis imx8x
Denys Drozdov [Wed, 13 Apr 2022 09:33:25 +0000 (11:33 +0200)]
toradex: apalis-imx8x: drop support for apalis imx8x

Drop Apalis iMX8X platform as it never left sample state and is no
longer supported.

Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoarm: dts: imx8mp: Import GPCv2 subset, HSIOMIX and USB PD
Marek Vasut [Tue, 12 Apr 2022 22:42:57 +0000 (00:42 +0200)]
arm: dts: imx8mp: Import GPCv2 subset, HSIOMIX and USB PD

Add DT bindings for a subset of GPCv2 which handles USB and PCIe PDs,
HSIOMIX PD controller and missing USB PD properties. This is required
to bring up the DWC3 USB controller up.

This is based on linux next and patches which are still pending
review, but which are likely going to be part of Linux 5.19:
b2d67d7bdf74 ("arm64: dts: imx8mp: disable usb3_phy1")
290918c72a29 ("arm64: dts: imx8mp: Add memory for USB3 glue layer to usb3 nodes")
https://www.spinics.net/lists/arm-kernel/msg958501.html

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
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>
2 years agousb: dwc3: Implement .glue_configure for i.MX8MP
Marek Vasut [Tue, 12 Apr 2022 22:42:56 +0000 (00:42 +0200)]
usb: dwc3: Implement .glue_configure for i.MX8MP

The i.MX8MP glue needs to be configured based on a couple of DT
properties, implement .glue_configure callback to parse those DT
properties and configure the glue accordingly.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agousb: dwc3: Rename .select_dr_mode to .glue_configure
Marek Vasut [Tue, 12 Apr 2022 22:42:55 +0000 (00:42 +0200)]
usb: dwc3: Rename .select_dr_mode to .glue_configure

Rename the select_dr_mode callback to glue_configure, the callback is
used for more than enforcing controller mode even on the TI chips, so
change the name to a more generic one. No functional change.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: power-domain: Add i.MX8MP HSIOMIX driver
Marek Vasut [Tue, 12 Apr 2022 22:42:54 +0000 (00:42 +0200)]
imx: power-domain: Add i.MX8MP HSIOMIX driver

Add trivial driver for i.MX8MP HSIOMIX handling. This is responsible
for enabling the GPCv2 power domains and clock for USB 3.0 and PCIe
in the correct order. Currently supported is the USB 3.0 part which
can be tested, PCIe support should be easy to add.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
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>
2 years agoimx: power-domain: Add i.MX8MP support
Marek Vasut [Tue, 12 Apr 2022 22:42:53 +0000 (00:42 +0200)]
imx: power-domain: Add i.MX8MP support

Add i.MX8MP power domain handling into the driver. This is based on the
Linux GPCv2 driver state which is soon to be in Linux next.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
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>
2 years agopower_domain: Add power_domain_get_by_name()
Marek Vasut [Tue, 12 Apr 2022 22:42:52 +0000 (00:42 +0200)]
power_domain: Add power_domain_get_by_name()

Implement power_domain_get_by_name() convenience function which parses
DT property 'power-domain-names' and looks up power domain by matching
name.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
2 years agoimx: power-domain: Get rid of SMCCC dependency
Marek Vasut [Tue, 12 Apr 2022 22:42:51 +0000 (00:42 +0200)]
imx: power-domain: Get rid of SMCCC dependency

This driver is the only SMCCC dependency in iMX8M U-Boot port. Rework
the driver based on Linux GPCv2 driver to directly control the GPCv2
block instead of using SMCCC calls. This way, U-Boot can operate the
i.MX8M power domains without depending on anything else.

This is losely based on Linux GPCv2 driver. The GPU, VPU, MIPI power
domains are not supported to save space, since they are not useful in
the bootloader. The only domains kept are ones for HSIO, PCIe, USB.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
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>
2 years agoimx: power-domain: Inline arch-imx8m/power-domain.h
Marek Vasut [Tue, 12 Apr 2022 22:42:50 +0000 (00:42 +0200)]
imx: power-domain: Inline arch-imx8m/power-domain.h

The arch/arm/include/asm/arch-imx8m/power-domain.h is not included
anywhere except in drivers/power/domain/imx8m-power-domain.c, just
inline the content and drop the header. No functional change.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
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>
2 years agoimx: power-domain: Descend into pgc subnode if present
Marek Vasut [Tue, 12 Apr 2022 22:42:49 +0000 (00:42 +0200)]
imx: power-domain: Descend into pgc subnode if present

In case the power domain node structure is gpc@303a0000/pgc/power-domain@N,
do not bind power domain driver to the 'pgc' node, but rather descend into
it and only bind power domain drivers to power-domain@N subnodes. This way
we do not waste one useless driver instance associated with 'pgc' node.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
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>
2 years agopower-domain: Return 0 if ops unimplemented and remove empty functions
Marek Vasut [Tue, 12 Apr 2022 22:42:48 +0000 (00:42 +0200)]
power-domain: Return 0 if ops unimplemented and remove empty functions

In case the ops is not implemented, return 0 in the core right away.
This is better than having multiple copies of functions which just
return 0 in each power domain driver. Drop all those empty functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
2 years agoimx8ulp: clock: Fix lcd clock algo
Loic Poulain [Thu, 31 Mar 2022 10:39:37 +0000 (12:39 +0200)]
imx8ulp: clock: Fix lcd clock algo

The div loop uses reassign and reuse parent_rate, which causes
the parent rate reference to be wrong after the first loop, the
resulting clock becomes incorrect for div != 1.

Fixes: 43e68a10eca4 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: turris: Rename atsha204a@64 DT node to crypto@64
Pali Rohár [Fri, 8 Apr 2022 14:30:15 +0000 (16:30 +0200)]
board: turris: Rename atsha204a@64 DT node to crypto@64

DT node name should be generic, therefore rename atsha204a@64 to crypto@64.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoboard: turris: Allow to specify first eth idx of first MAC address
Pali Rohár [Fri, 8 Apr 2022 14:30:14 +0000 (16:30 +0200)]
board: turris: Allow to specify first eth idx of first MAC address

Turris Omnia uses first MAC address from OTP for second ethernet interface.
Second MAC address for third interface and third MAC address for first
interface.

Other Turris routers do not have this rotate by one mapping. So add
function parameter for specifying id of the first ethernet interface.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoboard: turris: Do not cache Atsha device in BSS
Pali Rohár [Fri, 8 Apr 2022 14:30:13 +0000 (16:30 +0200)]
board: turris: Do not cache Atsha device in BSS

Atsha device is used prior relocation and at this early stage BSS does not
have to be ready yet. So do not cache Atsha device in BSS.

Fixes support for other Turris routers.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoboard: turris: Move Turris Atsha OTP code to separate file
Pali Rohár [Fri, 8 Apr 2022 14:30:12 +0000 (16:30 +0200)]
board: turris: Move Turris Atsha OTP code to separate file

OTP code is not Atsha generic but also it is not Omnia specific. It is
common for all Turris routers which use Atsha cryptochip for storing OTP.
So move this common Turris specific Atsha OTP code from Turris Omnia into
separate file. It will be used also by other Turris routers.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoarm: mvebu: a37xx: Add support for writing Security OTP values
Pali Rohár [Thu, 7 Apr 2022 09:32:10 +0000 (11:32 +0200)]
arm: mvebu: a37xx: Add support for writing Security OTP values

Implement write support for Security OTP values via mailbox API commands
MBOX_CMD_OTP_WRITE_32B and MBOX_CMD_OTP_WRITE.

Write support for North and South Bridge OTPs are not implemented as these
OTPs are already burned in factory with some data.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoarm: mvebu: Enable CONFIG_SPL_SYS_NO_VECTOR_TABLE for 32-bit mvebu
Pali Rohár [Wed, 6 Apr 2022 14:20:20 +0000 (16:20 +0200)]
arm: mvebu: Enable CONFIG_SPL_SYS_NO_VECTOR_TABLE for 32-bit mvebu

U-Boot SPL is on 32-bit mvebu executed by the BootROM. And BootROM expects
that U-Boot SPL returns execution back to the BootROM. Vectors during
execution of U-Boot SPL should not be changed as BootROM does not expect it
and uses its own vectors. So do not overwrite vectors in SPL build.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoarm: Do not compile vector table when SYS_NO_VECTOR_TABLE is enabled
Pali Rohár [Wed, 6 Apr 2022 14:20:19 +0000 (16:20 +0200)]
arm: Do not compile vector table when SYS_NO_VECTOR_TABLE is enabled

Vector table is not used when SYS_NO_VECTOR_TABLE is enabled.
So do not compile it and reduce image size.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoarm: Introduce new CONFIG_SPL_SYS_NO_VECTOR_TABLE option
Pali Rohár [Wed, 6 Apr 2022 14:20:18 +0000 (16:20 +0200)]
arm: Introduce new CONFIG_SPL_SYS_NO_VECTOR_TABLE option

Move OMAP4 specific option for disabling overwriting vector table into
config option CONFIG_SPL_SYS_NO_VECTOR_TABLE.

Signed-off-by: Pali Rohár <pali@kernel.org>