oweals/u-boot.git
4 years agoarm: mvebu: clearfog: support multiple SATA boot
Joel Johnson [Mon, 23 Mar 2020 17:26:32 +0000 (11:26 -0600)]
arm: mvebu: clearfog: support multiple SATA boot

Enable distro bootcmd support for additional SATA ports if enabled.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: clearfog: add SCSI to distro bootcmd
Joel Johnson [Mon, 23 Mar 2020 17:26:31 +0000 (11:26 -0600)]
arm: mvebu: clearfog: add SCSI to distro bootcmd

Include attempting to boot from SCSI (SATA) devices within generated
board distro bootcmd environment. The reasoning for boot ordering is
that MMC and USB are external and removable, while when a case is in
use, replacing M.2 or mSATA drives requires disassembly. Therefore,
to boot SCSI, [bootable] external media must be removed. If SCSI were
placed before MMC or USB, then removing a bootable SCSI drive to
enable MMC or USB booting would be more difficult.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: update RTC values for PCIe memory wrappers
Chris Packham [Wed, 26 Feb 2020 06:53:50 +0000 (19:53 +1300)]
arm: mvebu: update RTC values for PCIe memory wrappers

Update the RTC (Read Timing Control) values for PCIe memory wrappers
following an ERRATA (ERRATA# TDB). This means the PCIe accesses will
used slower memory Read Timing, to allow more efficient energy
consumption, in order to lower the minimum VDD of the memory.  Will lead
to more robust memory when voltage drop occurs (VDDSEG)

The code is based on changes from Marvell's U-Boot, specifically:

https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/20cd2704072512de176e048970f2883db901674b
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/eb608a7c8dd0d42b87601a61b9c0cc5615ab94b2
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/c4af19ae2bf08cf6e450e741ce4f04d402a5cb6b

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: clearfog: add scsi target to distro-boot
Josua Mayer [Mon, 17 Feb 2020 18:37:28 +0000 (19:37 +0100)]
arm: mvebu: clearfog: add scsi target to distro-boot

Support for sata devices via the scsi command is available and already
enabled by default for the Clearfog Base and Pro. This change adds scsi
to the list of boot targets used by distro-boot.

Signed-off-by: Josua Mayer <josua@solid-run.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: drivers/ddr: remove redundant assignment
Heinrich Schuchardt [Sat, 15 Feb 2020 20:58:31 +0000 (21:58 +0100)]
arm: mvebu: drivers/ddr: remove redundant assignment

The value of local variable ecc is immediately overwritten. So we can
remove the first assignment.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: dts: Sort Armada series dts alphabetically
Josip Kelecic [Thu, 13 Feb 2020 13:38:49 +0000 (14:38 +0100)]
arm: mvebu: dts: Sort Armada series dts alphabetically

Sort the Armada series dts in the Makefile alphabetically
prior to adding new board support.

Signed-off-by: Josip Kelečić <josip.kelecic@sartura.hr>
Reviewed-by: Luka Kovacic <luka.kovacic@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoddr: marvell: a38x: Allow boards to specify CK_DELAY parameter
Chris Packham [Wed, 29 Jan 2020 23:50:44 +0000 (12:50 +1300)]
ddr: marvell: a38x: Allow boards to specify CK_DELAY parameter

For some layouts it is necessary to adjust the CK_DELAY parameter to
successfully complete DDR training. Add the ability to specify the
CK_DELAY in the mv_ddr_topology_map.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
4 years agoMerge branch 'next'
Tom Rini [Mon, 13 Apr 2020 15:27:00 +0000 (11:27 -0400)]
Merge branch 'next'

Pull in changes that have been pending in our 'next' branch.  This
includes:
- A large number of CI improvements including moving to gcc-9.2 for all
  platforms.
- amlogic, xilinx, stm32, TI SoC updates
- USB and i2c subsystem updtaes
- Re-sync Kbuild/etc logic with v4.19 of the Linux kernel.
- RSA key handling improvements

4 years agoPrepare v2020.04 v2020.04
Tom Rini [Mon, 13 Apr 2020 15:02:18 +0000 (11:02 -0400)]
Prepare v2020.04

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Tom Rini [Sun, 12 Apr 2020 12:10:13 +0000 (08:10 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx

- Fixes DDR initialization failure on PowerPC boards like P3041DS,
  P4080DS

4 years agoMerge branch '2020-04-11-CI-further-improvements' into next
Tom Rini [Sat, 11 Apr 2020 15:18:14 +0000 (11:18 -0400)]
Merge branch '2020-04-11-CI-further-improvements' into next

- Further clean up and improve our Azure/GitLab/Travis CI loops

4 years agotravis/gitlab/azure: Run cppcheck in parallel
Simon Glass [Sun, 5 Apr 2020 20:35:43 +0000 (14:35 -0600)]
travis/gitlab/azure: Run cppcheck in parallel

This takes ages to run single-threaded. Adjust it to use all available
processors.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotest/py: Allow using buildman to build U-Boot
Simon Glass [Wed, 18 Mar 2020 15:43:01 +0000 (09:43 -0600)]
test/py: Allow using buildman to build U-Boot

It is a pain to have to set the CROSS_COMPILE environment variable when
using test.py's --build option. It is possible to get this using the -A
option from buildman. But it seems better to just use buildman to do the
build when it is available.

However using buildman adds a new dependency to the test system which we
want to avoid. So leave the default as is and add a flag to make it use
buildman.

Note that most of these changes relate to test.py and the parts of the
travis/gitlab/azure scripts which relate to running test and building a
suitable U-Boot to run the tests on.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Drop repeated buildman call with test.py
Simon Glass [Wed, 18 Mar 2020 15:43:00 +0000 (09:43 -0600)]
travis/gitlab/azure: Drop repeated buildman call with test.py

It does not seem to be necessary to run buildman again to show errors,
since any errors can be shown by the first invocation and there is only
a single board being built. Update this to simplify the code, using the
-e flag to make sure errors are shown.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Simplify the exit code for test.py
Simon Glass [Wed, 18 Mar 2020 15:42:59 +0000 (09:42 -0600)]
travis/gitlab/azure: Simplify the exit code for test.py

It seems unnecessary to read the exit code and then check it again. Drop
this and just let the test.py provide the exit code directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Enable test_handoff
Simon Glass [Wed, 18 Mar 2020 15:42:58 +0000 (09:42 -0600)]
travis/gitlab/azure: Enable test_handoff

Ensure that this SPL test runs on gitlab.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Use -W to avoid warnings check
Simon Glass [Wed, 18 Mar 2020 15:42:57 +0000 (09:42 -0600)]
travis/gitlab/azure: Use -W to avoid warnings check

We can use the -W flag to tell buildman to ignore warnings. Since we also
have -E defined, compiler warnings are promoted to errors, so they will
still cause a failure. But migration warnings of the form:

    ===================== WARNING ======================
    This board does not use CONFIG_DM. CONFIG_DM will be
    compulsory starting with the v2020.01 release.
    Failure to update may result in board removal.
    See doc/driver-model/migration.rst for more info.

will now be ignored.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 329f5ef51d2 (travis.yml: run buildman with option -E)
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Use bash to avoid a_test_which_does_not_exist
Simon Glass [Wed, 18 Mar 2020 15:42:56 +0000 (09:42 -0600)]
travis/gitlab/azure: Use bash to avoid a_test_which_does_not_exist

Bash allows for variables to expand only if non-empty:

$ var=test
$ echo ${var:+"$var"}
test
$ echo ${var:+"-k $var"}
-k test
$ var=
$ echo ${var:+"-k $var"}

Use this feature to avoid the workaround.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agogitlab/azure: Use -w flag for all test.py builds
Simon Glass [Wed, 18 Mar 2020 15:42:55 +0000 (09:42 -0600)]
gitlab/azure: Use -w flag for all test.py builds

Avoid needing to know about the internal .bm-work directory, by passing
the -w flag to buildman.

This is not needed on travis since the -w flag is already used (from a
previous patch).

Drop the -P flag since this has no effect if -w is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agogitlab/azure: Drop unnecessary if..fi when using test.py
Simon Glass [Wed, 18 Mar 2020 15:42:54 +0000 (09:42 -0600)]
gitlab/azure: Drop unnecessary if..fi when using test.py

Since TEST_PY_BD is always defined we can drop this check.

This does not affect travis since it has a single, unified script.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Drop the buildman -d flag
Simon Glass [Wed, 18 Mar 2020 15:42:53 +0000 (09:42 -0600)]
travis/gitlab/azure: Drop the buildman -d flag

This has no effect since -S is not given also. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Drop BUILDMAN variable with test.py
Simon Glass [Wed, 18 Mar 2020 15:42:52 +0000 (09:42 -0600)]
travis/gitlab/azure: Drop BUILDMAN variable with test.py

This is not needed in the test.py part of the config, now since we use the
same name as the pytests.

Drop BUILDMAN, retaining it only for the 'build' parts of the config, i.e.
where we build multiple boards and don't run any tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis/gitlab/azure: Use --board buildman flag with test.py
Simon Glass [Wed, 18 Mar 2020 15:42:51 +0000 (09:42 -0600)]
travis/gitlab/azure: Use --board buildman flag with test.py

The current method of selecting the board to build with test.py is a bit
error-prone, e.g. with "^sandbox$" it actually builds 5 boards (all of
those in the sandbox architecture).

Use the (newish) --board flag instead, to get the same result.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agogitlab/azure: Use the -w option for sandbox_spl
Simon Glass [Wed, 18 Mar 2020 15:42:50 +0000 (09:42 -0600)]
gitlab/azure: Use the -w option for sandbox_spl

Avoid needing to know about the internal .bm-work directory, by passing
the -w flag to buildman.

This does not affect travis since the previous commit already used the -w
flag.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis: Split the building into two parts
Simon Glass [Wed, 18 Mar 2020 15:42:49 +0000 (09:42 -0600)]
travis: Split the building into two parts

Buildman is used in two ways:

- to build a selection of boards (with no testing)
- to build a single board (and run pytest)

The gitlab and azure scrips do this in separate places, but travis does
not. To aid the refactoring process and keep the following patches in sync
across all three environments, split the code out in travis as well.

Use the buildman -w option for the single board. It is easier to
understand since it specifies the output directory directly. Also it
avoids needing to look at the internal .bm-work directory.

This initially creates some duplicate code, but by the end of the series
we have two completely different build paths with different arguments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotravis: Don't copy files into .bm-work/
Simon Glass [Wed, 18 Mar 2020 15:42:48 +0000 (09:42 -0600)]
travis: Don't copy files into .bm-work/

At present if TEST_PY_BD is empty the script copies various files into a
directory, to no purpose. This happens because UBOOT_TRAVIS_BUILD_DIR is
set before TEST_PY_BD is tested.

Move the 'if' to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agobuildman: Drop the -a option
Simon Glass [Wed, 18 Mar 2020 15:42:47 +0000 (09:42 -0600)]
buildman: Drop the -a option

There is no point in setting the ARCH environment variable since the
U-Boot build system no-longer uses it.

It seems safe to drop this feature since it was only recently added.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agobuildman: Allow building within a subdir of the current dir
Simon Glass [Wed, 18 Mar 2020 15:42:46 +0000 (09:42 -0600)]
buildman: Allow building within a subdir of the current dir

This is useful in some situations, in particular with -w and when building
in-tree. Now that we are more careful about what we remove in
_PrepareOutputSpace(), it should be safe to relax this restriction.

Update the progress information also so it is clear what buildman is
doing. Remove files can take a long time.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobuildman: Be more selective about which directories to remove
Simon Glass [Wed, 18 Mar 2020 15:42:45 +0000 (09:42 -0600)]
buildman: Be more selective about which directories to remove

At present buildman removes any directory it doesn't intend to write
output into. This is overly expansive since if the output directory
happens to be somewhere with existing files, they may be removed. Using
an existing directory for buildman is not a good practice, but since the
result might be catastrophic, it is best to guard against it.

A previous commit[1] fixed this by refusing to write to a subdirectory
of the current directory, assumed to have U-Boot source code. But we can
do better by only removing directories that look like the ones buildman
creates.

Update the code to do this and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
[1] 409fc029c40 tools: buildman: Don't use the working dir as build dir

4 years agobuildman: Allow ignoring warnings in the return code
Simon Glass [Wed, 18 Mar 2020 15:42:44 +0000 (09:42 -0600)]
buildman: Allow ignoring warnings in the return code

Sometimes we don't want buildman to return failure if it seems warnings.
Add a -W option to support this. If buildman detects warnings (and no
errors) it will return an exit code of 0 (success).

Note that the definition of 'warnings' includes the migration warnings
produced by U-Boot, such as:

    ===================== WARNING ======================
    This board does not use CONFIG_DM_MMC. Please update
    ...
    ====================================================

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agobuildman: Update help for -d
Simon Glass [Wed, 18 Mar 2020 15:42:43 +0000 (09:42 -0600)]
buildman: Update help for -d

This help is a bit ambiguous. It only does anything if asked to show size
changes with -S. Update the help and the function comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobulidman: Add support for a simple build
Simon Glass [Wed, 18 Mar 2020 15:42:42 +0000 (09:42 -0600)]
bulidman: Add support for a simple build

It is useful to run a simple build and put all the output in a single
directory. Add a -w option to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobuildman: Document the members of BuilderJob
Simon Glass [Wed, 18 Mar 2020 15:42:41 +0000 (09:42 -0600)]
buildman: Document the members of BuilderJob

This class has a few more members now. Add documentation for them and fix
a nit in the 'commits' comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomain: Drop show_boot_progress() prototype
Simon Glass [Wed, 18 Mar 2020 15:42:40 +0000 (09:42 -0600)]
main: Drop show_boot_progress() prototype

This is defined in bootstage.h and is not called in this file anyway. Drop
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agosandbox: Add documentation about required/useful packages
Simon Glass [Wed, 18 Mar 2020 15:42:39 +0000 (09:42 -0600)]
sandbox: Add documentation about required/useful packages

Quite a few packages are used by sandbox or tools. Add a list of these to
help people setting up for the first time.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMerge branch '2020-04-10-gitlab-travis-gcc9' into next
Tom Rini [Fri, 10 Apr 2020 22:28:20 +0000 (18:28 -0400)]
Merge branch '2020-04-10-gitlab-travis-gcc9' into next

- Switch over to using GCC-9.2.0 in our Azure, GitLab and Travis-CI
  instances

4 years agotravis: Switch to gcc 9.2.0
Bin Meng [Mon, 6 Apr 2020 13:07:00 +0000 (06:07 -0700)]
travis: Switch to gcc 9.2.0

Use gcc 9.2.0 to do the build testing.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agobuildman: Support fetching gcc 9.2.0
Bin Meng [Mon, 6 Apr 2020 13:06:59 +0000 (06:06 -0700)]
buildman: Support fetching gcc 9.2.0

This adds support to fetch gcc 9.2.0 toolchains.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agovideo: sunxi: Change sunxi_get_mon_desc() to not return NULL for the default case
Bin Meng [Mon, 6 Apr 2020 13:06:58 +0000 (06:06 -0700)]
video: sunxi: Change sunxi_get_mon_desc() to not return NULL for the default case

When building with gcc 9.2.0, the following build warning was seen:

  drivers/video/sunxi/sunxi_display.c: In function 'video_hw_init':
  drivers/video/sunxi/sunxi_display.c:1217:2:
    error: '%s' directive argument is null [-Werror=format-overflow=]

Change sunxi_get_mon_desc() to not return NULL for the default case,
to fix the compiler warning.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoazure/gitlab/travis: Add RISC-V SPL testing
Bin Meng [Sat, 28 Mar 2020 14:25:29 +0000 (07:25 -0700)]
azure/gitlab/travis: Add RISC-V SPL testing

This adds QEMU RISC-V 32/64 SPL testing. Unlike QEMU RISC-V 32/64,
we test SPL running in M-mode and U-Boot proper running in S-mode,
with a 4-core SMP configuration.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotest/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memory
Bin Meng [Sat, 28 Mar 2020 14:25:28 +0000 (07:25 -0700)]
test/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memory

On some RISC-V targets the low memory is protected that prevents
S-mode U-Boot from access.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoazure/gitlab/travis: Add qemu-riscv32 testing
Bin Meng [Sat, 28 Mar 2020 14:25:27 +0000 (07:25 -0700)]
azure/gitlab/travis: Add qemu-riscv32 testing

This adds the qemu-riscv32_defconfig test configuration.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotravis: Build GRUB image for RISC-V 32-bit and 64-bit
Bin Meng [Sat, 28 Mar 2020 14:25:26 +0000 (07:25 -0700)]
travis: Build GRUB image for RISC-V 32-bit and 64-bit

This adds the GRUB image build for RISC-V 32-bit and 64-bit.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotravis: Replace pre-built ARM/ARM64 GRUB images with the one built from source
Bin Meng [Sat, 28 Mar 2020 14:25:25 +0000 (07:25 -0700)]
travis: Replace pre-built ARM/ARM64 GRUB images with the one built from source

As of today travis uses the pre-built GRUB ARM/ARM64 images from
opensuse. But azure/gitlab are using images built from GRUB 2.04
source. This updates travis to build GRUB ARM/ARM64 UEFI targets
from source, to keep in sync with azure/gitlab.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoAzure/GitLab: Move to latest Docker images
Tom Rini [Fri, 10 Apr 2020 19:53:01 +0000 (15:53 -0400)]
Azure/GitLab: Move to latest Docker images

- Based on newer 'bionic' snapshot
- GCC 9.0
- RISCV GRUB binaries

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'dm-pull9apr20' of git://git.denx.de/u-boot-dm
Tom Rini [Fri, 10 Apr 2020 15:40:28 +0000 (11:40 -0400)]
Merge tag 'dm-pull9apr20' of git://git.denx.de/u-boot-dm

Fixes segfault in 'dm drivers' command

4 years agokconfig / kbuild: Re-sync with Linux 4.19
Tom Rini [Fri, 27 Mar 2020 15:46:27 +0000 (11:46 -0400)]
kconfig / kbuild: Re-sync with Linux 4.19

Align Kconfig and Kbuild logic to Linux 4.19 release with minimal impact
on files outside of this scope.

Our previous Kconfig sync was done by commit 5972ff077e0f ("kconfig /
kbuild: re-sync with Linux 4.18").

In this particular re-sync in order to keep clang support working a
number of related changes needed to be pulled in that had been missed
previously.  Not all of these changes we easily traceable and so have
been omitted from the list below.

The imported Linux commits are:
[From prior to v4.18]
9f3f1fd29976 kbuild: Add __cc-option macro
d7f14c66c273 kbuild: Enable Large File Support for hostprogs
6d79a7b424a5 kbuild: suppress warnings from 'getconf LFS_*'
24403874316a Shared library support
86a9df597cdd kbuild: fix linker feature test macros when cross compiling with Clang
0294e6f4a000 kbuild: simplify ld-option implementation

[From v4.18 to v4.19]
96f14fe738b6 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS
10844aebf448 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS
b90a368000ab kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS
8377bd2b9ee1 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS
f92d19e0ef9b kbuild: Use HOST*FLAGS options from the command line
4ab3b80159d4 kconfig: check for pkg-config on make {menu,n,g,x}config
693359f7ac90 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
f60b992e30ff kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
2fb9279f2c3e kbuild: change ld_flags to contain LDFLAGS_$(@F)
c931d34ea085 arm64: build with baremetal linker target instead of Linux when available
5accd7f3360e kconfig: handle format string before calling conf_message_callback()
a2ff4040151a kconfig: rename file_write_dep and move it to confdata.c
0608182ad542 kconfig: split out useful helpers in confdata.c
adc18acf42a1 kconfig: remove unneeded directory generation from local*config
79123b1389cc kconfig: create directories needed for syncconfig by itself
16952b77d8b5 kconfig: make syncconfig update .config regardless of sym_change_count
d6c6ab93e17f kbuild: remove deprecated host-progs variable
56869d45e364 kconfig: fix the rule of mainmenu_stmt symbol
c151272d1687 kconfig: remove unused sym_get_env_prop() function
1880861226c1 kconfig: remove P_ENV property type
e3fd9b5384f3 scripts/dtc: consolidate include path options in Makefile
4bf6a9af0e91 kconfig: add build-only configurator targets
f1575595d156 kconfig: error out when seeing recursive dependency
5e8c5299d315 kconfig: report recursive dependency involving 'imply'
f498926c47aa kconfig: improve the recursive dependency report
98a4afbfafd2 kconfig: fix "Can't open ..." in parallel build
9a9ddcf47831 kconfig: suppress "configuration written to .config" for syncconfig
87a32e624037 kbuild: pass LDFLAGS to recordmcount.pl
d503ac531a52 kbuild: rename LDFLAGS to KBUILD_LDFLAGS
217c3e019675 disable stringop truncation warnings for now
bc8d2e20a3eb kconfig: remove a spurious self-assignment
fd65465b7016 kconfig: do not require pkg-config on make {menu,n}config
5a4630aadb9a ftrace: Build with CPPFLAGS to get -Qunused-arguments

Note that this adds new cleanup work to do in that we should adapt the
shared library support we have to what is now upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agoRevert "mpc85xx: ddr: Always start DDR RAM in Self Refresh mode"
Biwen Li [Thu, 9 Apr 2020 12:44:48 +0000 (20:44 +0800)]
Revert "mpc85xx: ddr: Always start DDR RAM in Self Refresh mode"

This reverts commit 2a5d5d27edfbdb0e02a7fcf05569f92c02ae44ee.
The commit breaks uboot boot (hang in ddr init)
on many PowerPC boards like P3041DS, P4080DS

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoMerge tag 'mips-fixes-for-2020.04' of git://git.denx.de/u-boot-mips
Tom Rini [Thu, 9 Apr 2020 23:23:48 +0000 (19:23 -0400)]
Merge tag 'mips-fixes-for-2020.04' of git://git.denx.de/u-boot-mips

- doc: fix code examples in qemu-mips.rst
- mips: vcoreiii: fix memtest and cache coherency issues
- cmd/go: fix cache coherency issues on MIPS

4 years agodm: dump.c: Refactor dm_dump_drivers prints
Ovidiu Panait [Sun, 5 Apr 2020 16:47:41 +0000 (19:47 +0300)]
dm: dump.c: Refactor dm_dump_drivers prints

Refactor the printing sequence in dm_dump_drivers to make it more clear.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: dump.c: Fix segfault when entry->of_match is NULL
Ovidiu Panait [Sun, 5 Apr 2020 16:47:40 +0000 (19:47 +0300)]
dm: dump.c: Fix segfault when entry->of_match is NULL

Currently, dm drivers command produces a segfault:
=> dm drivers
Driver                Compatible
--------------------------------
Segmentation fault (core dumped)

This is caused by a NULL pointer dereference of entry->of_match.
Add a check to prevent this.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
4 years agousb: Keep async schedule running only across mass storage xfers
Marek Vasut [Mon, 6 Apr 2020 12:29:44 +0000 (14:29 +0200)]
usb: Keep async schedule running only across mass storage xfers

Rather than keeping the asynchronous schedule running always, keep it
running only across USB mass storage transfers for now, as it seems
that keeping it running all the time interferes with certain control
transfers during device enumeration.

Note that running the async schedule all the time should not be an
issue, especially on EHCI HCD, as that one implements most of the
transfers using async schedule.

Note that we have usb_disable_asynch(), which however is utterly broken.
The usb_disable_asynch() blocks the USB core from doing async transfers
by setting a global flag. The async schedule should however be disabled
per USB controller. Moreover, setting a global flag does not prevent the
controller from using the async schedule, which e.g. the EHCI HCD does.

This patch implements additional callback to the controller, which
permits it to lock the async schedule and keep it running across
multiple transfers. Once the schedule is unlocked, it must also be
disabled. This thus prevents the async schedule from running outside
of the USB mass storage transfers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Tested-by: Tom Rini <trini@konsulko.com> [omap3_beagle, previously failing]
4 years agoimx: Fix imx8m FIT script issue
Ye Li [Thu, 9 Apr 2020 08:44:43 +0000 (01:44 -0700)]
imx: Fix imx8m FIT script issue

The FIT config node has reversed ATF and u-boot: ATF is set to 'firmware' but
u-boot is set to 'loadables'.
This script can work previously because spl fit driver wrongly appends fdt to
all loadable images. With the issue fixed in commit 9d15d1d1c24f ("Revert
"common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled"") the
u-boot in 'loadables' does not have fdt appended and fails to work.  So correct
the script by moving u-boot to 'firmware' and ATF to 'loadables'.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reported-by: Matt Porter <mporter@konsulko.com>
Tested-by: Matt Porter <mporter@konsulko.com>
4 years agomips: cmd: go: Flush cache before jumping to app/image
Stefan Roese [Thu, 13 Feb 2020 06:04:00 +0000 (07:04 +0100)]
mips: cmd: go: Flush cache before jumping to app/image

It has been noticed on MT7628/88 platforms, that booting the RAM image
does not work reliably. Sometimes it works and sometimes not. Debugging
showed that this "might" be a cache related issue as very strange
errors occurred (e.g. output corrupted etc).

This patch adds a cache flush for the complete SDRAM area to the go cmd
before jumping to the entry point for the MIPS architecture. The
complete area is flushed as we don't know at this point, how big the
area of the "application" really is.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Mauro Condarelli <mc5686@mclink.it>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Mauro Condarelli <mc5686@mclink.it>
Cc: Weijie Gao <weijie.gao@mediatek.com>
4 years agomips: vcoreiii: Fix cache coherency issues
Lars Povlsen [Thu, 6 Feb 2020 09:45:40 +0000 (10:45 +0100)]
mips: vcoreiii: Fix cache coherency issues

This patch fixes an stability issue seen on some vcoreiii targets,
which was root caused to a cache inconsistency situation.

The inconsistency was caused by having kuseg pointing to NOR area but
used as a stack/gd/heap area during initialization, while only
relatively late remapping the RAM area into kuseg position.

The fix is to initialize the DDR right after the TLB setup, and then
remapping it into position before gd/stack/heap usage.

Reported-by: Ramin Seyed-Moussavi <ramin.moussavi@yacoub.de>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
4 years agomips: vcoreiii: Ajust CONFIG_SYS_MEMTEST_END
Lars Povlsen [Thu, 6 Feb 2020 09:43:18 +0000 (10:43 +0100)]
mips: vcoreiii: Ajust CONFIG_SYS_MEMTEST_END

This patch ajust CONFIG_SYS_MEMTEST_END for vcoreiii-based systems to
avoid overwriting the relocated u-boot. The former setting was too
agressive with networking etc. enabled on some platforms.

Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
4 years agodoc: board: qemu-mips.rst: fix code examples
Heinrich Schuchardt [Wed, 1 Jan 2020 07:34:03 +0000 (08:34 +0100)]
doc: board: qemu-mips.rst: fix code examples

Code sections should be syntax highlighted as bash.
Comment lines in code should start with a hash sign ('#') but code lines
should not.
Most commands can be executed as normal users. Prepend those commands
requiring elevated authorization with 'sudo'.
dd does not have a parameter cout.
sfdisk does not have a -C parameter on Debian Buster.
Provide the necessary input to sfdisk.
Creating a partition of length zero makes no sense.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMIPS: allow override of get_tbclk()
Alex Nemirovsky [Mon, 23 Dec 2019 20:53:56 +0000 (20:53 +0000)]
MIPS: allow override of get_tbclk()

Allow SoC or board layers with reconfigurable cpu clocks
capabilties to do implementation specific lookups and service
get_tbclk() requests.

Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
4 years agoMIPS: allow override of flush_dcache_range()
Alex Nemirovsky [Mon, 23 Dec 2019 20:19:20 +0000 (20:19 +0000)]
MIPS: allow override of flush_dcache_range()

Useful in custom HW designs which have a need to flush dcache
range in a completely non standard way.

Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
4 years agocmd: Add test and fix bugs for dm drivers
Sean Anderson [Mon, 6 Apr 2020 14:23:09 +0000 (10:23 -0400)]
cmd: Add test and fix bugs for dm drivers

Add a test for the dm drivers command. Also fix a null pointer dereference
revealed by said test.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge tag 'u-boot-imx-20200408' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Wed, 8 Apr 2020 16:06:39 +0000 (12:06 -0400)]
Merge tag 'u-boot-imx-20200408' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2020.04
-----------------

- mx7dsabre: Fix ramdisk_addr* for distro boot
- Toradex boards

Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/671988124

4 years agoMerge tag 'u-boot-amlogic-20200406' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 8 Apr 2020 12:48:31 +0000 (08:48 -0400)]
Merge tag 'u-boot-amlogic-20200406' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic into next

- clk: meson-g12a: missing break
- sync all Amlogic DT from Linux v5.6-rc2
- MMC clock fixups
- add support for Libre Computer AML-S905D-PC and AML-S912-PC

4 years agoMerge tag 'xilinx-for-v2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 7 Apr 2020 15:58:44 +0000 (11:58 -0400)]
Merge tag 'xilinx-for-v2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2020.07

common:
- Align ENV_FAT_INTERFACE
- Fix MAC address source print log
- Improve based autodetection code

xilinx:
- Enable netconsole

Microblaze:
- Setup default ENV_OFFSET/ENV_SECT_SIZE

Zynq:
- Multiple DT updates/fixes
- Use DEVICE_TREE environment variable for DTB selection
- Switch to single zynq configuration
- Enable NOR flash via DM
- Minor SPL print removal
- Enable i2c mux driver

ZynqMP:
- Print multiboot register
- Enable cache commands in mini mtest
- Multiple DT updates/fixes
- Fix firmware probing when driver is not enabled
- Specify 3rd backup RAM boot mode in SPL
- Add SPL support for zcu102 v1.1 and zcu111 revA
- Redesign debug uart enabling and psu_init delay
- Enable full u-boot run from EL3
- Enable u-boot.itb generation without ATF with U-Boot in EL3

Versal:
- Enable distro default
- Enable others SPI flashes
- Enable systems without DDR

Drivers:
- Gem:
  - Flush memory after freeing
  - Handle mdio bus separately
- Watchdog:
  - Get rid of unused global data pointer
  - Enable window watchdog timer
- Serial:
  - Change reinitialization logic in zynq serial driver

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agomx7dsabre: Fix ramdisk_addr* for distro boot
Jan Kiszka [Mon, 16 Mar 2020 11:50:09 +0000 (12:50 +0100)]
mx7dsabre: Fix ramdisk_addr* for distro boot

Overlapped with fdt_addr*, thus corrupted the latter when using both.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
4 years agoARM: dts: imx8qxp-colibri: dm-pre-proper for pd_dma nodes
Igor Opaniuk [Fri, 27 Mar 2020 10:28:16 +0000 (12:28 +0200)]
ARM: dts: imx8qxp-colibri: dm-pre-proper for pd_dma nodes

pd_dma_* nodes should be accessible during pre-relocation stage of
U-Boot proper for properly handling power domains.

This fixes the issue with permanent failing of invocation of
power_domain_get_by_index() in the common code of DM power domain
uclass (drivers/power/domain/power-domain-uclass.c).

Fixes: f0cc4eae9a ("core: device: use dev_power_domain_on")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoARM: dts: imx8qm-apalis: dm-pre-proper for pd_dma nodes
Igor Opaniuk [Fri, 27 Mar 2020 10:28:15 +0000 (12:28 +0200)]
ARM: dts: imx8qm-apalis: dm-pre-proper for pd_dma nodes

pd_dma_* nodes should be accessible during pre-relocation stage of
U-Boot proper for properly handling power domains.

This fixes the issue with permanent failing of invocation of
power_domain_get_by_index() in the common code of DM power domain
uclass (drivers/power/domain/power-domain-uclass.c).

Fixes: f0cc4eae9a ("core: device: use dev_power_domain_on")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoARM: dts: imx8qxp-colibri: replace dm-spl with dm-pre-proper
Igor Opaniuk [Fri, 27 Mar 2020 10:28:14 +0000 (12:28 +0200)]
ARM: dts: imx8qxp-colibri: replace dm-spl with dm-pre-proper

For non-SPL/TPL setups dm-spl, dm-tpl, dm-pre-proper, dm-pre-reloc are
handled equally, forcing the nodes with these properties
to be accessible and device being probed
before pre-relocation of U-Boot proper (drivers/core/util.c):

bool ofnode_pre_reloc(ofnode node)
{
    /* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
     * had property dm-pre-reloc or u-boot,dm-spl/tpl.
     * They are removed in final dtb (fdtgrep 2nd pass)
     */
    return true;
    if (ofnode_read_bool(node, "u-boot,dm-pre-reloc"))
        return true;
    if (ofnode_read_bool(node, "u-boot,dm-pre-proper"))
        return true;

    /*
     * In regular builds individual spl and tpl handling both
     * count as handled pre-relocation for later second init.
     */
    if (ofnode_read_bool(node, "u-boot,dm-spl") ||
        ofnode_read_bool(node, "u-boot,dm-tpl"))
        return true;

    return false;
}

Howewer, to avoid confusion in future, replace dm-spl
`%s/dm-spl/dm-pre-proper/g` properties to dm-pre-proper
to explicitly state that they are handled during pre-relocation
stage of U-Boot proper.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoARM: dts: imx8qm-apalis: replace dm-spl with dm-pre-proper
Igor Opaniuk [Fri, 27 Mar 2020 10:28:13 +0000 (12:28 +0200)]
ARM: dts: imx8qm-apalis: replace dm-spl with dm-pre-proper

For non-SPL/TPL setups dm-spl, dm-tpl, dm-pre-proper, dm-pre-reloc are
handled equally, forcing the nodes with these properties
to be accessible and device being probed
before pre-relocation of U-Boot proper (drivers/core/util.c):

bool ofnode_pre_reloc(ofnode node)
{
    /* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
     * had property dm-pre-reloc or u-boot,dm-spl/tpl.
     * They are removed in final dtb (fdtgrep 2nd pass)
     */
    return true;
    if (ofnode_read_bool(node, "u-boot,dm-pre-reloc"))
        return true;
    if (ofnode_read_bool(node, "u-boot,dm-pre-proper"))
        return true;

    /*
     * In regular builds individual spl and tpl handling both
     * count as handled pre-relocation for later second init.
     */
    if (ofnode_read_bool(node, "u-boot,dm-spl") ||
        ofnode_read_bool(node, "u-boot,dm-tpl"))
        return true;

    return false;
}

Howewer, to avoid confusion in future, replace dm-spl
`%s/dm-spl/dm-pre-proper/g` properties to dm-pre-proper
to explicitly state that they are handled during pre-relocation
stage of U-Boot proper.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agocolibri_imx6: set gpr1 ENET_CLK_SEL
Igor Opaniuk [Fri, 27 Mar 2020 10:28:17 +0000 (12:28 +0200)]
colibri_imx6: set gpr1 ENET_CLK_SEL

This fixes the issue when PHY auto negotiation never completes.

Fixes: 431cd76dd8("colibri_imx6: migrate to DM_ETH")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoPrepare v2020.04-rc5 v2020.04-rc5
Tom Rini [Mon, 6 Apr 2020 21:44:14 +0000 (17:44 -0400)]
Prepare v2020.04-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoserial: zynq: Change uart initialization logic
Michal Simek [Tue, 24 Mar 2020 10:31:42 +0000 (11:31 +0100)]
serial: zynq: Change uart initialization logic

The commit a673025535ae ("serial: zynq: Initialize uart only before
relocation") introduced code which detects relocation which is working for
single uart instance. With multiple instances in place there is a need to
enable and setup every instance. That's why detect if TX is enabled. If it
is then don't initialize uart again.
In post probe setbrg is called to setup baudrate but values should be the
same.

As a side effect of this change is that DECLARE_GLOBAL_DATA_PTR can be
removed completely.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agowatchdog: versal: Add support for Xilinx window watchdog
Ashok Reddy Soma [Wed, 11 Mar 2020 09:06:04 +0000 (03:06 -0600)]
watchdog: versal: Add support for Xilinx window watchdog

Add support for Xilinx window watchdog, which can be found on
Versal platforms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm64: xilinx: Never touch DDR if system has no DDR
Michal Simek [Thu, 19 Mar 2020 09:23:56 +0000 (10:23 +0100)]
arm64: xilinx: Never touch DDR if system has no DDR

If DDR is not mapped do not touch it. Default
XILINX_OF_BOARD_DTB_ADDR is pointing to DDR.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: versal: Disable DDR cache mapping if DDR is not enabled
Michal Simek [Wed, 18 Mar 2020 12:45:21 +0000 (13:45 +0100)]
arm64: versal: Disable DDR cache mapping if DDR is not enabled

Similar change was done in past by commit 3b644a3c2f69
("arm64: zynqmp: Provide a config to not map DDR region in MMU table").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add support for u-boot.itb generation without ATF
Michal Simek [Mon, 23 Mar 2020 13:40:52 +0000 (14:40 +0100)]
arm64: zynqmp: Add support for u-boot.itb generation without ATF

If ATF doesn't exist generate u-boot.itb without it and let U-Boot run in
EL3. Still keep warning to let user know that ATF/BL31 is missing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Reorder parameters for zynqmp_mmio_write()
Michal Simek [Mon, 23 Mar 2020 13:02:01 +0000 (14:02 +0100)]
arm64: zynqmp: Reorder parameters for zynqmp_mmio_write()

Parameter order is not correct based on zynqmp_mmio_write() declaration.

Fixes: be52372ff1bb ("arm64: zynqmp: Use zynqmp_mmio_read/write functions")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agofirmware: zynqmp: Enable IPI code calling also in EL3
Michal Simek [Mon, 23 Mar 2020 13:42:34 +0000 (14:42 +0100)]
firmware: zynqmp: Enable IPI code calling also in EL3

U-Boot proper can still run in EL3 without using firmware interface wired
via ATF. For supporting this use case there is a need to check EL level
where U-Boot runs and based on that choose the way how to talk to firmware.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Move timeout for clock propagation below psu_init
Michal Simek [Fri, 20 Mar 2020 07:59:02 +0000 (08:59 +0100)]
arm64: zynqmp: Move timeout for clock propagation below psu_init

Delay required for clock propagation is tighly coupled with initialization
done in psu_init(). That's why call it also for u-boot proper with
CONFIG_ZYNQMP_PSU_INIT_ENABLED enabled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add support for debug uart also for U-Boot proper
Michal Simek [Tue, 7 Jan 2020 08:02:52 +0000 (09:02 +0100)]
arm64: zynqmp: Add support for debug uart also for U-Boot proper

board_early_init_f() is the right location where debug uart can be
configurated (after MIO initialization).
The patch is taking this call from SPL to also make it available for U-Boot
proper.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agolib: Improve _parse_integer_fixup_radix base 16 detection
Michal Simek [Fri, 7 Feb 2020 12:04:10 +0000 (13:04 +0100)]
lib: Improve _parse_integer_fixup_radix base 16 detection

Base autodetection is failing for this case:
if test 257 -gt 3ae; then echo first; else echo second; fi

It is because base for 3ae is recognized by _parse_integer_fixup_radix() as
10. The code detects the first char which is not between 'a'/'A' or 'f'/'F'
to change base from dec to hex.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Shiril Tichkule <shirilt@xlinx.com>
4 years agoarm64: zynqmp: Enable netconsole for ZynqMP
Michal Simek [Wed, 18 Mar 2020 08:19:02 +0000 (09:19 +0100)]
arm64: zynqmp: Enable netconsole for ZynqMP

It is nice feature

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp Add support for zcu111 revA
Michal Simek [Mon, 16 Mar 2020 11:40:16 +0000 (12:40 +0100)]
arm64: zynqmp Add support for zcu111 revA

Add low level configuration for zcu111 for easier SPL run.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: eth-uclass: Fix message if mac is coming from DT or ROM
Michal Simek [Mon, 16 Mar 2020 10:36:17 +0000 (11:36 +0100)]
net: eth-uclass: Fix message if mac is coming from DT or ROM

When local-mac-address DT property is specified it is reported the same way
as address read from eeprom/ROM. Show properly if mac address is coming
from DT or ROM.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Enable i2c mux support for all boards
Michal Simek [Thu, 5 Mar 2020 07:17:49 +0000 (08:17 +0100)]
ARM: zynq: Enable i2c mux support for all boards

zc702/zc706 have pca9548 i2c muxes that's why enable the driver by default.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp Add support for zcu102 rev1.1
Michal Simek [Thu, 12 Mar 2020 08:03:13 +0000 (09:03 +0100)]
arm64: zynqmp Add support for zcu102 rev1.1

rev1.1 has different DDR sodimm module that's why it requires different DDR
configuration.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add third backup bootmode
Michal Simek [Wed, 11 Mar 2020 14:00:51 +0000 (15:00 +0100)]
arm64: zynqmp: Add third backup bootmode

I found this issue when was running py/test.py on zcu102 which is for me by
default setup to SD boot mode without any way to change boot mode.
Alternative software bootmode selection to JTAG is not working because JTAG
mode is 0 which also reset value for it. That's why saying SPL to take
u-boot.itb from RAM instead of SD in SD boot mode is not possible via
alternative bootmode selection.
That's why setup third boot mode to JTAG(BOOT_DEVICE_RAM) as final
fallback.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agowatchdog: cadence: Remove DECLARE_GLOBAL_DATA_PTR from driver
Michal Simek [Mon, 9 Mar 2020 07:44:43 +0000 (08:44 +0100)]
watchdog: cadence: Remove DECLARE_GLOBAL_DATA_PTR from driver

gd is not used in the driver that's why declaration is not needed at all.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: zynq-gem: Setup and use mdio base separately
Michal Simek [Mon, 30 May 2016 08:43:11 +0000 (10:43 +0200)]
net: zynq-gem: Setup and use mdio base separately

Not all IPs have private MDIO bus and MDIO bus should be shared between
several IPs. In past one patch tried to implement it
(https://lists.denx.de/pipermail/u-boot/2018-February/319285.html)
in pretty raw way but it is not the cleanest solution.
This patch is just taking the part of that solution to be able to handle it
over releases without conflicts.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Do not print message about boot device
Michal Simek [Thu, 5 Mar 2020 10:01:50 +0000 (11:01 +0100)]
ARM: zynq: Do not print message about boot device

This information is shown already that's why there is no reason to print it
again via custom prints.

U-Boot SPL 2020.01-03080-ga6214d033bd0 (Mar 05 2020 - 09:59:05 +0100)
mmc boot
Trying to boot from MMC1

or

U-Boot SPL 2020.01-03080-ga6214d033bd0 (Mar 05 2020 - 10:49:46 +0100)
qspi boot
Trying to boot from SPI

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Check firmware node when driver is enabled
Michal Simek [Wed, 4 Mar 2020 07:48:16 +0000 (08:48 +0100)]
arm64: zynqmp: Check firmware node when driver is enabled

ZynqMP mini configurations works without PMU firmware that's why there is
no reason to enable the driver and check if it was probed properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: versal: Enable support for Gigadevice/ISSI flashes
T Karthik Reddy [Mon, 17 Feb 2020 11:49:40 +0000 (04:49 -0700)]
arm64: versal: Enable support for Gigadevice/ISSI flashes

Enable support for Gigadevice/ISSI flash parts for Versal platform.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoenv: Make mmc as default option for CONFIG_ENV_FAT_INTERFACE
Michal Simek [Tue, 25 Feb 2020 14:50:33 +0000 (15:50 +0100)]
env: Make mmc as default option for CONFIG_ENV_FAT_INTERFACE

All configs are using mmc as default fat interface. That's why make it
default for everybody.
The reason for this patch is to make it default for Xilinx Zynq platform
which is not listed there.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Enable DM for CFI NOR flash
Michal Simek [Tue, 25 Feb 2020 14:29:40 +0000 (15:29 +0100)]
ARM: zynq: Enable DM for CFI NOR flash

With multi defconfig NOR flash information about NOR should be taken from
DT that's why there is no reason to specify address and sizes via fixed
config.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Do not report NOR flash detection failure
Michal Simek [Tue, 25 Feb 2020 13:55:58 +0000 (14:55 +0100)]
ARM: zynq: Do not report NOR flash detection failure

With multi defconfig targeting several board configurations bug report like
below is so verbose.
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
0 Bytes

Do not report that message and simply say "Flash: 0 Bytes" because most of
Zynq boards are using different type of flashes than NOR.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonand: raw: zynq: Do not try to probe driver if nand flash is disabled
Michal Simek [Tue, 25 Feb 2020 13:40:42 +0000 (14:40 +0100)]
nand: raw: zynq: Do not try to probe driver if nand flash is disabled

There is no reason to continue when DT status property indicates that NAND
flash is disabled. But that means that NOR flash should be present that's
why try it find it out.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
4 years agonand: raw: Do not free xnand structure
Michal Simek [Tue, 25 Feb 2020 13:51:48 +0000 (14:51 +0100)]
nand: raw: Do not free xnand structure

xnand structure is private data structure and it is handled by core and
probe shouldn't touch it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
4 years agoARM: zynq: Do not include full zynq-7000.dtsi to cse-nor configuration
Michal Simek [Wed, 26 Feb 2020 10:11:38 +0000 (11:11 +0100)]
ARM: zynq: Do not include full zynq-7000.dtsi to cse-nor configuration

There is no real need to include full DT when only some nodes are enough to
use. It will save some space.

Retested with FSBL for initial SoC setup. SPL didn't work.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: zynq_gem: Add cache flush to zynq_gem_free_pkt
Ashok Reddy Soma [Sun, 23 Feb 2020 15:01:29 +0000 (08:01 -0700)]
net: zynq_gem: Add cache flush to zynq_gem_free_pkt

Add cache flush to zynq_gem_free_pkt. This is necessary
because some net routines would modify this buffer in place.
The cache_invalidate in the zynq_gem_recv function would cause
the modifications to the buffer to overwrite the DMA from the GEM,
if cache coherency is not enabled in the GEM, the next time the
buffer is in use.

Flushing the cache when the buffer is no longer in use by the
net functions ensures that the GEM DMA is going to take place
into a clean buffer.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Switch to single zynq configurations
Michal Simek [Thu, 13 Feb 2020 14:03:29 +0000 (15:03 +0100)]
ARM: zynq: Switch to single zynq configurations

There are a lot of zynq configurations which can be merged together and use
only one for all. The similar change has been done for ZynqMP by commit
be1b6c32d940 ("arm64: zynqmp: Use zynqmp_virt platform")

Build SPL with u-boot.img for zc706 like this.
export DEVICE_TREE=zynq-zc706 && make xilinx_zynq_virt_defconfig && make -j8
u-boot.img is generic for all boards.

Tested on Zybo, zc702, zc706, zc770-xm011-x16, cc108 and microzed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoMakefile: Add environment variable DEVICE_TREE to header
Michal Simek [Tue, 18 Feb 2020 14:03:13 +0000 (15:03 +0100)]
Makefile: Add environment variable DEVICE_TREE to header

Users have option to overwrite default device tree
(CONFIG_DEFAULT_DEVICE_TREE) via environment variable DEVICE_TREE.

Feature has been added long time ago by commit 74de8c9a1672
("dts/Makefile: Build the user specified dts") for a little bit different
reason.

But this variable can be also used for different purpose like choosing
proper configuration from FIT image in SPL.
And this is the functionality I would like to use on Xilinx Zynq devices
that current u-boot.img can be composed in the same way based on OF_LIST
and different configuration is taken based on platform specific SPL.
SPL requires low level ps7_init_gpl configuration that's why different
boards require different SPL with fixed board_fit_config_name_match().

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>