platform/kernel/u-boot.git
3 years agolib: rsa: Add debug message on algo mismatch
Sean Anderson [Tue, 16 Feb 2021 16:40:15 +0000 (11:40 -0500)]
lib: rsa: Add debug message on algo mismatch

Currently we fail silently if there is an algorithm mismatch. To help
distinguish this failure condition.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agovexpress64_fvp: Set DRAM to 4G to match with kernel devicetree
Diego Sueiro [Mon, 15 Feb 2021 07:27:57 +0000 (07:27 +0000)]
vexpress64_fvp: Set DRAM to 4G to match with kernel devicetree

Currently, the kernel devicetree is setting the DRAM size to ~4G.

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
3 years agovirtio: fix off by one device id comparison
Vincent Stehlé [Sun, 14 Feb 2021 18:39:04 +0000 (19:39 +0100)]
virtio: fix off by one device id comparison

VIRTIO_ID_MAX_NUM is the largest device ID plus 1. Therefore a device id
cannot be greater or equal to VIRTIO_ID_MAX_NUM. Fix the comparison
accordingly.

Fixes: 8fb49b4c7a82 ("dm: Add a new uclass driver for VirtIO transport devices")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
3 years agobuild/DTC: fix sed usage in DTC command
Roger Pau Monne [Sat, 13 Feb 2021 10:06:32 +0000 (11:06 +0100)]
build/DTC: fix sed usage in DTC command

Current sed usage in the DTC command relies on GNU sed specific -i
option which has a slightly different syntax for BSD sed and always
expects an extension to be provided in order to create a backup file.

Instead drop the cat concatenation done before the sed call and use
sed itself to edit and concatenate the files.

No functional change intended.

Signed-off-by: Roger Pau Monné <royger@FreeBSD.org>
3 years agoscripts/check-config.sh: fix to be compatible with BSD sed
Roger Pau Monne [Sat, 13 Feb 2021 10:06:31 +0000 (11:06 +0100)]
scripts/check-config.sh: fix to be compatible with BSD sed

Fist use extended regexp in order to drop the '\' around the
parentheses which is not supported by BSD sed in regular mode.

Secondly use [[:blank:]] instead of \s, as the later is a GNU
extension.

No functional change intended.

Signed-off-by: Roger Pau Monné <royger@FreeBSD.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agomalloc: adjust memcpy() and memset() definitions.
Heinrich Schuchardt [Wed, 10 Feb 2021 17:59:21 +0000 (18:59 +0100)]
malloc: adjust memcpy() and memset() definitions.

Compiling the sandbox fails on armv7 due to conflicting definitions of
memcpy() and memset() in include/malloc.h and include/linux/string.h.

Use linux/string.h here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoconfig: hikey: convert to DM_USB and DM_ETH
Peter Robinson [Wed, 10 Feb 2021 17:29:16 +0000 (17:29 +0000)]
config: hikey: convert to DM_USB and DM_ETH

Convert the hikey to use DM_USB and DM_ETH.

Conversion based on rpi as it has a similar DWC config.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
3 years agocmd: pinmux: depend on PINCTRL
Marek Behún [Tue, 9 Feb 2021 20:23:47 +0000 (21:23 +0100)]
cmd: pinmux: depend on PINCTRL

The pinmux command uses functions pinctrl_get_pin_*(), which are missing
if PINCTRL config option is disabled.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMakefile: Add (default) DEVICE_TREE to SPL FIT
Klaus Heinrich Kiwi [Tue, 9 Feb 2021 18:41:55 +0000 (15:41 -0300)]
Makefile: Add (default) DEVICE_TREE to SPL FIT

U-boot allows the default device tree to be overridden from
the build environment using the DEVICE_TREE variable.

Make sure that we include it in the SPL FIT mkimage build step.

This also fixes a broken image in case CONFIG_OF_LIST and
CONFIG_OF_OVERLAY_LIST are unset (i.e., expected to be supplied
by the DEVICE_TREE env var).

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
3 years agoKconfig: SPL_FIT_SIGNATURE requires SPL_LOAD_FIT
Klaus Heinrich Kiwi [Tue, 9 Feb 2021 18:41:54 +0000 (15:41 -0300)]
Kconfig: SPL_FIT_SIGNATURE requires SPL_LOAD_FIT

Having the ability to support firmware FIT signatures on the SPL sounds
not so useful if the SPL is not supporting to load a (U-boot) firmware
as a FIT image.

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
3 years agoKconfig: SPL_FIT_SIGNATURE selects FIT_SIGNATURE
Klaus Heinrich Kiwi [Tue, 9 Feb 2021 18:41:53 +0000 (15:41 -0300)]
Kconfig: SPL_FIT_SIGNATURE selects FIT_SIGNATURE

Selecting SPL_FIT_SIGNATURE (without selecting U-boot proper
verified boot first) breaks the build due to
CONFIG_FIT_SIGNATURE_MAX_SIZE being undefined, in addition to Kconfig
warnings on RSA and IMAGE_SIGN_INFO unmet dependencies.

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
3 years agofs: btrfs: change directory list output to be aligned as before
Marek Behún [Tue, 9 Feb 2021 18:05:08 +0000 (19:05 +0100)]
fs: btrfs: change directory list output to be aligned as before

Since commit 325dd1f642dd ("fs: btrfs: Use btrfs_iter_dir() to ...")
when btrfs is listing a directory, the output is not aligned:

  <SYMLINK>         15  Wed Sep 09 13:20:03 2020  boot.scr -> @/boot/boot.scr
  <DIR>          0  Tue Feb 02 12:42:09 2021  @
  <FILE>        108  Tue Feb 02 12:54:04 2021  1.info

Return back to how it was displayed previously, i.e.:

  <SYM>         15  Wed Sep 09 13:20:03 2020  boot.scr -> @/boot/boot.scr
  <DIR>          0  Tue Feb 02 12:42:09 2021  @
  <   >        108  Tue Feb 02 12:54:04 2021  1.info

Instead of '<FILE>', print '<   >', as ext4 driver.

If an unknown directory item type is encountered, we will print the type
number left padded with spaces, enclosed by '?', instead of '<' and '>',
i.e.:

  ? 30?        .............................  name

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Fixes: 325dd1f642dd ("fs: btrfs: Use btrfs_iter_dir() to replace ...")
Cc: David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
3 years agofs: btrfs: skip xattrs in directory listing
Marek Behún [Tue, 9 Feb 2021 18:05:07 +0000 (19:05 +0100)]
fs: btrfs: skip xattrs in directory listing

Skip xattrs in directory listing. U-Boot filesystem drivers do not list
xattrs.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
3 years agocmd: fdt: skip board specific fixup using env variable
Wasim Khan [Thu, 4 Feb 2021 14:44:04 +0000 (15:44 +0100)]
cmd: fdt: skip board specific fixup using env variable

Sometimes it is useful to boot OS with already fixed-up
device tree. Check for env variable 'skip_board_fixup'
before calling ft_board_setup().
Current behaviour is unchanged, additionally user can
set skip_board_fixup to 1 to skip the fixup.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
3 years agofs/squashfs: NULL dereference in sqfs_closedir()
Heinrich Schuchardt [Mon, 1 Feb 2021 02:28:48 +0000 (03:28 +0100)]
fs/squashfs: NULL dereference in sqfs_closedir()

sqfs_opendir() called in sqfs_size(), sqfs_read(), sqfs_exists() may fail
leading to sqfs_closedir(NULL) being called. Do not dereference NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agocmd: pwm: Rework argc sanity checking
Tom Rini [Tue, 26 Jan 2021 16:44:37 +0000 (11:44 -0500)]
cmd: pwm: Rework argc sanity checking

Currently, we check argc in a number of places to make sure that we have
all of the required arguments for each of the pwm sub-commands.
However, there's at least one place where we've got dead code as we'll
never have argc == 0, due to checking that argc was at least 4 earlier
and having only subtracted 3.  Rework things so that when we have
determined our subcommand make sure we have the right number of
arguments for it, or error out.  This means we can stop checking against
argc again later.

Reported-by: Coverity (CID: 316601)
Cc: Pragnesh Patel <pragnesh.patel@sifive.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'xilinx-for-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 23 Feb 2021 15:45:55 +0000 (10:45 -0500)]
Merge tag 'xilinx-for-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2021.04-rc3

qspi:
- Support for dual/quad mode
- Fix speed handling

clk:
- Add clock enable function for zynq/zynqmp/versal

gem:
- Enable clock for Versal
- Fix error path
- Fix mdio deregistration path

fpga:
- Fix buffer alignment for ZynqMP

xilinx:
- Fix reset reason clearing in ZynqMP
- Show silicon version in SPL for Zynq/ZynqMP
- Fix DTB selection for ZynqMP
- Rename zc1275 to zcu1275 to match DT name

3 years agospi: zynqmp_gqspi: fix set_speed bug on multiple runs
Brandon Maier [Wed, 20 Jan 2021 20:28:30 +0000 (14:28 -0600)]
spi: zynqmp_gqspi: fix set_speed bug on multiple runs

If zynqmp_qspi_set_speed() is called multiple times with the same speed,
then on the second call it will skip recalculating the baud_rate_val as
it assumes the speed is already configured correctly. But it will still
write the baud_rate_val to the configuration register and call
zynqmp_gqspi_set_tapdelay(). Because it skipped recalculating the
baud_rate_val, it will use the initial value of 0 . This causes the
driver to run at maximum speed which for many spi flashes is too fast and
causes data corruption.

Instead only write out a new baud_rate_val if we have calculated the
correct baud_rate_val.

This opens up another issue with the "if (speed == 0)", we don't save
off the new plat->speed_hz value when setting the baud rate on the
speed=0 path. Instead mimic what the Linux zynqmp gqspi driver does, and
have speed==0 just use the same calculation as a normal speed. That will
cause the baud_rate_val to use the slowest speed possible, which is the
safest option.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
CC: jagan@amarulasolutions.com
CC: michal.simek@xilinx.com
CC: Ashok Reddy Soma <ashokred@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Rename zc1275/zcu1275 to be aligned with DT name
Michal Simek [Wed, 17 Feb 2021 07:55:34 +0000 (08:55 +0100)]
arm64: zynqmp: Rename zc1275/zcu1275 to be aligned with DT name

Folder names corresponds to DT name. These boards have been renamed from
zc1275 to zcu1275 by commit shown below and this should be the part of that
commit.

Fixes: 420d44678119 ("arm64: zynqmp: Rename zc1275 to zcu1275")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agonet: gem: Fix error path in zynq_gem_probe
Michal Simek [Thu, 11 Feb 2021 18:03:30 +0000 (19:03 +0100)]
net: gem: Fix error path in zynq_gem_probe

Clean up error path in connection where priv->rxbuffers and priv->tx_bd are
allocated.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agonet: gem: Enable ethernet rx clock for versal
T Karthik Reddy [Wed, 3 Feb 2021 10:10:48 +0000 (03:10 -0700)]
net: gem: Enable ethernet rx clock for versal

Enable rx clock along with tx clock for versal platform. Use compatible
data to enable/disable clocks in the driver.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoi2c: i2c_cdns: Enable i2c clock
T Karthik Reddy [Wed, 3 Feb 2021 10:10:46 +0000 (03:10 -0700)]
i2c: i2c_cdns: Enable i2c clock

Enable i2c controller clock from driver probe function
by calling clk_enable().

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoclk: versal: Add support to enable clocks
T Karthik Reddy [Wed, 3 Feb 2021 10:10:47 +0000 (03:10 -0700)]
clk: versal: Add support to enable clocks

Add clock enable functionality in versal clock driver to enable
clocks from peripheral drivers using clk_ops.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoclk: zynqmp: Add support to enable clocks
T Karthik Reddy [Wed, 3 Feb 2021 10:10:45 +0000 (03:10 -0700)]
clk: zynqmp: Add support to enable clocks

Add clock enable functionality in zynqmp clock driver to enable
clocks from peripheral drivers using clk_ops.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoclk: zynq: Add dummy clock enable function
Michal Simek [Tue, 9 Feb 2021 14:28:15 +0000 (15:28 +0100)]
clk: zynq: Add dummy clock enable function

A lot of Xilinx drivers are checking -ENOSYS which means that clock driver
doesn't have enable function. Remove this checking from drivers and create
dummy enable function as was done for clk_fixed_rate driver by
commit 6bf6d81c1112 ("clk: fixed_rate: add dummy enable() function").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Do not clear reset reason
Michal Simek [Tue, 9 Feb 2021 07:50:22 +0000 (08:50 +0100)]
arm64: zynqmp: Do not clear reset reason

There is no need to clear reset reason register because it is protected by
PMUFW already which is reported when verbose log is enabled as:
pm_core.c@733 APU> No write permission to 0xFF5E0220

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agofpga: zynqpl: fix buffer alignment
Michael Walle [Wed, 10 Feb 2021 21:42:29 +0000 (22:42 +0100)]
fpga: zynqpl: fix buffer alignment

Due to pointer arithmetic, "sizeof(u32) * ARCH_DMA_MINALIGN" is
subtracted. It seems that the original intention was to just subtract
ARCH_DMA_MINALIGN. Fix it.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoMerge tag 'u-boot-amlogic-20210222' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 22 Feb 2021 17:37:02 +0000 (12:37 -0500)]
Merge tag 'u-boot-amlogic-20210222' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- adds adc-keys button driver
- fix meson-saradc driver to get reference voltage
- add adc-keys test for sandbox
- enable adc-keys for VIM3 & VIM3L boards
- fix button.h build

3 years agoMerge tag 'ti-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 22 Feb 2021 14:12:04 +0000 (09:12 -0500)]
Merge tag 'ti-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- Fix ethernet on J721e
- Sync am335x DT nodes from Linux 5.9-rc7
- Minor Clock fixes

3 years agoMerge tag 'video-for-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 22 Feb 2021 14:11:27 +0000 (09:11 -0500)]
Merge tag 'video-for-v2021.04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

 - splash_source warning fix when building with 64-bit toolchains
 - lq123p1jx31 and nv101wxmn51 compatible in simple panel driver
 - remove not used mb862xx driver
 - add Himax HX8238D panel driver
 - s/video_uc_platdata/video_uc_plat/

3 years agoMerge branch '2021-02-21-mpc83xx-updates'
Tom Rini [Mon, 22 Feb 2021 14:06:36 +0000 (09:06 -0500)]
Merge branch '2021-02-21-mpc83xx-updates'

- mpc8379erdb DM_MMC conversion
- kmeter1 updates
- qe_uec fixes

3 years agobutton: add udevice forward declaration
Neil Armstrong [Fri, 19 Feb 2021 07:31:47 +0000 (08:31 +0100)]
button: add udevice forward declaration

After 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
build fails with :

drivers/button/button-uclass.c:13:5: error: conflicting types for 'button_get_by_label'
int button_get_by_label(const char *label, struct udevice **devp)
    ^~~~~~~~~~~~~~~~~~~

Adding struct udevice forward declaration in button.h solves the build error.

Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarch: sandbox: fix typo in clk.h
Dario Binacchi [Sun, 14 Feb 2021 14:17:43 +0000 (15:17 +0100)]
arch: sandbox: fix typo in clk.h

Fix the 'devivce' typo in arch/sandbox/include/asm/clk.h.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoclk: remove a redundant header
Dario Binacchi [Sun, 14 Feb 2021 14:17:42 +0000 (15:17 +0100)]
clk: remove a redundant header

The linux/err.h header file was included twice.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarm: dts: sync am33xx-clocks with Linux 5.9-rc7
Dario Binacchi [Sat, 13 Feb 2021 11:09:19 +0000 (12:09 +0100)]
arm: dts: sync am33xx-clocks with Linux 5.9-rc7

The commit 6337d53fdf45 ("arm: dts: sync am33xx with Linux 5.9-rc7")
synchronized the am33xx-clocks.dtsi file with Linux 5.9-rc7 with the
exception of two nodes. I think I was wrong and it is better to keep
the two files similar and possibly make changes to the *-u-boot.dtsi
files.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: improve debug messages for clkctrl driver
Dario Binacchi [Sat, 13 Feb 2021 11:02:30 +0000 (12:02 +0100)]
clk: ti: improve debug messages for clkctrl driver

The previous version printed the same debug message for both the enable
and disable routines without highlighting whether you were enabling or
disabling the module. It is now clear whether you are enabling or
disabling the module.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agouec.h: fix COFIG_DM typo
Rasmus Villemoes [Mon, 5 Oct 2020 13:15:18 +0000 (15:15 +0200)]
uec.h: fix COFIG_DM typo

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agodm_qe_uec.c: fix indentation in uec_set_mac_if_mode()
Rasmus Villemoes [Mon, 5 Oct 2020 13:15:17 +0000 (15:15 +0200)]
dm_qe_uec.c: fix indentation in uec_set_mac_if_mode()

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agomdio-uclass.c: support fixed-link subnodes
Rasmus Villemoes [Mon, 5 Oct 2020 13:15:16 +0000 (15:15 +0200)]
mdio-uclass.c: support fixed-link subnodes

When trying to port our mpc8309-based board to DM_ETH, on top of
Heiko's patches, I found that nothing in mdio-uclass.c seems to
support the use of a fixed-link subnode of the ethernet DT node. That
is, the ethernet node looks like

enet0: ethernet@2000 {
device_type = "network";
compatible = "ucc_geth";
...
fixed-link {
reg = <0xffffffff>;
speed = <100>;
full-duplex;
};

but the current code expects there to be phy-handle property. Adding
that, i.e.

phy-handle = <&enet0phy>;
enet0phy: fixed-link {

just makes the code break a few lines later since a fixed-link node
doesn't have a reg property. Ignoring the dtc complaint and adding a
dummy reg property, we of course hit "can't find MDIO bus for node
ethernet@2000" since indeed, the parent node of the phy node does not
represent an MDIO bus. So that's obviously the wrong path.

Now, in linux, it seems that the fixed link case is treated specially;
in the of_phy_get_and_connect() which roughly corresponds to
dm_eth_connect_phy_handle() we have

    if (of_phy_is_fixed_link(np)) {
        ret = of_phy_register_fixed_link(np);
        ...
    } else {
        phy_np = of_parse_phandle(np, "phy-handle", 0);
...
    }

    phy = of_phy_connect(dev, phy_np, hndlr, 0, iface);

And U-Boot's phy_connect() does have support for fixed-link
subnodes. Calling phy_connect() directly with NULL bus and a dummy
address does seem to make the ethernet work.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agompc83xx: kmeter1: increase malloc_f space
Heiko Schocher [Fri, 2 Oct 2020 07:23:22 +0000 (09:23 +0200)]
mpc83xx: kmeter1: increase malloc_f space

make malloc space before relocation bigger, set

CONFIG_SYS_MALLOC_F_LEN=0x800

Signed-off-by: Heiko Schocher <hs@denx.de>
3 years agompc83xx: kmeter1_defconfig add missing BAT4 config
Heiko Schocher [Fri, 2 Oct 2020 07:23:21 +0000 (09:23 +0200)]
mpc83xx: kmeter1_defconfig add missing BAT4 config

BAT4 setup missed in defconfig, add it.

Signed-off-by: Heiko Schocher <hs@denx.de>
3 years agompc8379erdb: Convert to DM_MMC
Sinan Akman [Sat, 4 Apr 2020 05:16:47 +0000 (01:16 -0400)]
mpc8379erdb: Convert to DM_MMC

Signed-off-by: Sinan Akman <sinan@writeme.com>
3 years agompc8379erdb: Add device tree
Sinan Akman [Sat, 4 Apr 2020 05:16:46 +0000 (01:16 -0400)]
mpc8379erdb: Add device tree

Signed-off-by: Sinan Akman <sinan@writeme.com>
3 years agoMerge tag 'efi-2021-04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 21 Feb 2021 16:17:30 +0000 (11:17 -0500)]
Merge tag 'efi-2021-04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-04-rc3

Bug fixes:

* Let EFI simple file protocol access last block of partition
* Correct conversion of multi-part device paths in
  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText()

Documentation:

* booti and qfw man-pages

3 years agoMerge tag 'for-v2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
Tom Rini [Sun, 21 Feb 2021 16:17:07 +0000 (11:17 -0500)]
Merge tag 'for-v2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c

i2c changes for v2021.04

new feature:
- Allow disabling driver model for I2C in SPL

fixes:
- i2c-gpio: Fix GPIO output
- at91: fix crash when using 'i2c probe'

3 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Sun, 21 Feb 2021 16:16:38 +0000 (11:16 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- RCar Gen3 updates

3 years agodoc: qfw man-page
Heinrich Schuchardt [Sat, 20 Feb 2021 09:00:19 +0000 (10:00 +0100)]
doc: qfw man-page

Provide a man-page for the qfw command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: multi part device paths to text
Heinrich Schuchardt [Thu, 18 Feb 2021 17:30:43 +0000 (18:30 +0100)]
efi_loader: multi part device paths to text

Our current implementation of
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() truncates multi
part device paths after the first part. We should convert all parts.

Render device path instance ends as commas. This is not explicitly
described in the UEFI spec but mimics what EDK II does.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_selftest: multi part device path to text
Heinrich Schuchardt [Thu, 18 Feb 2021 17:30:44 +0000 (18:30 +0100)]
efi_selftest: multi part device path to text

Test EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() for a multi
part device path.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_selftest: compiler flags for dtbdump.o
Heinrich Schuchardt [Thu, 18 Feb 2021 06:34:44 +0000 (07:34 +0100)]
efi_selftest: compiler flags for dtbdump.o

Fix a typo. Apply the correct compiler flags to dtbdump.o.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: booti man-page
Heinrich Schuchardt [Wed, 17 Feb 2021 11:19:35 +0000 (12:19 +0100)]
doc: booti man-page

Provide a man-page for the booti command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc/README.distro: kernel_comp_addr_r
Heinrich Schuchardt [Wed, 17 Feb 2021 07:06:05 +0000 (08:06 +0100)]
doc/README.distro: kernel_comp_addr_r

Add missing articles and preposition.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Add reference to U-Boot project in conf.py
Heinrich Schuchardt [Tue, 16 Feb 2021 17:20:54 +0000 (18:20 +0100)]
doc: Add reference to U-Boot project in conf.py

With the last update of conf.py the references to U-Boot where replaced by
references to Linux.

Fix the project references in the generated documentation.

Reported-by: Simon Glass <sjg@chromium.org>
Reported-by: Bin Meng <bmeng.cn@gmail.com>
Fixes: 98f01cf7a22e ("doc: update Kernel documentation build system")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoAllow last block to be read
Jesper Schmitz Mouridsen [Tue, 9 Feb 2021 16:17:17 +0000 (17:17 +0100)]
Allow last block to be read

The last block is of size media->block_size

Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer>
Simplify expression.
Apply same change to efi_disk_write_blocks().

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
Igor Opaniuk [Tue, 9 Feb 2021 11:52:45 +0000 (13:52 +0200)]
dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO

Use CONFIG_IS_ENABLED() macro, which provides more convenient
way to check $(SPL)DM_I2C/$(SPL)DM_I2C_GPIO configs
for both SPL and U-Boot proper.

CONFIG_IS_ENABLED(DM_I2C) expands to:
- 1 if CONFIG_SPL_BUILD is undefined and CONFIG_DM_I2C is set to 'y',
- 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_DM_I2C is set to 'y',
- 0 otherwise.

All occurences were replaced automatically using these bash cmds:
$ find . -type f -exec sed -i
     's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +
$ find . -type f -exec sed -i
    's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +
$ find . -type f -exec sed -i
    's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +

Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: drop CONFIG_DM_I2C undefs
Igor Opaniuk [Tue, 9 Feb 2021 11:52:44 +0000 (13:52 +0200)]
board: freescale: drop CONFIG_DM_I2C undefs

Drop CONFIG_DM_I2C undefs from board header files, and make them
disabled on these boards in defconfigs instead.

Disabling on Kconfig symbol was done automatically with this script:

cd configs
files=(*ls1046a*)
files2=(*T104*RDB*)
files3=(ls1021atwr_*)
files4=("imx8mp_evk_defconfig phycore-imx8mp_defconfig")
combine=("${files[@]}" "${files2[@]}" "${files3[@]}" "${files4[@]}")
cd ..

for item in ${combine[*]}
do
   echo "Adjusting  $item"
   echo "# CONFIG_SPL_DM_I2C is not set" >> configs/$item
   make $item && make savedefconfig && cp defconfig configs/$item
done

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agodm: i2c: allow disabling driver model in SPL
Igor Opaniuk [Tue, 9 Feb 2021 11:52:43 +0000 (13:52 +0200)]
dm: i2c: allow disabling driver model in SPL

At present if U-Boot proper uses driver model for I2C, then SPL has to
also. While this is desirable, it places a significant barrier to moving
to driver model in some cases. For example, with a space-constrained SPL
it may be necessary to enable CONFIG_SPL_OF_PLATDATA which involves
adjusting some drivers.

This patch introduces a separate Kconfig symbols for enabling DM_I2C and
DM_I2C_GPIO support in SPL.

This will also help to get away from dirty workarounds to
achieve non-DM I2C support for SPL, which is currently used in some
board header files like:

ifdef CONFIG_SPL_BUILD
undef CONFIG_DM_I2C
endif

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoi2c: at91: fix crash when using 'i2c probe'
Eugen Hristev [Fri, 4 Dec 2020 16:06:55 +0000 (18:06 +0200)]
i2c: at91: fix crash when using 'i2c probe'

When issuing 'i2c probe', the driver was crashing, because at probe
there is a request with zero length buffer to write to i2c bus.
The xfer_msg function assumes the buffer is always there, and never
checks for the buffer length.

=> i2c dev 0
Setting bus to 0
=> i2c probe
Valid chip addresses:
data abort
pc : [<7ffa97dc>]          lr : [<7ffa96f8>]
reloc pc : [<66f277dc>]    lr : [<66f276f8>]
sp : 7fb7c110  ip : 7ff87a28     fp : 7ff99938
r10: 00000002  r9 : 7fb7dec0     r8 : 00000000
r7 : e181c600  r6 : 7fb88c20     r5 : 00000000  r4 : 7fb7c128
r3 : 00000000  r2 : 00000001     r1 : 00000000  r0 : 00000009
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Code: eb0092f4 e1a00005 e8bd81f0 e594300c (e5d33000)
Resetting CPU ...

Fixes: 8800e0fa20 ("i2c: atmel: add i2c driver")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
3 years agoi2c: i2c-gpio: Fix GPIO output
Harm Berntsen [Sun, 29 Nov 2020 09:47:15 +0000 (09:47 +0000)]
i2c: i2c-gpio: Fix GPIO output

The dm_gpio_set_dir_flags function cannot be used to update the
configuration of a GPIO pin because it does a bitwise OR with the
existing flags. Looks like commit 788ea834124b ("gpio: add function
_dm_gpio_set_dir_flags") has introduced this behaviour and the i2c-gpio
driver has been broken since.

Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
CC: Heiko Schocher <hs@denx.de>
CC: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoARM: rmobile: Enable CONFIG_PCI_REGION_MULTI_ENTRY on RCar3
Marek Vasut [Fri, 15 Jan 2021 23:27:50 +0000 (00:27 +0100)]
ARM: rmobile: Enable CONFIG_PCI_REGION_MULTI_ENTRY on RCar3

R-Car3 can have multiple regions of type memory in DT, enable
CONFIG_PCI_REGION_MULTI_ENTRY to handle those instead of using
just one of the memory regions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agopci: renesas: Fix BAR mapping on Gen3
Marek Vasut [Fri, 15 Jan 2021 23:33:17 +0000 (00:33 +0100)]
pci: renesas: Fix BAR mapping on Gen3

Because the first PCIExAR(n) register is configured with the mapping,
It is the second PCIExAR(n) register that must be written with 0, not
the last one. Update the n from 4 to 1 to select the correct register.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 years agopci: renesas: Make map address and mask power of two on Gen3
Marek Vasut [Sun, 24 Jan 2021 17:37:11 +0000 (18:37 +0100)]
pci: renesas: Make map address and mask power of two on Gen3

Both the map address and mask must be power of two per documentation,
adjust the code accordingly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 years agopci: renesas: Add root bus handling on Gen3
Marek Vasut [Fri, 15 Jan 2021 23:28:18 +0000 (00:28 +0100)]
pci: renesas: Add root bus handling on Gen3

Add code to access the PCIe root bus space and configure it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sat, 20 Feb 2021 02:06:16 +0000 (21:06 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

- H616 clock fix to enable video PLL
- sunxi-common.h cleanups
- support for UART1 as the console on sun8i
- removing wrong linux,stdout-path from DTs

3 years agofdt/sunxi: Remove OF_STDOUT_PATH
Andre Przywara [Sun, 14 Feb 2021 10:35:18 +0000 (10:35 +0000)]
fdt/sunxi: Remove OF_STDOUT_PATH

OF_STDOUT_PATH was meant to hold the devicetree path to the serial
console, to be put into the linux,stdout-path property of the chosen node.

The only user of that was sunxi, and it was actually wrong for years
there: the paths hardcoded in sunxi_common.h were not matching the DTs,
evident by the leading 0's in nodenames, which have been removed years
ago.

On top of that, "linux,stdout-path" is now deprecated for a while (Linux
commit 2a9d832cc9aae from November 2014), and also all modern DTs
(including those included in U-Boot) carry a "stdout-path" property
already.

So remove the stanza from sunxi_common.h, and, since this was the last
user, also remove the associated bits from the rest of U-Boot.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosunxi: support boot console on uart1 for sun8i
Tobias Schramm [Sun, 14 Feb 2021 23:19:58 +0000 (00:19 +0100)]
sunxi: support boot console on uart1 for sun8i

The A23, A33, H3, H5, A83T, V3 and Sochip S3 sun8i SoCs can mux uart1 on
GPIOs PG6 and PG7. This patch adds support for using uart1 on those pins
as boot console.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: Remove dead ifdefs in sunxi-common.h
Samuel Holland [Mon, 8 Feb 2021 06:04:57 +0000 (00:04 -0600)]
sunxi: Remove dead ifdefs in sunxi-common.h

As variables were moved to Kconfig, some of the surrounding ifdefs were
left around, even though they were empty. Clean them up.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: spl: Fix H616 clock initialization
Jernej Skrabec [Mon, 1 Feb 2021 17:25:57 +0000 (18:25 +0100)]
sunxi: spl: Fix H616 clock initialization

It turns out that there is a magic bit in PRCM region which seemingly
makes PLLs work if it's enabled. Sadly, there is no documentation what
it does exactly, so we'll just mimick BSP boot0 behaviour and enable it
before any clock is set up.

Fixes: b18bd53d6cde ("sunxi: introduce support for H616 clocks")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agodrivers: video: Add Support for Himax HX8238D Panel
Moses Christopher [Wed, 6 Jan 2021 15:31:35 +0000 (15:31 +0000)]
drivers: video: Add Support for Himax HX8238D Panel

* SPI based initialization for HX8238D
* Resolution: 320x240
* Color-Mode: RGB

* Initial Work is done by Sjoerd Simons
  https://gitlab.apertis.org/packaging/u-boot/-/blob\
  /5f259720e3e64965d50da89a841ad6eb256a47df/debian/patches\
  /apertis/powertools/0005-video-Add-Himax-HX8238-D-driver.patch

* Tested on Bosch Guardian Board

Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Moses Christopher <BollavarapuMoses.Christopher@in.bosch.com>
3 years agoReplace video_uc_platdata with video_uc_plat
Dario Binacchi [Sat, 23 Jan 2021 18:43:52 +0000 (19:43 +0100)]
Replace video_uc_platdata with video_uc_plat

The video_uc_platdata structure no longer exists. It has been renamed
video_uc_plat.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: remove unused include/mb862xx.h
Heinrich Schuchardt [Tue, 29 Dec 2020 11:52:51 +0000 (12:52 +0100)]
video: remove unused include/mb862xx.h

CONFIG_VIDEO_MB862xx cannot be selected by any configuration.
So we can eliminate include/mb862xx.h.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agovideo: eliminate unused drivers/video/mb862xx.c
Heinrich Schuchardt [Tue, 29 Dec 2020 11:52:50 +0000 (12:52 +0100)]
video: eliminate unused drivers/video/mb862xx.c

The mb862xx driver does not conform to the driver model and is unused.
Eliminate it.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agovideo: simple_panel: Add boe,nv101wxmn51 display
Alper Nebi Yasak [Tue, 27 Oct 2020 21:41:55 +0000 (00:41 +0300)]
video: simple_panel: Add boe,nv101wxmn51 display

Add "boe,nv101wxmn51" to the compatible node. This is the panel for
chromebook_bob.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agovideo: simple_panel: Add sharp,lq123p1jx31 display
Alper Nebi Yasak [Tue, 27 Oct 2020 21:41:54 +0000 (00:41 +0300)]
video: simple_panel: Add sharp,lq123p1jx31 display

Add "sharp,lq123p1jx31" to the compatible node. This is the panel for
chromebook_kevin.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon: splash_source: fix -Wint-to-pointer-cast warning
Jaehoon Chung [Mon, 7 Dec 2020 08:18:51 +0000 (17:18 +0900)]
common: splash_source: fix -Wint-to-pointer-cast warning

Fix -Wint-to-pointer-cast warning

common/splash_source.c: In function 'splash_load_raw':
common/splash_source.c:100:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  100 |  bmp_hdr = (struct bmp_header *)bmp_load_addr;
      |            ^
common/splash_source.c: In function 'splash_sf_read_raw':
common/splash_source.c:39:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   39 |  return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
      |                                               ^

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge tag 'mmc-2021-2-19' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Fri, 19 Feb 2021 16:56:14 +0000 (11:56 -0500)]
Merge tag 'mmc-2021-2-19' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

- mmc_spi improvement
- added mmc-pwrseq to remove duplicated code
- fix response timeout after switch command
- sdhci: skip cache invalidation if DMA is not used

3 years agoconfigs: enable CONFIG_MMC_PWRSEQ configuration
Jaehoon Chung [Tue, 16 Feb 2021 01:16:56 +0000 (10:16 +0900)]
configs: enable CONFIG_MMC_PWRSEQ configuration

Enable CONFIG_MMC_PWRSEQ configuration about boards that is using
rockchip_dw_mmc driver.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: mach-meson: select MMC_PWRSEQ config
Jaehoon Chung [Tue, 16 Feb 2021 01:16:55 +0000 (10:16 +0900)]
ARM: mach-meson: select MMC_PWRSEQ config

Before time, PWRSEQ is selected since below commit.
commit 262d34363373 ("board: amlogic: select PWRSEQ for all amlogic platform")
Select MMC_PWRSEQ config because of introducing CONFIG_MMC_PWRSEQ for
only eMMC module.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: rockchip_dw_mmc: use mmc_pwrseq instead of rockchip_mmc_pwrseq
Jaehoon Chung [Tue, 16 Feb 2021 01:16:54 +0000 (10:16 +0900)]
mmc: rockchip_dw_mmc: use mmc_pwrseq instead of rockchip_mmc_pwrseq

Use mmc_pwrseq instead of rockchip_mmc_pwrseq.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: meson_gx_mmc: use mmc_pwrseq instead of meson_mmc_pwrseq
Jaehoon Chung [Tue, 16 Feb 2021 01:16:53 +0000 (10:16 +0900)]
mmc: meson_gx_mmc: use mmc_pwrseq instead of meson_mmc_pwrseq

Use mmc_pwrseq instead of meson_mmc_pwrseq.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agommc: pwrseq: add mmc-pwrseq file to provide a generic interface
Jaehoon Chung [Tue, 16 Feb 2021 01:16:52 +0000 (10:16 +0900)]
mmc: pwrseq: add mmc-pwrseq file to provide a generic interface

Add mmc-pwrseq file to provide a generic interface.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: mmc_spi: Document the 3 local functions
Bin Meng [Tue, 2 Feb 2021 02:48:48 +0000 (10:48 +0800)]
mmc: mmc_spi: Document the 3 local functions

mmc_spi_sendcmd(), mmc_spi_readdata() and mmc_spi_writedata() are
currently undocumented. Add comment blocks to explain the arguments
and the return value.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: mmc_spi: Fix potential spec violation in receiving card response
Bin Meng [Tue, 2 Feb 2021 02:48:47 +0000 (10:48 +0800)]
mmc: mmc_spi: Fix potential spec violation in receiving card response

After command is sent and before card response shows up on the line,
there is a variable number of clock cycles in between called Ncr.
The spec [1] says the minimum is 1 byte and the maximum is 8 bytes.

Current logic in mmc_spi_sendcmd() has a flaw that it could only work
with certain SD cards with their Ncr being just 1 byte.

When resp_match is false, the codes try to receive only 1 byte from
the SD card. On the other hand when resp_match is true, the logic
happens to be no problem as it loops until timeout to receive as many
bytes as possible to see a match of the expected resp_match_value.
However not every call to mmc_spi_sendcmd() is made with resp_match
being true hence this exposes a potential issue with SD cards that
have a larger Ncr value.

Given no issue was reported as of today, we can reasonably conclude
that all cards being used on the supported boards happen to have a 1
byte Ncr timing requirement. But a broken case can be triggered by
utilizing QEMU to emulate a larger value of Ncr (by default 1 byte
Ncr is used on QEMU). This commit fixes such potential spec violation
to improve the card compatibility.

[1] "Physical Layer Specification Version 8.00"
     chapter 7.5.1: Command / Response
     chapter 7.5.4: Timing Values

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: mmc_spi: Move argument check to the beginning of mmc_spi_sendcmd()
Bin Meng [Tue, 2 Feb 2021 02:48:46 +0000 (10:48 +0800)]
mmc: mmc_spi: Move argument check to the beginning of mmc_spi_sendcmd()

The argument check should happen before any transfer on the SPI lines.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: mmc_spi: Print verbose debug output when crc16 check fails
Bin Meng [Tue, 2 Feb 2021 02:32:48 +0000 (10:32 +0800)]
mmc: mmc_spi: Print verbose debug output when crc16 check fails

Add some verbose debug output when crc16 check fails.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fix response timeout after switch command
Stefan Bosch [Sat, 23 Jan 2021 12:37:41 +0000 (13:37 +0100)]
mmc: fix response timeout after switch command

After issuing the switch command: Wait until 'current state' of the card
status becomes 'tran'. This prevents from response timeout at the next
command because of 'current state' = 'data'.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: sdhci: skip cache invalidation if DMA is not used
Yuezhang.Mo@sony.com [Thu, 14 Jan 2021 05:46:50 +0000 (05:46 +0000)]
mmc: sdhci: skip cache invalidation if DMA is not used

If DMA(SDMA or ADMA) is not used, the cache invalidation
after reading is no need, should be skipped. Otherwise
U-Boot may hang at the cache invalidation.

Found this issue and tested this fix on DragonBoard 410c.

Fixes: commit 4155ad9aac94 ("mmc: sdhci: fix missing cache invalidation after reading by DMA")

Signed-off-by: Yuezhang.Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
3 years agocmd: mmc: update the mmc command's usage about argument
Jaehoon Chung [Tue, 15 Dec 2020 22:24:50 +0000 (07:24 +0900)]
cmd: mmc: update the mmc command's usage about argument

It's confusing whether arguments are optional or mandatory.
Update the command's usage to clarify how to use.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agommc: initialize an err variable
Jaehoon Chung [Thu, 3 Dec 2020 21:36:00 +0000 (06:36 +0900)]
mmc: initialize an err variable

Initialize an err variable to 0.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reported-by: Coverity (CID: 313548)
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-02-18-SPL-FIT-OP-TEE-Linux-improvements'
Tom Rini [Thu, 18 Feb 2021 17:02:11 +0000 (12:02 -0500)]
Merge branch '2021-02-18-SPL-FIT-OP-TEE-Linux-improvements'

- Improve interactions between SPL / OP-TEE and Linux in FIT images

3 years agonet: tftp: Avoid sending extra ack on completion
Ramon Fried [Wed, 3 Feb 2021 19:28:59 +0000 (21:28 +0200)]
net: tftp: Avoid sending extra ack on completion

in tftpboot, if ack was already sent previously for this
packet, don't send again.

Fixes: cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440")

Reported-by: Suneel Garapati <suneelglinux@gmail.com>
Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Suneel Garapati <suneelglinux@gmail.com>
Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
3 years agoMerge tag 'rpi-next-2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspb...
Tom Rini [Thu, 18 Feb 2021 13:06:26 +0000 (08:06 -0500)]
Merge tag 'rpi-next-2021.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi

- add iProc RNG2000 driver for RPi4
- add support for CM4 and RPi400

3 years agovideo: arm: rpi: Add brcm,bcm2711-hdmi0 compatible
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:31 +0000 (13:55 +0100)]
video: arm: rpi: Add brcm,bcm2711-hdmi0 compatible

The 'brcm,bcm2711-hdmi0' compatible string is used on RPi4 instead of
'brcm,bcm2835-hdmi' since the IP core was upgraded (now called VC6
instead of VC4). This has no functional change as far as u-boot driver
is concerned. So simply add the compatible string.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoconfigs: rpi4: Enable DM_DMA across all RPi4 configurations
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:30 +0000 (13:55 +0100)]
configs: rpi4: Enable DM_DMA across all RPi4 configurations

The DM_DMA option is needed in order to translate physical address into
bus addresses on a per-device basis.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agommc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:29 +0000 (13:55 +0100)]
mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

This will allow us to use DM variants of phys_to_bus()/bus_to_phys()
when relevant.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoxhci: translate virtual addresses into the bus's address space
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:28 +0000 (13:55 +0100)]
xhci: translate virtual addresses into the bus's address space

So far we've been content with passing physical addresses when
configuring memory addresses into XHCI controllers, but not all
platforms have buses with transparent mappings. Specifically the
Raspberry Pi 4 might introduce an offset to memory accesses incoming
from its PCIe port.

Introduce xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these
limitations, and make sure we don't break non DM users.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
[mb: fix compilation for 32 bit]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
fix from nicolas

3 years agodm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:27 +0000 (13:55 +0100)]
dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()

By reusing DT nodes already available in sandbox's test DT introduce a
test to validate dev_phys_to_bus()/dev_bus_to_phys().

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agodm: Introduce dev_phys_to_bus()/dev_bus_to_phys()
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:26 +0000 (13:55 +0100)]
dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

These functions, instead of relying on hard-coded platform-specific
address translations, make use of the DMA constraints provided by the DM
core. This allows for per-device translations.

We can't yet get rid of the legacy phys_to_bus()/bus_to_phys()
implementations as some of its users are not integrated into the
device model.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agodm: test: Add test case for dev->dma_offset
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:25 +0000 (13:55 +0100)]
dm: test: Add test case for dev->dma_offset

Add test to validate dev->dma_offset is properly set on devices.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agodm: Introduce DMA constraints into the core device model
Nicolas Saenz Julienne [Tue, 12 Jan 2021 12:55:24 +0000 (13:55 +0100)]
dm: Introduce DMA constraints into the core device model

Calculating the DMA offset between a bus address space and CPU's every
time we call phys_to_bus() and bus_to_phys() isn't ideal performance
wise, as it implies traversing the device tree from the device's node up
to the root. Since this information is static and available before the
device's initialization, parse it before the probe call an provide the
DMA offset in 'struct udevice' for the address translation code to use
it.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>