]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 years agofs: btrfs: Add more checksum algorithms
Qu Wenruo [Wed, 24 Jun 2020 16:02:48 +0000 (18:02 +0200)]
fs: btrfs: Add more checksum algorithms

This mostly crossports crypto/hash.[ch] from btrfs-progs.

The differences are:
- No blake2 support
  No blake2 related library in U-Boot yet.

- Use uboot xxhash/sha256 directly
  No need to implement the code as U-Boot has already provided the
  interface.

This adds the support for the following csums:
- SHA256
- XXHASH

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
4 years agofs: btrfs: Sync btrfs_btree.h from kernel
Qu Wenruo [Wed, 24 Jun 2020 16:02:47 +0000 (18:02 +0200)]
fs: btrfs: Sync btrfs_btree.h from kernel

This version includes all needed on-disk format from kernel.

Only need to modify the include headers for U-Boot, everything else is
untouched.

Also, since U-Boot btrfs is using a different endian convert timing (at
tree block read time), it needs some forced type conversion before
proper crossport.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
4 years agoMerge branch 'remove-config-nr-dram-banks-v9-2020-08-26' of https://gitlab.denx.de...
Tom Rini [Mon, 7 Sep 2020 18:31:00 +0000 (14:31 -0400)]
Merge branch 'remove-config-nr-dram-banks-v9-2020-08-26' of https://gitlab.denx.de/u-boot/custodians/u-boot-marvell into next

4 years agoPrepare v2020.10-rc4
Tom Rini [Mon, 7 Sep 2020 18:17:33 +0000 (14:17 -0400)]
Prepare v2020.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Sep 2020 18:05:55 +0000 (14:05 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'efi-2020-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 7 Sep 2020 12:49:50 +0000 (08:49 -0400)]
Merge tag 'efi-2020-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-10-rc4

Bug fixes are provided in the following areas:

* convert file system debug and print messages go log messages
* convert UEFI booting messages to log messages
* UEFI related code clean up and simplification

4 years agoefi_selftest: simplify Makefile
Heinrich Schuchardt [Fri, 28 Aug 2020 06:15:37 +0000 (08:15 +0200)]
efi_selftest: simplify Makefile

CONFIG_EFI_LOADER cannot be selected for ARMv7-M CPUs. So don't check it in
the Makefile.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: remove duplicate image size check
Heinrich Schuchardt [Thu, 27 Aug 2020 15:54:53 +0000 (17:54 +0200)]
efi_loader: remove duplicate image size check

The image size is checked in efi_load_pe(). Avoid checking it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi: clean up efi command
Heinrich Schuchardt [Thu, 27 Aug 2020 10:39:03 +0000 (12:39 +0200)]
efi: clean up efi command

* Eliminate superfluous enum value EFI_TABLE_END.
* Use correct variable type for the memory type.
* Check validity of memory type.
* Make efi_build_mem_table static.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: error message if image not authenticated
Heinrich Schuchardt [Thu, 27 Aug 2020 15:51:32 +0000 (17:51 +0200)]
efi_loader: error message if image not authenticated

Currently if the bootefi command fails due to missing authentication, the
user gets no feedback.

Write a log message 'Image not authenticated' if LoadImage() fails due to
missing authentication.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: log function in image loader
Heinrich Schuchardt [Tue, 25 Aug 2020 17:51:20 +0000 (17:51 +0000)]
efi_loader: log function in image loader

Use log_err() for error messages.
Replace debug() by EFI_PRINT().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: log messages for bootefi command
Heinrich Schuchardt [Tue, 25 Aug 2020 17:54:05 +0000 (17:54 +0000)]
efi_loader: log messages for bootefi command

Write log messages when booting via the bootefi command to allow tracking
on the syslog server. Example messages are

    Booting /snp.efi

or

    Booting /MemoryMapped(0x0,0x4fe00000,0x35a40)
    Loading image failed

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: convert error and debug messages to log
Heinrich Schuchardt [Tue, 25 Aug 2020 17:49:16 +0000 (17:49 +0000)]
fs: convert error and debug messages to log

Use log functions for error and debug messages of the file-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 4 Sep 2020 14:09:14 +0000 (10:09 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Fix SATA issue on Armada 3720
- Enable more SPI NOR chips in espressobin defconfig

4 years agodefconfig: espressobin: Add support for ISSI SPI flashes
Konstantin Porotchkin [Mon, 31 Aug 2020 06:48:05 +0000 (08:48 +0200)]
defconfig: espressobin: Add support for ISSI SPI flashes

Enable support of ISSI SPI flashes found on EspressoBIN boards

Change-Id: I6de61c48f108fb4f410f321b9db45887d23212e5
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61455
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agodefconfig: espressobin: Include support for Gigadevice SPI
Konstantin Porotchkin [Mon, 31 Aug 2020 06:48:04 +0000 (08:48 +0200)]
defconfig: espressobin: Include support for Gigadevice SPI

Include support for CONFIG_SPI_FLASH_GIGADEVICE for supporting
newly produces EspressoBin boards (v7)

Change-Id: I5d4b972cbe2ee5a9d52ce9908794ad4e1b59ee3b
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61236
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agophy: marvell: a3700: add sata comphy on lane 2 with invert option
zachary [Fri, 28 Aug 2020 14:56:29 +0000 (16:56 +0200)]
phy: marvell: a3700: add sata comphy on lane 2 with invert option

- This patch moves sata phy powerup from dedicate phy to compphy
  and adds invert option for sata powerup routine.

Change-Id: I1b4e8753e2b2c14c6efa97bca2ffc7d2553d8a90
Signed-off-by: zachary <zhangzg@marvell.com>
Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/53601
Reviewed-by: Igal Liberman <igall@marvell.com>
Tested-by: Igal Liberman <igall@marvell.com>
[a.heider: adapt to mainline]
Signed-off-by: Andre Heider <a.heider@gmail.com>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Thu, 3 Sep 2020 13:48:28 +0000 (09:48 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

- Mostly DFU fixes and r8152 fixes

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 3 Sep 2020 13:00:35 +0000 (09:00 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- SH serial bugfix

4 years agoMerge branch 'for-tom' of https://github.com/lftan/u-boot
Tom Rini [Thu, 3 Sep 2020 12:59:16 +0000 (08:59 -0400)]
Merge branch 'for-tom' of https://github.com/lftan/u-boot

- SoCFPGA bugfix

4 years agoarm: socfpga: soc64: Check FPGA Config status register before bridge reset
Chee Hong Ang [Thu, 6 Aug 2020 03:56:29 +0000 (11:56 +0800)]
arm: socfpga: soc64: Check FPGA Config status register before bridge reset

Instead of querying SDM for FPGA configuration status through mailbox
messages, U-Boot now checks System Manager's FPGA Config status register
for FPGA configuration status before resetting bridge.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
4 years agoAzure/GitLab: Update to latest Docker container
Tom Rini [Wed, 2 Sep 2020 13:22:29 +0000 (09:22 -0400)]
Azure/GitLab: Update to latest Docker container

- New base snapshot
- Fix for high UID/GID numbers on a toolchain

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Tue, 1 Sep 2020 15:02:54 +0000 (11:02 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86

- Fix parsing of "mtrr list" command
- Introduce USE_EARLY_BOARD_INIT option and remove dead codes for most
  x86 boards

4 years agofastboot: getvar: fix partition-size return value
Gary Bisson [Thu, 27 Aug 2020 08:51:14 +0000 (10:51 +0200)]
fastboot: getvar: fix partition-size return value

The size returned by 'getvar partition-size' should be in bytes, not in
blocks as fastboot uses that value to generate empty partition when
running format [1].

Note that the function was already returning the proper size in bytes
for NAND devices (see struct part_info details).

[1]
https://android.googlesource.com/platform/system/core/+/refs/heads/android10-release/fastboot/fastboot.cpp#1500

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
4 years agofastboot: Fix fastboot reboot fail by changing functions order
yurii.pidhornyi [Thu, 20 Aug 2020 15:41:18 +0000 (18:41 +0300)]
fastboot: Fix fastboot reboot fail by changing functions order

It was revealed that when the fastboot_tx_write_str function is called
without the previously initialized fastboot_func->in_req->complete field,
a copy of in_req will be sent to the I/O requests queue without
an initialized field.

Moving a piece of code with the initializing of the
fastboot_func->in_req->complete field above transmit_tx allows to solve
this problem.

Fixes: 65c96757fe9 "usb: fastboot: Convert USB f_fastboot to shared fastboot"
Signed-off-by: yurii.pidhornyi <yurii.pidhornyi@globallogic.com>
4 years agof_sdp: Change bInterval of interrupt endpoint to 3
Sherry Sun [Tue, 18 Aug 2020 10:16:49 +0000 (18:16 +0800)]
f_sdp: Change bInterval of interrupt endpoint to 3

Since the USB HID limits the maximum bandwidth(3072) for interrupt
endpoint transfers, when the bInterval set to 1, we can only support 3
boards to run sdp at the same time. In order to support more boards,
change the bInterval of interrupt endpoint to 3, which will not affect
the transmission speed.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agof_sdp: Add EP1_OUT as default data receive pipe in sdp
Sherry Sun [Tue, 18 Aug 2020 10:16:48 +0000 (18:16 +0800)]
f_sdp: Add EP1_OUT as default data receive pipe in sdp

EP0 has been used to transfer file data in sdp before, but the max
packetsize of ep0 is 64 bytes. So in order to improve the file transfer
speed, here add the EP1_OUT interrupt endpoint which max packetsize is
set to 1024 byte.

After testing, it turns out that using ep1out is twice as fast as using
ep0 while receiving data in sdp.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: add g_dnl_get_board_bcd_device_number
Peng Fan [Tue, 18 Aug 2020 10:16:47 +0000 (18:16 +0800)]
spl: add g_dnl_get_board_bcd_device_number

Add g_dnl_get_board_bcd_device_number, the new BCD value is used by uuu to distinguish
if the SPL supports the SDPV.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agof_sdp: Support searching and loading FIT or container image
Peng Fan [Tue, 18 Aug 2020 10:16:46 +0000 (18:16 +0800)]
f_sdp: Support searching and loading FIT or container image

Add support to f_sdp to search and load iMX8 container image or iMX8M
FIT image by new UUU command SDPV.

When using the SDPV, the uuu will continue to send out data after first
level boot loader used by ROM. This means uuu won't skip to the offset
of the second boot loader, and the padding data before second boot loader
will be sent out. So we have to search the FIT header or container header
in the buffer that SDP received.

Also change to more common method to exit f_sdp handler not depending on
SPL_FIT_FOUND flag because container loader won't set this.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agof_sdp: Fix wrong usb request size
Ye Li [Tue, 18 Aug 2020 10:16:45 +0000 (18:16 +0800)]
f_sdp: Fix wrong usb request size

Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agof_sdp: Add high speed endpoint descriptor
Ye Li [Tue, 18 Aug 2020 10:16:44 +0000 (18:16 +0800)]
f_sdp: Add high speed endpoint descriptor

Add HS endpoint descriptor for SDP. So that we can use high speed endpoint,
and the SDP device can send packet with 512 byte size.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agosdp: call board_usb_init at spl_sdp_load_image
Frank Li [Tue, 18 Aug 2020 10:16:43 +0000 (18:16 +0800)]
sdp: call board_usb_init at spl_sdp_load_image

Need initialize UDC before run sdp download

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agousb: max3420: add the gadget driver
Jassi Brar [Thu, 30 Jul 2020 01:51:27 +0000 (20:51 -0500)]
usb: max3420: add the gadget driver

MAX3420 implements FullSpeed USB Device over SPI.
Another version MAX3421, also implements USB Host mode.
This driver should be good for the device mode of max3421 as well.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
4 years agofastboot: Add default fastboot_set_reboot_flag implementation
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:34 +0000 (23:35 +0300)]
fastboot: Add default fastboot_set_reboot_flag implementation

Default implementation of fastboot_set_reboot_flag function that depends
on "bcb" commands could be used in general case if there are no need to
make any platform-specific implementation, otherwise it could be
disabled via Kconfig option FASTBOOT_USE_BCB_SET_REBOOT_FLAG.

Please note that FASTBOOT_USE_BCB_SET_REBOOT_FLAG is mutually exclusive
with some platforms which already have their own implementation of this
function.

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
4 years agofastboot: Add support for 'reboot fastboot' command
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:33 +0000 (23:35 +0300)]
fastboot: Add support for 'reboot fastboot' command

Android 10 adds support for dynamic partitions and in order to support
this userspace fastboot must be used[1]. New tool fastbootd is
included into recovery.

Userspace fastboot works from recovery and is launched if:
1) - Dynamic partitioning is enabled
2) - Boot control block has 'boot-fastboot' value into command field
The bootloader is expected to load and boot into the recovery image
upon seeing boot-fastboot in the BCB command. Recovery then parses the
BCB message and switches to fastbootd mode[2].

Please note that boot script is expected to handle 'boot-fastboot'
command in BCB and load into recovery mode.

Bootloader must support 'reboot fastboot' command which should reboot
device into userspace fastboot to accomodate those changes[3].

Another command that bootloader must support[3] is 'reboot recovery'. This
command should simply reboot device into recovery mode.

[1] - https://source.android.com/devices/bootloader/fastbootd
[2] - https://source.android.com/devices/bootloader/fastbootd#unified_fastboot_and_recovery
[3] - https://source.android.com/devices/bootloader/fastbootd#modifications_to_the_bootloader

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I9d2bdc9a6f6f31ea98572fe155e1cc8341e9af76

4 years agofastboot: Extend fastboot_set_reboot_flag with reboot reason
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:32 +0000 (23:35 +0300)]
fastboot: Extend fastboot_set_reboot_flag with reboot reason

Extend fastboot_set_reboot_flag arguments with reboot reason so that
it could handle different reboot cases in future.

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
4 years agodfu: fix dfu tftp on sandbox
Heinrich Schuchardt [Wed, 22 Jul 2020 15:46:02 +0000 (17:46 +0200)]
dfu: fix dfu tftp on sandbox

The environment variable loadaddr is in the virtual address space of the
sandbox. To get the actual memory address where the FIT image has been
loaded we have to convert this address according to the memory mapping of
the sandbox.

Equally the addresses in the *.its file have to be converted when used in
the dfu_ram driver.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: qemu: enable dfu testing
Heinrich Schuchardt [Tue, 21 Jul 2020 18:07:48 +0000 (20:07 +0200)]
configs: qemu: enable dfu testing

For testing automated updates via dfu and mtd we need the dfu and mtd
commands as well as preboot support.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodfu: DFU_MTD depends on CMD_MTDPARTS
Heinrich Schuchardt [Tue, 21 Jul 2020 18:06:31 +0000 (20:06 +0200)]
dfu: DFU_MTD depends on CMD_MTDPARTS

Function mtdparts_init() is needed for the DFU MTD driver.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodfu: fix typo parameteres
Heinrich Schuchardt [Fri, 17 Jul 2020 17:55:54 +0000 (19:55 +0200)]
dfu: fix typo parameteres

%s/parameteres/parameters/g

Even if a line exceeds 80 characters we should not split output strings
to make debugging easier.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofastboot: Support defining raw partitions without a partition table
Filip Brozovic [Mon, 29 Jun 2020 11:14:37 +0000 (13:14 +0200)]
fastboot: Support defining raw partitions without a partition table

Add support for defining raw fastboot partitions in eMMC by specifying
the offset and size in an environment variable. Optionally, the eMMC
hardware partition number may also be specified.

This makes it possible to e.g. update only part of the eMMC boot
partition, instead of having to write the entire partition.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
4 years agousb: ci_udc: Add function to remove usb device
Ye Li [Mon, 29 Jun 2020 02:12:59 +0000 (10:12 +0800)]
usb: ci_udc: Add function to remove usb device

When unregister gadget driver in ci_udc, the usb device is not
removed or stop. This causes next "usb start" fails to work.

Add a new interface "usb_remove_ehci_gadget" in usb-uclass to
remove the usb device for DM driver. Using "usb_lowlevel_stop" for
non-DM driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agousb: gadget: Fix controller index in UMS
Ye Li [Mon, 29 Jun 2020 02:12:26 +0000 (10:12 +0800)]
usb: gadget: Fix controller index in UMS

The usb mass storage (f_mass_storage.c) uses fixed usb index 0,
this causes problem while CDNS3 USB controller index is 1.
Modify the API of fsg to pass the controller index.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoeth/r8152: support RTL8153B/RTL8154B
Hayes Wang [Tue, 16 Jun 2020 09:09:47 +0000 (17:09 +0800)]
eth/r8152: support RTL8153B/RTL8154B

This is used to support RTL8153B and RTL8154B.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: modify rtl_clear_bp function
Hayes Wang [Tue, 16 Jun 2020 09:09:46 +0000 (17:09 +0800)]
eth/r8152: modify rtl_clear_bp function

The original rtl_clear_bp() is used to clear the firmware of both
PLA and USB MCU. The new one could clear the firmware of PLA or
USB independently. It is unnecessary to clear firmware, if there
is no one to be updated.

Besides, clear the firmware by writing the relative registers in
bulk.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: reset PHY after setting it
Hayes Wang [Tue, 16 Jun 2020 09:09:45 +0000 (17:09 +0800)]
eth/r8152: reset PHY after setting it

Some settings of PHY have to work after resetting PHY.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: reset bmu after disabling Tx/Rx
Hayes Wang [Tue, 16 Jun 2020 09:09:44 +0000 (17:09 +0800)]
eth/r8152: reset bmu after disabling Tx/Rx

Reset bmu after disabling Tx/Rx. This is used to clear the FIFO of
Tx/Rx. The remained data may be transferred after Tx/Rx is re-enabled.
And it results in garbage data.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoserial: sh: Improve FIFO empty check on RX
Marek Vasut [Sat, 9 May 2020 20:30:05 +0000 (22:30 +0200)]
serial: sh: Improve FIFO empty check on RX

If the SCIF is receiving data quickly enough, it may happen that the
SCxSR_RDxF flag is cleared in sh_serial_getc_generic(), while the
FIFO still contains data. If that happens, the serial_getc_check()
reports no data in the FIFO as the flag is no longer set. Add one
more check, if the SCxSR_RDxF is not set, read out the FIFO level
and if there are still characters in the FIFO, permit reading them
out.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 years agox86: Drop nhlt_serialise()
Simon Glass [Sat, 29 Aug 2020 21:23:07 +0000 (15:23 -0600)]
x86: Drop nhlt_serialise()

This function is not actually used in U-Boot. Drop it.

Suggested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: pinctrl: Fix 'relatove' typo
Simon Glass [Sat, 29 Aug 2020 21:23:06 +0000 (15:23 -0600)]
x86: pinctrl: Fix 'relatove' typo

Fix this typo in the Kconfig help.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: qemu: Remove dead code
Andy Shevchenko [Tue, 1 Sep 2020 08:33:52 +0000 (11:33 +0300)]
x86: qemu: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply replace the rule in it. We use stub C-file
like it's done for other boards.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: slimbootloader: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:33 +0000 (13:02 +0300)]
x86: intel: slimbootloader: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: minnowmax: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:32 +0000 (13:02 +0300)]
x86: intel: minnowmax: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: galileo: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:31 +0000 (13:02 +0300)]
x86: intel: galileo: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: edison: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:30 +0000 (13:02 +0300)]
x86: intel: edison: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: crownbay: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:29 +0000 (13:02 +0300)]
x86: intel: crownbay: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: cougarcanyon2: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:28 +0000 (13:02 +0300)]
x86: intel: cougarcanyon2: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: cherryhill: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:27 +0000 (13:02 +0300)]
x86: intel: cherryhill: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: bayleybay: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:26 +0000 (13:02 +0300)]
x86: intel: bayleybay: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: efi: efi-x86_payload: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:25 +0000 (13:02 +0300)]
x86: efi: efi-x86_payload: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: dfi: dfi-bt700: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:24 +0000 (13:02 +0300)]
x86: dfi: dfi-bt700: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: coreboot: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:23 +0000 (13:02 +0300)]
x86: coreboot: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: congatec: conga-qeval20-qa3-e3845: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:22 +0000 (13:02 +0300)]
x86: congatec: conga-qeval20-qa3-e3845: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: advantech: som-db5800-som-6867: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:21 +0000 (13:02 +0300)]
x86: advantech: som-db5800-som-6867: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Cc: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: Introduce USE_EARLY_BOARD_INIT option
Andy Shevchenko [Thu, 20 Aug 2020 10:02:20 +0000 (13:02 +0300)]
x86: Introduce USE_EARLY_BOARD_INIT option

Introduce USE_EARLY_BOARD_INIT option and select it by the actual users.

Cc: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: mtrr: Fix parsing of "mtrr list" command
Wolfgang Wallner [Fri, 14 Aug 2020 07:55:24 +0000 (09:55 +0200)]
x86: mtrr: Fix parsing of "mtrr list" command

The command 'mtrr' does not recognize the 'list' subcommand any more
since the code restructuring in commit b2a76b3fe75a ("x86: mtrr:
Restructure so command execution is in one place").

The if-else parsing the command arguments does not take 'list' into
account: the if-branch is intended for no subcommands, the else-branch
is intended for the non-list subcommands (which all expect additional
arguments). Calling the 'mtrr list' subcommand leads to a "return
CMD_RET_USAGE" in the else-branch.

Fix this by changing the else-branch to explicitly checking for
if (cmd != 'l').

Fixes: b2a76b3fe75a ("x86: mtrr: Restructure so command execution is in one place")
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoMAINTAINERS: step down as maintainer of UniPhier SoCs
Masahiro Yamada [Mon, 31 Aug 2020 14:52:03 +0000 (23:52 +0900)]
MAINTAINERS: step down as maintainer of UniPhier SoCs

I am leaving Socionext. Orphan the UniPhier platform until somebody
takes the role.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoMerge tag 'ti-v2020.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 31 Aug 2020 17:06:26 +0000 (13:06 -0400)]
Merge tag 'ti-v2020.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- Update to ABI 3.0
- Fix i2c write in eeprom driver

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 31 Aug 2020 13:43:13 +0000 (09:43 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- MVEBU Espressobin fixes and enhancements (fix switch security
  issue, enable MVNETA, enable SD-card, fix COMPHY nodes, default
  env variables, etc)
- MMC Xenon: Set signal voltage and max base clock
- a37xx PCI driver: Depend on DM_GPIO and remove #ifdef's

4 years agoarm: mvebu: Espressobin: Update README.marvell file
Pali Rohár [Thu, 27 Aug 2020 13:01:28 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Update README.marvell file

Include information about permanent ethernet MAC address and add link how
to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
Pali Rohár [Thu, 27 Aug 2020 13:01:27 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

Boot scripts for existing Espressobin Linux distributions, like OpenWRT,
expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases
from fdt_addr_r and kernel_addr_r values.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Change default loadaddr
Pali Rohár [Thu, 27 Aug 2020 13:01:26 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Change default loadaddr

Current loadaddr is not writable on Espressobin and 'loadb' command cause
rebooting board. Marvell's U-Boot already set default loadaddr to value
0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Move env load addresses
Pali Rohár [Thu, 27 Aug 2020 13:01:25 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Move env load addresses

According to Marvell's U-Boot description [1] current env load addresses
overlaps with ATF RT services region and TEE. Because the ATF RT service
and TEE region is going to be marked as secure and can't be overwritten,
use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm64: a37xx: pci: Depends on DM_GPIO
Pali Rohár [Tue, 25 Aug 2020 08:45:04 +0000 (10:45 +0200)]
arm64: a37xx: pci: Depends on DM_GPIO

For proper initialization of aardvark pci driver it is required to
de-assert reset GPIO. So depeneds on DM_GPIO option.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Setup MTD partitions when booting kernel
Pali Rohár [Wed, 19 Aug 2020 14:24:17 +0000 (16:24 +0200)]
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel

Due to different partition layouts in different U-Boot versions, DTS for
Espressobin in Linux does not contain any definition of MTD partitions.
See commit https://git.kernel.org/stable/c/00954566464a4 for more details.

This patch via ft_board_setup() hook fills current partition layout used by
U-Boot, so booted kernel would see correct MTD partitions layout.

U-Boot env partition is calculated from CONFIG_ENV_OFFSET option.

First partition contains secure firmware, ARM trusted firmware and U-Boot
with checksums. So it is not possible to replace just one image (e.g.
U-Boot) without updating other parts where is stored checksum of U-Boot.
Therefore there is no extra partition defined for U-Boot and first
partition is called just 'firmware'.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
Pali Rohár [Wed, 19 Aug 2020 14:24:16 +0000 (16:24 +0200)]
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot

Espressobin board comes with Marvell's U-Boot version where U-Boot env is
stored in SPI at offset 0x3F0000. This patch changes env offset in
Espressobin defconfig file to match Marvell's U-Boot version.

Users who want to use previous or different env offset can still change it
in .config file when compiling U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: dts: a37x0: enable sd card support on espressobin
Wilson Ding [Wed, 19 Aug 2020 14:19:40 +0000 (16:19 +0200)]
arm: dts: a37x0: enable sd card support on espressobin

Enabled SDIO slot 0 (south bridge) for SD card on
Espressobin board.

Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
Signed-off-by: Wilson Ding <dingwei@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
[pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agommc: xenon: set signal voltage and max base clock
Evan Wang [Wed, 19 Aug 2020 14:19:39 +0000 (16:19 +0200)]
mmc: xenon: set signal voltage and max base clock

- The SDIO signal voltage and max base clock frequency
  setting are missing in driver, which causes SDIO
  not working.
- The patch adds SDIO signal voltage switch support,
  which is based on regulator-gpio of vqmmc-supply, and
  sets the max base clock frequency.
- Fix the zero clock value in call to sdhci_setup_cfg()
  function.

Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
Signed-off-by: Evan Wang <xswang@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
Reviewed-by: Hua Jing <jinghua@marvell.com>
Tested-by: Hua Jing <jinghua@marvell.com>
[pali: Amended fixup patch]
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: a37xx: pci: Assert PERST# signal when unloading driver
Pali Rohár [Wed, 19 Aug 2020 13:57:07 +0000 (15:57 +0200)]
arm64: a37xx: pci: Assert PERST# signal when unloading driver

This change ensures that PCIe card is put into reset state when U-Boot
stops using it.

DM_FLAG_OS_PREPARE ensures that U-Boot executes driver's remove callback
prior booting Linux kernel.

Linux kernel pci-aardvark driver needs to reset PCIe card via PERST# signal
prior initializing it. If it does not issue reset then some PCIe cards
(specially Compex WiFi cards) are not detected at all.

Putting PCIe card into reset state prior booting Linux kernel would ensure
that card would be properly reset at time when Linux kernel starts
initializing pci-aardvark driver.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
Pali Rohár [Wed, 19 Aug 2020 13:57:06 +0000 (15:57 +0200)]
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT

Change active-high to active-low and change DT property name from
reset-gpio to reset-gpios. This format of gpio reset is used by
pci-aardvark driver in Linux kernel.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: dts: armada-3720-espressobin: fix COMPHY nodes
Marek Behún [Wed, 19 Aug 2020 09:57:25 +0000 (11:57 +0200)]
arm64: dts: armada-3720-espressobin: fix COMPHY nodes

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada
37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver.
The lanes are defined in comphy_a3700.c as described in functional
specification, that is:
  lane 0 is SGMII1 or USB3
  lane 1 is PCIe or SGMII0
  lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on
lane 1, which is wrong in the sense of the specification and doesn't
work with the comphy_mux code, which is 2 years now (the aardvark driver
causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering
up PCIe PHY doesn't work with lane number at all, and the code for
powering up USB3 PHY works differently only if USB3 is on lane 2, ie.
the check goes like:
  if (lane == 2)
    something
  else
    something else
so it does not differentiate between lanes 0 and 1.

In the future I shall post patches that remove the comphy_a3700 driver
and add comphy driver which uses calls to ATF, like Linux' driver does.
This will have the advantage of same DTS bindings as Linux', but till
this is done, we need this patch.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Pali Rohár <pali@kernel.org>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Enable CONFIG_MVNETA
Pali Rohár [Mon, 17 Aug 2020 15:13:19 +0000 (17:13 +0200)]
arm: mvebu: Espressobin: Enable CONFIG_MVNETA

Espressobin uses mvneta ethernet driver.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports
Pali Rohár [Mon, 17 Aug 2020 14:36:38 +0000 (16:36 +0200)]
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

By default Topaz switch on Espressobin board forwards packets between all
ethernet ports, including CPU (port 0), wan (port 1) and lan (ports 2,3).

This default U-Boot setup is unsuitable for using Espressobin as router as
it opens security hole in forwarding all packets between wan and lan ports.
E.g. dhcp packets from wan network leaks to lan network during small time
window until U-Boot boots Linux kernel which loads network drivers which
disallows forwarding between wan and lan.

This patch fixes above problem. For Espressobin board prior putting Topaz
switch into forwarding mode, Topaz switch is reconfigured to allow
forwarding packets from wan and lan ports only to CPU port. This ensures
that packets from wan port are not forwarded to lan ports and vice-versa.
Packets from CPU port are still forwarded to all other ports, so U-Boot
network boot works with any ethernet port as before.

This problem was already discussed on Espressobin forum [1] and on
Marvell's github issue tracker [2]. As a workaround people on Espressobin
forum patched U-Boot to completely disable lan ports on Topaz switch which
prevented forwarding packets. That workaround had an issue that U-Boot was
unable to netboot via lan ports anymore. Change in this patch does not have
such issue.

This security issue has been dicussed here as well: [3].

[1] - https://web.archive.org/web/20191231164238/http://espressobin.net/forums/topic/boot-behavior-of-the-switch-and-security/
[2] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/issues/18
[3] - https://forum.armbian.com/topic/12635-espressobin-uboot-security-concerns-switch-init-portmask/

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoti: common: Remove additional i2c read for board detection
Michal Simek [Thu, 27 Aug 2020 13:43:48 +0000 (15:43 +0200)]
ti: common: Remove additional i2c read for board detection

There shouldn't be a need to call additional i2c read if above failed
already. Based on comment it should be enough to try to detect legacy
boards which are mentioned in the comment.

Fixes: 2463f6728e82 ("ti: common: board_detect: Allow DM I2C without CONFIG_DM_I2C_COMPAT")
Fixes: 0bea813d0018 ("ARM: omap-common: Add standard access for board description EEPROM")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm: dts: k3-am65: Update the RM resource types
Lokesh Vutla [Mon, 17 Aug 2020 05:30:49 +0000 (11:00 +0530)]
arm: dts: k3-am65: Update the RM resource types

Update the ringacc and udma dt nodes to use the latest RM resource types
similar to the ones used in k3-j721e dt nodes.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agofirmware: ti_sci: Drop unused structure ti_sci_rm_type_map
Lokesh Vutla [Mon, 17 Aug 2020 05:30:48 +0000 (11:00 +0530)]
firmware: ti_sci: Drop unused structure ti_sci_rm_type_map

struct ti_sci_rm_type_map is no longer used. Drop its definition and its
declarations.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agofirmware: ti_sci: drop the device ids to resource id translation table
Lokesh Vutla [Mon, 17 Aug 2020 05:30:47 +0000 (11:00 +0530)]
firmware: ti_sci: drop the device ids to resource id translation table

With ABI 3.0, sysfw deprecated special resource types used for AM65x
SoC. Instead started using device id as resource type similar to the
convention used in J721E SOC.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agoMerge branch '2020-08-27-misc-fixes'
Tom Rini [Fri, 28 Aug 2020 12:51:37 +0000 (08:51 -0400)]
Merge branch '2020-08-27-misc-fixes'

- Fix for gd->ram_top and bootm_size calculations
- Assorted Kconfig entry cleanups / fixes.
- Make checkpatch.pl error on fdt_high/initrd_high=0xffffffff
- Resync scripts/setlocalversion
- Other minor bugfixes

4 years agoscripts/setlocalversion: sync with linux 5.8
Rasmus Villemoes [Tue, 25 Aug 2020 15:28:39 +0000 (17:28 +0200)]
scripts/setlocalversion: sync with linux 5.8

The linux changes since v3.16 are

78283edf2c01 kbuild: setlocalversion: print error to STDERR
b24413180f56 License cleanup: add SPDX GPL-2.0 license identifier to files with no license
6147b1cf1965 scripts/setlocalversion: git: Make -dirty check more robust
8ef14c2c41d9 Revert "scripts/setlocalversion: git: Make -dirty check more robust"
ff64dd485730 scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks
7a82e3fa28f1 scripts/setlocalversion: clear local variable to make it work for sh
991b78fbd223 scripts: setlocalversion: fix a bashism
3c96bdd0ebfa scripts: setlocalversion: replace backquote to dollar parenthesis

and it's ff64dd485730 that is the motivation for this sync. It fixes
false positive "-dirty" added to the version string when building with
Yocto
(https://lists.openembedded.org/g/openembedded-core/message/137702).

There has been one U-Boot specific patch since this was synced with
linux 3.16: 81630a3b38c2 (scripts: setlocalversion: safely extract
variables from auto.conf using awk).  Keep these changes applied.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
[trini: Re-add 81630a3b38c2 and reword message]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoimage: don't exceed gd->ram_top in bootm_size
Baruch Siach [Mon, 24 Aug 2020 17:14:05 +0000 (20:14 +0300)]
image: don't exceed gd->ram_top in bootm_size

When board_get_usable_ram_top() limits gd->ram_top, env_get_bootm_size()
must not exceed that limit. Otherwise, boot_relocate_fdt() might put fdt
out of the allowed RAM range.

The similar commit 8ce1f10cf2b1 ("ARM: bootm: take into account
gd->ram_top") exposed this bug.

This fixes boot on Armada 8040 based Clearfog GT-8K where ram_top is set
to 0x80000000 (2GB), but bi_dram[0].size might be up to 0xc0000000
(3GB). Note the relocated fdt address (0xbfff4000) in the console output
listed below:

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
62 bytes read in 21 ms (2 KiB/s)
1: linux
Retrieving file: /extlinux/Image
13740544 bytes read in 1266 ms (10.4 MiB/s)
Retrieving file: /extlinux/armada-8040-clearfog-gt-8k.dtb
33368 bytes read in 31 ms (1 MiB/s)
   Booting using the fdt blob at 0x4f00000
   Loading Device Tree to 00000000bfff4000, end 00000000bffff257 ... "Synchronous Abort" handler, esr 0x96000045
elr: 000000000006e1cc lr : 0000000000068fd8 (reloc)
elr: 000000007ffa91cc lr : 000000007ffa3fd8
x0 : ffffffffffffffff x1 : 00000000bfffc258
x2 : 0000000000000000 x3 : ffffffffffff7da7
x4 : 0000000004f08258 x5 : 00000000bfff4000
x6 : 00000000bfff4000 x7 : 000000000000000f
x8 : 000000007fb23bf8 x9 : 0000000000000008
x10: 00000000bffff257 x11: 00000000bffff257
x12: 0000000000000000 x13: fffffffffffff000
x14: 00000000bfff4000 x15: 0000000000000021
x16: 000000007ff7bc38 x17: 0000000000000000
x18: 000000007fb2add0 x19: 00000000bfff4000
x20: 0000000004f00000 x21: 000000000000b258
x22: 0000000058820000 x23: 0000000000000010
x24: 000000007ffe3c40 x25: 000000007fb23cb8
x26: 00000000c0000000 x27: 0000000000000000
x28: 000000007fc3fd50 x29: 000000007fb23bd0

Code: 54000061 aa0603e0 d65f03c0 38606882 (38206822)
Resetting CPU ...

Thanks to Patrice CHOTARD who directed me to the right way.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
4 years agocmd: mem: Remove already removed CONFIG_SYS_MEMTEST_SCRATCH
Michal Simek [Mon, 24 Aug 2020 11:17:00 +0000 (13:17 +0200)]
cmd: mem: Remove already removed CONFIG_SYS_MEMTEST_SCRATCH

The commit e519f03a1846 ("cmd: mem: Remove CONFIG_SYS_MEMTEST_SCRATCH
mapping") removed CONFIG_SYS_MEMTEST_SCRATCH but commit 091401131085
("command: Remove the cmd_tbl_t typedef") has added it back. That's why
symbol is still in the tree that's why remove it again.

Fixes: 091401131085 ("command: Remove the cmd_tbl_t typedef
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agolib/rsa: correct check after allocation in fdt_add_bignum()
Heinrich Schuchardt [Thu, 20 Aug 2020 19:11:17 +0000 (21:11 +0200)]
lib/rsa: correct check after allocation in fdt_add_bignum()

After allocating to pointer ctx we should check that pointer and not
another pointer already checked above.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agotest: undefined reference to 'sscanf'
Heinrich Schuchardt [Fri, 21 Aug 2020 01:56:17 +0000 (03:56 +0200)]
test: undefined reference to 'sscanf'

Compiling with CONFIG_UNIT_TEST=y leads to:

aarch64-linux-gnu-ld.bfd:
test/lib/sscanf.c:50: undefined reference to `sscanf'

Add missing build dependency.

Fixes:e87dfb0526be ("lib: sscanf: add sscanf implementation")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocheckpatch.pl: Make fdt / initrd relocation disabling an error
Tom Rini [Thu, 20 Aug 2020 12:37:49 +0000 (08:37 -0400)]
checkpatch.pl: Make fdt / initrd relocation disabling an error

Entirely disabling relocation of the device tree or initrd is almost
never the right answer.  Doing this by default leads to hard to diagnose
run-time failures.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Kconfig: Add missing dependency for ENV_IS_IN_EXT4
Michal Simek [Wed, 19 Aug 2020 08:44:23 +0000 (10:44 +0200)]
env: Kconfig: Add missing dependency for ENV_IS_IN_EXT4

ENV_IS_IN_EXT4 also need to enable FS_EXT4 which is not covered in Kconfig.
Kconfig reports this as:
WARNING: unmet direct dependencies detected for EXT4_WRITE
  Depends on [n]: FS_EXT4 [=n]
  Selected by [y]:
  - ENV_IS_IN_EXT4 [=y] && !CHAIN_OF_TRUST [=n]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoarc: Kconfig: Add missing DM dependency
Michal Simek [Wed, 19 Aug 2020 08:44:20 +0000 (10:44 +0200)]
arc: Kconfig: Add missing DM dependency

ARC is selecting TIMER which depends on DM but DM is not selected and
doesn't need to be enabled. Fix it by selecting DM for ARC architecture.

Kconfig is showing this missing dependency by:
WARNING: unmet direct dependencies detected for TIMER
  Depends on [n]: DM [=n]
  Selected by [y]:
  - ARC [=y] && <choice>

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocmd: Kconfig: Change dependency for CMD_ADC
Michal Simek [Wed, 19 Aug 2020 08:44:17 +0000 (10:44 +0200)]
cmd: Kconfig: Change dependency for CMD_ADC

CMD_ADC selected DM_REGULATOR unconditionally without enabling DM.
That's why change select to depends on to cover it.

Kconfig is showing this issue as:
WARNING: unmet direct dependencies detected for REGMAP
  Depends on [n]: DM [=n]
  Selected by [y]:
  - DM_REGULATOR_PBIAS [=y] && DM_REGULATOR [=y]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Update CMD_ADC=y configs to enable DM_REGULATOR now]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agopci: kconfig: Setup proper dependency for PCIE_ROCKCHIP
Michal Simek [Wed, 19 Aug 2020 08:44:15 +0000 (10:44 +0200)]
pci: kconfig: Setup proper dependency for PCIE_ROCKCHIP

There is missing dependency for PCIE_ROCKCHIP which selects
PHY_ROCKCHIP_PCIE which directly depends on ARCH_ROCKCHIP.

WARNING: unmet direct dependencies detected for PHY_ROCKCHIP_PCIE
  Depends on [n]: ARCH_ROCKCHIP [=n]
  Selected by [y]:
  - PCIE_ROCKCHIP [=y] && PCI [=y]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agodrivers: usb: Fix config indentation
Ruben Di Battista [Thu, 6 Aug 2020 10:12:30 +0000 (12:12 +0200)]
drivers: usb: Fix config indentation

The indentation was messing up with the scripts/build-whitelist.sh that
was marking SYS_USB_EVENT_POLL_VIA_INT_QUEUE (and probably also the
other indented options) erroneously as ad-hoc configure option with the
following error:

```
Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
```

4 years agoPrepare v2020.10-rc3
Tom Rini [Wed, 26 Aug 2020 21:18:06 +0000 (17:18 -0400)]
Prepare v2020.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>