platform/kernel/u-boot.git
2 years agopci: iproc: Set all 24 bits of PCI class code
Pali Rohár [Wed, 5 Jan 2022 09:50:20 +0000 (10:50 +0100)]
pci: iproc: Set all 24 bits of PCI class code

Register 0x43c in its low 24 bits contains PCI class code.

Update code to set all 24 bits of PCI class code and not only upper 16 bits
of PCI class code.

Use standard U-Boot macro (PCI_CLASS_BRIDGE_PCI << 8) for constructing all
24-bits of PCI class for PCI bridge Normal decode.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Roman Bacik <roman.bacik@broadcom.com>
2 years agoMerge branch '2022-01-24-assorted-fixes-and-updates'
Tom Rini [Mon, 24 Jan 2022 15:39:28 +0000 (10:39 -0500)]
Merge branch '2022-01-24-assorted-fixes-and-updates'

- Assorted dumpimage/mkimage fixes, allow setting the signature
  algorithm on the command line with mkimage
- Bugfix to the misc uclass, CONFIG_MP / CMD_MP Kconfig logic improved,
  updated Xen platform MAINTAINERS entry and fixed vexpress_aemv8a_semi
  booting.

2 years agocmd: Add Kconfig option for multiprocessor cmds
Ashok Reddy Soma [Mon, 17 Jan 2022 09:16:50 +0000 (10:16 +0100)]
cmd: Add Kconfig option for multiprocessor cmds

Add Kconfig option(CONFIG_CMD_MP) to enable or disable multiprocessor
commands. Compile cmd/mp.c based on CONFIG_CMD_MP.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agomkimage: struct stat.st_size may not be long
Heinrich Schuchardt [Sat, 15 Jan 2022 19:12:56 +0000 (20:12 +0100)]
mkimage: struct stat.st_size may not be long

The component st_size of struct stat is of type off_t. Depending on the
system printing it using %ld leads to a warning:

tools/mkimage.c:438:54: warning: format '%ld' expects argument of type
'long int', but argument 5 has type
'off_t' {aka 'long long int'} [-Wformat=]
  438 |     "%s: Bad size: \"%s\" is not valid image: size %ld < %u\n",
      |                                                    ~~^
      |                                                      |
      |                                                      long int
      |                                                    %lld

When comparing an off_t value to a 32bit integer we should not convert to
uint32_t but to off_t which may be wider.

Reported-by: Milan P. Stanić <mps@arvanta.net>
Fixes: 331f0800f1a3 ("mkimage: allow -l to work on block devices on Linux")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoMAINTAINERS: Update e-mail in Xen maintainership
Anastasiia Lukianenko [Wed, 19 Jan 2022 20:49:21 +0000 (22:49 +0200)]
MAINTAINERS: Update e-mail in Xen maintainership

Changing e-mail because of leaving EPAM.

Signed-off-by: Anastasiia Lukianenko <vicooodin@gmail.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2 years agomkimage: Allow to specify the signature algorithm on the command line
Jan Kiszka [Fri, 14 Jan 2022 09:21:19 +0000 (10:21 +0100)]
mkimage: Allow to specify the signature algorithm on the command line

This permits to prepare FIT image description that do not hard-code the
final choice of the signature algorithm, possibly requiring the user to
patch the sources.

When -o <algo> is specified, this information is used in favor of the
'algo' property in the signature node. Furthermore, that property is set
accordingly when writing the image.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agomkimage: Drop unused OPT_STRING constant
Jan Kiszka [Fri, 14 Jan 2022 09:21:18 +0000 (10:21 +0100)]
mkimage: Drop unused OPT_STRING constant

The actual opt string is inlined - and different. Seems this was a
left-over from older versions of 603e26f76346.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoimage-fit: Make string of algo parameter constant
Jan Kiszka [Fri, 14 Jan 2022 09:21:17 +0000 (10:21 +0100)]
image-fit: Make string of algo parameter constant

Modifications would be invalid.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomisc: mark write buffer const
John Keeping [Tue, 11 Jan 2022 17:04:49 +0000 (17:04 +0000)]
misc: mark write buffer const

The write operation in misc_ops already takes a "const void *" buffer,
but misc_write() takes a mutable "void *".  There's no reason for this,
so make misc_write() consistent with the standard write() prototype.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotools/fitimage: make sure dumpimage still works when "@" are detected
Stefan Eichenberger [Mon, 10 Jan 2022 17:48:32 +0000 (18:48 +0100)]
tools/fitimage: make sure dumpimage still works when "@" are detected

fit_verify_header fails if it detects unit addresses "@". However, this
will break tools like dumpimage on fit images which worked with previous
versions of the tool (e.g. 2020.04 vs 2021.07). As an example the output
of:
dumpimage -l <fit image>
is:
FIT description: U-Boot fitImage for Linux Distribution
Created:         Thu Jan  1 01:00:00 1970
 Image 0 (kernel@1)
  Description:  Linux kernel
  Created:      Thu Jan  1 01:00:00 1970
  Type:         Kernel Image
  Compression:  gzip compressed
  Data Size:    6442456 Bytes = 6291.46 KiB = 6.14 MiB
  Architecture: AArch64
  OS:           Linux
  Load Address: 0x80080000
  Entry Point:  0x80080000
  Hash algo:    sha256
  Hash value:   ...
 Image 1 (fdt@freescale_fsl-s32g274a-evb.dtb)
  Description:  Flattened Device Tree blob
  Created:      Thu Jan  1 01:00:00 1970
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    39661 Bytes = 38.73 KiB = 0.04 MiB
  Architecture: AArch64
  Hash algo:    sha256
  Hash value:   ...
 Default Configuration: 'conf@freescale_fsl-s32g274a-evb.dtb'
 Configuration 0 (conf@freescale_fsl-s32g274a-evb.dtb)
  Description:  1 Linux kernel, FDT blob
  Kernel:       kernel@1
  FDT:          fdt@freescale_fsl-s32g274a-evb.dtb
  Hash algo:    sha256
  Hash value:   unavailable

But with newer version it shows:
dumpimage -l <fit image>
GP Header: Size d00dfeed LoadAddr 62f0a4

This commit will output a warning that unit addresses were detected but
will not fail:
dumpimage -l <fit image>
Image contains unit addresses @, this will break signing
...

Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotools/fitimage: remove redundant format check
Stefan Eichenberger [Mon, 10 Jan 2022 17:48:31 +0000 (18:48 +0100)]
tools/fitimage: remove redundant format check

fit_extract_contents does a fit_check_format even thought it was already
checked during imagetool_verify_print_header.
Therefore, this check is not necessary. This commit removes the
redundancy.

Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agovexpress64: semi_defconfig: disable CRC32 support
Andre Przywara [Fri, 21 Jan 2022 16:36:04 +0000 (16:36 +0000)]
vexpress64: semi_defconfig: disable CRC32 support

Commit 270f8710f92f ("crc32: Add crc32 implementation using
__builtin_aarch64_crc32b") enabled the usage of ARMv8 CRC instructions
by default, for all arm64 builds. And indeed all Arm Ltd. v8 Cortex-A
cores support the instructions, and they are mandatory starting with
architecture revision v8.1, so realistically every known hardware
implementation should support them.

The Arm Fastmodel however defaults to the bare minimum ARMv8 feature set
by default, which means v8.0 without the CRC instructions, so U-Boot
hangs very early at the moment, without any output (the boot-wrapper or
TF-A printing the last visible lines).

Support for those instructions can be enabled on the model command line
by either:
-C cluster0.cpu0.enable_crc32=1 (for each core)
or by using a higher architecture revision by default:
-C cluster0.has_arm_v8-1=1 (for each cluster)
Of course any arch revision higher than v8.1 would work as well.

But for the sake of a smooth out-of-the-box experience, let's just
disable the usage of those instructions in the defconfig, to avoid
random hangs without any clues.

Reported-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Marek Vasut <marex@denx.de>
2 years agoMerge tag 'u-boot-stm32-20220124' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 24 Jan 2022 13:19:31 +0000 (08:19 -0500)]
Merge tag 'u-boot-stm32-20220124' of https://source.denx.de/u-boot/custodians/u-boot-stm

- stm32mp15: sync DT with kernel v5.16
- stm32mp15: Enable OF_BOARD config flag
- DHCOM: sync DT with kernel 5.15.12
- stm32mp: Fix USB boot device
- stm32mp: Remove bootcount activation
- stm32mp: Fix board_get_alt_info_mmc()
- board: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated
- stm32prog: add partition name in treat_partition_list error messages

2 years agoconfigs: stm32mp15: Enable OF_BOARD flag
Patrice Chotard [Thu, 20 Jan 2022 07:19:15 +0000 (08:19 +0100)]
configs: stm32mp15: Enable OF_BOARD flag

Since commit 985503439762 ("fdt: Don't call board_fdt_blob_setup()
 without OF_BOARD") board_fdt_blob_setup() is no more called on
STM32MP platforms in trusted boot which hangs during boot process.

Enable OF_BOARD flag to fix this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agostm32prog: add partition name in treat_partition_list error messages
Patrick Delaunay [Tue, 18 Jan 2022 09:33:14 +0000 (10:33 +0100)]
stm32prog: add partition name in treat_partition_list error messages

Add the partition name and remove the line number in error messages
of treat_partition_list() to provide correct information to user of
STM32CubeProgrammer.

The "line number" value was confusing because it is incorrect here;
the index in  part_array[] is not aligned with the line number in
the parsed Layout file, because the empty lines and the lines beginning
by '#' are skipped during the first parsing in parse_flash_layout().

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoboard: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated
Patrick Delaunay [Tue, 11 Jan 2022 15:37:21 +0000 (16:37 +0100)]
board: stm32mp1: solve compilation issue when ENV_IS_IN_MMC is deactivated

Solve compilation issue on undefined CONFIG_SYS_MMC_ENV_DEV when
CONFIG_ENV_IS_IN_MMC is deactivated on STMicroelectronics boards
defconfig

Fixes: 9f97193616f1 ("board: stm32mp1: use CONFIG_SYS_MMC_ENV_DEV when available")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: fix board_get_alt_info_mmc()
Heinrich Schuchardt [Tue, 11 Jan 2022 14:58:08 +0000 (15:58 +0100)]
stm32mp: fix board_get_alt_info_mmc()

MAX_SEARCH_PARTITIONS is the highest possible partition number.
Do not skip the last partition in board_get_alt_info_mmc().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoARM: dts: stm32: Synchronize DHCOM DTs with Linux 5.15.12
Marek Vasut [Thu, 30 Dec 2021 22:46:47 +0000 (23:46 +0100)]
ARM: dts: stm32: Synchronize DHCOM DTs with Linux 5.15.12

Synchronize DH DHCOM DTs with Linux commit 25960cafa06e ("Linux 5.15.12").
There is no functional change to the resulting DTs. The eeprom0 alias and
PHY reset GPIO are now reinstated in SoM u-boot dtsi.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoARM: dts: stm32: Synchronize DHCOR DTs with Linux 5.15.12
Marek Vasut [Thu, 30 Dec 2021 22:46:46 +0000 (23:46 +0100)]
ARM: dts: stm32: Synchronize DHCOR DTs with Linux 5.15.12

Synchronize DH DHCOR DTs with Linux commit 25960cafa06e ("Linux 5.15.12").
There is no functional change to the resulting DTs. The eeprom0 alias is
now reinstated in SoM u-boot dtsi, the PHY reset GPIO is reinstated in AV96
u-boot dtsi.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoarm: dts: stm32mp15: alignment with v5.16
Patrick Delaunay [Fri, 17 Dec 2021 15:30:22 +0000 (16:30 +0100)]
arm: dts: stm32mp15: alignment with v5.16

Device tree alignment with Linux kernel v5.16-rc5
- ARM: dts: stm32: set otg-rev on stm32mp151
- ARM: dts: stm32: use usbphyc ck_usbo_48m as USBH OHCI clock on stm32mp151
- ARM: dts: stm32: fix AV96 board SAI2 pin muxing on stm32mp15
- ARM: dts: stm32: fix SAI sub nodes register range
- ARM: dts: stm32: fix STUSB1600 Type-C irq level on stm32mp15xx-dkx

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: correct the dependency for bootcount configs
Patrick Delaunay [Tue, 7 Dec 2021 09:05:59 +0000 (10:05 +0100)]
stm32mp: correct the dependency for bootcount configs

Default value for CONFIG_SYS_BOOTCOUNT_SINGLEWORD and
CONFIG_SYS_BOOTCOUNT_ADDR are only needed when
CONFIG_BOOTCOUNT_GENERIC is used.

This patch avoids to define these configs when an other bootcount backend
is activated, for example for CONFIG_BOOTCOUNT_ENV.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agostm32mp: remove the bootcount activation
Patrick Delaunay [Tue, 7 Dec 2021 09:05:58 +0000 (10:05 +0100)]
stm32mp: remove the bootcount activation

Today the bootcount is not managed by the Linux kernel for STM32MP15 as
we don't have driver to update the used backup register in TAMP and the
recovery command still executes the normal bootcmd with
'altbootcmd=run bootcmd'.

So the bootcount feature is never used, the config CONFIG_BOOTCOUNT_LIMIT
and the associated environment variable 'altbootcmd' can be removed to
reduce the U-Boot size.

Each boards can re-enable this feature later in their defconfig, if it is
needed, with the expected backend, for example CONFIG_BOOTCOUNT_GENERIC
or CONFIG_BOOTCOUNT_ENV.

CC: Marek Vasut <marex@denx.de>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoARM: dts: stm32: Add DFU support for DHCOR recovery
Marek Vasut [Mon, 6 Dec 2021 20:58:09 +0000 (21:58 +0100)]
ARM: dts: stm32: Add DFU support for DHCOR recovery

This patch configures U-Boot SPL for DHCOR SoM to permit DFU upload of
SPL and subsequent u-boot.itb for recovery or commissioning purposes.

To start U-Boot on DHCOR based board, e.g. Avenger96, proceed as follows:
- Install dfu-util on the host PC (in debian this is package 'dfu-util')

- Power off the Avenger96 board.
- Connect both USB-serial console and USB-OTG microB ports to host PC.
- Switch Avenger96 to USB boot mode -- BOOT0..2 switches all set to 0.
- Power on the Avenger96 board.
- Verify using '$ dmesg' that a new device has been detected as follows:
    New USB device found, idVendor=0483, idProduct=df11, bcdDevice= 2.00
    New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Product: DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
    Manufacturer: STMicroelectronics

- Upload U-Boot SPL:
$ dfu-util -a 1 -D u-boot-spl.stm32
- Upload U-Boot proper:
$ dfu-util -a 0 -D u-boot.itb

- At this point, SPL will wait for user to press "Ctrl-C" on serial
  console. When ready to interact with U-Boot, press Ctrl-C to start
  the bootloader.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoarm: stm32mp: Fix USB boot device report
Marek Vasut [Mon, 6 Dec 2021 20:58:08 +0000 (21:58 +0100)]
arm: stm32mp: Fix USB boot device report

In case the SoC reports the boot device type is USB, it means the SPL was
loaded via BootROM DFU mode. Currently the spl_boot_device() returns boot
device as USB host, change it to DFU instead, so the SPL can continue the
DFU boot and load U-Boot via DFU.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 23 Jan 2022 14:54:49 +0000 (09:54 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sh

- rzg2_beacon updates

2 years agoarm: dts: rz-g2-beacon-u-boot: Enable pinmux for QSPI
Adam Ford [Tue, 11 Jan 2022 13:21:06 +0000 (07:21 -0600)]
arm: dts: rz-g2-beacon-u-boot: Enable pinmux for QSPI

When booting from QSPI, the boot ROM appears to mux the QSPI
pins, but it's not guaranteed to be setup when booting from
eMMC.  Fix this by explicitly configuring the pinmux.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoarm: rmobile: rzg2_beacon: Migrate reset to SYSRESET_PSCI
Adam Ford [Fri, 17 Dec 2021 19:47:59 +0000 (13:47 -0600)]
arm: rmobile: rzg2_beacon: Migrate reset to SYSRESET_PSCI

Instead of a custom cpu_reset function, use the sysreset_psci
instead to reduce redundant code clutter.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoMerge tag 'efi-2022-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 22 Jan 2022 20:43:36 +0000 (15:43 -0500)]
Merge tag 'efi-2022-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc1-2

Documentation:

* describe printf() format codes

UEFI

* enable more algorithms for UEFI image verification, e.g. SHA256-RSA2048

General

* simplify printing short texts for GUIDs
* provide a unit test for printing GUIDs

2 years agoMerge branch '2022-01-21-Kconfig-migrations'
Tom Rini [Fri, 21 Jan 2022 19:01:41 +0000 (14:01 -0500)]
Merge branch '2022-01-21-Kconfig-migrations'

- Migrate CONFIG_KEEP_SERVERADDR, CONFIG_UDP_CHECKSUM, CONFIG_TIMESTAMP,
  CONFIG_BOOTP_SERVERIP, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR,
  CONFIG_SYS_MAX_FLASH_BANKS_DETECT, CONFIG_SYS_MAX_FLASH_BANKS and
  CONFIG_AT91_EFLASH to Kconfig

2 years agoConvert CONFIG_AT91_EFLASH to Kconfig
Patrick Delaunay [Tue, 4 Jan 2022 13:24:01 +0000 (14:24 +0100)]
Convert CONFIG_AT91_EFLASH to Kconfig

This converts the following to Kconfig:
   CONFIG_AT91_EFLASH

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Eugen Hristev <eugen.hristev@microchip.com>
2 years agoconfigs: Migrate CONFIG_SYS_MAX_FLASH_BANKS to Kconfig
Patrick Delaunay [Tue, 4 Jan 2022 13:24:00 +0000 (14:24 +0100)]
configs: Migrate CONFIG_SYS_MAX_FLASH_BANKS to Kconfig

Use moveconfig.py script to convert define CONFIG_SYS_MAX_FLASH_BANKS
and CONFIG_SYS_MAX_FLASH_BANKS_DETECT to Kconfig and move these entries
to defconfigs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
[trini: Re-switch to IS_ENABLED check in spi-nor-core.c, re-run migration]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agomtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean
Patrick Delaunay [Tue, 4 Jan 2022 13:23:59 +0000 (14:23 +0100)]
mtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean

Prepare migration to Kconfig.

CONFIG_SYS_MAX_FLASH_BANKS_DETECT becomes boolean and
CONFIG_SYS_MAX_FLASH_BANKS define the MAX size, also used
for detection when CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
(CFI_MAX_FLASH_BANKS = CONFIG_SYS_MAX_FLASH_BANKS).

CONFIG_SYS_MAX_FLASH_BANKS become mandatory when
CONFIG_SYS_MAX_FLASH_BANKS_DETECT is activated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomtd: cfi: introduce CFI_FLASH_BANKS
Patrick Delaunay [Tue, 4 Jan 2022 13:23:58 +0000 (14:23 +0100)]
mtd: cfi: introduce CFI_FLASH_BANKS

Replace CONFIG_SYS_MAX_FLASH_BANKS by CFI_FLASH_BANKS to prepare
Kconfig migration and avoid to redefine CONFIG_SYS_MAX_FLASH_BANKS
in cfi_flash.h.

After this patch CONFIG_SYS_MAX_FLASH_BANKS should be never used in
the cfi code: use CFI_MAX_FLASH_BANKS for struct size or CFI_FLASH_BANKS
for number of CFI banks which can be dynamic.

This patch modify all the files which include mtd/cfi_flash.h.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocmd: Fix up warnings in flash.c
Patrick Delaunay [Tue, 4 Jan 2022 13:23:57 +0000 (14:23 +0100)]
cmd: Fix up warnings in flash.c

Tidy up the warnings reported by checkpatch.pl to prepare next patches

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agospl: Convert SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig
Alexandru Gagniuc [Thu, 30 Dec 2021 16:39:59 +0000 (10:39 -0600)]
spl: Convert SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig

Falcon mode is very useful in improving boot speed. A question that
Falcon mode asks is "Where do I look for the kernel". With MMC boot
media, the correct answer is CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR.
The scope of this patch is to move this to Kconfig.

It is possible for a system to support Falcon mode from NOR but not
MMC. In that case, mmc_load_image_raw_os() would not be used. To
address this, conditionally compile mmc_load_image_raw_os() when
SPL_FALCON_BOOT_MMCSD, instead of SPL_OS_BOOT.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Move spl_start_uboot to its own guard in spl_mmc.c, rerun migration]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Drop #ifdefs with CONFIG_BOOTP_SERVERIP
Simon Glass [Sat, 18 Dec 2021 18:27:52 +0000 (11:27 -0700)]
net: Drop #ifdefs with CONFIG_BOOTP_SERVERIP

Use IS_ENABLED() instead, to reduce the number of build paths.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoConvert CONFIG_BOOTP_SERVERIP to Kconfig
Simon Glass [Sat, 18 Dec 2021 18:27:51 +0000 (11:27 -0700)]
Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
   CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoConvert CONFIG_TIMESTAMP to Kconfig
Simon Glass [Sat, 18 Dec 2021 18:27:50 +0000 (11:27 -0700)]
Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
   CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoConvert CONFIG_UDP_CHECKSUM to Kconfig
Simon Glass [Sat, 18 Dec 2021 18:27:49 +0000 (11:27 -0700)]
Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
   CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoConvert CONFIG_KEEP_SERVERADDR to Kconfig
Simon Glass [Sat, 18 Dec 2021 18:27:48 +0000 (11:27 -0700)]
Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
   CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 20 Jan 2022 17:40:20 +0000 (12:40 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- fdt_support: Add fdt_for_each_node_by_compatible() helper macro
  (Marek)
- turris_omnia: Fixup SATA or PCIe nodes at runtime in DT blob (Pali)
- pci_mvebu: Add support for Kirkwood PCIe controllers (Pali)
- SPL: More verifications for kwbimage in SPL (Pali)
- mvebu: Remove comphy_update_map() (Pali)
- Minor misc stuff

2 years agoMerge tag 'u-boot-amlogic-20220120' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 20 Jan 2022 14:40:04 +0000 (09:40 -0500)]
Merge tag 'u-boot-amlogic-20220120' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Disable CONFIG_NET_RANDOM_ETHADDR for android configs
- meson64_android: define raw parts for bootloader to permit flashing with fastboot
- vim3: configure serial# from ethaddr to permit using fastboot like sei510/610

2 years agoMerge tag 'doc-2022-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 20 Jan 2022 14:39:45 +0000 (09:39 -0500)]
Merge tag 'doc-2022-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-2022-04-rc1

Replace @return by Return: in code comments.

2 years agoarm: a37xx: Disable CONFIG_DEBUG_UART_ANNOUNCE
Pali Rohár [Tue, 18 Jan 2022 09:43:23 +0000 (10:43 +0100)]
arm: a37xx: Disable CONFIG_DEBUG_UART_ANNOUNCE

After next branch was merged to v2022.01 release, U-Boot on A3720 started
printing "<debug_uart>" line on UART during booting. There is no need to
print this debug line by default, so disable it via config option
CONFIG_DEBUG_UART_ANNOUNCE in all config files for Armada 3720 boards.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agophy: marvell: Remove unused function comphy_update_map()
Pali Rohár [Tue, 18 Jan 2022 09:33:20 +0000 (10:33 +0100)]
phy: marvell: Remove unused function comphy_update_map()

This weak function is not used anymore, so completely remove it.

Private struct comphy_map is not used by any board code anymore, so move it
into private driver header file comphy_core.h.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_mox: Convert comphy_update_map() to board_fix_fdt()
Pali Rohár [Tue, 18 Jan 2022 09:33:19 +0000 (10:33 +0100)]
arm: mvebu: turris_mox: Convert comphy_update_map() to board_fix_fdt()

Code in board_fix_fdt() already detects connected MOX modules so there is
no need to have custom comphy_update_map() function for setting serdes
speeds.

This change sets phy-mode for MOX SFP module (when present) to sgmii.
Comphy driver then sets sgmii serdes speed for this module to 1.25G.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agodrivers: octeon: get rid of Unicode in code
Heinrich Schuchardt [Sun, 16 Jan 2022 22:11:58 +0000 (23:11 +0100)]
drivers: octeon: get rid of Unicode in code

Placing Unicode control codes <U+0080><U+0093> in the middle of a comment
does not make much sense. Let's get rid of all Unicode in
drivers/ram/octeon/octeon3_lmc.c.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: spl: Fix 100 column exceeds
Marek Behún [Fri, 14 Jan 2022 13:31:45 +0000 (14:31 +0100)]
arm: mvebu: spl: Fix 100 column exceeds

Fix 100 column exceeds in arch/arm/mach-mvebu/spl.c.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible
Marek Behún [Fri, 14 Jan 2022 13:31:44 +0000 (14:31 +0100)]
arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible

Use the preferred
  if (IS_ENABLED(X))
instead of
  #ifdef X
where possible.

There are still places where this is not possible or is more complicated
to convert in this file. Leave those be for now.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t
Marek Behún [Fri, 14 Jan 2022 13:31:43 +0000 (14:31 +0100)]
arm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t

Checkpatch warns about using uint32/16/8_t instead of u32/16/8.

Use the preferred types.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: spl: Print srcaddr in error message
Marek Behún [Fri, 14 Jan 2022 13:31:42 +0000 (14:31 +0100)]
arm: mvebu: spl: Print srcaddr in error message

Print the wrong srcaddr (spl_image->offset) in error message also for
SATA case.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Check for kwbimage data checksum
Pali Rohár [Fri, 14 Jan 2022 13:31:41 +0000 (14:31 +0100)]
arm: mvebu: Check for kwbimage data checksum

Last 4 bytes of kwbimage boot image is checksum. Verify it via the new
spl_check_board_image() function which is called by U-Boot SPL after
loading kwbimage.

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>
2 years agoSPL: Add support for checking board / BootROM specific image types
Pali Rohár [Fri, 14 Jan 2022 13:31:40 +0000 (14:31 +0100)]
SPL: Add support for checking board / BootROM specific image types

Commit 9baab60b8054 ("SPL: Add support for parsing board / BootROM specific
image types") added support for loading board specific image types.

This commit adds support for a new weak function spl_parse_board_header()
which is called after loading boot image. Board may implement this function
for checking if loaded board specific image is valid.

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>
2 years agoarm: mvebu: Check that kwbimage blockid matches boot mode
Pali Rohár [Fri, 14 Jan 2022 13:31:39 +0000 (14:31 +0100)]
arm: mvebu: Check that kwbimage blockid matches boot mode

Each boot mode has its own kwbimage specified by blockid. So check that
kwbimage is valid by blockid.

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>
2 years agoSPL: Add struct spl_boot_device parameter into spl_parse_board_header()
Pali Rohár [Fri, 14 Jan 2022 13:31:38 +0000 (14:31 +0100)]
SPL: Add struct spl_boot_device parameter into spl_parse_board_header()

Add parameter spl_boot_device to spl_parse_board_header(), which allows
the implementations to see from which device we are booting and do
boot-device-specific checks of the image header.

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>
2 years agoarm: mvebu: Check that kwbimage offset and blocksize are valid
Pali Rohár [Fri, 14 Jan 2022 13:31:37 +0000 (14:31 +0100)]
arm: mvebu: Check that kwbimage offset and blocksize are valid

There are certain restrictions for kwbimage offset and blocksize.
Validate them.

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>
2 years agopci: pci_mvebu: Add support for Kirkwood PCIe controllers
Pali Rohár [Thu, 13 Jan 2022 13:28:04 +0000 (14:28 +0100)]
pci: pci_mvebu: Add support for Kirkwood PCIe controllers

Kirkwood uses macros KW_DEFADR_PCI_MEM and KW_DEFADR_PCI_IO for base
address of PCIe mappings. Size of PCIe windows is not defined in any macro
yet, so export them in new KW_DEFADR_PCI_MEM_SIZE and KW_DEFADR_PCI_IO_SIZE
macros.

Kirkwood arch code already maps mbus windows for io and mem, so avoid
calling mvebu_mbus_add_window_by_id() function which would try to do
duplicate window mapping.

Kirkwood PCIe controllers already use "marvell,kirkwood-pcie" DT compatible
string, so mark pci_mvebu.c driver as compatible for it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: turris_omnia: Fixup SATA or PCIe nodes at runtime in DT blob
Pali Rohár [Mon, 10 Jan 2022 10:47:18 +0000 (11:47 +0100)]
arm: mvebu: turris_omnia: Fixup SATA or PCIe nodes at runtime in DT blob

On of the MiniPCIe ports on Turris Omnia is also a mSATA port. Whether
it works in SATA or PCIe mode is determined by a strapping pin, which
value is read from the MCU.

We already determine which type of card is connected when configuring
SerDeses.

But until now we left both SATA and PCIe port 0 nodes in device tree
enabled, and so the SATA driver is probed in U-Boot / Linux even if we
know there is no mSATA card, and similarly PCIe driver tries to link on
port 0 even if we know there is mSATA card, not a PCIe card.

Fixup device tree blob to disable SATA node if mSATA card is not
present, and to disable PCIe port 0 node if mSATA card is present.

Do this for U-Boot's DT blob before relocation and also for kernel DT
blob before booting.

This ensures that software does not try to use SATA or PCIe HW when
corresponding PHY is not configured.

Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored and fixed some issues ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agofdt_support: Add fdt_for_each_node_by_compatible() helper macro
Marek Behún [Thu, 20 Jan 2022 00:04:42 +0000 (01:04 +0100)]
fdt_support: Add fdt_for_each_node_by_compatible() helper macro

Add macro fdt_for_each_node_by_compatible() to allow iterating over
fdt nodes by compatible string.

Convert various usages of
    off = fdt_node_offset_by_compatible(fdt, start, compat);
    while (off > 0) {
        code();
        off = fdt_node_offset_by_compatible(fdt, off, compat);
    }
and similar, to
    fdt_for_each_node_by_compatible(off, fdt, start, compat)
        code();

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard: amlogic: vim3: configure serial# from ethaddr
Mattijs Korpershoek [Wed, 19 Jan 2022 14:24:00 +0000 (15:24 +0100)]
board: amlogic: vim3: configure serial# from ethaddr

The Khadas VIM3 and VIM3L boards, which are supported in Android via
Yukawa [1] need a serial number for usb/fastboot enumeration.

Whenever the environment does not provide a serial#, use the eth mac
address as serial#.

[1] https://source.android.com/setup/build/devices#vim3_and_vim3l_boards

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220119142400.127342-1-mkorpershoek@baylibre.com
2 years agoconfigs: meson64_android: define raw parts for bootloader
Mattijs Korpershoek [Fri, 7 Jan 2022 16:39:13 +0000 (17:39 +0100)]
configs: meson64_android: define raw parts for bootloader

Per the android documentation[1]:
- the mmc2boot0 partition should be labeled "bootloader".
- the mmc2boot1 partition should be labeled "bootenv".

Also the u-boot documentation[2] refers to a BOOT1_OFFSET of 1 block.

Define 2 raw partitions to store the bootloaders and the bootenv.

[1] https://source.android.com/setup/build/devices#vim3-fastboot
[2] https://u-boot.readthedocs.io/en/latest/board/amlogic/khadas-vim3l.html

Suggested-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220107163913.3393563-1-mkorpershoek@baylibre.com
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2 years agoconfigs: amlogic: Disable CONFIG_NET_RANDOM_ETHADDR for android
Mattijs Korpershoek [Wed, 12 Jan 2022 08:40:23 +0000 (09:40 +0100)]
configs: amlogic: Disable CONFIG_NET_RANDOM_ETHADDR for android

The Khadas vim3 and vim3l defconfigs introduced with:
f89b90d2d9 ("configs: add khadas-vim3{l}_android for AOSP support")
425f06f86e ("configs: prepare khadas-vim3{l}_ab_android for AOSP support")

were based on an outdated defconfig prior to the ede1f4f297 ("configs:
amlogic: Disable CONFIG_NET_RANDOM_ETHADDR when unnecessary") cleanup.

Disable CONFIG_NET_RANDOM_ETHADDR for the android configs as well to
stay consistent.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220112084023.2858375-1-mkorpershoek@baylibre.com
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2 years agodoc: replace @return by Return:
Heinrich Schuchardt [Wed, 19 Jan 2022 17:05:50 +0000 (18:05 +0100)]
doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge tag 'xilinx-for-v2022.04-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 19 Jan 2022 16:43:44 +0000 (11:43 -0500)]
Merge tag 'xilinx-for-v2022.04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2022.04-rc1

gpio:
- Add modepin driver

net:
- Save random mac addresses to eth variable

zynqmp gem:
- Add support for mdio bus DT description
- Add support for reset and SGMII phy configuration
- Reduce timeout for MDIO accesses

zynqmp clk:
- Fix clock handling for gem and usb

phy:
- Add zynqmp phy/serdes driver

serial:
- Add one missing compatible string

microblaze:
- Symbol alignement
- SPL fixups
- Code cleanups

zynqmp:
- Various dt changes, DP pre-reloc, gem resets, gem clocks
- Switch SOM to shared psu configuration
- Move dcache handling to firmware driver
- Workaround gmii2rgmii DT description issue
- Enable broadcasts again
- Change firmware enablement logic
- Small adjustement in firmware driver

versal:
- Support new mmc@ DT nodes
- Fix run time variable handling
- Add missing I2C_PMC ID for power domain

2 years agodoc: samsung: axy17lte: Fix underlines
Tom Rini [Wed, 19 Jan 2022 16:06:07 +0000 (11:06 -0500)]
doc: samsung: axy17lte: Fix underlines

A few sections had underlines that were too short, correct.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agodoc: printf() codes
Heinrich Schuchardt [Wed, 19 Jan 2022 00:20:45 +0000 (01:20 +0100)]
doc: printf() codes

Document the format specifier codes used by U-Boot's printf()
implementation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: fix description of build dependencies for Alpine Linux
Heinrich Schuchardt [Sat, 15 Jan 2022 19:35:37 +0000 (20:35 +0100)]
doc: fix description of build dependencies for Alpine Linux

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agolib/crypto: Enable more algorithms in cert verification
Ilias Apalodimas [Wed, 19 Jan 2022 11:54:41 +0000 (13:54 +0200)]
lib/crypto: Enable more algorithms in cert verification

Right now the code explicitly limits us to sha1,256 hashes with RSA2048
encryption.  But the limitation is artificial since U-Boot supports
a wider range of algorithms.

The internal image_get_[checksum|crypto]_algo() functions expect an
argument in the format of <checksum>,<crypto>.  So let's remove the size
checking and create the needed string on the fly in order to support
more hash/signing combinations.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoefi_loader: printing TCG2 protocol GUID
Heinrich Schuchardt [Sun, 16 Jan 2022 16:46:38 +0000 (17:46 +0100)]
efi_loader: printing TCG2 protocol GUID

We support the TCG2 protocol. Allow command efidebug to print it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_selftest: implement printing GUIDs
Heinrich Schuchardt [Sun, 16 Jan 2022 14:49:17 +0000 (15:49 +0100)]
efi_selftest: implement printing GUIDs

The ESRT test may try to print a GUID if an error occurs.
Implement the %pU print code.

Correct the ESRT test to use %pU instead of %pUl to avoid the output
of character 'l'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: printenv: simplify printing GUIDs
Heinrich Schuchardt [Sun, 16 Jan 2022 13:53:37 +0000 (14:53 +0100)]
cmd: printenv: simplify printing GUIDs

Use "%pS" to print text representations of GUIDs.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: use %pUs for printing GUIDs
Heinrich Schuchardt [Sun, 16 Jan 2022 13:15:31 +0000 (14:15 +0100)]
efi_loader: use %pUs for printing GUIDs

For printing GUIDs with macro EFI_ENTRY use %pUs instead of %pUl to provide
readable debug output.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: efidebug: simplify printing GUIDs
Heinrich Schuchardt [Sun, 16 Jan 2022 13:10:23 +0000 (14:10 +0100)]
cmd: efidebug: simplify printing GUIDs

Use "%pS" to print text representations of GUIDs.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agotest: add test for %pUs
Heinrich Schuchardt [Sun, 16 Jan 2022 12:22:06 +0000 (13:22 +0100)]
test: add test for %pUs

Add a unit test for the %pUs printf code.

Use ut_asserteq_str() for checking string results.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agosandbox: imply PARTITION_TYPE_GUID
Heinrich Schuchardt [Sun, 16 Jan 2022 12:04:06 +0000 (13:04 +0100)]
sandbox: imply PARTITION_TYPE_GUID

CONFIG_PARTITION_TYPE_GUID=y is needed for testing some GPT related
functionality.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodisk: simplify part_print_efi()
Heinrich Schuchardt [Sun, 16 Jan 2022 11:23:19 +0000 (12:23 +0100)]
disk: simplify part_print_efi()

Use printf code %pUs to print the text representation of the partition type
GUID.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agolib: printf code %pUs for GUID text representation
Heinrich Schuchardt [Sun, 16 Jan 2022 10:59:21 +0000 (11:59 +0100)]
lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agolib: compile uuid_guid_get_str if CONFIG_LIB_UUID=y
Heinrich Schuchardt [Sun, 16 Jan 2022 10:55:39 +0000 (11:55 +0100)]
lib: compile uuid_guid_get_str if CONFIG_LIB_UUID=y

Currently uuid_guid_get_str() is only built if
CONFIG_PARTITION_TYPE_GUID=y.

To make it usable for other GUIDs compile it if CONFIG_LIB_UUID=y.
The linker will take care of removing it if it is unused.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agofirmware: zynqmp: Do not report error if node is already configured
Michal Simek [Fri, 14 Jan 2022 12:25:37 +0000 (13:25 +0100)]
firmware: zynqmp: Do not report error if node is already configured

Power domain driver sends PM fragment to PMUFW. It is sent for every node
which is listed in DT. But some nodes could be already enabled but driver
is not capable to find it out. That's why it blinly sents request for every
listed IP. When PMUFW response by XST_PM_ALREADY_CONFIGURED error code
there is no need to show any error message because node is already enabled.
That's why cover this case with message when DEBUG is enabled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/8c15ef0b68cf191f693d3d010f70ac24cfd8171f.1642163135.git.michal.simek@xilinx.com
2 years agofirmware: zynqmp: Move loading message to debug
Michal Simek [Fri, 14 Jan 2022 12:25:36 +0000 (13:25 +0100)]
firmware: zynqmp: Move loading message to debug

Power domain driver is using this function for every IP which is PD listed.
This can end up with a lot of messages which end up in boot log. That's why
show it only in EL3 as was used in past.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/d73fc8bc663110b6e8d5e70fdb6435d1199e9db8.1642163135.git.michal.simek@xilinx.com
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Wed, 19 Jan 2022 13:09:34 +0000 (08:09 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

- Updates for a{3,7}y17lte platforms

2 years agoarm64: zynqmp: Change firmware dependency
Michal Simek [Fri, 14 Jan 2022 12:08:42 +0000 (13:08 +0100)]
arm64: zynqmp: Change firmware dependency

In case of mini U-Boot configurations there is no need to enable firmware
driver which just consume space for nothing. That's why add an option to
disable it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/d439399160ff3374f2b39f54f7dd70fa8c8bfea0.1642162121.git.michal.simek@xilinx.com
2 years agoarm64: xilinx: dts: Add dma properties to fix dtbs_check warnings
Shravya Kumbham [Fri, 14 Jan 2022 11:44:06 +0000 (12:44 +0100)]
arm64: xilinx: dts: Add dma properties to fix dtbs_check warnings

Update dma name and add #dma-cells properties to fix dtbs_check
warnings.

Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/fedbf83fd5c682b4d61905d2cb790d33c2f079d6.1642160644.git.michal.simek@xilinx.com
2 years agoarm64: zynqmp: Update USB node handle from dwc3 to usb
Manish Narani [Fri, 14 Jan 2022 11:43:35 +0000 (12:43 +0100)]
arm64: zynqmp: Update USB node handle from dwc3 to usb

The DWC3 bindings require all USB node handles to be '^usb@[0-9a-f]+$'.
Update the same in ZynqMP device tree.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/26fc2777eeb92cb5cb1d558d7c19cfb54ac42d0c.1642160613.git.michal.simek@xilinx.com
2 years agoarm64: zynqmp: Change compatible strings for cadence uart
Michal Simek [Fri, 14 Jan 2022 11:43:05 +0000 (12:43 +0100)]
arm64: zynqmp: Change compatible strings for cadence uart

Based on Linux kernel DT binding there should be different compatible
strings used that's why align zynqmp.dtsi with it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/e2404ccd22fd97fe6020be0b3b6eb3c8677f55b0.1642160583.git.michal.simek@xilinx.com
2 years agoMerge branch '2022-01-18-platform-updates'
Tom Rini [Tue, 18 Jan 2022 21:07:33 +0000 (16:07 -0500)]
Merge branch '2022-01-18-platform-updates'

- cubieboard7 MMC support, AST2600 MAC support

2 years agomiiphy.h: Remove CONFIG_DM_xxx guards
Tom Rini [Tue, 18 Jan 2022 18:38:00 +0000 (13:38 -0500)]
miiphy.h: Remove CONFIG_DM_xxx guards

Function prototypes must not be guarded with ifdef tests.  Doing so
prevents us from doing:
if (CONFIG_IS_ENABLED(FOO))
  func();

as that results in a warning when CONFIG_FOO is not enabled.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoclk: ast2600: Revise MII interface delay
Dylan Hung [Thu, 9 Dec 2021 02:12:28 +0000 (10:12 +0800)]
clk: ast2600: Revise MII interface delay

The clock delay of the RMII/RGMII interface is controlled by SCU340~35C.
These values are obtained by measurement and experiments so we simply
use macro to define them.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoconfigs: ast2600: enable DM_MDIO and MDIO driver
Dylan Hung [Thu, 9 Dec 2021 02:12:27 +0000 (10:12 +0800)]
configs: ast2600: enable DM_MDIO and MDIO driver

Enable DM_MDIO and Aspeed MDIO driver for AST2600 EVB.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoARM: dts: ast2600: Add MDIO devices
Dylan Hung [Thu, 9 Dec 2021 02:12:26 +0000 (10:12 +0800)]
ARM: dts: ast2600: Add MDIO devices

There are 4 MDIO bus controllers in AST2600 SOC.  Each of them can
connect to one or more PHY chips and is flexible to work with the 4 MAC
devices in AST2600.  On AST2600 EVB, MDIO 0,1,2,3 connect to the PHY
chips used by MAC 0,1,2,3 respectively.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: ftgmac100: Add Aspeed AST2600 support
Dylan Hung [Thu, 9 Dec 2021 02:12:25 +0000 (10:12 +0800)]
net: ftgmac100: Add Aspeed AST2600 support

Add support of the MAC controller of Aspeed AST2600 SOC.  The MAC
controller is the same with AST2500, except it has stand-alone MDIO
hardware block.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: ftgmac100: Add DM_MDIO support
Dylan Hung [Thu, 9 Dec 2021 02:12:24 +0000 (10:12 +0800)]
net: ftgmac100: Add DM_MDIO support

Add support for DM_MDIO to connect to PHY.  For the systems that have a
stand-alone MDIO hardware block, enable CONFIG_DM_MDIO to use driver
model for MDIO devices.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoconfigs: Enable mmc support
Amit Singh Tomar [Sun, 28 Nov 2021 11:32:25 +0000 (17:02 +0530)]
configs: Enable mmc support

This commits enables mmc on the Actions Cubieboard7 board.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
2 years agommc: actions: add MMC driver for Actions OWL S700/S900
Amit Singh Tomar [Sun, 28 Nov 2021 11:32:24 +0000 (17:02 +0530)]
mmc: actions: add MMC driver for Actions OWL S700/S900

This commit adds support for MMC controllers found on Actions OWL
SoC platform(S700/S900).

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
2 years agoARM: dts: s700: add MMC/SD controller node
Amit Singh Tomar [Sun, 28 Nov 2021 11:32:23 +0000 (17:02 +0530)]
ARM: dts: s700: add MMC/SD controller node

This patch adds node for mmc/sd controller found on Action Semi OWL
S700 SoC.

Since, upstream Linux binding has not been merged for S700 MMC/SD
controller, Changes are put in u-boot specific dtsi file.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
2 years agoARM: dts: sync Actions Semi S700 DT from Linux v5.16-rc3
Amit Singh Tomar [Thu, 2 Dec 2021 18:23:28 +0000 (23:53 +0530)]
ARM: dts: sync Actions Semi S700 DT from Linux v5.16-rc3

This Synchronizes the Actions Semi S700 SoC DT changes from
commit "g58e1100fdc59" ("Linux v5.16-rc3").

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
2 years agoclk: actions: Add SD/MMC clocks
Amit Singh Tomar [Sun, 28 Nov 2021 11:32:21 +0000 (17:02 +0530)]
clk: actions: Add SD/MMC clocks

This commit adds SD/MMC clocks, and provides .set/get_rate callbacks
for SD/MMC device present on Actions OWL S700 SoCs.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
2 years agoclk: actions: Introduce dummy get/set_rate callbacks
Amit Singh Tomar [Sun, 28 Nov 2021 11:32:20 +0000 (17:02 +0530)]
clk: actions: Introduce dummy get/set_rate callbacks

This commit introduces get/set_rate callbacks, these are dummy at
the moment, and can be used to get/set clock for various devices
based on the clk id.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2 years agoMerge branch '2022-01-17-assorted-updates'
Tom Rini [Tue, 18 Jan 2022 17:31:42 +0000 (12:31 -0500)]
Merge branch '2022-01-17-assorted-updates'

- musb gadget pinctrl-single, pxa3xx nand bugfixes
- btrfs BLAKE2 hash support and another btrfs fix
- board_r cleanups

2 years agopinctrl: single: add support for pinctrl-single, pins when #pinctrl-cells = 2
AJ Bagwell [Fri, 3 Dec 2021 15:18:53 +0000 (15:18 +0000)]
pinctrl: single: add support for pinctrl-single, pins when #pinctrl-cells = 2

Changes to the am33xx device (33e9021a) trees have been merged in from
the upstream linux kernel which now means the device tree uses the new
pins format (as of 5.10) where the confinguration can be stores as a
separate configuration value and pin mux mode which are then OR'd
together.

This patch adds support for the new format to u-boot so that
pinctrl-cells is now respected when reading in pinctrl-single,pins
Signed-off-by: Anthony Bagwell <anthony.bagwell@hivehome.com>