oweals/u-boot.git
8 years agorockchip: clk: Update the rk3288 driver to support of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:29 +0000 (11:58 -0600)]
rockchip: clk: Update the rk3288 driver to support of-platdata

Add support for of-platdata with rk3288. This requires decoding the
of-platdata struct and setting up the devices from that. Also the driver
needs to be renamed to match the string that of-platdata will search for.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: clk: Move all DT decoding to ofdata_to_platdata()
Simon Glass [Mon, 4 Jul 2016 17:58:28 +0000 (11:58 -0600)]
rockchip: clk: Move all DT decoding to ofdata_to_platdata()

It is more correct to avoid touching the device tree in the probe() method.
Update the driver to work this way. Also add an error check on grf since if
that fails then we should not use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: mmc: Update the driver to support of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:27 +0000 (11:58 -0600)]
rockchip: mmc: Update the driver to support of-platdata

Add support for of-platdata with rk3288. This requires decoding the
of-platdata struct and setting up the device from that. Also the driver
needs to be renamed to match the string that of-platdata will search for.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: mmc: Move all DT decoding to ofdata_to_platdata()
Simon Glass [Mon, 4 Jul 2016 17:58:26 +0000 (11:58 -0600)]
rockchip: mmc: Move all DT decoding to ofdata_to_platdata()

It is more correct to avoid touching the device tree in the probe() method.
Update the driver to work this way.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: Update the sdram-channel property to support of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:25 +0000 (11:58 -0600)]
rockchip: Update the sdram-channel property to support of-platdata

Add an extra byte so that this data is not byteswapped. Add a comment to
the code to explain the purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: serial: Add an of-platdata driver for rockchip
Simon Glass [Mon, 4 Jul 2016 17:58:24 +0000 (11:58 -0600)]
rockchip: serial: Add an of-platdata driver for rockchip

Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: serial: ns16550: Update to support of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:23 +0000 (11:58 -0600)]
dm: serial: ns16550: Update to support of-platdata

With of-platdata this driver cannot know the format of the of-platdata
struct, so we cannot use generic code for accessing the of-platdata. Each
SoC that uses this driver will need to set up ns16550's platdata for it.
So don't compile in the generic code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: core: Add an implementation of regmap_init_mem_platdata()
Simon Glass [Mon, 4 Jul 2016 17:58:22 +0000 (11:58 -0600)]
dm: core: Add an implementation of regmap_init_mem_platdata()

Add an implementation of this function which mirrors the functions of the
automatic device-tree implementation. This can be used with of-platdata to
create regmaps.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: core: Move regmap allocation into a separate function
Simon Glass [Mon, 4 Jul 2016 17:58:21 +0000 (11:58 -0600)]
dm: core: Move regmap allocation into a separate function

We plan to add a new way of creating a regmap for of-platdata. Move the
allocation code into a separate function so that it can be shared.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: sandbox: Enable of-platdata for sandbox_spl
Simon Glass [Mon, 4 Jul 2016 17:58:20 +0000 (11:58 -0600)]
dm: sandbox: Enable of-platdata for sandbox_spl

Enable this feature so that we can use it for testing in sandbox_spl.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Don't bring in the eeprom emulator in SPL
Simon Glass [Mon, 4 Jul 2016 17:58:19 +0000 (11:58 -0600)]
sandbox: Don't bring in the eeprom emulator in SPL

This driver should not be used in SPL since we do not have I2C support
enabled in SPL on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: core: Expand platdata for of-platdata devices
Simon Glass [Mon, 4 Jul 2016 17:58:18 +0000 (11:58 -0600)]
dm: core: Expand platdata for of-platdata devices

Devices which use of-platdata have their own platdata. However, in many
cases the driver will have its own auto-alloced platdata, for use with the
device tree. The ofdata_to_platdata() method converts the device tree
settings to platdata.

With of-platdata we would not normally allocate the platdata since it is
provided by the U_BOOT_DEVICE() declaration. However this is inconvenient
since the of-platdata struct is closely tied to the device tree properties.
It is unlikely to exactly match the platdata needed by the driver.

In fact a useful approach is to declare platdata in the driver like this:

struct r3288_mmc_platdata {
struct dtd_rockchip_rk3288_dw_mshc of_platdata;
/* the 'normal' fields go here */
};

In this case we have dt_platadata available, but the normal fields are not
present, since ofdata_to_platdata() is never called. In fact driver model
doesn't allocate any space for the 'normal' fields, since it sees that there
is already platform data attached to the device.

To make this easier, adjust driver model to allocate the full size of the
struct (i.e. platdata_auto_alloc_size from the driver) and copy in the
of-platdata. This means that when the driver's bind() method is called,
the of-platdata will be present, followed by zero bytes for the empty
'normal field' portion.

A new DM_FLAG_OF_PLATDATA flag is available that indicates that the platdata
came from of-platdata. When the allocation/copy happens, the
DM_FLAG_ALLOC_PDATA flag will be set as well. The dtoc tool is updated to
output the platdata_size field, since U-Boot has no other way of knowing
the size of the of-platdata struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Don't attach the device tree to SPL with of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:17 +0000 (11:58 -0600)]
dm: Don't attach the device tree to SPL with of-platdata

When of-platdata is used in SPL we don't use the device tree. So there is no
point in attaching it. Adjust the Makefile to skip attaching the device tree
when of-platdata is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodtoc: Ignore the u-boot, dm-pre-reloc property
Simon Glass [Mon, 4 Jul 2016 17:58:16 +0000 (11:58 -0600)]
dtoc: Ignore the u-boot, dm-pre-reloc property

This property is not useful for of-platdata, so omit it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCED
Simon Glass [Mon, 4 Jul 2016 17:58:15 +0000 (11:58 -0600)]
dm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCED

This is a flag. Adjust the name to be consistent with the other flags.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: spl: Bind in all devices in SPL with of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:14 +0000 (11:58 -0600)]
dm: spl: Bind in all devices in SPL with of-platdata

When CONFIG_OF_PLATDATA is enabled, we cannot use the u-boot,dm-pre-reloc
device tree property since the device tree is not available. However,
dt-platdata.c only includes devices which would have been present in the
device tree, and we can assume that all such devices are needed for SPL.
If they were not needed, they would have been omitted to save space.

So in this case, bind all devices regardless of the u-boot,dm-pre-reloc
setting. This avoids needing to add a DM_FLAG_PRE_RELOC to every driver,
thus affecting U-Boot proper also.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agotiny-printf: Support assert()
Simon Glass [Mon, 4 Jul 2016 17:58:13 +0000 (11:58 -0600)]
tiny-printf: Support assert()

At present assert() is not supported with tiny-printf, so when DEBUG is
enabled a build error is generated for each assert().

Add an __assert_fail() function to correct this. It prints a message and
then hangs.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoOnly build the libfdt python module if 'swig' is available
Simon Glass [Mon, 4 Jul 2016 17:58:12 +0000 (11:58 -0600)]
Only build the libfdt python module if 'swig' is available

When swig is not available, we can still build correctly. So make this
optional. Add a comment about how to enable this build.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add a more efficient libfdt library
Simon Glass [Mon, 4 Jul 2016 17:58:11 +0000 (11:58 -0600)]
dm: Add a more efficient libfdt library

Add a Python version of the libfdt library which contains enough features to
support the dtoc tool. This is only a very bare-bones implementation. It
requires the 'swig' to build.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Makefile: Build of-platdata files when the feature is enabled
Simon Glass [Mon, 4 Jul 2016 17:58:10 +0000 (11:58 -0600)]
dm: Makefile: Build of-platdata files when the feature is enabled

Update the Makefile to call dtoc to create the C header and source files,
then build these into the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add a tool to generate C code from a device tree
Simon Glass [Mon, 4 Jul 2016 17:58:09 +0000 (11:58 -0600)]
dm: Add a tool to generate C code from a device tree

This tool can produce C struct definitions and C platform data tables.
This is used to support the of-platdata feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add a library to provide simple device-tree access
Simon Glass [Mon, 4 Jul 2016 17:58:08 +0000 (11:58 -0600)]
dm: Add a library to provide simple device-tree access

This Python library provides a way to access the contents of the device
tree. It uses fdtget, so is inefficient for larger device tree files.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add a README for of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:07 +0000 (11:58 -0600)]
dm: Add a README for of-platdata

Add documentation on how this works, including the benefits and drawbacks.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add an option to enable the of-platdata feature
Simon Glass [Mon, 4 Jul 2016 17:58:06 +0000 (11:58 -0600)]
dm: Add an option to enable the of-platdata feature

Add a Kconfig option to enable this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Don't include fdtdec functions when of-platdata is enabled
Simon Glass [Mon, 4 Jul 2016 17:58:05 +0000 (11:58 -0600)]
dm: Don't include fdtdec functions when of-platdata is enabled

We cannot access the device tree in this case, so avoid compiling in the
various device-tree helper functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: serial: Add support for of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:04 +0000 (11:58 -0600)]
dm: serial: Add support for of-platdata

When this feature is enabled, we cannot access the device tree to find out
which serial device to use. Just use the first serial driver we find.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: clk: Add support for of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:03 +0000 (11:58 -0600)]
dm: clk: Add support for of-platdata

Add support for this feature in the core clock code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Add a header that provides access to the of-platdata structs
Simon Glass [Mon, 4 Jul 2016 17:58:02 +0000 (11:58 -0600)]
dm: Add a header that provides access to the of-platdata structs

This header can be included from anywhere, but will only pull in the
of-platdata struct definitions when this feature is enabled (and only in
SPL).

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: sandbox: Add a simple driver to test of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:01 +0000 (11:58 -0600)]
dm: sandbox: Add a simple driver to test of-platdata

Add a driver which uses of-platdata to obtain its platform data. This can
be used to test the feature in sandbox. It displays the contents of its
platform data.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: syscon: Add support for of-platdata
Simon Glass [Mon, 4 Jul 2016 17:58:00 +0000 (11:58 -0600)]
dm: syscon: Add support for of-platdata

Provide a new function which can cope with obtaining information from
of-platdata instead of the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: regmap: Add a dummy implementation for of-platdata
Simon Glass [Mon, 4 Jul 2016 17:57:59 +0000 (11:57 -0600)]
dm: regmap: Add a dummy implementation for of-platdata

Add a placeholder for now so that this code will compile. It currently does
nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: core: Don't use device tree with of-platdata
Simon Glass [Mon, 4 Jul 2016 17:57:58 +0000 (11:57 -0600)]
dm: core: Don't use device tree with of-platdata

When CONFIG_SPL_OF_PLATDATA is enabled we should not access the device
tree. Remove all references to this in the core driver-model code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: Makefile: Build of-platdata before SPL
Simon Glass [Mon, 4 Jul 2016 17:57:57 +0000 (11:57 -0600)]
dm: Makefile: Build of-platdata before SPL

Since SPL needs the of-platdata structures, build these before starting
to build any SPL components.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: spl: Don't set up device tree with of-platdata
Simon Glass [Mon, 4 Jul 2016 17:57:56 +0000 (11:57 -0600)]
dm: spl: Don't set up device tree with of-platdata

When this feature is enabled, we should not access the device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Add a test device that uses of-platdata
Simon Glass [Mon, 4 Jul 2016 17:57:55 +0000 (11:57 -0600)]
sandbox: Add a test device that uses of-platdata

Start up the test devices. These print out of-platdata contents, providing a
check that the of-platdata feature is working correctly.

The device-tree changes are made to sandbox.dts rather than test.dts. since
the former controls the of-platdata generation.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Add a new sandbox_spl board
Simon Glass [Mon, 4 Jul 2016 17:57:54 +0000 (11:57 -0600)]
sandbox: Add a new sandbox_spl board

It is useful to be able to build SPL for sandbox. It provides additional
build coverage and allows SPL features to be tested in sandbox. However
it does not need worthwhile to always create an SPL build. It nearly
doubles the build time and the feature is (so far) seldom used.

So for now, create a separate build target for sandbox SPL. This allows
experimentation with this new feature without impacting existing workflows.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: serial: Don't sync video in SPL
Simon Glass [Mon, 4 Jul 2016 17:57:53 +0000 (11:57 -0600)]
sandbox: serial: Don't sync video in SPL

SPL does not support an LCD display so there is no need to sync the video
when there is serial output.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Don't use IDE and iotrace in SPL
Simon Glass [Mon, 4 Jul 2016 17:57:52 +0000 (11:57 -0600)]
sandbox: Don't use IDE and iotrace in SPL

These functions are not supported in SPL, so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Add basic SPL implementation
Simon Glass [Mon, 4 Jul 2016 17:57:51 +0000 (11:57 -0600)]
sandbox: Add basic SPL implementation

Add an sandbox implementation for the generic SPL framework. This supports
locating and running U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Don't include the main loop in SPL
Simon Glass [Mon, 4 Jul 2016 17:57:50 +0000 (11:57 -0600)]
sandbox: Don't include the main loop in SPL

SPL does not have a command interface so we should not include the main loop
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Don't use PCI in SPL
Simon Glass [Mon, 4 Jul 2016 17:57:49 +0000 (11:57 -0600)]
sandbox: Don't use PCI in SPL

PCI is not supported in SPL for sandbox, so avoid using it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Add some missing headers in cpu.c
Simon Glass [Mon, 4 Jul 2016 17:57:48 +0000 (11:57 -0600)]
sandbox: Add some missing headers in cpu.c

These headers are needed in case they are not transitively included.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Correct header file order in cpu.c
Simon Glass [Mon, 4 Jul 2016 17:57:47 +0000 (11:57 -0600)]
sandbox: Correct header file order in cpu.c

The dm/ file should go at the end. Move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Support building an SPL image
Simon Glass [Mon, 4 Jul 2016 17:57:46 +0000 (11:57 -0600)]
sandbox: Support building an SPL image

When building an SPL image, override the link flags so that it uses the
system libraries. This is similar to the way the non-SPL image is built.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Allow chaining from SPL to U-Boot proper
Simon Glass [Mon, 4 Jul 2016 17:57:45 +0000 (11:57 -0600)]
sandbox: Allow chaining from SPL to U-Boot proper

SPL is expected to load and run U-Boot. This needs to work with sandbox also.
Provide a function to locate the U-Boot image, and another to start it. This
allows SPL to function on sandbox as it does on other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoMakefile: Allow the SPL final link rule to be overridden
Simon Glass [Mon, 4 Jul 2016 17:57:44 +0000 (11:57 -0600)]
Makefile: Allow the SPL final link rule to be overridden

Overriding the final link rule is possible with U-Boot proper. It us used to
create a sandbox image links with host libraries. To build a sandbox SPL
image we need the same feature for SPL.

To support this, update the SPL link rule so sandbox can override it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agospl: Drop include of i2c.h
Simon Glass [Mon, 4 Jul 2016 17:57:43 +0000 (11:57 -0600)]
spl: Drop include of i2c.h

This file does not appear to use I2C, so drop this include.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoREADME: Remove CONFIG_SYS_MALLOC_F_LEN comment
Simon Glass [Mon, 4 Jul 2016 17:57:42 +0000 (11:57 -0600)]
README: Remove CONFIG_SYS_MALLOC_F_LEN comment

This option is now widely available, so remove the comment that it is only
available on ARM and sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Don't print a warning for CONFIG_I2C_COMPAT
Simon Glass [Mon, 4 Jul 2016 17:57:41 +0000 (11:57 -0600)]
sandbox: Don't print a warning for CONFIG_I2C_COMPAT

Sandbox includes this code to provide build coverage. While we retain this
feature we should have sandbox build it. Sandbox does not in fact use the
I2C compatibility mode. Showing a warning for sandbox is just confusing,
since no conversion is expected.

Drop the warning for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoRevert "armv8: Enable CPUECTLR.SMPEN for coherency"
Tom Rini [Thu, 14 Jul 2016 21:36:18 +0000 (17:36 -0400)]
Revert "armv8: Enable CPUECTLR.SMPEN for coherency"

Upon further review this breaks most other platforms as we need to check
what core we're running on before touching it at all.

This reverts commit d73718f3236c520a92efa401084c658e6cc067f3.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-x86
Tom Rini [Tue, 12 Jul 2016 12:15:17 +0000 (08:15 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-x86

8 years agox86: link: Correct a failure in DRAM init
Simon Glass [Mon, 11 Jul 2016 15:30:55 +0000 (09:30 -0600)]
x86: link: Correct a failure in DRAM init

With the change to set up pinctrl after relocation, link fails to boot. Add
a special case in the link code to handle this.

Fixes: d8906c1f (x86: Probe pinctrl driver in cpu_init_r())

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: Add Advantech SOM-DB5800/SOM-6867 support
George McCollister [Tue, 21 Jun 2016 17:07:33 +0000 (12:07 -0500)]
x86: Add Advantech SOM-DB5800/SOM-6867 support

Add support for Advantech SOM-DB5800 with the SOM-6867 installed.
This is very similar to conga-qeval20-qa3-e3845 in that there is a
reference carrier board (SOM-DB5800) with a Baytrail based SoM (SOM-6867)
installed.

Currently supported:
 - 2x UART (From ITE EC on SOM-6867) routed to COM3/4 connectors on
   SOM-DB5800.
 - 4x USB 2.0 (EHCI)
 - Video
 - SATA
 - Ethernet
 - PCIe
 - Realtek ALC892 HD Audio
   Pad configuration for HDA_RSTB, HDA_SYNC, HDA_CLK, HDA_SDO
   HDA_SDI0 is set in DT to enable HD Audio codec.
   Pin defaults for codec pin complexs are not changed.

Not supported:
 - Winbond Super I/O (Must be disabled with jumpers on SOM-DB8500)
 - USB 3.0 (XHCI)
 - TPM

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agox86: baytrail: acpi: Hide internal UART per GNVS setting
Bin Meng [Fri, 17 Jun 2016 09:13:17 +0000 (02:13 -0700)]
x86: baytrail: acpi: Hide internal UART per GNVS setting

If global NVS says internal UART is not enabled, hide it in the ASL
code so that OS won't see it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: acpi: Pack global NVS into ACPI table
Bin Meng [Fri, 17 Jun 2016 09:13:16 +0000 (02:13 -0700)]
x86: acpi: Pack global NVS into ACPI table

Now that platform-specific ACPI global NVS is added, pack it into
ACPI table and get its address fixed up.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: quark: Introduce ACPI global NVS
Bin Meng [Fri, 17 Jun 2016 09:13:15 +0000 (02:13 -0700)]
x86: quark: Introduce ACPI global NVS

This introduces quark-specific ACPI global NVS structure, defined in
both C header file and ASL file.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: baytrail: Introduce ACPI global NVS
Bin Meng [Fri, 17 Jun 2016 09:13:14 +0000 (02:13 -0700)]
x86: baytrail: Introduce ACPI global NVS

This introduces baytrail-specific ACPI global NVS structure, defined in
both C header file and ASL file.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: conga-qeval20-qa3: Add support for internal UART
Stefan Roese [Wed, 15 Jun 2016 12:15:25 +0000 (14:15 +0200)]
x86: conga-qeval20-qa3: Add support for internal UART

This patch adds support to enable and use the internal BayTrail UART
instead of the one integrated in the Super IO Winbond chip. For this,
a 2nd defconfig file is added.

This is useful for tests done for the congatec SoM used on baseboards
without such a Super IO chip.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: fsp: Wrap setup_internal_uart() call with CONFIG_INTERNAL_UART
Bin Meng [Wed, 15 Jun 2016 04:33:24 +0000 (21:33 -0700)]
x86: fsp: Wrap setup_internal_uart() call with CONFIG_INTERNAL_UART

For any FSP-enabled boards that want to enable debug UART support,
setup_internal_uart() will be called, but this API is only available
on BayTrail platform. Change to wrap it with CONFIG_INTERNAL_UART.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agox86: baytrail: Introduce a Kconfig option for the internal UART
Bin Meng [Wed, 15 Jun 2016 04:33:23 +0000 (21:33 -0700)]
x86: baytrail: Introduce a Kconfig option for the internal UART

There are quite a number of BayTrail boards that uses an external
SuperIO chipset to provide the legacy UART. For such cases, it's
better to have a Kconfig option to enable the internal UART.

So far BayleyBay and MinnowMax boards are using internal UART as
the U-Boot console, enable this on these two boards.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agopci: Add board_ prefix to should_load_oprom() and make it weak
Bin Meng [Tue, 14 Jun 2016 09:02:40 +0000 (02:02 -0700)]
pci: Add board_ prefix to should_load_oprom() and make it weak

For consistency with board_should_run_oprom(), do the same to
should_load_oprom(). Board support codes can provide this one
to override the default weak one.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agopci: Make load_oprom and run_oprom independent
Bin Meng [Tue, 14 Jun 2016 09:02:39 +0000 (02:02 -0700)]
pci: Make load_oprom and run_oprom independent

At present should_load_oprom() calls board_should_run_oprom() to
determine whether oprom should be loaded. But sometimes we just
want to load oprom without running. Make them independent.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agopci: Remove CONFIG_ALWAYS_LOAD_OPROM
Bin Meng [Tue, 14 Jun 2016 09:02:38 +0000 (02:02 -0700)]
pci: Remove CONFIG_ALWAYS_LOAD_OPROM

This option is defined at nowhere. Remove it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Mon, 11 Jul 2016 22:50:29 +0000 (18:50 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

8 years agotools: patman: Handle missing 'END' in non-last commit of a series
Bin Meng [Mon, 27 Jun 2016 06:24:32 +0000 (23:24 -0700)]
tools: patman: Handle missing 'END' in non-last commit of a series

The following python error:

Traceback (most recent call last):
  File "./tools/patman/patman", line 144, in <module>
    series = patchstream.FixPatches(series, args)
  File "./tools/patman/patchstream.py", line 477, in FixPatches
    commit = series.commits[count]
IndexError: list index out of range

is seen when:

- 'END' is missing in those tags
- those tags are put in the last part in a commit message
- the commit is not the last commit of the series

Add testing logic to see if a new commit starts.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotools: patman: Handle missing blank line for 'Series-changes'
Bin Meng [Mon, 27 Jun 2016 06:24:31 +0000 (23:24 -0700)]
tools: patman: Handle missing blank line for 'Series-changes'

'Series-changes' uses blank line to indicate its end. If that is
missing, series internal state variable 'in_change' may be wrong.
Correct its state.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotools: patman: Generate cover letter correctly when 'END' is missing
Bin Meng [Mon, 27 Jun 2016 06:24:30 +0000 (23:24 -0700)]
tools: patman: Generate cover letter correctly when 'END' is missing

If 'END' is missing in a 'Cover-letter' section, and that section
happens to show up at the very end of the commit message, and the
commit is the last commit of the series, patman fails to generate
cover letter for us. Handle this in CloseCommit of patchstream.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotools: patman: Handle tag sections without an 'END'
Bin Meng [Mon, 27 Jun 2016 06:24:29 +0000 (23:24 -0700)]
tools: patman: Handle tag sections without an 'END'

'Cover-letter', 'Series-notes' and 'Commit-notes' tags require an
'END' to be put at the end of its section. If we forget to put an
'END' in those sections, and these sections are followed by another
patman tag, patman generates incorrect patches. This adds codes to
handle such scenario.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotools: patman: Use cover_match for 'Cover-letter'
Bin Meng [Mon, 27 Jun 2016 06:24:28 +0000 (23:24 -0700)]
tools: patman: Use cover_match for 'Cover-letter'

Like other patman tags, use a new variable cover_match to indicate
a match for 'Cover-letter'.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: Sort the uclass id in alphabetical order
Bin Meng [Wed, 22 Jun 2016 09:29:47 +0000 (02:29 -0700)]
dm: Sort the uclass id in alphabetical order

Some uclass ids are out of order. Per the comments, sort them
in alphabetical order.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agosandbox: Find keyboard driver using driver model
Simon Glass [Sun, 19 Jun 2016 23:33:15 +0000 (17:33 -0600)]
sandbox: Find keyboard driver using driver model

The cros-ec keyboard is always a child of the cros-ec node. Rather than
searching the device tree, looking at the children. Remove the compat string
which is now unused.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agofdt: x86: Tidy up a few COMPAT string definitions
Simon Glass [Sun, 19 Jun 2016 23:33:14 +0000 (17:33 -0600)]
fdt: x86: Tidy up a few COMPAT string definitions

The 'COMPAT_' part should appear only once so drop the duplicate part. It is
ignored anyway, but let's keep things consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agofdt: Add a note to avoid adding new compatible strings
Simon Glass [Sun, 19 Jun 2016 23:33:13 +0000 (17:33 -0600)]
fdt: Add a note to avoid adding new compatible strings

The list is shrinking and we should avoid adding new things. Instead, a
proper driver should be created with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agofdt: Drop unused exynos compatible strings
Simon Glass [Sun, 19 Jun 2016 23:33:12 +0000 (17:33 -0600)]
fdt: Drop unused exynos compatible strings

A few drivers have moved to driver model, so we can drop these strings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
8 years agox86: fdt: Drop the unused compatible strings in fdtdec
Simon Glass [Sun, 19 Jun 2016 23:33:11 +0000 (17:33 -0600)]
x86: fdt: Drop the unused compatible strings in fdtdec

We have drivers for several more devices now, so drop the strings which are
no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
8 years agocommon: block: fix compiler error with CONFIG_FASTBOOT_FLASH_MMC_DEV
Xu Ziyuan [Wed, 15 Jun 2016 08:56:18 +0000 (16:56 +0800)]
common: block: fix compiler error with CONFIG_FASTBOOT_FLASH_MMC_DEV

This fixes the following compiler error:

common/fb_mmc.c: In function ‘fb_mmc_erase’:
common/fb_mmc.c:209:17: error: ‘struct blk_desc’ has no member named
‘block_erase’

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: gpio: MPC85XX GPIO platform data support
Hamish Martin [Mon, 13 Jun 2016 22:17:05 +0000 (10:17 +1200)]
dm: gpio: MPC85XX GPIO platform data support

Define a platform data structure for the MPC85XX GPIO driver to allow
use of the driver without device tree. Users should define the GPIO
blocks for their platform like this:
  struct mpc85xx_gpio_plat gpio_blocks[] = {
         {
                 .addr = 0x130000,
                 .ngpios = 32,
         },
         {
                 .addr = 0x131000,
                 .ngpios = 32,
         },
  };

  U_BOOT_DEVICES(my_platform_gpios) = {
         { "gpio_mpc85xx", &gpio_blocks[0] },
         { "gpio_mpc85xx", &gpio_blocks[1] },
  };

This is intended to build upon the recent submission of the base
MPC85XX driver from Mario Six. We need to use that new driver
without dts support and this patch gives us that flexibility.
This has been tested on a Freescale T2080 CPU, although only the first
GPIO block.

Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
Tested-by: Mario Six <mario.six@gdsys.cc>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agodm: dfu: mmc: Support CONFIG_BLK in DFU for MMC
Simon Glass [Mon, 13 Jun 2016 05:30:33 +0000 (23:30 -0600)]
dm: dfu: mmc: Support CONFIG_BLK in DFU for MMC

Update the method of accessing the block device so that it works with
CONFIG_BLK enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: spl: mmc: Support CONFIG_BLK in SPL MMC
Simon Glass [Mon, 13 Jun 2016 05:30:32 +0000 (23:30 -0600)]
dm: spl: mmc: Support CONFIG_BLK in SPL MMC

Update the method of accessing the block device so that it works with
CONFIG_BLK enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: msmsdhic: Drop old MMC code
Simon Glass [Mon, 13 Jun 2016 05:30:31 +0000 (23:30 -0600)]
dm: mmc: msmsdhic: Drop old MMC code

Now that we have fully moved to driver model, drop the old code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: Move dragonboard410c to use CONFIG_BLK and CONFIG_DM_MMC_OPS
Simon Glass [Mon, 13 Jun 2016 05:30:30 +0000 (23:30 -0600)]
dm: mmc: Move dragonboard410c to use CONFIG_BLK and CONFIG_DM_MMC_OPS

Update this board to use driver model for block devices and MMC operations.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: msm_sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPS
Simon Glass [Mon, 13 Jun 2016 05:30:29 +0000 (23:30 -0600)]
dm: mmc: msm_sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPS

Add support for using driver model for block devices and MMC operations in
this driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPS
Simon Glass [Mon, 13 Jun 2016 05:30:28 +0000 (23:30 -0600)]
dm: mmc: sdhci: Support CONFIG_BLK and CONFIG_DM_MMC_OPS

Add support for using driver model for block devices and MMC operations in
this driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: sdhci: Refactor configuration setup to support DM
Simon Glass [Mon, 13 Jun 2016 05:30:27 +0000 (23:30 -0600)]
dm: mmc: sdhci: Refactor configuration setup to support DM

Move the configuration setting into a separate function which can be used by
the driver-model code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: sandbox: Convert to use CONFIG_CMD_MMC_OPS
Simon Glass [Mon, 13 Jun 2016 05:30:26 +0000 (23:30 -0600)]
dm: sandbox: Convert to use CONFIG_CMD_MMC_OPS

Update the sandbox MMC emulation to use driver model for MMC operations.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: Add MAINTAINER files for kylin_rk3036, evb_rk3036
Simon Glass [Mon, 13 Jun 2016 05:30:25 +0000 (23:30 -0600)]
rockchip: Add MAINTAINER files for kylin_rk3036, evb_rk3036

These boards should have maintainer entries. Add them.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: rockchip: Enable CONFIG_DM_MMC_OPS for all boards
Simon Glass [Mon, 13 Jun 2016 05:30:24 +0000 (23:30 -0600)]
dm: mmc: rockchip: Enable CONFIG_DM_MMC_OPS for all boards

Enable this option to move rockchip over to use driver model for MMC
operations.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: dwmmc: Support CONFIG_DM_MMC_OPS
Simon Glass [Mon, 13 Jun 2016 05:30:23 +0000 (23:30 -0600)]
dm: mmc: dwmmc: Support CONFIG_DM_MMC_OPS

Add support to dwmmc for using driver model for MMC operations.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: Add a way to use driver model for MMC operations
Simon Glass [Mon, 13 Jun 2016 05:30:22 +0000 (23:30 -0600)]
dm: mmc: Add a way to use driver model for MMC operations

The driver model conversion for MMC has moved in small steps. The first step
was to have an MMC device (CONFIG_DM_MMC). The second was to use a child
block device (CONFIG_BLK). The final one is to use driver model for MMC
operations (CONFIG_DM_MMC_OP). Add support for this.

The immediate priority is to make all boards that use DM_MMC also use those
other two options. This will allow them to be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: Disable CONFIG_SDHCI
Simon Glass [Mon, 13 Jun 2016 05:30:21 +0000 (23:30 -0600)]
rockchip: Disable CONFIG_SDHCI

This option is not actually needed for rockchip boards. Drop it, since it
will not support driver-model MMC operation support.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agommc: Move tracing code into separate functions
Simon Glass [Mon, 13 Jun 2016 05:30:20 +0000 (23:30 -0600)]
mmc: Move tracing code into separate functions

Move this code into separate functions so that it can be used from the uclass
also. Add static inline versions for when the option is disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: rockchip: Support only CONFIG_BLK
Simon Glass [Mon, 13 Jun 2016 05:30:19 +0000 (23:30 -0600)]
dm: mmc: rockchip: Support only CONFIG_BLK

Since all Rockchip boards use CONFIG_BLK, we can remove this old code.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agommc: Move MMC boot code into its own file
Simon Glass [Mon, 13 Jun 2016 05:30:18 +0000 (23:30 -0600)]
mmc: Move MMC boot code into its own file

Rather than having an #ifdef in the main mmc.c file, control this feature
from the Makefile by moving the code into its own file.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: Move non-CONFIG_BLK code into mmc_legacy.c
Simon Glass [Mon, 13 Jun 2016 05:30:17 +0000 (23:30 -0600)]
dm: mmc: Move non-CONFIG_BLK code into mmc_legacy.c

Rather than having #ifdef in mmc.c, move this code into the legacy file.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: Move CONFIG_BLK code into the mmc uclass
Simon Glass [Mon, 13 Jun 2016 05:30:16 +0000 (23:30 -0600)]
dm: mmc: Move CONFIG_BLK code into the mmc uclass

Rather than having #ifdef in mmc.c, move this code into the uclass file.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agommc: Add function declarations for mmc_bread() and mmc_switch_part()
Simon Glass [Mon, 13 Jun 2016 05:30:15 +0000 (23:30 -0600)]
mmc: Add function declarations for mmc_bread() and mmc_switch_part()

These private functions are used both in the driver-model implementation and
in the legacy code. Add them to the header.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agorockchip: Use 'select' instead of defaults in Kconfig
Simon Glass [Mon, 13 Jun 2016 05:30:14 +0000 (23:30 -0600)]
rockchip: Use 'select' instead of defaults in Kconfig

Rockchip uses driver model for all subsystems. Specify this in the arm
Kconfig rather than as defaults in the Rockchip Kconfig. This means that
boards cannot turn these options off, which seems correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agodm: mmc: dwmmc: Add comments to the dwmmc setup functions
Simon Glass [Mon, 13 Jun 2016 05:30:13 +0000 (23:30 -0600)]
dm: mmc: dwmmc: Add comments to the dwmmc setup functions

These comments were missed when the original code was written. Add them to
help people port their drivers over.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoPrepare v2016.07 v2016.07
Tom Rini [Mon, 11 Jul 2016 19:01:01 +0000 (15:01 -0400)]
Prepare v2016.07

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agodoc: ARMv8: add README.pine64
Andre Przywara [Fri, 8 Jul 2016 14:25:23 +0000 (15:25 +0100)]
doc: ARMv8: add README.pine64

Since we lack information about the DRAM initialization for the
Allwinner A64 SoC, booting any A64 based board like the Pine64 is a bit
involved at the moment.
Add a README file to explain the process.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Move to board/sunxi/ from doc/]
Signed-off-by: Tom Rini <trini@konsulko.com>