oweals/u-boot.git
4 years agotest: clk: test clock self assignment
Jean-Jacques Hiblot [Tue, 22 Oct 2019 12:00:07 +0000 (14:00 +0200)]
test: clk: test clock self assignment

Make sure that the clock self-assignment works by having a clock of
clk-sbox be configured automatically when clk-sbox is probed.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agodrivers: clk: Fix using assigned-clocks in the node of the clock it sets up
Jean-Jacques Hiblot [Tue, 22 Oct 2019 12:00:06 +0000 (14:00 +0200)]
drivers: clk: Fix using assigned-clocks in the node of the clock it sets up

This fixes the case where assigned-clocks is used to define a clock
defaults inside this same clock's node. This is used sometimes to setup a
default parents and/or rate for a clock.

example:
muxed_clock: muxed_clock {
clocks = <&clk_provider 0>, <&clk_provider 1>;
#clock-cells = <0>;
assigned-clocks = <&muxed_clock>;
assigned-clock-parents = <&clk_provider 1>;
};

It doesn't work in u-boot because the assigned-clocks are setup *before*
the clock is probed. (clk_set_parent() will likely crash or fail if called
before the device probe function)
Making it work by handling "assigned-clocks" in 2 steps: first before the
clk device is probed, and then after the clk device is probed.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agotest: clk: Update tests to also check the managed API
Jean-Jacques Hiblot [Tue, 22 Oct 2019 12:00:05 +0000 (14:00 +0200)]
test: clk: Update tests to also check the managed API

Add a few more clocks the clk_sandbox clock provider and get them using
the managed API.
Make sure they are released when the device is removed.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agodrivers: clk: Add a managed API to get clocks from the device-tree
Jean-Jacques Hiblot [Tue, 22 Oct 2019 12:00:04 +0000 (14:00 +0200)]
drivers: clk: Add a managed API to get clocks from the device-tree

Add devm_clk_get(), devm_clk_get_optional() to get clocks from the
device-tree. The clocks is automatically released and the data structure
freed when the device is unbound.
Also add devm_clk_put() to release the clock and free the data structure
manually.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agodrivers: clk: Handle gracefully NULL pointers
Jean-Jacques Hiblot [Tue, 22 Oct 2019 12:00:03 +0000 (14:00 +0200)]
drivers: clk: Handle gracefully NULL pointers

Prepare the way for a managed CLK API by handling NULL pointers without
crashing nor failing.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agoclk: Add support for I2C clocks on NXP's imx6q SoC which use CCF
Lukasz Majewski [Tue, 15 Oct 2019 10:44:57 +0000 (12:44 +0200)]
clk: Add support for I2C clocks on NXP's imx6q SoC which use CCF

This change adds support for I2C clock modeled in CCF. This code intention
is to only enable those clocks in the I2C driver with default settings.
For that reason the "busy" versions of clocks reuse the generic approach
and would need to be updated when one wants to adjust the I2C clock
frequency in U-Boot.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 years agoclk: Fix error check in clk_set_default_parents()
Jean-Jacques Hiblot [Thu, 26 Sep 2019 13:42:42 +0000 (15:42 +0200)]
clk: Fix error check in clk_set_default_parents()

According to the documentation in clk.h, clk_set_parent() return the new
rate of the clock or a negative error code.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
4 years agodm: pinctrl: fix for introduce PINCONF_RECURSIVE option
Patrick Delaunay [Mon, 21 Oct 2019 13:02:40 +0000 (15:02 +0200)]
dm: pinctrl: fix for introduce PINCONF_RECURSIVE option

Correct the name of the define used CONFIG_IS_ENABLED which is
not aligned with Kconfig name: CONFIG_$(SPL_)PINCONF_RECURSIVE.

The recursive calls is conditional only for UCLASS_PINCONFIG
"pinconfig" driver.
It is always needed to call pinctrl_post_bind for UCLASS_PINCTRL
"pinctrl", the test CONFIG_IS_ENABLED(PINCONF_RECURSIVE) need to
be removed for this driver.

This correct a regression introduced because the same patch is
applied twice times in u-boot-dm branch:
- commit e878b53a79d1 ("dm: pinctrl: introduce PINCONF_RECURSIVE
  option")
- commit c20851b3d850 ("dm: pinctrl: introduce PINCONF_RECURSIVE
  option")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agopinctrl: Kconfig: remove duplicated nodes
Patrick Delaunay [Mon, 21 Oct 2019 13:07:54 +0000 (15:07 +0200)]
pinctrl: Kconfig: remove duplicated nodes

Remove the duplicated configs introduced when the same patch is
applied twice times:
- commit e878b53a79d1 ("dm: pinctrl: introduce PINCONF_RECURSIVE
  option")
- commit c20851b3d850 ("dm: pinctrl: introduce PINCONF_RECURSIVE
  option")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agospl: mmc: make eMMC HW boot partition configuration optional
Anatolij Gustschin [Fri, 18 Oct 2019 19:38:33 +0000 (21:38 +0200)]
spl: mmc: make eMMC HW boot partition configuration optional

Loading U-Boot on i.MX8QXP MEK board is broken since recent changes
in spl_mmc:

  U-Boot SPL 2019.10-00162-gff5bd397e4 (Oct 18 2019 - 15:50:45 +0200)
  Normal Boot
  WDT:   Not found!
  Trying to boot from MMC2_2
  Load image from MMC/SD 0x46400
  spl: mmc partition switch failed
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

The newly added CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION option
is selected automatically and overrides the EXT_CSC_PART_CONFIG
configurations with default value, always selecting the eMMC boot
partition 1. Boards which place U-Boot image in other partitions
became not bootable.

Fix this by making the eMMC HW boot partition selection optional.

Fixes: 17241ea0543a (spl: mmc: Add option to set eMMC HW boot partition)
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 years agoMerge tag 'efi-2020-01-rc1-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 18 Oct 2019 20:37:03 +0000 (16:37 -0400)]
Merge tag 'efi-2020-01-rc1-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-01-rc1 (2)

Install the simple file protocol only if there is a file system on the
partition.

Enable CONFIG_CMD_NVEDIT_EFI on QEMU.

4 years agoMerge tag 'u-boot-amlogic-20191018' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 18 Oct 2019 20:36:44 +0000 (16:36 -0400)]
Merge tag 'u-boot-amlogic-20191018' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- document alternative libretech-cc installation methods, including upstream TF-A and opensource tools
- add HDMI/CVBS display support for Amlogic G12A SoCs and SEI510 board
- add support for Amlogic A311D based Khadas VIM3
- add support for Amlogic S905X3 based SEI610 board, targeting Android support like SEI510

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Fri, 18 Oct 2019 20:36:16 +0000 (16:36 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv

- Support sifive DM based gpio driver for FU540-SoC.
- Align boot image header with Linux v5.3

4 years agoconfigs: sei610: Add config file to fix userdata size
Guillaume La Roque [Fri, 11 Oct 2019 15:33:58 +0000 (17:33 +0200)]
configs: sei610: Add config file to fix userdata size

Add separate config file to handle the different eMMC size on
the sei610 board.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: sei510: rework header and fix userdata size
Guillaume La Roque [Fri, 11 Oct 2019 15:33:57 +0000 (17:33 +0200)]
configs: sei510: rework header and fix userdata size

Move android generic config and boot sequence in meson64_android header
and fix size of userdata to use all eMMC on SEI510.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoboards: amlogic: add SEI610 support
Neil Armstrong [Fri, 11 Oct 2019 15:33:56 +0000 (17:33 +0200)]
boards: amlogic: add SEI610 support

Add support for the customer board SEI610 manufactured by SEI Robotics
with the following specifications:
 - Amlogic S905X3 ARM Cortex-A55 quad-core SoC
 - 2GB DDR4 SDRAM
 - 10/100 Ethernet (Internal PHY)
 - 1 x USB 3.0 Host
 - 1 x USB Type-C DRD
 - 1 x FTDI USB Serial Debug Interface
 - eMMC
 - SDcard
 - Infrared receiver
 - SDIO WiFi Module

Like it's SEI510 counterpart, the boot flow is designed to boot
Android AOSP built for the Yukawa Android device.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoARM: dts: meson-sm1: add U-Boot specific DT for graphics
Neil Armstrong [Fri, 11 Oct 2019 15:33:55 +0000 (17:33 +0200)]
ARM: dts: meson-sm1: add U-Boot specific DT for graphics

Rename meson-g12a-u-boot.dtsi into meson-g12-common-u-boot.dtsi to
match the new DT architecture and add meson-sm1-sei610-u-boot.dtsi
to handle the U-Boot specific DT for graphics.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: sei510: enable everything-else power domain
Neil Armstrong [Fri, 11 Oct 2019 13:12:20 +0000 (15:12 +0200)]
configs: sei510: enable everything-else power domain

The GX VPU Power Domain driver has been replaced by the Everything-Else
Power Domain driver for G12A and SM1.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agopower: domain: add Amlogic Everything-Else power domain driver
Neil Armstrong [Fri, 11 Oct 2019 13:12:19 +0000 (15:12 +0200)]
power: domain: add Amlogic Everything-Else power domain driver

Based on the 54ecb8f7028c ("Linux 5.4-rc1") Everything-Else power domain
driver for Amlogic SoCs.

This driver handles the VPU Power domain and other domains from the
Everything-Else part of the SM1 and G12A SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoARM: dts: Import SEI610 DT from Linux 5.4-rc2
Neil Armstrong [Fri, 11 Oct 2019 15:33:54 +0000 (17:33 +0200)]
ARM: dts: Import SEI610 DT from Linux 5.4-rc2

Import the Amlogic SM1 DT and the SEI610 board DT from [1]

[1] da0c9ea146cb ("Linux 5.4-rc2")

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoclk: meson-sm1: add compatible
Neil Armstrong [Fri, 11 Oct 2019 15:33:53 +0000 (17:33 +0200)]
clk: meson-sm1: add compatible

The SM1 clock controller is almost identical to the G12A and
so far the differences don't matter.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agommc: meson-gx: add support for mmc-pwrseq-emmc
Neil Armstrong [Fri, 11 Oct 2019 15:33:52 +0000 (17:33 +0200)]
mmc: meson-gx: add support for mmc-pwrseq-emmc

Add support for mmc-pwrseq-emmc in the meson-gx mmc driver to support
enabling the eMMC.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoARM: meson: add SM1 SoC id
Neil Armstrong [Fri, 11 Oct 2019 15:33:51 +0000 (17:33 +0200)]
ARM: meson: add SM1 SoC id

Add the missing IDs to detect the SM1 S905X3 SoC.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoarm: meson: Recognize A311D SoC
Andreas Färber [Wed, 9 Oct 2019 14:03:57 +0000 (16:03 +0200)]
arm: meson: Recognize A311D SoC

Values imported from Linux driver, but in correct numeric order.

Khadas VIM3 prints: Amlogic Meson G12B (A311D) Revision 29:b (10:2)

Cc: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoarm: meson: Tidy SoC information output
Andreas Färber [Wed, 9 Oct 2019 14:03:56 +0000 (16:03 +0200)]
arm: meson: Tidy SoC information output

Write SoC instead of Soc. The Linux driver is not affected.

Fixes: f41d723b9f ("ARM: meson: display Amlogic SoC Information")
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: Add Khadas VIM3 defconfig
Andreas Färber [Wed, 9 Oct 2019 14:03:55 +0000 (16:03 +0200)]
configs: Add Khadas VIM3 defconfig

Derived from odroid-n2_defconfig and README.odroid-n2.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoarm: dts: Import and update DT for Khadas VIM3
Andreas Färber [Wed, 9 Oct 2019 14:03:54 +0000 (16:03 +0200)]
arm: dts: Import and update DT for Khadas VIM3

In Linux meson-g12-common.dtsi was introduced as well as new g12b nodes
and headers, as dependencies of new meson-g12b-a311d-khadas-vim3.dts.

Copied from da0c9ea146cb ("Linux 5.4-rc2")

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: sei510: enable Video Display support
Neil Armstrong [Fri, 30 Aug 2019 12:09:28 +0000 (14:09 +0200)]
configs: sei510: enable Video Display support

Add the necessary config options to support BMP display over HDMI,
and add a preboot command to load the BMP file from a predefined
eMMC partition.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoARM: dts: meson-g12a: add U-Boot specific DT for graphics
Neil Armstrong [Fri, 30 Aug 2019 12:09:27 +0000 (14:09 +0200)]
ARM: dts: meson-g12a: add U-Boot specific DT for graphics

Like the meson-gx support, add the U-Boot specific bits in DT
to support graphics on G12A SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoarm: meson: board-g12a: Setup VPU in fdt
Neil Armstrong [Fri, 30 Aug 2019 12:09:26 +0000 (14:09 +0200)]
arm: meson: board-g12a: Setup VPU in fdt

If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer.

Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for
EFI, and sets up simple-framebuffer nodes if simplefb support is
enabled.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: meson: add compatible for Amlogic G12A
Neil Armstrong [Fri, 30 Aug 2019 12:09:25 +0000 (14:09 +0200)]
video: meson: add compatible for Amlogic G12A

Finally add the Amlogic G12A SoC compatible for the VPU driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: meson: sync with linux drm-misc tree
Neil Armstrong [Fri, 30 Aug 2019 12:09:24 +0000 (14:09 +0200)]
video: meson: sync with linux drm-misc tree

Synchronize the Amlogic Meson Video driver back with the latest
DRM misc tree, adding G12A platform support, from the latest commit:
528a25d040bc ("drm: meson: use match data to detect vpu compatibility")

The sync includes the following changes from Linux adapted to U-Boot:
- Add support for VIC alternate timings
- Switch PLL to 5.94GHz base for 297Mhz pixel clock
- Add registers for G12A SoC
- Add G12A Support for VPP setup
- Add G12A Support for VIU setup
- Add G12A support for OSD1 Plane
- Add G12A support for plane handling in CRTC driver
- Add G12A support for CVBS Encoder
- Add G12A Video Clock setup
- Add G12A support for the DW-HDMI Glue
- fix G12A HDMI PLL settings for 4K60 1000/1001 variations
- fix primary plane disabling
- fix G12A primary plane disabling
- mask value when writing bits relaxed
- crtc: drv: vpp: viu: venc: use proper macros instead of magic constants
- global clean-up
- add macro used to enable HDMI PLL
- venc: set the correct macrovision max amplitude value

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: meson: remove power domain get
Neil Armstrong [Fri, 30 Aug 2019 12:09:23 +0000 (14:09 +0200)]
video: meson: remove power domain get

Remove getting and enabling the node power domain since it's now handled
by the dm core directly.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoclk: meson: g12a: add support for VPU/HDMI clocks
Neil Armstrong [Fri, 30 Aug 2019 12:09:22 +0000 (14:09 +0200)]
clk: meson: g12a: add support for VPU/HDMI clocks

Add necessary clock support to set up clock for the VPU and
HDMI support.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agopower: domain: meson-gx-pwrc: add G12A support
Neil Armstrong [Fri, 30 Aug 2019 12:09:21 +0000 (14:09 +0200)]
power: domain: meson-gx-pwrc: add G12A support

Add Amlogic G12A support for the gx-pwrc driver, aligned on the
Linux v5.2 driver.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoboard: amlogic: document alternative libretech-cc installation methods
Daniel Drake [Tue, 6 Aug 2019 08:10:42 +0000 (16:10 +0800)]
board: amlogic: document alternative libretech-cc installation methods

As already documented in this README, several binaries must be
glued together in order to boot the device.

Extend the documentation to cover the prebuilt binaries
(saving you the hassle of installing ancient cross-compilers),
and also mention the open source replacements for the encryption
tool (which is especially useful if you want to avoid requiring
32-bit x86 binaries in your build system).

Signed-off-by: Daniel Drake <drake@endlessm.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoRISC-V: Align boot image header with Linux
Atish Patra [Wed, 9 Oct 2019 17:34:17 +0000 (10:34 -0700)]
RISC-V: Align boot image header with Linux

The released Linux boot image header in v5.3 is different from the
one present in U-Boot. Align the header with the new version. The
changes in Linux are backward compatible. Previous U-Boot releases
with older header will continue to work as well. As v5.3 kernel is
the first one to support image header, there is no compatibility
issue between new U-Boot (with this patch) and older kernel.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Rick Chen <rick@andestech.com>
4 years agoconfigs: fu540: enable gpio driver
Sagar Shrikant Kadam [Tue, 1 Oct 2019 17:00:47 +0000 (10:00 -0700)]
configs: fu540: enable gpio driver

Enable the DM based GPIO driver for FU540-C000 SoC.

Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
4 years agogpio: sifive: add support for DM based gpio driver for FU540-SoC
Sagar Shrikant Kadam [Tue, 1 Oct 2019 17:00:46 +0000 (10:00 -0700)]
gpio: sifive: add support for DM based gpio driver for FU540-SoC

This patch adds a DM based driver model for gpio controller present in
FU540-C000 SoC on HiFive Unleashed A00 board. This SoC has one GPIO
bank and 16 GPIO lines in total, out of which GPIO0 to GPIO9 and
GPIO15 are routed to the J1 header on the board.

This implementation is ported from linux based gpio driver submitted
for review by Wesley W. Terpstra <wesley@sifive.com> and/or Atish Patra
<atish.patra@wdc.com> (many thanks !!). The linux driver can be referred
here [1]

[1]: https://lkml.org/lkml/2018/10/9/1103

Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoefi_loader: enable CONFIG_CMD_NVEDIT_EFI on QEMU
Heinrich Schuchardt [Sun, 13 Oct 2019 09:54:20 +0000 (11:54 +0200)]
efi_loader: enable CONFIG_CMD_NVEDIT_EFI on QEMU

To reduce the default image size CONFIG_CMD_NVEDIT_EFI was disabled by
default. Re-enable it on the QEMU platforms supporting the UEFI sub-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available
AKASHI Takahiro [Mon, 7 Oct 2019 05:59:38 +0000 (14:59 +0900)]
efi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available

In the current implementation, EFI_SIMPLEFILE_SYSTEM_PROTOCOL is always
installed to all the partitions even if some of them may house no file
system.

With this patch, that protocol will be installed only if any file system
exists.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: add fs_get_type() for current filesystem type
AKASHI Takahiro [Mon, 7 Oct 2019 05:59:37 +0000 (14:59 +0900)]
fs: add fs_get_type() for current filesystem type

This function is a variant of fs_get_type_name() and returns a filesystem
type with which the current device is associated.
We don't want to export fs_type variable directly because we have to take
care of it consistently within fs.c.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: clean up around fs_type
AKASHI Takahiro [Mon, 7 Oct 2019 05:59:36 +0000 (14:59 +0900)]
fs: clean up around fs_type

fs_ls(), fs_mkdir() and fs_unlink() sets fs_type to FS_TYPE_ANY
explicitly, but it is redundant as they call fs_close().
So just remove those lines.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: update fs_close() description
Heinrich Schuchardt [Sun, 13 Oct 2019 08:26:26 +0000 (10:26 +0200)]
fs: update fs_close() description

Provide a more detailed description of fs_close().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: export fs_close()
AKASHI Takahiro [Mon, 7 Oct 2019 05:59:35 +0000 (14:59 +0900)]
fs: export fs_close()

fs_close() closes the connection to a file system which opened with
either fs_set_blk_dev() or fs_set_dev_with_part(). Many file system
functions implicitly call fs_close(), e.g. fs_closedir(), fs_exist(),
fs_ln(), fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write()
and fs_unlink().
So just export it.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: device_path: check against file path length
AKASHI Takahiro [Wed, 9 Oct 2019 07:19:52 +0000 (16:19 +0900)]
efi_loader: device_path: check against file path length

device_path strcuture has 2 bytes of "length" field, and so
file path length should not exceed this limit, 65535.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge tag 'for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-ubi
Tom Rini [Thu, 17 Oct 2019 11:26:16 +0000 (07:26 -0400)]
Merge tag 'for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-ubi

ubi enhancements for 2020.01
- provide a way for skipping crc checks ported from linux, and add an
  U-Boot command to set this flag on already installed systems.
- fix redundand environment management

4 years agoMerge tag 'dm-pull-15oct19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Wed, 16 Oct 2019 22:10:31 +0000 (18:10 -0400)]
Merge tag 'dm-pull-15oct19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

binman enhancements:
- Dropping some test Elf files and building them from source instead
- Refactoring of x86 16-bit entries
- Support for SPL symbols within sections
- Handle the 'notes' sections and hidden symbols in recent binutils
- Improved error reporting with a tool fails

libfdt and documentation fixes
vboot required-key test
driver model power-domain controls
patman Message-Id enhancement

4 years agoMerge branch '2019-10-15-master-imports'
Tom Rini [Wed, 16 Oct 2019 22:10:01 +0000 (18:10 -0400)]
Merge branch '2019-10-15-master-imports'

- Split travis jobs again so we don't have failures due to excessive
  build times.
- Android image updates
- cscope bugfix, update ARM maintainers entry, drop H2200 platform.

4 years agotravis: Split and rename xilinx ARM in to two jobs
Tom Rini [Mon, 14 Oct 2019 22:12:59 +0000 (18:12 -0400)]
travis: Split and rename xilinx ARM in to two jobs

Split the ARMv7 and AArch64 platforms into separate jobs, to avoid them
taking too long to build overall.  Also rename them from "Xilinx" to
"Zynq*" to reflect slightly better what is being built and to pull in a
few more board matches.

Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotravis: Split sun8i in to two jobs
Tom Rini [Tue, 15 Oct 2019 11:27:14 +0000 (07:27 -0400)]
travis: Split sun8i in to two jobs

Split the 32bit and 64bit platforms into separate jobs, to avoid them
taking too long to build overall.

Cc: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotravis: Split i.MX jobs a bit more
Tom Rini [Tue, 15 Oct 2019 11:27:13 +0000 (07:27 -0400)]
travis: Split i.MX jobs a bit more

- Split "tqc" and "technexion" out into their own jobs and exclude
  them from the catch-all jobs
- Clarify the job labels a little more.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>
4 years agoMAINTAINERS: Update ARM entry
Tom Rini [Thu, 10 Oct 2019 21:33:09 +0000 (17:33 -0400)]
MAINTAINERS: Update ARM entry

Fully take over the ARM maintainers entry.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoMakefile: Skip symbolic links to files for cscope
Andy Shevchenko [Tue, 8 Oct 2019 18:12:45 +0000 (21:12 +0300)]
Makefile: Skip symbolic links to files for cscope

cscope complains that it can't find files that appears to be symbolic links

cscope: cannot find file tools/binman/test/u_boot_binman_syms_bad.c
cscope: cannot find file tools/version.h

`find -L` tests properties, but name, and cscope can't cope with symbolic
links (a lot of bugs in upstream were simple closed as kinda invalid).

To work around the problem, exclude symbolic links from the cscope.files.
Note, it's done in two pass to speed up the process (`-exec realpath ...`
approach is not portable and introduces a 3x delay).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 years agoarm: remove the H2200 board
Heinrich Schuchardt [Tue, 8 Oct 2019 18:54:49 +0000 (20:54 +0200)]
arm: remove the H2200 board

U-Boot cannot be built for h2200_defconfig with CONFIG_DM=y.

The maintainer Lukasz Dalek suggested to remove the board.
https://lists.denx.de/pipermail/u-boot/2019-August/380685.html

Cc: Lukasz Dalek <luk0104@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[trini: As this is the last non-toradex PXA board, update travis too]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoubi: env: fix redundand management
Philippe Reynes [Mon, 14 Oct 2019 17:41:06 +0000 (19:41 +0200)]
ubi: env: fix redundand management

We check (with a #if defined()) the config ENV_UBI_VOLUME_REDUND
to know if there is a redundant env. But this config is a string
and is always defined with env is in ubi, so we always consider
that a redundand env is used.

To fix this issue, I've added a hidden flag ENV_UBI_IS_VOLUME_REDUND
that is true when ENV_UBI_VOLUME_REDUND is not "". Then, I check
this flag in the code, instead of the string ENV_UBI_VOLUME_REDUND.

hs: fixed typo s/condider/consider

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 years agoubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr
Stefan Roese [Tue, 17 Sep 2019 07:17:53 +0000 (09:17 +0200)]
ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdr

U-Boot now supports the "skip_check" flag to optionally skip the CRC
check at open time. Currently its only possible to set this bit upon
UBI volume creation. But it might be very useful to also set this bit
on already installed systems (e.g. field upgrade) to make also use of
the boot-time decrease on those systems.

This patch now adds a new "ubi" command "ubi skipcheck" to set or clear
this bit in the UBI volume header:

=> ubi skipcheck rootfs0 on
Setting skip_check on volume rootfs0

BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based
target with 128MiB of SPI NAND.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
4 years agoubi: Print skip_check in ubi_dump_vol_info()
Stefan Roese [Thu, 12 Sep 2019 14:41:02 +0000 (16:41 +0200)]
ubi: Print skip_check in ubi_dump_vol_info()

It might be interesting, if "skip_check" is set or not, so lets print
this flag in ubi_dump_vol_info() as well.

hs: fix typo in commit message

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Heiko Schocher <hs@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 years agoubi: provide a way to skip CRC checks
Quentin Schulz [Thu, 12 Sep 2019 14:41:01 +0000 (16:41 +0200)]
ubi: provide a way to skip CRC checks

Some users of static UBI volumes implement their own integrity check,
thus making the volume CRC check done at open time useless. For
instance, this is the case when one use the ubiblock + dm-verity +
squashfs combination, where dm-verity already checks integrity of the
block device but this time at the block granularity instead of verifying
the whole volume.

Skipping this test drastically improves the boot-time.

Adapted to U-Boot by Stefan Roese.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
4 years agosandbox: fix build error due to missing struct udevice definition
AKASHI Takahiro [Fri, 4 Oct 2019 04:45:18 +0000 (13:45 +0900)]
sandbox: fix build error due to missing struct udevice definition

Without this patch, compiling may potentially fail.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: Tidy up dump output when there are many devices
Patrick Delaunay [Mon, 30 Sep 2019 08:19:13 +0000 (10:19 +0200)]
dm: Tidy up dump output when there are many devices

At present the 'Index' column of 'dm tree' assumes there is
two digits, this patch increase it to 3 digits.

It also aligns output of 'dm uclass', assuming the same 3 digits index.

The boards with CONFIG_PINCTRL_FULL activated have one pinconfig
by pin configuration, so they can have more than 100 devices
pinconfig (for example with stm32mp157c-ev1 board we have
106 pinconfig node).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: pinctrl: introduce PINCONF_RECURSIVE option
Patrick Delaunay [Fri, 2 Aug 2019 12:48:00 +0000 (14:48 +0200)]
dm: pinctrl: introduce PINCONF_RECURSIVE option

In the Linux pinctrl binding, the pin configuration nodes don't need to
be direct children of the pin controller device (may be grandchildren for
example). This behavior is managed with the pinconfig u-class which
recursively bind all the sub-node of the pin controller.

But for some binding (when pin configuration is only children of pin
controller) that is not necessary. U-Boot can save memory and reduce
the number of pinconf instance when this feature is deactivated
(for arch stm32mp for example for SPL).

This patch allows to control this feature with a new option
CONFIG_PINCONF_RECURSIVE when it is possible for each individual
pin controller device.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fixed CONFIG_IF_ENABLED() condition, added __maybe_unused:
Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: device: switch off power domain after device removal
Anatolij Gustschin [Fri, 27 Sep 2019 08:18:15 +0000 (13:48 +0530)]
dm: core: device: switch off power domain after device removal

The power domain associated with a device is enabled when probing,
but currently the domain remains enabled when the device is removed.
Some boards started to disable power domains for selected devices
via custom board_quiesce_devices(), but it doesn't work in many
cases, i. e. because devices still can be accessed later in
.remove() callback on behalf of dm_remove_devices_flags().

Utilize the DM core to power off the device power domain, but add a
device flag to be able to selectively let the power domain enabled
after device removal. This might be required for devices that must
remain enabled when booting OS, i. e. serial console for debug
output, etc.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopower: domain: Introduce dev_power_domain_off
Lokesh Vutla [Fri, 27 Sep 2019 08:18:14 +0000 (13:48 +0530)]
power: domain: Introduce dev_power_domain_off

Add dev_power_domain_off() api to disable all the power-domains
corresponding to a device

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoremoteproc: k3_arm64: Enable DM_FLAG_DEFAULT_PD_CTRL_OFF
Lokesh Vutla [Fri, 27 Sep 2019 08:18:13 +0000 (13:48 +0530)]
remoteproc: k3_arm64: Enable DM_FLAG_DEFAULT_PD_CTRL_OFF

Enable DM_FLAG_DEFAULT_PD_CTRL_OFF for arm64 remote core so that
pd can be enabled after loading the image.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Allow for not controlling the power-domain by DM framework
Lokesh Vutla [Fri, 27 Sep 2019 08:18:12 +0000 (13:48 +0530)]
dm: core: Allow for not controlling the power-domain by DM framework

In some remoteproc cases, enabling the power domain of the core will
start running the core. In such cases image should be loaded before
enabling the power domain. But the current DM framework enables the
power-domain by default during probe. This is causing the remotecore
to start and crash as there is no valid image loaded.

In order to avoid this introduce a DM flag that doesn't allow for
enabling/disabling the power-domain by DM framework.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: device: Fix typo in the non-DEVRES version of devm_kmalloc_array()
Jean-Jacques Hiblot [Thu, 26 Sep 2019 13:43:54 +0000 (15:43 +0200)]
dm: device: Fix typo in the non-DEVRES version of devm_kmalloc_array()

When DEVRES is not set, devm_kmalloc_array() is spelled
devm_kmaloc_array() (with one 'l' only).
Fixing it so that the name is the same with and without DEVRES.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Use the Change-Id, version, and prefix in the Message-Id
Douglas Anderson [Fri, 27 Sep 2019 16:23:56 +0000 (09:23 -0700)]
patman: Use the Change-Id, version, and prefix in the Message-Id

As per the centithread on ksummit-discuss [1], there are folks who
feel that if a Change-Id is present in a developer's local commit that
said Change-Id could be interesting to include in upstream posts.
Specifically if two commits are posted with the same Change-Id there's
a reasonable chance that they are either the same commit or a newer
version of the same commit.  Specifically this is because that's how
gerrit has trained people to work.

There is much angst about Change-Id in upstream Linux, but one thing
that seems safe and non-controversial is to include the Change-Id as
part of the string of crud that makes up a Message-Id.

Let's give that a try.

In theory (if there is enough adoption) this could help a tool more
reliably find various versions of a commit.  This actually might work
pretty well for U-Boot where (I believe) quite a number of developers
use patman, so there could be critical mass (assuming that enough of
these people also use a git hook that adds Change-Id to their
commits).  I was able to find this git hook by searching for "gerrit
change id git hook" in my favorite search engine.

In theory one could imagine something like this could be integrated
into other tools, possibly even git-send-email.  Getting it into
patman seems like a sane first step, though.

NOTE: this patch is being posted using a patman containing this patch,
so you should be able to see the Message-Id of this patch and see that
it contains my local Change-Id, which ends in 2b9 if you want to
check.

[1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2019-August/006739.html

Signed-off-by: Douglas Anderson <dianders@chromium.org>
4 years agocmd: aes: use map_sysmem when accessing memory
Philippe Reynes [Tue, 24 Sep 2019 09:32:29 +0000 (11:32 +0200)]
cmd: aes: use map_sysmem when accessing memory

The aes command used to segfault when accessing memory in sandbox.
The pointer accesses should be mapped.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agosandbox64: enable command aes
Philippe Reynes [Tue, 24 Sep 2019 09:32:28 +0000 (11:32 +0200)]
sandbox64: enable command aes

This commit add the support of command aes.
Then, it may be used on pytest.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agosandbox: enable command aes
Philippe Reynes [Tue, 24 Sep 2019 09:32:27 +0000 (11:32 +0200)]
sandbox: enable command aes

This commit enable the command aes on sandbox.
Then, it may be used on pytest.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agolibfdt: fix typo on comment
Giulio Benetti [Wed, 18 Sep 2019 15:22:13 +0000 (17:22 +0200)]
libfdt: fix typo on comment

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
4 years agorsa: Return immediately if required-key verification fails
Daniele Alessandrelli [Wed, 18 Sep 2019 14:04:54 +0000 (16:04 +0200)]
rsa: Return immediately if required-key verification fails

Currently, if image verification with a required key fails, rsa_verify()
code tries to find another key to verify the FIT image. This however, is
not the intended behavior as the documentation says that required keys
"must be verified for the image / configuration to be considered valid".

This patch fixes the issue by making rsa_verify() return immediately if
the verification of a required key fails.

Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
4 years agopytest: vboot: add a test for required key
Philippe Reynes [Wed, 18 Sep 2019 14:04:53 +0000 (16:04 +0200)]
pytest: vboot: add a test for required key

This commit add a test in the vboot test to check that
when a required key is asked, only FIT signed with this
key is used/accepted by u-boot.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agodm: pinctrl: Skip not associated gpio phandle and rise a warning message
Michael Trimarchi [Tue, 17 Sep 2019 20:06:03 +0000 (22:06 +0200)]
dm: pinctrl: Skip not associated gpio phandle and rise a warning message

Skip not associated gpio phandle let register the other gpios on a group.
We need anyway to send out a warning to the user to fix their uboot-board.dtsi.
Thhe handle id can be found inside the decompiled dtb

dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocore: device: use dev_power_domain_on
Peng Fan [Tue, 17 Sep 2019 09:29:22 +0000 (09:29 +0000)]
core: device: use dev_power_domain_on

When multiple power domains attached to a device, need power on
them all, so use dev_power_domain_on to do that.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agopower: domain: add dev_power_domain_on
Peng Fan [Tue, 17 Sep 2019 09:29:19 +0000 (09:29 +0000)]
power: domain: add dev_power_domain_on

Add this new API to power on multiple domains attached
to a device.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Changed to static inline and added a condition into C file:
Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: spi: Do not assume first SPI bus
Thomas Fitzsimmons [Fri, 6 Sep 2019 11:51:19 +0000 (07:51 -0400)]
dm: spi: Do not assume first SPI bus

When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed
before device_bind_common assigned request numbers sequentially in the
absence of aliases.

Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
4 years agodm: device: Request next sequence number
Thomas Fitzsimmons [Fri, 6 Sep 2019 11:51:18 +0000 (07:51 -0400)]
dm: device: Request next sequence number

For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a
given device, use the next request number for that type of device.
This allows aliases to be used when they're available, while still
allowing unaliased devices to be probed.

Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
4 years agotpm2: Don't assume active low reset value
Kayla Theil [Fri, 6 Sep 2019 10:40:45 +0000 (12:40 +0200)]
tpm2: Don't assume active low reset value

The reset function sets the pin to 0 then 1 but if the pin is marked
ACTIVE_LOW in the DT it gets inverted and leaves the TPM in reset.
Let the gpio driver take care of the reset polarity.

Signed-off-by: Kayla Theil <kayla.theil@mixed-mode.de>
4 years agodm: Fix default address cells return value
Matthias Brugger [Thu, 5 Sep 2019 08:48:49 +0000 (10:48 +0200)]
dm: Fix default address cells return value

Default address cells value on the livetree access function
returns the wrong value. Fix this so that the value returned
corresponds to the device tree specification.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agolibfdt: Allow #size-cells of 0
Matthias Brugger [Thu, 5 Sep 2019 08:48:48 +0000 (10:48 +0200)]
libfdt: Allow #size-cells of 0

The commit "libfdt: fdt_address_cells() and fdt_size_cells()" introduced
a bug as it consolidated code between the helpers for getting
be 0, and is frequently found so in practice for /cpus.  IEEE1275 only
requires implementations to handle 1..4 for #address-cells, although one
could make a case for #address-cells == #size-cells == 0 being used to
represent a bridge with a single port.

While we're there, it's not totally obvious that the existing implicit
cast of a u32 to int will give the correct results according to strict C,
although it does work in practice.  Straighten that up to cast only after
we've made our range checks.

This is based on upstream commit:
b8d6eca ("libfdt: Allow #size-cells of 0")
but misses the test cases,as we don't implement them in U-Boot.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agolibfdt: return correct value if #size-cells property is not present
Matthias Brugger [Thu, 5 Sep 2019 08:48:47 +0000 (10:48 +0200)]
libfdt: return correct value if #size-cells property is not present

According to the device tree specification, the default value for
was not present.

This patch also makes fdt_address_cells() and fdt_size_cells() conform
to the behaviour documented in libfdt.h. The defaults are only returned
if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error
is returned.

This is based on upstream commit:
aa7254d ("libfdt: return correct value if #size-cells property is not present")
but misses the test case part, as we don't implement them in U-Boot.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agolibfdt: fdt_address_cells() and fdt_size_cells()
Matthias Brugger [Thu, 5 Sep 2019 08:48:46 +0000 (10:48 +0200)]
libfdt: fdt_address_cells() and fdt_size_cells()

Add internal fdt_cells() to avoid copy and paste. Fix typo in
fdt_size_cells() documentation comment.

This is based in upstream commit:
c12b2b0 ("libfdt: fdt_address_cells() and fdt_size_cells()")
but misses the test cases, as we don't implement them in U-Boot.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosandbox: fix cpu property in test.dts for pytest
AKASHI Takahiro [Tue, 27 Aug 2019 08:17:03 +0000 (17:17 +0900)]
sandbox: fix cpu property in test.dts for pytest

When I tried to run some new efi tests with pytest, efi_smbios_register()
triggered a segmentation fault. Here is the location where it happened:
efi_init_obj_list()
  efi_smbios_register()
    write_smbios_table()
      smbios_write_type4()
        smbios_write_type4_dm()

where dev_get_parent_platdata() should return a pointer to struct
cpu_platdata, but it is actually NULL because any cpu device on
sandbox is attached to "root_driver."

With this patch, this issue will be fixed by moving all the definitions
of cpus under "cpus" node so that they have a "cpu_bus" parent.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodoc: add full path to patman README
Ralph Siemsen [Mon, 19 Aug 2019 19:00:30 +0000 (15:00 -0400)]
doc: add full path to patman README

Make it a little easier to find the documentation.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: pinctrl: introduce PINCONF_RECURSIVE option
Patrick Delaunay [Fri, 2 Aug 2019 12:48:00 +0000 (14:48 +0200)]
dm: pinctrl: introduce PINCONF_RECURSIVE option

In the Linux pinctrl binding, the pin configuration nodes don't need to
be direct children of the pin controller device (may be grandchildren for
example). This behavior is managed with the pinconfig u-class which
recursively bind all the sub-node of the pin controller.

But for some binding (when pin configuration is only children of pin
controller) that is not necessary. U-Boot can save memory and reduce
the number of pinconf instance when this feature is deactivated
(for arch stm32mp for example for SPL).

This patch allows to control this feature with a new option
CONFIG_PINCONF_RECURSIVE when it is possible for each individual
pin controller device.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Drop comment-out code in testUpdateFdtOutput()
Simon Glass [Sat, 24 Aug 2019 13:23:14 +0000 (07:23 -0600)]
binman: Drop comment-out code in testUpdateFdtOutput()

This code is not needed so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add logging for the number of pack passes
Simon Glass [Sat, 24 Aug 2019 13:23:13 +0000 (07:23 -0600)]
binman: Add logging for the number of pack passes

Sometimes binman takes multiple passes to complete packing an image. Add
logging to indicate this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Write symbol info before image inclusion
Simon Glass [Sat, 24 Aug 2019 13:23:12 +0000 (07:23 -0600)]
binman: Write symbol info before image inclusion

At present the symbol information is written to binaries just before
binman exits. This is fine for entries within sections since the section
contents is calculated when it is needed, so the updated symbol values are
included in the image that is written.

However some binaries are inside entries which have already generated
their contents and do not notice that the entries have changed (e.g. Intel
IFWI).

Move the symbol writing earlier to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Support writing symbols into entries within an IFWI
Simon Glass [Sat, 24 Aug 2019 13:23:11 +0000 (07:23 -0600)]
binman: Support writing symbols into entries within an IFWI

The Intel IFWI (Integrated Firmware Image) is effectively a section with
other entries inside it. Support writing symbol information into entries
within it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update IFWI entry to support updates
Simon Glass [Sat, 24 Aug 2019 13:23:10 +0000 (07:23 -0600)]
binman: Update IFWI entry to support updates

Add support for the ProcessContents() method in this entry so that it is
possible to support entries which change after initial creation.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update IFWI entry to read entries outside constructor
Simon Glass [Sat, 24 Aug 2019 13:23:09 +0000 (07:23 -0600)]
binman: Update IFWI entry to read entries outside constructor

At present this class reads its entries in the constructor. This is not
how things should be done now. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Fix entry comment for Intel descriptor
Simon Glass [Sat, 24 Aug 2019 13:23:08 +0000 (07:23 -0600)]
binman: Fix entry comment for Intel descriptor

This comment references another entry type. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add support for Intel FSP meminit
Simon Glass [Sat, 24 Aug 2019 13:23:07 +0000 (07:23 -0600)]
binman: Add support for Intel FSP meminit

The Intel FSP supports initialising memory early during boot using a binary
blob called 'fspm'. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Allow support for writing a size symbol to binaries
Simon Glass [Sat, 24 Aug 2019 13:23:05 +0000 (07:23 -0600)]
binman: Allow support for writing a size symbol to binaries

It is useful to be able to access the size of an image in SPL, with
something like:

binman_sym_declare(unsigned long, u_boot_any, size);

...
   ulong u_boot_size = binman_sym(ulong, u_boot_any, size);

Add support for this and update the tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Increase size of TPL and SPL test data
Simon Glass [Sat, 24 Aug 2019 13:23:04 +0000 (07:23 -0600)]
binman: Increase size of TPL and SPL test data

At present these are large enough to hold 20 bytes of symbol data. Add
four more bytes so we can add another test.

Unfortunately at present this involves changing a few test files to make
room. We could adjust the test files to not specify sizes for entries.
Then we could make the tests check the actual sizes. But for now, leave it
as it is, since the effort is minor.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Avoid needing the section size in advance
Simon Glass [Sat, 24 Aug 2019 13:23:03 +0000 (07:23 -0600)]
binman: Avoid needing the section size in advance

Entries which include a section and need to obtain its contents call
GetData(), as with any other entry. But the current implementation of this
method in entry_Section requires the size of the section to be known. If
it is unknown, an error is produced, since size is None:

   TypeError: can't multiply sequence by non-int of type 'NoneType'

There is no need to know the size in advance since the code can be
adjusted to build up the section piece by piece, instead of patching each
entry into an existing bytearray.

Update the code to handle this and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Rename some two-digit test files
Simon Glass [Sat, 24 Aug 2019 13:23:02 +0000 (07:23 -0600)]
binman: Rename some two-digit test files

Two of the test files somehow were not converted to three digits. Fix
them, using the next available numbers.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Use underscore in test filenames
Simon Glass [Sat, 24 Aug 2019 13:23:01 +0000 (07:23 -0600)]
binman: Use underscore in test filenames

At present a small number of test files use hyphens instead of
underscores. Rename them for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>