oweals/u-boot.git
4 years agoufs: Add glue layer driver for TI J721E devices
Faiz Abbas [Tue, 15 Oct 2019 12:54:38 +0000 (18:24 +0530)]
ufs: Add glue layer driver for TI J721E devices

Add glue layer driver for the controller present on TI's J721E devices.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoufs: Add Support for Cadence platform UFS driver
Faiz Abbas [Tue, 15 Oct 2019 12:54:37 +0000 (18:24 +0530)]
ufs: Add Support for Cadence platform UFS driver

Add Support for the platform driver for the Cadence device present on
TI's J721e device.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoufs: Add Initial Support for UFS subsystem
Faiz Abbas [Tue, 15 Oct 2019 12:54:36 +0000 (18:24 +0530)]
ufs: Add Initial Support for UFS subsystem

Add Support for UFS Host Controller Interface (UFSHCI) for communicating
with Universal Flash Storage (UFS) devices. The steps to initialize the
host controller interface are the following:

- Initiate the Host Controller Initialization process by writing to the
Host controller enable register.
- Configure the Host Controller base address registers by allocating a
host memory space and related data structures.
- Unipro link startup procedure
- Check for connected device
- Configure UFS host controller to process requests

Also register this host controller as a SCSI host controller.

Taken from Linux Kernel v5.2 (drivers/scsi/ufs/ufshcd.c) and ported to
U-boot.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoscsi: Add dma direction member to command structure
Faiz Abbas [Tue, 15 Oct 2019 12:54:35 +0000 (18:24 +0530)]
scsi: Add dma direction member to command structure

Some SCSI devices like UFS use DMA for executing scsi commands and hence
need to know the direction of transfer of the dma. Add a dma_dir element
to the command structure to facilitate this.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoscsi: Retry inquiry 3 times to overcome Unit Attention condition
Faiz Abbas [Tue, 15 Oct 2019 12:54:34 +0000 (18:24 +0530)]
scsi: Retry inquiry 3 times to overcome Unit Attention condition

The UFS SCSI device LUNs are observed to return failure the first time a
unit ready inquiry is sent and pass on the second try. Send this
inquiry 3 times to make sure device is ready.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoscsi: Add max_bytes_per_req to scsi_platdata
Faiz Abbas [Tue, 15 Oct 2019 12:54:33 +0000 (18:24 +0530)]
scsi: Add max_bytes_per_req to scsi_platdata

Add max_bytes_per_req to scsi_platdata to enable the host driver to limit
the number of bytes that can be read/written per request.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agoscsi: Simplify scsi_read()/_write()
Faiz Abbas [Tue, 15 Oct 2019 12:54:32 +0000 (18:24 +0530)]
scsi: Simplify scsi_read()/_write()

With no non-DM driver using scsi_read()/_write() APIs, remove
the legacy implementations.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
[trini: Reorder slightly and mark scsi_read/write behind BLK test to
avoid warnings]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'u-boot-stm32-2019-10-23' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 23 Oct 2019 18:04:02 +0000 (14:04 -0400)]
Merge tag 'u-boot-stm32-2019-10-23' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- Disable CONFIG_NET flag for MCU STM32
- Fix ramdisk_addr_r for stm32f746-disco
- Fix USB product id for stm32mp1

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Wed, 23 Oct 2019 11:55:20 +0000 (07:55 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- Add LS1027A, LS1018A, LS1017A support
- Few updates related to usb, ls1012a, lx2160a

4 years agoboard: stm32mp1: fixup the usb product id for USB download gadget
Patrick Delaunay [Fri, 13 Sep 2019 13:24:17 +0000 (15:24 +0200)]
board: stm32mp1: fixup the usb product id for USB download gadget

Select the correct USB product id used by the download gadget
for ST stm32mp1 boards.

The board stm32mp1 select the correct product id, as defined in
http://www.linux-usb.org/usb.ids for the STMicroelectronics
vendor id = 0x0483 (CONFIG_USB_GADGET_VENDOR_NUM):
- dfu = 0xdf11 : STM Device in DFU mode
  it is the value used by ROM code and reused for stm32prog
  command
- fasboot = 0x0afb : Android Fastboot device
- others = 0x5720 (CONFIG_USB_GADGET_PRODUCT_NUM)
  Mass Storage Device
  it is used for UMS command / usb_dnl_ums

This patch avoid conflict when the same USB VID/PID is used for
ums, fastboot or dfu command (two different protocols associated
to the same PID).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs: stm32f746-disco: Fix ramdisk_addr_r
Patrice Chotard [Mon, 16 Sep 2019 08:56:51 +0000 (10:56 +0200)]
configs: stm32f746-disco: Fix ramdisk_addr_r

Set ramdisk_addr_r to 0xC0600000.

Reported-by: Christophe Priouzeau <christophe.priouzeau@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32h743-eval: Disable CONFIG_NET flag
Patrice Chotard [Tue, 17 Sep 2019 08:09:45 +0000 (10:09 +0200)]
configs: stm32h743-eval: Disable CONFIG_NET flag

Network support was never added on this board, disable
CONFIG_NET flag to avoid following warning:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32h743-disco: Disable CONFIG_NET flag
Patrice Chotard [Tue, 17 Sep 2019 08:09:44 +0000 (10:09 +0200)]
configs: stm32h743-disco: Disable CONFIG_NET flag

Network support was never added on this board, disable
CONFIG_NET flag to avoid following warning:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32f469-discovery: Disable CONFIG_NET flag
Patrice Chotard [Tue, 17 Sep 2019 08:09:43 +0000 (10:09 +0200)]
configs: stm32f469-discovery: Disable CONFIG_NET flag

Network support was never added on this board, disable
CONFIG_NET flag to avoid following warning:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32f429-evaluation: Disable CONFIG_NET flag
Patrice Chotard [Tue, 17 Sep 2019 08:09:42 +0000 (10:09 +0200)]
configs: stm32f429-evaluation: Disable CONFIG_NET flag

Network support was never added on this board, disable
CONFIG_NET flag to avoid following warning:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32f429-discovery: Disable CONFIG_NET flag
Patrice Chotard [Tue, 17 Sep 2019 08:09:41 +0000 (10:09 +0200)]
configs: stm32f429-discovery: Disable CONFIG_NET flag

Network support was never added on this board, disable
CONFIG_NET flag to avoid following warning:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.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 agoarmv7: ls102xa: Don't power down OCRAM1 during deep sleep
Biwen Li [Mon, 21 Oct 2019 06:53:30 +0000 (12:23 +0530)]
armv7: ls102xa: Don't power down OCRAM1 during deep sleep

To allow OCRAM to be used as wakeup source in
deep sleep, do not power it down.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv7: ls102xa: add errata ID A-008646 for workaround
Biwen Li [Wed, 25 Sep 2019 10:40:42 +0000 (18:40 +0800)]
armv7: ls102xa: add errata ID A-008646 for workaround

The patch adds an errata ID A-008646 for workaround
to provide more information by errata ID.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: Update LX2160A/LX2120A/LX2080A SVR value
Wasim Khan [Tue, 15 Oct 2019 08:54:11 +0000 (08:54 +0000)]
armv8: Update LX2160A/LX2120A/LX2080A SVR value

LX2160A/LX2120A/LX2080A SVR value should be
0x873600/0x873620/0x873602
Previous values were valid only if CAN fuse is blown.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: ls1028a: disable multimedia for ls1027a, ls1017a
Yuantian Tang [Thu, 10 Oct 2019 09:19:37 +0000 (17:19 +0800)]
armv8: ls1028a: disable multimedia for ls1027a, ls1017a

ls1028a has 4 personalities: ls1028a, ls1027a, ls1017a and ls1018a.
Both ls1027a and ls1017a personalities are lower functionality version
which doesn't support the multimedia subsystems, like LCD, GPU.

To disable multimedia feature on non-multimedia version,
set the status property to disabled in dts nodes.

Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoboard/ls1028a: Add call to sec_init()
Udit Agarwal [Mon, 30 Sep 2019 10:16:57 +0000 (10:16 +0000)]
board/ls1028a: Add call to sec_init()

Adds sec_init call to initialise the job ring parameters
for secure boot operations.

Signed-off-by: Udit Agarwal <udit.agarwal@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012afrwy: Add CONFIG_ENV_ADDR
Kuldeep Singh [Mon, 30 Sep 2019 07:08:34 +0000 (12:38 +0530)]
configs: ls1012afrwy: Add CONFIG_ENV_ADDR

This configuration enables picking the environment from flash before
DDR init.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv7: ls102xa: Correct endianness of SCFG_SPARECR8 read
Biwen Li [Wed, 25 Sep 2019 09:48:11 +0000 (17:48 +0800)]
armv7: ls102xa: Correct endianness of SCFG_SPARECR8 read

The patch corrects endianness of register SCFG_SPARECR8 read
in_le32 -> in_be32

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: fsl-layerscape: Make USB masters snoopable
Ran Wang [Fri, 20 Sep 2019 09:34:29 +0000 (17:34 +0800)]
armv8: fsl-layerscape: Make USB masters snoopable

Program register bit of SCFG_SNPCNFGCR_USBxRDSNP and
SCFG_SNPCNFGCR_USBxWRSNP(x = 1, 2, 3) to drive USBx read/write
snoop signal on LS1043A and LS1046A.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv7: ls102xa: Update SCFG_QSPI_CLKSEL value
Kuldeep Singh [Wed, 18 Sep 2019 10:58:04 +0000 (16:28 +0530)]
armv7: ls102xa: Update SCFG_QSPI_CLKSEL value

Update SCFG_QSPI_CLKSEL value : 0xC -> 0x5
which means ClusterPLL/16

Signed-off-by: Ashish Kumar <Ashish.kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012ardb: Add CONFIG_ENV_ADDR
Kuldeep Singh [Wed, 18 Sep 2019 09:28:11 +0000 (14:58 +0530)]
configs: ls1012ardb: Add CONFIG_ENV_ADDR

CONFIG_ENV_ADDR config option enables picking the environment from
flash before DDR init.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: ls1028a: Add more personalities support
Yuantian Tang [Wed, 18 Sep 2019 08:50:52 +0000 (16:50 +0800)]
armv8: ls1028a: Add more personalities support

Add LS1027A, LS1018A and LS1017A personalities support to
LS1028A SoC family.

LS1028A is the prime personality of LS1028A SoC family.
LS1027A is a lower funtionality version of QorIQ LS1028A
which does not support the multimedia subsystems, such as LCD
controller, GPU, and eDP PHY.

The QorIQ LS1018A and LS1017A SoCs are single 64-bit Arm A72
core, low power versions of the QorIQ LS1028A and LS1027A
SoCs respectively.

Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.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>