platform/kernel/u-boot.git
3 years agomips: octeon: Add cvmx-l2c-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:36 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-l2c-defs.h header file

Import cvmx-l2c-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-ipd-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:35 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-ipd-defs.h header file

Import cvmx-ipd-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-gserx-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:34 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-gserx-defs.h header file

Import cvmx-gserx-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-gmxx-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:33 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-gmxx-defs.h header file

Import cvmx-gmxx-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-fpa-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:32 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-fpa-defs.h header file

Import cvmx-fpa-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-dtx-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:31 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-dtx-defs.h header file

Import cvmx-dtx-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-dpi-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:30 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-dpi-defs.h header file

Import cvmx-dpi-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-dbg-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:29 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-dbg-defs.h header file

Import cvmx-dbg-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-ciu-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:28 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-ciu-defs.h header file

Import cvmx-ciu-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-bgxx-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:27 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-bgxx-defs.h header file

Import cvmx-bgxx-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-asxx-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:26 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-asxx-defs.h header file

Import cvmx-asxx-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add cvmx-agl-defs.h header file
Aaron Williams [Fri, 11 Dec 2020 16:05:25 +0000 (17:05 +0100)]
mips: octeon: Add cvmx-agl-defs.h header file

Import cvmx-agl-defs.h header file from 2013 U-Boot. It will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: octeon: Add misc cvmx-helper header files
Aaron Williams [Fri, 11 Dec 2020 16:05:24 +0000 (17:05 +0100)]
mips: octeon: Add misc cvmx-helper header files

Import misc cvmx-helper header files from 2013 U-Boot. They will be used
by the later added drivers to support PCIe and networking on the MIPS
Octeon II / III platforms.

Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
3 years agomips: global_data.h: Add Octeon specific data to arch_global_data struct
Stefan Roese [Fri, 11 Dec 2020 16:05:23 +0000 (17:05 +0100)]
mips: global_data.h: Add Octeon specific data to arch_global_data struct

This will be used by the upcoming Serdes and driver code ported from
the original 2013 U-Boot code to mainline.

Signed-off-by: Stefan Roese <sr@denx.de>
3 years agotest/py: Bump py to 1.10.0 for CVE-2020-29651
Tom Rini [Wed, 21 Apr 2021 14:22:01 +0000 (10:22 -0400)]
test/py: Bump py to 1.10.0 for CVE-2020-29651

Bump our py version to 1.10.0 to address CVE-2020-29651.

Reported-by: GitHub dependabot
Reported-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'video-2021-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sat, 24 Apr 2021 17:30:57 +0000 (13:30 -0400)]
Merge tag 'video-2021-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-video

 - search for additional detailed timings in the EDID extension block
 - rework sunxi DE2 driver and accompanying DW-HDMI platform driver
   to drop redundant device specific code, and later use the DT as a
   source of information

3 years agoMerge tag 'efi-2021-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 24 Apr 2021 13:27:49 +0000 (09:27 -0400)]
Merge tag 'efi-2021-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc1-3

Documentation fixes

UEFI bug fixes:

* error handling for capsule updates

3 years agovideo: sunxi: de2: switch to public uclass functions
Jernej Skrabec [Thu, 22 Apr 2021 00:14:34 +0000 (01:14 +0100)]
video: sunxi: de2: switch to public uclass functions

Currently DE2 driver uses functions which are defined in internal
headers. They are not meant to be used outside of uclass framework.
Switch DE2 driver to public ones. This has additional benefit that
device_probe doesn't need to be called manually.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agovideo: sunxi: dw-hdmi: read source_id later
Jernej Skrabec [Thu, 22 Apr 2021 00:14:33 +0000 (01:14 +0100)]
video: sunxi: dw-hdmi: read source_id later

There is no real need to read source_id at probe time. It also doesn't
make sense to store it in driver private data since it's already stored
in class platform data. While this looks like cleanup (and it is), it's
also important for DE2 driver rework because this info will be filled
later (after probe is already executed).

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agovideo: sunxi: Remove TV probe from DE2
Jernej Skrabec [Thu, 22 Apr 2021 00:14:32 +0000 (01:14 +0100)]
video: sunxi: Remove TV probe from DE2

TV driver was never fully implemented. Remove search for it from DE2
driver.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agovideo: sunxi: Remove check for ddc-i2c-bus property
Jernej Skrabec [Thu, 22 Apr 2021 00:14:31 +0000 (01:14 +0100)]
video: sunxi: Remove check for ddc-i2c-bus property

No Allwinner board with DW-HDMI controller use separate I2C bus for
EDID read. Remove that check.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agovideo: sunxi: Use DW-HDMI hpd function
Jernej Skrabec [Thu, 22 Apr 2021 00:14:30 +0000 (01:14 +0100)]
video: sunxi: Use DW-HDMI hpd function

It turns out that there are two ways how hot plug detection can be done.
One is standard way for DW HDMI controller - checking bit 2 in 0x3004
register. Another way is applicable only to Allwinner custom PHY - by
checking bit 19 in register 0x10038. Both methods are equally good as
far as we know.

Use standard method in order to reduce amount of custom code.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agocommon: edid: Search for valid timing in extension block
Jernej Skrabec [Thu, 22 Apr 2021 00:14:29 +0000 (01:14 +0100)]
common: edid: Search for valid timing in extension block

One of my monitors have only 4k@60 timing in base EDID block which is
out of range for devices with HDMI 1.4. It turns out that it has
additional detailed timings in CTA-861 Extension Block and two of them
are appropriate for HDMI 1.4.

Add additional search for valid detailed timing in extension block.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agocommon: edid: extract code for detailed timing search
Jernej Skrabec [Thu, 22 Apr 2021 00:14:28 +0000 (01:14 +0100)]
common: edid: extract code for detailed timing search

Code which searches for valid detailed timing entry will be used in more
places. Extract it.

No functional change is made. However, descriptors are casted to
edid_detailed_timing instead of edid_monitor_descriptor. Descriptor can
be of either type, but since we're interested only in DTD, it is more
fitting to cast to edid_detailed_timing.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agocommon: edid: check for digital display earlier
Jernej Skrabec [Thu, 22 Apr 2021 00:14:27 +0000 (01:14 +0100)]
common: edid: check for digital display earlier

When searching for detailed timing in EDID, check for digital display
earlier. There is no point parsing other parameters if this flag is not
present.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agovideo: sunxi: Add mode_valid callback to sunxi_dw_hdmi
Jernej Skrabec [Thu, 22 Apr 2021 00:14:26 +0000 (01:14 +0100)]
video: sunxi: Add mode_valid callback to sunxi_dw_hdmi

Currently driver accepts all resolution which won't work on 4k screens.
Add validation callback which limits acceptable resolutions to 297 MHz.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agotest/py: Fix efidebug related tests
Ilias Apalodimas [Fri, 23 Apr 2021 13:24:13 +0000 (16:24 +0300)]
test/py: Fix efidebug related tests

commit cbea241e935e("efidebug: add multiple device path instances on Boot####")
slightly tweaked the efidebug syntax adding -b, -i and -s for the boot
image, initrd and optional data.
The pytests using this command were adapted as well. However I completely
missed the last "" argument, which at the time indicated the optional data
and needed conversion as well.  This patch is adding the missing -s flag
and the tests are back to normal.

Fixes: cbea241e935e("efidebug: add multiple device path instances on Boot####")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: capsule: return a correct error code at find_boot_device()
AKASHI Takahiro [Tue, 20 Apr 2021 01:03:16 +0000 (10:03 +0900)]
efi_loader: capsule: return a correct error code at find_boot_device()

In case of failure at efi_get_variable_int("BootOrder"), we should
skip examining boot option variables and return an appropriate error
code which is the one the function returned.

Fixes: CID 331153 Code maintainability issues  (UNUSED_VALUE)
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi: Fix ESRT refresh after Capsule update
Jose Marinho [Mon, 19 Apr 2021 13:54:33 +0000 (14:54 +0100)]
efi: Fix ESRT refresh after Capsule update

Indicated by Coverity Scan CID 331147

The ESRT was being refreshed in situations where the UpdateCapsule
procedure failed. In that scenario:

1) the ESRT refresh was superfluous.
2) a failed ESRT refresh return code overwrites the UpdateCapsule error
return code.

This commit ensures that the ESRT is only refreshed when the
UpdateCapsule performs successfully.

CC: Heinrich Schuchardt <xypron.glpk@gmx.de>
CC: Sughosh Ganu <sughosh.ganu@linaro.org>
CC: AKASHI Takahiro <takahiro.akashi@linaro.org>
CC: Tom Rini <trini@konsulko.com>
CC: Andre Przywara <andre.przywara@arm.com>
CC: nd@arm.com
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: simplify tcg2_create_digest()
Ilias Apalodimas [Thu, 22 Apr 2021 11:32:14 +0000 (14:32 +0300)]
efi_loader: simplify tcg2_create_digest()

Bumping the digest list count, for all supported algorithms,  can be
calculated outside of the individual switch statements.  So let's do that
for every loop iteration instead and simplify the code a bit.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: missing include in efi_string.c
Heinrich Schuchardt [Wed, 21 Apr 2021 10:39:15 +0000 (12:39 +0200)]
efi_loader: missing include in efi_string.c

To avoid diverging function definitions we need to include efi_loader.h.

Fixes: fe179d7fb5c1 ("efi_loader: Add size checks to efi_create_indexed_name()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: imx: psb: Fix missing setexpr arguments
Marek Vasut [Sun, 11 Apr 2021 16:30:36 +0000 (18:30 +0200)]
doc: imx: psb: Fix missing setexpr arguments

Due to copy-paste error, two of the setexpr arguments were missing.
Add the missing arguments.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: fatinfo man-page
Heinrich Schuchardt [Mon, 19 Apr 2021 19:54:45 +0000 (21:54 +0200)]
doc: fatinfo man-page

Provide a man-page for the fatinfo command.

The .rst file was lost in patch 15d9694600fe ("doc: fatinfo man-page").

Fixes: 15d9694600fe ("doc: fatinfo man-page")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge branch '2021-04-22-assorted-updates'
Tom Rini [Fri, 23 Apr 2021 16:21:37 +0000 (12:21 -0400)]
Merge branch '2021-04-22-assorted-updates'

- Move LMB to Kconfig, improve functionality
- Add partlabel support to more fs cmds

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 23 Apr 2021 11:31:36 +0000 (07:31 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

3 years agoMerge tag 'mips-pull-2021-04-22' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 23 Apr 2021 11:31:21 +0000 (07:31 -0400)]
Merge tag 'mips-pull-2021-04-22' of https://source.denx.de/u-boot/custodians/u-boot-mips

- net: fix traffic problems in MSCC Jaguar 2 network driver
- MIPS: mt7628: fix DDR memory init
- MIPS: octeon: add MMC and USB support

3 years agousb: ehci-hcd: Add IAA handshake for removing async QH
Ye Li [Tue, 9 Mar 2021 03:26:57 +0000 (19:26 -0800)]
usb: ehci-hcd: Add IAA handshake for removing async QH

According to EHCI spec, software needs to do handshake with HC for
safely removing QH from async list. This handshake is implemented by
setting IAAD (Interrupt on Async Advance Doorbell) bit in USB_USBCMD
register and poll the IAA (Interrupt on Async Advance bit) in the
USB_USBSTS to ensure the HC has released all on-chip state that may
potentially reference one of the data structures just removed.

Current codes only check active status of the last QTD, but this can't
ensure the QH is released from HC. We can meet unrecoverable
"EHCI timed out on TD" errors when running UEFI SCT tests on USB disk.
The USB_ASYNCLISTADDR register is changed to a invalid address when the
issue happens. It is fixed after adding the IAA handshake.

Steps to reproduce the issue:
1. Build the UEFI SCT from https://github.com/tianocore/edk2-test
2. Build the EDK2 UEFI Shell from https://github.com/tianocore/edk2
3. Copy SCT files and Shell.efi to USB disk FAT partition
4. Load the Shell.efi from USB FAT, and run bootefi to execute it
5. After booting into Shell, enter the SCT directory and run "sct -a"
   to execute all tests.
6. Tests run about 1 hour and stop with many EHCI timeout errors like
   EHCI timed out on TD - token=0x801f8c80

Signed-off-by: Ye Li <ye.li@nxp.com>
3 years agoconfigs: stm32mp15: increase the number of reserved memory region in lmb
Patrick Delaunay [Wed, 10 Mar 2021 09:16:32 +0000 (10:16 +0100)]
configs: stm32mp15: increase the number of reserved memory region in lmb

For the latest kernel device tree the max number of reserved regions
in lmb library is reached: 8 with 5 reserved regions in device tree.

When a new region is added, the lmb allocation for the device tree
relocation failed and boot with ramdisk failed.

This patch avoids this issue by increasing the max number of
supported reserved memory in lmb library to 16.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: Add 2 config to define the max number of regions
Patrick Delaunay [Wed, 10 Mar 2021 09:16:31 +0000 (10:16 +0100)]
lmb: Add 2 config to define the max number of regions

Add 2 configs CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVED_REGIONS
to change independently the max number of the regions in lmb
library.

When CONFIG_LMB_USE_MAX_REGIONS=y, move the lmb property arrays to
struct lmb and manage the array size with the element 'max' of struct
lmb_region; their are still allocated in stack.

When CONFIG_LMB_USE_MAX_REGIONS=n, keep the current location in
struct lmb_region to allow compiler optimization.

Increase CONFIG_LMB_RESERVED_REGIONS is useful to avoid lmb errors in
bootm when the number of reserved regions (not adjacent) is reached:
+ 1 region for relocated U-Boot
+ 1 region for initrd
+ 1 region for relocated linux device tree
+ reserved memory regions present in Linux device tree.

The current limit of 8 regions is reached with only 5 reserved regions
in DT.

see Linux kernel commit bf23c51f1f49 ("memblock: Move memblock arrays
to static storage in memblock.c and make their size a variable")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agotest: lmb: add test for overflow protection in lmb_add_region
Patrick Delaunay [Wed, 10 Mar 2021 09:16:30 +0000 (10:16 +0100)]
test: lmb: add test for overflow protection in lmb_add_region

Add test for max number of memory regions and in reserved regions.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: correct size of the regions array
Patrick Delaunay [Wed, 10 Mar 2021 09:16:29 +0000 (10:16 +0100)]
lmb: correct size of the regions array

As in lmb_region, cnt < max and in the lmb library
use region[i] only with i in 0...cnt, this region array size
can be reduced by 1 element without overflow.

This patch allows to reduce the struct lmb size.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: move MAX_LMB_REGIONS value in Kconfig
Patrick Delaunay [Wed, 10 Mar 2021 09:16:28 +0000 (10:16 +0100)]
lmb: move MAX_LMB_REGIONS value in Kconfig

Move MAX_LMB_REGIONS value in Kconfig, the max number of the regions
in lmb library.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: add a max parameter in the struct lmb_region
Patrick Delaunay [Wed, 10 Mar 2021 09:16:27 +0000 (10:16 +0100)]
lmb: add a max parameter in the struct lmb_region

Add a max parameter in lmb_region struct to handle test
in lmb_add_region without using the MAX_LMB_REGIONS
define.

This patch allows to modify these size independently for
memory of reserved regions in the next patches.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: remove lmb_region.size
Patrick Delaunay [Wed, 10 Mar 2021 09:16:26 +0000 (10:16 +0100)]
lmb: remove lmb_region.size

Remove the unused field size of struct lmb_region as it is initialized to 0
and never used after in lmb library.

See Linux kernel commit 4734b594c6ca ("memblock: Remove memblock_type.size
and add memblock.memory_size instead")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolmb: move CONFIG_LMB in Kconfig
Patrick Delaunay [Wed, 10 Mar 2021 09:16:25 +0000 (10:16 +0100)]
lmb: move CONFIG_LMB in Kconfig

Migrate CONFIG_LMB in Kconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agocheckpatch: Ignore ENOSYS warnings
Sean Anderson [Thu, 15 Apr 2021 02:02:21 +0000 (22:02 -0400)]
checkpatch: Ignore ENOSYS warnings

There are no system calls in U-Boot, but ENOSYS is still allowed (and
preferred since 42a2668743 ("dm: core: Document the common error codes")).
Silence this warning.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotest: Add test for partitions
Sean Anderson [Mon, 12 Apr 2021 22:53:07 +0000 (18:53 -0400)]
test: Add test for partitions

This is technically a library function, but we use MMCs for testing, so
it is easier to do it with DM. At the moment, the only block devices in
sandbox are MMCs (AFAIK) so we just test with those.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agopart: Fix bogus return from part_get_info_by_dev_and_name
Sean Anderson [Mon, 12 Apr 2021 22:53:06 +0000 (18:53 -0400)]
part: Fix bogus return from part_get_info_by_dev_and_name

blk_get_device_by_str returns the device number on success. So we must
check if the return was negative to determine an error.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions
Sean Anderson [Mon, 12 Apr 2021 22:53:05 +0000 (18:53 -0400)]
cmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions

This allows using dev#partlabel syntax.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agotest: Alphabetize dm Makefile
Sean Anderson [Tue, 20 Apr 2021 15:03:12 +0000 (11:03 -0400)]
test: Alphabetize dm Makefile

Recently, tests have been added primarily to the end of the dm Makefile.
This results in merge conflicts when two people add new tests at the
same time. To reduce these conflicts, alphabetize the makefile.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agoMerge branch '2021-04-22-udoo_neo-update'
Tom Rini [Thu, 22 Apr 2021 15:29:32 +0000 (11:29 -0400)]
Merge branch '2021-04-22-udoo_neo-update'

- Update the udoo_neo platform for DM support

3 years agomips: octeon: octeon_ebb7304_defconfig: Enable USB storage support
Stefan Roese [Fri, 19 Feb 2021 13:02:17 +0000 (14:02 +0100)]
mips: octeon: octeon_ebb7304_defconfig: Enable USB storage support

This patch enables USB storage support with the necessary partition
support on the MIPS Octeon EBB7304.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
3 years agomips: octeon: octeon_ebb7304_defconfig: Enable MMC support
Stefan Roese [Fri, 12 Mar 2021 08:48:28 +0000 (09:48 +0100)]
mips: octeon: octeon_ebb7304_defconfig: Enable MMC support

Enable MMC support including the regulator support on Octeon EBB7304.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agomips: octeon: mrvl,octeon_ebb7304.dts: Add MMC DT node
Stefan Roese [Fri, 12 Mar 2021 08:48:27 +0000 (09:48 +0100)]
mips: octeon: mrvl,octeon_ebb7304.dts: Add MMC DT node

Add the MMC DT node to the Octeon EBB7304 DT file including the
regulator node for the MMC power supply.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agomips: octeon: mrvl,cn73xx.dtsi: Add MMC DT node
Stefan Roese [Fri, 12 Mar 2021 08:48:26 +0000 (09:48 +0100)]
mips: octeon: mrvl,cn73xx.dtsi: Add MMC DT node

Add the MMC DT node to the Octeon CN73xx dtsi file.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agommc: octeontx_hsmmc: Add support for MIPS Octeon
Stefan Roese [Fri, 12 Mar 2021 08:48:25 +0000 (09:48 +0100)]
mmc: octeontx_hsmmc: Add support for MIPS Octeon

Until now, the Octeontx MMC driver did only support the ARM Octeon
TX/Tx2 platforms. This patch adds support for the MIPS Octeon platform
to this driver. Here a short summary of the changes:

- Enable driver compilation for MIPS Octeon, including the MMC related
  header file
- Reorder header inclusion
- Switch to using the clk framework to get the input clock
- Remove some functions for MIPS Octeon, as some registers don't
  exist here

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agomips: mt7628: fix the displayed DDR type of mt7628
Weijie Gao [Fri, 5 Mar 2021 03:13:27 +0000 (11:13 +0800)]
mips: mt7628: fix the displayed DDR type of mt7628

The MT7688KN is a multi-chip package with 8MiB DDR1 KGD. So the DDR type
from bootstrap register must be ignored, and always be assumed as DDR1.

This patch fixes the displayed DDR type of mt7628.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomips: mt7628: fix ddr_type for MT7688KN
Weijie Gao [Tue, 23 Feb 2021 07:12:44 +0000 (15:12 +0800)]
mips: mt7628: fix ddr_type for MT7688KN

The MT7688KN is a multi-chip package with 8MiB DDR1 KGD. So the DDR type
from bootstrap register must be ignored, and always be assumed as DDR1.

This patch fixes an issue that mt7628_ddr_pad_ldo_config() may be passed
with a wrong ddr_type in MT7688KN.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agonet: jr2: Fix Serdes6G configuration
Horatiu Vultur [Wed, 10 Mar 2021 08:31:39 +0000 (09:31 +0100)]
net: jr2: Fix Serdes6G configuration

Sometimes no traffic was getting out on the ports, the root cause was
a wrong configuration of the Serdes6G, which is used on jr2 pcb111.
This patch fixes this issue by applying the correct configuration.

Fixes: 5e1d417bec92ac ("net: Add MSCC Jaguar2 network driver.")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: jr2: Reset switch
Horatiu Vultur [Wed, 10 Mar 2021 08:31:38 +0000 (09:31 +0100)]
net: jr2: Reset switch

Make sure to reset the switch core at probe time.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoARM: imx: udoo_neo: Convert to ethernet DM
Peter Robinson [Thu, 1 Apr 2021 20:08:13 +0000 (21:08 +0100)]
ARM: imx: udoo_neo: Convert to ethernet DM

Convert the UDOO Neo to ethernet DM support.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Francesco Montefoschi <francesco.montefoschi@udoo.org>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo_neo: convert to DM_MMC
Peter Robinson [Thu, 1 Apr 2021 20:08:12 +0000 (21:08 +0100)]
ARM: imx: udoo_neo: convert to DM_MMC

Convert UDOO Neo to use DM MMC.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Francesco Montefoschi <francesco.montefoschi@udoo.org>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Thu, 1 Apr 2021 20:08:11 +0000 (21:08 +0100)]
ARM: imx: udoo_neo: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6SX based Udoo Neo.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Francesco Montefoschi <francesco.montefoschi@udoo.org>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: board: udoo_neo: Import UDOO Neo dts files
Peter Robinson [Thu, 1 Apr 2021 20:08:10 +0000 (21:08 +0100)]
ARM: board: udoo_neo: Import UDOO Neo dts files

Import the i.MX6SX based UDOO Neo dts files from Linux 5.12-rc1
and sync the i.MX6SX pinfunc.h

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Francesco Montefoschi <francesco.montefoschi@udoo.org>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoMerge branch '2021-04-20-assorted-improvements'
Tom Rini [Tue, 20 Apr 2021 11:32:04 +0000 (07:32 -0400)]
Merge branch '2021-04-20-assorted-improvements'

- ARM64 GIC fix, CONFIG_IRQ now moved to Kconfig
- IDE, lz4 fixes
- octeontx cleanups / enhancements
- highbank DM migration
- psci updates
- Enable use of -fstack-protector

3 years agoAdd support for stack-protector
Joel Peshkin [Sun, 11 Apr 2021 09:21:58 +0000 (11:21 +0200)]
Add support for stack-protector

Add support for stack protector for UBOOT, SPL, and TPL
as well as new pytest for stackprotector

Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com>
Adjust UEFI build flags.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agox86: correct usage of CFLAGS_NON_EFI
Heinrich Schuchardt [Sun, 11 Apr 2021 09:21:57 +0000 (11:21 +0200)]
x86: correct usage of CFLAGS_NON_EFI

The current usage of the variable CFLAGS_NON_EFI on the x86 architecture
deviates from other architectures.

Variable CFLAGS_NON_EFI is the list of compiler flags to be removed when
building UEFI applications. It is not a list of flags to be added anywhere.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agotest: fix test/dm/regmap.c
Heinrich Schuchardt [Sun, 11 Apr 2021 09:21:56 +0000 (11:21 +0200)]
test: fix test/dm/regmap.c

regmap_read() only fills the first two bytes of val. The last two bytes are
random data from the stack. This means the test will fail randomly.

For low endian systems we could simply initialize val to 0 and get correct
results. But tests should not depend on endianness. So let's use a pointer
conversion instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotoradex: configblock: fix module revision in config block
Denys Drozdov [Wed, 7 Apr 2021 12:28:24 +0000 (15:28 +0300)]
toradex: configblock: fix module revision in config block

U-boot might display wrong module revision information
for modules with an assembly version 'K'. "cfgblock create"
does not takes into account all revision digits from PID8.

This fix takes into account all digits of PID8
to store module revision.

Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agodoc: usage: add usage details for reset cmd
Igor Opaniuk [Wed, 31 Mar 2021 23:01:56 +0000 (02:01 +0300)]
doc: usage: add usage details for reset cmd

Add usage details for reset command.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
3 years agosysreset: provide type of reset in do_reset cmd
Igor Opaniuk [Wed, 31 Mar 2021 23:01:55 +0000 (02:01 +0300)]
sysreset: provide type of reset in do_reset cmd

Add additional param for reset cmd, which provides type of reset.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
3 years agosysreset: psci: use psci driver exported functions
Igor Opaniuk [Wed, 31 Mar 2021 23:01:54 +0000 (02:01 +0300)]
sysreset: psci: use psci driver exported functions

Use psci driver exported functions for reset/poweroff, instead of
invoking directly invoke_psci_fn.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
3 years agopsci: add features/reset2 support
Igor Opaniuk [Wed, 31 Mar 2021 23:01:53 +0000 (02:01 +0300)]
psci: add features/reset2 support

Adds support for:
* PSCI_FEATURES, which was introduced in PSCI 1.0. This provides API
that allows discovering whether a specific PSCI function is implemented
and its features.
* SYSTEM_RESET2, which was introduced in PSCI 1.1, which extends existing
SYSTEM_RESET. It provides support for vendor-specific resets, providing
reset_type as an additional param.

For additional details visit [1].

Implementations of some functions were borrowed from Linux PSCI driver
code [2].

[1] https://developer.arm.com/documentation/den0022/latest/
[2] drivers/firmware/psci/psci.c

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
3 years agopsci: add v1.0/v1.1 definitions from Linux
Igor Opaniuk [Wed, 31 Mar 2021 23:01:52 +0000 (02:01 +0300)]
psci: add v1.0/v1.1 definitions from Linux

Sync and add PSCI API versions 1.0/1.1 definitions from Linux.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
3 years agosysinfo.h: Add re-inclusion guard
Tom Rini [Mon, 19 Apr 2021 20:18:49 +0000 (16:18 -0400)]
sysinfo.h: Add re-inclusion guard

Add #ifndef __SYSINFO_H__ ... #endif to prevent re-inclusion of this
file.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoarm: highbank: Update maintainership
Andre Przywara [Mon, 12 Apr 2021 00:04:55 +0000 (01:04 +0100)]
arm: highbank: Update maintainership

Rob does not have access to any Calxeda systems anymore, also has
expressed a lack of interest in those systems in the past.

I have multiple working Midway nodes under my desk in the office, so
am happy to take over maintainership.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoarm: highbank: Do DRAM init from DT
Andre Przywara [Mon, 12 Apr 2021 00:04:54 +0000 (01:04 +0100)]
arm: highbank: Do DRAM init from DT

So far U-Boot was hard coding a (surely sufficient) memory size of 512
MB, even though all machines out there have at least 4GB of DRAM.
Since U-Boot uses its memory knowledge to populate the EFI memory map,
we are missing out here, at best losing everything beyond 4GB on Midway
boxes (which typically come with 8GB of DRAM).

Since the management processor populated the DT memory node already with
the detected DRAM size and configuration, we use that to populate
U-Boot's memory bank information, which is the base for the UEFI memory
map.
This finally allows us to get rid of the NR_DRAM_BANKS=0 hack, that we
had in place to avoid U-Boot messing up the DT memory node before
loading the kernel.

Also, to cover the whole of memory, we need to enable PHYS_64BIT.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoarm: highbank: Remove artificial SDRAM size
Andre Przywara [Mon, 12 Apr 2021 00:04:53 +0000 (01:04 +0100)]
arm: highbank: Remove artificial SDRAM size

So far we were defining a somewhat confusing PHYS_SDRAM_1_SIZE variable,
which originally was only used for setting the memtest boundaries. This
definition in highbank.h has been removed about a year ago (moved to
Kconfig), so we also don't need the hard-coded size definition any longer.

Get rid of the misleading memory size definition, which was actually wrong
anyway (it's 4088 MB for those machines with just 4GB of DRAM).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agonet: calxedagmac: Convert to DM_ETH
Andre Przywara [Mon, 12 Apr 2021 00:04:52 +0000 (01:04 +0100)]
net: calxedagmac: Convert to DM_ETH

To squash that nasty warning message and make better use of the newly
gained OF_CONTROL feature, let's convert the calxedagmac driver to the
"new" driver model.
The conversion is pretty straight forward, mostly just adjusting the
use of the involved data structures.
The only actual change is the required split of the receive routine into
a receive and free_pkt part.
Also this allows us to get rid of the hardcoded platform information and
explicit init calls.

This also uses the opportunity to wrap the code decoding the MMIO
register base address, to make it safe for using PHYS_64BIT later.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoarm: highbank: Enable OF_CONTROL
Andre Przywara [Mon, 12 Apr 2021 00:04:51 +0000 (01:04 +0100)]
arm: highbank: Enable OF_CONTROL

All Calxeda machines are actually a poster book example of device tree
usage: the DT is loaded from flash by the management processor into
DRAM, the memory node is populated with the detected DRAM size and this
DT is then handed over to the kernel.
So it's a shame that U-Boot didn't participate in this chain, but
fortunately this is easy to fix:

Define CONFIG_OF_CONTROL and CONFIG_OF_BOARD, and provide a trivial
function to tell U-Boot about the (fixed) location of the DTB in DRAM.
Then enable DM_SERIAL, to let the PL011 driver pick up the UART platform
data from the DT. Also define AHCI, to bring this driver into the driver
model world as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoarm: highbank: Limit FDT and initrd load addresses
Andre Przywara [Mon, 12 Apr 2021 00:04:50 +0000 (01:04 +0100)]
arm: highbank: Limit FDT and initrd load addresses

So far on Highbank/Midway machines U-Boot only ever uses 512MB of DRAM,
even though the machines have typically 4GB and 8GB, respectively.
That means that so far we didn't need an extra limit for placing the DTB
and initrd, as the 512MB are lower than the kernel's limit ("lowmem",
typically 768MB).

With U-Boot now needing to learn about the actual memory size (to
correctly populate the EFI memory map), it might relocate fdt and initrd
to the end of DRAM, which is out of reach of the kernel.

So add limiting values to the fdt_high and initrd_high environment
variables, to prevent U-Boot from using too high addresses.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agodoc: device-tree-bindings: regulator: anatop regulator
Ying-Chun Liu (PaulLiu) [Sat, 27 Mar 2021 13:46:52 +0000 (21:46 +0800)]
doc: device-tree-bindings: regulator: anatop regulator

Document the bindings for fsl,anatop-regulator

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agopower: regulator: add driver for ANATOP regulator
Ying-Chun Liu (PaulLiu) [Sat, 27 Mar 2021 13:46:51 +0000 (21:46 +0800)]
power: regulator: add driver for ANATOP regulator

Anatop is an integrated regulator inside i.MX6 SoC.
There are 3 digital regulators which controls PU, CORE (ARM), and SOC.
And 3 analog regulators which controls 1P1, 2P5, 3P0 (USB).
This patch adds the Anatop regulator driver.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agocmd: CONFIG_CMD_MMC depends on CONFIG_MMC
Heinrich Schuchardt [Sat, 27 Mar 2021 10:43:54 +0000 (11:43 +0100)]
cmd: CONFIG_CMD_MMC depends on CONFIG_MMC

Trying to compile with CONFIG_CMD_MMC=y and CONFIG_MMC=n leads to errors:

riscv64-linux-gnu-ld.bfd: cmd/built-in.o: in function `do_mmcops':
cmd/mmc.c:984: undefined reference to `get_mmc_num'
riscv64-linux-gnu-ld.bfd: cmd/built-in.o: in function `do_mmc_setdsr':
cmd/mmc.c:873: undefined reference to `find_mmc_device'

Add missing dependency.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agonet: octeontx: smi: fix mii probe
Tim Harvey [Fri, 26 Mar 2021 00:07:37 +0000 (17:07 -0700)]
net: octeontx: smi: fix mii probe

The fdt node offset is apparently not set properly when probed
causing no MDIO busses to be found. Fix this by obtaining the
offset.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agodrivers: ata: ahci: update max id if it is more than available ports
Suneel Garapati [Fri, 26 Mar 2021 00:07:36 +0000 (17:07 -0700)]
drivers: ata: ahci: update max id if it is more than available ports

After check for maximum between max id and available ports, also check
if available port count is less than max id and update.

In the case of the CN8030 OcteonTX SoC max_id needs to be reduced to
the number of ports found otherwise the following occurs on a scan:

GW6404-B> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq ilck stag pm led clo only pmp fbss pio slum part ccc
apst
  Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD8SFAT0 Rev: Z233
            Type: Hard Disk
            Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
"Synchronous Abort" handler, esr 0x96000006
elr: 000000000052f824 lr : 000000000052fa10 (reloc)
elr: 000000007fee9824 lr : 000000007fee9a10
x0 : 0000000000000001 x1 : 0000000000000001
x2 : 000000007bea3528 x3 : 000000007bea3580
x4 : 0000000000000200 x5 : 0000000000000000
x6 : 0000000000000002 x7 : 000000007bea3540
x8 : 00000000fffffff8 x9 : 0000000000000008
x10: 00000000000186a0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000007 x15: 00000000ffffffff
x16: 000000007ff439a5 x17: 000000007ff5730c
x18: 000000007bea9de0 x19: 000000007ff7a580
x20: 000000007bec79f8 x21: 0000000000000000
x22: 000000007bea3580 x23: 0000000000000000
x24: 0000000000000000 x25: 000000007bec7a00
x26: 00000000ffffffc0 x27: 000000007bec79d0
x28: 000000007beb51c0 x29: 000000007bea3480

Code: 91246800 940130c2 12800000 1400004f (b9402ae0)
Resetting CPU ...

Signed-off-by: Suneel Garapati <sgarapati@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agodrivers: net: octeontx: fix QSGMII
Tim Harvey [Fri, 26 Mar 2021 00:07:35 +0000 (17:07 -0700)]
drivers: net: octeontx: fix QSGMII

Revert a change that occured between the Marvell SDK-10.1.1.0
and SDK-10.3.1.1 which broke QSMII phy support.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoarm: octeontx: enable WDT_SBSA
Tim Harvey [Fri, 26 Mar 2021 00:07:34 +0000 (17:07 -0700)]
arm: octeontx: enable WDT_SBSA

The OcteonTX uses ARM's SBSA Watchdog device

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: octeontx: support generic distro config
Tim Harvey [Fri, 26 Mar 2021 00:07:33 +0000 (17:07 -0700)]
arm: octeontx: support generic distro config

Support Generic Distro Default config

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs
Tim Harvey [Fri, 26 Mar 2021 00:07:32 +0000 (17:07 -0700)]
arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs

Move CONFIG_SUPPORT_RAW_INITRD out of the octeontx_common header
and into the defconfig files.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agolz4: Fix unaligned accesses
Karl Beldan [Wed, 17 Mar 2021 22:31:58 +0000 (22:31 +0000)]
lz4: Fix unaligned accesses

Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>
3 years agoFix IDE commands issued, fix endian issues, fix non MMIO
Reinoud Zandijk [Wed, 24 Feb 2021 16:44:42 +0000 (17:44 +0100)]
Fix IDE commands issued, fix endian issues, fix non MMIO

Fixes IDE issues found on the Malta board under Qemu:

1) DMA implied commands were sent to the controller in stead of the PIO
variants. The rest of the code is DMA free and written for PIO operation.

2) direct pointer access was used to read and write the registers instead
of the inb/inw/outb/outw functions/macros. Registers don't have to be
memory mapped and ATA_CURR_BASE() does not have to return an offset from
address zero.

3) Endian isues in ide_ident() and reading/writing data in general. Names
were corrupted and sizes misreported.

Tested malta_defconfig and maltael_defconfig to work again in Qemu.

Signed-off-by: Reinoud Zandijk <reinoud@NetBSD.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agosandbox: enable IRQ using select for sandbox architecture
Wasim Khan [Mon, 8 Mar 2021 15:48:16 +0000 (16:48 +0100)]
sandbox: enable IRQ using select for sandbox architecture

Enable IRQ using select for sandbox architecture.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarch: Kconfig: enable IRQ using select for x86 architecture
Wasim Khan [Mon, 8 Mar 2021 15:48:15 +0000 (16:48 +0100)]
arch: Kconfig: enable IRQ using select for x86 architecture

use 'select' to enable IRQ as it does not have architecture
specific dependency.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarch: arm: update Kconfig to select IRQ when GIC_V3_ITS is enabled
Wasim Khan [Mon, 8 Mar 2021 15:48:14 +0000 (16:48 +0100)]
arch: arm: update Kconfig to select IRQ when GIC_V3_ITS is enabled

GIC_V3_ITS uses UCLASS_IRQ driver. Update Kconfig to select
IRQ when GIC_V3_ITS is enabled.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
3 years agomisc: make CONFIG_IRQ selectable for all platforms
Wasim Khan [Mon, 8 Mar 2021 15:48:13 +0000 (16:48 +0100)]
misc: make CONFIG_IRQ selectable for all platforms

UCLASS_IRQ driver is not Intel specific. Make CONFIG_IRQ
selectable for all platforms.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarm64: gic-v3-its: Clear the Pending table before enabling LPIs
Hou Zhiqiang [Fri, 5 Mar 2021 07:02:35 +0000 (15:02 +0800)]
arm64: gic-v3-its: Clear the Pending table before enabling LPIs

The GICv3 RM requires "The first 1KB of memory for the LPI Pending tables
must contain only zeros on initial allocation, and this must be visible
to the Redistributors, or else the effect is UNPREDICTABLE".

And as the following statement, we here clear the whole Pending tables
instead of the first 1KB.
"An LPI Pending table that contains only zeros, including in the first 1KB,
indicates that there are no pending LPIs.
The first 1KB of the LPI Pending table is IMPLEMENTATION DEFINED. However,
if the first 1KB of the LPI Pending table and the rest of the table contain
only zeros, this must indicate that there are no pending LPIs."

And there isn't any pending LPI under U-Boot, so it's unnecessary to
load the contents of the Pending table during the enablement, then set
the GICR_PENDBASER.PTZ flag.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # NXP LS1028A
Reviewed-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboards: amlogic: update documentation for PCIe support
Neil Armstrong [Fri, 16 Apr 2021 12:22:31 +0000 (14:22 +0200)]
boards: amlogic: update documentation for PCIe support

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64: add NVME boot target
Neil Armstrong [Fri, 26 Feb 2021 14:17:36 +0000 (15:17 +0100)]
configs: meson64: add NVME boot target

Let's add a boot target for NVMe so we can do a full boot over NVMe.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: khadas-vim3: enable PCIe and NVMe
Neil Armstrong [Fri, 26 Feb 2021 13:47:06 +0000 (14:47 +0100)]
configs: khadas-vim3: enable PCIe and NVMe

Now we have PCIe, let's also enable NVMe to access an eventual NVMe SSDs
connected on the M.2 slot.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>