Commit Graph

999 Commits

Author SHA1 Message Date
danh-arm dbc807179f Merge pull request #511 from soby-mathew/sm/psci_on_race_v2
Fix PSCI CPU ON race when setting state to ON_PENDING
2016-02-01 19:10:02 +00:00
danh-arm 1a3986a4c6 Merge pull request #508 from soby-mathew/sm/debug_xlat
Use tf_printf() for debug logs from xlat_tables.c
2016-02-01 19:06:57 +00:00
danh-arm 9f89feb919 Merge pull request #504 from sandrine-bailleux/sb/fix-doc-mmap
Porting Guide: Clarify identity-mapping requirement
2016-02-01 19:06:03 +00:00
danh-arm 6874e723c4 Merge pull request #503 from sandrine-bailleux/sb/clarify-doc-el3-payloads
Clarify EL3 payload documentation
2016-02-01 19:05:07 +00:00
danh-arm 51b57481c1 Merge pull request #501 from jcastillo-arm/jc/tf-issues/300
Disable PL011 UART before configuring it
2016-02-01 19:03:41 +00:00
Soby Mathew 203cdfe26f Fix PSCI CPU ON race when setting state to ON_PENDING
When a CPU is powered down using PSCI CPU OFF API, it disables its caches
and updates its `aff_info_state` to OFF. The corresponding cache line is
invalidated by the CPU so that the update will be observed by other CPUs
running with caches enabled. There is a possibility that another CPU
which has been trying to turn ON this CPU via PSCI CPU ON API,
has already seen the update to `aff_info_state` and proceeds to update
the state to ON_PENDING prior to the cache invalidation. This may result
in the update of the state to ON_PENDING being discarded.

This patch fixes this issue by making sure that the update of `aff_info_state`
to ON_PENDING sticks by reading back the value after the cache flush and
retrying it if not updated. The patch also adds a dsbish() to
`psci_do_cpu_off()` to ensure ordering of the update to `aff_info_state`
prior to cache line invalidation.

Fixes ARM-software/tf-issues#349

Change-Id: I225de99957fe89871f8c57bcfc243956e805dcca
2016-02-01 14:52:30 +00:00
danh-arm 7b46d0d81a Merge pull request #497 from mtk09422/spm-v3
update SPM/DCM/MTCMOS related code for power control logic
2016-02-01 13:02:25 +00:00
Soby Mathew d30ac1c36f Use tf_printf() for debug logs from xlat_tables.c
The debug prints used to debug translation table setup in xlat_tables.c
used the `printf()` standard library function instead of the stack
optimized `tf_printf()` API. DEBUG_XLAT_TABLE option was used to enable
debug logs within xlat_tables.c and it configured a much larger stack
size for the platform in case it was enabled. This patch modifies these
debug prints within xlat_tables.c to use tf_printf() and modifies the format
specifiers to be compatible with tf_printf(). The debug prints are now enabled
if the VERBOSE prints are enabled in Trusted Firmware via LOG_LEVEL build
option.

The much larger stack size definition when DEBUG_XLAT_TABLE is defined
is no longer required and the platform ports are modified to remove this
stack size definition.

Change-Id: I2f7d77ea12a04b827fa15e2adc3125b1175e4c23
2016-02-01 10:10:09 +00:00
Sandrine Bailleux ef7fb9e48e Porting Guide: Clarify identity-mapping requirement
The memory translation library in Trusted Firmware supports
non-identity mappings for Physical to Virtual addresses since commit
f984ce84ba. However, the porting guide hasn't been updated
accordingly and still mandates the platform ports to use
identity-mapped page tables for all addresses.

This patch removes this out-dated information from the Porting Guide
and clarifies in which circumstances non-identity mapping may safely
be used.

Fixes ARM-software/tf-issues#258

Change-Id: I84dab9f3cabfc43794951b1828bfecb13049f706
2016-01-29 16:09:12 +00:00
Sandrine Bailleux 143fbef42e Clarify EL3 payload documentation
This patch reworks the section about booting an EL3 payload in the
User Guide:

 - Centralize all EL3 payload related information in the same
   section.

 - Mention the possibility to program the EL3 payload in flash memory
   and execute it in place.

 - Provide model parameters for both the Base and Foundation FVPs.

 - Provide some guidance to boot an EL3 payload on Juno.

Change-Id: I975c8de6b9b54ff4de01a1154cba63271d709912
2016-01-29 15:31:52 +00:00
Fan Chen bb99828dee mt8173: Fix long latency issue of mtcmos contorl
We found sometimes mtcmos operation is too long in spm (>1ms),
so update a new version to fix it.
I verified with 5 hours power_LoadTest, every mtcmos control
can finish in 500us (average is 100~200us).

Change-Id: I47b712bf9898870f4abcecbea47e01b9786231d4
Signed-off-by: Fan Chen <fan.chen@mediatek.com>
2016-01-26 13:55:15 +08:00
Weiyi Lu 44c4908790 mt8173: Improve performance by handling more interrupts during idle
1. Set more wakeup source
2. Update PCM code for control logic

Change-Id: I2ad06bd85bd1c75a22c838eab4cf5566c443b89a
Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
2016-01-26 13:55:14 +08:00
Jimmy Huang 1a1ff8b962 mt8173: Implement subsystem power control logic in ARM TF
1. Add SiP calls for subsystem power on/off and check support
2. Add subsystem power control related initialization in
   bl31_plat_setup.c
3. Add subsystem power on/off and power ack waiting functions
4. Update PCM code for subsystem physical power control logic

Change-Id: Ia0ebb1964c8f9758159bcf17c1813d76ef52cf64
Signed-off-by: yt.lee <yt.lee@mediatek.com>
2016-01-26 13:55:13 +08:00
Jimmy Huang 8e53ec53b6 mt8173: support big/Little cluster power off for CPU idle(C2 state)
1. add power control for both big and Little cluster in MCDI
2. fix incorrect PCM_HOTPLUG_VALID_MASK in spm_hotplug.c
3. check the power status of cpus in cluster before setting the cputop
   power control

Change-Id: Ifa85306a8bc218098667247904d281494c2f7bfe
Signed-off-by: Weiyi Lu <weiyi.lu@mediatek.com>
2016-01-26 13:55:12 +08:00
Jimmy Huang 3c454d52e1 mt8173: Move SPM related PLL settings to ARM TF
Move SPM related PLL settings to spm_boot_init in ARM TF SPM driver

Change-Id: I414b896caae072570c8de33a25e06db4ae011f57
Signed-off-by: yt.lee <yt.lee@mediatek.com>
2016-01-26 13:55:11 +08:00
Jimmy Huang cc04b843ba mt8173: Fix USB remote wake up problem
This patch updates SPM driver settings and PCM code to fix USB remote
wake up problem.

Change-Id: I07a81cc64b1d226d111380580d09ae25879f4285
Signed-off-by: yt.lee <yt.lee@mediatek.com>
2016-01-26 13:55:10 +08:00
Jimmy Huang ac3986ef74 mt8173: Enable dynamic clock management
This patch enables dynamic clock management control to reduce power
consumption in various components.

Change-Id: I8f66d9b72c8b1d70169ffe46cc361b16a0dadb77
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
2016-01-26 13:55:08 +08:00
danh-arm 870d881ced Merge pull request #496 from Xilinx/attr-deprecated
cdefs.h: Use __deprecated__ instead of deprecated
2016-01-25 11:02:42 +00:00
danh-arm 01fc3f7300 Merge pull request #495 from jcastillo-arm/jc/tf-issues/170
ARM plat: add build option to unlock access to non-secure timer
2016-01-25 11:02:13 +00:00
Juan Castillo 9400b40ea4 Disable PL011 UART before configuring it
The PL011 TRM (ARM DDI 0183G) specifies that the UART must be
disabled before any of the control registers are programmed. The
PL011 driver included in TF does not disable the UART, so the
initialization in BL2 and BL31 is violating this requirement
(and potentially in BL1 if the UART is enabled after reset).

This patch modifies the initialization function in the PL011
console driver to disable the UART before programming the
control registers.

Register clobber list and documentation updated.

Fixes ARM-software/tf-issues#300

Change-Id: I839b2d681d48b03f821ac53663a6a78e8b30a1a1
2016-01-21 17:27:47 +00:00
Soren Brinkmann 6b8d6720cc cdefs.h: Use __deprecated__ instead of deprecated
Use the form with underscores to define the '__deprecated' macro to avoid
collisions with potentially defined macros, as suggested in gcc docs
(https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax).

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-01-20 15:45:39 -08:00
Juan Castillo 0e5dcdd254 ARM plat: add build option to unlock access to non-secure timer
Currently, Trusted Firmware on ARM platforms unlocks access to the
timer frame registers that will be used by the Non-Secure world. This
unlock operation should be done by the Non-Secure software itself,
instead of relying on secure firmware settings.

This patch adds a new ARM specific build option 'ARM_CONFIG_CNTACR'
to unlock access to the timer frame by setting the corresponding
bits in the CNTACR<N> register. The frame id <N> is defined by
'PLAT_ARM_NSTIMER_FRAME_ID'. Default value is true (unlock timer
access).

Documentation updated accordingly.

Fixes ARM-software/tf-issues#170

Change-Id: Id9d606efd781e43bc581868cd2e5f9c8905bdbf6
2016-01-20 09:49:45 +00:00
danh-arm 84091c4816 Merge pull request #493 from yupluo01/yp/tf-issue-fix-doc-links
Update doc links in the porting guide
2016-01-18 10:30:55 +00:00
Yuping Luo 6b14041bbd Update doc links in the porting guide
GIC v2 and v3 specification references in the porting guide
should refer to publically visible links, not ARM internal links.

Change-Id: Ib47c8adda6a03581f23bcaed72d71c08c7dd9fb1
Signed-off-by: Yuping Luo <yuping.luo@arm.com>
2016-01-18 10:12:56 +08:00
danh-arm 34ac29b6d0 Merge pull request #489 from sandrine-bailleux/sb/fix-mailbox-doc
Doc: Update out-dated info about Juno's mailbox
2016-01-15 17:55:46 +00:00
danh-arm 6243e53067 Merge pull request #486 from Xilinx/issues/340
Clean up __attribute__ usage
2016-01-15 17:55:11 +00:00
Sandrine Bailleux 6e8bb1e32c Doc: Update out-dated info about Juno's mailbox
Since commit 804040d106, the Juno port has moved from per-CPU mailboxes
to a single shared one. This patch updates an out-dated reference to
the former per-CPU mailboxes mechanism in the Firmware Design.

Change-Id: I355b54156b1ace1b3df4c4416e1e8625211677fc
2016-01-15 16:37:46 +00:00
Soren Brinkmann 65cd299f52 Remove direct usage of __attribute__((foo))
Migrate all direct usage of __attribute__ to usage of their
corresponding macros from cdefs.h.
e.g.:
 - __attribute__((unused)) -> __unused

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-01-14 10:55:17 -08:00
Soren Brinkmann 70ecb564fd Migrate __warn_deprecated -> __deprecated
Use the new __deprecated macro from the generic cdefs header and remove
the deprecated __warn_deprecated.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-01-14 10:55:17 -08:00
Soren Brinkmann 70050dd10c cdefs.h: Introduce '__deprecated' macro
Introduce a macro to mark functions as deprecated.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-01-14 10:55:17 -08:00
danh-arm f9410b47c3 Merge pull request #487 from sandrine-bailleux/sb/cortex-a72
FVP: Compile ARM Cortex-A72 CPU support in
2016-01-14 12:24:17 +00:00
danh-arm 6770d65ff5 Merge pull request #485 from jcastillo-arm/jc/max_mmap_reg
Add 'MAX_MMAP_REGIONS' and 'ADDR_SPACE_SIZE' to the Porting Guide
2016-01-13 12:40:31 +00:00
danh-arm 6cf9b6ac54 Merge pull request #484 from jcastillo-arm/jc/tf-issues/337
cert_create: update help message
2016-01-13 11:42:30 +00:00
danh-arm e123b2a37a Merge pull request #483 from soby-mathew/sm/rm_struct_padding
Rearrange fields in TF data structures to reduce padding
2016-01-13 11:41:46 +00:00
danh-arm 0812d49cbd Merge pull request #482 from sandrine-bailleux/sb/cortex-a35
Add support for ARM Cortex-A35 processor
2016-01-13 11:36:43 +00:00
danh-arm af94b08c7b Merge pull request #481 from sandrine-bailleux/sb/fix-doc
Various documentation fixes
2016-01-13 11:15:07 +00:00
Juan Castillo 359b60d91c Add 'MAX_MMAP_REGIONS' and 'ADDR_SPACE_SIZE' to the Porting Guide
This patch adds a brief description of 'MAX_MMAP_REGIONS' and
'ADDR_SPACE_SIZE' to the Porting Guide. These fields must be defined
by the platform in order to use the translation table library.

Change-Id: Ida366458fe2bc01979091a014dc38da0fae5991e
2016-01-13 11:05:21 +00:00
Soby Mathew b313d755a7 Rearrange fields in TF data structures to reduce padding
This patch rearranges fields of the `image_desc_t` & `auth_img_desc_t`
data structures to reduce padding between the fields and thereby
save memory.

NOTE: Platform ports which anonymously initialize these structures
should be aware of the rearrangement and do the required
modification.

Change-Id: I428b5429632797b31d5bd306174599c07e24c060
2016-01-13 09:39:40 +00:00
Soby Mathew 7b3aabc0cf Use designated initialization in DECLARE_RT_SVC macro
This patch changes the anonymous initialization of `rt_svc_desc_t` structure
by the `DECLARE_RT_SVC` macro to designated initialization. This makes the
code more robust and less sensitive to potential changes to the
`rt_svc_desc_t` structure.

Change-Id: If6f1586730c0d29d92ef09e07eff7dd0d22857c7
2016-01-13 09:39:11 +00:00
Sandrine Bailleux b13ed5efc2 FVP: Compile ARM Cortex-A72 CPU support in
This patch enables the ARM Cortex-A72 support in BL1 and BL31 on FVP.
This allows the same TF binaries to run on a Cortex-A72 based FVP
without recompiling them.

Change-Id: I4eb6bbad9f0e5d8704613f7c685c3bd22b45cf47
2016-01-13 09:14:12 +00:00
Sandrine Bailleux fcb22cf0f4 Documentation: Fix broken links in ToCs
Change-Id: I4fcdb8e813e0392c2cd3d0623698e8319b3b0593
2016-01-12 11:19:39 +00:00
Sandrine Bailleux 820756e933 Add support for ARM Cortex-A35 processor
This patch adds support for ARM Cortex-A35 processor in the CPU
specific framework, as described in the Cortex-A35 TRM (r0p0).

Change-Id: Ief930a0bdf6cd82f6cb1c3b106f591a71c883464
2016-01-12 09:25:12 +00:00
Sandrine Bailleux de849c8c4f Fixes in CPU specific operations framework doc
This patch fixes a couple of issues in the "CPU specific operations
framework" section in the Firmware Design document.

 * Fix broken link to the CPU Specific Build Macros document.

 * Fix the path to the cortex_a53.S file.

 * Fix power levels terminology.

Change-Id: Ib610791eaba13dab2823b7699bb63534bcd1c8fb
2016-01-08 10:34:00 +00:00
Juan Castillo 159807e2fa cert_create: update help message
The help message printed by the cert_create tool using the command
line option -h (or --help) does not correctly list all the available
command line options.

This patch reworks the print_help() function to print the help
messages in a data driven approach. For each command line option
registered, an optional help message can be specified, which will
be printed by print_help().

Help messages for the TBBR options (certificates, keys and images)
are also provided.

Fix a small bug in the short options string passed to getopt_long:
the ':' was missing in the '-a' option (this option must take an
argument).

Fixes ARM-software/tf-issues#337

Change-Id: I9d08c2dfd349022808fcc884724f677eefdc1452
2016-01-07 14:48:27 +00:00
danh-arm 5773b5322d Merge pull request #479 from jcastillo-arm/jc/tbbr_fip
Apply TBBR naming convention to the fip_create options
2016-01-06 14:51:07 +00:00
danh-arm d37b2098f7 Merge pull request #478 from sandrine-bailleux/sb/mbed-tls-pedantic
Always build with '-pedantic'
2016-01-06 14:50:15 +00:00
danh-arm 4a900a2aa0 Merge pull request #477 from mtk09422/console_uninit
Add ret to return from console_uninit() function
2016-01-06 14:49:06 +00:00
Juan Castillo 8f0617ef9e Apply TBBR naming convention to the fip_create options
The fip_create tool specifies images in the command line using the
ARM TF naming convention (--bl2, --bl31, etc), while the cert_create
tool uses the TBBR convention (--tb-fw, --soc-fw, etc). This double
convention is confusing and should be aligned.

This patch updates the fip_create command line options to follow the
TBBR naming convention. Usage examples in the User Guide have been
also updated.

NOTE: users that build the FIP by calling the fip_create tool directly
from the command line must update the command line options in their
scripts. Users that build the FIP by invoking the main ARM TF Makefile
should not notice any difference.

Change-Id: I84d602630a2585e558d927b50dfde4dd2112496f
2016-01-05 11:55:36 +00:00
Sandrine Bailleux aa856917ab Always build with '-pedantic'
By default ARM TF is built with the '-pedantic' compiler flag, which
helps detecting violations of the C standard. However, the mbed TLS
library and its associated authentication module in TF used to fail
building with this compiler flag. As a workaround, the mbed TLS
authentication module makefile used to set the 'DISABLE_PEDANTIC'
TF build flag.

The compiler errors flagged by '-pedantic' in the mbed TLS library
have been fixed between versions 1.3.9 and 2.2.0 and the library now
properly builds with this compiler flag.

This patch fixes the remaining compiler errors in the mbed TLS
authentication module in TF and unsets the 'DISABLE_PEDANTIC' TF
build flag. This means that TF is now always built with '-pedantic'.

In particular, this patch:

 * Removes the final semi-colon in REGISTER_COT() macro.

   This semi-colon was causing the following error message:

   drivers/auth/tbbr/tbbr_cot.c:544:23: error: ISO C does not allow
   extra ';' outside of a function [-Werror=pedantic]

   This has been fixed both in the mbed TLS authentication module
   as well as in the certificate generation tool. Note that the latter
   code didn't need fixing since it is not built with '-pedantic' but
   the change has been propagated for consistency.

   Also fixed the REGISTER_KEYS() and REGISTER_EXTENSIONS() macros,
   which were suffering from the same issue.

 * Fixes a pointer type.

   It was causing the following error message:

   drivers/auth/mbedtls/mbedtls_crypto.c: In function 'verify_hash':
   drivers/auth/mbedtls/mbedtls_crypto.c:177:42: error: pointer of
   type 'void *' used in arithmetic [-Werror=pointer-arith]

Change-Id: I7b7a04ef711efd65e17b5be26990d1a0d940257d
2016-01-05 11:41:08 +00:00
Jimmy Huang c85a15fcbe Add ret to return from console_uninit() function
The 'ret' was missing in console_uninit() implementation, so the
program doesn't return from console_uninit(). Instead, it keeps
executing the following instructions which is not expected.

Change-Id: I810684f37f61c41c6f95a3bb36914d0765da8571
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
2016-01-04 09:49:39 +08:00