Commit Graph

38687 Commits

Author SHA1 Message Date
Simon Glass d22199b166 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>
2016-07-14 20:40:24 -06:00
Simon Glass efefe1221b 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>
2016-07-14 20:40:24 -06:00
Simon Glass fd1c2d9b6a 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>
2016-07-14 20:40:24 -06:00
Simon Glass 7d23b9cf2b 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>
2016-07-14 20:40:24 -06:00
Simon Glass e24091398d 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>
2016-07-14 20:40:24 -06:00
Simon Glass 162a7a4217 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>
2016-07-14 20:40:24 -06:00
Simon Glass 76bce10d21 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>
2016-07-14 20:40:24 -06:00
Simon Glass dbbe2e6401 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>
2016-07-14 20:40:24 -06:00
Simon Glass 69f2ed7746 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>
2016-07-14 20:40:24 -06:00
Simon Glass ec564b47da 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>
2016-07-14 20:40:24 -06:00
Simon Glass 39782afb1a 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>
2016-07-14 20:40:24 -06:00
Simon Glass 2789ddb9d5 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>
2016-07-14 20:40:24 -06:00
Simon Glass 7a53a54073 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>
2016-07-14 20:40:24 -06:00
Simon Glass b484b0daef 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>
2016-07-14 20:40:24 -06:00
Simon Glass 7423daa60e 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>
2016-07-14 20:40:24 -06:00
Simon Glass f24770d812 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>
2016-07-14 20:40:24 -06:00
Simon Glass bab8233a1d 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>
2016-07-14 20:40:24 -06:00
Simon Glass 04ecf36ba6 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>
2016-07-14 20:40:24 -06:00
Simon Glass 3b2a29e097 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>
2016-07-14 20:40:24 -06:00
Simon Glass 29629eb897 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>
2016-07-14 20:40:24 -06:00
Simon Glass 054b3a1e80 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>
2016-07-14 20:40:24 -06:00
Simon Glass d223e0a822 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>
2016-07-14 20:40:24 -06:00
Simon Glass a091a8f084 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>
2016-07-14 20:40:24 -06:00
Simon Glass 8797b2cae3 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>
2016-07-14 20:40:24 -06:00
Simon Glass 0110f509c8 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>
2016-07-14 20:40:24 -06:00
Simon Glass 1c12bcee70 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>
2016-07-14 20:40:24 -06:00
Simon Glass e961a66df9 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>
2016-07-14 20:40:24 -06:00
Simon Glass d0d0746e0c 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>
2016-07-14 20:40:24 -06:00
Simon Glass a7d9caecd7 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>
2016-07-14 20:40:24 -06:00
Simon Glass f4289cbd8a 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>
2016-07-14 20:40:24 -06:00
Simon Glass 6e20650425 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>
2016-07-14 20:40:24 -06:00
Simon Glass 4cfc416701 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>
2016-07-14 20:40:24 -06:00
Simon Glass d4e33f5a72 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>
2016-07-14 20:40:24 -06:00
Simon Glass 72a7e07604 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>
2016-07-14 20:40:24 -06:00
Simon Glass 12c550d4fb 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>
2016-07-14 20:40:24 -06:00
Simon Glass 392853260d 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>
2016-07-14 20:40:24 -06:00
Simon Glass 7fcdac0ee9 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>
2016-07-14 20:40:24 -06:00
Simon Glass 36b898b6be 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>
2016-07-14 18:33:11 -04:00
Simon Glass bcc53bf095 arm: Show cache warnings in U-Boot proper only
Avoid bloating the SPL image size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 18:33:11 -04:00
Simon Glass 982868264e 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>
2016-07-14 18:33:11 -04:00
Simon Glass 5e7f743324 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>
2016-07-14 18:33:10 -04:00
Simon Glass 6b424611a8 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>
2016-07-14 18:33:10 -04:00
Simon Glass 397b5697ad 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>
2016-07-14 18:33:09 -04:00
Anatolij Gustschin ba169d981f 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>
2016-07-14 18:33:09 -04:00
Anatolij Gustschin 46d7a3b3d3 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>
2016-07-14 18:33:08 -04:00
Sekhar Nori 0ec807b2d8 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>
2016-07-14 18:22:45 -04:00
Lokesh Vutla 663f6fcaf0 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>
2016-07-14 18:22:45 -04:00
Teddy Reed b6fefa76d0 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>
2016-07-14 18:22:44 -04:00
Hector Palacios 19e8649e59 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>
2016-07-14 18:22:44 -04:00
Toshifumi NISHINAGA 4b2fd720a7 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>
2016-07-14 18:22:44 -04:00