fvp: plat_io_storage: remove duplicated code

Fixes issues #41:

https://github.com/ARM-software/tf-issues/issues/41

The policy functions for each file to be loaded were implemented by
copy/pasting one method and then varying the data checked.

This patch creates a generic function to check the policy based on the
data stored in a table.

This removes the amount of duplicated code but also makes the code
simpler and more efficient.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
bl_common: add image_size()

Fixes issue #42:

https://github.com/ARM-software/tf-issues/issues/42

Some callers of load_image() may need to get the size of the image
before/after loading it.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Revert accidental removal of BL2 from help message

Commit 375f538a7 in Github accidentally removed the BL2 targets from the
Makefile help message. This patch reverts that change.

Change-Id: I825a9abe5b4ba0f15d02879dda1056912e2ad60c
Reduce GICv3 debug output

Change-Id: Ia8502f8d0566025d8bad150029f49cb63815261d
Update contributing.md to new CLA location

This commit updates contributing.md to point to the ARM website
for downloading copies of the Contribution License Agreement (CLA).
It is no longer necessary to email ARM for these.

Change-Id: Iaf58680631a626f26827577709ac5471e3b84566
Implement late binding for runtime hooks

At present SPD power management hooks and BL3-2 entry are implemented
using weak references. This would have the handlers bound and registered
with the core framework at build time, but leaves them dangling if a
service fails to initialize at runtime.

This patch replaces implementation by requiring runtime handlers to
register power management and deferred initialization hooks with the
core framework at runtime. The runtime services are to register the
hooks only as the last step, after having all states successfully
initialized.

Change-Id: Ibe788a2a381ef39aec1d4af5ba02376e67269782
Tolerate runtime service initialization failure

At present, the firmware panics if a runtime service fails to
initialize. An earlier patch had implemented late binding for all
runtime service handlers.

With that in place, this patch allows the firmware to proceed even when
a service fails to initialize.

Change-Id: I6cf4de2cecea9719f4cd48272a77cf459b080d4e
fvp: Initialise UART earlier

The UART used to be initialised in bl1_platform_setup(). This is too
late because there are some calls to the assert() macro, which needs
to print some messages on the console, before that.

This patch moves the UART initialisation code to
bl1_early_platform_setup().

Fixes ARM-software/tf-issues#49

Change-Id: I98c83a803866372806d2a9c2e1ed80f2ef5b3bcc
Remove duplicate xlat_table descriptions

The BL31 and BL2 linker scripts ended up having duplicate descriptions
for xlat_tables section. This patch removes those duplicate
descriptions.

Change-Id: Ibbdda0902c57fca5ea4e91e0baefa6df8f0a9bb1
Update Makefiles to get proper dependency checking working.

This change requires all platforms to now specify a list of source files
rather than object files.

New source files should preferably be specified by using the path as
well and we should add this in the future for all files so we can remove
use of vpath. This is desirable because vpath hides issues like the fact that BL2 currently pulls in a BL1 file bl1/aarch64/early_exceptions.S
and if in the future we added bl2/aarch64/early_exceptions.S then it's
likely only one of the two version would be used for both bootloaders.

This change also removes the 'dump' build target and simply gets
bootloaders to always generate a dump file. At the same time the -x
option is added so the section headers and symbols table are listed.

Fixes ARM-software/tf-issues#11

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Fix assert in bakery_lock_release()

bakery_lock_release() expects an mpidr as the first argument however
bakery_lock_release() is calling it with the 'entry' argument it has
calculated. Rather than fixing this to pass the mpidr value it would be
much more efficient to just replace the call with

   assert(bakery->owner == entry)

As this leaves no remaining users of bakery_lock_held(), we might as
well delete it.

Fixes ARM-software/tf-issues#27

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Fix implementation and users of gicd_set_ipriorityr()

Make gicd_set_ipriorityr() actually write to the priority register.

Also correct callers of this function which want the highest priority
to use the value zero as this is the highest priority value according
to the ARM Generic Interrupt Controller Architecture Specification.

To make this easier to get right, we introduce defines for the lowest
and highest priorities for secure and non-secure interrupts.

Fixes ARM-software/tf-issues#21

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Enable platforms to omit some bootloaders

If a platform doesn't specify a BLx_SOURCE variable, then building
of the corresponding bootloader isn't attempted. Also allowe BL33 to
be omitted from the FIP.

Note, this change also removes support for PLAT=all and the 'fip' target
from the 'all' recipe.

Fixes ARM-software/tf-issues#30

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Generate build time and date message at link time.

So it updated each time a bootloader changes, not just when bl*_main.c
files are recompiled.

Fixes ARM-software/tf-issues#33

Signed-off-by: Jon Medhurst <tixy@linaro.org>

Conflicts:
	Makefile
Add generic functions for setting up aarch64 MMU translation tables

Signed-off-by: Jon Medhurst <tixy@linaro.org>
fvp: Make use of the generic MMU translation table setup code

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Merge remote-tracking branch 'linaro/tixy-issue-27' into integration
Merge remote-tracking branch 'linaro/tixy-issue-21' into integration
Merge remote-tracking branch 'linaro/tixy-issue-11' into integration
Merge remote-tracking branch 'linaro/tixy-issue-30' into integration