]> git.ipfire.org Git - people/ms/u-boot.git/log
people/ms/u-boot.git
6 years agoarmv8/ls1046a: RGMII PHY requires internal delay on Tx
Madalin Bucur [Mon, 3 Apr 2017 14:43:56 +0000 (17:43 +0300)] 
armv8/ls1046a: RGMII PHY requires internal delay on Tx

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agoarmv8/ls1043a: RGMII PHY requires internal delay on Tx
Madalin Bucur [Mon, 3 Apr 2017 14:43:55 +0000 (17:43 +0300)] 
armv8/ls1043a: RGMII PHY requires internal delay on Tx

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: zynq_gem: Do not return -ENOSYS on success
Olliver Schinagl [Mon, 3 Apr 2017 14:18:53 +0000 (16:18 +0200)] 
net: zynq_gem: Do not return -ENOSYS on success

The .read_rom_hwaddr net_ops hook does not check the return value, which
is why it was never caught that we are currently returning 0 if the
read_rom_hwaddr function return -ENOSYS and -ENOSYS otherwise.

In this case we can simplify this by just returning the result of the
function.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
6 years agonet: designware: Add phy supply support
Jacob Chen [Mon, 27 Mar 2017 08:54:17 +0000 (16:54 +0800)] 
net: designware: Add phy supply support

Some board need a regulator for gmac phy, so add this code to handle it.
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: Kconfig:make PHY_GIGE and individual Micrel PHYs selectable
Philipp Tomsich [Sun, 26 Mar 2017 16:50:23 +0000 (18:50 +0200)] 
net: Kconfig:make PHY_GIGE and individual Micrel PHYs selectable

This change migrate the following configuration options for Kconfig:
 * PHY_GIGE, indicates that a controller (with an appropriate PHY) is
   Gigabit capable and enables extra support in the miiutil for
   parsing the status of Gigabit PHYs
 * adds configuration options for Micrel KSZ9021 and KSZ9031 GbE PHYs,
   which previously had to enabled through a board-specific config file

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agofdt: Drop fdt_select.py
Simon Glass [Sat, 27 May 2017 13:38:30 +0000 (07:38 -0600)] 
fdt: Drop fdt_select.py

This file was used to select between the normal and fallback libfdt
implementations. Now that we only have one, it is not needed.

Drop it and fix up all users.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Rename fdt variable to dtb
Simon Glass [Sat, 27 May 2017 13:38:29 +0000 (07:38 -0600)] 
binman: Rename fdt variable to dtb

Since fdt is the name of a module, use a different name for variables to
avoid a conflict.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Merge fdt_normal with its base class
Simon Glass [Sat, 27 May 2017 13:38:28 +0000 (07:38 -0600)] 
fdt: Merge fdt_normal with its base class

Since we only have one Fdt implementation now we don't need to have a base
class. Merge the implementation and the base class together.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Drop a special case related to fdt_fallback
Simon Glass [Sat, 27 May 2017 13:38:27 +0000 (07:38 -0600)] 
binman: Drop a special case related to fdt_fallback

Previously we were sometimes forced to collate x86 microcode due to not
having access to the offset of each individual piece. Now that we never
use fdt_fallback, we don't have this problem. Drop this special case from
the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Drop fdt_fallback library
Simon Glass [Sat, 27 May 2017 13:38:26 +0000 (07:38 -0600)] 
fdt: Drop fdt_fallback library

Drop this now-unused library and associated tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Drop use of the legacy libfdt python module
Simon Glass [Sat, 27 May 2017 13:38:25 +0000 (07:38 -0600)] 
fdt: Drop use of the legacy libfdt python module

Now that this is no-longer available, stop looking for it. The new module
will be used if available.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Stop building the old python libfdt module
Simon Glass [Sat, 27 May 2017 13:38:24 +0000 (07:38 -0600)] 
fdt: Stop building the old python libfdt module

This is no-longer needed, so stop building it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Makefile: Build python libfdt library if needed
Simon Glass [Sat, 27 May 2017 13:38:23 +0000 (07:38 -0600)] 
fdt: Makefile: Build python libfdt library if needed

This is needed by binman and dtoc, so if those are being used, check that
the library is present and complain if not. Make sure that any error
appears on stderr so that buildman notices it.

This means that the fallback library (which uses fdtget) will not be used
anymore and swig will need to be installed to use binman / dtoc.

This affects any board which uses binman (currently sunxi and x86) or dtoc
(anything that uses CONFIG_SPL_OF_PLATDATA, currently some rockchip
boards).

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Support use of the new python libfdt library
Simon Glass [Sat, 27 May 2017 13:38:22 +0000 (07:38 -0600)] 
fdt: Support use of the new python libfdt library

Use the new library if available, while retaining backwards compatibility
with the old library for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: dtoc: Add a full set of property tests
Simon Glass [Sat, 27 May 2017 13:38:21 +0000 (07:38 -0600)] 
fdt: dtoc: Add a full set of property tests

The tests don't currently cover all the different property types. Add a
new test which checks each property type in turn, to make sure each has
the correct type and value.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Update fdt_test to use 'dt' instead of 'fdt'
Simon Glass [Sat, 27 May 2017 13:38:20 +0000 (07:38 -0600)] 
fdt: Update fdt_test to use 'dt' instead of 'fdt'

Since fdt is a module it conflicts with this variable name and prevents it
being used in tests. Rename the variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Build the new python libfdt module
Simon Glass [Sat, 27 May 2017 13:38:19 +0000 (07:38 -0600)] 
fdt: Build the new python libfdt module

Build the upstream python libfdt module. At present the legacy module is
still built and is the one that it used. Future work will switch this
over.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Rename existing python libfdt module
Simon Glass [Sat, 27 May 2017 13:38:18 +0000 (07:38 -0600)] 
fdt: Rename existing python libfdt module

Now that this module has been accepted upstream we should stop using the
local U-Boot one. In preparation for this, rename it to indicate it is for
legacy use.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Add all source files to the libfdt build
Simon Glass [Sat, 27 May 2017 13:38:17 +0000 (07:38 -0600)] 
fdt: Add all source files to the libfdt build

At present only a subset of source files are build. Add the rest and
refactor this so that a source file list is available also. This will be
used in later commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Allow swig options to be provided by Makefile
Simon Glass [Sat, 27 May 2017 13:38:16 +0000 (07:38 -0600)] 
fdt: Allow swig options to be provided by Makefile

U-Boot needs to provide some swig include directories. Add this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Move header files into lib/libfdt
Simon Glass [Sat, 27 May 2017 13:38:15 +0000 (07:38 -0600)] 
fdt: Move header files into lib/libfdt

These header files are actually part of libfdt. Move them there to make
it easier to build pylibfdt and easier to merge changes from upstream.

Update the license header to use SPDX at the same time.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Use SPDX format for licenses in the libfdt headers
Simon Glass [Sat, 27 May 2017 13:38:14 +0000 (07:38 -0600)] 
fdt: Use SPDX format for licenses in the libfdt headers

These should follow the UBoot standard. Update them.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Correct cast for sandbox in fdtdec_setup_memory_size()
Simon Glass [Sat, 27 May 2017 13:38:13 +0000 (07:38 -0600)] 
fdt: Correct cast for sandbox in fdtdec_setup_memory_size()

This gives a warning with some native compilers:

lib/fdtdec.c:1203:8: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘long unsigned int’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agopci: Correct cast for sandbox
Simon Glass [Sat, 27 May 2017 13:38:12 +0000 (07:38 -0600)] 
pci: Correct cast for sandbox

This gives a warning with some native compilers:

cmd/pci.c:152:11: warning: format ‘%llx’ expects argument of type
   ‘long long unsigned int’, but argument 3 has type
   ‘u64 {aka long unsigned int}’ [-Wformat=]

Fix it with a cast.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Add Python bindings
Simon Glass [Sat, 27 May 2017 13:38:11 +0000 (07:38 -0600)] 
fdt: Add Python bindings

An early version of this is available upstream. Bring it in as a starting
point. This is from dtc upstream commit e56f2b0.

Future work will plumb it into dtoc and remove the now-unnecessary local
libraries.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosun50i: h5: Add initial Orangepi Prime support
Jagan Teki [Wed, 24 May 2017 19:18:08 +0000 (19:18 +0000)] 
sun50i: h5: Add initial Orangepi Prime support

Orangepi Prime is an open-source single-board computer
using the Allwinner h5 SOC.

H5 Orangepi Prime has
- Quad-core Cortex-A53
- 2GB DDR3
- Debug TTL UART
- 1000M/100M Ethernet RJ45
- Three USB 2.0
- HDMI
- Audio and MIC
- Wifi + BT
- IR receiver
- HDMI
- Wifi + BT

Boot from MMC:
-------------
U-Boot SPL 2017.05-00662-ga3f4c05-dirty (May 25 2017 - 13:30:14)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE:  BL3-1: Running on H5 (1718) in SRAM A2 (@0x44000)
NOTICE:  Configuring SPC Controller
NOTICE:  BL3-1: v1.0(debug):aa75c8d
NOTICE:  BL3-1: Built : 18:28:27, May 24 2017
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address: 0x4a000000, SPSR: 0x3c9

U-Boot 2017.05-00662-ga3f4c05-dirty (May 25 2017 - 13:30:14 +0000) Allwinner Technology

CPU:   Allwinner H5 (SUN50I)
Model: OrangePi Prime
DRAM:  2 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet@1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
6 years agoarmv8: ls1046ardb: Enable loading PPA during SPL stage for SD boot
York Sun [Mon, 15 May 2017 15:52:03 +0000 (08:52 -0700)] 
armv8: ls1046ardb: Enable loading PPA during SPL stage for SD boot

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1046a: Enable spl_board_init() function
York Sun [Mon, 15 May 2017 15:52:02 +0000 (08:52 -0700)] 
armv8: ls1046a: Enable spl_board_init() function

CONFIG_SPL_BOARD_INIT is used for SPL boot. It is only enabled for
secure boot at this moment. Enable it in defconfig files for SPL
build.

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls1043ardb: Enable loading PPA during SPL stage for SD boot
York Sun [Mon, 15 May 2017 15:52:01 +0000 (08:52 -0700)] 
armv8: ls1043ardb: Enable loading PPA during SPL stage for SD boot

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: layerscape: Enabling loading PPA during SPL stage
York Sun [Mon, 15 May 2017 15:52:00 +0000 (08:52 -0700)] 
armv8: layerscape: Enabling loading PPA during SPL stage

Loading PPA in SPL puts the rest of U-Boot (including RAM version
loaded later) in EL2 with MMU and cache enabled. Once PPA is loaded,
PSCI is available.

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: layerscape: Make U-Boot EL2 safe
York Sun [Mon, 15 May 2017 15:51:59 +0000 (08:51 -0700)] 
armv8: layerscape: Make U-Boot EL2 safe

When U-Boot boots from EL2, skip some lowlevel init code requiring
EL3, including CCI-400/CCN-504, trust zone, GIC, etc. These
initialization tasks are carried out before U-Boot runs. This applies
to the RAM version image used for SPL boot if PPA is loaded first.

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls2080aqds: Add support for SD boot
Santan Kumar [Fri, 5 May 2017 10:12:29 +0000 (15:42 +0530)] 
armv8: ls2080aqds: Add support for SD boot

Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: ls2080a: Reorganise NAND_BOOT code in config flag
Santan Kumar [Fri, 5 May 2017 10:12:28 +0000 (15:42 +0530)] 
armv8: ls2080a: Reorganise NAND_BOOT code in config flag

Add CONFIG_NAND_BOOT config flag to organise
NAND_BOOT specific code in config flag like
-nand-boot specfic errata errata_rcw_src()
-CONFIG_SYS_NAND_U_BOOT_DST,etc

Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoQE: add QE support on SD boot
Zhao Qiang [Thu, 25 May 2017 01:47:40 +0000 (09:47 +0800)] 
QE: add QE support on SD boot

modify u_qe_init to upload QE firmware from SD card when it is SD
boot

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agodrivers: net: fsl-mc: Include MAC addr fixup to DPL
Bogdan Purcareata [Wed, 24 May 2017 16:40:22 +0000 (16:40 +0000)] 
drivers: net: fsl-mc: Include MAC addr fixup to DPL

Previous to MC v10.x, port mac address was specified via DPL. Since
newer MC versions are compatible with old style DPLs, make the u-boot
env mac addresses visible there. This applies only to DPLs that have
an older version.

DPLs use 32 bit values for specifying MAC addresses. U-boot
environment variables take precedence over the MAC addresses already
visible in the DPL/DPC.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Heinz Wrobel <heinz.wrobel@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agodrivers: net: fsl-mc: Link MC boot to PHY_RESET_R
Bogdan Purcareata [Wed, 24 May 2017 16:40:21 +0000 (16:40 +0000)] 
drivers: net: fsl-mc: Link MC boot to PHY_RESET_R

DPAA2 platforms boot the Management Complex based on the u-boot env
variable "mcinitcmd". Instead of doing this step on each platform
individually, define a single mc_env_boot function in the MC driver,
since it's semantically tied to it.

Call the function in a per-board reset_phy hook, as it gets called at a
later moment, when all board PHY devices have been initialized.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Heinz Wrobel <heinz.wrobel@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarm64: dts: sun50i: h5: orangepi-pc2: Use GPIO flag binding macro
Jagan Teki [Thu, 25 May 2017 18:26:41 +0000 (18:26 +0000)] 
arm64: dts: sun50i: h5: orangepi-pc2: Use GPIO flag binding macro

Instead of defining numerical value on GPIO flag
better to use existing binding macro.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoarm64: dts: sun50i: Add sun50i-h5.dtsi
Jagan Teki [Thu, 25 May 2017 18:15:36 +0000 (18:15 +0000)] 
arm64: dts: sun50i: Add sun50i-h5.dtsi

The Allwinner H5 SoC is pin-compatible to the H3 SoC,
but uses Cortex-A53 cores instead.

So move the shared cpu based and peripherals nodes into
sun50i-h5.dtsi so, that it can shared among the sun50i-h5
board dts files.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agosandbox: Move to use live tree
Simon Glass [Fri, 19 May 2017 02:10:02 +0000 (20:10 -0600)] 
sandbox: Move to use live tree

This updates sandbox to use a live device tree. This means that after
relocation (from board_init_r() onwards) it no-longer uses flat device
tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: gpio: power: Convert pm8916 drivers to livetree
Simon Glass [Fri, 19 May 2017 02:10:01 +0000 (20:10 -0600)] 
dm: gpio: power: Convert pm8916 drivers to livetree

This PMIC driver (power and GPIO) is used by the sandbox SPMI tests.
Update the drivers to support a live device tree so that the tests pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Fix nit with position of backslash
Simon Glass [Fri, 19 May 2017 02:10:00 +0000 (20:10 -0600)] 
dm: test: Fix nit with position of backslash

Line up this backslash with all the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: sandbox: sysreset: Convert driver to livetree
Simon Glass [Fri, 19 May 2017 02:09:59 +0000 (20:09 -0600)] 
dm: sandbox: sysreset: Convert driver to livetree

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: sandbox: spi: Convert driver to support livetree
Simon Glass [Fri, 19 May 2017 02:09:58 +0000 (20:09 -0600)] 
dm: sandbox: spi: Convert driver to support livetree

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: spi-flash: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:57 +0000 (20:09 -0600)] 
dm: spi-flash: Convert uclass to livetree

Update the SPI flash uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: sandbox: i2c_rtc: Drop fdtdec.h header
Simon Glass [Fri, 19 May 2017 02:09:56 +0000 (20:09 -0600)] 
dm: sandbox: i2c_rtc: Drop fdtdec.h header

This is not needed in this driver. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: sandbox: i2c: Drop fdtdec.h header
Simon Glass [Fri, 19 May 2017 02:09:55 +0000 (20:09 -0600)] 
dm: sandbox: i2c: Drop fdtdec.h header

This is not needed in this driver. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: spi: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:54 +0000 (20:09 -0600)] 
dm: spi: Convert uclass to livetree

Update the SPI uclass to support a live device tree. Also adjust
spi_slave_ofdata_to_platdata() to accept a device instead of a blob and
offset.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agocros_ec: Update the cros_ec keyboard driver to livetree
Simon Glass [Fri, 19 May 2017 02:09:53 +0000 (20:09 -0600)] 
cros_ec: Update the cros_ec keyboard driver to livetree

Update this driver and key_matrix to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: Update the I2C eeprom driver for livetree
Simon Glass [Fri, 19 May 2017 02:09:52 +0000 (20:09 -0600)] 
dm: Update the I2C eeprom driver for livetree

Update this driver so that it works with livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: pci: Update uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:51 +0000 (20:09 -0600)] 
dm: pci: Update uclass to support livetree

Update the PCI uclass to support livetree. This mostly involves fixing
the address decoding from the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: reset: Update uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:50 +0000 (20:09 -0600)] 
dm: reset: Update uclass to support livetree

Update the reset domain uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: power-domain: Update uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:49 +0000 (20:09 -0600)] 
dm: power-domain: Update uclass to support livetree

Update the power domain uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: phy: Update driver for livetree
Simon Glass [Fri, 19 May 2017 02:09:48 +0000 (20:09 -0600)] 
sandbox: phy: Update driver for livetree

Update the sandbox phy driver to support livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: phy: Update uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:47 +0000 (20:09 -0600)] 
dm: phy: Update uclass to support livetree

Update the phy uclass to support livetree. Fix the xlate() method
which has no callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: mailbox: Update uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:46 +0000 (20:09 -0600)] 
dm: mailbox: Update uclass to support livetree

Update the mailbox uclass to support livetree. Fix the xlate() method
in all callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: phy: Update tests to use ut_asserteq()
Simon Glass [Fri, 19 May 2017 02:09:45 +0000 (20:09 -0600)] 
dm: phy: Update tests to use ut_asserteq()

Use ut_asserteq() to test equality since this gives a better error message
on failure. Also make a few of the tests more specific.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Disable the fdt_offset test with livetree
Simon Glass [Fri, 19 May 2017 02:09:44 +0000 (20:09 -0600)] 
dm: test: Disable the fdt_offset test with livetree

We cannot run this test with livetree since it uses device tree offsets.
Mark it as flat tree only.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Separate out the bus DT offset test
Simon Glass [Fri, 19 May 2017 02:09:43 +0000 (20:09 -0600)] 
dm: test: Separate out the bus DT offset test

We cannot access the device tree via an offset when running in livetree
mode. Separate out that part of the bus' children tests and mark it as
for the flat tree only.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: clk: fixed: Update to support livetree
Simon Glass [Fri, 19 May 2017 02:09:42 +0000 (20:09 -0600)] 
dm: clk: fixed: Update to support livetree

Update the fixed-rate clock driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: clk: Update uclass to support livetree
Simon Glass [Wed, 31 May 2017 03:47:29 +0000 (21:47 -0600)] 
dm: clk: Update uclass to support livetree

Update the clk uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agoclk: Modify xlate() method for livetree
Simon Glass [Fri, 19 May 2017 02:09:40 +0000 (20:09 -0600)] 
clk: Modify xlate() method for livetree

Update the xlate() method to use ofnode_phandle_args instead of the fdtdec
variant. This will allow drivers to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: usb: Convert emulators to livetree
Simon Glass [Fri, 19 May 2017 02:09:39 +0000 (20:09 -0600)] 
sandbox: usb: Convert emulators to livetree

Update the sandbox flash and hub USB emulators to support a live device
tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: usb: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:38 +0000 (20:09 -0600)] 
dm: usb: Convert uclass to livetree

Update the usb uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: adc: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:37 +0000 (20:09 -0600)] 
dm: adc: Convert uclass to livetree

Update the adc uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: mmc: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:36 +0000 (20:09 -0600)] 
dm: mmc: Convert uclass to livetree

Update the mmc uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: regulator: Update fixed regulator to support livetree.
Simon Glass [Fri, 19 May 2017 02:09:35 +0000 (20:09 -0600)] 
dm: regulator: Update fixed regulator to support livetree.

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: regulator: Convert regulator uclass to support livetree
Simon Glass [Fri, 19 May 2017 02:09:34 +0000 (20:09 -0600)] 
dm: regulator: Convert regulator uclass to support livetree

Update the regulator uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: pmic: Convert pmic emulator to support livetree
Simon Glass [Fri, 19 May 2017 02:09:33 +0000 (20:09 -0600)] 
sandbox: pmic: Convert pmic emulator to support livetree

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: pmic: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:32 +0000 (20:09 -0600)] 
dm: pmic: Convert uclass to livetree

Update the pmic uclass and all pmics to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosamsung: Move pmic header out of config file
Simon Glass [Fri, 19 May 2017 02:09:31 +0000 (20:09 -0600)] 
samsung: Move pmic header out of config file

We should not be including a PMIC header file in the board config. Move it
to a C file.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: i2c: Convert uclass to livetree
Simon Glass [Fri, 19 May 2017 02:09:30 +0000 (20:09 -0600)] 
dm: i2c: Convert uclass to livetree

Update the i2c uclass to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agostring: Add strcspn()
Simon Glass [Fri, 19 May 2017 02:09:29 +0000 (20:09 -0600)] 
string: Add strcspn()

Add an implementation of strcspn() which returns the number of initial
characters that do not match any in a rejection list.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agostring: Add strchrnul()
Simon Glass [Fri, 19 May 2017 02:09:28 +0000 (20:09 -0600)] 
string: Add strchrnul()

This functions works like strchr() but returns the end of the string if
the character is not found. Add an implementation of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: Add more livetree helpers and definitions
Simon Glass [Fri, 19 May 2017 02:09:27 +0000 (20:09 -0600)] 
dm: Add more livetree helpers and definitions

Add some definitions and helpers for livetree in the main of.h header
file. These include:

- reading multi-cell integers
- default number of address/size cells
- functions for comparing names

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Rename a few functions in fdt_support
Simon Glass [Fri, 19 May 2017 02:09:26 +0000 (20:09 -0600)] 
fdt: Rename a few functions in fdt_support

These two functions have an of_ prefix which conflicts with naming used
in of_addr. Rename them:

   fdt_read_number
   fdt_support_bus_default_count_cells

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agotest: Update 'make test' to run more tests
Simon Glass [Fri, 19 May 2017 02:09:25 +0000 (20:09 -0600)] 
test: Update 'make test' to run more tests

The standard sandbox board cannot run the of-platdata test since it needs
SPL. Also, we should test the flat tree version of sandbox.

Add these tests to the default test script.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: Add a new sandbox_flattree board
Simon Glass [Fri, 19 May 2017 02:09:24 +0000 (20:09 -0600)] 
sandbox: Add a new sandbox_flattree board

Add a sandbox board to test the non-livetree build (i.e. with
CONFIG_OF_FLAT disabled). This increases our build and test coverage.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agocros_ec: Convert to support live tree
Simon Glass [Fri, 19 May 2017 02:09:23 +0000 (20:09 -0600)] 
cros_ec: Convert to support live tree

Convert this driver to support the live device tree and remove the old
fdtdec support.

The keyboard is not yet converted.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agocros_ec: Fix debug() statement in ec_command_inptr()
Simon Glass [Fri, 19 May 2017 02:09:22 +0000 (20:09 -0600)] 
cros_ec: Fix debug() statement in ec_command_inptr()

This prints out the wrong pointers. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: gpio: Add live tree support
Simon Glass [Wed, 31 May 2017 03:47:09 +0000 (21:47 -0600)] 
dm: gpio: Add live tree support

Add support for requesting GPIOs with a live device tree.

This involves adjusting the function signature for the legacy function
gpio_request_by_name_nodev(), so fix up all callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes to stm32f746-disco.c:
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agodm: gpio: sandbox: Use dev_read...() functions to access DT
Simon Glass [Fri, 19 May 2017 02:09:20 +0000 (20:09 -0600)] 
dm: gpio: sandbox: Use dev_read...() functions to access DT

Use the new dev_read...() functions to access the device tree, so that a
live tree can be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: gpio: Drop blank line in gpio_xlate_offs_flags() comment
Simon Glass [Fri, 19 May 2017 02:09:19 +0000 (20:09 -0600)] 
dm: gpio: Drop blank line in gpio_xlate_offs_flags() comment

This is not needed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: gpio: Refactor to prepare for live tree support
Simon Glass [Fri, 19 May 2017 02:09:18 +0000 (20:09 -0600)] 
dm: gpio: Refactor to prepare for live tree support

Move the main part of the GPIO request function into a separate function
so that it can be used by the live tree function when added. Update the
xlate method to use a node reference.

Update all GPIO drivers to handle the modified xlate() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Run tests with both livetree and flat tree
Simon Glass [Fri, 19 May 2017 02:09:17 +0000 (20:09 -0600)] 
dm: core: Run tests with both livetree and flat tree

Some tests require either livetree or flat tree. Add flags to allow the
tests to specify this. Adjust the test runner to run with livetree (if
supported) and then flat tree.

Some video tests are quite slow and running on flat tree adds little extra
test value, so run these on livetree only.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Add support for running tests with livetree
Simon Glass [Fri, 19 May 2017 02:09:16 +0000 (20:09 -0600)] 
dm: test: Add support for running tests with livetree

It is useful to run the driver model tests with both livetree and flat
tree in case something is different between the two. Add this feature to
the test runner.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Show the test filename when running
Simon Glass [Fri, 19 May 2017 02:09:15 +0000 (20:09 -0600)] 
dm: test: Show the test filename when running

Show the filename of the test being run. Skip the path and show just the
base name.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: test: Move test running code into a separate function
Simon Glass [Fri, 19 May 2017 02:09:14 +0000 (20:09 -0600)] 
dm: test: Move test running code into a separate function

We want to run the same test on flat and live trees. In preparation for
this, create a new function which handles running a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: Add a way to reset sandbox state for tests
Simon Glass [Fri, 19 May 2017 02:09:13 +0000 (20:09 -0600)] 
sandbox: Add a way to reset sandbox state for tests

Running a new test should reset the sandbox state to avoid tests
interferring with each other. Move the existing state-reset code into a
function so it can be used from tests.

Also update the code to reset the SPI devices and adjust the test code to
call it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Update uclass_find_device_by_phandle() for livetree
Simon Glass [Fri, 19 May 2017 02:09:12 +0000 (20:09 -0600)] 
dm: core: Update uclass_find_device_by_phandle() for livetree

Adjust this function to work with livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: simple-bus: Add support for livetree
Simon Glass [Fri, 19 May 2017 02:09:11 +0000 (20:09 -0600)] 
dm: simple-bus: Add support for livetree

Modify simple-bus to support livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: regmap: Add support for livetree
Simon Glass [Fri, 19 May 2017 02:09:10 +0000 (20:09 -0600)] 
dm: regmap: Add support for livetree

Modify regmap to support livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Add a way to find a device by ofnode
Simon Glass [Fri, 19 May 2017 02:09:09 +0000 (20:09 -0600)] 
dm: core: Add a way to find a device by ofnode

Add a function which looks up a device by its node (either in live tree
or flat tree).

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Scan the live tree when setting up driver model
Simon Glass [Fri, 19 May 2017 02:09:08 +0000 (20:09 -0600)] 
dm: core: Scan the live tree when setting up driver model

When starting up driver model with a live tree we need to scan the tree
for devices. Add code to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Update device_bind_driver_to_node() to use ofnode
Simon Glass [Fri, 19 May 2017 02:09:07 +0000 (20:09 -0600)] 
dm: core: Update device_bind_driver_to_node() to use ofnode

Adjust this function to us an ofnode instead of an offset, so it can be
used with livetree. This involves updating all callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Update lists_bind_fdt() to use ofnode
Simon Glass [Fri, 19 May 2017 02:09:06 +0000 (20:09 -0600)] 
dm: core: Update lists_bind_fdt() to use ofnode

Adjust this function to use an ofnode instead of an offset, so it can be
used with livetree. This involves updating all callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Allow binding a device from a live tree
Simon Glass [Fri, 19 May 2017 02:09:05 +0000 (20:09 -0600)] 
dm: core: Allow binding a device from a live tree

When a live tree is being used we need to record the node that was used to
create the device. Update device_bind_with_driver_data() to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Implement live tree 'read' functions
Simon Glass [Fri, 19 May 2017 02:09:04 +0000 (20:09 -0600)] 
dm: core: Implement live tree 'read' functions

When the live tree is supported some functions need to change a little.
Add an implementation which is used when not inlining these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Add device-based 'read' functions to access DT
Simon Glass [Fri, 19 May 2017 02:09:03 +0000 (20:09 -0600)] 
dm: core: Add device-based 'read' functions to access DT

It is common to read a device-tree property from the node associated with
a device. Add convenience functions to do this so that drivers do not need
to deal with accessing the ofnode from the device.

These functions all start with 'dev_read_' to provide consistent naming
for all functions which read information from a device's device tree node.

These are inlined when using the flat DT to save code size. The live tree
implementation is added in a later commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Add a place to put extra device-tree reading functions
Simon Glass [Fri, 19 May 2017 02:09:02 +0000 (20:09 -0600)] 
dm: core: Add a place to put extra device-tree reading functions

Some functions deal with structured data rather than simple data types.
It makes sense to have these in their own file. For now this just has a
function to read a flashmap entry. Move the data types also.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodm: core: Add address operations on device tree references
Simon Glass [Fri, 19 May 2017 02:09:01 +0000 (20:09 -0600)] 
dm: core: Add address operations on device tree references

Add functions to add addresses in the device tree using ofnode references.

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