pandora-u-boot.git
3 years agomtd: spi-nor-ids: Add support of flash protection to w25q128
Su Baocheng [Mon, 25 Jan 2021 02:59:05 +0000 (10:59 +0800)]
mtd: spi-nor-ids: Add support of flash protection to w25q128

The NOR flash w25q128 denoted by JEDEC ID 0xef4018 actually represents
various models. From Winbond's website, I could only find 3 types of
them:

    W25Q128JV-IQ/JQ
    datasheet:https://www.winbond.com/resource-files/
w25q128jv%20revg%2004082019%20plus.pdf

    W25Q128FV (SPI Mode)
    datasheet: https://www.winbond.com/resource-files/
w25q128fv%20rev.m%2005132016%20kms.pdf

    W25Q128BV
    datesheet: https://www.winbond.com/resource-files/
w25q128bv_revh_100313_wo_automotive.pdf

According to the datasheets, all of these 3 types support BP(0,1,2) and
TB bits in the status register (SR), so it could reuse the flash
protection logic for ST Micro.

So it should be safe to add the SPI_NOR_HAS_LOCK and SPI_NOR_HAS_TB
flags to the w25q128 entry of spi_nor_ids table.

Signed-off-by: Su Baocheng <baocheng.su@siemens.com>
[jagan: remove comments in spi-nor-ids.c]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: spi-nor.h: Change spaces to tabs
Bin Meng [Wed, 6 Jan 2021 12:58:54 +0000 (20:58 +0800)]
mtd: spi-nor.h: Change spaces to tabs

U-Boot coding convention prefers tabs over spaces.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agomtd: spi-nor-ids: Add Gigadevice GD25LQ64C
Alper Nebi Yasak [Sat, 31 Oct 2020 16:20:12 +0000 (19:20 +0300)]
mtd: spi-nor-ids: Add Gigadevice GD25LQ64C

Add GD25LQ24C 64Mbit chip to spi-nor id table. This chip is used on
rk3399-gru-kevin:

    => sf probe
    SF: Detected gd25lq64c with page size 256 Bytes, erase size 4 KiB, total 8 MiB
    => sf erase 0x600000 0x200000
    SF: 2097152 bytes @ 0x600000 Erased: OK
    => sf test 0x700000 0x1000
    SPI flash test:
    0 erase: 52 ticks, 76 KiB/s 0.608 Mbps
    1 check: 5 ticks, 800 KiB/s 6.400 Mbps
    2 write: 14 ticks, 285 KiB/s 2.280 Mbps
    3 read: 3 ticks, 1333 KiB/s 10.664 Mbps
    Test passed
    0 erase: 52 ticks, 76 KiB/s 0.608 Mbps
    1 check: 5 ticks, 800 KiB/s 6.400 Mbps
    2 write: 14 ticks, 285 KiB/s 2.280 Mbps
    3 read: 3 ticks, 1333 KiB/s 10.664 Mbps

The values are the same as in Linux, except adjusted for the U-Boot
definition of INFO().

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: imx: Implement set_speed
Marek Vasut [Wed, 3 Feb 2021 16:53:57 +0000 (17:53 +0100)]
spi: imx: Implement set_speed

The set_speed() callback should configure the bus speed, make it so.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoMerge branch '2021-02-25-remove-platforms'
Tom Rini [Thu, 25 Feb 2021 18:18:27 +0000 (13:18 -0500)]
Merge branch '2021-02-25-remove-platforms'

- Remove various older platforms that are missing DM migrations and have
  had their removal ack'd.

3 years agoppc: Remove MPC8569MDS board
Tom Rini [Sun, 21 Feb 2021 01:06:29 +0000 (20:06 -0500)]
ppc: Remove MPC8569MDS board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is the last ARCH_MPC8569 board, remove that support
as well.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoppc: configs: Remove a few non-updated build configurations
Tom Rini [Sun, 21 Feb 2021 01:06:28 +0000 (20:06 -0500)]
ppc: configs: Remove a few non-updated build configurations

In the cases of T2080RDB_SECURE_BOOT, T2080RDB_SRIO_PCIE_BOOT,
P2041RDB_SECURE_BOOT, P2041RDB_SRIO_PCIE_BOOT, P3041DS_SRIO_PCIE_BOOT
and P4080DS_SRIO_PCIE_BOOT while some forms of the board have been
migrated more fully to current build standards, these have not.  Remove
them.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: Remove sksimx6 board
Tom Rini [Sun, 21 Feb 2021 01:06:17 +0000 (20:06 -0500)]
arm: Remove sksimx6 board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>
3 years agoarm: Remove mx53smd board
Tom Rini [Sun, 21 Feb 2021 01:06:12 +0000 (20:06 -0500)]
arm: Remove mx53smd board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: Remove mx53ard board
Tom Rini [Sun, 21 Feb 2021 01:06:10 +0000 (20:06 -0500)]
arm: Remove mx53ard board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: Remove mx25pdk board
Tom Rini [Sun, 21 Feb 2021 01:05:44 +0000 (20:05 -0500)]
arm: Remove mx25pdk board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoMerge branch '2021-02-24-assorted-fixes'
Tom Rini [Thu, 25 Feb 2021 13:20:54 +0000 (08:20 -0500)]
Merge branch '2021-02-24-assorted-fixes'

- squashfs, btrfs fixes
- Kconfig CONFIG logic fixes
- hikey DM migration
- Some portability fixes for the build system
- Assorted code cleanups

3 years agocommon: Add "ifndef __ASSEMBLY__" in asm/global_data.h
Siew Chin Lim [Tue, 23 Feb 2021 06:34:37 +0000 (14:34 +0800)]
common: Add "ifndef __ASSEMBLY__" in asm/global_data.h

Commit "common: Drop asm/global_data.h from common header" added
asm/global_data.h into secure.h. However, secure.h will be included
by psci.S. Adding asm/global_data.h has caused compilation failure in
pcsi.S. Add "ifndef __ASSEMBLY__" in asm/global_data.h.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agonet: cortina_ni: buffer overrun
Heinrich Schuchardt [Sat, 20 Feb 2021 09:44:04 +0000 (10:44 +0100)]
net: cortina_ni: buffer overrun

When copying to a u32 field we should use sizeof(u32) and not
sizeof(*u32) in memcpy.

On 64bit systems like cortina_presidio-asic-emmc_defconfig using
sizeof(*u32) leads to a buffer overrun.

Fixes: febe13b438b3 ("net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
3 years agomtd: rawnand: cortina_nand: missing initialization
Heinrich Schuchardt [Sat, 20 Feb 2021 09:42:50 +0000 (10:42 +0100)]
mtd: rawnand: cortina_nand: missing initialization

ca_do_bch_correction() takes a random value from the stack and starts
counting bitflips from this value. Initialize the counter.

This passed unnoticed as the value is finally ignored in the call
hierarchy.

Fixes: 161df94b3c43 ("mtd: rawnand: cortina_nand: Add Cortina CAxxxx SoC support")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodm: ddr: socfpga: don't assign values that are not used
Heinrich Schuchardt [Sat, 20 Feb 2021 09:40:23 +0000 (10:40 +0100)]
dm: ddr: socfpga: don't assign values that are not used

The values of left_edge[0] and right_edge[0] are overwritten before they
are used. Remove the superfluous assignments.

Fixes: 285b3cb939a8 ("dm: ddr: socfpga: fix gen5 ddr driver to not use bss")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: sha512: include "compiler.h"
Siew Chin Lim [Fri, 19 Feb 2021 02:32:07 +0000 (10:32 +0800)]
lib: sha512: include "compiler.h"

Include "compiler.h" in sha512.c. This is needed by 'cpu_to_be64' macro
that used in 'sha512_base_do_finalize' function.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agorng: iProc rng200: Rename ..._platdata variables to just ..._plat
Peter Robinson [Thu, 18 Feb 2021 20:06:37 +0000 (20:06 +0000)]
rng: iProc rng200: Rename ..._platdata variables to just ..._plat

In 8a8d24bd Simon dropped data from all the various _platdata calls
but it seems this wasn't caught for the RNG200 driver from when it
was posted to merged. This fixes that issue.

Fixes: 537f0018 (rng: Add iProc RNG200 driver)
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
3 years agotest: missing dependency for test/cmd/setexpr.c
Heinrich Schuchardt [Wed, 17 Feb 2021 11:58:14 +0000 (12:58 +0100)]
test: missing dependency for test/cmd/setexpr.c

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to `setexpr_regex_sub'
ld.bfd: test/built-in.o: in function `setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: rsa: struct udevice build warning
Heinrich Schuchardt [Wed, 17 Feb 2021 11:54:31 +0000 (12:54 +0100)]
lib: rsa: struct udevice build warning

Avoid build warnings observed with gcc 10.2

In file included from lib/rsa/rsa-keyprop.c:16:
include/u-boot/rsa-mod-exp.h:65:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   65 | int rsa_mod_exp(struct udevice *dev, const uint8_t *sig,
      | uint32_t sig_len,
      |                        ^~~~~~~
include/u-boot/rsa-mod-exp.h:96:24: warning:
‘struct udevice’ declared inside parameter list will not be visible
outside of this definition or declaration
   96 |  int (*mod_exp)(struct udevice *dev, const uint8_t *sig,
      |

by defining struct udevice.

Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoconfigs: BPI-R2: Disable EFI Grub workaround
Matthias Brugger [Tue, 16 Feb 2021 19:54:07 +0000 (20:54 +0100)]
configs: BPI-R2: Disable EFI Grub workaround

The EFI Grub workaround on BananaPi R2 slows down the boot process to
the point, that the watchdog will trigger a reboot before the kernel can
reset it. Fix this by disabeling the workaround.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
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>