oweals/u-boot.git
8 years agovexpress64: Add MMU tables
Alexander Graf [Fri, 4 Mar 2016 00:09:51 +0000 (01:09 +0100)]
vexpress64: Add MMU tables

There's no good excuse for running with caches disabled on AArch64,
so let's just move the vexpress64 target to enable the MMU and run
with caches on.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agotegra: Replace home grown mmu code with generic table approach
Alexander Graf [Fri, 4 Mar 2016 00:09:50 +0000 (01:09 +0100)]
tegra: Replace home grown mmu code with generic table approach

Now that we have nice table driven page table creating code that gives
us everything we need, move to that.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agozymqmp: Replace home grown mmu code with generic table approach
Alexander Graf [Fri, 4 Mar 2016 00:09:49 +0000 (01:09 +0100)]
zymqmp: Replace home grown mmu code with generic table approach

Now that we have nice table driven page table creating code that gives
us everything we need, move to that.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agothunderx: Move mmu table into board file
Alexander Graf [Fri, 4 Mar 2016 00:09:48 +0000 (01:09 +0100)]
thunderx: Move mmu table into board file

The MMU range table can vary depending on things we may only find
out at runtime. While the very simple ThunderX variant does not
change, other boards will, so move the definition from a static
entry in a header file to the board file.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoarm64: Make full va map code more dynamic
Alexander Graf [Fri, 4 Mar 2016 00:09:47 +0000 (01:09 +0100)]
arm64: Make full va map code more dynamic

The idea to generate our pages tables from an array of memory ranges
is very sound. However, instead of hard coding the code to create up
to 2 levels of 64k granule page tables, we really should just create
normal 4k page tables that allow us to set caching attributes on 2M
or 4k level later on.

So this patch moves the full_va mapping code to 4k page size and
makes it fully flexible to dynamically create as many levels as
necessary for a map (including dynamic 1G/2M pages). It also adds
support to dynamically split a large map into smaller ones when
some code wants to set dcache attributes.

With all this in place, there is very little reason to create your
own page tables in board specific files.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agoarm64: Disable TTBR1 maps in EL1
Alexander Graf [Fri, 4 Mar 2016 00:09:46 +0000 (01:09 +0100)]
arm64: Disable TTBR1 maps in EL1

When running in EL1, AArch64 knows two page table maps. One with addresses
that start with all zeros (TTBR0) and one with addresses that start with all
ones (TTBR1).

In U-Boot we don't care about the high up maps, so just disable them to ensure
we don't walk an invalid page table by accident.

Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agothunderx: Calculate TCR dynamically
Alexander Graf [Fri, 4 Mar 2016 00:09:45 +0000 (01:09 +0100)]
thunderx: Calculate TCR dynamically

Based on the memory map we can determine a lot of hard coded fields of
TCR, like the maximum VA and max PA we want to support. Calculate those
dynamically to reduce the chance for pit falls.

Signed-off-by: Alexander Graf <agraf@suse.de>
8 years agokc1: Clear reboot mode garbage on cold reset
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:15 +0000 (19:19 +0100)]
kc1: Clear reboot mode garbage on cold reset

Reboot mode garbage is found on cold reset and might be seen as valid on the
next warm reset, thus it has to be cleared on cold reset.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agokc1: Power off when the power on reason is not a valid one
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:14 +0000 (19:19 +0100)]
kc1: Power off when the power on reason is not a valid one

Some power on reasons are not desirable (e.g. too short press on the power
button), battery plug. Thus, power off the device when one of those occurs.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoinput: TWL6030 input support for power button, USB and charger
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:13 +0000 (19:19 +0100)]
input: TWL6030 input support for power button, USB and charger

This adds support for detecting a few inputs exported by the TWL6030.
Currently-supported inputs are the power button, USB and charger presence.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Power off support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:12 +0000 (19:19 +0100)]
power: twl6030: Power off support

This adds support for powering off (the omap SoC) from the twl6030.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Remove ifdef around the code
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:11 +0000 (19:19 +0100)]
power: twl6030: Remove ifdef around the code

The TWL6030 power driver is only built when CONFIG_TWL6030_POWER is selected,
thus there is no reason to wrap the code with ifdef.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agokc1: Boot to bootloader (fastboot) on ID pin pull-up
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:10 +0000 (19:19 +0100)]
kc1: Boot to bootloader (fastboot) on ID pin pull-up

USB ID pin pull-up indicates factory (fastboot) cable detection.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agokc1: OMAP4 reboot mode support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:09 +0000 (19:19 +0100)]
kc1: OMAP4 reboot mode support

This adds support for the omap4 reboot mode mechanism and exports the reboot
mode via an environment variable, that is used in the boot command to make it
possible to boot from the recovery partition or fastboot.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Check warm reset for reboot mode validity
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:08 +0000 (19:19 +0100)]
omap4: Check warm reset for reboot mode validity

Since the SAR registers are filled with garbage on cold reset, this checks for a
warm reset to assert the validity of reboot mode.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Reboot mode support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:07 +0000 (19:19 +0100)]
omap4: Reboot mode support

Reboot mode is written to SAR memory before reboot in the form of a string.

This mechanism is supported on OMAP4 by various TI kernels.

It is up to each board to make use of this mechanism or not.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agokc1: MUSB USB controller and fastboot USB gadget support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:06 +0000 (19:19 +0100)]
kc1: MUSB USB controller and fastboot USB gadget support

This adds support for the MUSB USB dual-role controller in peripheral mode,
with configuration options for the fastboot USB gadget.

At this point, flashing the internal eMMC is support.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agousb: musb-new: omap2430: OMAP4 MUSB USB controller support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:05 +0000 (19:19 +0100)]
usb: musb-new: omap2430: OMAP4 MUSB USB controller support

This adds support for the OMAP4 MUSB USB controller, with a matching Linux
compat definition, TWL6030 USB device setup and USBOTGHS register setup.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Clear VUSB_IN_PMID bit on USB device setup
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:04 +0000 (19:19 +0100)]
power: twl6030: Clear VUSB_IN_PMID bit on USB device setup

When booting from USB, the bootrom sets the VUSB_IN_PMID bit of the MISC2
register of the TWL6030. However, U-Boot sets the VUSB_IN_VSYS bit to enable
VBUS input. As both bits are contradictory, enabling both disables the input,
according to the TWL6030 TRM.

Thus, we need to clear the VUSB_IN_PMID bit in case of an USB boot (which could
just as well be a memory boot after USB timed out).

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Configure VUSB voltage on USB device setup
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:03 +0000 (19:19 +0100)]
power: twl6030: Configure VUSB voltage on USB device setup

This explicitly sets VUSB voltage to 3.3V when enabling USB.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Properly enable USB PHY clocks
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:02 +0000 (19:19 +0100)]
omap4: Properly enable USB PHY clocks

This correctly enables the USB PHY clocks, by enabling CM_ALWON_USBPHY_CLKCTRL
and correctly setting CM_L3INIT_USBPHY_CLKCTRL's value.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap-common: clocks-common: Setup USB DPLL when MUSB is in use
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:01 +0000 (19:19 +0100)]
omap-common: clocks-common: Setup USB DPLL when MUSB is in use

On (at least) OMAP4, the USB DPLL is required to be setup for the internal PHY
to work properly. The internal PHY is used by default with the MUSB USB OTG
controller.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoAmazon Kindle Fire (first generation) codename kc1 support
Paul Kocialkowski [Sat, 27 Feb 2016 18:19:00 +0000 (19:19 +0100)]
Amazon Kindle Fire (first generation) codename kc1 support

The Amazon Kindle Fire (first generation) codename kc1 is a tablet that was
released by Amazon back in 2011.

It is using an OMAP4430 SoC GP version, which allows running U-Boot and the
U-Boot SPL from the ground up.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Move i2c clocks enable to enable_basic_clocks
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:59 +0000 (19:18 +0100)]
omap4: Move i2c clocks enable to enable_basic_clocks

I2C is often enabled withing the U-Boot SPL, thus those clocks are required to
be enabled early (especially when the bootrom doesn't enable them for us).

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Remove duplicate CM_L3INIT_USBPHY_CLKCTRL reference and whitespace
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:58 +0000 (19:18 +0100)]
omap4: Remove duplicate CM_L3INIT_USBPHY_CLKCTRL reference and whitespace

This removes a duplicate reference to CM_L3INIT_USBPHY_CLKCTRLin
enable_basic_uboot_clocks. Also, a doubled whitespace is removed.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap-common: Remove deprecated arch_cpu_init code
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:57 +0000 (19:18 +0100)]
omap-common: Remove deprecated arch_cpu_init code

save_omap_boot_params is called from spl_board_init in the SPL context. Thus,
there is no reason to duplicate that call on arch_cpu_init.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap-common: Rename set_muxconf_regs_essential to set_muxconf_regs
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:56 +0000 (19:18 +0100)]
omap-common: Rename set_muxconf_regs_essential to set_muxconf_regs

There is no distinction between essential and non-essential mux configuration,
so it doesn't make sense to have an "essential" prefix.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Export jedec sdram timings
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:55 +0000 (19:18 +0100)]
omap4: Export jedec sdram timings

Individual boards might provide their own emif_get_device_timings function and
use the jedec timings in their own way, hence those have to be exported.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Export elpidia sdram timings
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:54 +0000 (19:18 +0100)]
omap4: Export elpidia sdram timings

Individual boards might provide their own emif_get_device_timings function and
use the elpidia timings in their own way, hence those have to be exported.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap4: Export elpidia sdram device details
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:53 +0000 (19:18 +0100)]
omap4: Export elpidia sdram device details

Individual boards might provide their own emif_get_device_details function and
use elpidia device details in their own way, hence those have to be exported.

This also wraps existing definitions with the proper ifdef logic.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agoomap_hsmmc: Board-specific TWL6030 MMC power initialization
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:52 +0000 (19:18 +0100)]
omap_hsmmc: Board-specific TWL6030 MMC power initialization

Boards using the TWL6030 regulator may not all use the LDOs the same way.
Some might also not use MMC1 at all, so VMMC would't have to be enabled.

This delegates TWL6030 MMC power initializations to board-specific functions,
that may still call twl6030_power_mmc_init for the default behavior.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Device-index-specific MMC power initialization
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:51 +0000 (19:18 +0100)]
power: twl6030: Device-index-specific MMC power initialization

Not every device has multiple MMC slots available, so it makes sense to enable
only the required LDOs for the available slots. Generic code in omap_hsmmc will
enable both VMMC and VAUX1, in doubt.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Enable VAUX1 for eMMC power, depending on BOOT2 value
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:50 +0000 (19:18 +0100)]
power: twl6030: Enable VAUX1 for eMMC power, depending on BOOT2 value

This enables the VAUX1 supply, used for eMMC power in standard configurations.
Its voltage is determined by the value of the BOOT2 pin of the TWL6030.

Note that the TWL6030 might already have enabled this regulator at startup
(depending on the value of the BOOT3 pin of the TWL6030), according to the
TWL6030 datasheet.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agopower: twl6030: Some more explicit registers and values definitions
Paul Kocialkowski [Sat, 27 Feb 2016 18:18:49 +0000 (19:18 +0100)]
power: twl6030: Some more explicit registers and values definitions

This makes the twl6030 mmc and usb-related power registers and values
definitions more explicit and clear and adds prefixes to them.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
8 years agosniper: Clear reboot mode garbage on cold reset
Paul Kocialkowski [Sat, 27 Feb 2016 18:26:44 +0000 (19:26 +0100)]
sniper: Clear reboot mode garbage on cold reset

Reboot mode garbage is found on cold reset and might be seen as valid on the
next warm reset, thus it has to be cleared on cold reset.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agosniper: Get rid of reset_misc
Paul Kocialkowski [Sat, 27 Feb 2016 18:26:43 +0000 (19:26 +0100)]
sniper: Get rid of reset_misc

There is no need to set the reboot mode to a particular value prior to reboot,
since valid values will have been caught and cleared earlier.

In addition, this breaks the reboot-bootloader fastboot call, by overriding the
required value for fastboot.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoomap3: Use a define for reboot reason offset
Paul Kocialkowski [Sat, 27 Feb 2016 18:26:42 +0000 (19:26 +0100)]
omap3: Use a define for reboot reason offset

This introduces a define for the offset to the reboot reason, rather than
hardcoding it.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoomap3: String-based reboot mode handling
Paul Kocialkowski [Sat, 27 Feb 2016 18:26:41 +0000 (19:26 +0100)]
omap3: String-based reboot mode handling

This switches reboot mode handling to a string-based interface, that allows more
flexibility to set a common interface with the next generations of OMAP devices.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agospi: omap3: Fix multiple definition of 'priv'
Jagan Teki [Tue, 15 Mar 2016 18:26:33 +0000 (23:56 +0530)]
spi: omap3: Fix multiple definition of 'priv'

Global definition of priv seems no-sense to use it
for non-dm case and pass the pointer to functions
which are common to both dm and non-dm.

So, fix this by removing omap3_spi_slave from non-dm
and make visible to omap3_spi_priv for both dm and non-dm.

Cc: Christophe Ricard <christophe-h.ricard@st.com>
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-video
Tom Rini [Tue, 15 Mar 2016 12:01:17 +0000 (08:01 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-video

8 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Tue, 15 Mar 2016 12:01:04 +0000 (08:01 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

8 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Mon, 14 Mar 2016 23:21:44 +0000 (19:21 -0400)]
Merge git://git.denx.de/u-boot-dm

8 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Mon, 14 Mar 2016 23:21:35 +0000 (19:21 -0400)]
Merge git://git.denx.de/u-boot-marvell

8 years agoarm64: define _image_binary_end to fix SPL_OF_CONTROL
Masahiro Yamada [Tue, 8 Mar 2016 11:34:44 +0000 (20:34 +0900)]
arm64: define _image_binary_end to fix SPL_OF_CONTROL

To make SPL_OF_CONTROL work on ARM64 SoCs, _image_binary_end must be
defined in the linker script.

 LD      spl/u-boot-spl
lib/built-in.o: In function `fdtdec_setup':
lib/fdtdec.c:1186: undefined reference to `_image_binary_end'
lib/fdtdec.c:1186: undefined reference to `_image_binary_end'
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2

Note:
CONFIG_SPL_SEPARATE_BSS must be defined as well on ARM64 SoCs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA72-evm: Update mux and VIRTUAL/MANUAL mode timings
Lokesh Vutla [Tue, 8 Mar 2016 04:40:20 +0000 (10:10 +0530)]
ARM: DRA72-evm: Update mux and VIRTUAL/MANUAL mode timings

All the mux configurations needs to be done as part of the IODelay
sequence to avoid glitch. Adding all the mux configuration, MANUAL/VIRTUAL
mode configuration as needed for DRA72-evm.

Also update the mux for SD card detect on DRA74-evm.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA7-evm: Update memory info in banks
Lokesh Vutla [Tue, 8 Mar 2016 03:48:09 +0000 (09:18 +0530)]
ARM: DRA7-evm: Update memory info in banks

Updating the memory banks properly so that DT is populated accordingly.
And updating this only after DDR is properly detected by eeprom, so that
git bisect is still maintained.

Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: DRA7: EMIF: Add 4GB DDR settings
Lokesh Vutla [Tue, 8 Mar 2016 03:48:08 +0000 (09:18 +0530)]
ARM: DRA7: EMIF: Add 4GB DDR settings

The REVH and later versions of DRA7-evm uses MICRON MT41K512M16HA-125 memory
chips which is of size 4GB(2GB on EMIF1 and 2GB on EMIF2). Add support for the
same.

Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: DRA7: configs: Prepare for detecting memory > 2GB
Lokesh Vutla [Tue, 8 Mar 2016 03:48:07 +0000 (09:18 +0530)]
ARM: DRA7: configs: Prepare for detecting memory > 2GB

Enable configs that are required for detecting memory > 2GB.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: DRA7: Move emif settings to board specific files
Lokesh Vutla [Tue, 8 Mar 2016 03:48:06 +0000 (09:18 +0530)]
ARM: DRA7: Move emif settings to board specific files

The newer versions of DRA7 boards has EEPROM populated with DDR
size specified in it. Moving DRA7 specific emif related settings
to board files so that emif settings can be identified based on EEPROM.

Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: DRA7: Enable EEPROM support
Lokesh Vutla [Tue, 8 Mar 2016 03:48:05 +0000 (09:18 +0530)]
ARM: DRA7: Enable EEPROM support

Enable EEPROM support for DRA74-evm.

Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoti: common: dra7: Add standard access for board description EEPROM
Lokesh Vutla [Tue, 8 Mar 2016 03:48:04 +0000 (09:18 +0530)]
ti: common: dra7: Add standard access for board description EEPROM

DRA7 EVM revH and later EVMs have EEPROM populated that can contain board
description information such as name, revision, DDR definition, etc. Adding
support for this EEPROM format.

Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: AM57xx: Update EMIF registers
Lokesh Vutla [Tue, 8 Mar 2016 03:41:35 +0000 (09:11 +0530)]
ARM: AM57xx: Update EMIF registers

There are certain EMIF timing failures seen on the some x15 boards. Updating
the EMIF settings to get rid of these timing failures.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
8 years agoARM: Various: Future-proof serial platdata
Adam Ford [Tue, 8 Mar 2016 03:08:49 +0000 (21:08 -0600)]
ARM: Various: Future-proof serial platdata

A few boards still use ns16550_platdata structures, but assume the structure
is going to be in a specific order. By explicitly naming each entry,
this should also help 'future-proof' in the event the structure changes.

Tested on the Logic PD Torpedo + Wireless.

I only changed a handful of devices that used the same syntax as the Logic
board.  Appologies if I missed one or stepped on toes.  Thanks to Derald Woods
and Alexander Graf.

Signed-off-by: Adam Ford <aford173@gmail.com>
V6: Add fix to arch/arm/cpu/armv7/am33xx/board.c

V5: Add fix to arch/arm/cpu/arm926ejs/lpc32xx/devices.c

V4: Fix subject heading

V3: Remove  reg_offset out in all the structs. It was reverted out, and and if
it did exist, it would get initialized to 0 by default.

V2: I hastily copy-pasted the boards without looking at the UART number.
This addresses 3 boards that use UART3 and not UART1.
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoARM: OMAP4+: Allow arch specfic code to use early DM
Lokesh Vutla [Mon, 7 Mar 2016 09:19:54 +0000 (14:49 +0530)]
ARM: OMAP4+: Allow arch specfic code to use early DM

Early system initialization is being done before initf_dm is being called
in U-Boot. Then system will fail to boot if any of the DM enabled driver
is being called in this system initialization code. So, rearrange the
code a bit so that DM enabled drivers can be called during early system
initialization.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA7: emif: Enable interleaving for higher address space
Lokesh Vutla [Sat, 5 Mar 2016 12:02:31 +0000 (17:32 +0530)]
ARM: DRA7: emif: Enable interleaving for higher address space

Given that DRA7/OMAP5 SoCs can support more than 2GB of memory,
enable interleaving for this higher memory to increase performance.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA7: emif: Check for enable bits before updating leveling output
Lokesh Vutla [Sat, 5 Mar 2016 12:02:30 +0000 (17:32 +0530)]
ARM: DRA7: emif: Check for enable bits before updating leveling output

Read and write leveling can be enabled independently. Check for these
enable bits before updating the read and write leveling output values.
This will allow to use the combination of software and hardware leveling.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA7: emif: Fix DDR init sequence during warm reset
Lokesh Vutla [Sat, 5 Mar 2016 12:02:29 +0000 (17:32 +0530)]
ARM: DRA7: emif: Fix DDR init sequence during warm reset

Commit (20fae0a - ARM: DRA7: DDR: Enable SR in Power Management Control)
enables Self refresh mode by default and during warm reset the EMIF
contents are preserved. After warm reset EMIF sees that it is idle and
puts DDR in self-refresh. When in SR, leveling operations cannot be done
as DDR can only accept SR exit command, so its hanging during warm reset.
In order to fix this reset the power management control register before
EMIF initialization if it is a warm reset.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: DRA7: emif: Fix updating of refresh ctrl shadow
Lokesh Vutla [Sat, 5 Mar 2016 12:02:28 +0000 (17:32 +0530)]
ARM: DRA7: emif: Fix updating of refresh ctrl shadow

On DRA7, refresh ctrl shadow should be updated with
the final value.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agodm: omap_timer: Fix conversion of address to a pointer
Lokesh Vutla [Sat, 5 Mar 2016 11:10:32 +0000 (16:40 +0530)]
dm: omap_timer: Fix conversion of address to a pointer

OMAP timer driver directly typecasts fdt_addr_t to a pointer. This is
not strictly correct, as it gives a build warning when fdt_addr_t is u64.
So, use map_physmem for a proper typecasts.

This is inspired by commit 167efe01bc5a9 ("dm: ns16550: Use an address
instead of a pointer for the uart base")

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: use detected ddr3a size
Vitaly Andrianov [Fri, 4 Mar 2016 16:36:43 +0000 (10:36 -0600)]
ARM: keystone2: use detected ddr3a size

Because KS2 u-boot works in 32 bit address space the existing ram_size
global data field cannot be used. The maximum, which the get_ram_size()
can detect is 2GB only. The ft_board_setup() needs the actual ddr3 size
to fix up dtb.

This commit introduces the ddr3_get_size() which uses SPD data to
calculate the ddr3 size. This function replaces the "ddr3_size"
environment variable, which was used to get the SODIMM size.

For platforms, which don't have SODIMM with SPD and ddr3 is populated to
a board a simple ddr3_get_size function that returns ddr3 size has to be
implemented. See hardware-k2l.h

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: use SPD info to configure K2HK and K2E DDR3
Vitaly Andrianov [Fri, 4 Mar 2016 16:36:42 +0000 (10:36 -0600)]
ARM: keystone2: use SPD info to configure K2HK and K2E DDR3

This commit replaces hard-coded EMIF and PHY DDR3 configurations for
predefined SODIMMs to a calculated configuration. The SODIMM parameters
are read from SODIMM's SPD and used to calculated the configuration.

The current commit supports calculation for DDR3 with 1600MHz and 1333MHz
only.

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: K2G: Add support for different arm/device speeds
Lokesh Vutla [Fri, 4 Mar 2016 16:36:41 +0000 (10:36 -0600)]
ARM: keystone2: K2G: Add support for different arm/device speeds

The maximum device and arm speeds can be determined by reading
EFUSE_BOOTROM register. As there is already a framework for reading this
register, adding support for all possible speeds on k2g devices.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: Allow for board specific speed definitions
Lokesh Vutla [Fri, 4 Mar 2016 16:36:40 +0000 (10:36 -0600)]
ARM: keystone2: Allow for board specific speed definitions

Its not compulsory that speed definition should be same on EFUSE_BOOTROM
register for all keystone 2 devices. So, allow for board specific
speed definitions.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: K2G: power-off DSP during boot
Suman Anna [Fri, 4 Mar 2016 16:36:39 +0000 (10:36 -0600)]
ARM: keystone2: K2G: power-off DSP during boot

The DSPs are powered on by default upon a Power ON reset, and
they are powered off on current Keystone 2 SoCs - K2HK, K2L, K2E
during the boot in u-boot. This is not functional on K2G though.
Extend the existing DSP power-off support to the only DSP present
on K2G. Do note that the PSC clock domain module id for DSP on K2G
differs from that of previous Keystone2 SoCs.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: Use macro for DSP GEM power domain
Suman Anna [Fri, 4 Mar 2016 16:36:38 +0000 (10:36 -0600)]
ARM: keystone2: Use macro for DSP GEM power domain

Define a macro for the DSP GEM power domain id number and
use it instead of a hard-coded number in the code that
disables all the DSPs on various Keystone2 SoCs.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoinclude/crc.h: Remove unreferenced cyg_xxx() prototypes
Stefan Roese [Thu, 3 Mar 2016 08:34:13 +0000 (09:34 +0100)]
include/crc.h: Remove unreferenced cyg_xxx() prototypes

These cyg_ prototypes are not referenced anywhere in current mainline
U-Boot. So lets remove them.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agolib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value
Stefan Roese [Thu, 3 Mar 2016 08:34:12 +0000 (09:34 +0100)]
lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value

The original name of this function is unclear. This patch renames this
CRC16 function to crc16_ccitt() matching its name with its
implementation.

To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agolib/crc16.c: Coding-style cleanup
Stefan Roese [Thu, 3 Mar 2016 08:34:11 +0000 (09:34 +0100)]
lib/crc16.c: Coding-style cleanup

lib/crc16.c is changed to match the common U-Boot coding-style.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agocommon: image-fit: Fix load and entry addresses in FIT image
York Sun [Mon, 29 Feb 2016 23:48:41 +0000 (15:48 -0800)]
common: image-fit: Fix load and entry addresses in FIT image

FIT image supports more than 32 bits in addresses by using #address-cell
field. Fixing 64-bit support by using this field.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agocommon: image-fit: Use a common function to get address
York Sun [Mon, 29 Feb 2016 23:48:40 +0000 (15:48 -0800)]
common: image-fit: Use a common function to get address

FIT image supports load address and entry address. Getting these
addresses can use a common function.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoarm: Add support for LEGO MINDSTORMS EV3
David Lechner [Fri, 26 Feb 2016 06:46:07 +0000 (00:46 -0600)]
arm: Add support for LEGO MINDSTORMS EV3

This is based on the davinci da850evm. It can boot from either the
on-board 16MB flash or from a microSD card. It also reads board
information from an I2C EEPROM.

The EV3 itself initally boots from write-protected EEPROM, so no
u-boot SPL is needed.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoconfigs: k2g_evm: Add TI power processor support
Nishanth Menon [Thu, 25 Feb 2016 18:53:47 +0000 (12:53 -0600)]
configs: k2g_evm: Add TI power processor support

Enable support for PMMC the TI power processor on K2G. This processor
manages all power management related activities on the SoC and and
allows the Operating Systems on compute processors such as ARM, DSP to
offload the power logic away into the power processor.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: dts: k2g: Add support for PMMC
Nishanth Menon [Thu, 25 Feb 2016 18:53:46 +0000 (12:53 -0600)]
ARM: dts: k2g: Add support for PMMC

Enable support for PMMC the TI power processor on K2G. This processor
manages all power management related activities on the SoC and and
allows the Operating Systems on compute processors such as ARM, DSP to
offload the power logic away into the power processor. U-boot just has a
load responsibility, hence the view of the hardware from a bootloader
perspective is different from the view of hardware from a Operating
System perspective. While bootloader just loads up the firmware,
Operating Systems look at the resultant system as "hardware".

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoremoteproc: Add support for TI power processor
Nishanth Menon [Thu, 25 Feb 2016 18:53:45 +0000 (12:53 -0600)]
remoteproc: Add support for TI power processor

Many TI System on Chip (SoC) solutions do have a dedicated
microcontroller for doing power management functionality. These include
the AM335x, AM437x, Keystone K2G SoCs. The functionality provided by
these microcontrollers and the communication mechanisms vary very
widely. However, we are able to consolidate some basic functionality to
be generic enough starting with K2G SoC family. Introduce a basic remote
proc driver to support these microcontrollers. In fact, on SoCs starting
with K2G, basic power management functions are primarily accessible for
the High Level Operating Systems(HLOS) via these microcontroller solutions.

Hence, having these started at a bootloader level is pretty much
mandatory.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: psc: introduce function to hold and release module in reset.
Nishanth Menon [Thu, 25 Feb 2016 18:53:44 +0000 (12:53 -0600)]
ARM: keystone2: psc: introduce function to hold and release module in reset.

These are useful for modules that need to be held in reset and are
enabled for data to be loaded on to them. Typically these are
microcontrollers or other processing entities in the system.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: psc-defs: use adequate () for macros
Nishanth Menon [Thu, 25 Feb 2016 18:53:43 +0000 (12:53 -0600)]
ARM: keystone2: psc-defs: use adequate () for macros

'#define X a | b' is better defined as '#define X (a | b)' for obvious
reasons.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: psc: redo doc in kernel-doc format
Nishanth Menon [Thu, 25 Feb 2016 18:53:42 +0000 (12:53 -0600)]
ARM: keystone2: psc: redo doc in kernel-doc format

u-boot coding style guidance in
http://www.denx.de/wiki/U-Boot/CodingStyle clearly mentions that the
kernel doc style shall be followed for documentation in u-boot.

Current PSC documentation standard does not, so fix that.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: keystone2: Get rid of unused clock files
Nishanth Menon [Wed, 24 Feb 2016 23:48:43 +0000 (17:48 -0600)]
ARM: keystone2: Get rid of unused clock files

With commit fe772ebd285b ("ARM: keystone2: Use common definition for
clk_get_rate"), we have centralized the clock code into a common clock
logic and the redundant files, unfortunately remained... Clean that
up.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoboard: ti: AM57xx: Add detection logic for AM57xx-evm
Kipisz, Steven [Wed, 24 Feb 2016 18:30:58 +0000 (12:30 -0600)]
board: ti: AM57xx: Add detection logic for AM57xx-evm

Current AM57xx evm supports both BeagleBoard-X15
(http://beagleboard.org/x15) and AM57xx EVM
(http://www.ti.com/tool/tmdxevm5728).

The AM572x EValuation Module(EVM) provides an affordable platform to
quickly start evaluation of Sitara. ARM Cortex-A15 AM57x Processors
(AM5728, AM5726, AM5718, AM5716) and accelerate development for HMI,
machine vision, networking, medical imaging and many other industrial
applications. This EVM is based on the same BeagleBoard-X15 Chassis
and adds mPCIe, mSATA, LCD, touchscreen, Camera, push button and TI's
wlink8 offering.

Since the EEPROM contents are compatible between the BeagleBoard-X15 and
the AM57xx-evm, we add support for the detection logic to enable
support for various user programmable scripting capability.

NOTE: U-boot configuration is currently a superset of AM57xx evm and
BeagleBoard-X15 and no additional configuration tweaking is needed.

This change also sets up the stage for future support of TI AM57xx EVMs
to the same base bootloader build.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: OMAP4/5: Add generic board detection hook
Kipisz, Steven [Wed, 24 Feb 2016 18:30:57 +0000 (12:30 -0600)]
ARM: OMAP4/5: Add generic board detection hook

Many TI EVMs have capability to store relevant board information
such as DDR description in EEPROM. Further many pad configuration
variations can occur as part of revision changes in the platform.
In-order to support these at runtime, we for a board detection hook
which is available for override from board files that may desire to do
so.

NOTE: All TI EVMs are capable of detecting board information based on
early clocks that are configured. However, in case of additional needs
this can be achieved within the override logic from within the board
file.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: AM437x: Use generic EEPROM detection logic
Nishanth Menon [Wed, 24 Feb 2016 18:30:56 +0000 (12:30 -0600)]
ti: AM437x: Use generic EEPROM detection logic

Now that we have a generic TI eeprom logic which can be reused across
platforms, reuse the same.

This revision also includes fixes identified by Dave Gerlach
<d-gerlach@ti.com>

Cc: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Steven Kipisz <s-kipisz2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoti: AM335x: Use generic EEPROM detection logic
Nishanth Menon [Wed, 24 Feb 2016 18:30:55 +0000 (12:30 -0600)]
ti: AM335x: Use generic EEPROM detection logic

Use the generic EEPROM detection logic instead of duplicating the AM
eeprom logic.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Steven Kipisz <s-kipisz2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: omap-common: Add standard access for board description EEPROM
Lokesh Vutla [Wed, 24 Feb 2016 18:30:54 +0000 (12:30 -0600)]
ARM: omap-common: Add standard access for board description EEPROM

Several TI EVMs have EEPROM that can contain board description information
such as revision, DDR definition, serial number, etc. In just about all
cases, these EEPROM are on the I2C bus and provides us the opportunity
to centralize the generic operations involved.

The on-board EEPROM on the BeagleBone Black, BeagleBone, AM335x EVM,
AM43x GP EVM, AM57xx-evm, BeagleBoard-X15 share the same format.
However, DRA-7* EVMs, OMAP4SDP use a modified format.

We hence introduce logic which is generic between these platforms
without enforcing any specific format. This allows the boards to use the
relevant format for operations that they might choose.

This module will compile for all TI SoC based boards when
CONFIG_TI_I2C_BOARD_DETECT is enabled to have optimal build times for
platforms that require this support.

It is important to note that this logic is fundamental to the board
configuration process such as DDR configuration which is needed in
SPL, hence cannot be part of the standard u-boot driver model (which
is available later in the process). Hence, to aid efficiency, the
eeprom contents are copied over to SRAM scratchpad memory area at the
first invocation to retrieve data.

To prevent churn with cases such as DRA7, where eeprom format maybe
incompatible, we introduce a generic common format in eeprom which
is made available over accessor functions for usage.

Special handling for BBG1 EEPROM had to be introduced thanks to the
weird eeprom rev contents used.

The follow on patches introduce the use of this library for AM335x,
AM437x, and AM57xx.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: OMAP4/5: Centralize gpi2c_init
Kipisz, Steven [Wed, 24 Feb 2016 18:30:53 +0000 (12:30 -0600)]
ARM: OMAP4/5: Centralize gpi2c_init

Centralize gpi2c_init into omap_common from the sys_proto header so
that the information can be reused across SoCs.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoARM: OMAP4/5: Centralize early clock initialization
Kipisz, Steven [Wed, 24 Feb 2016 18:30:52 +0000 (12:30 -0600)]
ARM: OMAP4/5: Centralize early clock initialization

Early clock initialization is currently done in two stages for OMAP4/5
SoCs. The first stage is the initialization of console clocks and
then we initialize basic clocks for functionality necessary for SoC
initialization and basic board functionality.

By splitting up prcm_init and centralizing this clock initialization,
we setup the code for follow on patches that can do board specific
initialization such as board detection which will depend on these
basic clocks.

As part of this change, since the early clock initialization
is centralized, we no longer need to expose the console clock
initialization.

NOTE: we change the sequence slightly by initializing console clocks
timer after the io settings are complete, but this is not expected
to have any functioanlity impact since we setup the basic IO drive
strength initialization as part of do_io_settings.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agospl: Support loading a FIT from MMC
Simon Glass [Tue, 23 Feb 2016 05:55:58 +0000 (22:55 -0700)]
spl: Support loading a FIT from MMC

Detect a FIT when loading from MMC and handle it using the new FIT SPL
support.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agospl: Add a way to specify a list of device trees to include
Simon Glass [Tue, 23 Feb 2016 05:55:57 +0000 (22:55 -0700)]
spl: Add a way to specify a list of device trees to include

When building a FIT, more than one device tree can be included. The board
can select (at run-time) the one that it wants.

Add a Kconfig option to allow the list of devices trees (supported by the
board) to be specified.

When using SPL_LOAD_FIT, build u-boot.img in FIT format instead of the
legacy image format. Include all the listed device tree files in this FIT.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agospl: Add an option to load a FIT containing U-Boot
Simon Glass [Tue, 23 Feb 2016 05:55:56 +0000 (22:55 -0700)]
spl: Add an option to load a FIT containing U-Boot

This provides a way to load a FIT containing U-Boot and a selection of device
tree files. The board can select the correct device tree by probing the
hardware. Then U-Boot is started with the selected device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agospl: Add a way for boards to select which device tree to load
Simon Glass [Tue, 23 Feb 2016 05:55:55 +0000 (22:55 -0700)]
spl: Add a way for boards to select which device tree to load

SPL calls this function with each device tree it can find in the FIT. The
board should implement this function, using whatever hardware detection it
can muster to determine the correct device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomkimage: Bring data into the FIT before processing
Simon Glass [Tue, 23 Feb 2016 05:55:54 +0000 (22:55 -0700)]
mkimage: Bring data into the FIT before processing

Since we now support data outside the FIT image, bring it into the FIT image
first before we do any processing. This avoids adding new functionality to
the core FIT code for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomkimage: Support placing data outside the FIT
Simon Glass [Tue, 23 Feb 2016 05:55:53 +0000 (22:55 -0700)]
mkimage: Support placing data outside the FIT

One limitation of FIT is that all the data is 'inline' within it, using a
'data' property in each image node. This means that to find out what is in
the FIT it is necessary to scan the entire file. Once loaded it can be
scanned and then the images can be copied to the correct place in memory.

In SPL it can take a significant amount of time to copy images around in
memory. Also loading data that does not end up being used is wasteful. It
would be useful if the FIT were small, acting as a directory, with the
actual data stored elsewhere.

This allows SPL to load the entire FIT, without the images, then load the
images it wants later.

Add a -E option to mkimage to request that it output an 'external' FIT.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomkimage: Support adding device tree files to a FIT
Simon Glass [Tue, 23 Feb 2016 05:55:52 +0000 (22:55 -0700)]
mkimage: Support adding device tree files to a FIT

To make the auto-FIT feature useful we need to be able to provide a list of
device tree files on the command line for mkimage to add into the FIT. Add
support for this feature.

So far there is no support for hashing or verified boot using this method.
For those cases, a .its file must still be provided.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomkimage: Support automatic creating of a FIT without a .its
Simon Glass [Tue, 23 Feb 2016 05:55:51 +0000 (22:55 -0700)]
mkimage: Support automatic creating of a FIT without a .its

At present, when generating a FIT, mkimage requires a .its file containing
the structure of the FIT and referring to the images to be included.

Creating the .its file is a separate step that makes it harder to use FIT.
This is not required for creating legacy images.

Often the FIT is pretty standard, consisting of an OS image, some device
tree files and a single configuration. We can handle this case automatically
and avoid needing a .its file at all.

To start with, support automatically generate the FIT using a new '-f auto'
option. Initially this only supports adding a single image (e.g. a linux
kernel) and a single configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agoimage: Add functions to obtain short names
Simon Glass [Tue, 23 Feb 2016 05:55:50 +0000 (22:55 -0700)]
image: Add functions to obtain short names

Sometimes it is useful to obtain the short name for an Operating System,
architecture or compression mechanism. Provide functions for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agotools: Add a function to obtain the size of a file
Simon Glass [Tue, 23 Feb 2016 05:55:49 +0000 (22:55 -0700)]
tools: Add a function to obtain the size of a file

This will be used in mkimage when working out the required size of the FIT
based on the files to be placed into it.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agomkimage: Allow a FIT to include an image of any type
Simon Glass [Tue, 23 Feb 2016 05:55:48 +0000 (22:55 -0700)]
mkimage: Allow a FIT to include an image of any type

At present FIT images are set up by providing a device tree source file
which is a file with a .its extension. We want to support automatically
creating this file based on the image supplied to mkimage. This means that
even though the final file type is always IH_TYPE_FLATDT, the image inside
may be something else.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agotools: Include fdt_sw.o in libfdt for mkimage
Simon Glass [Tue, 23 Feb 2016 05:55:47 +0000 (22:55 -0700)]
tools: Include fdt_sw.o in libfdt for mkimage

At present this file is omitted. It is used to build up a binary device
tree. We plan to do this in mkimage, so include this file in the build.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agosunxi: Display the board model on start-up
Simon Glass [Tue, 23 Feb 2016 05:55:46 +0000 (22:55 -0700)]
sunxi: Display the board model on start-up

It is useful to know which sunxi board you are booting. Display this on
start-up to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agofdt: Allow libfdt to be used in SPL
Simon Glass [Tue, 23 Feb 2016 05:55:45 +0000 (22:55 -0700)]
fdt: Allow libfdt to be used in SPL

Add an option to enable libfdt in SPL. This can be useful when decoding
FIT files in SPL.

We need to make sure this option is not enabled in SPL by this change.
Also this option needs to be enabled in host builds. Si add a new
IMAGE_USE_LIBFDT #define which can be used in files that are built on the
host but must also build for U-Boot and SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
8 years agofdt: Adjust DEFAULT_DEVICE_TREE to device on OF_CONTROL
Simon Glass [Tue, 23 Feb 2016 05:55:44 +0000 (22:55 -0700)]
fdt: Adjust DEFAULT_DEVICE_TREE to device on OF_CONTROL

This option has no meaning without OF_CONTROL, so add a dependency.

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