Commit Graph

149 Commits

Author SHA1 Message Date
Sandrine Bailleux c9528cffdd juno: Improve TZC-400 initialisation code
- Distinguish Juno specific from platform agnostic constants
 - Define constants for Juno TZC-400 NSAID
2014-03-12 16:05:32 +00:00
Sandrine Bailleux e80b385a29 tzc-400: Export some TZC-400 related constants in a generic header 2014-03-12 16:05:32 +00:00
Sandrine Bailleux 4fe22df73d juno: Expose NIC-400 constants in the platform header file
It is easier to have all platform constants in the same place.
2014-03-12 16:05:32 +00:00
Sandrine Bailleux 4c05b6bc30 juno: Implement plat_report_exception() function
As for FVP platforms, Juno provides some LEDs that we can
use to report exceptions during the early boot code.
2014-03-12 16:05:32 +00:00
Sandrine Bailleux 68020e3ffa juno: BL2: Load BL30
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-12 16:05:25 +00:00
Jon Medhurst 6d6aea6e61 Add optional BL30 to fip make rule
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:33 +00:00
Ryan Harkin 4d5a115e2d io_fip: add BL30 to FIP name to uuid table
BL30 needs an entry in the table in io_fip.c.  I made it #ifdef'd so
that ports that don't use a BL30 won't break.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-12 16:03:33 +00:00
Ryan Harkin ff956f179e juno: plat_io_storage: remove semihosting
Removing semihosting from the plat_io_storage code copied from FVP.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-12 16:03:33 +00:00
Ryan Harkin 06176707bd juno: BL1: default to building bypass rom
Juno has a "taped out" BL1.

To run your own BL1 on the board, you have to place it in a "ROM bypass"
address and configure the platform to boot from there.

The agreed bypass address is an offset of 0x03EC0000 from the start of
NOR flash (0x08000000), which equates to 0x0BEC0000.

To run the model using a BL1 in bypass mode, you should use a parameter
set something like this:

	<path to>/FVP_CSS_Juno3 \
		-C css.aon.scp.ROMloader.fname=<SCP ROM filename> \
		--data css.cluster1.cpu0=bl1.bin@0x0BEC0000 \
		-C soc.scc.apps_alt_boot=0x0BEC0000

To build BL1 as a ROM located at address zero, you can over-ride the
default value for TZROM_BASE by passing parameters to make, eg:

	ASFLAGS="-D TZROM_BASE=0x00000000" \
	CFLAGS="-D TZROM_BASE=0x00000000" \
	CROSS_COMPILE=aarch64-linux-gnu- \
	make PLAT=juno DEBUG=1 all

Then you can launch the model using a command such as:

	<path to>/FVP_CSS_Juno3 \
		-C css.aon.scp.ROMloader.fname=<SCP ROM filename> \
		-C css.trustedBootROMloader.fname=<path to>/bl1.bin \

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-12 16:03:33 +00:00
Jon Medhurst 7f6dba15fe juno: Add a handler for 'ARM Architecture' SMC calls
Currently UEFI and Linux are using SMC calls in the 'ARM Architecture'
Owning Entity range so lets implement these to get things working.

UEFI probably doesn't actually need to issue the ID_PRESENCE and ID_UID
calls it does, and the device-tree used by Linux could specify the PSCI
identifiers instead. After those changes, this patch isn't required.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:33 +00:00
Jon Medhurst e7aa4a6f2c Workaround: Setup register context for BL3-3
This is a temporary solution for issue #20

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:33 +00:00
Jon Medhurst a0d586ea45 juno: Implement PM ops to power down CPUs
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:33 +00:00
Jon Medhurst 7441ac3a24 juno: Implement PM ops to power on CPUs
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst dbf5789ea6 juno: Implement SCPI Set CSS Power State command
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 0aadcc0f19 juno: Add bootloader for SCP image
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 2e45bfd034 juno: Add SCPI interface and implement the SCP Ready command
The SCP Ready command is sent by the SCP to indicate that the BL3-0 RAM
Firmware image is successfully up and running.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 4d65df50de juno: Add MHU interface
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 12026727a2 juno: Initialise PCIe
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 06f1af9111 juno: Initialise TZC-400
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 0be17c44ca juno: Initialise NIC-400
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 29dfa23b0f juno: Initialise GIC
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 39fa81bc37 juno: Port plat_topology.c
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 1100a4f140 juno: Update GIC addresses
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst f5a885ff15 juno: Port mailbox initialisation
Note, on Juno mailboxes are 16 bytes because any bigger and they would
overlap the memory used for MHU payload data for SCP->AP transfers.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst c478ff5d1e juno: Port CCI
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst 4c47d98a44 juno: Override platform_get_core_pos and platform_is_primary_cpu
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Jon Medhurst c30556a13b juno: Update memory map and use generic MMU code
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 16:03:32 +00:00
Sandrine Bailleux 8f23fbc643 juno: Various tidyups 2014-03-12 16:03:26 +00:00
Sandrine Bailleux b34ce28272 juno: Improve compliance to Linux coding style 2014-03-12 16:02:19 +00:00
Sandrine Bailleux a40fc37c37 juno: Use the correct firmware image names in comments and messages 2014-03-12 16:01:40 +00:00
Jon Medhurst 241a8bb461 juno: Use static declaration of bl31_args
Juno doesn't have TZDRAM as FVP does, and there is real reason why we
need a special memory region for bl31_args anyway, assuming we take care
to copy it in BL31 before BL2's memory is reused.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 14:04:53 +00:00
Jon Medhurst 305680329c juno: Initialise architected timer in BL3-1 2014-03-12 14:04:53 +00:00
Jon Medhurst b86295169e juno: Create as a trimmed copy of plat/fvp
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-12 14:04:40 +00:00
Jeenu Viswambharan 1c297bf015 Move architecture timer setup to platform-specific code
At present, bl1_arch_setup() and bl31_arch_setup() program the counter
frequency using a value from the memory mapped generic timer. The
generic timer however is not necessarily present on all ARM systems
(although it is architected to be present on all server systems).

This patch moves the timer setup to platform-specific code and updates
the relevant documentation. Also, CNTR.FCREQ is set as the specification
requires the bit corresponding to the counter's frequency to be set when
enabling. Since we intend to use the base frequency, set bit 8.

Fixes ARM-software/tf-issues#24

Change-Id: I32c52cf882253e01f49056f47c58c23e6f422652
2014-03-10 14:17:59 +00:00
Jeenu Viswambharan 92a12866e6 Remove unused 'CPU present' flag
This patch removes the 'CPU present' flag that's being set but not
referred or used anywhere else.

Change-Id: Iaf82bdb354134e0b33af16c7ba88eb2259b2682a
2014-03-10 14:17:58 +00:00
Dan Handley 5cfa93d8d6 Remove change log instructions from contribution.md
Remove the instructions to update the change log from
contribution.md. The change log no longer contains a
"Detailed changes since last release" section.

Also, update the documentation links following recent
documentation changes.

Change-Id: Id9df43d666f7f9a60dcc6f663a8a85cdd2ff7cc4
2014-03-05 16:21:14 +00:00
Ryan Harkin ee9ad7856c bl_common: add image_size()
Fixes ARM-software/tf-issues#42

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

Change-Id: I8dc067b69fc711433651a560ba5a8c3519445857
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-05 16:21:14 +00:00
Ryan Harkin 48e2ca7967 fvp: plat_io_storage: remove duplicated code
Fixes ARM-software/tf-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.

Change-Id: I1c52eacf6f18a1442dabbb33edd03d4bb8bbeae0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst 4bfc2d21a1 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 allow BL3-3 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

Change-Id: Ibdfead0440256eaf364617ecff65290ca6fe6240
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst fb05246201 Generate build time and date message at link time.
So it updates each time a bootloader changes, not just when bl*_main.c
files are recompiled.

Fixes ARM-software/tf-issues#33

Change-Id: Ie8e1a7bd7e1913d2e96ac268606284f76af8c5ab
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst 38aa76a87f fvp: Make use of the generic MMU translation table setup code
Change-Id: I559c5a4d86cad55ce3f6ad71285b538d3cfd76dc
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst c481c26987 Add generic functions for setting up aarch64 MMU translation tables
Change-Id: I5b8d040ebc6672e40e4f13925e2fd5bc124103f4
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst 6d55d109a3 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

Change-Id: Ie38f7be76fed95756c8576cf3f3ea3b7015a18dc
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-05 16:21:14 +00:00
Jon Medhurst cf6eeb8a60 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>
2014-03-05 16:21:14 +00:00
Jon Medhurst a4d9f26b00 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>
2014-03-05 16:21:14 +00:00
Dan Handley b238849030 Add v0.3 release documentation
Update the readme.md and change-log.md with release information.

Also, remove the "Detailed changes since last release" section of
the change-log.md since the same information can be found in the
GIT commit messages. Fixes ARM-software/tf-issues#22.

Change-Id: I968cc8aaf588aa5c34ba8f1c12a5b797a46e04f5
2014-02-28 18:23:42 +00:00
Dan Handley 57de6d7274 Consolidate design and porting documentation
Consolidate firmware-design.md and porting-guide.pm so
that recently added sections fit better with
pre-existing sections. Make the documentation more
consistent in use of terminology.

Change-Id: Id87050b096122fbd845189dc2fe1cd17c3003468
2014-02-28 17:51:07 +00:00
Dan Handley 5e1e920075 Add EL3 runtime services and SPD documentation
1. Add design information on EL3 runtime services and
Secure-EL1 Payload Dispatchers (SPD) to
firmware-design.md.

2. Create new EL3 runtime service writer's guide
(rt-svc-writers-guide.md) to ease creation of new
runtime services.

Change-Id: I670aeb5fc246e25c6e599a15139aac886a0074fd
2014-02-28 17:51:07 +00:00
Dan Handley 247f60bcbc Separate firmware design out of user-guide.md
Move the firmware design documentation out of user-guide.md
and into a new file - firmware-design.md. Reformat the
section headers.

Change-Id: I664815dd47011c7c1cf2202aa4472a8fd78ebb92
2014-02-28 17:51:07 +00:00
Dan Handley 3505c044a2 Update versions of dependencies in user-guide.md
1. Update user-guide.md with the latest versions of dependent
components required by the tested configurations of ARM Trusted
Firmware. This includes the tested versions of Fixed Virtual
Platforms (FVPs), toolchain, EFI Development Kit 2(EDK2),
Linux kernel and Linux file system.

2. Remove the instructions to configure the Cortex Base FVP
with the legacy GICv2 memory map as this is no longer supported
since version 5.3 of the Base FVPs.

3. General tidyup of "Using the software" section.

Change-Id: If8264cd29036b59dc5ff435b5f8b1d072dd36ef0
2014-02-28 17:51:07 +00:00