oweals/u-boot.git
4 years agonet: phy: dp83867: Add SGMII mode type switching
Michal Simek [Tue, 18 Feb 2020 12:51:02 +0000 (13:51 +0100)]
net: phy: dp83867: Add SGMII mode type switching

This patch adds ability to switch beetween two PHY SGMII modes.
Some hardware, for example, FPGA IP designs may use 6-wire mode
which enables differential SGMII clock to MAC.

Patch description, dt flags have been done in mainline Linux by
commit a2111c460c0c ("net: phy: dp83867: Add documentation for SGMII mode type")
and by commit 507ddd5c0d47 ("net: phy: dp83867: Add SGMII mode type switching")

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agodt-bindings: net: dp83867: Remove binding doc from U-Boot tree
Michal Simek [Mon, 17 Feb 2020 09:38:57 +0000 (10:38 +0100)]
dt-bindings: net: dp83867: Remove binding doc from U-Boot tree

U-Boot is having DT which doesn't cover all options currently supported by
driver. DT binding is aligned with Linux kernel version available here.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ti,dp83867.txt
Based on my talk with Grygorii Strashko better will be to remove it.

Also Linux kernel bindings are being converted to yaml that's another
reason to do it only at one place.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
4 years agonet: phy: add XFI, USXGMII types to is_10g_interface() helper
Alex Marginean [Thu, 9 Jan 2020 08:50:05 +0000 (10:50 +0200)]
net: phy: add XFI, USXGMII types to is_10g_interface() helper

The helper is used to reset PHYs on connect and it determines the clause
to use (C22/C45) based on interface type.  This fixes 'PHY reset timed out'
warnings in console for USXGMII/XFI PHYs.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agonet: phy: Fix overlong PHY timeout
Andre Przywara [Fri, 3 Jan 2020 22:08:47 +0000 (22:08 +0000)]
net: phy: Fix overlong PHY timeout

Commit 27c3f70f3b50 ("net: phy: Increase link up delay in
genphy_update_link()") increased the per-iteration waiting time from
1ms to 50ms, without adjusting the timeout counter. This lead to the
timeout increasing from the typical 4 seconds to over three minutes.

Adjust the timeout counter evaluation by that factor of 50 to bring the
timeout back to the intended value.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Fixes: net: phy: Increase link up delay in genphy_update_link() ("27c3f70f3b50")
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agodoc: net: Rewrite network driver documentation
Andre Przywara [Mon, 25 Nov 2019 01:32:15 +0000 (01:32 +0000)]
doc: net: Rewrite network driver documentation

doc/README.drivers.eth seems like a good source for understanding
U-Boot's network subsystem, but is only talking about legacy network
drivers. This is particularly sad as proper documentation would help in
porting drivers over to the driver model.

Rewrite the document to describe network drivers in the new driver model
world. Most driver callbacks/methods are almost identical in their
semantic, but recv() differs in some important details.

Also keep some parts of the original text at the end, to help
understanding old drivers. Add some hints on how to port drivers over.

This also uses the opportunity to reformat the document in reST, on the
way moving it into doc/driver-model and adding it into the structure
there.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agodrivers: net: phy: aquantia: make it less verbose
Alex Marginean [Wed, 4 Dec 2019 13:32:16 +0000 (15:32 +0200)]
drivers: net: phy: aquantia: make it less verbose

The driver now unconditionally prints some information that's not
universally useful.  Replace printf with debug.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agodrivers: net: phy: aquantia: drop XGMII as a valid system interface proto
Alex Marginean [Wed, 4 Dec 2019 13:32:15 +0000 (15:32 +0200)]
drivers: net: phy: aquantia: drop XGMII as a valid system interface proto

Use either USXGMII or XFI in aquantia_set_proto and drop XGMII as a valid
protocol configuration.  The PHY doesn't support it, it's just used as an
alias for one of the other two protocols.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agoenv: Update env_addr for mmc environment driver
Pankit Garg [Tue, 19 Nov 2019 09:49:31 +0000 (09:49 +0000)]
env: Update env_addr for mmc environment driver

Make sure the gd struct is up-to-date.

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agophy: Include NC-SI in phy setup
Samuel Mendoza-Jonas [Tue, 18 Jun 2019 01:37:18 +0000 (11:37 +1000)]
phy: Include NC-SI in phy setup

Add NC-SI to the usual phy handling. This makes two notable changes:
- Somewhat similar to a fixed phy, phy_connect() will create an NC-SI
phy if CONFIG_PHY_NCSI is defined.
- An early return is added to phy_read() and phy_write() to handle a
case like the NC-SI phy which does not define a bus.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agophy: Add support for the NC-SI protocol
Samuel Mendoza-Jonas [Tue, 18 Jun 2019 01:37:17 +0000 (11:37 +1000)]
phy: Add support for the NC-SI protocol

This introduces support for the NC-SI protocol, modelled as a phy driver
for other ethernet drivers to consume.

NC-SI (Network Controller Sideband Interface) is a protocol to manage a
sideband connection to a proper network interface, for example a BMC
(Baseboard Management Controller) sharing the NIC of the host system.
Probing and configuration occurs by communicating with the "remote" NIC
via NC-SI control frames (Ethernet header 0x88f8).

This implementation is roughly based on the upstream Linux
implementation[0], with a reduced feature set and an emphasis on getting
a link up as fast as possible rather than probing the full possible
topology of the bus.
The current phy model relies on the network being "up", sending NC-SI
command frames via net_send_packet() and receiving them from the
net_loop() loop (added in a following patch).

The ncsi-pkt.h header[1] is copied from the Linux kernel for consistent
field definitions.

[0]: https://github.com/torvalds/linux/tree/master/net/ncsi
[1]: https://github.com/torvalds/linux/blob/master/net/ncsi/ncsi-pkt.h

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agoMakefile: fix processing of default environment file
Samuel Mescoff [Mon, 15 Apr 2019 10:28:26 +0000 (12:28 +0200)]
Makefile: fix processing of default environment file

Allow the default environment file to contain long lines split into
multiples lines.

Leading white spaces can be added for readability as well.

Signed-off-by: Samuel Mescoff <samuel@mescoff.fr>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 5 Mar 2020 00:21:00 +0000 (19:21 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- Limit bootloader size to 1 MiB on R-Car Gen3

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Wed, 4 Mar 2020 15:41:41 +0000 (10:41 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

- ABB SECU board
- Assorted minor fixes

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Wed, 4 Mar 2020 15:41:27 +0000 (10:41 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

- DFU / Thor fixes

4 years agoMerge tag 'dm-pull-3mar20' of git://git.denx.de/u-boot-dm
Tom Rini [Wed, 4 Mar 2020 02:48:49 +0000 (21:48 -0500)]
Merge tag 'dm-pull-3mar20' of git://git.denx.de/u-boot-dm

Fixes for power domain on device removal

4 years agoARM: socfpga: Add initial support for the ABB SECU board
Holger Brunck [Wed, 19 Feb 2020 18:55:14 +0000 (19:55 +0100)]
ARM: socfpga: Add initial support for the ABB SECU board

Add initial support for the ABB SECU board, which is an ArriaV-based
SoCFPGA system with ethernet and booting from Denali NAND.

Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
4 years agovideo: meson: keep power domain up after booting
Anatolij Gustschin [Mon, 17 Feb 2020 11:36:44 +0000 (12:36 +0100)]
video: meson: keep power domain up after booting

Add driver flag to skip power domain disabling on device removal.

Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
4 years agodm: core: Add a flag for power domain control on device removal
Anatolij Gustschin [Mon, 17 Feb 2020 11:36:43 +0000 (12:36 +0100)]
dm: core: Add a flag for power domain control on device removal

In various cases a power domain must stay enabled after device
removal when booting OS (i.e. serial debug console or display).
Add a flag to selectively skip switching off a power domain.

Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge tag 'u-boot-stm32-20200203' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 2 Mar 2020 14:20:30 +0000 (09:20 -0500)]
Merge tag 'u-boot-stm32-20200203' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- convert stm32mp1 board documentation to rst format

4 years agoMerge tag 'xilinx-for-v2020.04-rc4' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 2 Mar 2020 14:20:12 +0000 (09:20 -0500)]
Merge tag 'xilinx-for-v2020.04-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx fixes for v2020.04-rc4

- Fix link good bit handling in dp83867
- Rename generic Zynq defconfig
- Fix zybo z7 low leve setup
- Fix error path in zynq_gem driver and fix 64bit usage
- Fix invalid clock name quieries for Versal
- Fix zynq/zynqmp SPL low level configuration via DT selection

4 years agodoc: add board documentation for stm32mp1
Patrick Delaunay [Tue, 25 Feb 2020 18:04:14 +0000 (19:04 +0100)]
doc: add board documentation for stm32mp1

Change plain test README to rst format and move this file
in documentation directory.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp1: rng: remove superfluous assignment
Heinrich Schuchardt [Sun, 16 Feb 2020 09:11:18 +0000 (10:11 +0100)]
stm32mp1: rng: remove superfluous assignment

We should not assign a value that is overwritten before use.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: socfpga: Add missing Denali NAND config options
Marek Vasut [Sat, 15 Feb 2020 13:10:09 +0000 (14:10 +0100)]
ARM: socfpga: Add missing Denali NAND config options

The Denali SPL shim won't build without these options set,
set them accordingly to fix the build error and let the SPL
shim to work correctly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
4 years agoARM: socfpga: Permit overriding the default timer frequency
Marek Vasut [Sat, 15 Feb 2020 13:10:02 +0000 (14:10 +0100)]
ARM: socfpga: Permit overriding the default timer frequency

The default timer rate may be different than 25 MHz, permit overriding
the default rate in board configuration file. Ultimatelly, this should
be properly handled by a clock driver, however that is not available
on Gen5 yet.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
4 years agortc: m41t62: add compatible for m41st87
Marek Vasut [Sat, 15 Feb 2020 13:46:10 +0000 (14:46 +0100)]
rtc: m41t62: add compatible for m41st87

This adds a compatible string for m41st87. This ensures that this driver
can be used for m41st87.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agogadget: f_thor: add missing line breaks for pr_err()
Seung-Woo Kim [Thu, 13 Feb 2020 08:24:11 +0000 (17:24 +0900)]
gadget: f_thor: add missing line breaks for pr_err()

After the commit 9b643e312d52 ("treewide: replace with error()
with pr_err()"), there are pr_err() usages without line break. Add
missing line breaks for pr_err() used in f_thor.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agodfu: Reset timeout in case of DFU request
Andy Shevchenko [Wed, 29 Jan 2020 15:23:14 +0000 (17:23 +0200)]
dfu: Reset timeout in case of DFU request

In case dfu command is being executed with timeout option,
the timer may expire in the middle of DFU operation. If there
is DFU request coming, we may simple reset timeout value
to prevent aborting of ongoing DFU operation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
4 years agoARM: rmobile: Limit bootloader size to 1 MiB on R-Car Gen3
Marek Vasut [Fri, 24 Jan 2020 00:31:37 +0000 (01:31 +0100)]
ARM: rmobile: Limit bootloader size to 1 MiB on R-Car Gen3

The HF/QSPI flash layout permits up to 1 MiB large bootloader blob,
set CONFIG_BOARD_SIZE_LIMIT to enforce this limit and set the
monitor size to match accordingly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 years agoMerge tag 'efi-2020-04-rc4-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 29 Feb 2020 13:01:07 +0000 (08:01 -0500)]
Merge tag 'efi-2020-04-rc4-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4 (2)

In Linux next-20200228 patches have been merged to load an initial ramdisk
using an EFI_LOAD_FILE2_PROTOCOL provided by the firmware. See commit
ec93fc371f01 ("efi/libstub: Add support for loading the initrd from a
device path"). The idea behind it is that the firmware should be
responsible for validating the initrd in a secure boot setup.

This pull-request comprises a patch series which let's U-Boot provide an
initial implementation of the EFI_LOAD_FILE2_PROTOCOL providing the initrd.

4 years agoMerge tag 'uniphier-v2020.04-3' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sat, 29 Feb 2020 13:00:53 +0000 (08:00 -0500)]
Merge tag 'uniphier-v2020.04-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier

UniPhier SoC updates for v2020.04 (3rd)

 - Enable ADMA and HS400 for the eMMC driver on 64-bit SoCs

 - Add some convenient environment variables to handle SD card

 - Sanitize the NAND controller reset sequence and its WP handling

 - Sync DT with Linux

4 years agoARM: dts: uniphier: remove U-Boot own EEPROM compatible and property
Masahiro Yamada [Fri, 28 Feb 2020 12:57:21 +0000 (21:57 +0900)]
ARM: dts: uniphier: remove U-Boot own EEPROM compatible and property

The compatible string "i2c-eeprom" is U-Boot own compatible, which
has never been approved by the DT community. "u-boot,i2c-offset-len"
is also a U-Boot own hack.

Linux adds "atmel,*" as generic compatibles, and U-Boot also followed
it by commit d7e28918aa3f ("i2c_eeprom: Add reading support").

The U-Boot own hack is no longer needed. Just sync with Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: dts: uniphier: add reset-names to NAND controller node
Masahiro Yamada [Fri, 28 Feb 2020 12:57:20 +0000 (21:57 +0900)]
ARM: dts: uniphier: add reset-names to NAND controller node

Import Linux commits:

37f3e0096f71 ("ARM: dts: uniphier: add reset-names to NAND controller node")
e98d5023fe1f ("arm64: dts: uniphier: add reset-names to NAND controller node")

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: dts: uniphier: rename DT nodes to follow json-schema
Masahiro Yamada [Fri, 28 Feb 2020 12:57:19 +0000 (21:57 +0900)]
ARM: dts: uniphier: rename DT nodes to follow json-schema

Import the nodename changes I made in Linux for avoiding dt-schama
warnings. This follows the $nodename patterns in the dt-schema.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agodoc/efi: add load file 2 protocol to HTML documentation
Heinrich Schuchardt [Sat, 22 Feb 2020 06:47:20 +0000 (07:47 +0100)]
doc/efi: add load file 2 protocol to HTML documentation

The load file 2 protocol can be used by the Linux kernel to load the initial
RAM disk. U-Boot can be configured to provide an implementation.

Add a description to the UEFI overview and document the related functions
in the API section.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: add selftests for loadfile2 used to load initramfs
Ilias Apalodimas [Fri, 21 Feb 2020 07:55:46 +0000 (09:55 +0200)]
efi_selftest: add selftests for loadfile2 used to load initramfs

Provide a unit test loading an initial ramdisk using the
EFI_LOAD_FILE2_PROTOCOL. The test is only executed on request.

An example usage - given a file image with a file system in partition 1
holding file initrd - is:

* Configure the sandbox with

  CONFIG_EFI_SELFTEST=y
  CONFIG_EFI_LOAD_FILE2_INITRD=y
  CONFIG_EFI_INITRD_FILESPEC="host 0:1 initrd"

* Run ./u-boot and execute

    host bind 0 image
    setenv efi_selftest load initrd
    bootefi selftest

This would provide a test output like:

    Testing EFI API implementation

    Selected test: 'load initrd'

    Setting up 'load initrd'
    Setting up 'load initrd' succeeded

    Executing 'load initrd'
    Loaded 12378613 bytes
    CRC32 2997478465
    Executing 'load initrd' succeeded

Now the size and CRC32 can be compared to the provided file.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Implement FileLoad2 for initramfs loading
Ilias Apalodimas [Fri, 21 Feb 2020 07:55:45 +0000 (09:55 +0200)]
efi_loader: Implement FileLoad2 for initramfs loading

Following kernel's proposal for an arch-agnostic initrd loading
mechanism [1] let's implement the U-boot counterpart.
This new approach has a number of advantages compared to what we did up
to now. The file is loaded into memory only when requested limiting the
area of TOCTOU attacks. Users will be allowed to place the initramfs
file on any u-boot accessible partition instead of just the ESP one.
Finally this is an attempt of a generic interface across architectures
in the linux kernel so it makes sense to support that.

The file location is intentionally only supported as a config option
argument(CONFIG_EFI_INITRD_FILESPEC), in an effort to enhance security.
Although U-boot is not responsible for verifying the integrity of the
initramfs, we can enhance the offered security by only accepting a
built-in option, which will be naturally verified by UEFI Secure Boot.
This can easily change in the future if needed and configure that via ENV
or UEFI variable.

[1] https://lore.kernel.org/linux-efi/20200207202637.GA3464906@rani.riverdale.lan/T/#m4a25eb33112fab7a22faa0fd65d4d663209af32f

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 28 Feb 2020 18:28:38 +0000 (13:28 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge branch '2020-02-28-mpc8xx-fixes'
Tom Rini [Fri, 28 Feb 2020 16:04:50 +0000 (11:04 -0500)]
Merge branch '2020-02-28-mpc8xx-fixes'

- Fix the watchdog on mpc8xx platforms

4 years agowatchdog: Don't select CONFIG_WATCHDOG and CONFIG_HW_WATCHDOG at the same time
Christophe Leroy [Wed, 26 Feb 2020 16:17:52 +0000 (16:17 +0000)]
watchdog: Don't select CONFIG_WATCHDOG and CONFIG_HW_WATCHDOG at the same time

Commit 06985289d452 ("watchdog: Implement generic watchdog_reset()
version") introduced an automatic selection of CONFIG_WATCHDOG by
CONFIG_WDT. But for boards selecting CONFIG_HW_WATCHDOG, like
boards have a powerpc 8xx, CONFIG_WATCHDOG shall not be selected
as they are mutually exclusive.

Make CONFIG_WATCHDOG dependent on !CONFIG_HW_WATCHDOG

Fixes: 06985289d452 ("watchdog: Implement generic watchdog_reset() version")
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agowatchdog: mpc8xx: Revert the 8xx watchdog back to CONFIG_HW_WATCHDOG
Christophe Leroy [Thu, 20 Feb 2020 07:39:51 +0000 (07:39 +0000)]
watchdog: mpc8xx: Revert the 8xx watchdog back to CONFIG_HW_WATCHDOG

Commit f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros
cleanup") switched the watchdog to CONFIG_WATCHDOG. But this is not
compatible with the 8xx because it starts the watchdog HW timer at
reset and must be serviced from the very beginning including while
U-boot is executed in the firmware before relocation in RAM.

Select CONFIG_HW_WATCHDOG and make hw_watchdog_reset() visible.

Meanwhile, finalise the cleanup of arch/powerpc/cpu/mpc8xx/Kconfig by
removing the lines put in comment in that commit, and also remove
again the selection of CONFIG_MPC8xx_WATCHDOG which was removed by
that commit and brought back by mistake by commit b3134ffbd944
("watchdog: Kconfig: Sort entry alphabetically")

Note that there was an 'imply WATCHDOG' in the original commit but
it disappeared in the Kconfig alphabetical sorting, so no need to
remove it here.

Fixes: f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup")
Fixes: b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoARM: zynq: Remove single comment about QSPI
Michal Simek [Tue, 25 Feb 2020 14:27:09 +0000 (15:27 +0100)]
ARM: zynq: Remove single comment about QSPI

Very likely configs have been moved to Kconfig by scripts and this just
remains there that's why remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Rename defconfig to be align with ZynqMP and Versal
Michal Simek [Thu, 13 Feb 2020 13:59:40 +0000 (14:59 +0100)]
ARM: zynq: Rename defconfig to be align with ZynqMP and Versal

Just cosmetic change before real switch.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm: xilinx: Fill DEVICE_TREE directly in Makefiles
Michal Simek [Thu, 13 Feb 2020 13:36:34 +0000 (14:36 +0100)]
arm: xilinx: Fill DEVICE_TREE directly in Makefiles

DEVICE_TREE variable is not exported from dts/Makefile that's why it is
necessary to setup directly before use.

Fixes: 312f2c5b14fa ("arm: xilinx: Use device tree which can be passed on cmd line")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: zynq: Free allocated buffers in case of error
Michal Simek [Thu, 6 Feb 2020 13:36:46 +0000 (14:36 +0100)]
net: zynq: Free allocated buffers in case of error

Driver probe function is called again and again in case of error.
Malloc space is getting full which is is reported by:
 Insufficient RAM for page table: 0x15000 > 0x14000.
 Please increase the size in get_page_table_size()
 ### ERROR ### Please RESET the board ###

The patch is freeing allocated buffers on error path to avoid panic.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: phy: dp83867: Clean force link good bit
Michal Simek [Thu, 6 Feb 2020 14:59:23 +0000 (15:59 +0100)]
net: phy: dp83867: Clean force link good bit

On Xilinx ZynqMP revA board initial value of PHYCR register is 0x5448 which
means FORCE_LINK_GOOD is already setup. Origin code was doing write but the
new code is doing read/modify/write and keep this bit untouched. That's why
ethernet stop to work.
The patch is cleaning this bit when PHYCR value is composed.

Tested on Xilinx zcu102-revA and zcu104-rev1.0 boards.

Fixes: 37d6265f2bfa ("net: phy: dp83867: refactor rgmii configuration")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
4 years agomtd: nand: Fix on-die ecc issues in arasan_nfc driver
T Karthik Reddy [Mon, 20 Jan 2020 06:59:23 +0000 (23:59 -0700)]
mtd: nand: Fix on-die ecc issues in arasan_nfc driver

Fixed wrong enumeration of nand_config structure. Added chip select
function before reading the nand chip for maf/dev id's, without this
unable to access id's from some of the micron chips. Also added a
print statement to identify if a nand flash is using on-die ecc.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoversal: drivers: clk: Fix invalid clock name queries
Rajan Vaja [Thu, 16 Jan 2020 11:55:05 +0000 (03:55 -0800)]
versal: drivers: clk: Fix invalid clock name queries

The clock driver makes EEMI call to get the name of invalid clk
when executing versal_get_clock_info() function. This results in
error messages.
Added check for validating clock before saving clock attribute and
calling versal_pm_clock_get_name() in versal_get_clock_info() function.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm: zynq: zybo z7: fix SPL uart init bitrate
Milan Obuch [Mon, 20 Jan 2020 01:32:19 +0000 (22:32 -0300)]
arm: zynq: zybo z7: fix SPL uart init bitrate

The board uses 100 MHz clock for UART bitrate generator,
but is configured as 50 MHz on defconfig.

This produces wrong console output.
The first message, "Debug uart enabled" is received as:
"������b"

Fix the issue by configuring the correct clock for the
UART baudrate generator

Signed-off-by: Milan Obuch <u-boot@dino.sk>
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm: zynq: zybo z7: fix MIO init issue
Milan Obuch [Mon, 20 Jan 2020 01:33:30 +0000 (22:33 -0300)]
arm: zynq: zybo z7: fix MIO init issue

The board has two push button connected to MIO pins
50 and 51, which have a pull-down resistor and are
connected to 1.8V when pressed.

These two pins are wrongly initialized with internal
pull-up enabled so they are reported as 1 all the time
with no change when pressed.

Disable the internal pull-up to fix the issue.

Signed-off-by: Milan Obuch <u-boot@dino.sk>
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agonet: zynq_gem: Use ulong instead of u32 data type
T Karthik Reddy [Wed, 15 Jan 2020 09:15:13 +0000 (02:15 -0700)]
net: zynq_gem: Use ulong instead of u32 data type

flush_dcache_range() expects unsigned long in the arguments. Here u32
variable is unable to hold the higher address value when ddr mapped
to higher addresses & flushing lower address dchache range instead
which is unmapped causing to crash.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: uniphier: enable CONFIG_MMC_HS400_SUPPORT for uniphier_v8_defconfig
Masahiro Yamada [Thu, 27 Feb 2020 11:31:18 +0000 (20:31 +0900)]
ARM: uniphier: enable CONFIG_MMC_HS400_SUPPORT for uniphier_v8_defconfig

The eMMC controller on LD20 or later supports HS-400 mode. It works on
a quick test. Enable it in case somebody may want to use it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: uniphier: detect the base of micro support card at run-time
Masahiro Yamada [Fri, 14 Feb 2020 11:54:42 +0000 (20:54 +0900)]
ARM: uniphier: detect the base of micro support card at run-time

The base address 0x43f00000 is no longer true for the future SoC.
Extract the base address from the device tree.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: uniphier: remove workaround for the NAND write protect
Masahiro Yamada [Fri, 14 Feb 2020 11:54:41 +0000 (20:54 +0900)]
ARM: uniphier: remove workaround for the NAND write protect

This workaround was previously needed for LD4, Pro4, sLD8, Pro5
SoCs. The boot ROM does not touch this register for PXs2/LD6b or
later.

Now that the reset signal of the Denali NAND controller is always
asserted in board_init() then deasserted in the driver, the
WRITE_PROTECT register gets back to the default value, which means
the write protect is deasserted.

This workaround can go away entirely.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: uniphier: move NAND reset assertion to U-Boot proper from SPL
Masahiro Yamada [Fri, 14 Feb 2020 11:54:40 +0000 (20:54 +0900)]
ARM: uniphier: move NAND reset assertion to U-Boot proper from SPL

The comment /* deassert reset */ is wrong. It asserts the reset.

It no longer needs to stay in SPL. The NAND controller reset is
handled  in the driver. So, this assert can be moved to the
board_init() of U-Boot proper.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: uniphier: add sdscript, sdboot, sdupdate environment variables
Masahiro Yamada [Thu, 13 Feb 2020 03:27:37 +0000 (12:27 +0900)]
ARM: uniphier: add sdscript, sdboot, sdupdate environment variables

Add handy macros:

  - sdscript: source boot.scr in the file system of the SD media
  - sdboot  : boot the kernel using the images in the file system
              of the SD media
  - sdscript: update the boot firmware in the SD media
              (in raw block sectors)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoARM: uniphier: enable CONFIG_MMC_SDHCI_ADMA for uniphier_v8_defconfig
Masahiro Yamada [Tue, 4 Feb 2020 11:13:43 +0000 (20:13 +0900)]
ARM: uniphier: enable CONFIG_MMC_SDHCI_ADMA for uniphier_v8_defconfig

Switch over to ADMA from SDMA.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoMerge tag 'ti-v2020.04-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Thu, 27 Feb 2020 13:51:01 +0000 (08:51 -0500)]
Merge tag 'ti-v2020.04-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- Minor fix in AVS class 0 driver
- DHCP fixes in Keystone2 HS platforms.

4 years agoMerge tag 'efi-2020-04-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 26 Feb 2020 19:49:24 +0000 (14:49 -0500)]
Merge tag 'efi-2020-04-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4

UEFI spec 2.8 errata A replaces the RuntimeServicesSupported variable
defined in UEFI spec 2.8 by the configuration table
EFI_RT_PROPERTIES_TABLE. So let's follow suit.

4 years agoefi_loader: implement EFI_RT_PROPERTIES_TABLE
Heinrich Schuchardt [Wed, 19 Feb 2020 19:48:49 +0000 (20:48 +0100)]
efi_loader: implement EFI_RT_PROPERTIES_TABLE

UEFI spec 2.8 errata A replaces the RuntimeServicesSupported variable
defined in UEFI spec 2.8 by the configuration table
EFI_RT_PROPERTIES_TABLE. So let's follow suit.

Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
4 years agodefconfig: k2x_hs: Remove DTB_RESELECT to fix DHCP issue
Madan Srinivas [Fri, 14 Feb 2020 14:05:24 +0000 (09:05 -0500)]
defconfig: k2x_hs: Remove DTB_RESELECT to fix DHCP issue

This fixes the inadvertent definition of CONFIG_DTB_RESELECT and
CONFIG_MULTI_DTB_FIT in the K2x HS defconfigs, that happened as part of
a resync of the defconfigs.

The inclusion of these config options causes ethernet to stop working on
K2x HS devices as they interfere with the installation of the secure
boot monitor.

This patch also removes the above configs for the K2 GP devices, as they
are not needed, and to keep the differences between the GP and HS
defconfigs to a minimum.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
4 years agomisc: k3_avs: Fix possible NULL pointer deference
Vignesh Raghavendra [Fri, 14 Feb 2020 12:22:17 +0000 (17:52 +0530)]
misc: k3_avs: Fix possible NULL pointer deference

Its possible that k3_avs_priv is NULL because the driver may not have
been probed yet. Therefore check if pointer is valid before
dereferencing it.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
4 years agoPrepare v2020.04-rc3 v2020.04-rc3
Tom Rini [Wed, 26 Feb 2020 12:53:20 +0000 (07:53 -0500)]
Prepare v2020.04-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Tom Rini [Wed, 26 Feb 2020 04:35:53 +0000 (23:35 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx

- Update Sata node for T2080QDS and revert SATA related unrequired
  patches.

4 years agoMerge branch '2020-02-25-master-imports'
Tom Rini [Tue, 25 Feb 2020 18:59:21 +0000 (13:59 -0500)]
Merge branch '2020-02-25-master-imports'

- Assorted fixes

4 years agoboard: novtech: meerkat96: use correct mmc driver
Carl Gelfand [Wed, 22 Jan 2020 21:03:02 +0000 (16:03 -0500)]
board: novtech: meerkat96: use correct mmc driver

When the board was originally submitted, it was attempting to use the
ESDHC driver. The board uses the USDHC driver.

Signed-off-by: Carl Gelfand <carl@novtech.com>
Cc: Shawn Guo <shawn.guo@kernel.org> (maintainer:MEERKAT96 BOARD)
Acked-by: Shawn Guo <shawnguo@kernel.org>
4 years agomoveconfig: convert ps.stderr to string
Markus Klotzbuecher [Wed, 12 Feb 2020 19:46:45 +0000 (20:46 +0100)]
moveconfig: convert ps.stderr to string

Printing the error message in verbose mode fails, since python3
doesn't implicitely convert bytes to strings.

Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agomoveconfig: replace unsafe eval with asteval
Markus Klotzbuecher [Wed, 12 Feb 2020 19:46:44 +0000 (20:46 +0100)]
moveconfig: replace unsafe eval with asteval

Commit b237d358b425 ("moveconfig: expand simple expressions") added
support for expanding expressions in configs, but used the unsafe python
built-in "eval". This patch fixes this by replacing eval with the
asteval module.

Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMAINTAINERS: set maintainer for doc/api/efi.rst
Heinrich Schuchardt [Sat, 22 Feb 2020 06:45:50 +0000 (07:45 +0100)]
MAINTAINERS: set maintainer for doc/api/efi.rst

doc/api/efi.rst belongs to the UEFI sub-system documentation.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoarch: arm: Fix SZ_64K undeclared compilation error
Wasim Khan [Fri, 14 Feb 2020 05:30:52 +0000 (11:00 +0530)]
arch: arm: Fix SZ_64K undeclared compilation error

Macro SZ_64K is undeclared. Include sizes.h to fix the compilation
error.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotools: image-host.c: remove uboot_aes.h
Philippe Reynes [Tue, 18 Feb 2020 16:23:20 +0000 (17:23 +0100)]
tools: image-host.c: remove uboot_aes.h

The include uboot_aes.h is not useful and
it breaks the compilation on android, so
we remove it.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reported-by: Praneeth Bajjuri <praneeth@ti.com>
4 years agoMerge branch '2020-02-24-ci-htmldocs'
Tom Rini [Tue, 25 Feb 2020 14:06:50 +0000 (09:06 -0500)]
Merge branch '2020-02-24-ci-htmldocs'

- Update our CI loops to run 'make htmldocs' and stop on errors

4 years agodoc/Makefile: turn warnings into errors
Heinrich Schuchardt [Fri, 21 Feb 2020 17:24:03 +0000 (18:24 +0100)]
doc/Makefile: turn warnings into errors

Several patches delivered incorrect restructured text as documentation. We
should be able to discover this in Travis CI, Gitlab CI, or Azure CI.

So let us turn all build warnings into errors.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoazure: build HTML documentation
Heinrich Schuchardt [Fri, 21 Feb 2020 17:24:02 +0000 (18:24 +0100)]
azure: build HTML documentation

Several patches delivered incorrect restructured text as documentation. We
should be able to discover this in Azure CI.

Provide a build step for 'make htmldocs'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agogitlab: build HTML documentation
Heinrich Schuchardt [Fri, 21 Feb 2020 17:24:01 +0000 (18:24 +0100)]
gitlab: build HTML documentation

Several patches delivered incorrect restructured text as documentation. We
should be able to discover this in Gitlab CI.

Provide a build step for 'make htmldocs'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotravis: build HTML docs
Heinrich Schuchardt [Fri, 21 Feb 2020 17:24:00 +0000 (18:24 +0100)]
travis: build HTML docs

Several patches delivered incorrect restructured text as documentation.
We should be able to discover this in Travis CI.

Provide a build step for 'make htmldocs'.

Add required package graphviz.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotravis: Add python3-sphinx to the package list
Tom Rini [Mon, 24 Feb 2020 20:10:36 +0000 (15:10 -0500)]
travis: Add python3-sphinx to the package list

In order to build htmldocs we need sphinx-build which comes from
python3-sphinx.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoarch: powerpc: Rewrite the sata node to fit the driver
Peng Ma [Mon, 23 Dec 2019 09:28:18 +0000 (09:28 +0000)]
arch: powerpc: Rewrite the sata node to fit the driver

The sata of our powerpc platforms are updated. These changes is to
fit the driver probe.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoRevert "configs: enable sata device module in T2080QDS"
Peng Ma [Mon, 23 Dec 2019 09:28:15 +0000 (09:28 +0000)]
Revert "configs: enable sata device module in T2080QDS"

This reverts commit 02dc1599ba0b16eb21ba0c206e5b6f38fe7b67a7

Commit 02dc1599ba0b ("configs: enable sata, eSDHC, USB device module in
T2080QDS")

has some sata defconfig changes to fit support DM mode, Now the driver
will be reverted, So revert it.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoRevert "powerpc: mpc85xx: delete FSL_SATA for T2080QDS board."
Peng Ma [Mon, 23 Dec 2019 09:28:12 +0000 (09:28 +0000)]
Revert "powerpc: mpc85xx: delete FSL_SATA for T2080QDS board."

This reverts commit 856b9cdb53f0e6c8d98f81cf71ef363c16b0aa0e.

Commit 856b9cdb53f0 ("powerpc: mpc85xx: delete FSL_SATA for T2080QDS
board.") is to fit support sata DM mode, Now the driver will be reverted,
So revert it.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoRevert "ata: fsl_ahci: Add sata DM support for Freescale powerpc socs"
Peng Ma [Mon, 23 Dec 2019 09:28:09 +0000 (09:28 +0000)]
Revert "ata: fsl_ahci: Add sata DM support for Freescale powerpc socs"

This reverts commit 1ee494291880fd51ef0c5f7342e072bdb069d7ff.

Commit 1ee494291880 ("ata: fsl_ahci: Add sata DM support for Freescale
powerpc socs") introduced SCSI layer to call AHCI private API in order
to support sata operations, In DM mode, This is not necessary for
non-AHCI sata. So revert it and have already updated the driver itself
to operate sata directly.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agodoc: update doc/sphinx/kerneldoc.py
Heinrich Schuchardt [Fri, 21 Feb 2020 17:23:59 +0000 (18:23 +0100)]
doc: update doc/sphinx/kerneldoc.py

Update doc/sphinx/kerneldoc.py from Linux next-20200219 to avoid warnings
like:

doc/sphinx/kerneldoc.py:125: RemovedInSphinx20Warning:
AutodocReporter is now deprecated. Use
sphinx.util.docutils.switch_source_input() instead.
  self.state.memo.reporter =
   AutodocReporter(result, self.state.memo.reporter)

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoAzure / GitLab: Update Docker image
Tom Rini [Mon, 24 Feb 2020 16:04:29 +0000 (11:04 -0500)]
Azure / GitLab: Update Docker image

Bring in a newer Docker image to build on that has everything required
for running 'make htmldocs'.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'u-boot-rockchip-20200220' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 21 Feb 2020 03:14:29 +0000 (22:14 -0500)]
Merge tag 'u-boot-rockchip-20200220' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip

- rk3399: split roc-pc-rk3399 out of evb_rk3399
- sync dts from upstream kernel for rk3399,rk3288,px30
- boot_mode: find the saradc device name

4 years agoMerge tag 'mmc-2-20-2020' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Thu, 20 Feb 2020 12:27:31 +0000 (07:27 -0500)]
Merge tag 'mmc-2-20-2020' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

- sdhci: code clean-up and fix cache coherency problem
- enable cache snooping on mpc830x
- Fix build error when MMC_WRITE disabled

4 years agommc: sdhci: fix missing cache invalidation after reading by DMA
Masahiro Yamada [Fri, 14 Feb 2020 07:40:27 +0000 (16:40 +0900)]
mmc: sdhci: fix missing cache invalidation after reading by DMA

This driver currently performs cache operation before the DMA start,
but does nothing after the DMA completion.

When reading data by DMA, the cache invalidation is needed also after
finishing the DMA transfer. Otherwise, the CPU might read data from
the cache instead of from the main memory when speculative memory read
or memory prefetch occurs.

Instead of calling the cache operation directly, this commit adds
dma_unmap_single(), which performs cache invalidation internally,
but drivers do not need which operation is being run.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: sdhci: use dma_map_single() instead of flush_cache() before DMA
Masahiro Yamada [Fri, 14 Feb 2020 07:40:26 +0000 (16:40 +0900)]
mmc: sdhci: use dma_map_single() instead of flush_cache() before DMA

Currently, sdhci_prepare_dma() calls flush_cache() regardless of the
DMA direction.

Actually, cache invalidation is enough when reading data from the device.

This is correctly handled by dma_map_single(), which mimics the DMA-API
in Linux kernel. Drivers can be agnostic which cache operation occurs
behind the scene.

This commit also sanitizes the difference between the virtual address
and the dma address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: add mmc_get_dma_dir() helper
Masahiro Yamada [Fri, 14 Feb 2020 07:40:25 +0000 (16:40 +0900)]
mmc: add mmc_get_dma_dir() helper

Copied from Linux kernel.
include/linux/mmc/host.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: remove unneeded casts
Masahiro Yamada [Fri, 14 Feb 2020 07:40:24 +0000 (16:40 +0900)]
mmc: sdhci: remove unneeded casts

host->mmc is already (struct mmc *).

memalign() returns an opaque pointer, so there is no need for casting.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: use lower_32_bit2() and upper_32_bits() for setting adma_addr
Masahiro Yamada [Fri, 14 Feb 2020 07:40:23 +0000 (16:40 +0900)]
mmc: sdhci: use lower_32_bit2() and upper_32_bits() for setting adma_addr

Use {lower,upper}_32_bits() instead of the combination of cast
and shift.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: reduce code duplication for aligned buffer
Masahiro Yamada [Fri, 14 Feb 2020 07:40:22 +0000 (16:40 +0900)]
mmc: sdhci: reduce code duplication for aligned buffer

The same code is run for both SDHCI_QUIRK_32BIT_DMA_ADDR and
define(CONFIG_FIXED_SDHCI_ALIGNED_BUFFER).

Unify the code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: put the aligned buffer pointer to struct sdhci_host
Masahiro Yamada [Fri, 14 Feb 2020 07:40:21 +0000 (16:40 +0900)]
mmc: sdhci: put the aligned buffer pointer to struct sdhci_host

Using the global variable does not look nice.

Add a new field sthci::align_buffer to point to the bounce buffer.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agodma-mapping: add <asm/dma-mapping.h> for all architectures
Masahiro Yamada [Thu, 20 Feb 2020 05:15:37 +0000 (14:15 +0900)]
dma-mapping: add <asm/dma-mapping.h> for all architectures

To avoid "asm/dma-mapping.h: No such file or directory" error,
we need something.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoarch: arm: rockchip: order the rk3399 entries alphabetically
Peter Robinson [Wed, 8 Jan 2020 03:56:11 +0000 (03:56 +0000)]
arch: arm: rockchip: order the rk3399 entries alphabetically

Put the target entries for rk3399 devices in alphabetical order.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: rk3399: add target type for evb based board
Kever Yang [Wed, 19 Feb 2020 09:51:07 +0000 (17:51 +0800)]
rockchip: rk3399: add target type for evb based board

There are many boards share the board file and device header file with
rk3399 evb, add target type MACRO so that it is fixed instead of default
to the first target in "RK3399 board select".

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoMerge tag 'efi-2020-04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 19 Feb 2020 22:25:26 +0000 (17:25 -0500)]
Merge tag 'efi-2020-04-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc3

* Update the Kconfig description of CONFIG_EFI_RNG_PROTOCOL
* Fix a function comment resolving a warning in 'make htmldocs'

4 years agodma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>
Masahiro Yamada [Fri, 14 Feb 2020 07:40:19 +0000 (16:40 +0900)]
dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>

The implementation of dma_map_single() and dma_unmap_single() is
exactly the same for all the architectures that support them.

Factor them out to <linux/dma-mapping.h>, and make all drivers to
include <linux/dma-mapping.h> instead of <asm/dma-mapping.h>.

If we need to differentiate them for some architectures, we can
move the generic definitions to <asm-generic/dma-mapping.h>.

Add some comments to the helpers. The concept is quite similar to
the DMA-API of Linux kernel. Drivers are agnostic about what is
going on behind the scene. Just call dma_map_single() before the
DMA, and dma_unmap_single() after it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agodma-mapping: fix the prototype of dma_unmap_single()
Masahiro Yamada [Fri, 14 Feb 2020 07:40:18 +0000 (16:40 +0900)]
dma-mapping: fix the prototype of dma_unmap_single()

dma_unmap_single() takes the dma address, not virtual address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agodma-mapping: fix the prototype of dma_map_single()
Masahiro Yamada [Fri, 14 Feb 2020 07:40:17 +0000 (16:40 +0900)]
dma-mapping: fix the prototype of dma_map_single()

Make dma_map_single() return the dma address, and remove the
pointless volatile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: fsl_esdhc: actually enable cache snooping on mpc830x
Rasmus Villemoes [Thu, 30 Jan 2020 12:06:45 +0000 (12:06 +0000)]
mmc: fsl_esdhc: actually enable cache snooping on mpc830x

The reference manuals for MPC8308 and MPC8309 both say that the
esdhcctl aka DMA Control Register "is implemented as SDHCCR" in the
System configuration registers. Unfortunately, that doesn't mean that
the registers are just mirrors of each other - any write to esdhcctl
is simply ignored. So to actually enable cache snooping, we
unfortunately have to add a little ifdeffery.

There is, naturally, no description of the bit fields of esdhcctl in
the MPC8309 manual, but comparing the description of esdhcctl from the
LS1021A reference manual to the description of the sdhccr in MPC8309,
one also finds that the fields are bit-reversed, so the bit to set is
0x02000000 rather than 0x00000040 - this is also what board_mmc_init()
uses in the two gdsys/mpc8308/ boards.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years agoefi_loader: EFI_RNG_PROTOCOL
Heinrich Schuchardt [Fri, 14 Feb 2020 22:28:58 +0000 (23:28 +0100)]
efi_loader: EFI_RNG_PROTOCOL

Do not use quotation marks for Kconfig help text.
Replace rng abbreviation by full words.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>