platform/kernel/u-boot.git
4 years agommc: sdhci: Add support for dt caps & caps mask
T Karthik Reddy [Mon, 2 Sep 2019 14:34:31 +0000 (16:34 +0200)]
mmc: sdhci: Add support for dt caps & caps mask

The sdhci capabilities registers can be incorrect. The
sdhci-caps-mask and sdhci-caps dt properties specify which bits of
the registers are incorrect and what their values should be. This
patch makes the sdhci driver use those properties to correct the caps.
Also use "dev_read_u64_default" instead of "dev_read_u32_array" for
caps mask.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agodm: core: Add functions to read 64-bit dt properties
T Karthik Reddy [Mon, 2 Sep 2019 14:34:30 +0000 (16:34 +0200)]
dm: core: Add functions to read 64-bit dt properties

This patch adds functions dev_read_u64_default & dev_read_u64
to read unsigned 64-bit values from devicetree.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agodm: mmc_spi: Fix NULL pointer dereference in mmc_spi_bind()
Bin Meng [Sat, 31 Aug 2019 04:15:33 +0000 (21:15 -0700)]
dm: mmc_spi: Fix NULL pointer dereference in mmc_spi_bind()

The mmc_spi driver's priv is not available in its bind phase(). Use
platdata instead.

Fixes: 05e35d429745 ("mmc: mmc_spi: Re-write driver using DM framework")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agommc: dw_mmc: fix timeout calculate method
Kever Yang [Thu, 29 Aug 2019 07:42:41 +0000 (15:42 +0800)]
mmc: dw_mmc: fix timeout calculate method

There are two cases not been considered:
- use uint for timeout, it will overflow when size bigger than 512KB for
  it *8*1000 at the beginning, but we may use size up to 32MB; The
  'timeout' will overflow if size bigger than 51.2MB after this fix, which
  should be enough for U-Boot;
- The timeout is using clock speed for data rate, but the device may not
  have such high speed, eg. clock is 52MHz while the device write speed may
  be less than 10MB/s, and we may use up to 150MHz clock.

Fix them in this patch, the max timeout is about 6500 when size is 32MB
after fix.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoARM: dts: ast2500: Add SDHCI nodes
Eddie James [Thu, 15 Aug 2019 19:29:40 +0000 (14:29 -0500)]
ARM: dts: ast2500: Add SDHCI nodes

Add nodes for the Aspeed SD controllers with their necessary properties.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Eddie James <eajames@linux.ibm.com>
4 years agoconfigs: AST2500 EVB: Enable SD controller
Eddie James [Thu, 15 Aug 2019 19:29:39 +0000 (14:29 -0500)]
configs: AST2500 EVB: Enable SD controller

Enable the MMC subsystem and the Aspeed SD controller. Also enable the
use of the device tree for probing the controller.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
4 years agommc: Add Aspeed SD controller driver
Eddie James [Tue, 27 Aug 2019 14:48:03 +0000 (09:48 -0500)]
mmc: Add Aspeed SD controller driver

Add support for the Aspeed SD host controller engine.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
4 years agoclk: aspeed: Add support for SD clock
Eddie James [Thu, 15 Aug 2019 19:29:37 +0000 (14:29 -0500)]
clk: aspeed: Add support for SD clock

Add code to enable the SD clock on the ast2500 SoC.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Eddie James <eajames@linux.ibm.com>
4 years agommc: Rename timeout parameters for clarification
Sam Protsenko [Wed, 14 Aug 2019 19:52:51 +0000 (22:52 +0300)]
mmc: Rename timeout parameters for clarification

It's quite hard to figure out time units for various function that have
timeout parameters. This leads to possible errors when one forgets to
convert ms to us, for example. Let's rename those parameters
correspondingly to 'timeout_us' and 'timeout_ms' to prevent such issues
further.

While at it, add time units info as comments to struct mmc fields.

This commit doesn't change the behavior, only renames parameters names.
Buildman should report no changes at all.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
4 years agommc: Fix timeout values passed to mmc_wait_dat0()
Sam Protsenko [Wed, 14 Aug 2019 19:52:50 +0000 (22:52 +0300)]
mmc: Fix timeout values passed to mmc_wait_dat0()

mmc_wait_dat0() expects timeout argument to be in usec units. But some
overlying functions operate on timeout in msec units. Convert timeout
from msec to usec when passing it to mmc_wait_dat0().

This fixes 'avb' commands on BeagleBoard X15, because next chain was
failing:

    get_partition() -> mmc_switch_part() -> __mmc_switch() ->
    mmc_wait_dat0()

when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0().

Fixes: bb98b8c5c06a ("mmc: During a switch, poll on dat0 if available and check the final status")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Tested-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
4 years agodm: mmc: remove unused U_BOOT_DRIVER(mmc)
Andy Yan [Fri, 31 May 2019 07:44:39 +0000 (15:44 +0800)]
dm: mmc: remove unused U_BOOT_DRIVER(mmc)

When look through the code, I found this bare metal
drives is not used, so remove it.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge tag 'arc-for-2019.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-arc
Tom Rini [Tue, 3 Sep 2019 16:40:50 +0000 (12:40 -0400)]
Merge tag 'arc-for-2019.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-arc

These are some very late changes mostly required to get 64-bit
division working on ARC boards.

For that we had to import missing parts of libgcc and add compiler
flags to EMSDP which otherwise used very simple profile for compliation.

And while at it another fix for EM SDP initialization is inluded as well.

4 years agoarc: emsdp: Add more platform-specific compiler options
Alexey Brodkin [Mon, 2 Sep 2019 12:02:14 +0000 (15:02 +0300)]
arc: emsdp: Add more platform-specific compiler options

Even though EM SDP is FPGA-based board and different FPGA
images (known as .bit-files) are awailable for the board still
there's a common subset of options we may rely on for all configs.

These are:
 * Normalizer
 * Swap instructions
 * Simple multiplier
 * Barrel-shifter
 * Floating-point unit
 * Shorter instructions (code density)

This among other improvements allows to compile code with
64-bit divisions, see [1].

[1] https://patchwork.ozlabs.org/patch/1156541/

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
4 years agoarc: libgcc: Import __udivdi3 & __udivmoddi4 to allow 64-bit division
Alexey Brodkin [Mon, 2 Sep 2019 09:19:15 +0000 (12:19 +0300)]
arc: libgcc: Import __udivdi3 & __udivmoddi4 to allow 64-bit division

As reported by Kever here [1] we were unable to compile 64-bit division
code due to missing definition of __udivdi3().

Import its implementation and __udivmoddi4() as its direct dependency
from today's libgcc [2].

[1] https://patchwork.ozlabs.org/patch/1146845/
[2] https://github.com/gcc-mirror/gcc/commit/5d8723600bc0eed41226b5a6785bc02a053b45d5

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
4 years agoarc: emsdp: Add initialization of PSRAM
Alexey Brodkin [Thu, 18 Jul 2019 12:51:25 +0000 (15:51 +0300)]
arc: emsdp: Add initialization of PSRAM

If the "Page Mode" is not enabled on the device,
read operations from PSRAM may result in incorrect data.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
4 years agoMerge tag 'for-v2019.10-v2' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
Tom Rini [Tue, 3 Sep 2019 11:16:05 +0000 (07:16 -0400)]
Merge tag 'for-v2019.10-v2' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c

i2c bugfixes for 2019.10 take 2
- i2c: mxc: add CONFIG_CLK support
  If CONFIG_CLK is enabled use clk framework for clock settings.

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Tue, 3 Sep 2019 03:21:44 +0000 (23:21 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv

- Skip unavailable hart in the get_count().
- fu540 set serial env from otp.
- fu540 add mmc0 as a boot target device.
- Update fix_rela_dyn and add absolute reloc addend.
- Andestech PLIC driver will skip unavailable hart.
- Support Andestech V5L2 cache driver.

4 years agoriscv: cache: use CCTL to flush d-cache
Rick Chen [Wed, 28 Aug 2019 10:46:11 +0000 (18:46 +0800)]
riscv: cache: use CCTL to flush d-cache

Use CCTL command to do d-cache write back
and invalidate instead of fence.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: dts: move out AE350 L2 node from cpus node
Rick Chen [Wed, 28 Aug 2019 10:46:10 +0000 (18:46 +0800)]
riscv: dts: move out AE350 L2 node from cpus node

When L2 node exists inside cpus node, uclass_get_device
can not parse L2 node successfully. So move it outside
from cpus node.

Also add tag-ram-ctl and data-ram-ctl attributes for
v5l2 cache controller driver. This can adjust timing
by requirement from dtb to improve performance.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: cache: Flush L2 cache before jump to linux
Rick Chen [Wed, 28 Aug 2019 10:46:09 +0000 (18:46 +0800)]
riscv: cache: Flush L2 cache before jump to linux

Flush and disable L2 cache in dcache_disable()
which will be called in cleanup_before_linux()
before jump to linux.

The sequence will be preferred as below:
L1 flush -> L1 disable -> L2 flush -> L2 disable

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: ax25: add imply v5l2 cache controller
Rick Chen [Thu, 29 Aug 2019 02:30:13 +0000 (10:30 +0800)]
riscv: ax25: add imply v5l2 cache controller

Select the v5l2 UCLASS_CACHE driver for ax25.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: ae350: use the v5l2 driver to configure the cache
Rick Chen [Wed, 28 Aug 2019 10:46:07 +0000 (18:46 +0800)]
riscv: ae350: use the v5l2 driver to configure the cache

Find the UCLASS_CACHE driver to configure the cache controller's
settings.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agodm: cache: add v5l2 cache controller driver
Rick Chen [Wed, 28 Aug 2019 10:46:06 +0000 (18:46 +0800)]
dm: cache: add v5l2 cache controller driver

Add a v5l2 cache controller driver that is usually found on
Andes RISC-V ae350 platform. It will parse the cache settings
from the dtb.

In this version tag and data ram control timing can be adjusted
by the requirement from the dtb.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agodm: cache: Add enable and disable ops for sandbox and test
Rick Chen [Wed, 28 Aug 2019 10:46:05 +0000 (18:46 +0800)]
dm: cache: Add enable and disable ops for sandbox and test

Add cache enable and disable ops for test coverage.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agodm: cache: Add enable and disable ops for cache uclass
Rick Chen [Wed, 28 Aug 2019 10:46:04 +0000 (18:46 +0800)]
dm: cache: Add enable and disable ops for cache uclass

Add cache enable/disable ops to the DM cache uclass driver

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: andes_plic: init plic by scanning each cpu node
Rick Chen [Wed, 21 Aug 2019 03:26:50 +0000 (11:26 +0800)]
riscv: andes_plic: init plic by scanning each cpu node

Initialize plic driver by ofnode_for_each_subnode() instead
of cpu_get_count().

This way can support to skip some harts which maybe marked as
unavailable, but the cpu node exists indeed.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: update fix_rela_dyn
Marcus Comstedt [Sun, 11 Aug 2019 12:45:29 +0000 (14:45 +0200)]
riscv: update fix_rela_dyn

The addend is now added for RELOC_TYPE relocs.  Also, changed the loop
structure so that all the R_RISCV_RELATIVE relocs are not required to
be at the beginning of the list.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
4 years agoriscv: tools: Handle addend to absolute reloc in prelink-riscv
Marcus Comstedt [Sun, 11 Aug 2019 09:29:57 +0000 (11:29 +0200)]
riscv: tools: Handle addend to absolute reloc in prelink-riscv

Previously the handling of R_RISCV_32 and R_RISCV_64 would simply
insert the value of the symbol and ignore any addend.  However, there
exist relocs where the addend is non-zero:

0000000080250900 R_RISCV_64        efi_runtime_services+0x0000000000000068
0000000080250910 R_RISCV_64        efi_runtime_services+0x0000000000000038
0000000080250920 R_RISCV_64        efi_runtime_services+0x0000000000000018
0000000080250930 R_RISCV_64        efi_runtime_services+0x0000000000000020
0000000080250980 R_RISCV_64        efi_runtime_services+0x0000000000000048
0000000080250990 R_RISCV_64        efi_runtime_services+0x0000000000000050
00000000802509a0 R_RISCV_64        efi_runtime_services+0x0000000000000058
0000000080250940 R_RISCV_64        systab+0x0000000000000030
0000000080250950 R_RISCV_64        systab+0x0000000000000040
0000000080250960 R_RISCV_64        systab+0x0000000000000050
0000000080250970 R_RISCV_64        systab+0x0000000000000060

In these cases the addend needs to be added to the symbol value to get
the correct value for the reloc.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
4 years agosifive-fu540: config: Add mmc0 as a boot target device
Alistair Francis [Fri, 16 Aug 2019 18:00:00 +0000 (11:00 -0700)]
sifive-fu540: config: Add mmc0 as a boot target device

Add the mmc0 device as a BOOT_TARGET_DEVICES.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: sifive: fu540: set serial environment variable from otp
Sagar Shrikant Kadam [Mon, 12 Aug 2019 14:57:40 +0000 (07:57 -0700)]
riscv: sifive: fu540: set serial environment variable from otp

This patch sets the serial# environment variable by reading the
board serial number from the OTP memory region.

Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoriscv: cpu: Skip unavailable hart in the get_count() op
Bin Meng [Thu, 8 Aug 2019 07:52:08 +0000 (00:52 -0700)]
riscv: cpu: Skip unavailable hart in the get_count() op

We should not count in hart that is marked as not available in the
device tree in riscv_cpu_get_count().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
4 years agoi2c: mxc: add CONFIG_CLK support
Peng Fan [Thu, 8 Aug 2019 01:43:30 +0000 (01:43 +0000)]
i2c: mxc: add CONFIG_CLK support

When CONFIG_CLK enabled, use CLK UCLASS for clk related settings.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
hs: removed hunk in mxc_i2c_probe() as not longer in code

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Sun, 1 Sep 2019 17:33:12 +0000 (13:33 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- r8a66597 usb changes

4 years agoMerge branch '2019-08-30-master-imports'
Tom Rini [Sat, 31 Aug 2019 21:38:02 +0000 (17:38 -0400)]
Merge branch '2019-08-30-master-imports'

- Assorted bug fixes

4 years agoMakefile: fix newline escaping for CONFIG_DEFAULT_ENV_FILE
Rasmus Villemoes [Wed, 28 Aug 2019 11:00:46 +0000 (11:00 +0000)]
Makefile: fix newline escaping for CONFIG_DEFAULT_ENV_FILE

I wanted this to be compatible with mkenvimage, including the ability
to embed newlines in variables by escaping them. But I failed to check
that it works more than once.

Fixes: f3d8f7dd73a (Allow providing default environment from file)
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
4 years agoRevert "vexpress64: fvp dram: add DRAM configuration"
Ryan Harkin [Tue, 27 Aug 2019 10:56:49 +0000 (11:56 +0100)]
Revert "vexpress64: fvp dram: add DRAM configuration"

This reverts commit fc04b923541d984b1544056fd3bfa8129d4e5aac where the
FVP DRAM configuration was added.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
4 years agosiemens: avoid out of bound access
Heinrich Schuchardt [Thu, 22 Aug 2019 19:58:26 +0000 (21:58 +0200)]
siemens: avoid out of bound access

char num[1];
sprintf(num, "%d", i);

leads to a buffer overrun.

Simplify the overly complex coding.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
4 years agoarm: omap2: am43xx: Enable CONFIG_DM_USB
Suniel Mahesh [Thu, 29 Aug 2019 13:38:59 +0000 (19:08 +0530)]
arm: omap2: am43xx: Enable CONFIG_DM_USB

Enable CONFIG_DM_USB to remove compile warning for
am43xx based targets:

===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
4 years agoMakefile: clean build generated SPL binary for TI AM65x
Suniel Mahesh [Tue, 27 Aug 2019 07:57:56 +0000 (13:27 +0530)]
Makefile: clean build generated SPL binary for TI AM65x

TI AM65x platforms (evm and HS) generate an SPL image
'tispl.bin*' and there is no rule for cleanup.
Added entry for cleanup in clean target.

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
4 years agoconfigs: enable CONFIG_BLOCK_CACHE for mt7623n_bpir2
Weijie Gao [Tue, 27 Aug 2019 07:32:20 +0000 (15:32 +0800)]
configs: enable CONFIG_BLOCK_CACHE for mt7623n_bpir2

This patch enables CONFIG_BLOCK_CACHE for mt7623n_bpir2.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
4 years agommc: invalidate block cache after hwpart switched successfully
Weijie Gao [Tue, 27 Aug 2019 07:32:19 +0000 (15:32 +0800)]
mmc: invalidate block cache after hwpart switched successfully

eMMC device has multiple hw partitions both address from zero. However the
mmc driver lacks block cache invalidation for switch hwpart. This causes a
problem that data of current hw partition is cached before switching to
another hw partition. And the following read operation of the latter hw
partition will get wrong data when reading from the addresses that have
been cached previously.

To solve this problem, invalidate block cache after a successful
mmc_switch_part() operation.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Felix Brack <fb@ltec.ch>
4 years agoRevert "blk: Invalidate block cache when switching hwpart"
Weijie Gao [Tue, 27 Aug 2019 07:32:18 +0000 (15:32 +0800)]
Revert "blk: Invalidate block cache when switching hwpart"

This reverts commit 0ebe112d09b48230ba4be833cd3504b06997d9a4.

Most block devices have only one hwpart. Multiple hwparts only found used
by eMMC devices in u-boot. The mmc driver do blk_dselect_hwpart() at the
beginning of mmc_bread() which causes block cache being invalidated too
frequently and makes block cache useless.

So it's not a good idea to put blkcache_invalidate() in the common
functions. It should be called inside mmc_select_hwpart().

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Felix Brack <fb@ltec.ch>
4 years agoboard_f: fix noncached reservation calculation
Stephen Warren [Tue, 27 Aug 2019 17:54:31 +0000 (11:54 -0600)]
board_f: fix noncached reservation calculation

The current code in reserve_noncached() has two issues:

1) The first update of gd->start_addr_sp always rounds down to a section
start. However, the equivalent calculation in cache.c:noncached_init()
always first rounds up to a section start, then subtracts a section size.
These two calculations differ if the initial value is already rounded to
section alignment.

2) The second update of gd->start_addr_sp subtracts exactly
CONFIG_SYS_NONCACHED_MEMORY, whereas the equivalent calculation in
cache.c:noncached_init() rounds the noncached size up to section
alignment before subtracting it. The two calculations differ if the
noncached region size is not a multiple of the MMU section size.

In practice, one/both of those issues causes a practical problem on
Jetson TX1; U-Boot triggers a synchronous abort during initialization,
likely due to overlapping use of some memory region.

This change fixes both these issues by duplicating the exact calculations
from noncached_init() into reserve_noncached().

However, this fix assumes that gd->start_addr_sp on entry to
reserve_noncached() exactly matches mem_malloc_start on entry to
noncached_init(). I haven't traced the code to see whether it absolutely
guarantees this in all (or indeed any!) cases. Consequently, I added some
comments in the hope that this condition will continue to be true.

Fixes: 5f7adb5b1c02 ("board_f: reserve noncached space below malloc area")
Cc: Vikas Manocha <vikas.manocha@st.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
4 years agoMerge tag 'efi-2019-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 29 Aug 2019 11:26:42 +0000 (07:26 -0400)]
Merge tag 'efi-2019-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for v2019.10-rc4

Enable the unit test for UEFI runtime service Exit() on x86_64.
Use as standalone UEFI binary for testing the handling of exceptions.

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Tom Rini [Thu, 29 Aug 2019 11:26:13 +0000 (07:26 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx

Enable DM PCI for T2080RDB, T4240RDB, T1024RDB, T1042D4RDB, P1020RDB,
P2020RDB, P2041RDB, P3041DS, P4080DS, and MPC8548CDS

4 years agoMerge tag 'u-boot-amlogic-20190828' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 29 Aug 2019 11:25:48 +0000 (07:25 -0400)]
Merge tag 'u-boot-amlogic-20190828' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- add missing g12b clock driver compatible, fixing odroid-n2 usb support

4 years agoefi_selftest: use standalone UEFI program for exception
Heinrich Schuchardt [Tue, 27 Aug 2019 06:16:08 +0000 (08:16 +0200)]
efi_selftest: use standalone UEFI program for exception

To fully demonstrate crash outputs for UEFI images provide a standalone
UEFI application that tries to invoke an illegal opcode.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: enable Exit() unit test on x86_64
Heinrich Schuchardt [Wed, 21 Aug 2019 20:21:54 +0000 (22:21 +0200)]
efi_selftest: enable Exit() unit test on x86_64

Enable unit tests for StartImage() and Exit() unit tests on x86_64.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: MPC8548CDS: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:29 +0000 (11:05 +0000)]
configs: MPC8548CDS: Enable PCIe driver

Enable the DM PCIe driver in MPC8548CDS defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: MPC8548CDS: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:26 +0000 (11:05 +0000)]
powerpc: MPC8548CDS: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoMPC8548: dts: Added PCIe DT node
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:23 +0000 (11:05 +0000)]
MPC8548: dts: Added PCIe DT node

MPC8548 integrated a PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 1.0a, and this
patch is to add DT node for the PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add MPC8548 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:19 +0000 (11:05 +0000)]
dm: pcie_fsl: Add MPC8548 PCIe support

Add compatible string for MPC8548 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: MPC85xxCDS: Disable legacy PCI fixup when DM_PCI is selected
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:16 +0000 (11:05 +0000)]
powerpc: MPC85xxCDS: Disable legacy PCI fixup when DM_PCI is selected

Disable legacy PCI and PCIe fixup when CONFIG_DM_PCI is selected.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: MPC8548CDS: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:12 +0000 (11:05 +0000)]
powerpc: MPC8548CDS: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines only when
DM_PCI is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P5040DS: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:09 +0000 (11:05 +0000)]
configs: P5040DS: Enable PCIe driver

Enable the DM PCIe driver in P5040DS defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
eviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>

4 years agoP5040: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:06 +0000 (11:05 +0000)]
P5040: dts: Added PCIe DT nodes

P5040 integrated 3 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add P5040 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:05:02 +0000 (11:05 +0000)]
dm: pcie_fsl: Add P5040 PCIe support

Add compatible string for P5040 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P4080DS: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:59 +0000 (11:04 +0000)]
configs: P4080DS: Enable PCIe driver

Enable the DM PCIe driver in P4080DS defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoP4080: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:56 +0000 (11:04 +0000)]
P4080: dts: Added PCIe DT nodes

P4080 integrated 3 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add P4080 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:52 +0000 (11:04 +0000)]
dm: pcie_fsl: Add P4080 PCIe support

Add compatible string for P4080 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P3041DS: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:49 +0000 (11:04 +0000)]
configs: P3041DS: Enable PCIe driver

Enable the DM PCIe driver in P3041DS defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: corenet_ds: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:45 +0000 (11:04 +0000)]
powerpc: corenet_ds: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoP3041: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:42 +0000 (11:04 +0000)]
P3041: dts: Added PCIe DT nodes

P3041 integrated 4 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add P3041 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:39 +0000 (11:04 +0000)]
dm: pcie_fsl: Add P3041 PCIe support

Add compatible string for P3041 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P2041RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:35 +0000 (11:04 +0000)]
configs: P2041RDB: Enable PCIe driver

Enable the DM PCIe driver in P2041RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: P2041RDB: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:32 +0000 (11:04 +0000)]
powerpc: P2041RDB: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoP2041: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:29 +0000 (11:04 +0000)]
P2041: dts: Added PCIe DT nodes

P2041 integrated 3 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add P2041 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:25 +0000 (11:04 +0000)]
dm: pcie_fsl: Add P2041 PCIe support

Add compatible string for P2041 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: p_corenet: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:22 +0000 (11:04 +0000)]
powerpc: p_corenet: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines for P2041RDB,
P3041, P4080, P5020 and P5040 DS boards only when DM_PCI is
 not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P2020RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:18 +0000 (11:04 +0000)]
configs: P2020RDB: Enable PCIe driver

Enable the DM PCIe driver in P2020RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoP2020: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:15 +0000 (11:04 +0000)]
P2020: dts: Added PCIe DT nodes

P2020 integrated 3 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 1.0a, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: P1020RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:11 +0000 (11:04 +0000)]
configs: P1020RDB: Enable PCIe driver

Enable the DM PCIe driver in P1020RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: p1_p2_rdb: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:08 +0000 (11:04 +0000)]
powerpc: p1_p2_rdb: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled
for P1020, P1021, P1024, P1025 and P2020 RDB boards.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoP1020: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:04 +0000 (11:04 +0000)]
P1020: dts: Added PCIe DT nodes

P1020 integrated 2 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 1.0a, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add PCIe support for P1 and P2 series SoCs
Hou Zhiqiang [Tue, 27 Aug 2019 11:04:01 +0000 (11:04 +0000)]
dm: pcie_fsl: Add PCIe support for P1 and P2 series SoCs

Add compatible string for PCIe of P1020, P1021, P1024, P1025
and P2020 SoCs.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: p1_p2_rdb: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:58 +0000 (11:03 +0000)]
powerpc: p1_p2_rdb: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines for P1020,
P1021, P1024, P1025 and P2020 RDB boards only when DM_PCI
is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: T1042D4RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:54 +0000 (11:03 +0000)]
configs: T1042D4RDB: Enable PCIe driver

Enable the DM PCIe driver in T1042D4RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T104xRDB: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:51 +0000 (11:03 +0000)]
powerpc: T104xRDB: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agot104x: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:47 +0000 (11:03 +0000)]
t104x: dts: Added PCIe DT nodes

T104x integrated 4 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add T104x PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:44 +0000 (11:03 +0000)]
dm: pcie_fsl: Add T104x PCIe support

Add compatible string for T104x PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T104xRDB: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:41 +0000 (11:03 +0000)]
powerpc: T104xRDB: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines only when
DM_PCI is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: T1024RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:37 +0000 (11:03 +0000)]
configs: T1024RDB: Enable PCIe driver

Enable the DM PCIe driver in T1024RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T102xRDB: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:34 +0000 (11:03 +0000)]
powerpc: T102xRDB: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T102xRDB: Remove the useless macro CONFIG_ARCH_T1040
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:30 +0000 (11:03 +0000)]
powerpc: T102xRDB: Remove the useless macro CONFIG_ARCH_T1040

Remove the macro CONFIG_ARCH_T1040 from the T102xRDB.h and
the PCIE4 related macros, as there are only 3 PCIe controllers
on T102x SoCs.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agot102x: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:27 +0000 (11:03 +0000)]
t102x: dts: Added PCIe DT nodes

T102x integrated 3 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 2.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add T102x PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:24 +0000 (11:03 +0000)]
dm: pcie_fsl: Add T102x PCIe support

Add compatible string for T102x PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T102xRDB: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:20 +0000 (11:03 +0000)]
powerpc: T102xRDB: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines only when
DM_PCI is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: T4240RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:16 +0000 (11:03 +0000)]
configs: T4240RDB: Enable PCIe driver

Enable the DM PCIe driver in T4240RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T4240RDB: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:13 +0000 (11:03 +0000)]
powerpc: T4240RDB: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agot4240: dts: Added PCIe DT nodes
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:10 +0000 (11:03 +0000)]
t4240: dts: Added PCIe DT nodes

T4240 integrated 4 PCIe controllers, which is compatible with
the PCI Express™ Base Specification, Revision 3.0, and this
patch is to add DT node for each PCIe controller.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Add T4240 PCIe support
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:06 +0000 (11:03 +0000)]
dm: pcie_fsl: Add T4240 PCIe support

Add compatible string for T4240 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T4RDB: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:03:03 +0000 (11:03 +0000)]
powerpc: T4RDB: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines only when
DM_PCI is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoconfigs: T2080RDB: Enable PCIe driver
Hou Zhiqiang [Tue, 27 Aug 2019 11:02:59 +0000 (11:02 +0000)]
configs: T2080RDB: Enable PCIe driver

Enable the DM PCIe driver in T2080RDB defconfig.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T208xRDB: Disable legacy PCIe driver when DM_PCI is enabled
Hou Zhiqiang [Tue, 27 Aug 2019 11:02:56 +0000 (11:02 +0000)]
powerpc: T208xRDB: Disable legacy PCIe driver when DM_PCI is enabled

Disable legacy PCIe driver and unused PCIe macros when DM_PCI enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agopowerpc: T208xRDB: Compile legacy PCIe routines conditionally
Hou Zhiqiang [Tue, 27 Aug 2019 11:02:52 +0000 (11:02 +0000)]
powerpc: T208xRDB: Compile legacy PCIe routines conditionally

Compile the legacy PCIe initialization routines only when
DM_PCI is not enabled.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Fix the calculation of controller index
Hou Zhiqiang [Tue, 27 Aug 2019 10:13:54 +0000 (10:13 +0000)]
dm: pcie_fsl: Fix the calculation of controller index

The PCIe controller register address in CCSR is different
on various platforms, the current code erroneously use
the hardcoded address (0xffe240000) and stride (0x10000)
to calculate the controller's index.

Fix it by adding the related info to the driver data
structure.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Fix the Class Code fixup function
Hou Zhiqiang [Tue, 27 Aug 2019 10:13:51 +0000 (10:13 +0000)]
dm: pcie_fsl: Fix the Class Code fixup function

The Class Code fixup method was changed from PCIe block
revision 3.0, the current fixup is only valid for the
revision 3.0 and the later ones.

So add the Class Code fixup for the block revision < 3.0.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agodm: pcie_fsl: Convert IS_ENABLED() run-time checking to #ifdef
Hou Zhiqiang [Tue, 27 Aug 2019 10:13:48 +0000 (10:13 +0000)]
dm: pcie_fsl: Convert IS_ENABLED() run-time checking to #ifdef

This can avoid build error:
The macro in brackets of the IS_ENABLED(CONFIG_FOO) is only
defined on the platforms that select the CONFIG_FOO, while
it's not defined on platforms that do not select the
CONFIG_FOO.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
4 years agoclk: meson-g12b: add compatible
Mark Kettenis [Tue, 27 Aug 2019 21:06:28 +0000 (23:06 +0200)]
clk: meson-g12b: add compatible

The G12B clock controller is almost identical to the G12A and
so far the differences don't matter.  Adding the G12B compatible
makes USB work on the Odroid-N2.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoMerge branch 'u-boot-stm32_20190827' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Tue, 27 Aug 2019 17:19:47 +0000 (13:19 -0400)]
Merge branch 'u-boot-stm32_20190827' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- Fixes and update related to STM32MP1 platforms