]> git.kernelconcepts.de Git - karo-tx-uboot.git/log
karo-tx-uboot.git
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agortc: Tidy up the code style
Simon Glass [Mon, 20 Jun 2016 01:51:00 +0000 (19:51 -0600)]
rtc: Tidy up the code style

This code generates lots of checkpatch errors. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoarm: Show cache warnings in U-Boot proper only
Simon Glass [Mon, 20 Jun 2016 01:43:05 +0000 (19:43 -0600)]
arm: Show cache warnings in U-Boot proper only

Avoid bloating the SPL image size.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoAdd warn_non_spl() to show a message in U-Boot proper
Simon Glass [Mon, 20 Jun 2016 01:43:04 +0000 (19:43 -0600)]
Add warn_non_spl() to show a message in U-Boot proper

SPL tends to be more space-constrained that U-Boot proper. Some error
messages are best suppressed in SPL. Add a macros to make this easy.

warn_non_spl() does nothing when built in SPL code.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoAdd comments for debug() and pr_fmt
Simon Glass [Mon, 20 Jun 2016 01:43:03 +0000 (19:43 -0600)]
Add comments for debug() and pr_fmt

Add a note to each of these so it is more obvious how they work.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoarm: Don't invalidate unaligned cache regions
Simon Glass [Mon, 20 Jun 2016 01:43:02 +0000 (19:43 -0600)]
arm: Don't invalidate unaligned cache regions

At present armv7 will unhappily invalidate a cache region and print an
error message. Make it skip the operation instead, as it does with other
cache operations.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoarm: Move check_cache_range() into a common place
Simon Glass [Mon, 20 Jun 2016 01:43:01 +0000 (19:43 -0600)]
arm: Move check_cache_range() into a common place

This code is common, so move it into a common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoboard_f: prevent misleading "Watchdog enabled" output
Anatolij Gustschin [Mon, 13 Jun 2016 12:24:24 +0000 (14:24 +0200)]
board_f: prevent misleading "Watchdog enabled" output

Output the "Watchdog enabled" message only if hw_watchdog_init()
call really happened.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
7 years agoboard_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=y
Anatolij Gustschin [Mon, 13 Jun 2016 12:24:23 +0000 (14:24 +0200)]
board_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=y

The designware watchdog init is skipped even if CONFIG_DESIGNWARE_WATCHDOG
is enabled. Fix it.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
7 years agoconfigs: da850evm: enable bootz command
Sekhar Nori [Tue, 12 Jul 2016 10:54:48 +0000 (16:24 +0530)]
configs: da850evm: enable bootz command

Enable bootz command on Texas Instruments DA850 EVM
board. This helps it boot zImage with device-tree
blob passed.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
7 years agoARM: OMAP5+: Enable errata i727
Lokesh Vutla [Tue, 12 Jul 2016 09:17:41 +0000 (14:47 +0530)]
ARM: OMAP5+: Enable errata i727

Errata i727 is applicable on all OMAP5 and DRA7 variants but enabled only
on OMAP5 ES1.0. So, enable it on all platforms.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: fix missing break for -p switch
Teddy Reed [Tue, 12 Jul 2016 05:54:26 +0000 (22:54 -0700)]
mkimage: fix missing break for -p switch

Signed-off-by: Teddy Reed <teddy.reed@gmail.com>
Reported-by: Coverity (CID: 150277)
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agobootm: fixup silent Linux out of BOOTM_STATE_LOADOS state
Hector Palacios [Mon, 11 Jul 2016 10:34:37 +0000 (12:34 +0200)]
bootm: fixup silent Linux out of BOOTM_STATE_LOADOS state

The function fixup_silent_linux() is called in status BOOTM_STATE_LOADOS
to silence Linux if variable 'silent' is set.
Currently only the 'bootm' command state machine contains
BOOTM_STATE_LOADOS, but others like 'booti' or 'bootz' commands do not.
This means silent Linux does not work with these commands.

This patch moves the fixup_silent_linux() call out of the
BOOTM_STATE_LOADOS state and into BOOTM_STATE_OS_PREP, to silence Linux
independently of the used command (booti, bootm or bootz).

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
7 years agostm32: Change USART port to USART6 for stm32f746 discovery board
Toshifumi NISHINAGA [Thu, 7 Jul 2016 16:02:26 +0000 (01:02 +0900)]
stm32: Change USART port to USART6 for stm32f746 discovery board

This change is to remove a halt at about 200KiB
while sending a large(1MiB) binary to a micro controller using USART1.
USART1 is connected to a PC via an on-board ST-Link debugger
that also functions as a USB-Serial converter.
However, it seems to loss some data occasionally.
So I changed the serial port to USART6 and connected it to the PC using
an FTDI USB-Serial cable, therefore the transmission was successfully
completed.

Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
7 years agostm32: Add SDRAM support for stm32f746 discovery board
Toshifumi NISHINAGA [Thu, 7 Jul 2016 16:02:25 +0000 (01:02 +0900)]
stm32: Add SDRAM support for stm32f746 discovery board

This patch adds SDRAM support for stm32f746 discovery board.
This patch depends on previous patch.
This patch is based on STM32F4 and emcraft's[1].

[1]:  https://github.com/EmcraftSystems/u-boot

Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
7 years agostm32: clk: Add 200MHz clock configuration for stm32f746 discovery board
Toshifumi NISHINAGA [Thu, 7 Jul 2016 16:02:24 +0000 (01:02 +0900)]
stm32: clk: Add 200MHz clock configuration for stm32f746 discovery board

This patch adds 200MHz clock configuration for stm32f746 discovery board.
This patch is based on STM32F4 and emcraft's[1].

[1]:  https://github.com/EmcraftSystems/u-boot

Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
7 years agodragonboard410c: adding missing default addr for script and pxe boot
Ricardo Salveti de Araujo [Sun, 3 Jul 2016 17:16:03 +0000 (14:16 -0300)]
dragonboard410c: adding missing default addr for script and pxe boot

Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net>
7 years agodragonboard410c: prefer sdcard boot over emmc
Ricardo Salveti de Araujo [Sun, 3 Jul 2016 16:59:01 +0000 (13:59 -0300)]
dragonboard410c: prefer sdcard boot over emmc

Make the external devices the preferred ones when booting the system
(usb is already the first option). This allows users to easily boot
custom distributions without requiring them to reflash/customize u-boot.

Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Andreas Färber <afaerber@suse.de>
Acked-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
7 years agotest: Convert the vboot test to test/py
Simon Glass [Sun, 3 Jul 2016 15:40:46 +0000 (09:40 -0600)]
test: Convert the vboot test to test/py

Now that we have a suitable test framework we should move all tests into it.
The vboot test is a suitable candidate. Rewrite it in Python and move the
data files into an appropriate directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agotools: Correct error handling in fit_image_process_hash()
Simon Glass [Sun, 3 Jul 2016 15:40:44 +0000 (09:40 -0600)]
tools: Correct error handling in fit_image_process_hash()

We should not be returning -1 as an error code. This can mask a situation
where we run out of space adding things to the FIT. By returning the correct
error in this case (-ENOSPC) it can be handled by the higher-level code.

This may fix the error reported by Tom Van Deun here:

https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html

although I am not sure as I cannot actually repeat it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Van Deun <tom.vandeun@wapice.com>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotools: Add an error code when fit_handle_file() fails
Simon Glass [Sun, 3 Jul 2016 15:40:43 +0000 (09:40 -0600)]
tools: Add an error code when fit_handle_file() fails

The error code may provide useful information for debugging. Add it to the
error string.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Add a helper to run a list of U-Boot commands
Simon Glass [Sun, 3 Jul 2016 15:40:42 +0000 (09:40 -0600)]
test/py: Add a helper to run a list of U-Boot commands

Some tests want to execute a sequence of commands. Add a helper for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Provide a way to check that a command fails
Simon Glass [Sun, 3 Jul 2016 15:40:41 +0000 (09:40 -0600)]
test/py: Provide a way to check that a command fails

Sometimes we want to run a command and check that it fails. Add a function
to handle this. It can check the return code and also make sure that the
output contains a given error message.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agotest/py: Add an option to execute a string containing a command
Simon Glass [Sun, 3 Jul 2016 15:40:40 +0000 (09:40 -0600)]
test/py: Add an option to execute a string containing a command

It is sometimes inconvenient to convert a string into a list for execution
with run_and_log(). Provide a helper function to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Return output from run_and_log()
Simon Glass [Sun, 3 Jul 2016 15:40:39 +0000 (09:40 -0600)]
test/py: Return output from run_and_log()

It is useful to be able to obtain the output from a command. Return it from
this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Provide output from exceptions with RunAndLog()
Simon Glass [Sun, 3 Jul 2016 15:40:38 +0000 (09:40 -0600)]
test/py: Provide output from exceptions with RunAndLog()

Tests may want to look at the output from running a command, even if it
fails (e.g. with a non-zero return code). Provide a means to obtain this.

Another approach would be to return a class object containing both the
output and the exception, but I'm not sure if that would result in a lot
of refactoring.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Allow RunAndLog() to return the output
Simon Glass [Sun, 3 Jul 2016 15:40:37 +0000 (09:40 -0600)]
test/py: Allow RunAndLog() to return the output

Tests may want to look at the output from running a command. Return it so
that this is possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest/py: Allow tests to control the sandbox device-tree file
Simon Glass [Sun, 3 Jul 2016 15:40:36 +0000 (09:40 -0600)]
test/py: Allow tests to control the sandbox device-tree file

Normally tests will run with the test.dtb file designed for this purpose.
However, the verified boot tests need to run with their own device-tree
file, containing a public key.

Make the device-tree file a config option so that it can be adjusted by
tests. The default is to keep the current behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agosandbox: Don't exit when bootm completes
Simon Glass [Sun, 3 Jul 2016 15:40:35 +0000 (09:40 -0600)]
sandbox: Don't exit when bootm completes

At present sandbox exits when the 'bootm' command completes, since it is not
actually able to run the OS that is loaded. Normally 'bootm' failure is
considered a fatal error in U-Boot.

However this is annoying for tests, which may want to examine the state
after a test is complete. In any case there is a 'reset' command which can
be used to exit, if required.

Change the behaviour to return normally from the 'bootm' command on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest: Add a simple script to run tests on sandbox
Simon Glass [Sun, 3 Jul 2016 15:40:34 +0000 (09:40 -0600)]
test: Add a simple script to run tests on sandbox

A common check before sending patches is to run all available tests on
sandbox. But everytime I do this I have to look up the README. This presents
quite a barrier to actually doing this.

Add a shell script to help. To run the tests, type:

   test/run

in the U-Boot directory, which should be easy to remember.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotest: Add a README
Simon Glass [Sun, 3 Jul 2016 15:40:33 +0000 (09:40 -0600)]
test: Add a README

Add a few notes about how testing works in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
7 years agotools: Allow building with debug enabled
Simon Glass [Thu, 30 Jun 2016 16:52:20 +0000 (10:52 -0600)]
tools: Allow building with debug enabled

Sometimes it is useful to build tools with debugging information included so
that line-number information is available when run under gdb. Add a Kconfig
option to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Show item lists for all categories
Simon Glass [Thu, 30 Jun 2016 16:52:19 +0000 (10:52 -0600)]
mkimage: Show item lists for all categories

Update the error-handling code for -A, -C and -O to show a list of valid
options when an invalid one is provided.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Vinoth Eswaran <evinoth1206@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Use generic code for showing an 'image type' error
Simon Glass [Thu, 30 Jun 2016 16:52:18 +0000 (10:52 -0600)]
mkimage: Use generic code for showing an 'image type' error

The existing error code only displays image types which are claimed by a
particular U_BOOT_IMAGE_TYPE() driver. But this does not seem correct. The
mkimage tool should support all image types, so it makes sense to allow
creation of images of any type with the tool.

When an incorrect image type is provided, use generic code to display the
error.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Allow display of a list of any image header category
Simon Glass [Thu, 30 Jun 2016 16:52:17 +0000 (10:52 -0600)]
mkimage: Allow display of a list of any image header category

Add a generic function which can display a list of items in any category.
This will allow displaying of images for the -A, -C, -O and -T flags. At
present only -T is supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Add functions to obtain category information
Simon Glass [Thu, 30 Jun 2016 16:52:16 +0000 (10:52 -0600)]
image: Add functions to obtain category information

Add generic functions which can look up information about a category:

- the number of items in the category
- the category description
- an item long time
- an item short time

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Add a name for invalid types
Simon Glass [Thu, 30 Jun 2016 16:52:15 +0000 (10:52 -0600)]
image: Add a name for invalid types

At present the name is NULL, which prevents qsort() fromp being used. Use
the name "invalid" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Create a table of information for each category
Simon Glass [Thu, 30 Jun 2016 16:52:14 +0000 (10:52 -0600)]
image: Create a table of information for each category

Add a table that contains the category name, the number of items in each
category and a pointer to the table of items. This will allow us to use
generic code to deal with the categories.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Convert the IH_... values to enums
Simon Glass [Thu, 30 Jun 2016 16:52:13 +0000 (10:52 -0600)]
image: Convert the IH_... values to enums

We need to know the number of values of each category (architecture,
compression, OS and image type). To make this value easier to maintain,
convert all values to enums. The count is then automatic.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Correct auto-fit architecture property name
Simon Glass [Thu, 30 Jun 2016 16:52:12 +0000 (10:52 -0600)]
image: Correct auto-fit architecture property name

The fit_write_images() function incorrectly uses the long name for the
architecture. This cannot be parsed with the FIT is read. Fix this by using
the short name instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Drop blank line before main()
Simon Glass [Thu, 30 Jun 2016 16:52:11 +0000 (10:52 -0600)]
mkimage: Drop blank line before main()

This is not needed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Drop premature setting of params.fit_image_type
Simon Glass [Thu, 30 Jun 2016 16:52:10 +0000 (10:52 -0600)]
mkimage: Drop premature setting of params.fit_image_type

There is no need to set params.fit_image_type while parsing the arguments.
It is set up later anyway.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Require a data file when auto-fit is used
Simon Glass [Thu, 30 Jun 2016 16:52:09 +0000 (10:52 -0600)]
mkimage: Require a data file when auto-fit is used

When auto-fit is used, it is not valid to create a FIT without an image
file. Add a check for this to avoid a very confusing error message later
("Can't open (null): Bad address").

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agomkimage: Explain the auto-fit imagefile special case
Simon Glass [Thu, 30 Jun 2016 16:52:08 +0000 (10:52 -0600)]
mkimage: Explain the auto-fit imagefile special case

There is a special case in the code when auto-fit is used. Add a comment to
make it easier to understand why this is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agomkimage: Honour the default image type with auto-fit
Simon Glass [Thu, 30 Jun 2016 16:52:07 +0000 (10:52 -0600)]
mkimage: Honour the default image type with auto-fit

The default image type is supposed to be IH_TYPE_KERNEL, as set in the
'params' variable. Honour this with auto-fit also.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agolinux/io.h: add generic ioremap()/iounmap() defines
Masahiro Yamada [Tue, 28 Jun 2016 01:48:42 +0000 (10:48 +0900)]
linux/io.h: add generic ioremap()/iounmap() defines

For most of architectures in U-Boot, virtual address is straight
mapped to physical address.  So, it makes sense to have generic
defines of ioremap and friends in <linux/io.h>.

All of them are just empty and will disappear at compile time, but
they will be helpful to implement drivers which are counterparts of
Linux ones.

I notice MIPS already has its own implementation, so I added a
Kconfig symbol CONFIG_HAVE_ARCH_IOREMAP which MIPS (and maybe
Sandbox as well) can select.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7 years agoarm, nds32, sh: remove useless ioremap()/iounmap() defines
Masahiro Yamada [Tue, 28 Jun 2016 01:48:41 +0000 (10:48 +0900)]
arm, nds32, sh: remove useless ioremap()/iounmap() defines

These defines are valid only when iomem_valid_addr is defined,
but I do not see such defines anywhere.  Remove.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agotypes.h: move and redefine resource_size_t
Masahiro Yamada [Tue, 28 Jun 2016 01:48:40 +0000 (10:48 +0900)]
types.h: move and redefine resource_size_t

Currently, this is only defined in arch/arm/include/asm/types.h,
so move it to include/linux/types.h to make it available for all
architectures.

I defined it with phys_addr_t as Linux does.  I needed to surround
the define with #ifdef __KERNEL__ ... #endif to avoid build errors
in tools building.  (Host tools should not include <linux/types.h>
in the first place, but this is already messy in U-Boot...)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodoc: Update info on using secure devices from TI
Andreas Dannenberg [Mon, 27 Jun 2016 14:19:24 +0000 (09:19 -0500)]
doc: Update info on using secure devices from TI

Adds information regarding SPL handling the loading and processing of
secured u-boot images as part of the second stage boot the SPL does.
Introduces the description of a new interface script in the TI SECDEV
Package which handles the creation and prep of secured binary images.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoarm: am4x: add U-Boot FIT signing and SPL image post-processing
Madan Srinivas [Mon, 27 Jun 2016 14:19:23 +0000 (09:19 -0500)]
arm: am4x: add U-Boot FIT signing and SPL image post-processing

Modify the SPL build procedure for AM437x high-security (HS) device
variants to create a secure u-boot_HS.img FIT blob that contains U-Boot
and DTB artifacts signed (and optionally encrypted) with a TI-specific
process based on the CONFIG_TI_SECURE_DEVICE config option and the
externally-provided image signing tool.

Also populate the corresponding FIT image post processing call to be
performed during SPL runtime.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap5: add U-Boot FIT signing and SPL image post-processing
Andreas Dannenberg [Mon, 27 Jun 2016 14:19:22 +0000 (09:19 -0500)]
arm: omap5: add U-Boot FIT signing and SPL image post-processing

Modify the SPL build procedure for AM57xx and DRA7xx high-security (HS)
device variants to create a secure u-boot_HS.img FIT blob that contains
U-Boot and DTB artifacts signed with a TI-specific process based on the
CONFIG_TI_SECURE_DEVICE config option and the externally-provided image
signing tool.

Also populate the corresponding FIT image post processing call to be
performed during SPL runtime.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agospl: fit: add support for post-processing of images
Daniel Allred [Mon, 27 Jun 2016 14:19:21 +0000 (09:19 -0500)]
spl: fit: add support for post-processing of images

The next stage boot loader image and the selected FDT can be post-
processed by board/platform/device-specific code, which can include
modifying the size and altering the starting source address before
copying these binary blobs to their final destination. This might be
desired to do things like strip headers or footers attached to the
images before they were packaged into the FIT, or to perform operations
such as decryption or authentication. Introduce new configuration
option CONFIG_SPL_FIT_IMAGE_POST_PROCESS to allow controlling this
feature. If enabled, a platform-specific post-process function must
be provided.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoarm: omap-common: Update to generate secure U-Boot FIT blob
Andreas Dannenberg [Mon, 27 Jun 2016 14:19:20 +0000 (09:19 -0500)]
arm: omap-common: Update to generate secure U-Boot FIT blob

Adds commands so that when a secure device is in use and the SPL is
built to load a FIT image (with combined U-Boot binary and various
DTBs), these components that get fed into the FIT are all processed to
be signed/encrypted/etc. as per the operations performed by the
secure-binary-image.sh script of the TI SECDEV package. Furthermore,
perform minor comments cleanup to make better use of the available
space.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoarm: omap-common: secure ROM signature verify API
Andreas Dannenberg [Mon, 27 Jun 2016 14:19:19 +0000 (09:19 -0500)]
arm: omap-common: secure ROM signature verify API

Adds an API that verifies a signature attached to an image (binary
blob). This API is basically a entry to a secure ROM service provided by
the device and accessed via an SMC call, using a particular calling
convention.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap-common: add secure rom call API for secure devices
Andreas Dannenberg [Mon, 27 Jun 2016 14:19:18 +0000 (09:19 -0500)]
arm: omap-common: add secure rom call API for secure devices

Adds a generic C-callable API for making secure ROM calls on OMAP and
OMAP-compatible devices. This API provides the important function of
flushing the ROM call arguments to memory from the cache, so that the
secure world will have a coherent view of those arguments. Then is
simply calls the omap_smc_sec routine.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap-common: add secure smc entry
Daniel Allred [Mon, 27 Jun 2016 14:19:17 +0000 (09:19 -0500)]
arm: omap-common: add secure smc entry

Add an interface for calling secure ROM APIs across a range of OMAP and
OMAP compatible high-security (HS) device variants. While at it, also
perform minor cleanup/alignment without any change in functionality.

Signed-off-by: Daniel Allred <d-allred@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>