platform/kernel/u-boot.git
3 years agoMerge tag 'u-boot-amlogic-20210703' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 2 Jul 2021 22:56:46 +0000 (18:56 -0400)]
Merge tag 'u-boot-amlogic-20210703' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- configs: libretech: set SPI mode to 0 to fix SPI NOR Flash probe

3 years agoconfigs: libretech: set SPI mode to 0
Da Xue [Fri, 2 Jul 2021 21:11:40 +0000 (17:11 -0400)]
configs: libretech: set SPI mode to 0

Kconfig defaults to mode 3 if CONFIG_SF_DEFAULT_MODE is not set.
It becomes an issue since meson_spifc does not support SPI_CPHA.
Needed after commit e2e95e5e25 ("spi: Update speed/mode on change").

Fixes: e2e95e5e25 ("spi: Update speed/mode on change")
Signed-off-by:Da Xue <da@libre.computer>
[narmstrong: reformated commit reference & added Fixes tag]
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoMerge tag 'efi-2021-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 2 Jul 2021 19:04:07 +0000 (15:04 -0400)]
Merge tag 'efi-2021-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc6

Bug fixes:

* improve specification compliance of UEFI capsule updates
* allow capsule update on-disk without checking OsIndications
* provide parameter checks for QueryVariableInfo()

3 years agoautoboot: fix MENUKEY
Da Xue [Fri, 2 Jul 2021 16:32:43 +0000 (12:32 -0400)]
autoboot: fix MENUKEY

replace CONFIG_AUTOBOOT_USE_MENUKEY with CONFIG_AUTOBOOT_MENUKEY

Signed-off-by: Da Xue <da@libre.computer>
3 years agoefi_loader: Allow capsule update on-disk without checking OsIndications
Ilias Apalodimas [Tue, 29 Jun 2021 04:55:51 +0000 (07:55 +0300)]
efi_loader: Allow capsule update on-disk without checking OsIndications

Although U-Boot supports capsule update on-disk, it's lack of support for
SetVariable at runtime prevents applications like fwupd from using it.

In order to perform the capsule update on-disk the spec says that the OS
must copy the capsule to the \EFI\UpdateCapsule directory and set a bit in
the OsIndications variable.  The firmware then checks for the
EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit in OsIndications
variable, which is set by the submitter to trigger processing of the
capsule on the next reboot.

Let's add a config option which ignores the bit and just relies on the
capsule being present. Since U-Boot deletes the capsule while processing
it, we won't end up applying it multiple times.

Note that this is allowed for all capsules. In the future, once
authenticated capsules are fully supported, we can limit the functionality
to those only.

Signed-off-by: apalos <ilias.apalodimas@linaro.org>
Reword Kconfig description.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: clear OsIndications
Heinrich Schuchardt [Tue, 29 Jun 2021 11:33:09 +0000 (13:33 +0200)]
efi_loader: clear OsIndications

After each reboot we must clear flag
EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED in variable
OsIndications.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Improve the parameter check for QueryVariableInfo()
Masami Hiramatsu [Wed, 30 Jun 2021 15:49:48 +0000 (00:49 +0900)]
efi_loader: Improve the parameter check for QueryVariableInfo()

Improve efi_query_variable_info() to check the parameter settings and
return correct error code according to the UEFI Specification 2.9,
and the Self Certification Test (SCT) II Case Specification, June
2017, chapter 4.1.4 QueryVariableInfo().

Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: missing parentheses in query_console_size
Heinrich Schuchardt [Tue, 29 Jun 2021 08:09:14 +0000 (10:09 +0200)]
efi_loader: missing parentheses in query_console_size

After if we should use parentheses to keep the code readable.

Fixes: a95f4c885991 ("efi_loader: NULL dereference in EFI console")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Always install FMPs
Ilias Apalodimas [Tue, 22 Jun 2021 14:38:53 +0000 (17:38 +0300)]
efi_loader: Always install FMPs

We only install FMPs if a CapsuleUpdate is requested.  Since we now have an
ESRT table which relies on FMPs to build the required information, it
makes more sense to unconditionally install them. This will allow userspace
applications (e.g fwupd) to make use of the ERST and provide us with files
we can use to run CapsuleUpdate on-disk

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Force a single FMP instance per hardware store
Ilias Apalodimas [Tue, 22 Jun 2021 14:38:52 +0000 (17:38 +0300)]
efi_loader: Force a single FMP instance per hardware store

Chapter 23 of the EFI spec (rev 2.9) says:
"A specific updatable hardware firmware store must be represented by
exactly one FMP instance".
This is not the case for us, since both of our FMP protocols can be
installed at the same time because they are controlled by a single
'dfu_alt_info' env variable.
So make the config options depend on each other and allow the user to
install one of them at any given time.  If we fix the meta-data provided
by the 'dfu_alt_info' in the future,  to hint about the capsule type
(fit or raw) we can revise this and enable both FMPs to be installed, as
long as they target different firmware hardware stores

Note that we are not using a Kconfig 'choice' on purpose, since we
want to allow both of those to be installed and tested in sandbox

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi: Fix to use null handle to create new handle for efi_fmp_raw
Masami Hiramatsu [Tue, 22 Jun 2021 14:38:51 +0000 (17:38 +0300)]
efi: Fix to use null handle to create new handle for efi_fmp_raw

When running the efidebug capsule disk-update command, the efi_fmp_raw
protocol installation fails with 2 (EFI_INVALID_PARAMETER) as below.
This is because the code passes efi_root instead of the handle local var.

=> efidebug capsule disk-update
EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL)
  EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988)
    EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
      EFI: Entry efi_install_protocol_interface(00000000fbaf598886c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8)
        EFI: new handle 00000000fbb37520
      EFI: Exit: efi_install_protocol_interface: 0
    EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
  EFI: Exit: efi_install_multiple_protocol_interfaces: 0
EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL)
EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)
  EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648)
    EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
      EFI: Entry efi_install_protocol_interface(00000000fbfec64886c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18)
        EFI: handle 00000000fbaf8520
      EFI: Exit: efi_install_protocol_interface: 2
    EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface)
  EFI: Exit: efi_install_multiple_protocol_interfaces: 2
EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)
Command failed, result=1

To fix this issue, pass the handle local var which is set NULL right
before installing efi_fmp_raw as same as the installing efi_fmp_fit.
(In both cases, the local reference to the handle will be just discarded)

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoRevert "TEST: USB_HOST not USB"
Tom Rini [Wed, 30 Jun 2021 17:09:49 +0000 (13:09 -0400)]
Revert "TEST: USB_HOST not USB"

This reverts commit 4e1903a645453deab5ec5dd1cf4f0061469b99c3.

This local commit was not intended to be pushed out.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoTEST: USB_HOST not USB
Tom Rini [Wed, 30 Jun 2021 15:38:52 +0000 (11:38 -0400)]
TEST: USB_HOST not USB

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agospi: Update speed/mode on change
Marek Vasut [Thu, 10 Jun 2021 12:00:00 +0000 (14:00 +0200)]
spi: Update speed/mode on change

The spi_get_bus_and_cs() may be called on the same bus and chipselect
with different frequency or mode. This is valid usecase, but the code
fails to notify the controller of such a configuration change. Call
spi_set_speed_mode() in case bus frequency or bus mode changed to let
the controller update the configuration.

The problem can easily be triggered using the sspi command:
=> sspi 0:0@1000
=> sspi 0:0@2000
Without this patch, both transfers happen at 1000 Hz. With this patch,
the later transfer happens correctly at 2000 Hz.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoMerge tag 'efi-2021-07-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 29 Jun 2021 15:25:39 +0000 (11:25 -0400)]
Merge tag 'efi-2021-07-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc5-2

Documentation:

* man-page for askenv

bug fixes

* correct display of BootOrder in efidebug command
* do not allow TPL_HIGH_LEVEL for CreateEvent(Ex)
* correct handling of unknown properties in SMBIOS tables

3 years agoPrepare v2021.07-rc5
Tom Rini [Mon, 28 Jun 2021 19:38:55 +0000 (15:38 -0400)]
Prepare v2021.07-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoarm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y
Kunihiko Hayashi [Tue, 15 Jun 2021 06:33:02 +0000 (15:33 +0900)]
arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y

If both POSITION_INDEPENDENT and SYS_RELOC_GD_ENV_ADDR are enabled,
wherever original env is placed anywhere, it should be relocated to
the right address.

Relocation offset gd->reloc_off is calculated with SYS_TEXT_BASE in
setup_reloc() and env address gd->env_addr is relocated by the offset in
initr_reloc_global_data().

gd->env_addr
  = (orig env) + gd->reloc_off
  = (orig env) + (gd->relocaddr - SYS_TEXT_BASE)

However, SYS_TEXT_BASE isn't always runtime base address when
POSITION_INDEPENDENT is enabled. So the relocated env_addr might point to
wrong address. For example, if SYS_TEXT_BASE is zero, gd->env_addr is
out of memory location and memory exception will occur.

There is a difference between linked address such as SYS_TEXT_BASE and
runtime base address. In _main, the difference is calculated as
"run-vs-link" offset. The env_addr should also be added to the offset
to fix the address.

gd->env_addr
  = (orig env) + ("run-vs-link" offset)   + gd->reloc_off
  = (orig env) + (SYS_TEXT_BASE - _start) + (gd->relocaddr - SYS_TEXT_BASE)
  = (orig env) + (gd->relocaddr - _start)

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
3 years agosmbios: Fix SMBIOS tables
Ilias Apalodimas [Thu, 10 Jun 2021 09:33:15 +0000 (12:33 +0300)]
smbios: Fix SMBIOS tables

Commit e4f8e543f1a9("smbios: Drop the unused Kconfig options")
break SMBIOS tables.  The reason is that the patch drops the Kconfig
options *after* removing the code using them,  but that changes the semantics
of the code completely.  Prior to the change a non NULL value was used in
the 'product' and 'manufacturer ' fields.

Chapter 6.2 of the DMTF spec requires Manufacturer and Product Name to be
non-null on some of the tables. So let's add sane defaults for Type1/2/3.

* Before the patchset:

<snip>
Handle 0x0002, DMI type 2, 14 bytes
Base Board Information
        Manufacturer: Not Specified
        Product Name: Not Specified
        Version: Not Specified
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Features:
                Board is a hosting board
        Location In Chassis: Not Specified
        Chassis Handle: 0x0000
        Type: Motherboard

Invalid entry length (0). DMI table is broken! Stop.

* After the patchset:

<snip>
Handle 0x0005, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected

Handle 0x0006, DMI type 127, 4 bytes
End Of Table

Fixes: e4f8e543f1a9 ("smbios: Drop the unused Kconfig options")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agosmbios: Fix BIOS Characteristics Extension Byte 2
Ilias Apalodimas [Wed, 9 Jun 2021 15:14:47 +0000 (18:14 +0300)]
smbios: Fix BIOS Characteristics Extension Byte 2

We currently define the EFI support of an SMBIOS table as the third bit of
"BIOS Characteristics Extension Byte 1". The latest DMTF spec defines it
on "BIOS Characteristics Extension Byte 2".

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Remove superfluous assignment.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc/usage: cmd-usage help file for askenv
Adarsh Babu Kalepalli [Fri, 11 Jun 2021 14:15:11 +0000 (19:45 +0530)]
doc/usage: cmd-usage help file for askenv

help file for using askenv cmd is created.
It provides description on the command purpose,
description of arguments,
couple of examples (illustrating command usage),
configuration parameter and
possible return values.

Signed-off-by: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
Add missing entry in doc/usage/index.rst.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agosmbios: convert function descriptions to Sphinx style
Heinrich Schuchardt [Thu, 10 Jun 2021 10:13:52 +0000 (12:13 +0200)]
smbios: convert function descriptions to Sphinx style

Use 'Return:' instead of '@return:'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefidebug: correct display of BootOrder
Heinrich Schuchardt [Fri, 11 Jun 2021 22:01:44 +0000 (00:01 +0200)]
efidebug: correct display of BootOrder

Display the number of the boot option and not its index.

Fixes: 2ecee31017bf ("efi_loader: use efi_create_indexed_name()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: TPL_HIGH_LEVEL not allowed for CreateEvent
Heinrich Schuchardt [Thu, 10 Jun 2021 21:10:52 +0000 (23:10 +0200)]
efi_loader: TPL_HIGH_LEVEL not allowed for CreateEvent

According to chapter 7.1 "Event, Timer, and Task Priority Services"
TPL_HIGH_LEVEL should not be exposed to applications and drivers.

According to the discussion with EDK II contributors this implies that
CreateEvent() shall not allow to create events with TPL_HIGH_LEVEL.

Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 28 Jun 2021 14:17:29 +0000 (10:17 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'u-boot-imx-20210625' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 25 Jun 2021 17:33:47 +0000 (13:33 -0400)]
Merge tag 'u-boot-imx-20210625' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2021.07
-----------------

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

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Fri, 25 Jun 2021 01:18:22 +0000 (21:18 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sh

- Beacon board fix, for this release.

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 25 Jun 2021 01:17:49 +0000 (21:17 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- A few easy MX7 EHCI USB fixes, for this release.

3 years agousb: ehci-mx6: Do not fail when 'reg' is not found
Fabio Estevam [Sun, 20 Jun 2021 15:00:52 +0000 (12:00 -0300)]
usb: ehci-mx6: Do not fail when 'reg' is not found

Unlike imx6, on imx7 the USB PHY is described as:

usbphynop1: usbphynop1 {
compatible = "usb-nop-xceiv";
clocks = <&clks IMX7D_USB_PHY1_CLK>;
clock-names = "main_clk";
#phy-cells = <0>;
};

which does not have the 'reg' property.

Do not return an error when the 'reg' property is not found
for the USB PHY.

This fixes USB gadget regression on a imx7s-warp board.

Successfully tested the "ums 0 mmc 0" command on two boards:
imx7s-warp and imx6dl-pico-pi.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 years agousb: ehci-mx6: Move fdtdec_get_alias_seq() inside the CONFIG_MX6
Fabio Estevam [Sun, 20 Jun 2021 15:00:51 +0000 (12:00 -0300)]
usb: ehci-mx6: Move fdtdec_get_alias_seq() inside the CONFIG_MX6

On a imx7s-warp board the fdtdec_get_alias_seq() function
always fails.

As priv->portnr is only used on i.MX6, move fdtdec_get_alias_seq()
inside the CONFIG_MX6 block.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 years agoARM: rmobile: beacon: Set CONFIG_RZ_G2 on Beacon boards
Adam Ford [Thu, 24 Jun 2021 17:52:11 +0000 (12:52 -0500)]
ARM: rmobile: beacon: Set CONFIG_RZ_G2 on Beacon boards

The board detection is incorrectly stating it's an rcar3 variant
instead of an RZ/G2 variant on all the r8a774*1_beacon boards.
Set the flag to correctly display as RZ/G2[M/N/H]

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Wed, 23 Jun 2021 12:46:26 +0000 (08:46 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- x86: Discard .note.gnu.property sections
- nvme: Skip block device creation for inactive namespaces
- nvme: Convert NVMe doc to reST, and various minor fixes

3 years agoMerge tag 'mmc-2021-6-22' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Wed, 23 Jun 2021 12:45:29 +0000 (08:45 -0400)]
Merge tag 'mmc-2021-6-22' of https://source.denx.de/u-boot/custodians/u-boot-mmc

- Revert fsl_esdhc_imx using VENDORSPEC_FRC_SDCLK_ON
- Fix data read for dw_mmc
- Increase minimum bus freq for mtk-sd
- Minor cleanup

3 years agoMerge branch '2021-06-22-assorted-fixes'
Tom Rini [Wed, 23 Jun 2021 12:45:09 +0000 (08:45 -0400)]
Merge branch '2021-06-22-assorted-fixes'

- Assorted minor bugfixes

3 years agotest: Include /sbin to the PATH when creating file system
Andy Shevchenko [Thu, 10 Jun 2021 15:08:42 +0000 (18:08 +0300)]
test: Include /sbin to the PATH when creating file system

On some distributions the mkfs is under /sbin and /sbin is not set
for mere users. Include /sbin to the PATH when creating file system,
so that users won't get a scary traceback from Python.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 years agoMAINTAINER, git-mailrc: Update the mmc maintainer
Jaehoon Chung [Mon, 14 Jun 2021 22:16:36 +0000 (07:16 +0900)]
MAINTAINER, git-mailrc: Update the mmc maintainer

Update to me as co-maintainer with Peng.
Additionally, update the mmc alias in git-mailrc.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agoglobal_data: Ensure we have <config.h> when symbols are not in Kconfig yet
Tom Rini [Thu, 3 Jun 2021 13:39:02 +0000 (09:39 -0400)]
global_data: Ensure we have <config.h> when symbols are not in Kconfig yet

All symbols that are defined in Kconfig will always be defined (or not)
prior to preprocessing due to the -include directive while building.
However, symbols which are not yet migrated will only be defined (or
not) once the board config.h is included, via <config.h>.  While the end
goal must be to migrate all symbols, today we have cases where the size
of gd will get mismatched within the build, based on include order.
Mitigate this by making sure that any <asm/global_data.h> that uses
symbols not in Kconfig does start with <config.h>.  Remove this when not
needed.

Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Huan Wang <alison.wang@nxp.com>
Cc: Angelo Dureghello <angelo@sysam.it>
Cc: Rick Chen <rick@andestech.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agosocfpga64: Do not define CONFIG_SYS_MEM_RESERVE_SECURE to 0
Tom Rini [Thu, 3 Jun 2021 13:39:01 +0000 (09:39 -0400)]
socfpga64: Do not define CONFIG_SYS_MEM_RESERVE_SECURE to 0

Based on the comment in socfpga_soc64_common.h, the intention is for
CONFIG_SYS_MEM_RESERVE_SECURE to be unused.  However, in the code we do:
...

and that will evaluate to true.  This leads to unwanted code being
compiled.  Further, as CONFIG_SYS_MEM_RESERVE_SECURE has not been
migrated to Kconfig, this leads to a mismatch in the size of gd
depending on if we have or have not also had <configs/BOARD.h> also
included yet.

Remove the define as it's not needed.

Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Chee Hong Ang <chee.hong.ang@intel.com>
Cc: Dalon Westergreen <dalon.westergreen@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoRevert "powerpc: fix regression in arch_initr_trap()"
Tom Rini [Thu, 3 Jun 2021 13:39:00 +0000 (09:39 -0400)]
Revert "powerpc: fix regression in arch_initr_trap()"

With the changes in commit 588efcdd72fc ("powerpc: Don't use relative
include for config.h in global_data.h") fixing the root of the problem,
we no longer need this re-inclusion.

This reverts commit f6c0d365d3e8ee8e4fd3ebe2ed957c2bca9d3328.

Cc: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agopowerpc: Don't use relative include for config.h in global_data.h
Tom Rini [Thu, 3 Jun 2021 13:38:59 +0000 (09:38 -0400)]
powerpc: Don't use relative include for config.h in global_data.h

As there is an arch/powerpc/include/asm/config.h file using "" to get
config.h here can lead to using that rather than include/config.h.  This
in turn can lead to a mismatch in the size of gd.

Cc: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Matt Merhar <mattmerhar@protonmail.com>
3 years agomalloc: add SPDX license identifiers
Heinrich Schuchardt [Sat, 29 May 2021 11:18:00 +0000 (13:18 +0200)]
malloc: add SPDX license identifiers

The original code is in the public domain. Licenses/README states that the
general license for U-Boot is GPL 2.0+. So we can mark the malloc code as
GPL 2.0+ too.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMAINTAINERS: Add an entry for NVMe
Bin Meng [Tue, 22 Jun 2021 13:16:23 +0000 (21:16 +0800)]
MAINTAINERS: Add an entry for NVMe

This was missed when NVMe support was initially brought to U-Boot
back in 2017. Add an entry for it and list myself as the maintainer.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agodoc: develop: Convert README.nvme to reST
Bin Meng [Tue, 22 Jun 2021 13:16:22 +0000 (21:16 +0800)]
doc: develop: Convert README.nvme to reST

This converts the existing README.nvme to reST, and puts it under
the develop/driver-model/ directory.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Don't clear nvme blk device's priv space
Bin Meng [Tue, 22 Jun 2021 13:16:21 +0000 (21:16 +0800)]
nvme: Don't clear nvme blk device's priv space

A udevice's priv space is cleared in alloc_priv() in the DM core.
Don't do it again in its probe() routine.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Drop useless members of 'struct nvme_ns'
Bin Meng [Tue, 22 Jun 2021 13:16:20 +0000 (21:16 +0800)]
nvme: Drop useless members of 'struct nvme_ns'

mode_select_num_blocks and mode_select_block_len in 'struct nvme_ns'
are not useful. Drop them.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Eliminate the offset of one during block dev creation
Bin Meng [Tue, 22 Jun 2021 13:16:19 +0000 (21:16 +0800)]
nvme: Eliminate the offset of one during block dev creation

At present there is an offset of one added during the creation of
block device. This can be very confusing as we wanted to encode the
namespace id in the block device name but namespae id cannot be zero.

This changes to use the namespace id directly in the block device
name, eliminating the offset of one effectively.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Skip block device creation for inactive namespaces
Bin Meng [Tue, 22 Jun 2021 13:16:18 +0000 (21:16 +0800)]
nvme: Skip block device creation for inactive namespaces

At present for each namespace there is a block device created for it.
There is no issue if the number of supported namespaces reported from
the NVMe device is only 1.

Since QEMU commit 7f0f1acedf15 ("hw/block/nvme: support multiple namespaces"),
the number of supported namespaces reported has been changed from 1
to 256, but not all of them are active namespaces. The actual active
one depends on the QEMU command line parameters. A common case is
that namespace 1 being active and all other 255 being inactive.

If a namespace is inactive, the namespace identify command returns a
zero filled data structure. We can use field NSZE (namespace size) to
decide whether a block device should be created for it.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Move block dev creation from uclass post_probe() to driver probe()
Bin Meng [Tue, 22 Jun 2021 13:16:17 +0000 (21:16 +0800)]
nvme: Move block dev creation from uclass post_probe() to driver probe()

At present the block device creation happens in the NVMe uclass
driver post_probe() phase. In preparation to support multiple
namespaces, we should issue namespace identify before creating
block devices but that touches the underlying hardware hence it
is not appropriate to do such in the uclass driver post_probe().
Let's move it to driver probe() phase instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Remove the redundant aqa value setting
Wesley Sheng [Tue, 22 Jun 2021 03:34:43 +0000 (11:34 +0800)]
nvme: Remove the redundant aqa value setting

AQA (Admin Queue Attributes) register is a dword size with
lower word of ASQS, and higher word of ACQS.

The code set the variable aqa twice, but it is redundant.

Signed-off-by: Wesley Sheng <wesleyshenggit@sina.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: Correct the prps per page calculation method
Wesley Sheng [Tue, 22 Jun 2021 03:34:21 +0000 (11:34 +0800)]
nvme: Correct the prps per page calculation method

Each prp is 8 bytes, calculate the number of prps
per page should just divide page size by 8
there is no need to minus 1

Signed-off-by: Wesley Sheng <wesleyshenggit@sina.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agonvme: fix for big endian systems
David Lamparter [Thu, 6 May 2021 18:24:30 +0000 (20:24 +0200)]
nvme: fix for big endian systems

writel() and co. already include the endian swap;  doing the swap twice
is, er, unhelpful.

Tested on a P4080DS, which boots perfectly fine off NVMe with this.

Signed-off-by: David Lamparter <equinox@diac24.net>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agox86: Discard .note.gnu.property sections
Bin Meng [Fri, 18 Jun 2021 07:09:30 +0000 (15:09 +0800)]
x86: Discard .note.gnu.property sections

When switching to kernel.org x86_64 gcc 11.1.0 toolchain, u-boot.rom
built from qemu-x86_defconfig no longer boots anymore. Investigation
shows that U-Boot fails at a very early stage during the boot process,
in fdtdec_prepare_fdt() where fdt_check_header() complains that there
is not a valid device tree found at gd->fdt_blob which points to _end.
Now _end points to an allocated section .note.gnu.property which of
course is wrong.

This issue is however not seen when using the default Ubuntu 20.04 gnu
toolchain (gcc 9.3.0 with binutils 2.34). Further investigation shows
that it is caused by a behavior change of binutils v2.36 which is part
of the kernel.org gcc 11.1.0 toolchain, via the following commit:

  939b95c77bf2 ("Linux/x86: Configure gas with --enable-x86-used-note by default")

In fact, there was already a regression bug report [1] for binutils two
months ago, but the binutils folks did not think it is a bug :(

To resolve this, there are several options:

* pass -Wa,-mx86-used-note=no to gas
* pass -R .note.gnu.property to objcopy
* discard the section in the linker script

Linux kernel uses the discard way [2], so let's do the same for U-Boot.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=27753
[2] commit 4caffe6a28d3 ("x86/vdso: Discard .note.gnu.property sections in vDSO")

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoMakefile: Adjust indention of GENENV quiet output
Jan Kiszka [Sun, 20 Jun 2021 20:29:13 +0000 (22:29 +0200)]
Makefile: Adjust indention of GENENV quiet output

The column width for a command name is 8.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
3 years agoautoboot: fix typos of CONFIG_AUTOBOOT_USE_MENUKEY
Da Xue [Tue, 22 Jun 2021 02:39:19 +0000 (22:39 -0400)]
autoboot: fix typos of CONFIG_AUTOBOOT_USE_MENUKEY

Replace typo CONFIG_USE_AUTOBOOT_MENUKEY with
CONFIG_AUTOBOOT_USE_MENUKEY as when they were introduced initially there
was some mismatch in which name was used where.

Fixes: 8fc31e23aa83 ("autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY")
Signed-off-by: Da Xue <da@libre.computer>
3 years agodisk/part_dos.c: Fix a variable typo in write_mbr_partitions()
Christian Melki [Mon, 7 Jun 2021 09:21:15 +0000 (11:21 +0200)]
disk/part_dos.c: Fix a variable typo in write_mbr_partitions()

This function is passed *dev not *dev_desc, so pass the right name to
part_init().

Fixes: f14c5ee5ab8b ("disk: part_dos: update partition table entries after write")
Signed-off-by: Christian Melki <christian.melki@t2data.com>
3 years agoazure: Use msys2 20210604 installer for Windows build
Bin Meng [Mon, 21 Jun 2021 23:33:21 +0000 (07:33 +0800)]
azure: Use msys2 20210604 installer for Windows build

MSYS2 Windows build started to fail since yesterday (Jun 21):

  checking keyring...
  checking package integrity...
  error: gcc-libs: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
  :: File /var/cache/pacman/pkg/gcc-libs-10.2.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
  error: gcc: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
  :: File /var/cache/pacman/pkg/gcc-10.2.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
  error: failed to commit transaction (invalid or corrupted package)
  Errors occurred, no packages were upgraded.

Switching to the latest installer (version 20210604) seems to fix it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Tom Rini <trini@konsulko.com>
3 years agoRevert "mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output"
Fabio Estevam [Mon, 7 Jun 2021 20:40:09 +0000 (17:40 -0300)]
Revert "mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output"

This reverts commit 63756575b42b8b4fb3f59cbbf0cedf03331bc2d2.

Since this commit a imx6qdl-pico board boots extremely slowly
in both SPL as well as U-Boot proper.

Fix this regression by reverting the offending commit for now.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Pierre-Jean Texier <texier.pj2@gmail.com>
3 years agommc: mmc-uclass: change to static about dm function
Jaehoon Chung [Sun, 30 May 2021 23:31:50 +0000 (08:31 +0900)]
mmc: mmc-uclass: change to static about dm function

Change to static about dm function.
They can be used with wrapper functions.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fsl_esdhc_imx: use mmc_send_cmd instead of dm_mmc_send_cmd
Jaehoon Chung [Sun, 30 May 2021 23:31:49 +0000 (08:31 +0900)]
mmc: fsl_esdhc_imx: use mmc_send_cmd instead of dm_mmc_send_cmd

Use mmc_send_cmd instead of dm_mmc_send_cmd.
It doesn't need to distinguish this function.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: Update environment variable with active partition
Reuben Dowle [Thu, 13 May 2021 22:15:43 +0000 (10:15 +1200)]
mmc: Update environment variable with active partition

This patch allows uboot scripts make choices about where to boot from based
on the active mmc boot partition. This allows having two copies of kernel,
filesystems etc, and choosing which to boot from based off of the active
bootloader partition.

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: dwmmc: socfpga: Get "fifo-mode" property from DT
Ley Foon Tan [Mon, 26 Apr 2021 05:17:46 +0000 (13:17 +0800)]
mmc: dwmmc: socfpga: Get "fifo-mode" property from DT

Add FIFO mode support for SoCFPGA dwmmc, read "fifo-mode" property from DT.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: dw_mmc: Fixes data read when receiving DTO interrupt in FIFO mode
Ley Foon Tan [Mon, 26 Apr 2021 03:35:05 +0000 (11:35 +0800)]
mmc: dw_mmc: Fixes data read when receiving DTO interrupt in FIFO mode

The data read is not working when using FIFO mode.

From DesignWare databook, when a Data_Transfer_Over (DTO) interrupt is
received, the software should read the remaining data from FIFO.

Add DTO interrupt checking on data read path and clear interrupts before
start reading from FIFO. So, it doesn't clear the next pending
interrupts unintentionally after read from FIFO.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: mtk-sd: increase the minimum bus frequency
Weijie Gao [Tue, 20 Apr 2021 08:37:10 +0000 (16:37 +0800)]
mmc: mtk-sd: increase the minimum bus frequency

With a 48MHz input clock, the lowest bus frequency can be as low as
48000000 / (4 * 4095) = 2930Hz. Such an extremely low frequency will cause
the mmc framework take seconds to finish the initialization.

Limiting the minimum bus frequency to a slightly higher value can solve the
issue without any side effects.

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agoimx8mm: configs: enable distro default features
Andrey Zhizhikin [Sat, 1 May 2021 20:23:04 +0000 (22:23 +0200)]
imx8mm: configs: enable distro default features

imx8mm ekv has been switched to use distro boot commands, but had no
correct options enabled to support sysboot.
According to the README.distro, sysboot is consindered to be a
recommended way of using distro boot commands, it required default distro
features to be enabled instead of only those that are relevant to the boot
script.

Replace the boot script specific options in the config to a default distro
option.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Fixes: 2df8930bf9 ("imx8mm: configs: add support for distro boot commands")
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoimx8mp: configs: enable distro default features
Andrey Zhizhikin [Sat, 1 May 2021 20:23:05 +0000 (22:23 +0200)]
imx8mp: configs: enable distro default features

imx8mp ekv has been switched to use distro boot commands, but had no
correct options enabled to support sysboot.
According to the README.distro, sysboot is consindered to be a
recommended way of using distro boot commands, it required default distro
features to be enabled instead of only those that are relevant to the boot
script.

Replace the boot script specific options in the config to a default distro
option.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Cc: Peng Fan <peng.fan@nxp.com>
Fixes: 9b162b1d1f ("imx8mp: configs: add support for distro boot commands")
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoo4-imx-nano: Fix dtc warnings
Fabio Estevam [Thu, 17 Jun 2021 15:57:29 +0000 (12:57 -0300)]
o4-imx-nano: Fix dtc warnings

Remove the LED unit addresses and reg properties to
fix the following dtc build warnings:

arch/arm/dts/o4-imx-nano.dtb: Warning (reg_format): /leds/led@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
...
arch/arm/dts/o4-imx-nano.dtb: Warning (avoid_default_addr_size): /leds/led@0: Relying on default #address-cells value

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Oleh Kravchenko <oleg@kaa.org.ua>
3 years agoMerge branch 'network_master' of https://source.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Fri, 18 Jun 2021 15:18:56 +0000 (11:18 -0400)]
Merge branch 'network_master' of https://source.denx.de/u-boot/custodians/u-boot-net

3 years agonet: octeontx: smi: use dt live tree API
Tim Harvey [Thu, 17 Jun 2021 23:08:54 +0000 (16:08 -0700)]
net: octeontx: smi: use dt live tree API

clean up octeontx_smi_probe by using the live-tree API.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agocmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
Dimitri John Ledkov [Wed, 21 Apr 2021 11:42:01 +0000 (12:42 +0100)]
cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.

If the environment does not have "soc" or "board" set, and fdtdir
option is specified in extlinux.conf, the bootloader will crash whilst
dereferencing a null pointer. Add a guard against null soc or
board. Fixes a crash of qemu-riscv64_smode configuration, which does
not have CONFIG_SYS_SOC defined.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: use the same alias stem for ethernet as linux
Michael Walle [Thu, 25 Feb 2021 15:51:11 +0000 (16:51 +0100)]
net: use the same alias stem for ethernet as linux

Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from
the linux tree:

$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l
0
$ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l
633

In u-boot device trees both prefixes are used. Until recently the only
user of the ethernet alias was the sandbox test device tree. This
changed with commit fc054d563bfb ("net: Introduce DSA class for Ethernet
switches"). There, the MAC addresses are inherited based on the devices
sequence IDs which is in turn given by the device tree.

Before there are more users in u-boot and both worlds will differ even
more, rename the alias prefix to "ethernet" to match the linux ones.
Also adapt the test cases and rename any old aliases in the u-boot
device trees.

Cc: David Wu <david.wu@rock-chips.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agonet: use a more deterministic approach to get the active ethernet device
Michael Walle [Wed, 24 Feb 2021 16:30:44 +0000 (17:30 +0100)]
net: use a more deterministic approach to get the active ethernet device

If the environment variable "ethact" is not set, the first device in the
uclass is returned. This depends on the probing order of the ethernet
devices. Moreover it is not not configurable at all.

Try to return the ethernet device with sequence id 0 first which then
can be configured by the aliases in a device tree. Fall back to the old
mechanism in case of an error.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: sun8i-emac: fix MDIO frequency
Heinrich Schuchardt [Thu, 3 Jun 2021 07:52:41 +0000 (07:52 +0000)]
net: sun8i-emac: fix MDIO frequency

Commit 4f0278dac56a ("net: sun8i-emac: Lower MDIO frequency") leads to
network failure on the OrangePi PC.

    => dhcp
    sun8i_emac_eth_start: Timeout

According to the commit message the change of the MDIO frequency is only
required for external PHYs.

Fixes: 4f0278dac56a ("net: sun8i-emac: Lower MDIO frequency")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agonet: synquacer: Add netsec driver
Jassi Brar [Fri, 4 Jun 2021 09:44:38 +0000 (18:44 +0900)]
net: synquacer: Add netsec driver

Add SynQuacer's NETSEC GbE controller driver.
Since this driver will load the firmware from SPI NOR flash,
this depends on CONFIG_SYNQUACER_SPI=y.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dwc_eth_qos: Revert some changes of commit 3a97da12ee7b
Daniil Stas [Sun, 30 May 2021 13:34:09 +0000 (13:34 +0000)]
net: dwc_eth_qos: Revert some changes of commit 3a97da12ee7b

Revert some changes of commit 3a97da12ee7b ("net: dwc_eth_qos: add dwc
eqos for imx support") that were probably added by mistake.

One of these changes can lead to received data corruption (enabling
FUP and FEP bits). Another causes invalid register rxq_ctrl0 settings
for some platforms. And another makes some writes at unknown memory
location.

Fixes: 3a97da12ee7b ("net: dwc_eth_qos: add dwc eqos for imx support")
Signed-off-by: Daniil Stas <daniil.stas@posteo.net>
Cc: Ye Li <ye.li@nxp.com>
Cc: Fugang Duan <fugang.duan@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dwc_eth_qos: Fix needless phy auto-negotiation restarts
Daniil Stas [Sun, 23 May 2021 22:24:48 +0000 (22:24 +0000)]
net: dwc_eth_qos: Fix needless phy auto-negotiation restarts

Disabling clk_ck clock leads to link up status loss in phy, which
leads to auto-negotiation restart before each network command
execution.

This issue is especially big for PXE boot protocol because of
auto-negotiation restarts before each configuration filename trial.

To avoid this issue don't disable clk_ck clock after it was enabled.

Signed-off-by: Daniil Stas <daniil.stas@posteo.net>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: e1000: do not attempt to set hwaddr for i210 without FLASH
Tim Harvey [Fri, 16 Apr 2021 20:25:09 +0000 (13:25 -0700)]
net: e1000: do not attempt to set hwaddr for i210 without FLASH

commit f1bcad22dd19 ("net: e1000: add support for writing to EEPROM")
adds support for storing hwaddr in EEPROM however i210 devices do not
support this and thus results in errors such as:
Warning: e1000#0 failed to set MAC address'

Check if a flash device is present and if not return -ENOSYS indicating
this is not supported.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoFix a memory leak issue in the RX port initialization.
Hou Zhiqiang [Sat, 12 Jun 2021 18:15:41 +0000 (21:15 +0300)]
Fix a memory leak issue in the RX port initialization.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Thu, 17 Jun 2021 12:44:56 +0000 (08:44 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- fsl-qoriq: Bug fixes related pfe, eth, thermal node, vid.c, cpu release,
  mmc, usb, env, etc for Layerscape boards
- powerpc: Update Maintainers for some boards.

3 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 17 Jun 2021 12:44:23 +0000 (08:44 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv

- ae350 related dts fixes.

3 years agoboard: freescale: t1028xrdb: Add MAINTAINER for revD
Priyanka Jain [Thu, 17 Jun 2021 07:22:46 +0000 (12:52 +0530)]
board: freescale: t1028xrdb: Add MAINTAINER for revD

Add Priyanka Jain as MAINTAINER for
 T2080RDB_revD_defconfig,
 T2080RDB_revD_NAND_defconfig,
 T2080RDB_revD_SDCARD_defconfig and
 T2080RDB_revD_SPIFLASH_defconfig

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: Update erratum number to align with doc
Ran Wang [Wed, 16 Jun 2021 12:23:19 +0000 (17:53 +0530)]
armv8: Update erratum number to align with doc

Change the USB erratum number A-050106 to A-050204 as A-050106 is
a duplicate and never be published.

Fixes 0cfa00cdb94 (“armv8: Add workaround for USB erratum A-050106”)
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t208xrdb: add a config option for rev D dts fixups
Camelia Groza [Fri, 11 Jun 2021 12:28:08 +0000 (15:28 +0300)]
board: freescale: t208xrdb: add a config option for rev D dts fixups

Under DM, we rely on u-boot's device tree to provide the correct PHY
addresses. The board_fix_fdt callback is intended to be used for
device tree fixups before relocation. Unfortunately, this isn't an
option when booting from flash since the device tree isn't writable
before relocation.

This patch introduces the CONFIG_T2080RDB_REV_D option to signal that a
board revision D or up is the target. The config option is used to set
the correct Aquantia PHY address in the board's u-boot device tree.

Defconfig files with the option enable explicitly are added for
convenience.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t208xrdb: add Linux fdt fix-ups for rev D
Camelia Groza [Wed, 16 Jun 2021 12:17:31 +0000 (17:47 +0530)]
board: freescale: t208xrdb: add Linux fdt fix-ups for rev D

The T2080RDB boards revisions D and up have updated 10G Aquantia PHYs
connected to MAC1 and MAC2. The second Aquantia PHY is located at a
different address on the MDIO bus compared to rev C (0x8 instead of 0x1).

Fix-up the Linux device tree to update the PHY address for the second
Aquantia PHY on boards revisions D and up. Also rename the PHY node to
reflect the changes.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t208xrdb: detect the board revision version
Camelia Groza [Fri, 11 Jun 2021 12:28:06 +0000 (15:28 +0300)]
board: freescale: t208xrdb: detect the board revision version

Detect and print the board revision version based on the CPLD registers.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t208xrdb: remove the legacy non-DM_ETH code
Camelia Groza [Fri, 11 Jun 2021 12:28:05 +0000 (15:28 +0300)]
board: freescale: t208xrdb: remove the legacy non-DM_ETH code

Both DM_ETH and DM_PCI are enabled for the T2080RDB board. Remove the
board_eth_init() callback and the non-DM_ETH code paths since they are not
needed anymore.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopg-wcom-ls102xa: fix sys counter frequency
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:25:21 +0000 (14:25 +0000)]
pg-wcom-ls102xa: fix sys counter frequency

A system clock of 66MHz was chosen for the pg-wcom-ls102xa.
Compared to the Evalboard, this corresponds to a reduction of 1/3.
The system counter clock should have been reduced accordingly,
but that was not the case, so we had a system time that was
1/3 behind the real time.

This patch corrects the system counter clock to
8.333MHz = 66.667MHz / 8.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachi-powergrids.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopg-wcom-ls102x: initialize front led and app buf
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:24:32 +0000 (14:24 +0000)]
pg-wcom-ls102x: initialize front led and app buf

This patch adds the front led initialization and the application
buffer enable to the eraly board inititlaization.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachi-powergrids.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm: ls102x: update device disable configuration acc hw design desc
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:23:34 +0000 (14:23 +0000)]
km: ls102x: update device disable configuration acc hw design desc

In order to improve power consumption ls102x allows to disable peripherals
that are not in use.
This patch follows SELI8 HW design description and disables peripherals
that are not in use in our designs, the same configuration is applicable
and for EXPU1.

This patch uses available hwconfig option for updating ls102x device
disable configuration.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm: ls102x: set ethrotate envvar to no
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:21:15 +0000 (14:21 +0000)]
km: ls102x: set ethrotate envvar to no

The default behavior in the latest u-boot revisions is to rotate the
active net device to the next available if the requested link is not
established.

For our ls102x based devices this would mean that if active debug net
device is not available, u-boot will rotate and set the next net device
that is one of the estar adapters.
To return from this situation manual action to set correct ethact
adapter will be needed and this can be annoying when working in
debug mode.

Setting ethrotate=no will disable net adapter rotation and will make sure
that the primary adapter is always used.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm/scripts: fix saveenv command syntax
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:20:13 +0000 (14:20 +0000)]
km/scripts: fix saveenv command syntax

This is most probably a typo, and in older u-uboot versions is same as
'saveenv', in the newer uboot versions there is a separate 'save' command
that is different from 'saveenv'.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm: ls102xa: add missing define for PRAM regions
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:19:08 +0000 (14:19 +0000)]
km: ls102xa: add missing define for PRAM regions

In our designs we reserve PRAM area at the end of the RAM, and in order
this area to be visible and taken into account by the u-boot memory mgmt
CONFIG_PRAM has to be defined.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokm/ls102xa: add support for u-boot POST memory test
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:17:34 +0000 (14:17 +0000)]
km/ls102xa: add support for u-boot POST memory test

From production view this is standard test executed during production on
all linux based foxmc cards.
On CENT2 HW defined memory region is zero means that some DDR accesses are
done by memory_post_dataline and memory_post_addrline but pattern tests
are skipped that's why mem_regions is fast there.

On ls102x for the complete DDR region of 1GiB memory_regions_post_test
takes approx. 4min and this is too much for production, so this patch
defines only 1MiB region as compromise.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard/km: add support for expu1 design based on nxp
Aleksandar Gerasimovski [Tue, 8 Jun 2021 14:16:28 +0000 (14:16 +0000)]
board/km: add support for expu1 design based on nxp

The EXPU1 design is a new 40G capable ethernet service unit card for
Hitachi-Powergrids wired-com product lines.

The base SoC is same as for already added SELI8 card, consequently the
already added u-boot support for SELI8 is reused.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachi-powergrids.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
[Fixed new line error at EOF]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t102xrdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:07:01 +0000 (13:37 +0530)]
board: freescale: t102xrdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for t102xrdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: p2041rdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:07:00 +0000 (13:37 +0530)]
board: freescale: p2041rdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for p2041rdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: p1_p2_rdb_pc: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:06:59 +0000 (13:36 +0530)]
board: freescale: p1_p2_rdb_pc: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for p1_p2_rdb_pc board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t4rdb: Add MAINTAINER
Priyanka Jain [Tue, 8 Jun 2021 08:06:58 +0000 (13:36 +0530)]
board: freescale: t4rdb: Add MAINTAINER

Add "Priyanka Jain <priyanka.jain@nxp.com>" as
MAINTAINER for t4rdb board.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: dts: ls1021a.dtsi: Fix invalid reg on gpio nodes
Lasse Klok Mikkelsen [Tue, 8 Jun 2021 06:39:12 +0000 (08:39 +0200)]
arm: dts: ls1021a.dtsi: Fix invalid reg on gpio nodes

Address and size cells on SOC are set to 1. But gpio nodes are specified
with 2 cells. This fixes the gpio nodes to correct cells.

Signed-off-by: Lasse Klok Mikkelsen <lkmi@prevas.dk>
Reviewed-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: tsec: add option to set device max-speed via dts
Aleksandar Gerasimovski [Fri, 4 Jun 2021 13:40:58 +0000 (13:40 +0000)]
net: tsec: add option to set device max-speed via dts

Current tsec adapter sets adapter gigabit capabilities by default, and in
reality this must not always be the case.
It is possible that tsec adapter is used for 100Mbps connection, and in
this case setting 1000Mbps capabilities can lead to some side effects such
longer autoneg process.

In our ls102x designs this problem leads to long autoneg times (> 4 sec)
in case board rgmii link is 100Mbps capable only.
Limiting the rgmii link capabilities provides faster and smoother
link establishment.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agokeymile: common: fix hexadecimal env variable format
Aleksandar Gerasimovski [Fri, 4 Jun 2021 09:25:00 +0000 (09:25 +0000)]
keymile: common: fix hexadecimal env variable format

Commit df86d32 breaks linux kernel and product application boot.

Linux kernel and our product application scripts are expecting 0x prefix
for hexadecimal values, while env_set_hex writes them without a prefix.

This patch partially revert env_set_hex usage for affected env variables.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: seli8: set envsize to 0x4000
Aleksandar Gerasimovski [Fri, 4 Jun 2021 09:17:56 +0000 (09:17 +0000)]
configs: seli8: set envsize to 0x4000

During the mainlining of the board this was by mistake set to sector size.
Our user space env scripts are expecting envsize of 0x4000, and setting
this differently will break our cross-platform compatibility.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>