platform/kernel/u-boot.git
2 years agobootstd: Add an implementation of script boot
Simon Glass [Mon, 25 Apr 2022 05:31:22 +0000 (23:31 -0600)]
bootstd: Add an implementation of script boot

Add a bootmeth driver which handles distro boot from a disk via a U-Boot
script, so we can boot a bootflow using this commonly used mechanism. This
is required by Armbian, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: sandbox: Add a hostfs bootdev
Simon Glass [Mon, 25 Apr 2022 05:31:21 +0000 (23:31 -0600)]
bootstd: sandbox: Add a hostfs bootdev

It is helpful to be able to try out bootstd on sandbox, using host files.
This is easier than using a block device, which must have a filesystem,
partition table, etc.

Add a new driver which provides this feature. For now it is not used in
tests, but it is likely to be useful.

Add notes in the devicetree also, but don't disturb the tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a sandbox bootmeth driver
Simon Glass [Mon, 25 Apr 2022 05:31:20 +0000 (23:31 -0600)]
bootstd: Add a sandbox bootmeth driver

Add a bootmeth driver for sandbox, used for testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of EFI bootmgr
Simon Glass [Mon, 25 Apr 2022 05:31:19 +0000 (23:31 -0600)]
bootstd: Add an implementation of EFI bootmgr

Add a bootmeth driver which handles EFI boot manager, using EFI_LOADER.

In effect, this provides the same functionality as the 'bootefi bootmgr'
command and shares the same code. But the interface into it is via a
bootmeth, so it does not require any special scripts, etc.

For now this requires the 'bootefi' command be enabled. Future work may
tidy this up so that it can be used without CONFIG_CMDLINE being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a system bootdev for strange boot methods
Simon Glass [Mon, 25 Apr 2022 05:31:18 +0000 (23:31 -0600)]
bootstd: Add a system bootdev for strange boot methods

Some boot methods don't act on a single bootdev but instead do their own
thing. An example is EFI bootmgr which scan various devices using its own
logic. Add a bootdev to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of EFI boot
Simon Glass [Mon, 25 Apr 2022 05:31:17 +0000 (23:31 -0600)]
bootstd: Add an implementation of EFI boot

Add a bootmeth driver which handles EFI boot, using EFI_LOADER.

In effect, this provides the same functionality as the 'bootefi' command
and shares the same code. But the interface into it is via a bootmeth,
so it does not require any special scripts, etc.

For now this requires the 'bootefi' command be enabled. Future work may
tidy this up so that it can be used without CONFIG_CMDLINE being enabled.

There was much discussion about whether this is needed, but it seems
that it is, at least for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of distro PXE boot
Simon Glass [Mon, 25 Apr 2022 05:31:16 +0000 (23:31 -0600)]
bootstd: Add an implementation of distro PXE boot

Add a bootmeth driver which handles distro boot from a network device, so
we can boot a bootflow using this commonly used mechanism.

In effect, this provides the same functionality as the 'pxe' command
and shares the same code. But the interface into it is via a bootmeth.

For now this requires the 'pxe' command be enabled. Future work may tidy
this up so that it can be used without CONFIG_CMDLINE being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: ethernet: Add a bootdev driver
Simon Glass [Mon, 25 Apr 2022 05:31:15 +0000 (23:31 -0600)]
bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: mmc: Add a bootdev driver
Simon Glass [Mon, 25 Apr 2022 05:31:14 +0000 (23:31 -0600)]
bootstd: mmc: Add a bootdev driver

Add a bootdev driver for MMC. It mostly just calls the bootdev helper
function.

Add a function to obtain the block device for an MMC controller.

Fix up the comment for mmc_get_blk_desc() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of distro boot
Simon Glass [Mon, 25 Apr 2022 05:31:13 +0000 (23:31 -0600)]
bootstd: Add an implementation of distro boot

Add a bootmeth driver which handles distro boot from a disk, so we can
boot a bootflow using this commonly used mechanism.

In effect, this provides the same functionality as the 'sysboot' command
and shares the same code. But the interface into it is via a bootmeth.

For now this requires the 'pxe' command be enabled. Future work may tidy
this up so that it can be used without CONFIG_CMDLINE being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootmeth command
Simon Glass [Mon, 25 Apr 2022 05:31:12 +0000 (23:31 -0600)]
bootstd: Add a bootmeth command

Add a 'bootmeth' command to handle listing and ordering of boot methods.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootflow command
Simon Glass [Mon, 25 Apr 2022 05:31:11 +0000 (23:31 -0600)]
bootstd: Add a bootflow command

Add a 'bootflow' command to handle listing and selection of bootflow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootdev command
Simon Glass [Mon, 25 Apr 2022 05:31:10 +0000 (23:31 -0600)]
bootstd: Add a bootdev command

Add a 'bootdev' command to handle listing and selection of bootdevs.

Disable standard boot for a few boards which otherwise run out of space.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add support for bootflows
Simon Glass [Mon, 25 Apr 2022 05:31:09 +0000 (23:31 -0600)]
bootstd: Add support for bootflows

Add support for bootflows, including maintaining a list of them and
iterating to find them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootmeth uclass and helpers
Simon Glass [Mon, 25 Apr 2022 05:31:08 +0000 (23:31 -0600)]
bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootdev uclass
Simon Glass [Mon, 25 Apr 2022 05:31:07 +0000 (23:31 -0600)]
bootstd: Add the bootdev uclass

A 'bootdev' is a device which can be used to boot an operating system.
It is a child of the media device (e.g. MMC) which handles reading files
from that device, such as a bootflow file.

Add a uclass for bootdev and the various helpers needed to make it
work. Also add a binding file, empty for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootstd uclass and core implementation
Simon Glass [Mon, 25 Apr 2022 05:31:06 +0000 (23:31 -0600)]
bootstd: Add the bootstd uclass and core implementation

The 'bootstd' device provides the central information about U-Boot
standard boot.

Add a uclass for bootstd and the various helpers needed to make it
work. Also add a binding file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the concept of a bootflow
Simon Glass [Mon, 25 Apr 2022 05:31:05 +0000 (23:31 -0600)]
bootstd: Add the concept of a bootflow

A bootflow encapsulates the process used to boot an operating system.
It typically has a control file (such as extlinux.conf) and information
about which 'bootdev' it came from.

Add the header file for this first, since it is needed by all other
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agofs: Add a function to set the filesystem type
Simon Glass [Mon, 25 Apr 2022 05:31:04 +0000 (23:31 -0600)]
fs: Add a function to set the filesystem type

When sandbox is used with hostfs we won't have a block device, but still
must set up the filesystem type before any filesystem operation, such as
loading a file. Add a function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: blk: Add a function to return the device type
Simon Glass [Mon, 25 Apr 2022 05:31:03 +0000 (23:31 -0600)]
dm: blk: Add a function to return the device type

Use the uclass name to get the device type for a block device.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: dm: Restart USB before assuming it is stopped
Simon Glass [Mon, 25 Apr 2022 05:31:02 +0000 (23:31 -0600)]
test: dm: Restart USB before assuming it is stopped

Update the blk test to stop USB first, in case another test has started
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: fastboot: Avoid using mmc1
Simon Glass [Mon, 25 Apr 2022 05:31:01 +0000 (23:31 -0600)]
test: fastboot: Avoid using mmc1

The bootflow tests need to use an MMC with an associated backing file
containing a filesystem. Update the fastboot tests to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Allow finding a uclass device by partial name
Simon Glass [Mon, 25 Apr 2022 05:31:00 +0000 (23:31 -0600)]
dm: core: Allow finding a uclass device by partial name

In some cases two devices are related and the only way to tell is to
check that the names partially patch. Add a way to check this without
needing to create a new string for the comparison.

Fix the comment for device_find_child_by_namelen() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Rename and fix uclass_get_by_name_len()
Simon Glass [Mon, 25 Apr 2022 05:30:59 +0000 (23:30 -0600)]
dm: core: Rename and fix uclass_get_by_name_len()

It seems that namelen is more common in U-Boot. Rename this function to
fit in better. Also fix a bug where it breaks the operation of
uclass_get_by_name() and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reported-by: Tim Harvey <tharvey@gateworks.com>
2 years agolib: Add a way to find the postiion of a trailing number
Simon Glass [Mon, 25 Apr 2022 05:30:58 +0000 (23:30 -0600)]
lib: Add a way to find the postiion of a trailing number

At present it is not possible to find out which part of the string is the
number part and which is before it. Add a new variant which provides this
feature, so we can separate the two in the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Fix a few bugs in trailing_strtoln()
Simon Glass [Mon, 25 Apr 2022 05:30:57 +0000 (23:30 -0600)]
lib: Fix a few bugs in trailing_strtoln()

At present this has a minor bug in that it reads the byte before the
start of the string, if it is empty. Also it doesn't handle a
non-numeric prefix which is only one character long.

Fix these bugs with a reworked implementation. Add a test for the second
case. The first one is hard to test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Correct comment formatting to avoid sphinx problems
Simon Glass [Mon, 25 Apr 2022 05:30:56 +0000 (23:30 -0600)]
lib: Correct comment formatting to avoid sphinx problems

Tweak a few comments to kep sphinx happy, in case we want to include this
file one day.

Also fix the 'exxamine' typo.

Patch-notes:
This uses:

   sed -i 's/@param \(\S*\)\s*/@\1: /' include/vsprintf.h

to convert the @param to the new format.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: Add tests for trailing_strtol()
Simon Glass [Mon, 25 Apr 2022 05:30:55 +0000 (23:30 -0600)]
test: Add tests for trailing_strtol()

This function currently has no tests. Add some.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Move string tests to the string module
Simon Glass [Mon, 25 Apr 2022 05:30:54 +0000 (23:30 -0600)]
lib: Move string tests to the string module

A few string tests were added to the print module by mistake. Move them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2022-04-22-assorted-updates'
Tom Rini [Sat, 23 Apr 2022 12:06:28 +0000 (08:06 -0400)]
Merge branch '2022-04-22-assorted-updates'

- Add "-q" to fdt addr and use it in distro_bootcmd to make the user
  experience less scary reading in normal try/fail cases.
- Let the adc update an environment variable like many other commands do
- Fix TPL SEPARATE_BSS check when locating DTB
- Allow ":" in PXE file names again
- Two Apple M1 fixes

2 years agoarm: apple: Point stdout-path to framebuffer when keyboard present
Mark Kettenis [Tue, 19 Apr 2022 19:20:31 +0000 (21:20 +0200)]
arm: apple: Point stdout-path to framebuffer when keyboard present

Unless you have a spare Apple Silicon machine, getting access to
the serial port on Apple Silicon machines requires special
hardware. Given that most machines come with a built-in screen
the framebuffer is likely to be the most convenient output device
for most users. While U-Boot will output to both serial and
framebuffer, OSes might not. Therefore set stdout-path to point
at /chosen/framebuffer when a keyboard is connected to the machine.

This behaviour can be overridden by setting the "stdout" variable
in the U-Boot environment. I addition to that keep the serial
console as the default when running under the m1n1 hypervisor.
The m1n1 hypervisor virtualizes the serial port such that it
can be easily accessed from any other machine with a USB port.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Janne Grunau <j@jannau.net>
Tested-by: Janne Grunau <j@jannau.net>
2 years agoarm: apple: Don't clear framebuffer
Mark Kettenis [Tue, 19 Apr 2022 19:10:29 +0000 (21:10 +0200)]
arm: apple: Don't clear framebuffer

Enable CONFIG_NO_FB_CLEAR to preserve the Asahi logo. Since that
logo is drawn on a black background also enable
CONFIG_SYS_WHITE_ON_BLACK such that text printed by U-Boot is still
visible.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoAllow colon in PXE bootfile URLs
Lyle Franklin [Sat, 16 Apr 2022 15:36:43 +0000 (11:36 -0400)]
Allow colon in PXE bootfile URLs

- U-boot's PXE flow supports prefixing your bootfile name with an
  IP address to fetch from a server other than the DHCP server,
  e.g. `hostIPaddr:bootfilename`:
  https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
- However, this breaks bootfile paths which contain a colon, e.g.
  `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
- This patch checks whether the `hostIPaddr` prefix is a valid
  IP address before overriding the serverIP otherwise the whole
  bootfile path is preserved

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
2 years agofdt: Add -q option to fdt addr for distro_bootcmd
Peter Hoyes [Thu, 31 Mar 2022 10:53:22 +0000 (11:53 +0100)]
fdt: Add -q option to fdt addr for distro_bootcmd

distro_bootcmd uses this construct a few times to test $fdt_addr_r,
and fall back on $fdtcontroladdr if not set/invalid:

    if fdt addr ${fdt_addr_r}; then
        ...
    else
        ...
    fi

If the `fdt addr` test fails, it prints the following  message on the
console, suggesting there is an error when there is not:

    libfdt fdt_check_header(): FDT_ERR_BADMAGIC

To remove this potentially confusing error message, this patch adds -q
as a 'quiet' option for fdt addr, and uses this flag in
config_distro_bootcmd.h

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2 years agocmd: adc: Add support for storing ADC result in env variable
Marek Vasut [Thu, 14 Apr 2022 16:52:25 +0000 (18:52 +0200)]
cmd: adc: Add support for storing ADC result in env variable

Add the ability to save ADC conversion result in an environment
variable. This is useful for further arbitrary processing by the
U-Boot scripts.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agofdt: Fix TPL SEPARATE_BSS check when locating DTB
Andrew Abbott [Sat, 16 Apr 2022 00:12:31 +0000 (10:12 +1000)]
fdt: Fix TPL SEPARATE_BSS check when locating DTB

Commit 690af71850149bf242502f688eca80fb302d1f76 changed this condition
from an explicit

IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)

to

CONFIG_IS_ENABLED(SEPARATE_BSS)

The documentation for CONFIG_IS_ENABLED() in include/linux/kconfig.h
implies that we will get the correct behaviour, but the actual behaviour
differs such that this condition is now always false.

This stopped TPL being able to load the device tree blob at least on the
ROCKPro64 board (RK3399 SoC), since the wrong device tree location was
chosen.

The issues causing this behaviour with CONFIG_IS_ENABLED() are:

1. The documentation implies that CONFIG_SPL_BUILD =>
   CONFIG_SPL_<option> is considered before the TPL equivalent.

   Actually, the TPL options have higher priority - see definition of
   _CONFIG_PREFIX.

2. The documentation implies a fallthrough, eg. if CONFIG_SPL_BUILD is
   defined but the CONFIG_SPL_<option> is not, then it will proceed to
   check if CONFIG_TPL_BUILD

   Actually, if CONFIG_TPL_BUILD is defined, then it stops there
   and CONFIG_SPL_BUILD is not considered - see definition of
   _CONFIG_PREFIX.

   During TPL build, at least for the ROCKPro64, both CONFIG_TPL_BUILD
   and CONFIG_SPL_BUILD are defined, but because of the above, only TPL
   options are considered. Since there is no CONFIG_TPL_SEPARATE_BSS,
   this fails.

Fixes: 690af71850 ("fdt: Correct condition for SEPARATE_BSS")
Signed-off-by: Andrew Abbott <andrew@mirx.dev>
2 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Fri, 22 Apr 2022 15:06:38 +0000 (11:06 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-pmic

2 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 22 Apr 2022 15:06:31 +0000 (11:06 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

2 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 22 Apr 2022 14:17:35 +0000 (10:17 -0400)]
configs: Resync with savedefconfig

Resync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agopower-domain: Fix use of uninitialized value in dev_power_domain_ctrl
Sean Anderson [Wed, 23 Mar 2022 18:26:09 +0000 (14:26 -0400)]
power-domain: Fix use of uninitialized value in dev_power_domain_ctrl

If dev_count_phandle_with_args returns 0 or another error, then pd will never
have been initialized by power_domain_get_by_index. Avoid comparing against
pd.dev in this situation.

Fixes: 3e4fcfa4bc ("power-domain: fix hang in endless loop on i.MX8")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Fri, 22 Apr 2022 12:12:53 +0000 (08:12 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdog

- device-tree-bindings: watchdog: document common properties (Philippe)
- nuvoton: Add support for Nuvoton (Jim)

2 years agoMerge tag 'u-boot-imx-20220422' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 22 Apr 2022 12:12:20 +0000 (08:12 -0400)]
Merge tag 'u-boot-imx-20220422' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220422
-------------------

- Switch to DM_SERIAL
- Drop MMCROOT
- several cleanup

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

2 years agoAdd support for TP-Link UE200 dongle
Oleksii Titov [Wed, 20 Apr 2022 08:23:25 +0000 (11:23 +0300)]
Add support for TP-Link UE200 dongle

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Oleksii Titov <ootitov@gmail.com>
2 years agousb: dwc3: Add support for usb3-phy PHY configuration
Michal Simek [Wed, 9 Mar 2022 09:05:45 +0000 (10:05 +0100)]
usb: dwc3: Add support for usb3-phy PHY configuration

When usb3-phy label is found, PHY driver is called and serdes line is
initialized. This is preparation for serdes/psgtr driver to configure GT
lines based on description in DT.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agogeneric-phy: s/CONFIG_PHY/CONFIG_IS_ENABLED(PHY)/
Michal Simek [Wed, 9 Mar 2022 09:05:44 +0000 (10:05 +0100)]
generic-phy: s/CONFIG_PHY/CONFIG_IS_ENABLED(PHY)/

Allow to disable PHY driver in SPL because it checks the CONFIG_SPL_PHY
variable for SPL builds.

The same change was done for usb by commit fd09c205fc57 ("usb:
s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agousb: gadget: ci: Make various ops const
Adam Ford [Fri, 4 Mar 2022 22:59:02 +0000 (16:59 -0600)]
usb: gadget: ci: Make various ops const

ci_udc_ops and ci_ep_ops do not change their operations.
Mark them as const.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agowdt: nuvoton: Add support for Nuvoton
Jim Liu [Fri, 1 Apr 2022 09:59:39 +0000 (17:59 +0800)]
wdt: nuvoton: Add support for Nuvoton

Add watchdog controller driver for NPCM7xx/npcm8xx

the wdt design of npcm750 and npcm845 is the same.
so the driver can work on npcm750 and npcm845.
about npcm845 wdt dtsi i will followed kernel dts name
to use nuvoton,npcm750-wdt.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodoc: device-tree-bindings: watchdog: document common properties
Philippe Reynes [Wed, 9 Mar 2022 13:56:19 +0000 (14:56 +0100)]
doc: device-tree-bindings: watchdog: document common properties

Adds simple documentation about common properties for watchdog
in the device tree.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge branch '2022-04-21-further-cleanups'
Tom Rini [Thu, 21 Apr 2022 23:55:38 +0000 (19:55 -0400)]
Merge branch '2022-04-21-further-cleanups'

- Fix SPL_SYS_MALLOC_SIMPLE and non-SPL_FRAMEWORK boards (a large number
  of PowerPC platforms)
- Remove duplication of crc16 functionality
- Migrate COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY and have it in
  Kconfig

2 years agoARM: imx: imx8mn-evk: change environment address variables
Heiko Thiery [Thu, 24 Feb 2022 20:07:14 +0000 (21:07 +0100)]
ARM: imx: imx8mn-evk: change environment address variables

Currently the space between kernel_addr_r and the fdt_addr_r is only 32MB.
To have enough space to load kernel images bigger than 32MB change the
variables to a feasible value.

The new environment variables layout is based on the scheme from
"include/configs/ti_armv7_common.h".

The CONFIG_SYS_LOAD_ADDR value is set to 0x42000000. With that we have
the same value as for the kernel_addr_r.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx: drop IMX_FEC_BASE
Peng Fan [Fri, 15 Apr 2022 04:23:43 +0000 (12:23 +0800)]
configs: imx: drop IMX_FEC_BASE

IMX_FEC_BASE is not used in these boards, so drop it.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8mm-cl-iot-gate: Remove redundant board_fix_fdt()
Ying-Chun Liu (PaulLiu) [Wed, 20 Apr 2022 15:37:07 +0000 (23:37 +0800)]
imx8mm-cl-iot-gate: Remove redundant board_fix_fdt()

In arch/arm/mach-imx/imx8m/soc.c there's an implementation of
board_fix_fdt() introduced by commit 35bb60787b88. Remove the
redundant one to avoid failed to build from source when enabling
CONFIG_OF_BOARD_FIXUP.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoarm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid
Peng Fan [Wed, 13 Apr 2022 09:47:22 +0000 (17:47 +0800)]
arm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid

Since COUNTER_FREQUENCY is obselete, so set cntfrq_el0 if
CONFIG_COUNTER_FREQUENCY is valid

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2 years agoinclude/configs: drop COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:21 +0000 (17:47 +0800)]
include/configs: drop COUNTER_FREQUENCY

Since we have CONFIG_COUNTER_FREQUENCY enabled, no need COUNTER_FREQUENCY

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: set CONFIG_COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:20 +0000 (17:47 +0800)]
configs: set CONFIG_COUNTER_FREQUENCY

Set CONFIG_COUNTER_FREQUENCY according to COUNTER_FREQUENCY in
config header file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
[trini: Re-run migration]

2 years agoarch: arm: Kconfig: set default COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:19 +0000 (17:47 +0800)]
arch: arm: Kconfig: set default COUNTER_FREQUENCY

Set default COUNTER_FREQUENCY according to config header file
under include/configs/
i.MX6UL/ULL/7D/8QM/8QXP all has system counter frequency run at 8MHz,
so set default value for them.
SUNXI/EXYNOS/ROCKCHIP_RK3128/ROCKCHIP_RK3288/ROCKCHIP_RK322X/ROCKCHIP_RK3036
at 24MHz. ARCH_LX2160A at 25MHz
ARCH_ZYNQMP at 100MHz

2 years agoarch: arm: move COUNTER_FREQUENCY from versal to arm
Peng Fan [Wed, 13 Apr 2022 09:47:18 +0000 (17:47 +0800)]
arch: arm: move COUNTER_FREQUENCY from versal to arm

Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to
versal. And update help message.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoxilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
Peng Fan [Wed, 13 Apr 2022 09:47:17 +0000 (17:47 +0800)]
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY

Since versal has CONFIG_COUNTER_FREQUENCY, so use it. And
COUNTER_FREQUENCY will be dropped.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
2 years agomisc: atsha204a: Remove duplicate CRC-16 implementation
Pali Rohár [Tue, 12 Apr 2022 09:20:44 +0000 (11:20 +0200)]
misc: atsha204a: Remove duplicate CRC-16 implementation

ATSHA204A uses bit-reversed checksum of standard CRC-16 with polynomial
x^16 + x^15 + x^2 + 1.

This ATSHA204A specific checksum can be calculated just by using common
U-Boot functions bitrev16() and crc16().

So replace custom driver CRC-16 implementation by common U-Boot functions.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agofs: ext4: Use CRC-16 implementation from linux/crc16.h
Pali Rohár [Tue, 12 Apr 2022 09:20:43 +0000 (11:20 +0200)]
fs: ext4: Use CRC-16 implementation from linux/crc16.h

Implementation in linux/crc16.h provides standard CRC-16 algorithm with
polynomial x^16 + x^15 + x^2 + 1. Use it and remove duplicate ext4 CRC-16
specific code.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16: Move standard CRC-16 implementation from ubifs to lib
Pali Rohár [Tue, 12 Apr 2022 09:20:42 +0000 (11:20 +0200)]
crc16: Move standard CRC-16 implementation from ubifs to lib

This implementation provides standard CRC-16 algorithm with polynomial
x^16 + x^15 + x^2 + 1.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16: Rename fs/ubifs/crc16.h to include/linux/crc16.h
Pali Rohár [Tue, 12 Apr 2022 09:20:41 +0000 (11:20 +0200)]
crc16: Rename fs/ubifs/crc16.h to include/linux/crc16.h

File fs/ubifs/crc16.h is standard linux's crc16.h include file. So move it
from fs/ubifs to include/linux where are also other linux include files.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agocrc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c
Pali Rohár [Tue, 12 Apr 2022 09:20:40 +0000 (11:20 +0200)]
crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c

U-Boot CRC-16 implementation uses polynomial x^16 + x^12 + x^5 + 1 which is
not standard CRC-16 algorithm, but it is known as CRC-16-CCITT. Rename file
crc16.c to crc16-ccitt.c to reduce confusion.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoSPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default
Pali Rohár [Fri, 8 Apr 2022 08:28:05 +0000 (10:28 +0200)]
SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default

On P2020 board is SPL malloc simple always failing with error and loops:

  SD boot...
  alloc space exhausted
  Bad trap at PC: f8f8b5f0, SR: 21200, vector=d00
  NIP: 00000000 XER: 00000000 LR: 00000000 REGS: f8f8b5f0 TRAP: 20000000 DAR: 00000000
  MSR: 00021200 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00

  GPR00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR08: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  GPR24: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  Call backtrace:
  Exception in kernel pc f8f8b5f0 signal 0

Inspection showed that gd->malloc_limit is zero. And it is because
generally SPL_FRAMEWORK initialize SPL's gd->malloc_limit. But when
SPL_FRAMEWORK is not enabled then in most cases nobody initialize
gd->malloc_limit and so SPL malloc simple does not work.

So disable SPL_SYS_MALLOC_SIMPLE by default when SPL_FRAMEWORK is not
enabled. SPL_SYS_MALLOC_SIMPLE can be disabled only by setting
SPL_SYS_MALLOC_F_LEN to zero. So do it.

This change fixes SPL error "alloc space exhausted" on P2020 board.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 21 Apr 2022 15:44:54 +0000 (11:44 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mrvl_uart.sh: Remove script (Pali)
- Fix Espressobin build for configs where ENV is not in SPI (Rogier)
- mvebu: a37xx: Add support for reading OTP (Pali)
- mvebu: uDPU: Ethernet fixes and misc DT and defconfig changes (Robert)
- mvebu: Add support for reading LD0 and LD1 eFuse (Pali)
- kwboot: Replace fstat()+st_size by lseek()+SEEK_END (Pali)
- mvebu: turris_omnia: Enable CONFIG_CMD_FUSE (Pali)
- arm: Add CONFIG_SPL_SYS_NO_VECTOR_TABLE used on 32bit MVEBU (Pali)
- mvebu: a37xx: Add support for writing Security OTP values (Pali)
- mvebu: turris: Misc enhancements and cleanups / fixes (Pali)
- Sheevaplug : Use Marvell uclass mvgbe and PHY driver for Ethernet (Tony)

2 years agoMerge branch '2022-04-21-assorted-improvements'
Tom Rini [Thu, 21 Apr 2022 14:56:58 +0000 (10:56 -0400)]
Merge branch '2022-04-21-assorted-improvements'

- For the environment, add a arch_env_get_location hook and make use of
  it on some NXP platforms (so that boards can override SoCs).
- Remove some unused squashfs code from SPL
- Resync am335x beaglebone related DTS files
- Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used

2 years agoimx: Fix build error
Ye Li [Tue, 19 Apr 2022 09:13:25 +0000 (14:43 +0530)]
imx: Fix build error

Fix wrong environment.h and remove DECLARE_GLOBAL_DATA_PTR

Fixes: 30e39ac7c9 (imx: imx7 Support for Manufacturing Protection)
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agoimx: Update FSL_MFGPROT config for iMX8M
Ye Li [Tue, 19 Apr 2022 09:13:24 +0000 (14:43 +0530)]
imx: Update FSL_MFGPROT config for iMX8M

Update the Kconfig and Makefile to allow build for iMX8M and
restrict the build only in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
2 years agocrypto/fsl: add invalidate_dcache_range for hash output buffer
Gaurav Jain [Tue, 19 Apr 2022 05:22:28 +0000 (10:52 +0530)]
crypto/fsl: add invalidate_dcache_range for hash output buffer

HW accelerated hash operations are giving incorrect hash output.
so invalidate cache lines to avoid cache overwriting in DDR memory region.

caam_hash()
 -moved address alignment check in the beginning of function.
 -added invalidate_dcache_range for pout buffer before running descriptor.

Fixes: d7af2baa49 (crypto/fsl: Fix HW accelerated hash commands)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agodoc: imx8mn_evk: Do not export ATF_LOAD_ADDR
Fabio Estevam [Mon, 18 Apr 2022 17:15:08 +0000 (14:15 -0300)]
doc: imx8mn_evk: Do not export ATF_LOAD_ADDR

The imx8mn_evk target have been converted to use binman.

With the binman approach the ATF load address is described via
devicetree, so remove the now unneeded instruction of exporting
ATF_LOAD_ADDR.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mn_evk: Enable cache in SPL
Fabio Estevam [Mon, 18 Apr 2022 17:15:07 +0000 (14:15 -0300)]
imx8mn_evk: Enable cache in SPL

There is no reason for disabling I-cache and D-cache
in SPL.

Remove the unneeded CONFIG_SPL_SYS_ICACHE_OFF and
CONFIG_SPL_SYS_DCACHE_OFF options.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoboard: bsh: imx8mn_bsh_smm_s2/s2pro: enable DM_SERIAL
Michael Trimarchi [Mon, 18 Apr 2022 06:53:36 +0000 (08:53 +0200)]
board: bsh: imx8mn_bsh_smm_s2/s2pro: enable DM_SERIAL

Enable DM_SERIAL for both U_Boot and the SPL. The uart4 and its pinmux
are already marked with u-boot,dm-spl but we need to move the call to
preloader_console_init() after spl_init() to avoid a board hang
as dm can't be used until after spl_init().

Remove the manual config of the UART pinmux now that it is no longer
needed.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Tested-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2 years agoarm: dts: imx8mp: add of-list support to common imx8mp-u-boot.dtsi
Tim Harvey [Fri, 15 Apr 2022 20:41:54 +0000 (13:41 -0700)]
arm: dts: imx8mp: add of-list support to common imx8mp-u-boot.dtsi

Add support for OF-LIST to common imx8mp-u-boot.dtsi so that it can
be used with boards that have multiple DTB's.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Teresa Remmet <t.remmet@phytec.de>
Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agocrypto/fsl: Clear the memory when blob decapsulation fails
Gaurav Jain [Fri, 15 Apr 2022 11:22:34 +0000 (16:52 +0530)]
crypto/fsl: Clear the memory when blob decapsulation fails

issue: blob decapsulation operation store the decrypted data
       in memory even if ICV check failed.

fix: clear the blob data output memory.

Fixes: c5de15cbc8 (crypto/fsl: Add command for encapsulating/decapsulating blobs)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Tested-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mq-evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:36 +0000 (12:35 +0800)]
imx: imx8mq-evk: enable CONFIG_DM_SERIAL

Marked related nodes as u-boot,dm-spl for serial driver model
Enable CONFIG_DM_SERIAL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mn_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:35 +0000 (12:35 +0800)]
imx: imx8mn_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

move the preloader_console_init() call after spl_init() to
avoid board hang

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mm_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:34 +0000 (12:35 +0800)]
imx: imx8mm_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

move the preloader_console_init() call after spl_early_init() to
avoid board hang

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: imx8mp_evk: enable CONFIG_DM_SERIAL
Peng Fan [Fri, 15 Apr 2022 04:35:33 +0000 (12:35 +0800)]
imx: imx8mp_evk: enable CONFIG_DM_SERIAL

Enable CONFIG_DM_SERIAL. uart2 and its pinmux was already
marked with u-boot,dm-spl.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoscripts: config_whitelist: drop CONFIG_MMCROOT
Peng Fan [Fri, 15 Apr 2022 04:23:42 +0000 (12:23 +0800)]
scripts: config_whitelist: drop CONFIG_MMCROOT

Drop CONFIG_MMCROOT, no users now.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: drop CONFIG_MMCROOT
Peng Fan [Fri, 15 Apr 2022 04:23:41 +0000 (12:23 +0800)]
configs: drop CONFIG_MMCROOT

CONFIG_MMCROOT is only used to set mmcroot, no need a dedicated macro.

Script as below
"
 for i in `ls include/configs/*.h`
 do
 mmcroot=`sed -n '/define.*MMCROOT/ p' $i  | awk -F\" '{ print $2;}'`

 if [ ! -n "$mmcroot" ]; then
  continue
 fi

 sed -i '/define.*MMCROOT/ d' $i
 sed -i 's,\" CONFIG_MMCROOT \",'$mmcroot',g' $i

 done
"

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agotreewide: Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used
Sean Anderson [Tue, 12 Apr 2022 14:59:04 +0000 (10:59 -0400)]
treewide: Enable SPL_SEPARATE_BSS if SPL_BSS_START_ADDR is used

If .bss does not immediately follow the end of the image, then
CONFIG_SPL_SEPARATE_BSS must be selected. Typically, the location of bss
is specified by using CONFIG_SPL_BSS_START_ADDR in a linker script. On
these arches, CONFIG_SPL_SEPARATE_BSS should be enabled. If there is an
option to use an alternate boot script (e.g. CONFIG_SPL_LDSCRIPT is just
a default), just imply. If there is not, select.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2 years agoboard: ti: am335x: Add support for BBE Extended WiFi
Paul Barker [Mon, 11 Apr 2022 15:42:01 +0000 (15:42 +0000)]
board: ti: am335x: Add support for BBE Extended WiFi

The Sancloud BeagleBone Enhanced Extended WiFi (BBE Extended WiFi) has
its own devicetree file and the board can be identified by the 2nd
letter of the config string within the common EEPROM.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agoboard: ti: am335x: Add BBE Lite support
Paul Barker [Mon, 11 Apr 2022 15:42:00 +0000 (15:42 +0000)]
board: ti: am335x: Add BBE Lite support

The Sancloud BeagleBone Enhanced Lite (BBE Lite) has its own devicetree
file and the board can be identified by the 2nd letter of the config
string within the common EEPROM.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agoarm: dts: Resync dts for BeagleBone and derivatives
Paul Barker [Mon, 11 Apr 2022 15:41:59 +0000 (15:41 +0000)]
arm: dts: Resync dts for BeagleBone and derivatives

Sync BeagleBone dts files & TPS dtsi files with Linux v5.17 and include
the SanCloud BBE Extended WiFi dts added in v5.18-rc1. Also pull in
changes to am33xx-l4.dtsi needed to support the BeagleBone Blue.

The change to use the cpsw switch driver (commit c477358e66a3 in Linux)
is excluded from the sync as u-boot does not recognise the new
compatible string.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2 years agofs: Allow to compile FS_SQUASHFS only for proper U-Boot
Pali Rohár [Wed, 6 Apr 2022 21:34:00 +0000 (23:34 +0200)]
fs: Allow to compile FS_SQUASHFS only for proper U-Boot

CONFIG_SPL_FS_SQUASHFS cannot be disabled when CONFIG_FS_SQUASHFS is
enabled. Fix it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoARM: imx: imx8m: env: Switch to arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:34 +0000 (02:21 +0200)]
ARM: imx: imx8m: env: Switch to arch_env_get_location()

Implement arch_env_get_location() instead of env_get_location(), so that
the env_get_location() can be implemented on board level and override the
arch_env_get_location() architecture defaults.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoarmv8: layerscape: env: Switch to arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:33 +0000 (02:21 +0200)]
armv8: layerscape: env: Switch to arch_env_get_location()

Implement arch_env_get_location() instead of env_get_location(), so that
the env_get_location() can be implemented on board level and override the
arch_env_get_location() architecture defaults.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoenv: Implement lower priority arch_env_get_location()
Marek Vasut [Wed, 6 Apr 2022 00:21:32 +0000 (02:21 +0200)]
env: Implement lower priority arch_env_get_location()

Currently there is only one way to override desired environment location,
by implementing env_get_location(). This is increasingly being conflated
both on board level and architecture level, which leads to a problem on
boards where this function is already implemented on architecture level,
since those boards have no way to override this environment location on
board level anymore.

Implement arch_env_get_location() function which is architecture specific
and should only ever be implemented in architecture code. This function
has lower priority than env_get_location(), which should only ever be
implemented in board code, and which overrides the arch_env_get_location()
architecture environment selection.

This way, architecture can define its default environment chooser, while
board can now override it as needed at all times.

There is no functional change, since env_get_location() simply returns
arch_env_get_location(), and arch_env_get_location() implements the
current env_get_location() default content.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tommaso Merciai <tomm.merciai@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
2 years agoconfigs: phycore_imx8mm/p: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:40 +0000 (12:23 +0800)]
configs: phycore_imx8mm/p: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-By: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mm/n_venice: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:39 +0000 (12:23 +0800)]
configs: imx8mm/n_venice: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-By: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: verdin-imx8m: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:38 +0000 (12:23 +0800)]
configs: verdin-imx8m: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8qm/qxp_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:37 +0000 (12:23 +0800)]
configs: imx8qm/qxp_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: mx7dsabresd: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:36 +0000 (12:23 +0800)]
configs: mx7dsabresd: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 CONFIG_SYS_FSL_USDHC_NUM
 CONFIG_SYS_FSL_ESDHC_ADDR

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: mx6sxsabresd: drop CONFIG_SYS_FSL_USDHC_NUM
Peng Fan [Fri, 15 Apr 2022 04:23:35 +0000 (12:23 +0800)]
configs: mx6sxsabresd: drop CONFIG_SYS_FSL_USDHC_NUM

With DM_MMC, CONFIG_SYS_FSL_USDHC_NUM is not needed.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mn_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:34 +0000 (12:23 +0800)]
configs: imx8mn_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mp_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:33 +0000 (12:23 +0800)]
configs: imx8mp_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mm_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:32 +0000 (12:23 +0800)]
configs: imx8mm_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoARM: imx: imx8m: Fix board_get_usable_ram_top()
Marek Vasut [Thu, 14 Apr 2022 13:51:46 +0000 (15:51 +0200)]
ARM: imx: imx8m: Fix board_get_usable_ram_top()

The 4 GiB boundary is at 0xffffffff+1 , not at 0x80000000, fix this.

The PHYS_SDRAM of i.MX8M is at 0x40000000 , so to restrict ram_top
below 4 GiB, the ram_top has to be set to 0xffffffff as it is not
an offset from the start of PHYS_SDRAM, but rather a physical address
marking the topmost allowed DRAM address.

Fixes: e27bddff4b9 ("imx8m: Restrict usable memory to space below 4G boundary")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agoconfigs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO
Ian Ray [Thu, 14 Apr 2022 11:05:46 +0000 (14:05 +0300)]
configs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO

This GPIO is actually an input "Q7_3V3_PCIE_WAKE#_IN" not an output, so
remove the misleaading and incorrect definition.

Cc: Tim Harvey <tharvey@gateworks.com> (re: pci: imx: use vpcie-supply if defined by device-tree)
Signed-off-by: Ian Ray <ian.ray@ge.com>
2 years agopci: imx: remove weak overrides no longer used
Tim Harvey [Wed, 13 Apr 2022 22:57:37 +0000 (15:57 -0700)]
pci: imx: remove weak overrides no longer used

There are no users of the imx6_pcie_toggle_power and imx6_pcie_toggle_reset
weak overrides and as these functions are able to be handled now via dt
properties lets remove these.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>