]> git.baikalelectronics.ru Git - uboot.git/log
uboot.git
3 years agoARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver
Etienne Carriere [Wed, 24 Feb 2021 10:19:41 +0000 (11:19 +0100)]
ARM: dts: stm32mp1: explicit clock reference needed by RCC clock driver

Define in the RCC clock provider node which root clocks the driver
depends on. These are root oscillators, which may be present or
not, upon FDT content.

This update binding is introduced in Linux kernel device tree by patch
"ARM: dts: stm32: move clocks/resets to SCMI resources for stm32mp15"

This patch is a preliminary step for SCMI support of stm32mp15
boards with trusted boot chain, based on TF-A or OP-TEE.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agomtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write()
Patrice Chotard [Wed, 20 Jan 2021 13:42:04 +0000 (14:42 +0100)]
mtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write()

In case of big area read/write on spi nand, watchdog timeout may occurs.
To fix that, add WATCHDOG_RESET() in spinand_mtd_read() and
spinand_mtd_write() to ensure that watchdog is reset.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agomtd: nand: Add WATCHDOG_RESET() in nanddev_mtd_erase()
Patrice Chotard [Wed, 20 Jan 2021 13:42:03 +0000 (14:42 +0100)]
mtd: nand: Add WATCHDOG_RESET() in nanddev_mtd_erase()

In case of big area erased on nand, watchdog timeout may occurs.
To fix that, add WATCHDOG_RESET() in nanddev_mtd_erase() to ensure that
watchdog is reset.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agospi: stm32_qspi: Add WATCHDOG_RESET in _stm32_qspi_read_fifo()
Patrice Chotard [Wed, 20 Jan 2021 13:42:02 +0000 (14:42 +0100)]
spi: stm32_qspi: Add WATCHDOG_RESET in _stm32_qspi_read_fifo()

In case of reading large area and memory-map mode is misconfigured
(memory-map size declared lower than the real size of the memory chip)
watchdog can be triggered.

Add WATCHDOG_RESET() in _stm32_qspi_read_fifo to fix it.

Issue reproduced with stm32mp157c-ev1 board and memory map size set to
1, with following command:
sf read 0xC0000000 0 0x4000000

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agomtd: spi-nor: Add WATCHDOG_RESET() in spi_nor_core callbacks
Patrice Chotard [Wed, 20 Jan 2021 13:42:01 +0000 (14:42 +0100)]
mtd: spi-nor: Add WATCHDOG_RESET() in spi_nor_core callbacks

In case of big area write/erase on spi nor, watchdog timeout may occurs.
Issue reproduced on stm32mp157c-ev1 with following commands:

sf write 0xC0000000 0 0x3000000
or
sf erase 0 0x1000000

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoPrepare v2021.04-rc3
Tom Rini [Tue, 2 Mar 2021 03:46:41 +0000 (22:46 -0500)]
Prepare v2021.04-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agolog: convert pr_*() to logging
Heinrich Schuchardt [Mon, 4 Jan 2021 07:02:55 +0000 (08:02 +0100)]
log: convert pr_*() to logging

In drivers we use a family of printing functions including pr_err() and
pr_cont(). CONFIG_LOGLEVEL is used to control which of these lead to output
via printf().

Our logging functions allow finer grained control of output. So replace
printf() by the matching logging functions. The usage of CONFIG_LOGLEVEL
remains unchanged.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agofs: btrfs: do not fail when offset of a ROOT_ITEM is not -1
Marek Behún [Tue, 9 Feb 2021 17:33:37 +0000 (18:33 +0100)]
fs: btrfs: do not fail when offset of a ROOT_ITEM is not -1

When the btrfs_read_fs_root() function is searching a ROOT_ITEM with
location key offset other than -1, it currently fails via BUG_ON.

The offset can have other value than -1, though. This can happen for
example if a subvolume is renamed:

  $ btrfs subvolume create X && sync
  Create subvolume './X'
  $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: X$
        location key (270 ROOT_ITEM 18446744073709551615) type DIR
        transid 283 data_len 0 name_len 1
        name: X
  $ mv X Y && sync
  $ btrfs inspect-internal dump-tree /dev/root | grep -B 2 'name: Y$
        location key (270 ROOT_ITEM 0) type DIR
        transid 285 data_len 0 name_len 1
        name: Y

As can be seen the offset changed from -1ULL to 0.

Do not fail in this case.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>
Cc: Tom Rini <trini@konsulko.com>
3 years agouboot-test-hooks: Switch to our GitLab instance
Tom Rini [Wed, 24 Feb 2021 22:05:04 +0000 (17:05 -0500)]
uboot-test-hooks: Switch to our GitLab instance

As Stephen is no longer actively maintaining the uboot-test-hooks
repository, switch to using the instance on our GitLab.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoCorrect U-Boot upstream repository
Heinrich Schuchardt [Wed, 24 Feb 2021 12:19:04 +0000 (13:19 +0100)]
Correct U-Boot upstream repository

The U-Boot source moves to https://source.denx.de/u-boot/u-boot.git
effective 2021-02-28.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge tag 'efi-2021-04-rc3-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 27 Feb 2021 13:06:10 +0000 (08:06 -0500)]
Merge tag 'efi-2021-04-rc3-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-04-rc3-2

Bug fixes:
* debug build for mkeficapsule
* limit output length for VenHw, VenMedia
* ACPI tables must be in EfiACPIReclaimMemory

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 26 Feb 2021 20:11:08 +0000 (15:11 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- fastboot updates / fixes

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Fri, 26 Feb 2021 17:41:19 +0000 (12:41 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi

- new GigaDevice flash ids
- fixes for imx, nxp_spi drivers

3 years agoMerge tag 'u-boot-stm32-20210226' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 26 Feb 2021 17:41:06 +0000 (12:41 -0500)]
Merge tag 'u-boot-stm32-20210226' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- Add USB host boot support in stm32mp1 config
- Enable uefi related commands for STMicroelectronics STM32MP15 boards
- Remove duplicate uart nodes in stm32mp15 device tree

3 years agocmd/efidebug: add firmware management protocol GUID
Heinrich Schuchardt [Fri, 26 Feb 2021 16:57:47 +0000 (17:57 +0100)]
cmd/efidebug: add firmware management protocol GUID

Add missing GUID short text used in the efidebug tables and efidebug dh
sub-commands.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: fix documentation in efi_loader.h
Heinrich Schuchardt [Thu, 25 Feb 2021 07:02:37 +0000 (08:02 +0100)]
efi_loader: fix documentation in efi_loader.h

Correct missing descriptions and typos in efi_loader.h.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: limit output length for VenHw, VenMedia
Heinrich Schuchardt [Tue, 23 Feb 2021 20:15:35 +0000 (21:15 +0100)]
efi_loader: limit output length for VenHw, VenMedia

VenHw and VenMedia device path nodes may carry vendor defined data of
arbitrary length. When converting a device path node to text ensure that we
do not overrun our internal buffer.

In our implementation of
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() we could first
determine the output length and then allocate buffers but that would nearly
double the code size. Therefore keep the preallocated buffers and truncate
excessive device paths instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agotools/mkeficapsule.c: fix DEBUG build
Klaus Heinrich Kiwi [Sat, 20 Feb 2021 20:40:45 +0000 (17:40 -0300)]
tools/mkeficapsule.c: fix DEBUG build

Fix a missing comma sign (,) from a printf(), that is only
reachable if DEBUG is defined, in which case the build fails with:

    tools/mkeficapsule.c:266:36: error: expected ‘)’ before ‘bin’
      266 |  printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
          |                                    ^~~~
          |                                    )

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMAINTAINERS: assign tools/mkeficapsule.c to EFI PAYLOAD
Heinrich Schuchardt [Mon, 22 Feb 2021 19:26:34 +0000 (20:26 +0100)]
MAINTAINERS: assign tools/mkeficapsule.c to EFI PAYLOAD

tools/mkeficapsule.c is used to prepare test files for testing the UEFI
sub-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: ACPI tables must be in EfiACPIReclaimMemory
Heinrich Schuchardt [Sun, 21 Feb 2021 09:16:58 +0000 (10:16 +0100)]
efi_loader: ACPI tables must be in EfiACPIReclaimMemory

The UEFI spec does not allow ACPI tables to be in runtime services memory.
It recommends EfiACPIReclaimMemory.

Remove a superfluous check that the allocated pages are 16 byte aligned.
EFI pages are 4 KiB aligned.

Fixes: 10bec7c1b5b8 ("efi_loader: Install ACPI configuration tables")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoconfigs: stm32mp1: enable uefi related commands
Ilias Apalodimas [Fri, 26 Feb 2021 12:52:51 +0000 (14:52 +0200)]
configs: stm32mp1: enable uefi related commands

The board can boot with UEFI. With the latest changes in U-Boot's
EFI subsystem we also have support for EFI runtime variables, without
SetVariable support.  We can also store the EFI variables in a file on the
ESP partition and preserve them across reboots.
The env and efidebug commands are missing in order to configure
EFI variables and the efibootmgr though.  Since U-Boot's default config
enables other EFI related commands (e.g bootefi), let's add the env related
and efidebug commands and allow users to do that

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoarm: dts: stm32mp15: remove duplicate uart nodes
Patrick Delaunay [Wed, 24 Feb 2021 10:00:56 +0000 (11:00 +0100)]
arm: dts: stm32mp15: remove duplicate uart nodes

Remove duplicated uart nodes introduced with commit fcd76ae14c4b
("ARM: dts: stm32mp1: DT alignment with Linux kernel v5.9-rc4"),
because the uart nodes wasn't correctly ordered in alphabetic order.

Only cosmetic: the generated device tree don't change.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoARM: stm32: Add USB host boot support
Marek Vasut [Fri, 12 Feb 2021 12:50:52 +0000 (13:50 +0100)]
ARM: stm32: Add USB host boot support

Add support for booting from USB pen drive, since USB host port is
available on the STM32MP1.

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>
3 years agousb: gadget: dwc2_udc_otg: Fix dwc2_gadget_start() and usb_gadget_register_driver()
Patrice Chotard [Wed, 17 Feb 2021 09:17:27 +0000 (10:17 +0100)]
usb: gadget: dwc2_udc_otg: Fix dwc2_gadget_start() and usb_gadget_register_driver()

Since commit 2633459f01e8 ("usb: gadget: add super speed support")
ums was no more functional on platform which use dwc2_udc_otg driver.

This was due to a too restrictive test which checked that the gadget
driver speed was either FS or HS.

So all gadget driver with max speed set to speed higher than
HS (SS in case of composite gadget driver in our case) are not
allowed, which is wrong.

Update the speed test in usb_gadget_register_driver() and in
dwc2_gadget_start() to allow all gadget driver speed equal or higher
than FS.

Tested on stm32mp157c-ev1 board.

Fixes: 8fae2d750482 ("usb: dwc2: convert driver to DM_USB_GADGET")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agousb: kbd: Also accept keyboards with Interrupt OUT endpoint
Stefan Brüns [Sat, 20 Feb 2021 16:26:06 +0000 (17:26 +0100)]
usb: kbd: Also accept keyboards with Interrupt OUT endpoint

The OUT endpoint can just be ignored as it is not used, just as the
corresponding Set_Report request for IN-only interfaces. E.g. the
Linux gadget hid keyboard also provides an interrupt endpoint.

Also cleanup confusing debug messages like "found set protocol", which
is printed when a keyboard device is found, while the Set_Protocol request
is issued quite some time later.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
3 years agofastboot: add UUU command UCmd and ACmd support
Heiko Schocher [Wed, 10 Feb 2021 08:29:03 +0000 (09:29 +0100)]
fastboot: add UUU command UCmd and ACmd support

add support for the UUU commands ACmd and UCmd.

Enable them through the Kconfig option
CONFIG_FASTBOOT_UUU_SUPPORT

base was commit in NXP kernel
9b149c2a2882: ("MLK-18591-3 android: Add FSL android fastboot support")

and ported it to current mainline. Tested this patch
on imx6ul based board.

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agodoc: Document partition specifications
Sean Anderson [Fri, 5 Feb 2021 14:39:02 +0000 (09:39 -0500)]
doc: Document partition specifications

This documents the way U-Boot understands partitions specifications.
This also updates the fastboot documentation for the changes in the
previous commit.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Rename k210 partitions anchor
Sean Anderson [Fri, 5 Feb 2021 14:39:01 +0000 (09:39 -0500)]
doc: Rename k210 partitions anchor

This anchor is only for the k210 partition layout, so rename it
appropriately. This keeps it from conflicting with the (to be added)
anchor for U-Boot partitions in general.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofastboot: Allow u-boot-style partitions
Sean Anderson [Fri, 5 Feb 2021 14:39:00 +0000 (09:39 -0500)]
fastboot: Allow u-boot-style partitions

This adds support for partitions of the form "dev.hwpart:part" and
"dev#partname". This allows one to flash to eMMC boot partitions without
having to use CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT. It also allows one to
flash to an entire device without needing CONFIG_FASTBOOT_MMC_USER_NAME.
Lastly, one can also flash MMC devices other than
CONFIG_FASTBOOT_FLASH_MMC_DEV.

Because devices can be specified explicitly, CONFIG_FASTBOOT_FLASH_MMC_DEV
is used only when necessary for existing functionality. For those cases,
fastboot_mmc_get_dev has been added as a helper function. This allows

There should be no conflicts with the existing system, but just in case, I
have ordered detection of these names after all existing names.

The fastboot_mmc_part test has been updated for these new names.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofastboot: Move part_get_info_by_name_or_alias after raw_part_get_info_by_name
Sean Anderson [Fri, 5 Feb 2021 14:38:59 +0000 (09:38 -0500)]
fastboot: Move part_get_info_by_name_or_alias after raw_part_get_info_by_name

This makes the next commit more readable by doing the move now.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofastboot: Remove mmcpart argument from raw_part_get_info_by_name
Sean Anderson [Fri, 5 Feb 2021 14:38:58 +0000 (09:38 -0500)]
fastboot: Remove mmcpart argument from raw_part_get_info_by_name

The only thing mmcpart was used for was to pass to blk_dselect_hwpart.
This calls blk_dselect_hwpart directly from raw_part_get_info_by_name. The
error handling is dropped, but it is reintroduced in the next commit
(albeit less specificly).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopart: Support string block devices in part_get_info_by_dev_and_name
Sean Anderson [Fri, 5 Feb 2021 14:38:57 +0000 (09:38 -0500)]
part: Support string block devices in part_get_info_by_dev_and_name

This adds support for things like "#partname" and "0.1#partname". The block
device parsing is done like in blk_get_device_part_str.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopart: Support getting whole disk from part_get_info_by_dev_and_name_or_num
Sean Anderson [Fri, 5 Feb 2021 14:38:56 +0000 (09:38 -0500)]
part: Support getting whole disk from part_get_info_by_dev_and_name_or_num

This adds an option to part_get_info_by_dev_and_name_or_num to allow
callers to specify whether whole-disk partitions are fine.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopart: Give several functions more useful return values
Sean Anderson [Fri, 5 Feb 2021 14:38:55 +0000 (09:38 -0500)]
part: Give several functions more useful return values

Several functions in disk/part.c just return -1 on error. This makes them
return different errnos for different failures. This helps callers
differentiate between failures, even if they cannot read stdout.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotest: dm: Add test for fastboot mmc partition naming
Sean Anderson [Fri, 5 Feb 2021 14:38:54 +0000 (09:38 -0500)]
test: dm: Add test for fastboot mmc partition naming

This test verifies the mapping between fastboot partitions and partitions
as understood by U-Boot. It also tests the creation of GPT partitions,
though that is not the primary goal.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agommc: sandbox: Add support for writing
Sean Anderson [Fri, 5 Feb 2021 14:38:53 +0000 (09:38 -0500)]
mmc: sandbox: Add support for writing

This adds support writing to the sandbox mmc backed by an in-memory
buffer. The unit test has been updated to test reading, writing, and
erasing. I'm not sure what MMCs erase to; I picked 0, but if it's 0xFF
then that can be easily changed.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 26 Feb 2021 12:55:16 +0000 (07:55 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- turris_mox: Enhancements, mostlly defconfig changes (Pali)
- pci-aardvark: Set Max Payload Size and Max Read Request Size
                to 512 bytes (Pali)
- pci_mvebu: Minor cleanup and refactoring (Marek)
- Upgrade A38x DDR3 training to version 14.0.0 (Marek)

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Fri, 26 Feb 2021 12:54:27 +0000 (07:54 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-samsung

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Fri, 26 Feb 2021 12:53:04 +0000 (07:53 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv

3 years agomtd: nand: spi: Support GigaDevice GD5F1GQ5UExxG
Reto Schneider [Thu, 11 Feb 2021 12:05:48 +0000 (13:05 +0100)]
mtd: nand: spi: Support GigaDevice GD5F1GQ5UExxG

The relevant changes to the already existing GD5F1GQ4UExxG support has
been determined by consulting the GigaDevice product change notice
AN-0392-10, version 1.0 from November 30, 2020.

As the overlaps are huge, variable names have been generalized
accordingly.

Apart form the lowered ECC strength (4 instead of 8 bits per 512 bytes),
the new device ID, and the extra quad IO dummy byte, no changes had to
be taken into account.

New hardware features are not supported, namely:
 - Power on reset
 - Unique ID
 - Double transfer rate (DTR)
 - Parameter page
 - Random data quad IO

The inverted semantic of the "driver strength" register bits, defaulting
to 100% instead of 50% for the Q5 devices, got ignored as the driver has
never touched them anyway.

The no longer supported "read from cache during block erase"
functionality is not reflected as the current SPI NAND core does not
support it anyway.

Implementation has been tested on MediaTek MT7688 based GARDENA smart
Gateways using both, GigaDevice GD5F1GQ5UEYIG and GD5F1GQ4UBYIG.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: nand: spi: Only one dummy byte in QUADIO
Hauke Mehrtens [Thu, 11 Feb 2021 12:05:47 +0000 (13:05 +0100)]
mtd: nand: spi: Only one dummy byte in QUADIO

The datasheet only lists one dummy byte in the 0xEB operation for the
following chips:
* GD5F1GQ4xExxG
* GD5F1GQ4xFxxG
* GD5F1GQ4UAYIG
* GD5F4GQ4UAYIG

Reto Schneider:
- Linux patch ported to U-Boot
- Checked for compatibility with GD5F1GQ4xBxxG
- Fixed operation code in original commit message (0xEH -> 0xEB)

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: spi-nor-core: Fix typo in documentation
Sean Anderson [Fri, 5 Feb 2021 04:11:08 +0000 (23:11 -0500)]
mtd: spi-nor-core: Fix typo in documentation

This line should come before the docs for the next function.

Fixes: 78416e2c8d0 ("mtd: spi: Port SPI NOR framework from Linux")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agocmd: sf: Print error on test failure
Sean Anderson [Fri, 5 Feb 2021 04:11:07 +0000 (23:11 -0500)]
cmd: sf: Print error on test failure

The sf test command is used to test spi flashes (and spi masters). Printing
the exact error code is very helpful to those debugging the spi stack.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agocmd: sf: Display errno on erase failure
Sean Anderson [Fri, 5 Feb 2021 04:11:06 +0000 (23:11 -0500)]
cmd: sf: Display errno on erase failure

If there is an error while erasing SPI flash, no errno is displayed. This
makes it difficult to determine the cause of the error. This change mirrors
the logic for write errors above.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: nxp_fspi: Fix error reporting
Adam Ford [Mon, 18 Jan 2021 21:32:49 +0000 (15:32 -0600)]
spi: nxp_fspi: Fix error reporting

On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
rate the clock was able to set.  When checking for errors, it only
checks that it is not NULL.  Since positive numbers are not errors,
only check for negative numbers when handling errors.

Fixes: b2b3c5e98cae ("spi: nxp_fspi: new driver for the FlexSPI controller")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agoddr: marvell: a38x: fix comment in conditional macro
Marek Behún [Fri, 19 Feb 2021 16:11:26 +0000 (17:11 +0100)]
ddr: marvell: a38x: fix comment in conditional macro

The code was processed with unifdef utility to omit portions not
relevant to A38x and DDR3. This removes usage of many macros, including
A70X0, A80X0 and A3900. It seems that the unifdef utility did not remove
the macros from #else comment.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: bump version to 14.0.0
Marek Behún [Fri, 19 Feb 2021 16:11:25 +0000 (17:11 +0100)]
ddr: marvell: a38x: bump version to 14.0.0

Bump version of a38x DDR3 trianing to version 14.0.0 to reflect the
version in the mv-ddr-devel branch of upstream repository
https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git.

There is a new version numbering system, where after 18.12.0 came
1.0.0, 2.0.0, and so on until 14.0.0. So 14.0.0 is newer than 18.12.0.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: enum mv_ddr_twin_die: change order
heaterC [Fri, 19 Feb 2021 16:11:24 +0000 (17:11 +0100)]
ddr: marvell: a38x: enum mv_ddr_twin_die: change order

commit 56db5d1464b44df10a02b99e615ebd6f6a35c428 upstream.

@pali suggested this change
In commit 6285efb ("mv_ddr: add support for twin-die combined memory
device") was added support for twin-die combined memory device and
default value for explicitly uninitialized structure members is zero, s
also twin_die_combined is initialized to zero. Which means COMBINED
value.
As prior this commit there was no support for twin-die combined memory
device, default value for twin_die_combined should be NOT_COMBINED. This
change change order of enum mv_ddr_twin_die to ensure that NOT_COMBINED
has value zero.

Signed-off-by: heaterC <airyguy@gmx.de>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: import code change from upstream
Marek Behún [Fri, 19 Feb 2021 16:11:23 +0000 (17:11 +0100)]
ddr: marvell: a38x: import code change from upstream

commit 2bdd12dd68b1f8e27a03a3443ae49a09a14c18e4 upstream.

The commit mentioned above changes non-DDR3 stuff in upstream, but it
also changes code in ddr3_training.c.

Import this change to remain consistent with upstream.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: fix memory cs size function
Moti Buskila [Fri, 19 Feb 2021 16:11:22 +0000 (17:11 +0100)]
ddr: marvell: a38x: fix memory cs size function

commit c8b301463d508c807a33f7b7eaea98bbda4aa35e upstream.

The funtion returnd cs size in byte instead of MB, that cause
calculation error since the caller was expected to get u32 and when he
got above 4G it refers it as 0.
The fix was to get the cs memory size from function as in MB and then
multiply it by 1MB.

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: import header change from upstream
Marek Behún [Fri, 19 Feb 2021 16:11:21 +0000 (17:11 +0100)]
ddr: marvell: a38x: import header change from upstream

commit d653b305d0b3da9727c49124683f1a6d95d5c9a5 upstream.

The commit mentioned above changes non-DDR3 stuff in upstream, but it
also changes header ddr_topology_def.h.

Import this header change to remain consistent with upstream.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: disable WL phase correction stage in case of bus_width=16bit
Moti Buskila [Fri, 19 Feb 2021 16:11:20 +0000 (17:11 +0100)]
ddr: marvell: a38x: disable WL phase correction stage in case of bus_width=16bit

commit 20c89a28548cdab11f88d2ec8936344af0686a1e upstream.

WL phase correcion stage is failing while using bus_width of 16bit, not
to be fix this stage is un-necessary when working with bus_width of 16
bit.

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: add support for twin-die combined memory device
Moti Buskila [Fri, 19 Feb 2021 16:11:19 +0000 (17:11 +0100)]
ddr: marvell: a38x: add support for twin-die combined memory device

commit 6285efb8a118940877522c4c07bd7c64569b4f5f upstream.

the twin-die combined memory device should be treatened as X8
device and not as X16 one

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
[ - the default value for twin_die_combined is set to NOT_COMBINED for
    all boards, as this was default behaviour prior this change ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: add 16Gbit memory devices support
Moti Buskila [Fri, 19 Feb 2021 16:11:18 +0000 (17:11 +0100)]
ddr: marvell: a38x: add 16Gbit memory devices support

commit 994509eb4fe6771d92cd06314c37895098ac48fa upstream.

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: allow board specific ODT configuration
Baruch Siach [Fri, 19 Feb 2021 16:11:17 +0000 (17:11 +0100)]
ddr: marvell: a38x: allow board specific ODT configuration

commit 2d3b9437cf38c06c4330e0de07f29476197f5e04 upstream.

The ODT enable heuristic based on active chip-selects is not always
correct. Some board might use two chip-selects, but have only one ODT
line connected. Allow board specific mv_ddr_topology_map to directly set
the ODT configuration register value.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Nadav Haklai <Nadav.Haklai@cavium.com>
Reviewed-by: Kostya Porotchkin <Kostya.Porotchkin@cavium.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: import header change from upstream
Marek Behún [Fri, 19 Feb 2021 16:11:16 +0000 (17:11 +0100)]
ddr: marvell: a38x: import header change from upstream

commit 3908e20c6c520339e9bddb566823ae5e065d5218 upstream.

The commit mentioned above changes non-DDR3 stuff in upstream, but it
also changes header ddr_topology_def.h.

Import this header change to remain consistent with upstream.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: fix memory size calculation using 32bit bus width
Moti Buskila [Fri, 19 Feb 2021 16:11:15 +0000 (17:11 +0100)]
ddr: marvell: a38x: fix memory size calculation using 32bit bus width

commit ab9240402a70cc02496683971779e75eff410ab4 upstream.

- function mv_ddr_spd_die_capacity_user_get() has a bug,
  since it insert a user memory enum to it,
  instead of SPD memory enum (which are different)
- fix: remove mv_ddr_spd_die_capacity_user_get() function.
- memory size with 64 and 32 bit already calculated correctly
  at mv_ddr_mem_sz_per_cs_get() function

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Stefan Chulski <Stefan.Chulski@cavium.com>
Reviewed-by: Alex Leibovich <alexl@marvell.com>
Reviewed-by: Kostya Porotchkin <Kostya.Porotchkin@cavium.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: fix 32bit
Moti Buskila [Fri, 19 Feb 2021 16:11:14 +0000 (17:11 +0100)]
ddr: marvell: a38x: fix 32bit

commit 0b5adedd4ced9b8f528faad1957d4d69e95759ef upstream.

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Alex Leibovich <alexl@marvell.com>
Reviewed-by: Kostya Porotchkin <Kostya.Porotchkin@cavium.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: import header change from upstream
Marek Behún [Fri, 19 Feb 2021 16:11:13 +0000 (17:11 +0100)]
ddr: marvell: a38x: import header change from upstream

commit 6c705ebc0d70f67ed7cae83ad1978c3305ef25be upstream.

The commit mentioned above changes non-DDR3 stuff in upstream, but it
also changes header mv_ddr_topology.h.

Import this header change to remain consistent with upstream.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: add ddr 32bit ECC support
Alex Leibovich [Fri, 19 Feb 2021 16:11:12 +0000 (17:11 +0100)]
ddr: marvell: a38x: add ddr 32bit ECC support

commit 61a8910998d7b553e80f600ebe8147a8b98f0945 upstream.

Required changes made for 32bit ddr support.
An update is made to the topology map, according to
bus_act_mask, set in the dram_port.c

Signed-off-by: Alex Leibovich <alexl@marvell.com>
Reviewed-by: Kostya Porotchkin <Kostya.Porotchkin@cavium.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: add ddr32 support
Alex Leibovich [Fri, 19 Feb 2021 16:11:11 +0000 (17:11 +0100)]
ddr: marvell: a38x: add ddr32 support

commit 32800667b375ebd1f82120da0f3479b1cf52d96d upstream.

Required changes made for 32bit ddr support.
An update is made to the topology map, according to
bus_act_mask, set in the dram_port.c

Signed-off-by: Alex Leibovich <alexl@marvell.com>
Reviewed-by: Nadav Haklai <Nadav.Haklai@cavium.com>
Reviewed-by: Kostya Porotchkin <Kostya.Porotchkin@cavium.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: import header change from upstream
Marek Behún [Fri, 19 Feb 2021 16:11:10 +0000 (17:11 +0100)]
ddr: marvell: a38x: import header change from upstream

commit a165037ec26f301be75e1fabc263643683e85255 upstream.

The commit mentioned above changes non-DDR3 stuff in upstream, but it
also changes header ddr_topology_def.h.

Import this header change to remain consistent with upstream.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoddr: marvell: a38x: fix write leveling suplementary algo
Moti Buskila [Fri, 19 Feb 2021 16:11:09 +0000 (17:11 +0100)]
ddr: marvell: a38x: fix write leveling suplementary algo

commit ce62bef8fac559e27245259882e45f19cdc293ad upstream.

- fix JIRA A7K8K-5056
- remove TEST_PATTERN write at the load patern stage earlier to WL SUP stage
- the WL SUP stage already writes this pattern to the memory, if the pattern exist at the memory
  then the algorithm will fail, since it think that there are no phase to correct

Signed-off-by: Moti Buskila <motib@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
3 years agoARM: dts: armada-385-turris-omnia: rename node in -u-boot.dtsi file
Marek Behún [Tue, 9 Feb 2021 02:43:03 +0000 (03:43 +0100)]
ARM: dts: armada-385-turris-omnia: rename node in -u-boot.dtsi file

The SPI NOR flash node name in main device tree for Turris Omnia is
called `spi-nor@0`.

Rename node spi-flash@0 in Turris Omnia's -u-boot.dtsi file to spi-nor@0
so that U-Boot does not try to probe the same SPI NOR device multiple
times.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
3 years agopci: pci_mvebu: set local dev to number 1
Marek Behún [Mon, 8 Feb 2021 22:01:41 +0000 (23:01 +0100)]
pci: pci_mvebu: set local dev to number 1

Linux displays the real PCIe card connected to a mvebu PCIe slot as
device 0, not 1. This is done by setting local dev number to 1, so that
the local "Marvell Memory controller" device is on address 1.

Let's do it also in U-Boot.

With this commit the pci command in U-Boot prints something like:
  => pci
  Scanning PCI devices on bus 0
  BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
  _____________________________________________________________
  00.00.00   0x168c     0x003c     Network controller      0x80

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agopci: pci_mvebu: refactor validation of addresses for config access
Marek Behún [Mon, 8 Feb 2021 22:01:40 +0000 (23:01 +0100)]
pci: pci_mvebu: refactor validation of addresses for config access

Refactor validation of bdf parameter in mvebu_pcie_read/write_config
functions.

We can simplify the code by putting the validation into separate
function.

Also there are always only two devices visible on local bus:
* on slot configured by function mvebu_pcie_set_local_dev_nr()
  (by default this register is set to 0) there is a
  "Marvell Memory controller", which isn't useful in root complex
  mode,
* on all other slots the real PCIe card connected to the PCIe slot.

We can simplify the code even more by simply allowing access only to
the real PCIe card.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agopci: pci_mvebu: debug rd/wr config as other drivers do
Marek Behún [Mon, 8 Feb 2021 22:01:39 +0000 (23:01 +0100)]
pci: pci_mvebu: debug rd/wr config as other drivers do

Other drivers (aardvark, intel_fpga) print "(addr,size,val)" when
debugging is enabled. Print size for pci_mvebu as well.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agopci: pci_mvebu: cosmetic fix
Marek Behún [Mon, 8 Feb 2021 22:01:38 +0000 (23:01 +0100)]
pci: pci_mvebu: cosmetic fix

Write bdf address in a same way in mvebu_pcie_read/write_config.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agopci: pci_mvebu: use dev_seq instead of static variable
Marek Behún [Mon, 8 Feb 2021 22:01:37 +0000 (23:01 +0100)]
pci: pci_mvebu: use dev_seq instead of static variable

PCI uclass maps PCI bus numbers to the seq member of struct udevice.
Use dev_seq(dev) as the bus number in mvebu_pcie_probe instead of an
incrementing a static variable.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: Enable NVMe support
Marek Behún [Fri, 5 Feb 2021 14:32:31 +0000 (15:32 +0100)]
arm: mvebu: turris_mox: Enable NVMe support

NVMe drives can be connected to Turris MOX via MOX B and MOX G
extensions.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI
Pali Rohár [Fri, 5 Feb 2021 14:32:30 +0000 (15:32 +0100)]
arm: mvebu: turris_mox: Enable CONFIG_USB_XHCI_PCI

USB devices can be connected to Turris MOX also via MOX F extension which
contains VL805 PCIe based USB 3.0 controller.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_mox: Enable CONFIG_PCI_PNP
Pali Rohár [Fri, 5 Feb 2021 14:32:29 +0000 (15:32 +0100)]
arm: mvebu: turris_mox: Enable CONFIG_PCI_PNP

PCIe devices do not work in U-Boot without proper initialization and
configuration of PCI config space like the PCI_BASE_ADDRESS_0 register.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512 bytes
Pali Rohár [Fri, 5 Feb 2021 14:32:28 +0000 (15:32 +0100)]
arm: a37xx: pci: Set Max Payload Size and Max Read Request Size to 512 bytes

Fix usage of VL805 XHCI PCIe controller when it is connected via PCIe to
Armada 3720 SOC. Without this U-Boot crashes when trying to access
enumerated USB devices connected to this XHCI PCIe controller.

This should be done according to the PCIe Link Initialization sequence, as
defined in Marvell Armada 3720 Functional Specification.

Linux has this code too.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomtd: spi-nor-ids: Add support of flash protection to w25q128
Su Baocheng [Mon, 25 Jan 2021 02:59:05 +0000 (10:59 +0800)]
mtd: spi-nor-ids: Add support of flash protection to w25q128

The NOR flash w25q128 denoted by JEDEC ID 0xef4018 actually represents
various models. From Winbond's website, I could only find 3 types of
them:

    W25Q128JV-IQ/JQ
    datasheet:https://www.winbond.com/resource-files/
w25q128jv%20revg%2004082019%20plus.pdf

    W25Q128FV (SPI Mode)
    datasheet: https://www.winbond.com/resource-files/
w25q128fv%20rev.m%2005132016%20kms.pdf

    W25Q128BV
    datesheet: https://www.winbond.com/resource-files/
w25q128bv_revh_100313_wo_automotive.pdf

According to the datasheets, all of these 3 types support BP(0,1,2) and
TB bits in the status register (SR), so it could reuse the flash
protection logic for ST Micro.

So it should be safe to add the SPI_NOR_HAS_LOCK and SPI_NOR_HAS_TB
flags to the w25q128 entry of spi_nor_ids table.

Signed-off-by: Su Baocheng <baocheng.su@siemens.com>
[jagan: remove comments in spi-nor-ids.c]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: spi-nor.h: Change spaces to tabs
Bin Meng [Wed, 6 Jan 2021 12:58:54 +0000 (20:58 +0800)]
mtd: spi-nor.h: Change spaces to tabs

U-Boot coding convention prefers tabs over spaces.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: spi-nor-ids: Add Gigadevice GD25LQ64C
Alper Nebi Yasak [Sat, 31 Oct 2020 16:20:12 +0000 (19:20 +0300)]
mtd: spi-nor-ids: Add Gigadevice GD25LQ64C

Add GD25LQ24C 64Mbit chip to spi-nor id table. This chip is used on
rk3399-gru-kevin:

    => sf probe
    SF: Detected gd25lq64c with page size 256 Bytes, erase size 4 KiB, total 8 MiB
    => sf erase 0x600000 0x200000
    SF: 2097152 bytes @ 0x600000 Erased: OK
    => sf test 0x700000 0x1000
    SPI flash test:
    0 erase: 52 ticks, 76 KiB/s 0.608 Mbps
    1 check: 5 ticks, 800 KiB/s 6.400 Mbps
    2 write: 14 ticks, 285 KiB/s 2.280 Mbps
    3 read: 3 ticks, 1333 KiB/s 10.664 Mbps
    Test passed
    0 erase: 52 ticks, 76 KiB/s 0.608 Mbps
    1 check: 5 ticks, 800 KiB/s 6.400 Mbps
    2 write: 14 ticks, 285 KiB/s 2.280 Mbps
    3 read: 3 ticks, 1333 KiB/s 10.664 Mbps

The values are the same as in Linux, except adjusted for the U-Boot
definition of INFO().

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: imx: Implement set_speed
Marek Vasut [Wed, 3 Feb 2021 16:53:57 +0000 (17:53 +0100)]
spi: imx: Implement set_speed

The set_speed() callback should configure the bus speed, make it so.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoMerge branch '2021-02-25-remove-platforms'
Tom Rini [Thu, 25 Feb 2021 18:18:27 +0000 (13:18 -0500)]
Merge branch '2021-02-25-remove-platforms'

- Remove various older platforms that are missing DM migrations and have
  had their removal ack'd.

3 years agoppc: Remove MPC8569MDS board
Tom Rini [Sun, 21 Feb 2021 01:06:29 +0000 (20:06 -0500)]
ppc: Remove MPC8569MDS board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is the last ARCH_MPC8569 board, remove that support
as well.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoppc: configs: Remove a few non-updated build configurations
Tom Rini [Sun, 21 Feb 2021 01:06:28 +0000 (20:06 -0500)]
ppc: configs: Remove a few non-updated build configurations

In the cases of T2080RDB_SECURE_BOOT, T2080RDB_SRIO_PCIE_BOOT,
P2041RDB_SECURE_BOOT, P2041RDB_SRIO_PCIE_BOOT, P3041DS_SRIO_PCIE_BOOT
and P4080DS_SRIO_PCIE_BOOT while some forms of the board have been
migrated more fully to current build standards, these have not.  Remove
them.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: Remove sksimx6 board
Tom Rini [Sun, 21 Feb 2021 01:06:17 +0000 (20:06 -0500)]
arm: Remove sksimx6 board

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

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>
3 years agoarm: Remove mx53smd board
Tom Rini [Sun, 21 Feb 2021 01:06:12 +0000 (20:06 -0500)]
arm: Remove mx53smd board

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

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: Remove mx53ard board
Tom Rini [Sun, 21 Feb 2021 01:06:10 +0000 (20:06 -0500)]
arm: Remove mx53ard board

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

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: Remove mx25pdk board
Tom Rini [Sun, 21 Feb 2021 01:05:44 +0000 (20:05 -0500)]
arm: Remove mx25pdk board

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

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoMerge branch '2021-02-24-assorted-fixes'
Tom Rini [Thu, 25 Feb 2021 13:20:54 +0000 (08:20 -0500)]
Merge branch '2021-02-24-assorted-fixes'

- squashfs, btrfs fixes
- Kconfig CONFIG logic fixes
- hikey DM migration
- Some portability fixes for the build system
- Assorted code cleanups

3 years agoriscv: k210: Enable QSPI for spi3
Sean Anderson [Fri, 5 Feb 2021 04:11:19 +0000 (23:11 -0500)]
riscv: k210: Enable QSPI for spi3

This device has four IOs connected to the SPI flash. Add the appropriate
bindings.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
3 years agocmd/riscv/sbi: support System Reset Extension
Heinrich Schuchardt [Sun, 17 Jan 2021 21:27:13 +0000 (21:27 +0000)]
cmd/riscv/sbi: support System Reset Extension

Let the sbi command detect the 'System Reset Extension'
(EID #0x53525354 "SRST").

Cf. https://github.com/riscv/riscv-sbi-doc

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
3 years agocommon: Add "ifndef __ASSEMBLY__" in asm/global_data.h
Siew Chin Lim [Tue, 23 Feb 2021 06:34:37 +0000 (14:34 +0800)]
common: Add "ifndef __ASSEMBLY__" in asm/global_data.h

Commit "common: Drop asm/global_data.h from common header" added
asm/global_data.h into secure.h. However, secure.h will be included
by psci.S. Adding asm/global_data.h has caused compilation failure in
pcsi.S. Add "ifndef __ASSEMBLY__" in asm/global_data.h.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agonet: cortina_ni: buffer overrun
Heinrich Schuchardt [Sat, 20 Feb 2021 09:44:04 +0000 (10:44 +0100)]
net: cortina_ni: buffer overrun

When copying to a u32 field we should use sizeof(u32) and not
sizeof(*u32) in memcpy.

On 64bit systems like cortina_presidio-asic-emmc_defconfig using
sizeof(*u32) leads to a buffer overrun.

Fixes: 9d9f8f22c76e ("net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
3 years agomtd: rawnand: cortina_nand: missing initialization
Heinrich Schuchardt [Sat, 20 Feb 2021 09:42:50 +0000 (10:42 +0100)]
mtd: rawnand: cortina_nand: missing initialization

ca_do_bch_correction() takes a random value from the stack and starts
counting bitflips from this value. Initialize the counter.

This passed unnoticed as the value is finally ignored in the call
hierarchy.

Fixes: bd674b7201ea ("mtd: rawnand: cortina_nand: Add Cortina CAxxxx SoC support")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodm: ddr: socfpga: don't assign values that are not used
Heinrich Schuchardt [Sat, 20 Feb 2021 09:40:23 +0000 (10:40 +0100)]
dm: ddr: socfpga: don't assign values that are not used

The values of left_edge[0] and right_edge[0] are overwritten before they
are used. Remove the superfluous assignments.

Fixes: a2734ab91de9 ("dm: ddr: socfpga: fix gen5 ddr driver to not use bss")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: sha512: include "compiler.h"
Siew Chin Lim [Fri, 19 Feb 2021 02:32:07 +0000 (10:32 +0800)]
lib: sha512: include "compiler.h"

Include "compiler.h" in sha512.c. This is needed by 'cpu_to_be64' macro
that used in 'sha512_base_do_finalize' function.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agorng: iProc rng200: Rename ..._platdata variables to just ..._plat
Peter Robinson [Thu, 18 Feb 2021 20:06:37 +0000 (20:06 +0000)]
rng: iProc rng200: Rename ..._platdata variables to just ..._plat

In 9055f7da Simon dropped data from all the various _platdata calls
but it seems this wasn't caught for the RNG200 driver from when it
was posted to merged. This fixes that issue.

Fixes: 7cc1ecb1 (rng: Add iProc RNG200 driver)
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
3 years agotest: missing dependency for test/cmd/setexpr.c
Heinrich Schuchardt [Wed, 17 Feb 2021 11:58:14 +0000 (12:58 +0100)]
test: missing dependency for test/cmd/setexpr.c

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to `setexpr_regex_sub'
ld.bfd: test/built-in.o: in function `setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: rsa: struct udevice build warning
Heinrich Schuchardt [Wed, 17 Feb 2021 11:54:31 +0000 (12:54 +0100)]
lib: rsa: struct udevice build warning

Avoid build warnings observed with gcc 10.2

In file included from lib/rsa/rsa-keyprop.c:16:
include/u-boot/rsa-mod-exp.h:65:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   65 | int rsa_mod_exp(struct udevice *dev, const uint8_t *sig,
      | uint32_t sig_len,
      |                        ^~~~~~~
include/u-boot/rsa-mod-exp.h:96:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   96 |  int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
      |

by defining struct udevice.

Fixes: a8f86699a83e ("common: Drop asm/global_data.h from common header")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoconfigs: BPI-R2: Disable EFI Grub workaround
Matthias Brugger [Tue, 16 Feb 2021 19:54:07 +0000 (20:54 +0100)]
configs: BPI-R2: Disable EFI Grub workaround

The EFI Grub workaround on BananaPi R2 slows down the boot process to
the point, that the watchdog will trigger a reboot before the kernel can
reset it. Fix this by disabeling the workaround.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agolib: rsa: Add debug message on algo mismatch
Sean Anderson [Tue, 16 Feb 2021 16:40:15 +0000 (11:40 -0500)]
lib: rsa: Add debug message on algo mismatch

Currently we fail silently if there is an algorithm mismatch. To help
distinguish this failure condition.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agovexpress64_fvp: Set DRAM to 4G to match with kernel devicetree
Diego Sueiro [Mon, 15 Feb 2021 07:27:57 +0000 (07:27 +0000)]
vexpress64_fvp: Set DRAM to 4G to match with kernel devicetree

Currently, the kernel devicetree is setting the DRAM size to ~4G.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
3 years agovirtio: fix off by one device id comparison
Vincent Stehlé [Sun, 14 Feb 2021 18:39:04 +0000 (19:39 +0100)]
virtio: fix off by one device id comparison

VIRTIO_ID_MAX_NUM is the largest device ID plus 1. Therefore a device id
cannot be greater or equal to VIRTIO_ID_MAX_NUM. Fix the comparison
accordingly.

Fixes: 6d48a934966b ("dm: Add a new uclass driver for VirtIO transport devices")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
3 years agobuild/DTC: fix sed usage in DTC command
Roger Pau Monne [Sat, 13 Feb 2021 10:06:32 +0000 (11:06 +0100)]
build/DTC: fix sed usage in DTC command

Current sed usage in the DTC command relies on GNU sed specific -i
option which has a slightly different syntax for BSD sed and always
expects an extension to be provided in order to create a backup file.

Instead drop the cat concatenation done before the sed call and use
sed itself to edit and concatenate the files.

No functional change intended.

Signed-off-by: Roger Pau Monné <royger@FreeBSD.org>