PSCI: Do not flush cache when unneeded
authorAndrew F. Davis <afd@ti.com>
Thu, 30 Aug 2018 17:13:57 +0000 (12:13 -0500)
committerAndrew F. Davis <afd@ti.com>
Wed, 10 Oct 2018 18:07:56 +0000 (13:07 -0500)
When a platform enables its caches before it accesses the
psci_non_cpu_pd_nodes structure then explicit cache maintenance
is not needed.

Signed-off-by: Andrew F. Davis <afd@ti.com>
lib/psci/psci_common.c

index 3bc03c884d4e92a30b4b82710e2707238422d26c..97aeb8323ac81058a60a89c0c60d582bb0ca6586 100644 (file)
@@ -267,7 +267,7 @@ static plat_local_state_t *psci_get_req_local_pwr_states(unsigned int pwrlvl,
 static plat_local_state_t get_non_cpu_pd_node_local_state(
                unsigned int parent_idx)
 {
-#if !(USE_COHERENT_MEM || HW_ASSISTED_COHERENCY)
+#if !(USE_COHERENT_MEM || HW_ASSISTED_COHERENCY || WARMBOOT_ENABLE_DCACHE_EARLY)
        flush_dcache_range(
                        (uintptr_t) &psci_non_cpu_pd_nodes[parent_idx],
                        sizeof(psci_non_cpu_pd_nodes[parent_idx]));
@@ -283,7 +283,7 @@ static void set_non_cpu_pd_node_local_state(unsigned int parent_idx,
                plat_local_state_t state)
 {
        psci_non_cpu_pd_nodes[parent_idx].local_state = state;
-#if !(USE_COHERENT_MEM || HW_ASSISTED_COHERENCY)
+#if !(USE_COHERENT_MEM || HW_ASSISTED_COHERENCY || WARMBOOT_ENABLE_DCACHE_EARLY)
        flush_dcache_range(
                        (uintptr_t) &psci_non_cpu_pd_nodes[parent_idx],
                        sizeof(psci_non_cpu_pd_nodes[parent_idx]));