platform/kernel/u-boot.git
3 years agokm/scripts: fix saveenv command syntax
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:20:13 +0000 (14:20 +0000)]
km/scripts: fix saveenv command syntax

This is most probably a typo, and in older u-uboot versions is same as
'saveenv', in the newer uboot versions there is a separate 'save' command
that is different from 'saveenv'.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm: ls102xa: add missing define for PRAM regions
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:19:08 +0000 (14:19 +0000)]
km: ls102xa: add missing define for PRAM regions

In our designs we reserve PRAM area at the end of the RAM, and in order
this area to be visible and taken into account by the u-boot memory mgmt
CONFIG_PRAM has to be defined.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm/ls102xa: add support for u-boot POST memory test
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:17:34 +0000 (14:17 +0000)]
km/ls102xa: add support for u-boot POST memory test

From production view this is standard test executed during production on
all linux based foxmc cards.
On CENT2 HW defined memory region is zero means that some DDR accesses are
done by memory_post_dataline and memory_post_addrline but pattern tests
are skipped that's why mem_regions is fast there.

On ls102x for the complete DDR region of 1GiB memory_regions_post_test
takes approx. 4min and this is too much for production, so this patch
defines only 1MiB region as compromise.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard/km: add support for expu1 design based on nxp
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:16:28 +0000 (14:16 +0000)]
board/km: add support for expu1 design based on nxp

The EXPU1 design is a new 40G capable ethernet service unit card for
Hitachi-Powergrids wired-com product lines.

The base SoC is same as for already added SELI8 card, consequently the
already added u-boot support for SELI8 is reused.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachi-powergrids.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
[Fixed new line error at EOF]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t102xrdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:07:01 +0000 (13:37 +0530)]
board: freescale: t102xrdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for t102xrdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: p2041rdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:07:00 +0000 (13:37 +0530)]
board: freescale: p2041rdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for p2041rdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: p1_p2_rdb_pc: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:06:59 +0000 (13:36 +0530)]
board: freescale: p1_p2_rdb_pc: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for p1_p2_rdb_pc board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t4rdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:06:58 +0000 (13:36 +0530)]
board: freescale: t4rdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for t4rdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: dts: ls1021a.dtsi: Fix invalid reg on gpio nodes
Lasse Klok Mikkelsen [Tue, 8 Jun 2021 06:39:12 +0000 (08:39 +0200)]
arm: dts: ls1021a.dtsi: Fix invalid reg on gpio nodes

Address and size cells on SOC are set to 1. But gpio nodes are specified
with 2 cells. This fixes the gpio nodes to correct cells.

Signed-off-by: Lasse Klok Mikkelsen <lkmi@prevas.dk>
Reviewed-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: tsec: add option to set device max-speed via dts
Aleksandar Gerasimovski [Fri, 4 Jun 2021 13:40:58 +0000 (13:40 +0000)]
net: tsec: add option to set device max-speed via dts

Current tsec adapter sets adapter gigabit capabilities by default, and in
reality this must not always be the case.
It is possible that tsec adapter is used for 100Mbps connection, and in
this case setting 1000Mbps capabilities can lead to some side effects such
longer autoneg process.

In our ls102x designs this problem leads to long autoneg times (> 4 sec)
in case board rgmii link is 100Mbps capable only.
Limiting the rgmii link capabilities provides faster and smoother
link establishment.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokeymile: common: fix hexadecimal env variable format
Aleksandar Gerasimovski [Fri, 4 Jun 2021 09:25:00 +0000 (09:25 +0000)]
keymile: common: fix hexadecimal env variable format

Commit df86d32 breaks linux kernel and product application boot.

Linux kernel and our product application scripts are expecting 0x prefix
for hexadecimal values, while env_set_hex writes them without a prefix.

This patch partially revert env_set_hex usage for affected env variables.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: seli8: set envsize to 0x4000
Aleksandar Gerasimovski [Fri, 4 Jun 2021 09:17:56 +0000 (09:17 +0000)]
configs: seli8: set envsize to 0x4000

During the mainlining of the board this was by mistake set to sector size.
Our user space env scripts are expecting envsize of 0x4000, and setting
this differently will break our cross-platform compatibility.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: layerscape: drop CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
Yangbo Lu [Thu, 3 Jun 2021 02:51:19 +0000 (10:51 +0800)]
armv8: layerscape: drop CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33

Drop CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33. CONFIG_FSL_ESDHC_VS33_NOT_SUPPORT
is used instead.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Michael Walle <michael@walle.cc> [for kontron-sl28]
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agommc: fsl_esdhc_imx: drop CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
Yangbo Lu [Thu, 3 Jun 2021 02:51:18 +0000 (10:51 +0800)]
mmc: fsl_esdhc_imx: drop CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33

There is no i.MX board using such option. Drop it.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agommc: fsl_esdhc: convert to CONFIG_FSL_ESDHC_VS33_NOT_SUPPORT
Yangbo Lu [Thu, 3 Jun 2021 02:51:17 +0000 (10:51 +0800)]
mmc: fsl_esdhc: convert to CONFIG_FSL_ESDHC_VS33_NOT_SUPPORT

For eSDHC, power supply is through peripheral circuit.
Some eSDHC versions have value 0 of the bit but that
does not reflect the truth. 3.3V is common for SD/MMC,
and is supported for all boards with eSDHC in current
u-boot. So, make 3.3V is supported in default in code.
CONFIG_FSL_ESDHC_VS33_NOT_SUPPORT can be enabled if
future board does not support 3.3V.

This is also a fix-up for one previous patch, which converted
to use IS_ENABLED() for CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
that is not a Kconfig option.

Fixes: 52faec31827e ("mmc: fsl_esdhc: replace most #ifdefs by IS_ENABLED()")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: p2041rdb: use correct EEPROM address length
Matt Merhar [Sun, 30 May 2021 00:16:17 +0000 (00:16 +0000)]
board: freescale: p2041rdb: use correct EEPROM address length

These boards, according to the schematic and per the board I own, use an
M24256-BWDW6TP I2C EEPROM which requires two address bytes.

This fixes the 'mac' command which is used to program, among other
things, the MAC addresses for the ethernet interfaces on the board.

Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls2088aqds: fix synchronous exception
Biwen Li [Fri, 21 May 2021 07:15:06 +0000 (15:15 +0800)]
configs: ls2088aqds: fix synchronous exception

IFC NOR flash base address of ls2088a is 0x580000000,
and offset of env crc is 0x500000, so fix the macro
CONFIG_ENV_ADDR to fix synchronous exception(access illegal address)

Fixes: 59071804c1 ("configs: ls2080a: Correct ENV_ADDR value")
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1088a: Enable CONFIG_SYS_RELOC_ENV_ADDR
Kuldeep Singh [Wed, 19 May 2021 11:10:12 +0000 (16:40 +0530)]
configs: ls1088a: Enable CONFIG_SYS_RELOC_ENV_ADDR

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: dts: lx2162aqds: support eMMC HS400 mode on esdhc1
Yangbo Lu [Fri, 14 May 2021 02:33:57 +0000 (10:33 +0800)]
arm: dts: lx2162aqds: support eMMC HS400 mode on esdhc1

Add properties related to eMMC HS400 mode for esdhc1.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopci: layerscape-ep: Add check of the PCIe controller enablement
Hou Zhiqiang [Thu, 13 May 2021 06:54:32 +0000 (14:54 +0800)]
pci: layerscape-ep: Add check of the PCIe controller enablement

Stop to initialize the PCIe controller if it's disabled by RCW.

Fixes: 118e58e26eba ("pci: layerscape: Split the EP and RC driver")
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: ls1012a: Pass PPFE firmware to Linux through FDT
Chaitanya Sakinam [Fri, 7 May 2021 04:22:05 +0000 (12:22 +0800)]
armv8: ls1012a: Pass PPFE firmware to Linux through FDT

Read Linux PPFE firmware from flash partition and pass it to Linux through
FDT entry. So that we can avoid placing PPFE firmware in Linux rootfs.
(FDT may increase at max by 64KB)

Signed-off-by: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
Signed-off-by: Anji J <anji.jagarlmudi@nxp.com>
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: layerscape: enable eMMC HS400 workarounds for LX2160A/LX2162A
Yangbo Lu [Tue, 27 Apr 2021 08:42:11 +0000 (16:42 +0800)]
armv8: layerscape: enable eMMC HS400 workarounds for LX2160A/LX2162A

Enable eMMC HS400 workarounds for LX2160A/LX2162A.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: layerscape: add PSCI support for cpu release
Jiafei Pan [Wed, 21 Apr 2021 04:12:49 +0000 (12:12 +0800)]
armv8: layerscape: add PSCI support for cpu release

For cpu release command, check whether PSCI is supported firstly,
if supported, use PSCI to kick off secondary cores, otherwise still
use spin table.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
[Fixed checkpatch alignment CHECKs]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: vid.c: Add check for return value of adjust_vdd()
Priyanka Singh [Mon, 19 Apr 2021 05:45:04 +0000 (11:15 +0530)]
board: freescale: vid.c: Add check for return value of adjust_vdd()

Add check for return value of adjust_vdd()

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Priyanka Singh <priyanka.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agols1012a: net: pfe: remove pfe stop from bootcmd
Mian Yousaf Kaukab [Wed, 14 Apr 2021 10:33:58 +0000 (12:33 +0200)]
ls1012a: net: pfe: remove pfe stop from bootcmd

When using bootefi to boot a EFI binary, u-boot is supposed to
provide networking service for EFI application. Currently, 'pfe stop'
command is called from bootcmd before running bootefi. As a result
network stops working for EFI applications and console is flooded with
"Rx pkt not on expected port" messages.

Implement board_quiesce_devices() for ls1012a boards and call
pfe_command_stop() from it instead of calling 'pfe stop' from
*_bootcmd and bootcmd.

Tested-by: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[Fixed checkpatch space error]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: sl28: fix RGMII clock and voltage
Michael Walle [Tue, 13 Apr 2021 15:54:17 +0000 (17:54 +0200)]
board: sl28: fix RGMII clock and voltage

It was noticed that the clock isn't continuously enabled when there is
no link. This is because the 125MHz clock is derived from the internal
PLL which seems to go into some kind of power-down mode every once in a
while. The LS1028A expects a contiuous clock. Thus enable the PLL all
the time.

Also, the RGMII pad voltage is wrong, it was configured to 2.5V (that is
the VDDH regulator). The correct voltage is 1.8V, i.e. the VDDIO
regulator.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1046afrwy: Add secure boot config
Manish Tomar [Tue, 13 Apr 2021 07:08:34 +0000 (12:38 +0530)]
configs: ls1046afrwy: Add secure boot config

Add required CONFIG_NXP_ESBC for ls1046afrwy to enable ESBC Chain of Trust.

Signed-off-by: Manish Tomar <manish.tomar@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 15 Jun 2021 12:23:04 +0000 (08:23 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Turris: Fix bootcmd_rescue (Pali)

3 years agoarm: mvebu: turris_{omnia, mox}: ensure running bootcmd_rescue always works
Pali Rohár [Mon, 14 Jun 2021 14:45:58 +0000 (16:45 +0200)]
arm: mvebu: turris_{omnia, mox}: ensure running bootcmd_rescue always works

One of the points of putting the rescue boot command into default
environment is that user can invoke it without physical access to the
board (without having to press the factory reset button), by running
  run bootcmd_rescue
in U-Boot's console.

Therefore we have to ensure that bootcmd_rescue is always set to default
value, regardless of whether the factory reset button was pressed.
Otherwise the variable will be empty for example after upgrade from
previous U-Boot.

Fixes: ec3784d62646 ("arm: mvebu: turris_mox: add support for board rescue mode")
Fixes: 176c3e7760a2 ("arm: mvebu: turris_omnia: support invoking rescue boot from console")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge tag 'xilinx-for-v2021.07-rc5' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 11 Jun 2021 12:29:34 +0000 (08:29 -0400)]
Merge tag 'xilinx-for-v2021.07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2021.07-rc5

zynqmp:
- Fix ANALOG_BUS value after powerup
- Disable EFI_CAPSULE_ON_DISK_EARLY

zynqmp-gqspi:
- Fix write issue

3 years agoarm64: zynqmp: Disable EFI_CAPSULE_ON_DISK_EARLY
Michal Simek [Thu, 10 Jun 2021 12:33:55 +0000 (14:33 +0200)]
arm64: zynqmp: Disable EFI_CAPSULE_ON_DISK_EARLY

Sata/scsi and usb based devices are not started at this stage that's why
disks are not found and early update can't happen.
It is because of deficiency in the UEFI implementation which is not able to
deal with block devices which are added or removed after initialization.

EFI capsule on disk early feature needs to be fixed first to be able to
enable this feature properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agospi: zynqmp_gqspi: Fix write issue
Ashok Reddy Soma [Tue, 25 May 2021 12:36:27 +0000 (06:36 -0600)]
spi: zynqmp_gqspi: Fix write issue

Enable manual start in zynqmp_qspi_fill_gen_fifo().
Also enable GQSPI_IXR_GFNFULL_MASK and check for it instead of
GQSPI_IXR_GFEMTY_MASK.

Add dummy write to genfifo register in chipselect.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoarm64: zynqmp: Writing correct value to ANALOG_BUS
Adrian Fiergolski [Tue, 8 Jun 2021 10:37:23 +0000 (12:37 +0200)]
arm64: zynqmp: Writing correct value to ANALOG_BUS

The default register configuration after powerup for PSSYSMON_ANALOG_BUS
register is incorrect. Hence, fix this in SPL by writing correct fixed
value. It follows UG1085 chapter 'PS SYSMON Analog_Bus' and reflects commit
sw_apps:zynq ("056ca65d44549ce27f716d423e8dfdefeee7440c")
in Xilinx:embeddedsw[1].

[1] https://github.com/Xilinx/embeddedsw

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 10 Jun 2021 17:27:14 +0000 (13:27 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: Turris MOX misc updates (cmds, rescue mode, LED's etc)
  (Marek)
- mvebu: correct Armada 8K addresses (Heinrich)

3 years agoarm64: mvebu: correct Armada 8K addresses
Heinrich Schuchardt [Tue, 8 Jun 2021 10:00:35 +0000 (12:00 +0200)]
arm64: mvebu: correct Armada 8K addresses

0x04000000- 0x06000000 is reserved memory. We cannot load to anything here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: enable options for Turris network boot
Marek Behún [Mon, 7 Jun 2021 14:34:51 +0000 (16:34 +0200)]
arm: mvebu: turris_mox: enable options for Turris network boot

Enable configuration options to support Turris network boot. This
includes FIT support and some crypto commands.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: dts: turris_mox: add nodes for SPI NOR partitions
Marek Behún [Mon, 7 Jun 2021 14:34:50 +0000 (16:34 +0200)]
arm: mvebu: dts: turris_mox: add nodes for SPI NOR partitions

Add nodes for SPI NOR partitions to the device tree of Turris MOX, as
are in Linux' device tree.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: configs: turris_mox: add fdtfile default env variable
Marek Behún [Mon, 7 Jun 2021 14:34:49 +0000 (16:34 +0200)]
arm: mvebu: configs: turris_mox: add fdtfile default env variable

Add default fdtfile environment variable with value
marvell/armada-3720-turris-mox.dtb.

This can be useful for some boot scenarios.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: start blinking PHY LEDs when entering rescue
Marek Behún [Mon, 7 Jun 2021 14:34:48 +0000 (16:34 +0200)]
arm: mvebu: turris_mox: start blinking PHY LEDs when entering rescue

Configure blinking on ethernet PHY LEDs on the MOX A board when entering
rescue mode via reset button.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: add support for board rescue mode
Marek Behún [Mon, 7 Jun 2021 14:34:47 +0000 (16:34 +0200)]
arm: mvebu: turris_mox: add support for board rescue mode

Add necessary config options and board code to support board factory
reset / rescue mode on Turris MOX.

In order to also support invoking rescue mode from U-Boot console,
without having to press the factory reset button, put the rescue command
into `bootcmd_rescue` default environment variable. When factory reset
button is pressed, invoke rescue mode via distroboot by setting
`boot_targets` to `rescue`.

Rescue boot from console can be invoked by running
  run bootcmd_rescue

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: dts: turris_mox: add button and LED nodes
Marek Behún [Mon, 7 Jun 2021 14:34:46 +0000 (16:34 +0200)]
arm: mvebu: dts: turris_mox: add button and LED nodes

Add nodes for indicator LED and reset button so that board code can
implement board factory reset mechanism.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agofs/squashfs: fix reading of fragmented files
Joao Marcos Costa [Mon, 17 May 2021 21:20:38 +0000 (18:20 -0300)]
fs/squashfs: fix reading of fragmented files

The fragmented files were not correctly read because of two issues:

- The squashfs_file_info struct has a field named 'comp', which tells if
the file's fragment is compressed or not. This field was always set to
'true' in sqfs_get_regfile_info and sqfs_get_lregfile_info. It should
actually take sqfs_frag_lookup's return value. This patch addresses
these two assignments.

- In sqfs_read, the fragments (compressed or not) were copied to the
output buffer through a for loop which was reading data at the wrong
offset. Replace these loops by equivalent calls to memcpy, with the
right parameters.

I tested this patch by comparing the MD5 checksum of a few fragmented
files with the respective md5sum output in sandbox, considering both
compressed and uncompressed fragments.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Richard Genoud <richard.genoud@posteo.net>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Wed, 9 Jun 2021 12:20:36 +0000 (08:20 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- dwc2 and cdns3 fixes

3 years agoMerge tag 'efi-2021-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 9 Jun 2021 12:20:24 +0000 (08:20 -0400)]
Merge tag 'efi-2021-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc5

Documentation:

* pinmux and ums man-page

Bug fixes:

* Consider that partition numbers as hexadecimal.
* Avoid a possible NULL dereference in efi_capsule_delete_file().

3 years agoefi_loader: fix Sphinx warning
Heinrich Schuchardt [Tue, 8 Jun 2021 22:21:24 +0000 (00:21 +0200)]
efi_loader: fix Sphinx warning

Brackets '[' need to be escaped to avoid a build warning

    lib/efi_loader/efi_image_loader.c:223:
    WARNING: Inline strong start-string without end-string.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Masahisa Kojima <masahisa.kojima@linaro.org>
3 years agousb: dwc2: Avoid delay when initializing USB peripheral by dwc2
João Loureiro [Wed, 17 Mar 2021 15:52:21 +0000 (16:52 +0100)]
usb: dwc2: Avoid delay when initializing USB peripheral by dwc2

When `usb start` is called on the terminal, the dwc2 driver will try
to start every USB device as host first, even if it is explicitly
configured as peripheral in the device tree (dr_mode = "peripheral").

So to avoid an unwanted 15 seconds delay when initializing the usb
(one second per channel = 1s x 15), this patch adds a check to the
initialization, and will skip host initialization of the device is
explicitly set as peripheral. The checking is already done similarly
in the `drivers/usb/gadget/dwc2_udc_otg.c` driver.

Signed-off-by: João Loureiro <joaofl@gmail.com>
3 years agoefi_loader: efi_capsule_delete_file() NULL dereference
Heinrich Schuchardt [Wed, 2 Jun 2021 17:28:22 +0000 (19:28 +0200)]
efi_loader: efi_capsule_delete_file() NULL dereference

If opening a file fails, the file handle pointer is not valid and must not
be dereferenced.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: partition numbers are hexadecimal
Heinrich Schuchardt [Tue, 25 May 2021 16:00:13 +0000 (18:00 +0200)]
efi_loader: partition numbers are hexadecimal

If we want to address partition 15 of virtio block device 11, we have to
write:

virtio b:f

When calling sprintf() we must use %x for the device and partition numbers.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: usage: man-page for ums command
Patrick Delaunay [Fri, 4 Jun 2021 16:51:47 +0000 (18:51 +0200)]
doc: usage: man-page for ums command

Provide a man-page for the ums command - USB Mass Storage.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agocmd: Add dependency for ums command
Patrick Delaunay [Fri, 4 Jun 2021 16:51:46 +0000 (18:51 +0200)]
cmd: Add dependency for ums command

Add the missing dependency for the command ums:
- CONFIG_BLK: call of blk_* functions in usb_mass_storage.c
- CONFIG_USB_GADGET: required to select CONFIG_USB_FUNCTION_MASS_STORAGE

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: usage: man-page for pinmux command
Patrick Delaunay [Wed, 2 Jun 2021 11:56:45 +0000 (13:56 +0200)]
doc: usage: man-page for pinmux command

Provide a man-page for the pinmux command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agodoc: usage: reorder commands in index.rst
Patrick Delaunay [Wed, 2 Jun 2021 08:11:19 +0000 (10:11 +0200)]
doc: usage: reorder commands in index.rst

Reorder alphabetically the command in the index of usage
in U-Boot documentation.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Tue, 8 Jun 2021 21:46:49 +0000 (17:46 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sh

- More pinctrl updates

3 years agousb: cdns3: cdns3-ti: Fix clk_get_by_name() to get the correct name
Kishon Vijay Abraham I [Tue, 1 Jun 2021 10:56:16 +0000 (16:26 +0530)]
usb: cdns3: cdns3-ti: Fix clk_get_by_name() to get the correct name

Kernel device tree got updated to use clock name as "ref" instead of
"usb2_refclk". Fix cdns3-ti.c to use the correct name.

Fixes: 70e167495ab2 ("arm: dts: k3-j721e: Sync Linux v5.11-rc6 dts into U-Boot")
Fixes: 6239cc8c4e84 ("arm: dts: k3-j7200: Sync Linux v5.11-rc6 dts into U-Boot")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agopinctrl: renesas: Synchronize R-Car Gen2/Gen3 tables with Linux 5.12
Marek Vasut [Mon, 26 Apr 2021 20:04:11 +0000 (22:04 +0200)]
pinctrl: renesas: Synchronize R-Car Gen2/Gen3 tables with Linux 5.12

Synchronize R-Car Gen2/Gen3 pinctrl tables with Linux 5.12,
commit 9f4ad9e425a1 ("Linux 5.12") . This is a rather large
commit, since the macros in sh-pfc.h also got updated, so
all the PFC tables must be updated in lockstep.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoPrepare v2021.07-rc4
Tom Rini [Mon, 7 Jun 2021 13:26:39 +0000 (09:26 -0400)]
Prepare v2021.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Jun 2021 12:09:35 +0000 (08:09 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'u-boot-rockchip-20210606' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 7 Jun 2021 11:22:14 +0000 (07:22 -0400)]
Merge tag 'u-boot-rockchip-20210606' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

3 years agoMerge tag 'dm-pull-6jun21' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 6 Jun 2021 17:00:23 +0000 (13:00 -0400)]
Merge tag 'dm-pull-6jun21' of https://source.denx.de/u-boot/custodians/u-boot-dm

Minor fixes for sandbox and handling of dm-ranges

3 years agoMerge tag 'video-for-2021-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sat, 5 Jun 2021 15:17:55 +0000 (11:17 -0400)]
Merge tag 'video-for-2021-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-video

 - disable legacy video for brxre1, mx28evk, pico-imx6ul,
   pxm2 and rut boards after DM_VIDEO conversion deadline

3 years agotest: add dm_test_read_resource
Patrick Delaunay [Fri, 21 May 2021 10:25:00 +0000 (12:25 +0200)]
test: add dm_test_read_resource

Add a test of dev_read_resource with translation or without translation

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agonet: luton: remove address translation after ofnode_read_resource
Patrick Delaunay [Fri, 21 May 2021 10:24:59 +0000 (12:24 +0200)]
net: luton: remove address translation after ofnode_read_resource

Removed call of ofnode_translate_address() after ofnode_read_resource
in luton_switch.c:luton_probe(); it is unnecessary since
the commit feb7ac457c20 ("dm: core: Add address translation in
fdt_get_resource").

Fixes: feb7ac457c20 ("dm: core: Add address translation in fdt_get_resource")
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reported-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agopwm: cros_ec: Rename "priv_auto_alloc_size" to "priv_auto"
Alper Nebi Yasak [Fri, 14 May 2021 13:48:40 +0000 (16:48 +0300)]
pwm: cros_ec: Rename "priv_auto_alloc_size" to "priv_auto"

With commit 41575d8e4c33 ("dm: treewide: Rename auto_alloc_size members
to be shorter") "priv_auto_alloc_size" was renamed to "priv_auto". This
driver was sent to the mailing list before that change, merged after it,
and still has the old form. Apply the rename here as well.

Fixes: 1b9ee2882e6b ("pwm: Add a driver for Chrome OS EC PWM")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: correct determination of the text base
Heinrich Schuchardt [Sat, 15 May 2021 17:29:13 +0000 (19:29 +0200)]
sandbox: correct determination of the text base

os_find_text_base() assumes that first line of /proc/self/maps holds
information about the text. Hence we must call the function before calling
os_malloc() which calls mmap(0x10000000,).

Failure to do so has led to incorrect values for pc_reloc when an
exception was reported

    => exception undefined

    Illegal instruction
    pc = 0x5628d82e9d3c, pc_reloc = 0x5628c82e9d3c

as well as incorrect output of the bdinfo command

    => bdinfo
    relocaddr   = 0x0000000007858000
    reloc off   = 0x0000000010000000

Fixes: b308d9fd18fa ("sandbox: Avoid using malloc() for system state")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoof: addr: Remove call to dev_count_cells() in of_get_address()
Bin Meng [Fri, 30 Apr 2021 13:16:59 +0000 (21:16 +0800)]
of: addr: Remove call to dev_count_cells() in of_get_address()

In of_get_address(), there is:

  dev_count_cells(dev, &na, &ns);

followed by:

  bus->count_cells(dev, &na, &ns);

but no codes in between use na/ns, hence the first call is useless.
By dropping the first call, dev_count_cells() is now useless too.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoof: addr: Translate 'dma-ranges' for parent nodes missing 'dma-ranges'
Bin Meng [Fri, 30 Apr 2021 13:16:58 +0000 (21:16 +0800)]
of: addr: Translate 'dma-ranges' for parent nodes missing 'dma-ranges'

'dma-ranges' frequently exists without parent nodes having 'dma-ranges'.
While this is an error for 'ranges', this is fine because DMA capable
devices always have a translatable DMA address. Also, with no
'dma-ranges' at all, the assumption is that DMA addresses are 1:1 with
no restrictions unless perhaps the device itself has implicit
restrictions.

This keeps in sync with Linux kernel commit:

  81db12ee15cb: of/address: Translate 'dma-ranges' for parent nodes missing 'dma-ranges'

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopico-imx6ul: disable video after DM_VIDEO conversion deadline
Anatolij Gustschin [Mon, 24 May 2021 15:31:26 +0000 (17:31 +0200)]
pico-imx6ul: disable video after DM_VIDEO conversion deadline

These boards were not converted to DM_VIDEO before deadline,
so disable video support for now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Richard Hu <richard.hu@technexion.com>
Cc: Fabio Estevam <festevam@gmail.com>
3 years agobrxre1: disable video after DM_VIDEO conversion deadline
Anatolij Gustschin [Mon, 24 May 2021 15:19:56 +0000 (17:19 +0200)]
brxre1: disable video after DM_VIDEO conversion deadline

The board was not converted to DM_VIDEO before deadline, so disable
video support for now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
3 years agomx28evk: disable video after DM_VIDEO conversion deadline
Anatolij Gustschin [Mon, 24 May 2021 14:45:29 +0000 (16:45 +0200)]
mx28evk: disable video after DM_VIDEO conversion deadline

The board was not converted to DM_VIDEO before deadline, so disable
video support for now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
3 years agosiemens: pxm2: disable video after DM_VIDEO conversion deadline
Anatolij Gustschin [Mon, 24 May 2021 14:35:57 +0000 (16:35 +0200)]
siemens: pxm2: disable video after DM_VIDEO conversion deadline

The board was not converted to DM_VIDEO before deadline, so disable
video support for now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agosiemens: rut: disable video after DM_VIDEO conversion deadline
Anatolij Gustschin [Mon, 24 May 2021 14:26:51 +0000 (16:26 +0200)]
siemens: rut: disable video after DM_VIDEO conversion deadline

The board was not converted to DM_VIDEO before deadline, so disable
video support for now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 4 Jun 2021 13:34:21 +0000 (09:34 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: a37xx: PCI related enhancements and fixes (Pali)
- mvebu: turris_omnia: Board specific updates, e.g. rescue
  boot cmd etc (Marek)

3 years agoarm: mvebu: turris_omnia: support invoking rescue boot from console
Marek Behún [Fri, 28 May 2021 08:00:49 +0000 (10:00 +0200)]
arm: mvebu: turris_omnia: support invoking rescue boot from console

Make it possible to invoke rescue boot from U-Boot console, without
having to press the factory reset button. This is needed when accessing
the device remotely, for example.

Achieve this by putting rescue command into `bootcmd_rescue` default
environment variable and setting some distroboot environment variables
to their default values when the factory button is pressed.

Rescue boot from console can be invoked by running
  run bootcmd_rescue

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_omnia: update rescue mode boot command
Marek Behún [Fri, 28 May 2021 08:00:48 +0000 (10:00 +0200)]
arm: mvebu: turris_omnia: update rescue mode boot command

Update rescue mode boot command on Turris Omnia. We are compressing the
image with lzma now.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Fix configuring PCIe resources
Pali Rohár [Wed, 26 May 2021 15:59:40 +0000 (17:59 +0200)]
arm: a37xx: pci: Fix configuring PCIe resources

The `ranges` DT property of the PCIe node is currently ignored by
Aardvark driver - all entries are used as transparent PCIe MEM, despite
some of them being defined for IO in DT.

This is because the driver does not setup PCIe outbound windows and thus
a default configuration is used.

This can cause an external abort on CPU when a device driver tries to
access non-MEM space.

Setup the PCIe windows according to the `ranges` property for all
non-MEM resources (currently only IO) and also non-transparent MEM
resources.

Because Linux expects that bootloader does not setup Aardvark PCIe
windows, disable them before booting Linux.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Increase PCIe MEM size from 16 MiB to 127 MiB
Pali Rohár [Wed, 26 May 2021 15:59:39 +0000 (17:59 +0200)]
arm: a37xx: pci: Increase PCIe MEM size from 16 MiB to 127 MiB

For some configurations with more PCIe cards and PCIe bridges, 16 MiB of
PCIe MEM space may not be enough. Since TF-A already allocates a 128 MiB
CPU window for PCIe, and since IO port space is only 64 KiB in total,
use all the remaining space (64 + 32 + 16 + 8 + 4 + 2 + 1 = 127 MiB) for
PCIe MEM.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Fix a3700_fdt_fix_pcie_regions() function
Pali Rohár [Wed, 26 May 2021 15:59:38 +0000 (17:59 +0200)]
arm: a37xx: pci: Fix a3700_fdt_fix_pcie_regions() function

Current version of this function uses a lot of incorrect assumptions about
the `ranges` DT property:

 * parent(#address-cells) == 2
 * #size-cells == 2
 * number of entries == 2
 * address size of first entry == 0x1000000
 * second child address entry == base + 0x1000000

Trying to increase PCIe MEM space to more than 16 MiB leads to an overlap
with PCIe IO space, and trying to define additional MEM space (as a third
entry in the `ranges` DT property) causes U-Boot to crash when booting the
kernel.

  ## Flattened Device Tree blob at 04f00000
     Booting using the fdt blob at 0x4f00000
     Loading Device Tree to 000000001fb01000, end 000000001fb08f12 ... OK
  ERROR: board-specific fdt fixup failed: <unknown error>
   - must RESET the board to recover.

Fix a3700_fdt_fix_pcie_regions() to properly parse and update all addresses
in the `ranges` property according to
https://elinux.org/Device_Tree_Usage#PCI_Address_Translation

Now it is possible to increase PCIe MEM space from 16 MiB to maximal value
of 127 MiB.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Fixes: cb2ddb291ee6 ("arm64: mvebu: a37xx: add device-tree fixer for PCIe regions")
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Find PCIe controller node by compatible instead of path
Pali Rohár [Wed, 26 May 2021 15:59:37 +0000 (17:59 +0200)]
arm: a37xx: pci: Find PCIe controller node by compatible instead of path

Find PCIe DT node by compatible string instead of retrieving it by using
hardcoded DT path.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Fix DT compatible string to Linux' DT compatible
Pali Rohár [Wed, 26 May 2021 15:59:36 +0000 (17:59 +0200)]
arm: a37xx: pci: Fix DT compatible string to Linux' DT compatible

Change DT compatible string for A3700 PCIe from 'marvell,armada-37xx-pcie'
to 'marvell,armada-3700-pcie' to make U-Boot A3700 PCIe DT node compatible
with Linux' DT node.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Disable bus mastering when unloading driver
Pali Rohár [Wed, 26 May 2021 15:59:35 +0000 (17:59 +0200)]
arm: a37xx: pci: Disable bus mastering when unloading driver

Disable Root Bridge I/O space, memory space and bus mastering in Aardvark's
remove method, which is called before booting Linux kernel.

This ensures that PCIe device which was initialized and used by U-Boot
cannot do new DMA transfers until Linux initializes PCI subsystem and loads
appropriate drivers for the device.

During initialization of PCI subsystem Linux in fact disables this bus
mastering on Root Bridge (and later enables it when driver is loaded and
configured), but there is a possibility of a small window after U-Boot
boots Linux when bus mastering is enabled, which is not correct.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Don't put link into LTSSM Recovery state during probe
Pali Rohár [Wed, 26 May 2021 15:59:34 +0000 (17:59 +0200)]
arm: a37xx: pci: Don't put link into LTSSM Recovery state during probe

During our debugging of the Aardvark driver in Linux we have discovered
that the PCIE_CORE_LINK_CTRL_STAT_REG register in fact controls standard
PCIe Link Control Register for PCIe Root Bridge. This led us to discover
that the name of the PCIE_CORE_LINK_TRAINING macro and the corresponding
comment by this macro's usage is misleading; this bit in fact controls
Retrain Link, which, according to PCIe base spec is defined as:

  A write of 1b to this bit initiates Link retraining by directing the
  Physical Layer LTSSM to the Recovery state. If the LTSSM is already in
  Recovery or Configuration, re-entering Recovery is permitted but not
  required.

Entering Recovery state is normally done from LTSSM L0, L0s and L1 states.
But since the pci-aardvark.c driver enables Link Training just a few lines
above, the controller is not in L0 ready state yet. So setting aardvark bit
PCIE_CORE_LINK_TRAINING does not actually enter Recovery state at this
place.

Moreover, trying to enter LTSSM Recovery state without other configuration
is causing issues for some cards (e.g. Atheros AR9xxx and QCA9xxx). Since
Recovery state is not entered, these issues are not triggered.

Remove code which tries to enter LTSSM Recovery state completely.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agofastboot: Fix overflow when calculating chunk size
Sean Anderson [Thu, 27 May 2021 16:02:34 +0000 (12:02 -0400)]
fastboot: Fix overflow when calculating chunk size

If a chunk was larger than 4GiB, then chunk_data_sz would overflow and
blkcnt would not be calculated correctly. Upgrade it to a u64 and cast
its multiplicands as well. Also fix bytes_written while we're at it.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoMAINTAINERS: Update maintainer's mail address
Kever Yang [Tue, 30 Mar 2021 10:02:07 +0000 (18:02 +0800)]
MAINTAINERS: Update maintainer's mail address

Philipp has change the mail and the legacy one is not available, update it
to the new one.

CC: Philipp Tomsich <philipp.tomsich@vrull.eu>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Mon, 31 May 2021 14:19:14 +0000 (10:19 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- SiFive FU740 and Unmatched support

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Mon, 31 May 2021 14:18:26 +0000 (10:18 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi

This contains the fix to bring back the SD card as MMC0. In the long run
we are looking into a more robust solution, but for now we need to fix
this, as this breaks the user experience left, right, and centre.
Also add the one MAINTAINERS path addition from Samuel.

3 years agodrivers: pci: pcie_dw_common: fix Werror compilation error
Green Wan [Wed, 19 May 2021 11:16:15 +0000 (04:16 -0700)]
drivers: pci: pcie_dw_common: fix Werror compilation error

Fix compilation error when Werror is turned on. The warning could
possible break some CI builds.

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: cpu: fu740: clear feature disable CSR
Green Wan [Thu, 27 May 2021 13:52:14 +0000 (06:52 -0700)]
riscv: cpu: fu740: clear feature disable CSR

Clear feature disable CSR to turn on all features of hart. The detail
is specified at section, 'SiFive Feature Disable CSR', in user manual

https://sifive.cdn.prismic.io/sifive/aee0dd4c-d156-496e-a6c4-db0cf54bbe68_sifive_U74MC_rtl_full_20G1.03.00_manual.pdf

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoboard: sifive: add HiFive Unmatched board support
Green Wan [Thu, 27 May 2021 13:52:13 +0000 (06:52 -0700)]
board: sifive: add HiFive Unmatched board support

Add defconfig and board support for HiFive Unmatched.

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoriscv: dts: add SiFive Unmatched board support
Green Wan [Thu, 27 May 2021 13:52:12 +0000 (06:52 -0700)]
riscv: dts: add SiFive Unmatched board support

Add dts files for SiFive Unmatched board.

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoriscv: dts: add fu740 support
Green Wan [Thu, 27 May 2021 13:52:11 +0000 (06:52 -0700)]
riscv: dts: add fu740 support

Add dts support for fu740. The HiFive Unmatched support is based on
fu740 cpu and drivers in following patch set.

Signed-off-by: Green Wan <green.wan@sifive.com>
[greentime.hu: set fu740 speed to 1.2GHz]
Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agodrivers: pci: add pcie support for fu740
Green Wan [Thu, 27 May 2021 13:52:10 +0000 (06:52 -0700)]
drivers: pci: add pcie support for fu740

Add pcie driver for SiFive fu740, the driver depends on
fu740 gpio, clk and reset driver to do init. Force running at Gen1
for better capatible enumeration.

Several devices are tested:
a) M.2 NVMe SSD
b) USB-to-PCI adapter
c) Ethernet adapter (E1000 compatible)

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agodrivers: ram: sifive: rename fu540_ddr and add fu740 support
Green Wan [Thu, 27 May 2021 13:52:09 +0000 (06:52 -0700)]
drivers: ram: sifive: rename fu540_ddr and add fu740 support

Rename fu540_ddr.c to sifive_ddr.c and add fu740 support

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agodrivers: clk: add fu740 support
Green Wan [Thu, 27 May 2021 13:52:08 +0000 (06:52 -0700)]
drivers: clk: add fu740 support

Add fu740 support. One abstract layer is added for supporting
multiple chips such as fu540 and fu740.

Signed-off-by: Green Wan <green.wan@sifive.com>
3 years agoriscv: cpu: fu740: Add support for cpu fu740
Green Wan [Thu, 27 May 2021 13:52:07 +0000 (06:52 -0700)]
riscv: cpu: fu740: Add support for cpu fu740

Add SiFive fu740 cpu to support RISC-V arch

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoMAINTAINERS: Add allwinner/sunxi driver directories
Samuel Holland [Mon, 19 Apr 2021 03:13:36 +0000 (22:13 -0500)]
MAINTAINERS: Add allwinner/sunxi driver directories

These drivers are sunxi platform-specific, and so are of interest to the
sunxi maintainers.

In fact, as there is no PHY driver maintainer, drivers/phy/allwinner had
no maintainer at all.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: Bring back SD card as MMC device 0
Andre Przywara [Fri, 16 Apr 2021 10:52:27 +0000 (11:52 +0100)]
sunxi: Bring back SD card as MMC device 0

Commit 2243d19e5618 ("mmc: mmc-uclass: Use dev_seq() to read aliases
node's index") now actually enforces U-Boot's device enumeration policy,
where explicitly named devices come first, then any other non-named
devices follow, without filling gaps.

For quite a while we have had an "mmc1 = &mmc2;" alias in our
sunxi-u-boot.dtsi, which now leads to the problem that the SD card
(which was always mmc device 0) now gets to be number 2.
This breaks quite some boot scripts, including our own distro boot
commands, and some other features looking at $mmc_bootdev, also
fastboot.

Just add an explicit mmc0 alias in the very same file to fix this and
restore the old behaviour.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reported-by: Samuel Holland <samuel@sholland.org>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
3 years agoMerge tag 'u-boot-stm32-20210528' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 28 May 2021 18:11:06 +0000 (14:11 -0400)]
Merge tag 'u-boot-stm32-20210528' of https://source.denx.de/u-boot/custodians/u-boot-stm

- DFU: MTD: fix for lock support
- reset: stm32: fix bank bank and offset computation
- enable UNZIP config in several stm32mp defconfig

3 years agoMerge tag 'efi-2021-07-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 28 May 2021 18:10:51 +0000 (14:10 -0400)]
Merge tag 'efi-2021-07-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc4-2

Simplify configuration using HASH functions
Fix Coverity warnings related to EFI TCG2 protocol
Enable PE/COFF image measurement

3 years agoefi_loader: add PE/COFF image measurement
Masahisa Kojima [Wed, 26 May 2021 03:09:58 +0000 (12:09 +0900)]
efi_loader: add PE/COFF image measurement

"TCG PC Client Platform Firmware Profile Specification"
requires to measure every attempt to load and execute
a OS Loader(a UEFI application) into PCR[4].
This commit adds the PE/COFF image measurement, extends PCR,
and appends measurement into Event Log.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Replace CONFIG_HASH_CALCULATE by CONFIG_HASH
Fix conversions between pointers and u64.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_loader: Work-around build issue due to missing hash_calculate()
Alexandru Gagniuc [Mon, 24 May 2021 19:28:57 +0000 (14:28 -0500)]
efi_loader: Work-around build issue due to missing hash_calculate()

The hash_calculate() symbol is provided by hash-checksum.c. It depends
on hash_progressive_lookup_algo(), provided when CONFIG_HASH=y.

The issue is that hash_calculate() is used by the efi_loader,
irregardless of CONFIG_FIT_SIGNATURE. As pointed out in
commit 87316da05f2f ("lib: introduce HASH_CALCULATE option"),
enabling hash_calculate() based on CONFIG_FIT_SIGNATURE is incorrect.

To resolve this, use CONFIG_HASH as the compile switch for
hash-checksum.c. This ensures that all dependencies are compiled, and
is the most natural Kconfig to use.

There is the issue of having to 'select HASH' in a couple of places
that already 'select SHA256'. This is a deeper problem with how hashes
are organized, and fixing it is beyonf the scope of this change.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Masahisa Kojima <masahisa.kojima@linaro.org>