Commit Graph

1618 Commits

Author SHA1 Message Date
Harry Liebel e22fb91e31 Build project with 'pedantic'
Tighten up ISO C standard checking. Fix 'CASSERT' implementation to
conform to C99 as opposed to GNU99 standard.

Change-Id: I58ddc61913617b66f11da5b6e3f7363136d5cf7d
2014-01-17 10:27:52 +00:00
Sandrine Bailleux bdb774df31 Fix SPSR register size in gp_regs structure
SPSR is a 32-bit register and so its size should be reflected in
the gp_regs structure.  This patch fixes the type of gp_regs.spsr
to use a 32-bit variable.  It also makes the size of the other
register fields more explicit.

Change-Id: I27e0367df1a91cc501d5217c1b3856d4097c60ba
2013-12-20 15:52:16 +00:00
Harry Liebel 1bc9e1f6eb Add strchr() and putchar() to local C library
Change-Id: I3659e119a242f8ef828e32bfdf5d0b4b7ac4f716
2013-12-20 15:52:16 +00:00
Harry Liebel 0f702c6e70 Create local C library implementation (2/2)
- This change is split into two separate patches in order to
  simplify the history as interpreted by 'git'. The split is
  between the move/rename and addition of new files.
- Remove dependency on toolchain C library headers and functions in
  order to ensure behavioural compatibility between toolchains.
- Use FreeBSD as reference for C library implementation.
- Do not let GCC use default library include paths.
- Remove unused definitions in modified headers and implementations.
- Move C library files to 'lib/stdlib' and 'include/stdlib'.
- Break std.c functions out into separate files.

Change-Id: I3e3d8d992052264d2a02489034ae4c03bf0f5512
2013-12-20 15:52:16 +00:00
Harry Liebel c81b1d0f03 Create local C library implementation (1/2)
- This change is split into two separate patches in order to
  simplify the history as interpreted by 'git'. The split is
  between the move/rename and addition of new files.
- Remove dependency on toolchain C library headers and functions in
  order to ensure behavioural compatibility between toolchains.
- Use FreeBSD as reference for C library implementation.
- Do not let GCC use default library include paths.
- Remove unused definitions in modified headers and implementations.
- Move C library files to 'lib/stdlib' and 'include/stdlib'.
- Break std.c functions out into separate files.

Change-Id: I91cddfb3229775f770ad781589670c57d347a154
2013-12-20 15:52:16 +00:00
Harry Liebel 57bb658193 Add debug macros
- Add 'debug.h' with INFO, WARN and ERROR macros.
- This prints the specified message with the appropriate tag.
- INFO and WARN messages are only displayed when building with
  the DEBUG flag set. Error messages are always printed.

Change-Id: I21835b6063fcc99649b30ac7489387cbd3705bc0
2013-12-20 15:52:16 +00:00
Sandrine Bailleux 93ca221c95 Make BL31's ns_entry_info a single-cpu area
ns_entry_info used to be a per-cpu array.  This is a waste of space
because it is only accessed by the primary CPU on the cold boot path.
This patch reduces ns_entry_info to a single-cpu area.

Change-Id: I647c70c4e76069560f1aaad37a1d5910f56fba4c
2013-12-12 16:06:48 +00:00
Sandrine Bailleux ba6980a8db Move RUN_IMAGE constant from bl1.h to bl_common.h
RUN_IMAGE constant is used by all bootloader stages.

Change-Id: I1b4e28d8fcf3ad1363f202c859f5efab0f320efe
2013-12-12 16:06:48 +00:00
Sandrine Bailleux ee12f6f749 Remove useless copies of meminfo structures
Platform setup code has to reserve some memory for storing the
memory layout information.  It is populated in early platform setup
code.

blx_get_sec_mem_layout() functions used to return a copy of this
structure.  This patch modifies blx_get_sec_mem_layout() functions
so that they now directly return a pointer to their memory layout
structure.  It ensures that the memory layout returned by
blx_get_sec_mem_layout() is always up-to-date and also avoids a
useless copy of the meminfo structure.

Also rename blx_get_sec_mem_layout() to blx_plat_sec_mem_layout()
to make it clear those functions are platform specific.

Change-Id: Ic7a6f9d6b6236b14865ab48a9f5eff545ce56551
2013-12-12 16:06:48 +00:00
Achin Gupta 3140a9e5c7 psci: rework cpu_off assertion and minor cleanups
This patch:

1. removes a duplicate assertion to check that the only error
   condition that can be returned while turning a cpu off is
   PSCI_E_DENIED. Having this assertion after calling
   psci_afflvl_off() is sufficient.

2. corrects some incorrect usage of 'its' vs 'it is'

3. removes some unwanted white spaces

Change-Id: Icf014e269b54f5be5ce0b9fbe6b41258e4ebf403
2013-12-05 12:28:50 +00:00
Achin Gupta c2b43afc54 move timer #defines & remove duplicate declaration
This patch removes the duplicate declaration of psci_cpu_on in psci.h
and moves the constants for the system level implementation of the
generic timer from arch_helpers.h to arch.h. All other architectural
constants are defined in arch.h so there is no need to add them to
arch_helpers.h

Change-Id: Ia8ad3f91854f7e57fce31873773eede55c384ff1
2013-12-05 12:28:50 +00:00
Achin Gupta 994dfceb44 psci: fix values of incorrectly defined constants
This patch fixes the following constant values in the psci.h:

1. The affinity level shift value in the power_state parameter of the
   cpu_suspend psci call. The previous value was preventing shutdown
   of the affinity level 1.

2. The values used for affinity state constants (ON, OFF,
   ON_PENDING). They did not match the values expected to be returned
   by the affinity_info psci api as mentioned in the spec.

3. The state id shift value in the power_state parameter of the
   cpu_suspend psci call.

Change-Id: I62ed5eb0e9640b4aa97b93923d6630e6b877a097
2013-12-05 12:28:50 +00:00
Achin Gupta 4a826ddad8 rework general purpose registers save and restore
The runtime exception handling assembler code used magic numbers for
saving and restoring the general purpose register context on stack
memory. The memory is interpreted as a 'gp_regs' structure and the
magic numbers are offsets to members of this structure. This patch
replaces the magic number offsets with constants. It also adds compile
time assertions to prevent an incorrect assembler view of this
structure.

Change-Id: Ibf125bfdd62ba3a33e58c5f1d71f8c229720781c
2013-12-05 12:28:50 +00:00
Dan Handley ab2d31edbd Enable third party contributions
- Add instructions for contributing to ARM Trusted Firmware.

- Update copyright text in all files to acknowledge contributors.

Change-Id: I9311aac81b00c6c167d2f8c889aea403b84450e5
2013-12-05 11:34:09 +00:00
Sandrine Bailleux 8d69a03f6a Various improvements/cleanups on the linker scripts
- Check at link-time that bootloader images will fit in memory
    at run time and that they won't overlap each other.
  - Remove text and rodata orphan sections.
  - Define new linker symbols to remove the need for platform setup
    code to know the order of sections.
  - Reduce the size of the raw binary images by cutting some sections
    out of the disk image and allocating them at load time, whenever
    possible.
  - Rework alignment constraints on sections.
  - Remove unused linker symbols.
  - Homogenize linker symbols names across all BLs.
  - Add some comments in the linker scripts.

Change-Id: I47a328af0ccc7c8ab47fcc0dc6e7dd26160610b9
2013-12-05 11:33:15 +00:00
Sandrine Bailleux 295538bc37 AArch64: Remove EL-agnostic TLB helper functions
Also, don't invalidate the TLBs in disable_mmu() function, it's better
to do it in enable_mmu() function just before actually enabling the
MMU.

Change-Id: Ib32d6660019b0b2c17254156aad4be67ab4970e1
2013-11-27 15:31:06 +00:00
Sandrine Bailleux 3738274dc1 Unmask SError and Debug exceptions.
Any asynchronous exception caused by the firmware should be handled
in the firmware itself.  For this reason, unmask SError exceptions
(and Debug ones as well) on all boot paths.  Also route external
abort and SError interrupts to EL3, otherwise they will target EL1.

Change-Id: I9c191d2d0dcfef85f265641c8460dfbb4d112092
2013-11-27 15:31:06 +00:00
Achin Gupta 4f6ad66ae9 ARMv8 Trusted Firmware release v0.2 2013-10-25 09:37:16 +01:00