Browse Source

Optimize Cortex-A57 cluster power down sequence on Juno

This patch optimizes the Cortex-A57 cluster power down sequence by not
flushing the Level1 data cache. The L1 data cache and the L2 unified
cache are inclusive. A flush of the L2 by set/way flushes any dirty
lines from the L1 as well. This is a known safe deviation from the
Cortex-A57 TRM defined power down sequence. This optimization can be
enabled by the platform through the 'SKIP_A57_L1_FLUSH_PWR_DWN' build
flag. Each Cortex-A57 based platform must make its own decision on
whether to use the optimization.

This patch also renames the cpu-errata-workarounds.md to
cpu-specific-build-macros.md as this facilitates documentation
of both CPU Specific errata and CPU Specific Optimization
build macros.

Change-Id: I299b9fe79e9a7e08e8a0dffb7d345f9a00a71480
pull/218/head
Soby Mathew 10 years ago
parent
commit
5541bb3f61
  1. 5
      Makefile
  2. 35
      docs/cpu-specific-build-macros.md
  3. 5
      docs/firmware-design.md
  4. 3
      lib/cpus/aarch64/cortex_a57.S
  5. 9
      lib/cpus/cpu-ops.mk
  6. 4
      plat/juno/platform.mk

5
Makefile

@ -138,9 +138,10 @@ msg_start:
include plat/${PLAT}/platform.mk include plat/${PLAT}/platform.mk
# By default all CPU errata workarounds are disabled. This can be # Include the CPU specific operations makefile. By default all CPU errata
# workarounds and CPU specifc optimisations are disabled. This can be
# overridden by the platform. # overridden by the platform.
include lib/cpus/cpu-errata.mk include lib/cpus/cpu-ops.mk
ifdef BL1_SOURCES ifdef BL1_SOURCES
NEED_BL1 := yes NEED_BL1 := yes

35
docs/cpu-errata-workarounds.md → docs/cpu-specific-build-macros.md

@ -1,5 +1,22 @@
ARM CPU Errata Workarounds ARM CPU Specific Build Macros
========================== =============================
Contents
--------
1. Introduction
2. CPU Errata Workarounds
3. CPU Specific optimizations
1. Introduction
----------------
This document describes the various build options present in the CPU specific
operations framework to enable errata workarounds and to enable optimizations
for a specific CPU on a platform.
2. CPU Errata Workarounds
--------------------------
ARM Trusted Firmware exports a series of build flags which control the ARM Trusted Firmware exports a series of build flags which control the
errata workarounds that are applied to each CPU by the reset handler. The errata workarounds that are applied to each CPU by the reset handler. The
@ -33,6 +50,20 @@ For Cortex-A57, following errata build flags are defined :
* `ERRATA_A57_813420`: This applies errata 813420 workaround to Cortex-A57 * `ERRATA_A57_813420`: This applies errata 813420 workaround to Cortex-A57
CPU. This needs to be enabled only for revision r0p0 of the CPU. CPU. This needs to be enabled only for revision r0p0 of the CPU.
3. CPU Specific optimizations
------------------------------
This section describes some of the optimizations allowed by the CPU micro
architecture that can be enabled by the platform as desired.
* `SKIP_A57_L1_FLUSH_PWR_DWN`: This flag enables an optimization in the
Cortex-A57 cluster power down sequence by not flushing the Level 1 data
cache. The L1 data cache and the L2 unified cache are inclusive. A flush
of the L2 by set/way flushes any dirty lines from the L1 as well. This
is a known safe deviation from the Cortex-A57 TRM defined power down
sequence. Each Cortex-A57 based platform must make its own decision on
whether to use the optimization.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_Copyright (c) 2014, ARM Limited and Contributors. All rights reserved._ _Copyright (c) 2014, ARM Limited and Contributors. All rights reserved._

5
docs/firmware-design.md

@ -982,9 +982,10 @@ Please note that only 2. is mandated by the TRM.
The CPU specific operations framework scales to accommodate a large number of The CPU specific operations framework scales to accommodate a large number of
different CPUs during power down and reset handling. The platform can specify different CPUs during power down and reset handling. The platform can specify
any CPU optimization it wants to enable for each CPU. It can also specify
the CPU errata workarounds to be applied for each CPU type during reset the CPU errata workarounds to be applied for each CPU type during reset
handling by defining CPU errata compile time macros. Details on these macros handling by defining CPU errata compile time macros. Details on these macros
can be found in the [cpu-errata-workarounds.md][ERRW] file. can be found in the [cpu-specific-build-macros.md][CPUBM] file.
The CPU specific operations framework depends on the `cpu_ops` structure which The CPU specific operations framework depends on the `cpu_ops` structure which
needs to be exported for each type of CPU in the platform. It is defined in needs to be exported for each type of CPU in the platform. It is defined in
@ -1485,4 +1486,4 @@ _Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved._
[User Guide]: ./user-guide.md [User Guide]: ./user-guide.md
[Porting Guide]: ./porting-guide.md [Porting Guide]: ./porting-guide.md
[INTRG]: ./interrupt-framework-design.md [INTRG]: ./interrupt-framework-design.md
[ERRW]: ./cpu-errata-workarounds.md [CPUBM]: ./cpu-specific-build-macros.md.md

3
lib/cpus/aarch64/cortex_a57.S

@ -222,13 +222,14 @@ func cortex_a57_cluster_pwr_dwn
*/ */
bl cortex_a57_disable_l2_prefetch bl cortex_a57_disable_l2_prefetch
#if !SKIP_A57_L1_FLUSH_PWR_DWN
/* ------------------------------------------------- /* -------------------------------------------------
* Flush the L1 caches. * Flush the L1 caches.
* ------------------------------------------------- * -------------------------------------------------
*/ */
mov x0, #DCCISW mov x0, #DCCISW
bl dcsw_op_level1 bl dcsw_op_level1
#endif
/* --------------------------------------------- /* ---------------------------------------------
* Disable the optional ACP. * Disable the optional ACP.
* --------------------------------------------- * ---------------------------------------------

9
lib/cpus/cpu-errata.mk → lib/cpus/cpu-ops.mk

@ -28,6 +28,15 @@
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
# #
# Cortex A57 specific optimisation to skip L1 cache flush when
# cluster is powered down.
SKIP_A57_L1_FLUSH_PWR_DWN ?=0
# Process SKIP_A57_L1_FLUSH_PWR_DWN flag
$(eval $(call assert_boolean,SKIP_A57_L1_FLUSH_PWR_DWN))
$(eval $(call add_define,SKIP_A57_L1_FLUSH_PWR_DWN))
# CPU Errata Build flags. These should be enabled by the # CPU Errata Build flags. These should be enabled by the
# platform if the errata needs to be applied. # platform if the errata needs to be applied.

4
plat/juno/platform.mk

@ -99,3 +99,7 @@ NEED_BL30 := yes
# Enable workarounds for selected Cortex-A57 erratas. # Enable workarounds for selected Cortex-A57 erratas.
ERRATA_A57_806969 := 1 ERRATA_A57_806969 := 1
ERRATA_A57_813420 := 1 ERRATA_A57_813420 := 1
# Enable option to skip L1 data cache flush during the Cortex-A57 cluster
# power down sequence
SKIP_A57_L1_FLUSH_PWR_DWN := 1

Loading…
Cancel
Save