oweals/u-boot.git
8 years agoarm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo
Jagan Teki [Sat, 8 Oct 2016 12:30:19 +0000 (18:00 +0530)]
arm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo

i.CoreM6 DualLite/Solo modules are system on module solutions
manufactured by Engicam with following characteristics:
CPU           NXP i.MX6 DL, 800MHz
RAM           1GB, 32, 64 bit, DDR3-800/1066
NAND          SLC,512MB
Power supply  Single 5V
MAX LCD RES   FULLHD

and more info at
http://www.engicam.com/en/products/embedded/som/sodimm/i-core-m6s-dl-d-q

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agodt-bindings: clock: imx6qdl: Add clock defines
Jagan Teki [Sat, 8 Oct 2016 12:30:18 +0000 (18:00 +0530)]
dt-bindings: clock: imx6qdl: Add clock defines

Add imx6qdl clock header defines support from Linux.

"clk: imx: Add clock support for imx6qp"
(sha1: ee36027427c769b0b9e5e205fe43aced93d6aa66)

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoarm: dts: imx6dl: Add pinctrl defines
Jagan Teki [Sat, 8 Oct 2016 12:30:17 +0000 (18:00 +0530)]
arm: dts: imx6dl: Add pinctrl defines

Add imx6dl pinctrl defines support from Linux.

Here is the last commit:
"ARM: dts: imx: pinfunc: add MX6QDL_PAD_GPIO_6__ENET_IRQ"
(sha1: d8c765e0d1ddbd5032c2491c82cc9660c2f0e7f2)

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoarm: dts: Add devicetree for i.MX6DQL
Jagan Teki [Sat, 8 Oct 2016 12:30:16 +0000 (18:00 +0530)]
arm: dts: Add devicetree for i.MX6DQL

Add i.MX6DQL dtsi support from Linux.

Here is the last commit:
"ARM: dts: imx6qdl: Fix SPDIF regression"
(sha1: f065e9e4addd75c21bb976bb2558648bf4f61de6)

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoarm: dts: Add devicetree for i.MX6DL
Jagan Teki [Sat, 8 Oct 2016 12:30:15 +0000 (18:00 +0530)]
arm: dts: Add devicetree for i.MX6DL

Add i.MX6DL dtsi support from Linux.

Here is the last commit:
"ARM: dts: add gpio-ranges property to iMX GPIO controllers"
(sha1: bb728d662bed0fe91b152550e640cb3f6caa972c)

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoimx: s/docs\/README.imximage/doc\/README.imximage/g
Jagan Teki [Sat, 8 Oct 2016 12:30:14 +0000 (18:00 +0530)]
imx: s/docs\/README.imximage/doc\/README.imximage/g

Fixed typo for doc/README.imximage on respective imximage.cfg files.

Cc: Tom Rini <trini@konsulko.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoimx6: icorem6: Add ENET support
Jagan Teki [Sat, 8 Oct 2016 12:30:13 +0000 (18:00 +0530)]
imx6: icorem6: Add ENET support

Add enet support for engicam icorem6 qdl starter kit.
- Add pinmux settings
- Add board_eth_init

TFTP log:
--------
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
icorem6qdl> tftpboot {fdt_addr} imx6dl-icore.dtb
Using FEC device
TFTP from server 192.168.2.96; our IP address is 192.168.2.75
Filename 'imx6dl-icore.dtb'.
Load address: 0x0
Loading: ######
         1.3 MiB/s
done
Bytes transferred = 28976 (7130 hex)
CACHE: Misaligned operation at range [0000000000007130]
icorem6qdl>

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: Kconfig: Add FEC_MXC entry
Jagan Teki [Sat, 8 Oct 2016 12:30:12 +0000 (18:00 +0530)]
net: Kconfig: Add FEC_MXC entry

Added kconfig for FEC_MXC driver.

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoarm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support
Jagan Teki [Sat, 8 Oct 2016 12:30:11 +0000 (18:00 +0530)]
arm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support

Boot Log for i.CoreM6 DualLite/Solo Starter Kit:
-----------------------------------------------

U-Boot SPL 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46)
Trying to boot from MMC1

U-Boot 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46 +0530)

CPU:   Freescale i.MX6SOLO rev1.3 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 31C
Reset cause: POR
DRAM:  256 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
switch to partitions #0, OK
mmc0 is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
6741808 bytes read in 341 ms (18.9 MiB/s)
Booting from mmc ...
reading imx6dl-icore.dtb
30600 bytes read in 19 ms (1.5 MiB/s)
   Booting using the fdt blob at 0x18000000
   Using Device Tree in place at 18000000, end 1800a787

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0

Boot Log for i.CoreM6 Quad/Dual Starter Kit:
--------------------------------------------

U-Boot SPL 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46)
Trying to boot from MMC1

U-Boot 2016.09-rc2-30739-gd1fa290 (Sep 17 2016 - 00:37:46 +0530)

CPU:   Freescale i.MX6Q rev1.2 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 28C
Reset cause: POR
DRAM:  512 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Hit any key to stop autoboot:  0
icorem6qdl>

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoconfig: Move CONFIG_DEFAULT_FDT_FILE to defconfigs
Jagan Teki [Sat, 8 Oct 2016 12:30:10 +0000 (18:00 +0530)]
config: Move CONFIG_DEFAULT_FDT_FILE to defconfigs

- Add DEFAULT_FDT_FILE kconfig entry
- Move CONFIG_DEFAULT_FDT_FILE from include/configs to defconfigs

Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agothermal: Kconfig: Add IMX_THERMAL entry
Jagan Teki [Sat, 8 Oct 2016 12:30:09 +0000 (18:00 +0530)]
thermal: Kconfig: Add IMX_THERMAL entry

Added kconfig for IMX_THERMAL driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoserial: Kconfig: Add MXC_UART entry
Jagan Teki [Sat, 8 Oct 2016 12:30:08 +0000 (18:00 +0530)]
serial: Kconfig: Add MXC_UART entry

Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
8 years agoimx: mx6ull_14x14_evk: add plugin defconfig
Peng Fan [Tue, 11 Oct 2016 06:29:17 +0000 (14:29 +0800)]
imx: mx6ull_14x14_evk: add plugin defconfig

Add defconfig file to use plugin code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
8 years agoimx: mx6ullevk: correct boot device macro
Peng Fan [Tue, 11 Oct 2016 06:29:16 +0000 (14:29 +0800)]
imx: mx6ullevk: correct boot device macro

Correct boot device macro according to kconfig entry
in common/Kconfig

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
8 years agoimx: mx6ullevk: support plugin
Peng Fan [Tue, 11 Oct 2016 06:29:15 +0000 (14:29 +0800)]
imx: mx6ullevk: support plugin

Add plugin code for mx6ullevk.
Define CONFIG_USE_IMXIMG_PLUGIN in defconfig file to use plugin code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
8 years agoimx-common: compile plugin code
Peng Fan [Tue, 11 Oct 2016 06:29:14 +0000 (14:29 +0800)]
imx-common: compile plugin code

If CONFIG_USE_IMXIMG_PLUGIN is selected, plugin.bin will be
generated under board/$(BOARDDIR)/.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoimx-common: introduce USE_IMXIMG_PLUGIN Kconfig
Peng Fan [Tue, 11 Oct 2016 06:29:12 +0000 (14:29 +0800)]
imx-common: introduce USE_IMXIMG_PLUGIN Kconfig

Introduce USE_IMXIMG_PLUGIN Kconfig

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoimx: mx7: Add plugin support
Peng Fan [Tue, 11 Oct 2016 06:29:11 +0000 (14:29 +0800)]
imx: mx7: Add plugin support

Add mx7_plugin.S which calls boot rom setup function, generate the second ivt,
and jump back to boot rom.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoimx: mx6: Add plugin support
Peng Fan [Tue, 11 Oct 2016 06:29:10 +0000 (14:29 +0800)]
imx: mx6: Add plugin support

Add mx6_plugin.S which calls boot rom setup function, generate the second ivt,
and jump back to boot rom.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
8 years agotools: imximage: add plugin support
Peng Fan [Tue, 11 Oct 2016 06:29:09 +0000 (14:29 +0800)]
tools: imximage: add plugin support

Add plugin support for imximage.

Define CONFIG_USE_IMXIMG_PLUGIN in defconfig to enable using plugin.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Eric Nelson <eric@nelint.com>
Cc: Ye Li <ye.li@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agomx6sabresd: Add README file
Diego Dorta [Tue, 11 Oct 2016 14:09:28 +0000 (11:09 -0300)]
mx6sabresd: Add README file

Add a README to explain the steps for booting mx6sabresd in different ways:
    1. Booting via Normal U-Boot (u-boot.imx)
    2. Booting via SPL (SPL and u-boot.img)
    3. Booting via Falcon mode (SPL launches the kernel directly)

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
8 years agomx6sabresd: Add Falcon mode support
Diego Dorta [Tue, 11 Oct 2016 14:09:27 +0000 (11:09 -0300)]
mx6sabresd: Add Falcon mode support

Allow i.MX6Q Sabre SD to load the kernel and dtb via SPL in Falcon mode.

Based on the Falcon mode code for MX6 Gateworks Ventana board.

Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
8 years agonitrogen6x: add secure boot support
Gary Bisson [Thu, 25 Aug 2016 17:03:20 +0000 (19:03 +0200)]
nitrogen6x: add secure boot support

Declaring a CSF section makes the imximage tool increase the size of
data to be loaded by the BootROM and also adds a pointer to that CSF
section in the IVT header to the BootROM can check the signature.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
8 years agomx7_common: add secure boot support
Gary Bisson [Thu, 25 Aug 2016 17:03:19 +0000 (19:03 +0200)]
mx7_common: add secure boot support

Selecting the proper options to enable the build of the HAB tools.

Note, this support is disabled by default, one will have to select
the SECURE_BOOT configuration through menuconfig to enable it.

See doc/README.mxc_hab for more details.

Also remove duplicate options from board config headers.

Cc: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
8 years agomx6_common: add secure boot support
Gary Bisson [Thu, 25 Aug 2016 17:03:18 +0000 (19:03 +0200)]
mx6_common: add secure boot support

Selecting the proper options to enable the build of the HAB tools.

Note, this support is disabled by default, one will have to select
the SECURE_BOOT configuration through menuconfig to enable it.

See doc/README.mxc_hab for more details.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
8 years agoarm: imx-common: introduce back usec2ticks
Peng Fan [Thu, 25 Aug 2016 17:03:17 +0000 (19:03 +0200)]
arm: imx-common: introduce back usec2ticks

This commit "2bb014820c49a63902103bac710bc86b5772e843"
do some clean up to use the code in lib/time.c.
But usec2ticks is still being used by security related job ring code.
Bring back the function to avoid build break when CONFIG_FSL_CAAM
is defined.
The computation logic has been changed, using 64-bit variable
to ease the process, making it work on older (MX5) platforms.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
8 years agoarm: imx-common: add SECURE_BOOT option to Kconfig
Gary Bisson [Thu, 25 Aug 2016 17:03:16 +0000 (19:03 +0200)]
arm: imx-common: add SECURE_BOOT option to Kconfig

So the option can easily be selected through menuconfig.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
8 years agospl: move FDT_FIXUP_PARTITIONS to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:31:45 +0000 (07:31 +0200)]
spl: move FDT_FIXUP_PARTITIONS to Kconfig

Move FDT_FIXUP_PARTITIONS to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
8 years agospl: move SYS_OS_BASE to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:55:16 +0000 (07:55 +0200)]
spl: move SYS_OS_BASE to Kconfig

Move SYS_OS_BASE to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
[trini: Also migrate a4m2k]
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agospl: move SPL_OS_BOOT to Kconfig
Heiko Schocher [Thu, 6 Oct 2016 05:55:15 +0000 (07:55 +0200)]
spl: move SPL_OS_BOOT to Kconfig

Move SPL_OS_BOOT to Kconfig and cleanup existing
uses.

Signed-off-by: Heiko Schocher <hs@denx.de>
8 years agotest/py/tests/test_sleep.py: Add check for CONFIG_CMD_MISC
Tom Rini [Fri, 14 Oct 2016 23:12:31 +0000 (19:12 -0400)]
test/py/tests/test_sleep.py: Add check for CONFIG_CMD_MISC

We can only run this command if the sleep command is enabled and that
depends on CONFIG_CMD_MISC

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoARM: create .secure_stack section only for PSCI
Masahiro Yamada [Mon, 26 Sep 2016 05:21:30 +0000 (14:21 +0900)]
ARM: create .secure_stack section only for PSCI

Jon Master reports that QEMU refuses to load a U-Boot image built
with CONFIG_ARMV7_NONSEC, but without CONFIG_ARMV7_PSCI since
commit 5a3aae68c74e ("ARM: armv7: guard memory reserve for PSCI
with #ifdef CONFIG_ARMV7_PSCI").

It looks like only PSCI that needs the Secure stack, so move
the #ifdef to guard the whole of .secure_stack allocation in order
not to create the empty section.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Jon Masters <jcm@redhat.com>
Link: http://patchwork.ozlabs.org/patch/664025/
8 years agoMerge git://git.denx.de/u-boot-fdt
Tom Rini [Fri, 14 Oct 2016 00:03:33 +0000 (20:03 -0400)]
Merge git://git.denx.de/u-boot-fdt

8 years agolibfdt: Drop inlining of fdt_path_offset()
Simon Glass [Sun, 2 Oct 2016 23:59:30 +0000 (17:59 -0600)]
libfdt: Drop inlining of fdt_path_offset()

The fdt_path_offset() function is not inlined in upstream libfdt. Adjust
U-Boot's version to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Sync fdt_for_each_subnode() with upstream
Simon Glass [Sun, 2 Oct 2016 23:59:29 +0000 (17:59 -0600)]
libfdt: Sync fdt_for_each_subnode() with upstream

The signature for this macro has changed. Bring in the upstream version and
adjust U-Boot's usages to suit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Update to drivers/power/pmic/palmas.c:
Signed-off-by: Keerthy <j-keerthy@ti.com>
Change-Id: I6cc9021339bfe686f9df21d61a1095ca2b3776e8

8 years agolibfdt: Bring in upstream stringlist functions
Simon Glass [Sun, 2 Oct 2016 23:59:28 +0000 (17:59 -0600)]
libfdt: Bring in upstream stringlist functions

These have now landed upstream. The naming is different and in one case the
function signature has changed. Update the code to match.

This applies the following upstream commits by
Thierry Reding <treding@nvidia.com> :

   604e61e fdt: Add functions to retrieve strings
   8702bd1 fdt: Add a function to get the index of a string
   2218387 fdt: Add a function to count strings

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Sync up with upstream
Simon Glass [Sun, 2 Oct 2016 23:59:27 +0000 (17:59 -0600)]
libfdt: Sync up with upstream

This includes small changes to the following functions, from upstream
commit 6d1832c:

- fdt_get_max_phandle() (upstream commit 84e0e134)
- fdt_node_check_compatible (upstream commit 53bf130b)
- fdt_setprop_inplace_namelen_partial() to remove useless brackets and
     use idx instead of index
- _fdt_resize_property() to use idx instead of index
- _fdt_splice() (upstream commit d4c7c25c)

It also includes various typo fixes in libfdt.h

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agolibfdt: Fix undefined behaviour in fdt_offset_ptr()
David Gibson [Sun, 2 Oct 2016 23:59:26 +0000 (17:59 -0600)]
libfdt: Fix undefined behaviour in fdt_offset_ptr()

Using pointer arithmetic to generate a pointer outside a known object is,
technically, undefined behaviour in C.  Unfortunately, we were using that
in fdt_offset_ptr() to detect overflows.

To fix this we need to do our bounds / overflow checking on the offsets
before constructing pointers from them.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agocmd/fdt: add possibilty to have 'extrasize' on fdt resize
Hannes Schmelzer [Tue, 20 Sep 2016 16:10:43 +0000 (18:10 +0200)]
cmd/fdt: add possibilty to have 'extrasize' on fdt resize

Sometimes devicetree nodes and or properties are added out of the u-boot
console, maybe through some script or manual interaction.

The devicetree as loaded or embedded is quite small, so the devicetree
has to be resized to take up those new nodes/properties.

In original the devicetree was only extended by effective
4 * add_mem_rsv.

With this commit we can add an argument to the "fdt resize" command,
which takes the extrasize to be added.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Thu, 13 Oct 2016 17:38:49 +0000 (13:38 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-net

8 years agonet: smsc95xx: fix DM MAC address reading
Stephen Warren [Thu, 15 Sep 2016 18:53:22 +0000 (12:53 -0600)]
net: smsc95xx: fix DM MAC address reading

eth-uclass.c expects DM-capable Ethernet adapters to implement ops->
read_rom_hwaddr(), or for some other mechanism to set pdata->enetaddr, or
for the user to set environment variable $usbethaddr. Without any of
these, it will refuse to initialize the device since no valid MAC address
is known. Implement this function for the smsc95xx driver.

With this feature implemented, there is no point smsc95xx_init_common()
re-reading the MAC address from ROM, so ifdef out this code when DM_ETH
is enabled.

This allows (at least) the built-in Ethernet on the NVIDIA Harmony board
to operate again.

Fixes: 0990fcb77219 ("net: smsc95xx: Add driver-model support")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agotest: add NFS download test
Guillaume GARDET [Wed, 14 Sep 2016 08:29:12 +0000 (10:29 +0200)]
test: add NFS download test

Add a NFS download test, based on TFTP test.
Tested on i.MX6 SabreLite board.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@konsulko.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: Fix cache misalignment message after network load operations
Peter Chubb [Wed, 14 Sep 2016 03:49:22 +0000 (03:49 +0000)]
net: Fix cache misalignment message after network load operations

After any operation that downloads a file (e.g., pxe get, or dhcp), the
buffer containing the downloaded data is flushed.  This is unnecessary
and annoying.  Unnecessary, because
the network driver should already have fliushed the cache for the DMAed area,
and annoying because it generates a cache misalignment message.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agortl8169: fix cache misalignment message on transmit.
Peter Chubb [Wed, 14 Sep 2016 01:29:03 +0000 (01:29 +0000)]
rtl8169: fix cache misalignment message on transmit.

The call to flush cache on the transmit buffer was misplaced (for very
short packets) and asked to flush less than a cacheline.

Move the flush cache call to after a short packet has been padded
to minimum length (so the padding is flushed too), and round the size
up to a cacheline.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: write enetaddr down to hardware on env_callback
Hannes Schmelzer [Fri, 2 Sep 2016 12:48:17 +0000 (14:48 +0200)]
net: write enetaddr down to hardware on env_callback

If mac-address is changed using "setenv ethaddr ...." command the new
mac-adress also must be written into the responsible ethernet driver.

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: mvneta: fix typo in comment
Chris Packham [Mon, 29 Aug 2016 08:54:02 +0000 (20:54 +1200)]
net: mvneta: fix typo in comment

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: mv88e61xx: Add support for fixed links
Chris Packham [Fri, 26 Aug 2016 05:30:26 +0000 (17:30 +1200)]
net: mv88e61xx: Add support for fixed links

On some boards these switches are wired directly into a SERDES
interface on another Ethernet MAC. Add the ability to specify
these kinds of boards using CONFIG_MV88E61XX_FIXED_PORTS which defines
a bit mask of these fixed ports.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agonet: Add support for mv88e609x switches
Chris Packham [Fri, 26 Aug 2016 05:30:25 +0000 (17:30 +1200)]
net: Add support for mv88e609x switches

The Marvell Link Street mv88e60xx is a series of FastEthernet switch
chips, some of which also support Gigabit ports. It is similar to the
mv88e61xx series which support Gigabit on all ports.

The main difference is the number of ports. Which affects the
PORT_COUNT define and the size of the mask passed to
mv88e61xx_port_set_vlan().

Other than that it's just a matter of adding the appropriate chip
IDs.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Cc: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoboard: am335x: Always set eth/eth1addr environment variable
Roger Quadros [Wed, 24 Aug 2016 12:35:51 +0000 (15:35 +0300)]
board: am335x: Always set eth/eth1addr environment variable

Ethernet ports might be used in the kernel even if CPSW driver
is disabled at u-boot. So always set ethaddr and eth1addr
environment variable from efuse.

Retain usbnet_devaddr as it is required for SPL USB eth boot.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoboard: am335x-icev2: add ethernet phy mode detection logic
Roger Quadros [Wed, 24 Aug 2016 12:35:50 +0000 (15:35 +0300)]
board: am335x-icev2: add ethernet phy mode detection logic

Both ethernet ports can be used as CPSW ethernet (RMII mode)
or PRU ethernet (MII mode) by setting the jumper near the port.
Read the jumper value and set the pinmux, external mux and
PHY clock accordingly.

As jumper line is overridden by PHY RX_DV pin immediately
after bootstrap (power-up/reset), we have to use GPIO edge
detection to capture the jumper line status.

As u-boot doesn't provide any infrastructure for GPIO edge
detection, we directly access the GPIO registers.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agodriver: net: cpsw: add support for RGMII id mode support and RMII clock source selection
Mugunthan V N [Thu, 13 Oct 2016 14:03:38 +0000 (19:33 +0530)]
driver: net: cpsw: add support for RGMII id mode support and RMII clock source selection

cpsw driver supports only selection of phy mode in control module
but control module has more setting like RGMII ID mode selection,
RMII clock source selection. So ported to cpsw-phy-sel driver
from kernel to u-boot.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoinclude: configs: am335x: add Atheros phy support
Mugunthan V N [Thu, 13 Oct 2016 14:03:37 +0000 (19:33 +0530)]
include: configs: am335x: add Atheros phy support

In AM335x GP EVM, Atheros 8031 phy is used, enable the driver as
AM335x SoC RGMII delay mode has to be enabled in phy as mentioned
in the silicon errata Advisory 1.0.10

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agodrivers: net: phy: atheros: add separate config for AR8031
Mugunthan V N [Thu, 13 Oct 2016 14:03:36 +0000 (19:33 +0530)]
drivers: net: phy: atheros: add separate config for AR8031

In the current driver implementation, config() callback is common
for AR8035 and AR8031 phy. In config() callback, driver tries to
configure MMD Access Control Register and MMD Access Address Data
Register unconditionally for both phy versions which leads to
auto negotiation failure in AM335x EVMsk second port which uses
AR8031 Giga bit RGMII phy. Fixing this by adding separate config
for AR8031 phy.

Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agophy: atheros: add support for RGMII_ID, RGMII_TXID and RGMII_RXID
Andrea Merello [Thu, 26 May 2016 16:24:28 +0000 (18:24 +0200)]
phy: atheros: add support for RGMII_ID, RGMII_TXID and RGMII_RXID

This adds support for internal delay on RX and TX on RGMII interface for the
AR8035 phy.

This is basically the same Linux driver do. Tested on a Zynq Zturn board (for
which u-boot support in is my tree; first patch waiting ML approval)

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
8 years agoMerge branch 'master' of http://git.denx.de/u-boot-mmc
Tom Rini [Thu, 13 Oct 2016 12:13:56 +0000 (08:13 -0400)]
Merge branch 'master' of git.denx.de/u-boot-mmc

8 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Thu, 13 Oct 2016 00:48:43 +0000 (20:48 -0400)]
Merge git://git.denx.de/u-boot-dm

8 years agoMerge branch 'master' of git://git.denx.de/u-boot-x86
Tom Rini [Wed, 12 Oct 2016 12:32:09 +0000 (08:32 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-x86

8 years agoMerge branch 'master' of git://git.denx.de/u-boot-tegra
Tom Rini [Wed, 12 Oct 2016 12:31:08 +0000 (08:31 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-tegra

8 years agoMerge branch 'master' of http://git.denx.de/u-boot-sunxi
Tom Rini [Wed, 12 Oct 2016 12:30:46 +0000 (08:30 -0400)]
Merge branch 'master' of git.denx.de/u-boot-sunxi

8 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Wed, 12 Oct 2016 12:30:38 +0000 (08:30 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

8 years agoMerge git://www.denx.de/git/u-boot-marvell
Tom Rini [Wed, 12 Oct 2016 12:30:08 +0000 (08:30 -0400)]
Merge git://www.denx.de/git/u-boot-marvell

8 years agoMerge git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Wed, 12 Oct 2016 12:29:42 +0000 (08:29 -0400)]
Merge git://git.denx.de/u-boot-fsl-qoriq

Signed-off-by: Tom Rini <trini@konsulko.com>
Conflicts:
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h

8 years agocommon: Add DISPLAY_BOARDINFO
Lokesh Vutla [Wed, 12 Oct 2016 01:33:46 +0000 (21:33 -0400)]
common: Add DISPLAY_BOARDINFO

Create a Kconfig entry for DISPLAY_BOARDINFO and make it be the default
in certain architectures.  Migrate all config files.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agocommon/Kconfig: Add DISPLAY_CPUINFO
Lokesh Vutla [Sat, 8 Oct 2016 18:41:44 +0000 (14:41 -0400)]
common/Kconfig: Add DISPLAY_CPUINFO

Create a Kconfig entry for DISPLAY_CPUINFO and make it be the default
in certain architectures.  Migrate all config files.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agox86: Clean up unused macros in the configuration headers
Bin Meng [Sun, 9 Oct 2016 11:14:20 +0000 (04:14 -0700)]
x86: Clean up unused macros in the configuration headers

Legacy video driver macros are not needed. Clean them up.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agovideo: Remove legacy VESA and coreboot framebuffer drivers
Bin Meng [Sun, 9 Oct 2016 11:14:19 +0000 (04:14 -0700)]
video: Remove legacy VESA and coreboot framebuffer drivers

Now that all x86 boards have been converted to DM video, drop the
legacy drivers.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: coreboot: Convert to use DM coreboot video driver
Bin Meng [Sun, 9 Oct 2016 11:14:18 +0000 (04:14 -0700)]
x86: coreboot: Convert to use DM coreboot video driver

This converts coreboot to use DM framebuffer driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: video: Don't do anything in alloc_fb() when plat->size is zero
Bin Meng [Sun, 9 Oct 2016 11:14:17 +0000 (04:14 -0700)]
dm: video: Don't do anything in alloc_fb() when plat->size is zero

With DM VESA driver on x86 boards, plat->base/size/align are all
zeroes and starting address passed to alloc_fb() happens to be 1MB
aligned, so this routine does not trigger any issue. On QEMU with
U-Boot as coreboot payload, the starting address is within 1MB
range (eg: 0x7fb0000), thus causes failure in video_post_bind().

Actually if plat->size is zero, it makes no sense to do anything
in this routine. Add such check there.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: video: Add driver for coreboot framebuffer device
Bin Meng [Sun, 9 Oct 2016 11:14:16 +0000 (04:14 -0700)]
dm: video: Add driver for coreboot framebuffer device

This adds a DM driver for coreboot framebuffer device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agovbe: Make vbe_setup_video_priv() public
Bin Meng [Sun, 9 Oct 2016 11:14:15 +0000 (04:14 -0700)]
vbe: Make vbe_setup_video_priv() public

vbe_setup_video_priv() might be useful to other drivers.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: doc: Correct qfw command example
Bin Meng [Sun, 9 Oct 2016 11:14:14 +0000 (04:14 -0700)]
x86: doc: Correct qfw command example

The kernel load address for zboot should be 0x1000000.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: Convert to use DM VESA video driver
Bin Meng [Sun, 9 Oct 2016 11:14:13 +0000 (04:14 -0700)]
x86: Convert to use DM VESA video driver

At present only chromebook boards are converted to DM video. Other
x86 boards are still using the legacy cfb_console driver. This
switches to use DM version drivers.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: video: Output verbose information in vbe_setup_video()
Bin Meng [Sun, 9 Oct 2016 11:14:12 +0000 (04:14 -0700)]
dm: video: Output verbose information in vbe_setup_video()

With DM conversion, information like "Video: 1024x768x16" is not
shown anymore. Now add these verbose output back.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: video: Add driver for VESA-compatible device
Bin Meng [Sun, 9 Oct 2016 11:14:11 +0000 (04:14 -0700)]
dm: video: Add driver for VESA-compatible device

This adds a DM driver for VESA-compatible device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: doc: Document coreboot framebuffer driver issue on QEMU
Bin Meng [Sun, 9 Oct 2016 11:14:10 +0000 (04:14 -0700)]
x86: doc: Document coreboot framebuffer driver issue on QEMU

For some unknown reason, coreboot framebuffer driver never works on
QEMU since day 1. It seems the driver only works on real hardware.
Document this issue.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agocmd: cros_ec: Move crosec commands to cmd subdirectory
Moritz Fischer [Wed, 5 Oct 2016 00:08:08 +0000 (17:08 -0700)]
cmd: cros_ec: Move crosec commands to cmd subdirectory

Move crosec commands from drivers/misc/cros_ec.c to
cmd/cros_ec.c

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Miao Yan <yanmiaobest@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: u-boot@lists.denx.de
8 years agosandbox/fs: Set correct filetype for unknown filetype
Stefan Brüns [Tue, 4 Oct 2016 19:46:35 +0000 (21:46 +0200)]
sandbox/fs: Set correct filetype for unknown filetype

The "hostfs ls" command prefixes each directory entry with either DIR,
LNK or "   " if it is a directory, symlink resp. regular file, or
"???" for any other or unknown type.
The latter only works if the type is set correctly, as the entry defaults
to OS_FILET_REG and e.g. socket files show up as regular files.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Use the address in readl/writel() functions
Simon Glass [Sat, 1 Oct 2016 20:42:33 +0000 (14:42 -0600)]
sandbox: Use the address in readl/writel() functions

At present these functions do not touch addr, which can raising warnings
about unused variables.

This fixes the following warnings:

sandbox_spl defconfig
drivers/core/regmap.c: In function ‘regmap_read’:
drivers/core/regmap.c:125:12: warning: unused variable ‘ptr’ [-Wunused-variable]
  uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE);
            ^
drivers/core/regmap.c: In function ‘regmap_write’:
drivers/core/regmap.c:134:12: warning: unused variable ‘ptr’ [-Wunused-variable]
  uint32_t *ptr = map_physmem(map->base + offset, 4, MAP_NOCACHE);

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 3bfb8cb4 (dm: regmap: Implement simple regmap_read & regmap_write)

8 years agosandbox/fs: Use readdir instead of deprecated readdir_r
Stefan Brüns [Sat, 1 Oct 2016 18:41:42 +0000 (20:41 +0200)]
sandbox/fs: Use readdir instead of deprecated readdir_r

Using readdir_r limits the maximum file name length and may even be
unsafe, and is thus deprecated in since glibc 2.24.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agosandbox/fs: Use correct size path name buffer
Stefan Brüns [Sat, 1 Oct 2016 18:41:40 +0000 (20:41 +0200)]
sandbox/fs: Use correct size path name buffer

The readdir linux manpage explicitly states (quoting POSIX.1) that
sizeof(d_name) is not correct for determining the required size, but to
always use strlen. Grow the buffer if needed.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agosandbox/fs: Make linking of nodes in os_dirent_ls more obvious
Stefan Brüns [Sat, 1 Oct 2016 18:41:39 +0000 (20:41 +0200)]
sandbox/fs: Make linking of nodes in os_dirent_ls more obvious

Previously, after reading/creating the second dirent, the second entry
would be chained to the first entry and the first entry would be linked
to head. Instead, immediately link the first entry to head.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agosandbox/fs: Free memory allocated by os_dirent_ls
Stefan Brüns [Sat, 1 Oct 2016 18:41:38 +0000 (20:41 +0200)]
sandbox/fs: Free memory allocated by os_dirent_ls

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agopower: regulator: lp873x: Add regulator support
Keerthy [Fri, 30 Sep 2016 04:04:03 +0000 (09:34 +0530)]
power: regulator: lp873x: Add regulator support

The driver provides regulator set/get voltage
enable/disable functions for lp873x family of PMICs.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agopower: pmic: lp873x: Add the base pmic support
Keerthy [Fri, 30 Sep 2016 04:04:02 +0000 (09:34 +0530)]
power: pmic: lp873x: Add the base pmic support

Add support to bind the regulators/child nodes with the pmic.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoconfigs: am57xx_evm_defconfig: Enable CMD_REG option
Keerthy [Fri, 30 Sep 2016 03:50:47 +0000 (09:20 +0530)]
configs: am57xx_evm_defconfig: Enable CMD_REG option

Enable CMD_REG option.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoconfigs: am57xx_evm_defconfig: Enable PALMAS options
Keerthy [Fri, 30 Sep 2016 03:50:46 +0000 (09:20 +0530)]
configs: am57xx_evm_defconfig: Enable PALMAS options

Enable palmas PMIC config options.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoconfigs: dra7xx_evm_defconfig: Enable PALMAS options
Keerthy [Fri, 30 Sep 2016 03:50:45 +0000 (09:20 +0530)]
configs: dra7xx_evm_defconfig: Enable PALMAS options

Enable palmas PMIC config options.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agopower: regulator: palmas: Add regulator support
Keerthy [Fri, 30 Sep 2016 03:50:44 +0000 (09:20 +0530)]
power: regulator: palmas: Add regulator support

The driver provides regulator set/get voltage
enable/disable functions for palmas family of PMICs.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agopower: pmic: Palmas: Add the base pmic support
Keerthy [Fri, 30 Sep 2016 03:50:43 +0000 (09:20 +0530)]
power: pmic: Palmas: Add the base pmic support

Add support to bind the regulators/child nodes with the pmic.
Also adds the pmic i2c based read/write funtions to access pmic
registers.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agopower: regulator: Add ctrl_reg and volt_reg fields for pmic
Keerthy [Fri, 30 Sep 2016 03:50:42 +0000 (09:20 +0530)]
power: regulator: Add ctrl_reg and volt_reg fields for pmic

The ctrl reg contains bit fields to enable and disable regulators,
and volt_reg has the bit fields to configure the voltage values.
The registers are frequently accessed hence make them part
of dm_regulator_uclass_platdata structure.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agopower: regulator: Add support for gpio regulators
Keerthy [Thu, 15 Sep 2016 11:34:06 +0000 (17:04 +0530)]
power: regulator: Add support for gpio regulators

Add support for gpio regulators. As of now this driver caters
to gpio regulators with one gpio. Supports setting voltage values to gpio
regulators and retrieving the values.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: Enable DM_MMC_OPS by default with DM_MMC
Simon Glass [Sat, 1 Oct 2016 20:43:19 +0000 (14:43 -0600)]
dm: mmc: Enable DM_MMC_OPS by default with DM_MMC

These two options go together and it is best to do the conversion in one
step. So enable DM_MMC_OPS by default if DM_MMC is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: blk: Enable CONFIG_BLK if DM_MMC is enabled
Simon Glass [Sat, 1 Oct 2016 20:43:18 +0000 (14:43 -0600)]
dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

To speed up conversion to CONFIG_BLK, enable it by default when DM_MMC is
enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agox86: mrccache: Fix error handling in mrccache_get_region()
Simon Glass [Mon, 26 Sep 2016 03:33:40 +0000 (21:33 -0600)]
x86: mrccache: Fix error handling in mrccache_get_region()

This should return normal errors, not device-tree errors. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Drop unused init_helper functions
Simon Glass [Mon, 26 Sep 2016 03:33:38 +0000 (21:33 -0600)]
x86: Drop unused init_helper functions

Drop init_bd_struct_r() which is no-longer used. Also drop the declaration
for init_func_spi() since this is now handled by generic board init.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Tidy up enable_clock_gating() for 64-bit
Simon Glass [Mon, 26 Sep 2016 03:33:35 +0000 (21:33 -0600)]
x86: ivybridge: Tidy up enable_clock_gating() for 64-bit

Fix the hex case and remove unused brackets. Use ~0U instead of ~0UL to
allow compilation on 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: ivybridge: Fix PCH power setup
Simon Glass [Mon, 26 Sep 2016 03:33:34 +0000 (21:33 -0600)]
x86: ivybridge: Fix PCH power setup

At present pch_power_options() has the arguments to writel() around the
wrong way. Fix this and update it to compile on 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Don't export interrupt handlers with x86_64
Simon Glass [Mon, 26 Sep 2016 03:33:31 +0000 (21:33 -0600)]
x86: Don't export interrupt handlers with x86_64

We don't have a way of adjusting these at present so it is best to refuse to
export these functions. This can be implemented later if the API is required.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: i2c: Fix cast of address to 32-bit value
Simon Glass [Mon, 26 Sep 2016 03:33:30 +0000 (21:33 -0600)]
x86: i2c: Fix cast of address to 32-bit value

This gives a build warning on 64-bit x86. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Correct address casts in interrupt code
Simon Glass [Mon, 26 Sep 2016 03:33:25 +0000 (21:33 -0600)]
x86: Correct address casts in interrupt code

We should cast an address to unsigned long, not u32.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>