oweals/u-boot.git
6 years agousb: xhci: Fix bool initialization in xhci_bulk_tx
Gustavo A. R. Silva [Sat, 20 Jan 2018 08:37:31 +0000 (02:37 -0600)]
usb: xhci: Fix bool initialization in xhci_bulk_tx

Bool initializations should use true and false.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
6 years agoMerge git://git.denx.de/u-boot-mmc
Tom Rini [Wed, 24 Jan 2018 16:28:44 +0000 (11:28 -0500)]
Merge git://git.denx.de/u-boot-mmc

6 years agommc: Poll for broken card detection case
Jun Nie [Tue, 2 Jan 2018 04:25:57 +0000 (12:25 +0800)]
mmc: Poll for broken card detection case

Poll for broken card detection case instead of return
no card detected.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
6 years agommc: fix to assign to correct clock value when clock is enabling
Jaehoon Chung [Tue, 23 Jan 2018 05:04:30 +0000 (14:04 +0900)]
mmc: fix to assign to correct clock value when clock is enabling

When clock is enabling, it's assigned to 0 as mmc->clock.
Then it can't initialize any card.
Fix to assign to correct clock value as mmc->cfg->f_min or f_max.

Fixes: 9546eb92cb6 ("mmc: fix the wrong disabling clock")
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Guillaume GARDET <guillaume.gardet@free.fr>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
6 years agoconfigs: odroid-xu3: enable the configs relevant to regulator
Jaehoon Chung [Tue, 16 Jan 2018 06:33:52 +0000 (15:33 +0900)]
configs: odroid-xu3: enable the configs relevant to regulator

Enable the CONFIG_CMD_REGULATOR and CONFIG_DM_REGULATOR_S2MPS11.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Anand Moon <linux.amoon@gmail.com>
6 years agopower: pmic: s2mps11: probe the regulator driver
Jaehoon Chung [Tue, 16 Jan 2018 06:33:51 +0000 (15:33 +0900)]
power: pmic: s2mps11: probe the regulator driver

Add the probe function to support the s2mps11 regulator driver.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Anand Moon <linux.amoon@gmail.com>
6 years agopower: regulator: s2mps11: add a regulator driver for s2mps11
Jaehoon Chung [Tue, 16 Jan 2018 06:33:50 +0000 (15:33 +0900)]
power: regulator: s2mps11: add a regulator driver for s2mps11

exynos5422 has the s2mps11 PMIC.
s2mps11 pmic has the 10-BUCK and 38-LDO regulators.
Each IP and devices in exynos5422 can be controlled by each regulators.
This patch is support for s2mps11 regulator driver.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Anand Moon <linux.amoon@gmail.com>
6 years agoMerge git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Wed, 24 Jan 2018 02:48:53 +0000 (21:48 -0500)]
Merge git://git.denx.de/u-boot-fsl-qoriq

6 years agoarmv8: ls1088a: Add IFC and eMMC as qixis boot sources
Ashish Kumar [Wed, 17 Jan 2018 06:46:37 +0000 (12:16 +0530)]
armv8: ls1088a: Add IFC and eMMC as qixis boot sources

Add macro QIXIS_LBMAP_EMMC, QIXIS_LBMAP_IFC, QIXIS_RCW_SRC_IFC,
QIXIS_RCW_SRC_EMMC to enable IFC and eMMC as boot sources for
qixis commands.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
[YS: Modify subject and add commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agofsl: common: qixis: Add ifc and emmc switching via qixis
Ashish Kumar [Wed, 17 Jan 2018 06:46:36 +0000 (12:16 +0530)]
fsl: common: qixis: Add ifc and emmc switching via qixis

Currently only SD, NAND can be secondary boot sources controlled
by FPGA/CPLD via qixis commands. For SoC like LS1088 IFC-NOR
can be secondary boot source, while QSPI-NOR is the primary.
Add options in qixis to switch to other boot sources including
ifc and emmc.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agocrypto/fsl: Fix HW accelerated hash commands
Breno Lima [Wed, 17 Jan 2018 12:03:45 +0000 (10:03 -0200)]
crypto/fsl: Fix HW accelerated hash commands

The hash command function were not flushing the dcache before passing data
to CAAM/DMA and not invalidating the dcache when getting data back.

Due the data cache incoherency, HW accelerated hash commands used to fail
with CAAM errors like "Invalid KEY Command".

Check if pbuf and pout buffers are properly aligned to the cache line size
and flush/invalidate the memory regions to address this issue.

This solution is based in a previous work from Clemens Gruber in
commit 598e9dccc75d ("crypto/fsl: fix BLOB encapsulation and
decapsulation")

Reported-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoARM: dts: Freescale: re-license device tree files under GPLv2+/X11
Pankaj Bansal [Thu, 18 Jan 2018 04:13:33 +0000 (09:43 +0530)]
ARM: dts: Freescale: re-license device tree files under GPLv2+/X11

The current GPL only licensing on the device trees makes it very
impractical for other software components licensed under another
license.

To make it easier to reuse them, re-license the the device trees for
Freescale (now NXP) SoCs and boards under GPLv2+/X11 dual license.

Same trend is followed in linux.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: York Sun <york.sun@nxp.com>
Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1088a: vid: Compiling VID specific functions for SPL
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:10 +0000 (16:13 +0530)]
armv8: ls1088a: vid: Compiling VID specific functions for SPL

Enables and compiles VID specific functions for SPL.

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agols1088a: Add VID support for QDS and RDB platforms
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:09 +0000 (16:13 +0530)]
ls1088a: Add VID support for QDS and RDB platforms

This patch adds the support for VID on LS1088AQDS and LS1088ARDB systems.
It reads the fusesr register and changes the VDD accordingly by adjusting
the voltage via LTC3882 regulator.

This patch also takes care of the special case of 0.9V VDD is present in
fusesr register. In that case,it also changes the SERDES voltage by
disabling the SERDES, changing the SVDD and then re-enabling SERDES.

Signed-off-by: Raghav Dogra <raghav.dogra@nxp.com>
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Amrita Kumari <amrita.kumari@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agocommon: board_f: vid: Add VID specific API to adjust core voltage
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:08 +0000 (16:13 +0530)]
common: board_f: vid: Add VID specific API to adjust core voltage

Adds a VID specific API in init_sequence_f and spl code flow
namely init_func_vid which is required to adjust core voltage.

VID specific code is required in spl, hence moving flag CONFIG_VID
out of spl flags.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agols1088a: ddr: configure DDR for 0.9v for VID support
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:07 +0000 (16:13 +0530)]
ls1088a: ddr: configure DDR for 0.9v for VID support

When VID feature is supported, check the contents of fuse register
and configure DDR operate at 0.9v.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoddr: fsl: set cdr1 first in case 0.9v VDD is enabled for some SoCs
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:06 +0000 (16:13 +0530)]
ddr: fsl: set cdr1 first in case 0.9v VDD is enabled for some SoCs

Sets DDR configuration parameter cdr1 before all other settings
to support case 0.9v VDD is enabled for some SoCs

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoboard: common: vid: Add support for LTC3882 voltage regulator chip
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:05 +0000 (16:13 +0530)]
board: common: vid: Add support for LTC3882 voltage regulator chip

Restructures common driver to support LTC3882 voltage regulator
chip.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoKconfig: Add LTC3882 voltage regulator config
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:04 +0000 (16:13 +0530)]
Kconfig: Add LTC3882 voltage regulator config

Adds below LTC3882 voltage regulator config:
CONFIG_VOL_MONITOR_LTC3882_READ
CONFIG_VOL_MONITOR_LTC3882_SET

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoboard: common: vid: Move IR chip specific code in flag
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:03 +0000 (16:13 +0530)]
board: common: vid: Move IR chip specific code in flag

Moves IR chip (IR36021) specific code in flag to resolve
compilation issue where it is not present. For example,
LS1088A is having a new LTC3882 voltage chip.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoboard: common: vid: Add board specific vdd adjust API
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:02 +0000 (16:13 +0530)]
board: common: vid: Add board specific vdd adjust API

Adds a board specific API namely board_adjust_vdd which
is required to define the board VDD adjust settings.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoboard: common:vid: Add LS1088A VID Supported voltage values
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:01 +0000 (16:13 +0530)]
board: common:vid: Add LS1088A VID Supported voltage values

Adds below voltage values supported by LS1088A Soc:
1.025V(default), 0.9875V, 0.9750V, 0.9V, 1.0V, 1.0125V, 1.0250V.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: lsch3: Add serdes and DDR voltage setup
Rajesh Bhagat [Wed, 17 Jan 2018 10:43:00 +0000 (16:13 +0530)]
armv8: lsch3: Add serdes and DDR voltage setup

Adds SERDES voltage and reset SERDES lanes API and makes
enable/disable DDR controller support 0.9V API common.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoMerge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Tom Rini [Tue, 23 Jan 2018 12:59:43 +0000 (07:59 -0500)]
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-01-23

This time around we have a lot of EFI patches from Heinrich.
Highlights are:

  - Allow EFI applications to register as drivers
  - Allow exposure of U-Boot block devices from an EFI payload
  - Compatibility improvements

6 years agoRevert "travis-ci: Add qemu-x86_64 target"
Tom Rini [Tue, 23 Jan 2018 02:06:41 +0000 (21:06 -0500)]
Revert "travis-ci: Add qemu-x86_64 target"

This reverts commit 998ae28799c79c6bc796aea182ae6acf13d18284.

This continues to fail in travis itself, so remove for now.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoConvert CONFIG_SOC_DA8XX et al to Kconfig
Adam Ford [Thu, 11 Jan 2018 14:20:27 +0000 (08:20 -0600)]
Convert CONFIG_SOC_DA8XX et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SOC_DA8XX
   CONFIG_SOC_DA850
   CONFIG_DA850_LOWLEVEL
   CONFIG_MACH_DAVINCI_DA850_EVM
   CONFIG_SYS_DA850_PLL_INIT
   CONFIG_SYS_DA850_DDR_INIT

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: David Lechner <david@lechnology.com>
[trini: Rework CONFIG_SYS_DA850_PLL_INIT so it's selected on SOC_DA8XX]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoefi_selftest: reduce noise in test output for device trees
Heinrich Schuchardt [Sat, 20 Jan 2018 19:44:10 +0000 (20:44 +0100)]
efi_selftest: reduce noise in test output for device trees

Some messages are only useful if an error occurs.
Fix a use after free.
Add a missing free.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: allow creation of more device part nodes
Heinrich Schuchardt [Sat, 20 Jan 2018 20:02:18 +0000 (21:02 +0100)]
efi_loader: allow creation of more device part nodes

Create device path nodes for UCLASS_ETH udevices.
Create device path nodes of block device children of UCLASS_MMC udevices.
Consistently use debug for unsupported nodes.
Set the log level to error.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: Fix build failure by adding #ifdef CONFIG_DM_ETH]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: provide a test for block io
Heinrich Schuchardt [Sun, 21 Jan 2018 18:29:31 +0000 (19:29 +0100)]
efi_selftest: provide a test for block io

This test checks the driver for block IO devices.
A disk image is created in memory.
A handle is created for the new block IO device.
The block I/O protocol is installed on the handle.
ConnectController is used to setup partitions and to install the simple
file protocol.
A known file is read from the file system and verified.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_driver: EFI block driver
Heinrich Schuchardt [Sun, 21 Jan 2018 18:29:30 +0000 (19:29 +0100)]
efi_driver: EFI block driver

This patch provides
* a uclass for EFI drivers
* a EFI driver for block devices

For each EFI driver the uclass
* creates a handle
* adds the driver binding protocol

The uclass provides the bind, start, and stop entry points for the driver
binding protocol.

In bind() and stop() it checks if the controller implements the protocol
supported by the EFI driver. In the start() function it calls the bind()
function of the EFI driver. In the stop() function it destroys the child
controllers.

The EFI block driver binds to controllers implementing the block io
protocol.

When the bind function of the EFI block driver is called it creates a
new U-Boot block device. It installs child handles for all partitions and
installs the simple file protocol on these.

The read and write functions of the EFI block driver delegate calls to the
controller that it is bound to.

A usage example is as following:

U-Boot loads the iPXE snp.efi executable. iPXE connects an iSCSI drive and
exposes a handle with the block IO protocol. It calls ConnectController.

Now the EFI block driver installs the partitions with the simple file
protocol.

iPXE uses the simple file protocol to load Grub or the Linux Kernel.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: add comment on calloc len]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: add missing LF in test output
Heinrich Schuchardt [Sun, 21 Jan 2018 20:30:57 +0000 (20:30 +0000)]
efi_selftest: add missing LF in test output

The output of the minicapps lacks a line feed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: store DT in EFI_RUNTIME_SERVICES_DATA memory
Heinrich Schuchardt [Thu, 18 Jan 2018 22:21:22 +0000 (23:21 +0100)]
efi_loader: store DT in EFI_RUNTIME_SERVICES_DATA memory

The device tree is needed at runtime. So we have to store it in
EFI_RUNTIME_SERVICES_DATA memory.

The UEFI spec recommends to store all configuration tables in
EFI_RUNTIME_SERVICES_DATA memory.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: test start image
Heinrich Schuchardt [Fri, 19 Jan 2018 18:01:05 +0000 (19:01 +0100)]
efi_selftest: test start image

This pair of tests checks the StartImage boot service.

Each test loads an EFI application into memory and starts it.
One returns by calling the Exit boot service. The other returns directly.

The tests are not built on x86_64 because the relocation code for the efi
binary cannot be created.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix ExitBootServices
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:52 +0000 (20:24 +0100)]
efi_loader: fix ExitBootServices

This patch lets the implementation of ExitBootServices conform to
the UEFI standard.

The timer events must be disabled before calling the notification
functions of the exit boot services events.

The boot services must be disabled in the system table.

The handles in the system table should be defined as efi_handle_t.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: add check_tpl parameter to efi_signal_event
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:51 +0000 (20:24 +0100)]
efi_loader: add check_tpl parameter to efi_signal_event

In ExitBootServices we need to signal events irrespective of the current
TPL level. A new parameter check_tpl is added to efi_signal_event().

Function efi_console_timer_notify() gets some comments.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: provide function to get last node of a device path
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:49 +0000 (20:24 +0100)]
efi_loader: provide function to get last node of a device path

On a block device and its partitions the same protocols can be
installed. To tell the apart we can use the type of the last
node of the device path which is not the end node.

The patch provides a utility function to find this last node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: correct EFI_BLOCK_IO_PROTOCOL definitions
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:48 +0000 (20:24 +0100)]
efi_loader: correct EFI_BLOCK_IO_PROTOCOL definitions

Add the revision constants.
Depending on the revision additional fields are needed in the
media descriptor.
Use efi_uintn_t for number of bytes to read or write.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: make efi_disk_create_partitions a global symbol
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:47 +0000 (20:24 +0100)]
efi_loader: make efi_disk_create_partitions a global symbol

Up to now we have been using efi_disk_create_partitions() to create
partitions for block devices that existed before starting an EFI
application.

We need to call it for block devices created by EFI
applications at run time. The EFI application will define the
handle for the block device and install a device path protocol
on it. We have to use this device path as stem for the partition
device paths.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: provide a function to create a partition node
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:46 +0000 (20:24 +0100)]
efi_loader: provide a function to create a partition node

Provide new function efi_dp_part_node() to create a device
node for a partition.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: make efi_block_io_guid a global symbol
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:45 +0000 (20:24 +0100)]
efi_loader: make efi_block_io_guid a global symbol

The GUID of the EFI_BLOCK_IO_PROTOCOL is needed in different code
parts. To avoid duplication make efi_block_io_guid a global symbol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: efi_disk_register: correctly determine if_type_name
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:44 +0000 (20:24 +0100)]
efi_loader: efi_disk_register: correctly determine if_type_name

The interface type name can be used to look up the interface type.
Don't confound it with the driver name which may be different.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix StartImage bootservice
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:43 +0000 (20:24 +0100)]
efi_loader: fix StartImage bootservice

The calling convention for the entry point of an EFI image
is always 'asmlinkage'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: check tables in helloworld.efi
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:42 +0000 (20:24 +0100)]
efi_loader: check tables in helloworld.efi

Check if the device tree and the SMBIOS table are available.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: allocate correct memory type for EFI image
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:41 +0000 (20:24 +0100)]
efi_loader: allocate correct memory type for EFI image

The category of memory allocated for an EFI image should depend on
its type (application, bootime service driver, runtime service driver).

Our helloworld.efi built on arm64 has an illegal image type. Treat it
like an EFI application.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: print device path when entering efi_load_image
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:40 +0000 (20:24 +0100)]
efi_loader: print device path when entering efi_load_image

Use %pD to print the device path instead of its address when
entering efi_load_image.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: correct find simple file system protocol
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:39 +0000 (20:24 +0100)]
efi_loader: correct find simple file system protocol

In contrast to the description the code did not split the device
path into device part and file part.

The code should use the installed protocol and not refer to the
internal structure of the the disk object.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: address of the simple file system protocol
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:38 +0000 (20:24 +0100)]
efi_loader: address of the simple file system protocol

When installing the the simple file system protocol we have to path
the address of the structure and not the address of a pointer to the
structure.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: return NULL from device path functions
Heinrich Schuchardt [Fri, 19 Jan 2018 19:24:37 +0000 (20:24 +0100)]
efi_loader: return NULL from device path functions

For the construction of device paths we need to call the
AllocatePool service. We should not ignore if it fails due to an
out of memory situation.

This patch changes the device path functions to return NULL if
the memory allocation fails.

Additional patches will be needed to fix the callers.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: consistently use efi_handle_t for handles
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:09 +0000 (08:16 +0100)]
efi_loader: consistently use efi_handle_t for handles

We should consistently use the efi_handle_t typedef when
referring to handles.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: test for (Dis)ConnectController
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:08 +0000 (08:16 +0100)]
efi_selftest: test for (Dis)ConnectController

This unit test checks the following protocol services:
ConnectController, DisconnectController,
InstallProtocol, UninstallProtocol,
OpenProtocol, CloseProtcol, OpenProtocolInformation

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: remove todo in device path test
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:07 +0000 (08:16 +0100)]
efi_selftest: remove todo in device path test

The installation of UninstallProtocol is functional now.
So we do not expect errors when calling it.

Call UninstallProtocol with correct level of indirection
for parameter handle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: remove todo in manage protocols
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:06 +0000 (08:16 +0100)]
efi_selftest: remove todo in manage protocols

The installation of UninstallProtocols is functional now.
So we do not expect errors when calling it.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: disconnect controllers in UninstallProtocol
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:05 +0000 (08:16 +0100)]
efi_loader: disconnect controllers in UninstallProtocol

The UninstallProtocol boot service should first try to
disconnect controllers that have been connected with
EFI_OPEN_PROTOCOL_BY_DRIVER.

If the protocol is still opened by an agent, it should be
closed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: implement DisconnectController
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:04 +0000 (08:16 +0100)]
efi_loader: implement DisconnectController

Unfortunately we need a forward declaration because both
OpenProtocol and CloseProtocol have to call DisconnectController.
And DisconnectController calls both OpenProtcol and CloseProtocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix signature of efi_disconnect_controller
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:03 +0000 (08:16 +0100)]
efi_loader: fix signature of efi_disconnect_controller

Handles should be passed as efi_handle_t and not as void *.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: implement ConnectController
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:02 +0000 (08:16 +0100)]
efi_loader: implement ConnectController

Implement the ConnectController boot service.

A unit test is supplied in a subsequent patch.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: debug output installed device path
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:01 +0000 (08:16 +0100)]
efi_loader: debug output installed device path

When a device path protocol is installed write the device
path to the console in debug mode.

For printing the new macro EFI_PRINT is used, which can be reused
for future diagnostic output.

Remove unused EFI_PRINT_GUID macro

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: implement OpenProtocolInformation
Heinrich Schuchardt [Thu, 11 Jan 2018 07:16:00 +0000 (08:16 +0100)]
efi_loader: implement OpenProtocolInformation

efi_open_protocol_information provides the agent and controller
handles as well as the attributes and open count of an protocol
on a handle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: fix counting error]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: open_info in CloseProtocol
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:59 +0000 (08:15 +0100)]
efi_loader: open_info in CloseProtocol

efi_open_protocol and efi_close_protocol have to keep track of
opened protocols.

Check if the protocol was opened for the same agent and
controller.

Remove all open protocol information for this pair.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: open_info in OpenProtocol
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:58 +0000 (08:15 +0100)]
efi_loader: open_info in OpenProtocol

efi_open_protocol has to keep track of opened protocols.

OpenProtocol enters the agent and controller handle
information into this list.

A unit test is supplied with a subsequent patch.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: list of open protocol infos
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:57 +0000 (08:15 +0100)]
efi_loader: list of open protocol infos

Add a list of open protocol infos to each protocol of a handle.

Provide helper functions to access the list items.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: do not try to close device path protocol
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:56 +0000 (08:15 +0100)]
efi_selftest: do not try to close device path protocol

CloseProtocol cannot be called without agent handle.

There is no need to close the device path protocol if
it has been opened without agent handle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: simplify efi_remove_all_protocols
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:55 +0000 (08:15 +0100)]
efi_loader: simplify efi_remove_all_protocols

Replace list_for_each_safe() and list_entry() by
list_for_each_entry_safe().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: colored test output
Heinrich Schuchardt [Thu, 11 Jan 2018 07:15:54 +0000 (08:15 +0100)]
efi_selftest: colored test output

Add color coding to output:
test section    blue
success         green
errors          red
todo            yellow
summary         white
others          light gray

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
[agraf: Fold in move of set_attribute before the print]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agotools: provide a tool to convert a binary file to an include
Heinrich Schuchardt [Wed, 17 Jan 2018 19:16:09 +0000 (20:16 +0100)]
tools: provide a tool to convert a binary file to an include

For testing EFI disk management we need an in-memory image of
a disk.

The tool file2include converts a file to a C include. The file
is separated into strings of 8 bytes. Only the non-zero strings
are written to the include. The output format has been designed
to maintain readability.

 #define EFI_ST_DISK_IMG { 0x00010000, { \
  {0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \
  {0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \
  {0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \
  {0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \
 ...
  {0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \
  {0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \
  {0, NULL} } }

As the disk image needed for testing contains mostly zeroes a high
compression ratio can be attained.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: correctly call images
Heinrich Schuchardt [Thu, 18 Jan 2018 19:28:43 +0000 (20:28 +0100)]
efi_loader: correctly call images

Avoid a failed assertion when an EFI app calls an EFI app.

Avoid that the indent level increases when calling 'bootefi hello'
repeatedly.

Avoid negative indent level when an EFI app calls an EFI app that
calls an EFI app (e.g. iPXE loads grub which starts the kernel).

Return the status code of a loaded image that returns without
calling the Exit boot service.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agovsprintf.c: add EFI device path printing
Heinrich Schuchardt [Wed, 10 Jan 2018 17:06:08 +0000 (18:06 +0100)]
vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

    debug("device path: %pD", dp);

A possible output would be

    device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: text output for device path end node
Heinrich Schuchardt [Sun, 14 Jan 2018 16:05:57 +0000 (17:05 +0100)]
efi_loader: text output for device path end node

Without the patch a device path consisting only of an end node is
displayed as '/UNKNOWN(007f,00ff)'. It should be displayed as '/'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMAINTAINERS: correct entry for lib/efi*/
Heinrich Schuchardt [Tue, 2 Jan 2018 15:00:45 +0000 (16:00 +0100)]
MAINTAINERS: correct entry for lib/efi*/

lib/efi* indicates files efi* in directory lib.
lib/efi*/ indicates all files in directories lib/efi*.

Fixes: 623b3a579765 efi_selftest: provide an EFI selftest application
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: do not cut off u16 strings when printing
Heinrich Schuchardt [Fri, 22 Dec 2017 18:21:04 +0000 (19:21 +0100)]
efi_selftest: do not cut off u16 strings when printing

Device paths can be very long. Due to a limited output buffer
the output for device paths is cut off. We can avoid this by
directly calling the boottime service with the the device path
string.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: Remove coloring code change]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: avoid superfluous messages for task priority levels
Heinrich Schuchardt [Fri, 22 Dec 2017 18:21:03 +0000 (19:21 +0100)]
efi_selftest: avoid superfluous messages for task priority levels

In the task priority levels test debug output is written even if no
failure is detected.

Remove this distracting output.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: avoid superfluous messages for event services
Heinrich Schuchardt [Fri, 22 Dec 2017 18:21:02 +0000 (19:21 +0100)]
efi_selftest: avoid superfluous messages for event services

In the event services test debug output is written even if no
failure is detected.

Remove this distracting output.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: use correct format string for unsigned long
Heinrich Schuchardt [Fri, 22 Dec 2017 18:16:57 +0000 (19:16 +0100)]
efi_loader: use correct format string for unsigned long

virt_size is of type unsigned long.
So it should be printed with %ul.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: add comments to memory functions
Heinrich Schuchardt [Mon, 4 Dec 2017 19:52:41 +0000 (20:52 +0100)]
efi_loader: add comments to memory functions

Add comments describing memory functions.

Fix the formatting of a function declaration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: use wide string do define firmware vendor
Heinrich Schuchardt [Mon, 11 Dec 2017 19:10:20 +0000 (20:10 +0100)]
efi_loader: use wide string do define firmware vendor

As the U-Boot is compiled with -fshort-wchar we can define
the firmware vendor constant as wide string.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: support device path for IDE and SCSI disks
Heinrich Schuchardt [Mon, 11 Dec 2017 11:56:44 +0000 (12:56 +0100)]
efi_loader: support device path for IDE and SCSI disks

Correctly create the device path for IDE and SCSI disks.

Support for SATA remains to be done in a future patch.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: create full device path for block devices
Heinrich Schuchardt [Mon, 11 Dec 2017 11:56:43 +0000 (12:56 +0100)]
efi_loader: create full device path for block devices

When creating the device path of a block device it has to
comprise the block device itself and should not end at
its parent.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agofs: fat: Drop CONFIG_SUPPORT_VFAT
Tuomas Tynkkynen [Fri, 5 Jan 2018 00:45:21 +0000 (02:45 +0200)]
fs: fat: Drop CONFIG_SUPPORT_VFAT

fat.h unconditionally defines CONFIG_SUPPORT_VFAT (and has done since
2003), so as a result VFAT support is always enabled regardless of
whether a board config defines it or not. Drop this unnecessary option.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agofs: FAT: Fix typo in FS_FAT_MAX_CLUSTSIZE description
Tuomas Tynkkynen [Fri, 5 Jan 2018 00:45:20 +0000 (02:45 +0200)]
fs: FAT: Fix typo in FS_FAT_MAX_CLUSTSIZE description

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoenv: ENV_IS_IN_FAT improvements
Tuomas Tynkkynen [Fri, 5 Jan 2018 00:45:19 +0000 (02:45 +0200)]
env: ENV_IS_IN_FAT improvements

Make it select FS_FAT as well, because if it's not selected, enabling
ENV_IS_IN_FAT causes a Kconfig warning:

warning: (ENV_IS_IN_FAT) selects FAT_WRITE which has unmet direct dependencies (FS_FAT)

This also allows dropping some code from config_fallbacks.

Also drop the unnecessary help text about having to enable
CONFIG_FAT_WRITE - Kconfig automatically handles that.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoARM: poplar: Use Kconfig to enable CONFIG_FAT_WRITE
Tuomas Tynkkynen [Fri, 5 Jan 2018 00:45:18 +0000 (02:45 +0200)]
ARM: poplar: Use Kconfig to enable CONFIG_FAT_WRITE

The symbol's been converted to Kconfig for a while, poplar is the only
one #defining it.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agofs: Migrate ext4 to Kconfig
Tuomas Tynkkynen [Fri, 5 Jan 2018 00:45:17 +0000 (02:45 +0200)]
fs: Migrate ext4 to Kconfig

Migrate the following symbols to Kconfig:

CONFIG_FS_EXT4
CONFIG_EXT4_WRITE

The definitions in config_fallbacks.h can now be expressed in Kconfig.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoConvert CONFIG_ROCKCHIP_USB2_PHY to Kconfig
Adam Ford [Tue, 2 Jan 2018 16:39:52 +0000 (10:39 -0600)]
Convert CONFIG_ROCKCHIP_USB2_PHY to Kconfig

This converts the following to Kconfig:
   CONFIG_ROCKCHIP_USB2_PHY

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_OMAP_USB_PHY to Kconfig
Adam Ford [Tue, 2 Jan 2018 16:39:21 +0000 (10:39 -0600)]
Convert CONFIG_OMAP_USB_PHY to Kconfig

This converts the following to Kconfig:
   CONFIG_OMAP_USB_PHY

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_TWL4030_USB to Kconfig
Adam Ford [Tue, 2 Jan 2018 16:38:36 +0000 (10:38 -0600)]
Convert CONFIG_TWL4030_USB to Kconfig

This converts the following to Kconfig:
   CONFIG_TWL4030_USB

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_DAVINCI_SPI to Kconfig
Adam Ford [Sat, 30 Dec 2017 13:33:42 +0000 (07:33 -0600)]
Convert CONFIG_DAVINCI_SPI to Kconfig

This converts the following to Kconfig:
   CONFIG_DAVINCI_SPI

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_USB_MUSB_HCD et al to Kconfig
Adam Ford [Fri, 29 Dec 2017 15:15:41 +0000 (09:15 -0600)]
Convert CONFIG_USB_MUSB_HCD et al to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_MUSB_HCD
   CONFIG_USB_MUSB_UDC
   CONFIG_USB_DAVINCI
   CONFIG_USB_OMAP3
   CONFIG_USB_DA8XX
   CONFIG_USB_AM35X

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_USB_MUSB_OMAP2PLUS et al to Kconfig
Adam Ford [Fri, 29 Dec 2017 14:16:05 +0000 (08:16 -0600)]
Convert CONFIG_USB_MUSB_OMAP2PLUS et al to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_MUSB_OMAP2PLUS
   CONFIG_USB_MUSB_AM35X
   CONFIG_USB_MUSB_DSPS
   CONFIG_USB_MUSB_PIO_ONLY

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: omap3_logic: Enable SPL_OF_CONTROL and SPL_OF_PLATDATA
Adam Ford [Wed, 27 Dec 2017 19:39:56 +0000 (13:39 -0600)]
ARM: omap3_logic: Enable SPL_OF_CONTROL and SPL_OF_PLATDATA

The SPL doesn't have much room, so in order to support OF_CONTROL
in SPL, we need the extra functionality of SPL_OF_PLATDATA.

Adding these features allows us to remove a small part of code without
losing the serial port during SPL.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agotravis-ci: Add qemu-x86_64 target
Tom Rini [Sat, 11 Feb 2017 15:44:05 +0000 (10:44 -0500)]
travis-ci: Add qemu-x86_64 target

Add qemu-x86_64 to the list of targets we use for test.py runs.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agommc: fsl_esdhc: Fix i.MX53 eSDHCv3 clock
Benoît Thébaudeau [Tue, 16 Jan 2018 21:44:18 +0000 (22:44 +0100)]
mmc: fsl_esdhc: Fix i.MX53 eSDHCv3 clock

Commit 4f425280fa71 ("mmc: fsl_esdhc: Allow all supported prescaler
values") made it possible to set SYSCTL.SDCLKFS to 0 in SDR mode on
i.MX, thus bypassing the SD clock frequency prescaler, in order to be
able to get higher SD clock frequencies in some contexts. However, that
commit missed the fact that this value is illegal on the eSDHCv3
instance of the i.MX53. This seems to be the only exception on i.MX,
this value being legal even for the eSDHCv2 instances of the i.MX53.

Fix this issue by changing the minimum prescaler value for the single
instance of the i.MX53 eSDHCv3 controller.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agommc: fix the wrong disabling clock
Jaehoon Chung [Wed, 17 Jan 2018 10:36:58 +0000 (19:36 +0900)]
mmc: fix the wrong disabling clock

When power is off, clock is not disabling.
Because it's passed to 1, mmc->clock should be set to f_min value.
Some drivers can't initialize the eMMC/SD card with current status.

This patch is to fix the disabling clock value to 0.

Fixes: 2e7410d76ad1 ("mmc: disable the mmc clock during power off")

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Guillaume GARDET <guillaume.gardet@free.fr>
Tested-by: Anand Moon <linux.amoon@gmail.com>
6 years agommc: sdhci: change data transfer failure into debug message
Masahiro Yamada [Fri, 29 Dec 2017 17:00:12 +0000 (02:00 +0900)]
mmc: sdhci: change data transfer failure into debug message

During the tuning, drivers repeat data transfer, changing timing
parameters in the controller hardware.  So, the tuning commands
(CMD19 for SD, CMD21 for eMMC) fail, and this is not a problem
at all.

Showing "Error detected..." in normal operation just make users
upset.  This should not be shown.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agommc: sdhci-cadence: add HS200 support
Masahiro Yamada [Fri, 12 Jan 2018 09:10:38 +0000 (18:10 +0900)]
mmc: sdhci-cadence: add HS200 support

Add HS200 timing setting and the MMC tuning callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 years agommc: sdhci-cadence: call mmc_of_parse()
Masahiro Yamada [Fri, 29 Dec 2017 17:00:10 +0000 (02:00 +0900)]
mmc: sdhci-cadence: call mmc_of_parse()

This is needed to parse more capabilities such as mmc-hs200-1_8v.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agommc: sdhci-cadence: use bitfield access macros for cleanup
Masahiro Yamada [Fri, 29 Dec 2017 17:00:09 +0000 (02:00 +0900)]
mmc: sdhci-cadence: use bitfield access macros for cleanup

This driver is a counterpart from the one in Linux.  Follow the
clean-up I did in Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agommc: sdhci: do not overwrite host_caps in sdhci_setup_cfg()
Masahiro Yamada [Fri, 29 Dec 2017 17:00:08 +0000 (02:00 +0900)]
mmc: sdhci: do not overwrite host_caps in sdhci_setup_cfg()

This line overwrites host_cap that has been set by drivers and/or
helpers like mmc_of_parse().  Accumulate capabilities flags.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agommc: let mmc_of_parse() fail for insane bus-width value
Masahiro Yamada [Fri, 29 Dec 2017 17:00:07 +0000 (02:00 +0900)]
mmc: let mmc_of_parse() fail for insane bus-width value

You must fix your DT if it specifies insane bus-width, for example,
  bus-width = <3>;

debug() is not displayed in usual configuration, so people will not
even notice weirdness.  Use dev_err() instead, then let it fail.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agommc: do not overwrite cfg->f_max if "max-frequency" if missing
Masahiro Yamada [Fri, 29 Dec 2017 17:00:06 +0000 (02:00 +0900)]
mmc: do not overwrite cfg->f_max if "max-frequency" if missing

mmc_of_parse() in U-Boot is a pussy helper; it sets cfg->f_max to
52MHz even if DT does not provide "max-frequency" at all.  This can
overwrite cfg->f_max that may have been set to a reasonable default.

As the DT binding says, "max-frequency" is an optional property.
Do nothing if DT does not specify it.  This is the behavior of
mmc_of_parse() in Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agodm: add dev_read_u32()
Masahiro Yamada [Fri, 29 Dec 2017 17:00:05 +0000 (02:00 +0900)]
dm: add dev_read_u32()

dev_read_u32_default() always returns something even when the property
is missing.  So, it is impossible to do nothing in the case.  One
solution is to use ofnode_read_u32() instead, but adding dev_read_u32()
will be helpful.

BTW, Linux has an equvalent function, device_property_read_u32();
it is clearer that it reads a property.  I cannot understand the
behavior of dev_read_u32() from its name.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>