platform/kernel/u-boot.git
4 years agosandbox, test: change hog gpio
Philippe Reynes [Fri, 24 Jul 2020 13:51:53 +0000 (15:51 +0200)]
sandbox, test: change hog gpio

Since commit 9ba84329dc45 ("sandbox, test: add test for GPIO_HOG
function"), the gpio_a 0,1,2 and 3 are used by hog in test.dts.
But 2 leds 'sandbox:red' and 'sandbox:green' are using gpio_a 0
and 1. As hog always request his gpios, the led command on both
led is broken:

=> led sandbox:red
LED 'sandbox:red' not found (err=-16)

The gpio is already requested by hog, so it can't be enabled
for led 'sandbox:red'.

This commit change the gpio used by hog to 10, 11, 12 and 13,
so the led command could be used again with 'sandbox:red' and
'sandbox:green'.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 years agocmd: host: return value of do_host_bind()
Heinrich Schuchardt [Fri, 24 Jul 2020 06:29:55 +0000 (08:29 +0200)]
cmd: host: return value of do_host_bind()

When trying to bind to a non-existent file the following output is
displayed:

=> host bind 0 non_existent
Failed to access host backing file 'non_existent'
exit not allowed from main input shell.

The last line is quite unexpected and due to an incorrect return value.

If do_host_bind() fails, return CMD_RET_FAILURE (= 1).

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodm: Fix build error when OF_CONTROL is not set
Dan Murphy [Thu, 23 Jul 2020 12:01:38 +0000 (07:01 -0500)]
dm: Fix build error when OF_CONTROL is not set

With OF_CONTROL disabled the build fails for
include/dm/read.h:932:10: error: ‘ENOTSUPP’ undeclared (first use in this function)
  932 |  return -ENOTSUPP;

Fixes: 45224e8f2691 ("dm: core: gracefully handle alias seq without of")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
4 years agodtoc: remove compatible string aliases support
Walter Lozano [Thu, 23 Jul 2020 03:22:05 +0000 (00:22 -0300)]
dtoc: remove compatible string aliases support

After latest improvements in dtoc, compatible strings are checked
against driver and driver alias list to get a valid driver name. With
this new feature the list of compatible string aliases seems not
useful any more.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodrivers: avoid using aliases on drivers when OF_PLATDATA is enabled
Walter Lozano [Thu, 23 Jul 2020 03:22:04 +0000 (00:22 -0300)]
drivers: avoid using aliases on drivers when OF_PLATDATA is enabled

After latest improvements on OF_PLATDATA struct names are generated
based on driver name instead of compatible strings. With this in mind,
using aliases in drivers are not longer needed.

This patch removes code that tried to handle these kind of aliases to
improve readability.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodtoc: look for compatible string aliases in driver list
Walter Lozano [Thu, 23 Jul 2020 03:22:03 +0000 (00:22 -0300)]
dtoc: look for compatible string aliases in driver list

Currently dtoc checks if the first compatible string in a dtb node
matches either a driver o driver alias name, without taking into account
any other compatible string in the list. In the case that no driver matches
the first compatible string a warning is printed and the U_BOOT_DEVICE is
not being declared correctly.

This patch adds dtoc's support for try all the compatible strings in the
dtb node, in an effort to find the correct driver.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agofind dtb in android boot image with header version 2 during bootm
chenshuo [Mon, 20 Jul 2020 00:48:15 +0000 (08:48 +0800)]
find dtb in android boot image with header version 2 during bootm

This patch is about bootm process, android boot image and device tree.

Android 10 updates the boot image header to version 2,
which includes a section to store the device tree blob (DTB) image.

include/android_image.h has updated the struct andr_img_hdr,
but not used in bootm process. This patch avoid reporting
"Device tree not found or missing FDT support"
when bootm a correctly constructed android boot image.

Signed-off-by: chenshuo <chenshuo@eswin.com>
4 years agox86: chromebook_samus_tpl: Correct the image layout
Simon Glass [Sun, 19 Jul 2020 19:56:18 +0000 (13:56 -0600)]
x86: chromebook_samus_tpl: Correct the image layout

At present there is not enough space for U-Boot due to the EFI loader.
Correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: chromebook_panther: Correct the image layout
Simon Glass [Sun, 19 Jul 2020 19:56:17 +0000 (13:56 -0600)]
x86: chromebook_panther: Correct the image layout

This board does not have microcode but at present that is not supported
by Kconfig nor the binman image layout. Fix both of these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: chromebook_link64: Correct the image layout
Simon Glass [Sun, 19 Jul 2020 19:56:16 +0000 (13:56 -0600)]
x86: chromebook_link64: Correct the image layout

At present the image layout is not correct, since it uses the SDRAM
address of the 64-bit U-Boot as the ROM address. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: Move the fdtmap away from the binary blobs
Simon Glass [Sun, 19 Jul 2020 19:56:15 +0000 (13:56 -0600)]
x86: Move the fdtmap away from the binary blobs

This causes conflicts on chromebook_link64. Move it to after U-Boot where
there should be plenty of space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agorockchip: Drop the fit_spl_optee.sh script
Simon Glass [Sun, 19 Jul 2020 19:56:14 +0000 (13:56 -0600)]
rockchip: Drop the fit_spl_optee.sh script

Now that all board use binman instead of this script, drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agorockchip: Convert evb-rk3229 over to use binman
Simon Glass [Sun, 19 Jul 2020 19:56:13 +0000 (13:56 -0600)]
rockchip: Convert evb-rk3229 over to use binman

At present this board uses a custom script to produce the .its file.
Update it to use binman instead. Binman can create all the images that
are needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: Convert evb-rk3288 over to use binman
Simon Glass [Sun, 19 Jul 2020 19:56:12 +0000 (13:56 -0600)]
rockchip: Convert evb-rk3288 over to use binman

At present this board uses a custom script to produce the .its file.
Update it to use binman instead. Binman can create all the images that
are needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMakefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Simon Glass [Sun, 19 Jul 2020 19:56:11 +0000 (13:56 -0600)]
Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR

This option is used to run arch-specific shell scripts which produce .its
files which are used to produce FIT images. We already have binman which
is designed to produce firmware images. It is more powerful and has tests.

So this option should be deprecated and not used. Existing uses should be
migrated.

Mentions of this in code reviews over the last year or so do not seem to
have resulted in action, and things are getting worse.

So let's add a warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoMakefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty
Simon Glass [Sun, 19 Jul 2020 19:56:10 +0000 (13:56 -0600)]
Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty

At present we use the empty string to indicate that there is no FIT
generator, but this doesn't allow an individual board to undefine it.
Create a separate bool instead.

Update the config of the boards which currently have an empty string.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMakefile: Fix a long line in cmd_mkfitimage
Simon Glass [Sun, 19 Jul 2020 19:56:09 +0000 (13:56 -0600)]
Makefile: Fix a long line in cmd_mkfitimage

Fix this line which is over the limit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoMakefile: Move CONFIG_TOOLS_DEBUG check to later
Simon Glass [Sun, 19 Jul 2020 19:56:08 +0000 (13:56 -0600)]
Makefile: Move CONFIG_TOOLS_DEBUG check to later

At present this is checked before the config has been loaded by the
Makefile, so it doesn't work.

Move the check to later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agomediatek: Makefile: Drop explicit targets built by binman
Simon Glass [Sun, 19 Jul 2020 19:56:07 +0000 (13:56 -0600)]
mediatek: Makefile: Drop explicit targets built by binman

On mediatek various files that need to be created by binman. It does not
make sense to enumerate these in the Makefile. They are described in the
configuration (devicetree) for each board and we can simply run binman
(always) to generate them.

This avoid sprinkling the Makefile with arch-specific code.

Also update the binman definition so that idbloader.img is only needed
when SPL is actually being used.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotegra: Makefile: Drop explicit targets built by binman
Simon Glass [Sun, 19 Jul 2020 19:56:06 +0000 (13:56 -0600)]
tegra: Makefile: Drop explicit targets built by binman

On tegra various files that need to be created by binman. It does not make
sense to enumerate these in the Makefile. They are described in the
configuration (devicetree) for each board and we can simply run binman
(always) to generate them.

This avoid sprinkling the Makefile with arch-specific code.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agosunxi: Makefile: Drop explicit targets built by binman
Simon Glass [Sun, 19 Jul 2020 19:56:05 +0000 (13:56 -0600)]
sunxi: Makefile: Drop explicit targets built by binman

On sunxi various files that need to be created by binman. It does not make
sense to enumerate these in the Makefile. They are described in the
configuration (devicetree) for each board and we can simply run binman
(always) to generate them.

This avoid sprinkling the Makefile with arch-specific code.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agox86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM
Simon Glass [Sun, 19 Jul 2020 19:56:04 +0000 (13:56 -0600)]
x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM

This Kconfig is not needed anymore since U-Boot will build the ROM if the
required binary blobs exist.

The BUILD_ROM environment variable used to request that the ROM be built.
Now this always happens if the required binary blobs are available. Update
it to mean that U-Boot should fail if the ROM cannot be built. This
behaviour should be compatible with how it used to work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: Makefile: Drop explicit targets built by binman
Simon Glass [Sun, 19 Jul 2020 19:56:03 +0000 (13:56 -0600)]
x86: Makefile: Drop explicit targets built by binman

On x86 various files that need to be created by binman. It does not make
sense to enumerate these in the Makefile. They are described in the
configuration (devicetree) for each board and we can simply run binman
(always) to generate them.

Update the Makefile to have a separate, final step which runs binman,
once all input dependencies are present.

This avoid sprinkling the Makefile with arch-specific code.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopowerpc: mpc85xx: Only enable binman when it is needed
Simon Glass [Sun, 19 Jul 2020 19:56:02 +0000 (13:56 -0600)]
powerpc: mpc85xx: Only enable binman when it is needed

Quite a few boards using this SoC family don't use binman, yet
CONFIG_BINMAN is enabled for all of them. But the option should only be
enabled if we expect binman to produce an image. Calling binman when the
device tree is missing, etc. will cause failer.

Add a condition so that CONFIG_BINMAN is only enabled as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoMakefile: Rename ALL-y to INPUTS-y
Simon Glass [Sun, 19 Jul 2020 19:56:01 +0000 (13:56 -0600)]
Makefile: Rename ALL-y to INPUTS-y

When binman is in use, most of the targets built by the Makefile are
inputs to binman. We then need a final rule to run binman to produce the
final outputs.

Rename the variable to indicate this, and add a new 'inputs' target.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotegra: Don't enable binman on ARMv8 SoCs
Simon Glass [Sun, 19 Jul 2020 19:56:00 +0000 (13:56 -0600)]
tegra: Don't enable binman on ARMv8 SoCs

At present only the ARMv7 tegra SoCs actually use binman to create an
image. Change the config to reflect this, since otherwise running binman
will produce an error.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotegra: Drop the unused non-binman code
Simon Glass [Sun, 19 Jul 2020 19:55:59 +0000 (13:55 -0600)]
tegra: Drop the unused non-binman code

This has been in the Makefile long enough to ensure migration is complete.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: Enable building a SPI ROM image on bob
Simon Glass [Sun, 19 Jul 2020 19:55:58 +0000 (13:55 -0600)]
rockchip: Enable building a SPI ROM image on bob

Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for bob.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: Enable building a SPI ROM image on jerry
Simon Glass [Sun, 19 Jul 2020 19:55:57 +0000 (13:55 -0600)]
rockchip: Enable building a SPI ROM image on jerry

Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot
produces a ROM for jerry.

Change the binman image definition to support multiple images, since it
may be used to build both u-boot-rockchip.bin and u-boot.rom

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: bob: Support SPI-flash booting
Simon Glass [Sun, 19 Jul 2020 19:55:56 +0000 (13:55 -0600)]
rockchip: bob: Support SPI-flash booting

Update the config for chromebook_bob to support booting from SPI flash.
The existing SPL size is too small since ATF is needed, so double it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: jerry: Add serial support
Simon Glass [Sun, 19 Jul 2020 19:55:55 +0000 (13:55 -0600)]
rockchip: jerry: Add serial support

This option allows the serial console to work correctly. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMakefile: Allow building .rom files for non-x86 boards
Simon Glass [Sun, 19 Jul 2020 19:55:54 +0000 (13:55 -0600)]
Makefile: Allow building .rom files for non-x86 boards

Some non-x86 devices can use SPI flash to boot and need to produce images
of a fixed size to program the flash.

Add a way to handle this for non-x86 boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: Allow Bob to use SPI boot
Simon Glass [Sun, 19 Jul 2020 19:55:53 +0000 (13:55 -0600)]
rockchip: Allow Bob to use SPI boot

Bob is a Chromebook and can boot from SPI flash. Add it to the condition
check for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agox86: Change how selection of ROMs works
Simon Glass [Sun, 19 Jul 2020 19:55:52 +0000 (13:55 -0600)]
x86: Change how selection of ROMs works

Most x86 boards build a u-boot.rom which is programmed into SPI flash. But
this is not unique to x86. For example some rockchip boards can also boot
from SPI flash.

Also, at least on x86, binary blobs are sadly quite common. It is not
possible to build a functional image without them, and U-Boot needs to
know this at build time.

Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is
built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary
blobs are also needed. If they are not needed, it is safe to build the ROM
always. Otherwise we still require the BUILD_ROM environment variable.

For now this affects only x86, but future patches will enable this for
rockchip too.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobuildman: Show the build rate at the end
Simon Glass [Sun, 19 Jul 2020 18:40:26 +0000 (12:40 -0600)]
buildman: Show the build rate at the end

It is interesting to note the number of builds completed per second to
track machine performance and build speed. Add a 'rate' value at the end
of the build to show this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobuildman: Correct the testOutputDir() unit test
Simon Glass [Sun, 19 Jul 2020 18:28:11 +0000 (12:28 -0600)]
buildman: Correct the testOutputDir() unit test

This current fails with an error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7664b03ffc5 ("buildman: Remove _of_#_ from results directory paths")

4 years agobuildman: Allow using older versions of genboardscfg.py
Simon Glass [Sun, 19 Jul 2020 15:59:49 +0000 (09:59 -0600)]
buildman: Allow using older versions of genboardscfg.py

Older versions of this script don't support the -q flag. Since buildman
runs this script from when it starts, we may get the old version.

Fix this in two ways:

1. Use the version from the same tree as buildman is run from, if
available
2. Failing that, allow the -q flag to be missing

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agosandbox: enable FIT cipher support in defconfig
Patrick Oppenlander [Fri, 17 Jul 2020 01:12:34 +0000 (11:12 +1000)]
sandbox: enable FIT cipher support in defconfig

Linux distributions generally use the "make defconfig && make tools-all"
recipe to generate a uboot-tools (or similar) package.

This patch enables FIT cipher support in the default mkimage build.

Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
4 years agodtoc: add coverage test for unicode error
Walter Lozano [Tue, 28 Jul 2020 22:06:23 +0000 (19:06 -0300)]
dtoc: add coverage test for unicode error

Add an additional test to dtoc in order improve the coverage,
specifically to take into account the case of unicode error when
scanning drivers.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
4 years agoMerge branch '2020-07-28-Kconfig-migrations'
Tom Rini [Tue, 28 Jul 2020 22:27:34 +0000 (18:27 -0400)]
Merge branch '2020-07-28-Kconfig-migrations'

- Migration of more symbols to Kconfig

4 years agoconfigs: migrate CONFIG_SPL_LOAD_FIT_ADDRESS to defconfigs
Peng Fan [Mon, 6 Jul 2020 07:35:01 +0000 (15:35 +0800)]
configs: migrate CONFIG_SPL_LOAD_FIT_ADDRESS to defconfigs

Done with:
./tools/moveconfig.py -S SPL_LOAD_FIT_ADDRESS
./tools/moveconfig.py -S SPL_LOAD_FIT_ADDRESS -H

Signed-off-by: Peng Fan <peng.fan@nxp.com>
[trini: A few more migrations]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoKconfig: add SPL_LOAD_FIT_ADDRESS
Peng Fan [Mon, 6 Jul 2020 07:35:00 +0000 (15:35 +0800)]
Kconfig: add SPL_LOAD_FIT_ADDRESS

Add SPL_LOAD_FIT_ADDRESS to make user could add it in defconfig

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoConvert CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to Kconfig
Adam Ford [Fri, 3 Jul 2020 15:17:30 +0000 (10:17 -0500)]
Convert CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MMCSD_FS_BOOT_PARTITION

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoconfigs: Remove dead CONFIG options
Adam Ford [Fri, 3 Jul 2020 14:06:36 +0000 (09:06 -0500)]
configs: Remove dead CONFIG options

BOOTP_DEFAULT is defined in several boards, but this config
option is never checked or used.

This patch removes this config option from config files and
the whitelist.txt

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoConvert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig
Adam Ford [Fri, 3 Jul 2020 14:00:14 +0000 (09:00 -0500)]
Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
   CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoConvert CONFIG_DRIVER_TI_EMAC_USE_RMII to Kconfig
Adam Ford [Fri, 3 Jul 2020 13:27:12 +0000 (08:27 -0500)]
Convert CONFIG_DRIVER_TI_EMAC_USE_RMII to Kconfig

This converts the following to Kconfig:
   CONFIG_DRIVER_TI_EMAC_USE_RMII

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoConvert CONFIG_SPL_NAND_BASE et al to Kconfig
Adam Ford [Fri, 3 Jul 2020 13:09:45 +0000 (08:09 -0500)]
Convert CONFIG_SPL_NAND_BASE et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SPL_NAND_BASE
   CONFIG_SPL_NAND_IDENT

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoConvert CONFIG_SPL_NAND_DRIVERS et al to Kconfig
Adam Ford [Fri, 3 Jul 2020 13:09:44 +0000 (08:09 -0500)]
Convert CONFIG_SPL_NAND_DRIVERS et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SPL_NAND_DRIVERS
   CONFIG_SPL_NAND_ECC
   CONFIG_SPL_NAND_SIMPLE

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoConvert CONFIG_ENV_OVERWRITE to Kconfig
Adam Ford [Fri, 3 Jul 2020 11:48:56 +0000 (06:48 -0500)]
Convert CONFIG_ENV_OVERWRITE to Kconfig

This converts the following to Kconfig:
   CONFIG_ENV_OVERWRITE

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Rerun migration, remove some comments]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoARM: dts: stm32: Add DHSOM based DRC02 board
Marek Vasut [Sat, 25 Jul 2020 14:50:56 +0000 (16:50 +0200)]
ARM: dts: stm32: Add DHSOM based DRC02 board

Add DT for DH DRC02 unit, which is a universal controller device.
The system has two ethernet ports, two CANs, RS485 and RS232, USB,
capacitive buttons and an OLED display.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: Move ethernet PHY into SoM DT
Marek Vasut [Sat, 25 Jul 2020 14:50:55 +0000 (16:50 +0200)]
ARM: dts: stm32: Move ethernet PHY into SoM DT

The PHY and the VIO regulator is populated on the SoM, move it
into the SoM DT.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: add seeed studio odyssey-stm32mp157c board
Marcin Sloniewski [Wed, 8 Jul 2020 17:56:22 +0000 (19:56 +0200)]
ARM: dts: stm32: add seeed studio odyssey-stm32mp157c board

This commit adds device tree files supporting
SBC from Seeed Studio based on STM32MP157C.

This works with generic stm32mp1 config.
Right now only booting from SD card is supported.

Signed-off-by: Marcin Sloniewski <marcin.sloniewski@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoRevert "ARM: dts: stm32: Reinstate card detect behavior on ST boards"
Patrick Delaunay [Tue, 7 Jul 2020 16:47:29 +0000 (18:47 +0200)]
Revert "ARM: dts: stm32: Reinstate card detect behavior on ST boards"

Since commit f13ff88b61c3 ("gpio: stm32: add ops set_dir_flags")
the gpio flags are supported by stm32 pinctrl driver.

The cd-gpios is correctly handle in U-Boot and the patch on the
device tree can be removed.

This reverts commit 792919241b3d750cd5295dfe6dd1d0958b9be468.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoRevert "ARM: dts: stm32: Reinstate card detect behavior on DHSOM"
Patrick Delaunay [Tue, 7 Jul 2020 16:46:08 +0000 (18:46 +0200)]
Revert "ARM: dts: stm32: Reinstate card detect behavior on DHSOM"

Since commit f13ff88b61c3 ("gpio: stm32: add ops set_dir_flags")
the gpio flags are supported by stm32 pinctrl driver.

The cd-gpios is correctly handle in U-Boot and the patch on the
device tree can be removed.

This reverts commit 3c2e2a1a79608c5e046313a8c47586d9a734e2a3.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: use correct weak function name spl_board_prepare_for_linux
Patrick Delaunay [Tue, 7 Jul 2020 12:21:53 +0000 (14:21 +0200)]
arm: stm32mp: use correct weak function name spl_board_prepare_for_linux

Replace the function spl_board_prepare_for_boot_linux by the correct
name of the weak function spl_board_prepare_for_linux defined in spl.h.

This patch avoids warning with W=1 option:

u-boot/arch/arm/mach-stm32mp/spl.c:150:6:
warning: no previous prototype for ‘spl_board_prepare_for_boot_linux’
[-Wmissing-prototypes]

Fixes: dc7e5f190de5 ("arm: stm32mp: activate data cache on DDR in SPL")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32: add reset support to uart nodes on stm32mp15x
Patrick Delaunay [Mon, 6 Jul 2020 12:48:58 +0000 (14:48 +0200)]
ARM: dts: stm32: add reset support to uart nodes on stm32mp15x

STM32 serial IP can be reset via reset controller.
Add the support of reset to uart nodes on stm32mp15-u-boot.dtsi,
the ad-dons file for U-Boot.

This patch fix issues when previous UART configuration, for example
done in TF-A or ROM code, is not handled in U-Boot stm32 serial driver
init.

This reset property won't be not added in Linux kernel device tree
as this reset is not used in Linux STM32 serial driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32mp: remove hnp-srp-disable for usbotg on dk1
Patrick Delaunay [Wed, 1 Jul 2020 11:10:10 +0000 (13:10 +0200)]
ARM: dts: stm32mp: remove hnp-srp-disable for usbotg on dk1

Remove hnp-srp-disable for usbotg node because this feature is only needed
for usbotg in HOST mode (in drivers/usb/host/dwc2.c)
and this feature is not activated in stm32mp15 U-Boot
(stm32mp15_basic_defconfig and stm32mp15_trusted_defconfig);
only the device mode is activated and OTG is not supported in DWC2 driver.

This patch reduces the difference between U-Boot and Linux kernel
device-tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32mp1: DT alignment with Linux kernel v5.8-rc1
Patrick Delaunay [Mon, 6 Jul 2020 11:26:53 +0000 (13:26 +0200)]
ARM: dts: stm32mp1: DT alignment with Linux kernel v5.8-rc1

DT alignment with Linux kernel v5.8-rc1 for the STM32MP15x soc
device tree files and the STMicroelectronics boards device tree files.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: rename stm32mp15xx-avenger96 ethernet0_rgmii_pins
Patrick Delaunay [Mon, 6 Jul 2020 11:26:51 +0000 (13:26 +0200)]
ARM: dts: rename stm32mp15xx-avenger96 ethernet0_rgmii_pins

Alignment with pins name used in Linux kernel v5.8.

It is a preleminary step for device tree alignment.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs: stm32mp15: activate CMD_ADTIMG
Patrick Delaunay [Mon, 6 Jul 2020 13:00:46 +0000 (15:00 +0200)]
configs: stm32mp15: activate CMD_ADTIMG

Activate the support of the command adtimg to handle android images.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agophy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply
Patrick Delaunay [Fri, 3 Jul 2020 17:13:02 +0000 (19:13 +0200)]
phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supply

Use regulator_set_enable_if_allowed() api instead of regulator_set_enable()
while disabling vdd supply. This way the driver doesn't see an error
when disabling an always-on regulator.

This patch is needed since the commit f93fab312615 ("Revert 'power:
regulator: Return success on attempt to disable an always-on regulator'")
and use the API introduced by commit cc4a224af226 ("power: regulator:
Introduce regulator_set_enable_if_allowed api").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: stm32prog: check result of find_mmc_device
Patrick Delaunay [Mon, 6 Jul 2020 11:20:58 +0000 (13:20 +0200)]
arm: stm32mp: stm32prog: check result of find_mmc_device

Check result of find_mmc_device() before calling mmc_init().

This patch avoid a data abort when the command try to acces
to sd/mmc device deactivated in device tree.

Fixes: aff4c5dd8265 ("stm32mp: stm32prog: add MMC device")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: update test on misc_read result in board_late_init
Patrick Delaunay [Fri, 3 Jul 2020 15:45:07 +0000 (17:45 +0200)]
board: update test on misc_read result in board_late_init

Update management of misc_read, which now return length of data
after the commit 8729b1ae2cbd ("misc: Update read() and write()
methods to return bytes xfered")

Fixes: 8b8b3d6b55b9 ("stm32mp1: board: add environment variable for board id and board rev")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: dh_stm32mp1: remove env location override
Jakob Riepler [Mon, 27 Jul 2020 12:18:29 +0000 (14:18 +0200)]
board: dh_stm32mp1: remove env location override

Overriding the environment location is not necessary as the defconfig
for the relevant boards only enable SPI flash and nowhere sources which
are in the same order per default but having this explicit override
prevents using eMMC or SD card (or EXT4) as environment source.

Signed-off-by: Jakob Riepler <jakob.riepler@aviloo.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: use the command env info -q in env_check
Patrick Delaunay [Thu, 2 Jul 2020 16:48:02 +0000 (18:48 +0200)]
stm32mp1: use the command env info -q in env_check

Activate the new option -q in command "env info"
to avoid unnecessary trace during boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs:stm32mp1: activate env config in SPL
Patrick Delaunay [Mon, 15 Jun 2020 09:18:24 +0000 (11:18 +0200)]
configs:stm32mp1: activate env config in SPL

Activate env config in SPL with CONFIG_SPL_ENV_SUPPORT
and use CONFIG_IS_ENABLED macro to test the activated
CONFIG_$(SPL_)ENV_IS_IN_... in env_get_location.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: use a specific SD/eMMC partition for U-Boot enviromnent
Patrick Delaunay [Mon, 15 Jun 2020 09:18:23 +0000 (11:18 +0200)]
stm32mp1: use a specific SD/eMMC partition for U-Boot enviromnent

Save the environment at the end of the U-Boot partition, the GPT
partition named "ssbl" in SD card or eMMC and avoid requirements
on the "bootfs" file system generated via specific raw tools
(like wic and genimage).

With the previous configuration of the U-Boot environment saved in ext4
file, U-Boot need to create/modify the file uenv.txt in the ext4 file
system; so this EXT4 file system need to be generated without some
functionality, like metadata_csum and dir_index, because they are not
supported by U-Boot.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: board: add support of CONFIG_ENV_IS_IN_MMC
Patrick Delaunay [Mon, 15 Jun 2020 09:18:22 +0000 (11:18 +0200)]
stm32mp1: board: add support of CONFIG_ENV_IS_IN_MMC

Add support of CONFIG_ENV_IS_IN_MMC in env_get_location, used for
all mmc device (SD card and eMMC).
The 2 configs CONFIG_ENV_IS_IN_MMC and CONFIG_ENV_IS_IN_EXT4 are
incompatible.

Add the weak function mmc_get_env_dev to select the mmc boot instance.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: mmu_set_region_dcache_behaviour
Patrick Delaunay [Fri, 24 Jul 2020 09:21:51 +0000 (11:21 +0200)]
stm32mp1: mmu_set_region_dcache_behaviour

Since commit d877f8fd0f09 ("arm: provide a function for boards init
code to modify MMU virtual-physical map") the parameter of
mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE
aligned.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: move dbgmcu_init call when DT is ready
Patrick Delaunay [Fri, 24 Jul 2020 09:13:31 +0000 (11:13 +0200)]
arm: stm32mp: move dbgmcu_init call when DT is ready

As the dbgmcu_init use the function bsec_dbgswenable which is based
on the DM and DT, its call can't be done before the spl is initialized
(driver model, DT and malloc) in board_init_f::spl_early_init().

This function call is moved later in spl_board_init().

Fixes: bd3f60d29c24 ("arm: stm32mp: protect DBGMCU_IDC access with BSEC")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoMerge branch '2020-07-28-update-azure-tests'
Tom Rini [Tue, 28 Jul 2020 12:49:42 +0000 (08:49 -0400)]
Merge branch '2020-07-28-update-azure-tests'

- Update Azure to fix some recent issues with Windows host tool builds

4 years agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 28 Jul 2020 12:46:52 +0000 (08:46 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoazure: Switch to use the MSYS2 official installer as the CI base
Bin Meng [Tue, 28 Jul 2020 09:06:44 +0000 (02:06 -0700)]
azure: Switch to use the MSYS2 official installer as the CI base

Recent CI failures were seen [1] when building MSYS2 Windows host
tools. The error messages are something like:

  downloading mingw32.db...
  downloading mingw32.db.sig...
  error: mingw32: key "4A6129F4E4B84AE46ED7F635628F528CF3053E04" is unknown
  error: mingw32: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
  error: failed to update mingw32 (invalid or corrupted database (PGP signature))

Per the MSYS2 official news [2], this was caused by a packager
switch and several solutions were suggested, e.g.: a new package
of msys2-keyring and a new msys2 installer that includes them are
released. However right now we have been using the MSYS2 github
CI base repo [3] for the MSYS2 build in U-Boot, but per the project
information on the github webpage, it says: "This repository is
unused/deprecated and will be remove after 2021-01-01". Since it is
unmaintained it's unlikely the new PGP keys will be included in the
git repo, and the only choice is to switch to use the MSYS2 official
installer as the CI base instead.

[1] https://dev.azure.com/u-boot/u-boot/_build/results?buildId=975
[2] https://www.msys2.org/news/#2020-06-29-new-packagers
[3] https://github.com/msys2/msys2-ci-base

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoazure: Add the missing build dependency for MSYS2 build
Bin Meng [Tue, 28 Jul 2020 09:06:43 +0000 (02:06 -0700)]
azure: Add the missing build dependency for MSYS2 build

Package 'flex' is needed when building the U-Boot host tool, but
is currently missing in the build dependency in the CI pipeline.

This is to prepare switching to an installer based CI build.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoazure: Drop 32-bit MSYS2 build
Bin Meng [Tue, 28 Jul 2020 09:06:42 +0000 (02:06 -0700)]
azure: Drop 32-bit MSYS2 build

As of 2020-05-17, 32-bit MSYS2 is no longer actively supported by
the upstream [1]. Let's drop the 32-bit Windows host tool build.

[1] https://www.msys2.org/news/#2020-05-17-32-bit-msys2-no-longer-actively-supported

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoazure: Use a login shell everywhere for MSYS2 build
Bin Meng [Tue, 28 Jul 2020 09:06:41 +0000 (02:06 -0700)]
azure: Use a login shell everywhere for MSYS2 build

This simplifies things a bit to just use a login shell everywhere.

This keeps in sync with MSYS2 upstream commit:
9d11b7f0aa93 ("azure-pipelines: simplify things a bit").

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoPrepare v2020.10-rc1
Tom Rini [Tue, 28 Jul 2020 02:46:03 +0000 (22:46 -0400)]
Prepare v2020.10-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'u-boot-amlogic-20200727' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 28 Jul 2020 01:40:26 +0000 (21:40 -0400)]
Merge tag 'u-boot-amlogic-20200727' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- Handle errors in Meson serial driver
- Enable HDMI, keyboard and ADC for Odroid-C2

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Mon, 27 Jul 2020 19:18:15 +0000 (15:18 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- Bug fixes and updates on ls2088a,ls1028a, ls1046a, ls1043a, ls1012a
- lx2-watchdog support
- layerscape: pci-endpoint support, spin table relocation fixes and
  cleanups
- fsl-crypto: RNG support and bug fixes

4 years agotravis: Install pyelftools via pip
Tom Rini [Mon, 27 Jul 2020 15:11:27 +0000 (11:11 -0400)]
travis: Install pyelftools via pip

With the migration to python3 for all of our tests, we need to install
pyelftools via pip now rather than the system tools as they will
otherwise not be present in our virtualenv.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2: Switch to pip

4 years agoMerge tag 'dm-pull-20jul20-take2a' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 27 Jul 2020 15:15:37 +0000 (11:15 -0400)]
Merge tag 'dm-pull-20jul20-take2a' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

binman support for FIT
new UCLASS_SOC
patman switch 'test' command
minor fdt fixes
patman usability improvements

4 years agoconfigs: odroid-c2: update for HDMI output, ADC & USB keyboard
Anand Moon [Thu, 23 Jul 2020 08:06:35 +0000 (08:06 +0000)]
configs: odroid-c2: update for HDMI output, ADC & USB keyboard

Enable options to permit HDMI output on Odroid-C2 GXBB boards.
Enable VPU Power Domain.
Enable ADC and USB_KERBOARD.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
4 years agoserial: meson: handle RX errors
Neil Armstrong [Tue, 21 Jul 2020 11:41:14 +0000 (13:41 +0200)]
serial: meson: handle RX errors

This checks and handles RX errors on the Amlogic UART controller
after experiencing errors on the Khadas VIM3 & VIM3L when UART AO A
lines are not connected.

When the RX line is not connected, the first byte is erroneous and breaks
the U-Boot autoboot, breaking automatic boot.

This checks and drops any erroneous RX byte on pending and getc callbacks
to avoid returning true to pending when an error byte is in the FIFO.

Fixes: bfcef28ae4 ("arm: add initial support for Amlogic Meson and ODROID-C2")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 27 Jul 2020 13:41:18 +0000 (09:41 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sh

- R8A774A1 / Beacon EmbeddedWorks RZG2M Dev Kit support

4 years agoMerge branch 'net' of https://gitlab.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 27 Jul 2020 13:40:06 +0000 (09:40 -0400)]
Merge branch 'net' of https://gitlab.denx.de/u-boot/custodians/u-boot-sh

- Convert dc2114x driver to DM.

4 years agoMerge branch '2020-07-27-misc-env-improvements'
Tom Rini [Mon, 27 Jul 2020 13:25:53 +0000 (09:25 -0400)]
Merge branch '2020-07-27-misc-env-improvements'

- Assorted environment fixes.
- Enhance environment in MMC and controlled via OF_CONTROL
- Allow for environment in FAT to use the same device we boot from
  rather than be hard-coded.

4 years agoconfigs: ls2088a: Restore CONFIG_ENV_ADDR to IFC-NOR
Kuldeep Singh [Wed, 22 Jul 2020 09:35:44 +0000 (15:05 +0530)]
configs: ls2088a: Restore CONFIG_ENV_ADDR to IFC-NOR

Restore CONFIG_ENV_ADDR value to fix boot hang with IFC-NOR
which is default boot source.

Signed-off-by: Ashish Kumar <ashish.kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarm: dts: ls1028a: Add dspi flash device node to qds
Zhao Qiang [Tue, 14 Jul 2020 05:53:36 +0000 (13:53 +0800)]
arm: dts: ls1028a: Add dspi flash device node to qds

Add dspi flash device node to fsl-ls1028a-qds.dtsi

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: lx2160a: Enable Watchdog support
Zhao Qiang [Fri, 10 Jul 2020 08:55:20 +0000 (16:55 +0800)]
configs: lx2160a: Enable Watchdog support

Enable support to compile SBSA driver.

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarm64: lx2160a: dts: Add watchdog node
Zhao Qiang [Fri, 10 Jul 2020 08:55:19 +0000 (16:55 +0800)]
arm64: lx2160a: dts: Add watchdog node

Add watchdog node which is sbsa into lx2160a dtsi

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoWatchdog: introduce ARM SBSA watchdog driver
Zhao Qiang [Fri, 10 Jul 2020 08:55:18 +0000 (16:55 +0800)]
Watchdog: introduce ARM SBSA watchdog driver

According to Server Base System Architecture (SBSA) specification,
the SBSA Generic Watchdog has two stage timeouts: the first signal
(WS0) is for alerting the system by interrupt, the second one (WS1) is a
real hardware reset.
More details about the hardware specification of this device:
ARM DEN0029B - Server Base System Architecture (SBSA)

This driver can operate ARM SBSA Generic Watchdog as a single stage
In the single stage mode, when the timeout is reached, your system
will be reset by WS1. The first signal (WS0) is ignored.

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci: layerscape: Add specific config entry for RC and EP mode driver
Hou Zhiqiang [Thu, 9 Jul 2020 15:31:42 +0000 (23:31 +0800)]
pci: layerscape: Add specific config entry for RC and EP mode driver

Add Root Complex and Endpoint mode specific config entries, such that
it's feasible to enable the RC and/or EP mode driver indepently.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci_ep: layerscape: Add the PCIe EP mode support for lx2160a-v2
Xiaowei Bao [Thu, 9 Jul 2020 15:31:41 +0000 (23:31 +0800)]
pci_ep: layerscape: Add the PCIe EP mode support for lx2160a-v2

Add the PCIe EP mode support for lx2160a-v2 platform.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci: layerscape: Modify the ls_pcie_dump_atu function
Xiaowei Bao [Thu, 9 Jul 2020 15:31:40 +0000 (23:31 +0800)]
pci: layerscape: Modify the ls_pcie_dump_atu function

Modify the ls_pcie_dump_atu function, make it can print the INBOUND
windows registers.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci_ep: layerscape: Add the SRIOV VFs of PF support
Xiaowei Bao [Thu, 9 Jul 2020 15:31:39 +0000 (23:31 +0800)]
pci_ep: layerscape: Add the SRIOV VFs of PF support

Add the INBOUND configuration for VFs of PF.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci_ep: layerscape: Add Support for ls2085a and ls2080a EP mode
Xiaowei Bao [Thu, 9 Jul 2020 15:31:38 +0000 (23:31 +0800)]
pci_ep: layerscape: Add Support for ls2085a and ls2080a EP mode

Due to the ls2085a and ls2080a use different way to set the BAR size,
so add the BAR size init code here.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci_ep: layerscape: Add the workaround for errata A-009460
Xiaowei Bao [Thu, 9 Jul 2020 15:31:37 +0000 (23:31 +0800)]
pci_ep: layerscape: Add the workaround for errata A-009460

The VF_BARn_REG register's Prefetchable and Type bit fields
are overwritten by a write to VF's BAR Mask register.
workaround: Before writing to the VF_BARn_MASK_REG register,
write 0b to the PCIE_MISC_CONTROL_1_OFF register.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopcie_ep: layerscape: Add the multiple function support
Xiaowei Bao [Thu, 9 Jul 2020 15:31:36 +0000 (23:31 +0800)]
pcie_ep: layerscape: Add the multiple function support

Add the multiple function support for Layerscape platform, some PEXs
of Layerscaple platform have more than one PF.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: dts: ls1046a: Add the PCIe EP node
Xiaowei Bao [Thu, 9 Jul 2020 15:31:35 +0000 (23:31 +0800)]
armv8: dts: ls1046a: Add the PCIe EP node

Add the PCIe EP node for ls1046a.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agopci_ep: Add the init function
Xiaowei Bao [Thu, 9 Jul 2020 15:31:34 +0000 (23:31 +0800)]
pci_ep: Add the init function

Some EP deivces need to initialize before RC scan it, e.g. NXP
layerscape platform, so add the init function in pci_ep uclass.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>