platform/kernel/u-boot.git
3 years agoboard: sifive: remove the command for setting serial number
Zong Li [Fri, 9 Jul 2021 08:26:35 +0000 (16:26 +0800)]
board: sifive: remove the command for setting serial number

We wouldn't like to allow user to change the serial number, so remove
the command for changing serial number in EEPROM.

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoMerge branch 'master' of git://source.denx.de/u-boot-sh
Tom Rini [Tue, 20 Jul 2021 23:31:40 +0000 (19:31 -0400)]
Merge branch 'master' of git://source.denx.de/u-boot-sh

- R-Car3 updates

3 years agoARM: dts: rmobile: Remove multiple unused DT properties on R-Car Gen3
Marek Vasut [Sat, 10 Jul 2021 17:17:34 +0000 (19:17 +0200)]
ARM: dts: rmobile: Remove multiple unused DT properties on R-Car Gen3

Filter out dmas dma-names interrupt-parent interrupts interrupts-extended
interrupt-names interrupt-map interrupt-map-mask iommus DT properties on
R-Car Gen3, since they are not used by U-Boot and only take space.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: dts: rmobile: Disable RPC HF by default
Marek Vasut [Sat, 10 Jul 2021 16:56:29 +0000 (18:56 +0200)]
ARM: dts: rmobile: Disable RPC HF by default

The RPC HF might be locked by ATF, and any access to its register
space would result in complete hang. Disable the RPC HF by default.
The ATF should be patched to set RPC node status = "okay" in the DT
fragment it passes to U-Boot in case the RPC HF access is unlocked,
and that way U-Boot could access the RPC HF safely.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Align CPU: print with other prints
Marek Vasut [Sun, 4 Jul 2021 15:27:27 +0000 (17:27 +0200)]
ARM: rmobile: Align CPU: print with other prints

The CPU: print only has one space after it, while the other prints
from U-Boot align the value to offset 7. Align the CPU: print too.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Enable sysinfo on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 18:41:50 +0000 (20:41 +0200)]
ARM: rmobile: Enable sysinfo on R-Car Gen3

Enable support for sysinfo on supported R-Car Gen3 boards. The sysinfo
is used e.g. to access and decode board-specific information and then
in turn used by board-info to print those information. On R-Car Gen3
the sysinfo rcar3 driver is used to parse the board ID EEPROM, obtain
board type and revision from it, and let board-info print this
information on boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Enable I2C EEPROM support on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 18:39:28 +0000 (20:39 +0200)]
ARM: rmobile: Enable I2C EEPROM support on R-Car Gen3

Enable support for I2C EEPROM driver on supported Renesas R-Car Gen3 boards.
This is useful for accessing the board ID EEPROM.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: dts: rmobile: Add sysinfo extras on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 16:16:14 +0000 (18:16 +0200)]
ARM: dts: rmobile: Add sysinfo extras on R-Car Gen3

Add sysinfo node and phandle to the board ID EEPROM on all boards
where this functionality is described in DT, which is Salvator-X(S),
ULCB and Ebisu. The u-boot,dm-pre-reloc is necessary here, since the
sysinfo must be available early during boot. The V3M and V3H boards
currently do not describe this board ID EEPROM in upstream DT, but
that could be easily added later, once the DTs contain the necessary
nodes.

ULCB and Ebisu needs the full EEPROM node in the u-boot extras DT,
since the EEPROM node is still missing in the upstream DTs. Ebisu
also needs extra compatible string override for the i2c_dvfs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agosysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver
Marek Vasut [Sat, 3 Jul 2021 18:38:26 +0000 (20:38 +0200)]
sysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver

The Renesas R-Car Gen3 development kits contain board ID EEPROM.
This driver parses out the board ID and revision out of that
EEPROM and exports it e.g. for the board-info print on boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Sean Anderson <sean.anderson@seco.com>
Cc: Simon Glass <sjg@chromium.org>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 19 Jul 2021 12:41:04 +0000 (08:41 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Marvell SheevaPlug: Convert Ethernet and SATA to Driver Model (Tony)
- Zyxel NSA310S NAS: Convert to Driver Model (Tony)
- Turris_omnia: Add `u-boot-env` NOR partition (Marek)
- Turris_omnia: Fixup MTD partitions in Linux' DTB (Marek)
- Espressobin: Enable 'mtd' command and define SPI NOR partitions (Pali)

3 years agoMerge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 19 Jul 2021 12:29:24 +0000 (08:29 -0400)]
Merge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti

- Enabled distro boot for all TI platforms.
- Cleanup for AM335x Guardian Board
- PRUSS rproc on AM65 platform.
- Add PMIC support for J7200
- Misc fixes for Nokia RX-51

# Conflicts:
# arch/arm/mach-omap2/am33xx/Kconfig

3 years agoarm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions
Pali Rohár [Fri, 16 Jul 2021 10:34:42 +0000 (12:34 +0200)]
arm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions

U-Boot now supports parsing SPI NOR partitions from Device Tree. So enable
'mtd' command support for Espressobin board and define partition layout in
U-Boot Espressobin DTS file. Access to SPI NOR via 'sf' command is old
method and 'mtd' command is now preferred variant.

From include file remove '#define CONFIG_MTD_PARTITIONS' as this option is
now defined and enabled in defconfig file. This change is required to fix
compile error:

      CC      arch/arm/lib/asm-offsets.s
    In file included from include/config.h:4,
                     from include/common.h:16,
                     from lib/asm-offsets.c:14:
    include/configs/mvebu_armada-37xx.h:63: warning: "CONFIG_MTD_PARTITIONS" redefined
     #define CONFIG_MTD_PARTITIONS  /* required for UBI partition support */

    In file included from ././include/linux/kconfig.h:4,
                     from <command-line>:
    include/generated/autoconf.h:44: note: this is the location of the previous definition
     #define CONFIG_MTD_PARTITIONS 1

After enabling support for mtd command, output from 'mtd list' on
Espressobin board is:

    => mtd list
    List of MTD devices:
    * w25q32dw
      - device: spi-flash@0
      - parent: spi@10600
      - driver: jedec_spi_nor
      - path: /soc/internal-regs/spi@10600/spi-flash@0
      - type: NOR flash
      - block size: 0x1000 bytes
      - min I/O: 0x1 bytes
      - 0x000000000000-0x000000400000 : "w25q32dw"
              - 0x000000000000-0x0000003f0000 : "firmware"
              - 0x0000003f0000-0x000000400000 : "u-boot-env"
    =>

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB
Marek Behún [Thu, 15 Jul 2021 17:21:02 +0000 (19:21 +0200)]
arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB

Fixup SPI NOR partition nodes in Linux' device tree prior booting Linux.

Linux' devicetree does not contain "u-boot-env" partition and we do not
want to add it there because the address is different between stock
U-Boot and current upstream U-Boot.

Instead we add code that recreates partition nodes from scratch
according to how U-Boot sees them (which is defined in U-Boot's device
tree).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoARM: dts: armada-385-turris-omnia: add `u-boot-env` NOR partition
Marek Behún [Thu, 15 Jul 2021 17:21:01 +0000 (19:21 +0200)]
ARM: dts: armada-385-turris-omnia: add `u-boot-env` NOR partition

Specify a separate partition `u-boot-env` for U-Boot's env settings for
the Turris Omnia board.

Do this only in U-Boot's specific DTS. We do not want to do this in
Linux' official DTS, because Omnia's stock U-Boot stores env at a
different address, and there are still boards with stock U-Boot.

In a subsequent patch will add board code that fixes Linux's DTB before
booting Linux.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: Marvell Sheevaplug: Use Ethernet PHY name and address from device...
Tony Dinh [Fri, 16 Jul 2021 09:18:04 +0000 (02:18 -0700)]
arm: kirkwood: Marvell Sheevaplug: Use Ethernet PHY name and address from device tree

- In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: Marvell Sheevaplug: Add DM SATA and remove IDE configs
Tony Dinh [Wed, 14 Jul 2021 04:35:46 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM SATA and remove IDE configs

Enable DM SATA, removed IDE driver, and add SATA MV driver.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: Marvell Sheevaplug: Add DM Ethernet and DM SATA configs
Tony Dinh [Wed, 14 Jul 2021 04:35:44 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM Ethernet and DM SATA configs

Add DM_ETH, SATA_MV and associated configs to sheevaplug_defconfig

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Use Ethernet PHY name from device tree
Tony Dinh [Wed, 7 Jul 2021 09:06:47 +0000 (02:06 -0700)]
arm: kirkwood: NSA310S: Use Ethernet PHY name from device tree

In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Add DM SATA configs
Tony Dinh [Sat, 3 Jul 2021 03:08:14 +0000 (20:08 -0700)]
arm: kirkwood: NSA310S: Add DM SATA configs

Enable DM SATA, removed IDE driver, and add SATA MV driver.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Add DM USB, DM Ethernet, and DM SATA configs
Tony Dinh [Thu, 1 Jul 2021 04:26:23 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add DM USB, DM Ethernet, and DM SATA configs

Convert to Driver Model.

- Add DM USB, DM Ethernet, and DM SATA configs to nsa310s_defconfig
- Add CONFIG_DEFAULT_DEVICE_TREE to nsa310s_defconfig
- Move CONFIG_ENV_SECT_SIZE from board file to nsa310s_defconfig
- Add CONFIG_IDENT_STRING, and CONFIG_NET_RANDOM_ETHADDR
to nsa310s_defconfig

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: NSA310S: Add device tree DTS for Zyxel NSA310S board
Tony Dinh [Thu, 1 Jul 2021 04:26:22 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add device tree DTS for Zyxel NSA310S board

Add device tree kirkwood-nsa310s.dts for Zyxel NSA310S board to
convert to Driver Model.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge branch '2021-07-18-finalize-migrations'
Tom Rini [Mon, 19 Jul 2021 03:07:36 +0000 (23:07 -0400)]
Merge branch '2021-07-18-finalize-migrations'

- With the deadline for DM_USB (host controller support), DM_VIDEO,
  DM_SPI_FLASH and DM_PCI now at 2 years past the release where their
  migration deadline was given, finish removing platforms and enforcing
  the switch.

3 years agoMakefile: Remove DM_VIDEO and DM_SPI_FLASH checks
Tom Rini [Mon, 19 Jul 2021 01:06:33 +0000 (21:06 -0400)]
Makefile: Remove DM_VIDEO and DM_SPI_FLASH checks

As we have now completed the DM_VIDEO and DM_SPI_FLASH migrations we can
remove the checks.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agopci: Require DM_PCI
Tom Rini [Sat, 15 May 2021 01:34:32 +0000 (21:34 -0400)]
pci: Require DM_PCI

As the migration deadline has passed, require that DM_PCI be used.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agousb: Enforce DM_USB migration for USB_HOST devices.
Tom Rini [Fri, 9 Jul 2021 14:11:56 +0000 (10:11 -0400)]
usb: Enforce DM_USB migration for USB_HOST devices.

As the deadline for migration to DM_USB, when using a USB host
controller has now gone two years past the deadline, enforce migration.
This is done by:

- Ensuring that all host controller options (other than the very legacy
  old MUSB ones) now select USB_HOST.  USB_HOST now enforces DM_USB and
  OF_CONTROL.
  - Remove other parts of Kconfig logic that had platforms pick DM_USB.
  - To keep Kconfig happy, have some select statements test for USB_HOST
    as well.
- Re-order some Kconfig entries and menus so that we can cleanly pick
  host or gadget roles.  For the various HCD options that have platform
  glue options, group them together and update dependencies in some
  cases.
- As SPL_DM_USB is not required, on platforms that had not yet enabled
  it, disable it.

Cc: Marek Vasut <marex@denx.de>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Samuel Holland <samuel@sholland.org>
Cc: FUKAUMI Naoki <naobsd@gmail.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotreewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USB
Tom Rini [Fri, 9 Jul 2021 14:11:55 +0000 (10:11 -0400)]
treewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USB

As the logic here is only used when we have a USB host controller, test
on CONFIG_USB_HOST rather than CONFIG_USB in general.  This lets us move
towards using CONFIG_USB only as a menu symbol to say that we have some
form of USB, and then USB_HOST or USB_GADGET depending on the role that
USB plays within the build.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd
Tom Rini [Fri, 9 Jul 2021 14:11:54 +0000 (10:11 -0400)]
tegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd

Reuse the common logic to allow for BOOT_TARGET_DEVICES to list USB as a
possibility if we're building for a platform that will have USB but not
if we don't, so that we don't hit the link-time check for trying to have
USB boot on a non-USB system.

Acked-by: Tom Warren <twarren@nvidia.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoge_bx50v3: Remove unused USB related defines
Tom Rini [Fri, 9 Jul 2021 14:11:53 +0000 (10:11 -0400)]
ge_bx50v3: Remove unused USB related defines

These USB defines do not change the build as there is no USB support
enabled currently.

Cc: Ian Ray <ian.ray@ge.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agom68k: Remove M52277EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:14 +0000 (12:42 -0400)]
m68k: Remove M52277EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is also the last in family remove the related
support as well.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54451EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:13 +0000 (12:42 -0400)]
m68k: Remove M54451EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is also the last in family remove the related
support as well.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54418TWR board
Tom Rini [Mon, 12 Jul 2021 16:42:12 +0000 (12:42 -0400)]
m68k: Remove M54418TWR board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54455EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:11 +0000 (12:42 -0400)]
m68k: Remove M54455EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agovinco: Enable DM_USB and DM_SPI_FLASH support
Tom Rini [Mon, 12 Jul 2021 16:42:10 +0000 (12:42 -0400)]
vinco: Enable DM_USB and DM_SPI_FLASH support

As this platform already enables CONFIG_DM and CONFIG_OF_CONTROL,
migrating to DM_USB and DM_SPI_FLASH is just a matter of enabling the
correct options.

Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
u-boot@lists.denx.de (open list)
Reported-by: Marek Behun <marek.behun@nic.cz>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'mips-pull-2021-07-18' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 18 Jul 2021 22:31:16 +0000 (18:31 -0400)]
Merge tag 'mips-pull-2021-07-18' of https://source.denx.de/u-boot/custodians/u-boot-mips

- mips: gardena-smart-gateway: adjust config to new production values
- mips: malta: convert to PCI DM and ETH DM

3 years agoMIPS: malta: enable PCI driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:01 +0000 (20:54 +0200)]
MIPS: malta: enable PCI driver model

Enable DM_PCI and DM_ETH on MIPS Malta.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agoMIPS: malta: add support for PCI driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:00 +0000 (20:54 +0200)]
MIPS: malta: add support for PCI driver model

As almost all peripherals are connected via PCI dependent on the
used core card, PCI setup is always required. Thus run pci_init()
including PCI scanning and probing and core card specific setups
in board_early_init_r().

Also prepare support for dynamically managing the status of the
different PCI DT nodes dependent on used core card via option
CONFIG_OF_BOARD_FIXUP. Before this feature can be enabled,
the call order of the fix_fdt() init hook in board_init_f
needs to be changed. Otherwise rw_fdt_blob points to a read-only
NOR flash address. Thus this options needs to stay disabled
until the board_init_f problem could be solved. This breaks
running the default U-Boot image on real HW using the FPGA core
card but Qemu emulation still works. Currently Qemu is more
important as MIPS CI tests depend on Malta and the deadline
for PCI DM conversion will be enforced soon.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agoMIPS: malta: add DT bindings for PCI host controller
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:59 +0000 (20:53 +0200)]
MIPS: malta: add DT bindings for PCI host controller

Add DT binding for GT64120 and MSC01 PCI controllers. Only
GT64120 is enabled by default to support Qemu. The MSC01 node
will be dynamically enabled by Malta board code dependent
on the plugged core card.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agopci: msc01: convert to driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:58 +0000 (20:53 +0200)]
pci: msc01: convert to driver model

This driver is currently only used on MIPS Malta boards.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopci: gt64120: convert to driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:57 +0000 (20:53 +0200)]
pci: gt64120: convert to driver model

This driver is currently only used on MIPS Malta boards.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: pci: add option to map virtual system memory base address
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:56 +0000 (20:53 +0200)]
dm: pci: add option to map virtual system memory base address

On MIPS the DRAM start address respectively CONFIG_SYS_SDRAM_BASE
is still used as a virtual, CPU-mapped address instead of being used
as physical address. Converting all MIPS boards and generic MIPS code
to fix that is not trivial. Due to the approaching deadline for
PCI DM conversion, this workaround is required for MIPS boards with
PCI support until the CONFIG_SYS_SDRAM_BASE issue could be solved.

Add a compile-time option to let the PCI uclass core optionally map
the DRAM address to a physical address when adding the PCI region
of type PCI_REGION_SYS_MEMORY.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomips: mt7688: gardena-smart-gateway: Adjust to production values
Reto Schneider [Thu, 17 Jun 2021 16:09:34 +0000 (18:09 +0200)]
mips: mt7688: gardena-smart-gateway: Adjust to production values

This commit updates the default config with the values that will
be used soon on the MediaTek MT7688 based GARDENA smart gateway.

CONFIG_SPL_SYS_MALLOC_F_LEN had to be increased due to the more
demanding new configuration.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge tag 'efi-2021-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 18 Jul 2021 15:03:02 +0000 (11:03 -0400)]
Merge tag 'efi-2021-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc1-2

* Correct device path nodes for GUID partitions
* Embed keys to check update capsules instead of providing then in DTB
* Increase event log buffer size for measured boot.

3 years agodoc: Update CapsuleUpdate READMEs
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:46 +0000 (17:26 +0300)]
doc: Update CapsuleUpdate READMEs

Since we removed embeddingg the capsule key into a .dtb and fixed
authenticated capsule updates for all boards, move the relevant
documentation in the efi file and update it accordingly

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agomkeficapsule: Remove dtb related options
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:45 +0000 (17:26 +0300)]
mkeficapsule: Remove dtb related options

commit 322c813f4bec ("mkeficapsule: Add support for embedding public key in a dtb")
added a bunch of options enabling the addition of the capsule public key
in a dtb.  Since now we embedded the key in U-Boot's .rodata we don't this
this functionality anymore

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_capsule: Move signature from DTB to .rodata
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:44 +0000 (17:26 +0300)]
efi_capsule: Move signature from DTB to .rodata

The capsule signature is now part of our DTB.  This is problematic when a
user is allowed to change/fixup that DTB from U-Boots command line since he
can overwrite the signature as well.
So Instead of adding the key on the DTB, embed it in the u-boot binary it
self as part of it's .rodata.  This assumes that the U-Boot binary we load
is authenticated by a previous boot stage loader.

Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_loader: increase eventlog buffer size
Masahisa Kojima [Wed, 14 Jul 2021 13:00:01 +0000 (22:00 +0900)]
efi_loader: increase eventlog buffer size

TCG PC Client PFP spec says "The Log Area Minimum Length
for the TCG event log MUST be at least 64KB." in ACPI chapter.
This commit increase the buffer size to 64KB.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Use %pD to log device-path instead of local efi_dp_str()
Masami Hiramatsu [Wed, 14 Jul 2021 05:19:13 +0000 (14:19 +0900)]
efi_loader: Use %pD to log device-path instead of local efi_dp_str()

Use %pD to log device-path instead of using efi_dp_str() and
efi_free_pool() locally in find_boot_device().
This is a cleanup patch, no feature update nor fix.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: set partition GUID in device path for SIG_TYPE_GUID
Alfonso Sánchez-Beato [Thu, 15 Jul 2021 13:31:42 +0000 (15:31 +0200)]
efi_loader: set partition GUID in device path for SIG_TYPE_GUID

Previously, the GPT device GUID was being used instead of the partition,
which was incorrect.

Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Let EFI_LOADER select CONFIG_PARTITION_UUIDS.
Use log_warning() instead of printf() for warning.
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoMerge branch '2021-07-16-cleanup-image-support'
Tom Rini [Sat, 17 Jul 2021 15:39:50 +0000 (11:39 -0400)]
Merge branch '2021-07-16-cleanup-image-support'

- A large rework of the logic around supporting various image
  types/formats and sharing between the host and target.

3 years agoMerge tag 'u-boot-imx-20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Sat, 17 Jul 2021 14:52:21 +0000 (10:52 -0400)]
Merge tag 'u-boot-imx-20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

i.MX
----

- mx7ulp : fix  WDOG
- imx8 : Phytec
- USB3 support for i.MX8

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

3 years agomx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete
Breno Lima [Tue, 29 Jun 2021 02:32:35 +0000 (10:32 +0800)]
mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete

According to i.MX7ULP Reference Manual we should wait for WDOG unlock
and reconfiguration to complete.

Section "59.5.3 Configure Watchdog" provides the following example:

DisableInterrupts; //disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
while(WDOG_CS[ULK]==0); //wait until registers are unlocked
WDOG_TOVAL = 256; //set timeout value
WDOG_CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(1) |
  WDOG_CS_WIN(0) | WDOG_CS_UPDATE(1);
while(WDOG_CS[RCS]==0); //wait until new configuration takes effect
EnableInterrupts; //enable global interrupt

Update U-Boot WDOG driver to align with i.MX7ULP reference manual.

Use 32 bits accessing to CS register. According to RM, the bits in
this register only can write once after unlock. So using 8 bits access
will cause problem.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agomx7ulp: Update unlock and refresh sequences in sWDOG driver
Breno Lima [Tue, 29 Jun 2021 02:32:34 +0000 (10:32 +0800)]
mx7ulp: Update unlock and refresh sequences in sWDOG driver

According to i.MX7ULP Reference Manual the second word write for both
UNLOCK and REFRESH operations must occur in maximum 16 bus clock.

The current code is using writel() function which has a DMB barrier to
order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing a WDOG timeout due to 16 bus
clock window requirement.

Replace writel() function by __raw_writel() to achieve a faster memory
access and avoid such issue.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
3 years agoimx8mq_evk: Enable the USB3.0 host port
Ye Li [Sun, 21 Feb 2021 16:26:24 +0000 (08:26 -0800)]
imx8mq_evk: Enable the USB3.0 host port

Setup USB clock in board codes, and enable the DWC3 XHCI and
PHY drivers to make USB3.0 host port working on i.MX8MQ EVK.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
3 years agoarm: imx8mq: Add USB clock init function
Ye Li [Sun, 21 Feb 2021 16:26:23 +0000 (08:26 -0800)]
arm: imx8mq: Add USB clock init function

Add clock function to setup relevant clocks for USB3.0 controllers and
PHYs on i.MX8MQ

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agoarm: dts: imx8mq: Add alias for two usb controllers
Ye Li [Sun, 21 Feb 2021 16:26:22 +0000 (08:26 -0800)]
arm: dts: imx8mq: Add alias for two usb controllers

Add alias for two DWC3 usb controllers to fix the seq index.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agophy: phy-imx8mq-usb: Add USB PHY driver for i.MX8MQ
Ye Li [Sun, 21 Feb 2021 16:26:21 +0000 (08:26 -0800)]
phy: phy-imx8mq-usb: Add USB PHY driver for i.MX8MQ

Add the USB PHY driver for i.MX8MQ to work with DWC3 USB controller.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agotools: Use a single target-independent config to enable OpenSSL
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:47 +0000 (17:05 -0500)]
tools: Use a single target-independent config to enable OpenSSL

Host tool features, such as mkimage's ability to sign FIT images were
enabled or disabled based on the target configuration. However, this
misses the point of a target-agnostic host tool.

A target's ability to verify FIT signatures is independent of
mkimage's ability to create those signatures. In fact, u-boot's build
system doesn't sign images. The target code can be successfully built
without relying on any ability to sign such code.

Conversely, mkimage's ability to sign images does not require that
those images will only work on targets which support FIT verification.
Linking mkimage cryptographic features to target support for FIT
verification is misguided.

Without loss of generality, we can say that host features are and
should be independent of target features.

While we prefer that a host tool always supports the same feature set,
we recognize the following
  - some users prefer to build u-boot without a dependency on OpenSSL.
  - some distros prefer to ship mkimage without linking to OpenSSL

To allow these use cases, introduce a host-only Kconfig which is used
to select or deselect libcrypto support. Some mkimage features or some
host tools might not be available, but this shouldn't affect the
u-boot build.

I also considered setting the default of this config based on
FIT_SIGNATURE. While it would preserve the old behaviour it's also
contrary to the goals of this change. I decided to enable it by
default, so that the default build yields the most feature-complete
mkimage.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Add support for relocating crypto_algos in linker lists
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:46 +0000 (17:05 -0500)]
image: Add support for relocating crypto_algos in linker lists

Function pointers from crypto_algos array are relocated, when
NEEDS_MANUAL_RELOC is set. This relocation doesn't happen if the algo
is placed in a linker list. Implement this relocation.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
3 years agoimage: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:45 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro

This macro is no longer needed for code flow or #ifdefs. Remove it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: Eliminate IMAGE_ENABLE_VERIFY macro
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:44 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY macro

This macro is no longer needed for code flow or #ifdefs. Remove it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: rsa: Remove #ifdefs from rsa.h
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:43 +0000 (17:05 -0500)]
lib: rsa: Remove #ifdefs from rsa.h

It is no longer necessary to implement rsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the rsa code is no longer linked when unused.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: ecdsa: Remove #ifdefs from ecdsa.h
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:42 +0000 (17:05 -0500)]
lib: ecdsa: Remove #ifdefs from ecdsa.h

It is no longer necessary to implement ecdsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the ecdsa code is no longer linked when unused.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: image-sig.c: Remove crypto_algos array
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:41 +0000 (17:05 -0500)]
image: image-sig.c: Remove crypto_algos array

Crytographic algorithms (currently RSA), are stored in linker lists.
The crypto_algos array is unused, so remove it, and any logic
associated with it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: rsa: Move verification algorithm to a linker list
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:40 +0000 (17:05 -0500)]
image: rsa: Move verification algorithm to a linker list

Move the RSA verification crytpo_algo structure out of the
crypto_algos array, and into a linker list.

Although it appears we are adding an #ifdef to rsa-verify.c, the gains
outweigh this small inconvenience. This is because rsa_verify() is
defined differently based on #ifdefs. This change allows us to have
a single definition of rsa_verify().

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: Add support for placing crypto_algo in linker lists
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:39 +0000 (17:05 -0500)]
image: Add support for placing crypto_algo in linker lists

The purpose of this change is to enable crypto algorithms to be placed
in linker lists, rather than be declared as a static array. The goal
is to remove the crypto_algos array in a subsequent patch.

Create a new linker list named "cryptos", and search it when
image_get_crypto_algo() is invoked.

NOTE that adding support for manual relocation of crypto_algos within
linker lists is beyond the scope of this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon: image-sig.c: Remove host-specific logic and #ifdefs
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:38 +0000 (17:05 -0500)]
common: image-sig.c: Remove host-specific logic and #ifdefs

Remove any ifdefs in image-sig.c that were previously used to
differentiate from the host code. Note that all code dedicated to
relocating ->sign() and ->add_verify_data)_ can be safely removed,
as signing is not supported target-side.

NOTE that although it appears we are removing ecdsa256 support, this
is intentional. ecdsa_verify() is a no-op on the target, and is
currently only used by host code.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon: Move host-only logic in image-sig.c to separate file
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:37 +0000 (17:05 -0500)]
common: Move host-only logic in image-sig.c to separate file

image-sig.c is used to map a hash or crypto algorithm name to a
handler of that algorithm. There is some similarity between the host
and target variants, with the differences worked out by #ifdefs. The
purpose of this change is to remove those ifdefs.

First, copy the file to a host-only version, and remove target
specific code. Although it looks like we are duplicating code,
subsequent patches will change the way target algorithms are searched.
Besides we are only duplicating three string to struct mapping
functions. This isn't something to fuss about.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: Drop IMAGE_ENABLE_BEST_MATCH
Simon Glass [Wed, 14 Jul 2021 22:05:36 +0000 (17:05 -0500)]
image: Drop IMAGE_ENABLE_BEST_MATCH

This is not needed with Kconfig, since we can use IS_ENABLED() easily
enough. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Drop IMAGE_ENABLE_SHAxxx
Simon Glass [Wed, 14 Jul 2021 22:05:35 +0000 (17:05 -0500)]
image: Drop IMAGE_ENABLE_SHAxxx

We already have a host Kconfig for these SHA options. Use
CONFIG_IS_ENABLED(SHAxxx) directly in the code shared with the host build,
so we can drop the unnecessary indirections.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Drop IMAGE_ENABLE_SHA1
Simon Glass [Wed, 14 Jul 2021 22:05:34 +0000 (17:05 -0500)]
image: Drop IMAGE_ENABLE_SHA1

We already have a host Kconfig for SHA1. Use CONFIG_IS_ENABLED(SHA1)
directly in the code shared with the host build, so we can drop the
unnecessary indirection.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoKconfig: Rename SPL_MD5_SUPPORT to SPL_MD5
Simon Glass [Wed, 14 Jul 2021 22:05:33 +0000 (17:05 -0500)]
Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5

Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this
option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoKconfig: Rename SPL_CRC32_SUPPORT to SPL_CRC32
Simon Glass [Wed, 14 Jul 2021 22:05:32 +0000 (17:05 -0500)]
Kconfig: Rename SPL_CRC32_SUPPORT to SPL_CRC32

Drop the _SUPPORT suffix so we can use CONFIG_IS_ENABLED() with this
option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Rename CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT
Simon Glass [Wed, 14 Jul 2021 22:05:31 +0000 (17:05 -0500)]
image: Rename CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT

Drop the ENABLE and SUPPORT parts of this, which are redundant.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Rename SPL_SHAxxx_SUPPORT to SPL_FIT_SHAxxx
Simon Glass [Wed, 14 Jul 2021 22:05:30 +0000 (17:05 -0500)]
image: Rename SPL_SHAxxx_SUPPORT to SPL_FIT_SHAxxx

These option are named inconsistently with other SPL options, thus making
them incompatible with the CONFIG_IS_ENABLED() macro. Rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Shorten FIT_ENABLE_SHAxxx_SUPPORT
Simon Glass [Wed, 14 Jul 2021 22:05:29 +0000 (17:05 -0500)]
image: Shorten FIT_ENABLE_SHAxxx_SUPPORT

The ENABLE part of this name is redundant, since all boolean Kconfig
options serve to enable something. The SUPPORT part is also redundant
since Kconfigs can be assumed to enable support for something. Together
they just serve to make these options overly long and inconsistent
with other options.

Rename FIT_ENABLE_SHAxxx_SUPPORT to FIT_SHAxxx

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoMerge branch '2021-07-15-assorted-fixes'
Tom Rini [Fri, 16 Jul 2021 13:15:59 +0000 (09:15 -0400)]
Merge branch '2021-07-15-assorted-fixes'

- Large number of Coverity reported issues addressed
- m41t62 bugfix
- Support more Android image compression formats
- FIT + DTO bugfix

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 16 Jul 2021 13:15:21 +0000 (09:15 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- designware_wdt: reset watchdog in designware_wdt_stop() function
  (Meng)
- socfpga_stratix10: enable wdt command (Meng)
- wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART (Teresa)

3 years agoMerge tag 'u-boot-stm32-20210715' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 16 Jul 2021 13:15:05 +0000 (09:15 -0400)]
Merge tag 'u-boot-stm32-20210715' of https://source.denx.de/u-boot/custodians/u-boot-stm

- DTS: alignment with Linux kernel v5.13 for stm32mp15 boards
- STM32MP1: update the stm32key command
- STM32MP1: activate the rng command
- STM32MP1: fix the stm32prog command (help, parttition size)
- STM32MP1: add fdtoverlay_addr_r variable
- STM32MP1: correctly managed SYSCON/SYSCFG clock
- STM32MP1: remove mmc alias and directly use device instance in boot_instance variable

3 years agodrivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART
Teresa Remmet [Thu, 15 Jul 2021 11:26:32 +0000 (13:26 +0200)]
drivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART

There is no separate SPL/TPL config for WATCHDOG_AUTOSTART.
So use IS_ENABLED instead of CONFIG_IS_ENABLED to make watchdog
working in SPL again.

Fixes: 830d29ac3721 ("watchdog: Allow to use CONFIG_WDT without starting watchdog")
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: socfpga: socfpga_stratix10: enable wdt command by default
MengLi [Mon, 24 May 2021 02:22:49 +0000 (10:22 +0800)]
arm: socfpga: socfpga_stratix10: enable wdt command by default

In latest u-boot code, watchdog feature is implemented, so enable
wdt command by default.

Signed-off-by: Meng Li <Meng.Li@windriver.com>
3 years agodriver: watchdog: reset watchdog in designware_wdt_stop() function
MengLi [Mon, 24 May 2021 02:22:48 +0000 (10:22 +0800)]
driver: watchdog: reset watchdog in designware_wdt_stop() function

In uboot command line environment, watchdog is not able to be
stopped with below commands:
SOCFPGA_STRATIX10 # wdt dev watchdog@ffd00200
SOCFPGA_STRATIX10 # wdt stop
Refer to watchdog driver in linux kernel, it is also need to reset
watchdog after disable it so that the disable action takes effect.

Signed-off-by: Meng Li <Meng.Li@windriver.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
3 years agoARM: dts: stm32mp15: remove mmc alias
Patrick Delaunay [Tue, 6 Jul 2021 15:19:46 +0000 (17:19 +0200)]
ARM: dts: stm32mp15: remove mmc alias

Remove the mmc alias no more required as the sequence number
of mmc device is used for boot_instance.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: use device sequence number in boot_instance variable
Patrick Delaunay [Tue, 6 Jul 2021 15:19:45 +0000 (17:19 +0200)]
stm32mp: use device sequence number in boot_instance variable

Use the device sequence number in boot_instance variable
and no more the SDMMC instance provided by ROM code/TF-A.

After this patch we don't need to define the mmc alias in
device tree, for example:
  mmc0 = &sdmmc1;
  mmc1 = &sdmmc2;
  mmc2 = &sdmmc3;
to have a correct mapping between the ROM code boot device =
"${boot_device}${boot_instance}" and the MMC device in U-Boot.

With this patch the 'mmc0' device (used in mmc commands) is
always used when only one instance sdmmc is activated in device
tree, even if it is only the sdmmc2 or sdmmc3.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: stm32prog: use defines for virtual partition size
Patrick Delaunay [Mon, 5 Jul 2021 07:39:01 +0000 (09:39 +0200)]
stm32mp: stm32prog: use defines for virtual partition size

Use the existing defines PMIC_SIZE and OTP_SIZE and a new define
CMD_SIZE for virtual partition size.

This patch corrects the size for OTP partition in alternate name
(1024 instead of 512) and avoids other alignment issues.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoconfigs: stm32mp1: activate command rng
Patrick Delaunay [Tue, 29 Jun 2021 10:08:27 +0000 (12:08 +0200)]
configs: stm32mp1: activate command rng

Activate the command rng with CONFIG_CMD_RNG, used to test
the rng driver

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: syscon: manage clock when present in device tree
Patrick Delaunay [Tue, 29 Jun 2021 10:04:23 +0000 (12:04 +0200)]
stm32mp: syscon: manage clock when present in device tree

Enable the clocks during syscon probe when they are present in device tree.

This patch avoids a freeze when the SYSCFG clock is not enabled by
TF-A / OP-TEE.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoclk: stm32mp1: add support of SYSCFG clock
Patrick Delaunay [Tue, 29 Jun 2021 10:04:22 +0000 (12:04 +0200)]
clk: stm32mp1: add support of SYSCFG clock

Add the support of SYSCFG clock used by syscon driver
to prepare the clock management of STM32MP_SYSCON_SYSCFG.

This clock is already defined in kernel device tree,
stm32mp151.dtsi but not yet supported in the syscon driver:

syscfg: syscon@50020000 {
compatible = "st,stm32mp157-syscfg", "syscon";
reg = <0x50020000 0x400>;
clocks = <&rcc SYSCFG>;
};

It is safe to support this clock in U-Boot driver with
RCC_MC_APB3ENSETR, Bit 11 SYSCFGEN: SYSCFG peripheral clocks
enable.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: dts: stm32mp15: alignment with v5.13
Patrick Delaunay [Tue, 29 Jun 2021 10:01:07 +0000 (12:01 +0200)]
arm: dts: stm32mp15: alignment with v5.13

Device tree alignment with Linux kernel v5.13
- ARM: dts: stm32: Add PTP clock to Ethernet controller
- ARM: dts: stm32: enable the analog filter for all I2C nodes in
  stm32mp151
- ARM: dts: stm32: fix usart 2 & 3 pinconf to wake up with flow control
- ARM: dts: stm32: Add wakeup management on stm32mp15x UART nodes
- ARM: dts: stm32: add #clock-cells property to usbphyc node on stm32mp151
- ARM: dts: stm32: Add STM32MP1 I2C6 SDA/SCL pinmux
- ARM: dts: stm32: Rename mmc controller nodes to mmc@
- ARM: dts: stm32: Add additional init state for SDMMC1 pins

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: add subcommand close
Patrick Delaunay [Mon, 28 Jun 2021 12:56:03 +0000 (14:56 +0200)]
stm32mp: cmd_stm32key: add subcommand close

The expected sequence to close the device

1/ Load key in DDR with any supported load command
2/ Update OTP with key: STM32MP> stm32key read <addr>

At this point the device is able to perform image authentication but
non-authenticated images can still be used and executed.
So it is the last moment to test boot with signed binary and
check that the ROM code accepts them.

3/ Close the device: only signed binary will be accepted !!
   STM32MP> stm32key close

Warning: Programming these OTP is an irreversible operation!
         This may brick your system if the HASH of key is invalid

This command should be deactivated by default in real product.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: add read OTP subcommand
Patrick Delaunay [Mon, 28 Jun 2021 12:56:02 +0000 (14:56 +0200)]
stm32mp: cmd_stm32key: add read OTP subcommand

Allow to read the OTP value and lock status with the command
$> stm32key read.

This patch also protects the stm32key fuse command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: add get_misc_dev function
Patrick Delaunay [Mon, 28 Jun 2021 12:56:01 +0000 (14:56 +0200)]
stm32mp: cmd_stm32key: add get_misc_dev function

Add a helper function to access to BSEC misc driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: lock of PKH OTP after fuse
Patrick Delaunay [Mon, 28 Jun 2021 12:56:00 +0000 (14:56 +0200)]
stm32mp: cmd_stm32key: lock of PKH OTP after fuse

Lock the OTP value of key's hash after the command
$> stm32key fuse <address>

This operation forbids a second update of these OTP as they are
ECC protected in BSEC: any update of these OTP with a different value
causes a BSEC disturb error and the closed chip will be bricked.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: handle error in fuse_hash_value
Patrick Delaunay [Mon, 28 Jun 2021 12:55:59 +0000 (14:55 +0200)]
stm32mp: cmd_stm32key: handle error in fuse_hash_value

Handle errors in fuse_hash_value function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: cmd_stm32key: use sub command
Patrick Delaunay [Mon, 28 Jun 2021 12:55:58 +0000 (14:55 +0200)]
stm32mp: cmd_stm32key: use sub command

Simplify parsing the command argument by using
the macro U_BOOT_CMD_WITH_SUBCMDS.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: configs: activate the command stm32key only for ST boards
Patrick Delaunay [Mon, 28 Jun 2021 12:55:57 +0000 (14:55 +0200)]
stm32mp: configs: activate the command stm32key only for ST boards

This command is used to evaluate the secure boot on stm32mp SOC,
it is deactivated by default in real products.

We activate this command only in STMicroelectronics defconfig
used with the evaluation boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: stm32prog: fix the content of short help message
Patrick Delaunay [Mon, 28 Jun 2021 12:44:33 +0000 (14:44 +0200)]
stm32mp: stm32prog: fix the content of short help message

Reduce the content of short help message for stm32prog command and
removed the carriage return to fix the display of 'help' command when
this command is activated.

Fixes: 954bd1a923a6 ("stm32mp: add the command stm32prog")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoconfigs: stm32mp1: remove splashimage and add fdtoverlay_addr_r
Patrick Delaunay [Mon, 28 Jun 2021 12:42:08 +0000 (14:42 +0200)]
configs: stm32mp1: remove splashimage and add fdtoverlay_addr_r

Add the variable used by PXE command for fdtoverlays support
since the commit 69076dff2284 ("cmd: pxe: add support for FDT overlays").

Reused the unused "splashimage" address as CONFIG_SPLASH_SOURCE and
CONFIG_VIDEO_LOGO are not activated and U-Boot display the "BACKGROUND"
image found in extlinux.conf to manage splashscreen on stm32mp1 boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agortc: m41t62: fix wrong register use for set/reset ST bit
Max Yang [Mon, 10 May 2021 05:23:37 +0000 (05:23 +0000)]
rtc: m41t62: fix wrong register use for set/reset ST bit

Fix wrong register use when set/reset ST bit.
ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR.

I have not actually tested this. But this seemed buggy from inspection.

Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>
3 years agoimage: android: Automatically detect more compression types
Stephan Gerhold [Thu, 1 Jul 2021 18:33:16 +0000 (20:33 +0200)]
image: android: Automatically detect more compression types

At the moment android_image_get_kcomp() can automatically detect
LZ4 compressed kernels and the compression specified in uImages.
However, especially on ARM64 Linux is often compressed with GZIP.
Attempting to boot an Android image with a GZIP compressed kernel
image currently results in a very strange crash, e.g.

  Starting kernel ...
  "Synchronous Abort" handler, esr 0x02000000
   ...
  Code: 5555d555 55555d55 555f5555 5d555d55 (00088b1f)

Note the 1f8b, which are the "magic" bytes for GZIP images.

U-Boot already has the image_decomp_type() function that checks for
the magic bytes of bzip2, gzip, lzma and lzo. It's easy to make use
of it here to increase the chance that we do the right thing and the
user does not become confused with strange crashes.

This allows booting Android boot images that contain GZIP-compressed
kernel images.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agofit: Load DTO into temporary buffer and ignore load address
Marek Vasut [Fri, 11 Jun 2021 02:09:56 +0000 (04:09 +0200)]
fit: Load DTO into temporary buffer and ignore load address

The current fitImage DTO implementation expects each fitImage image
subnode containing DTO to have 'load' property, pointing somewhere
into memory where the DTO will be loaded. The address in the 'load'
property must be different then the base DT load address and there
must be sufficient amount of space between those two addresses.
Selecting and using such hard-coded addresses is fragile, error
prone and difficult to port even across devices with the same SoC
and different DRAM sizes.

The DTO cannot be applied in-place because fdt_overlay_apply_verbose()
modifies the DTO when applying it onto the base DT, so if the DTO was
used in place within the fitImage, call to fdt_overlay_apply_verbose()
would corrupt the fitImage.

Instead of copying the DTO to a specific hard-coded load address,
allocate a buffer, copy the DTO into that buffer, apply the DTO onto
the base DT, and free the buffer.

The upside of this approach is that it is no longer necessary to
select and hard-code specific DTO load address into the DTO. The
slight downside is the new malloc()/free() overhead for each DTO,
but that is negligible (*).

(*) on iMX8MM/MN and STM32MP1

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Add <linux/sizes.h>]
Signed-off-by: Tom Rini <trini@konsulko.com>