summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-layerscape/ppa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-layerscape/ppa.c')
-rw-r--r--arch/arm/mach-layerscape/ppa.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
index 6070451020..477e894781 100644
--- a/arch/arm/mach-layerscape/ppa.c
+++ b/arch/arm/mach-layerscape/ppa.c
@@ -14,18 +14,37 @@
#include <image-fit.h>
#include <asm/psci.h>
#include <mach/layerscape.h>
+#include <asm/cache.h>
int ppa_entry(const void *, u32 *, u32 *);
-void dma_flush_range(void *ptr, size_t size);
+
+#define SEC_JR3_OFFSET 0x40000
static int of_psci_do_fixup(struct device_node *root, void *unused)
{
unsigned long psci_version;
+ struct device_node *np;
struct arm_smccc_res res = {};
arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
psci_version = res.a0;
+ for_each_compatible_node_from(np, root, NULL, "fsl,sec-v4.0-job-ring") {
+ const void *reg;
+ int na = of_n_addr_cells(np);
+ u64 offset;
+
+ reg = of_get_property(np, "reg", NULL);
+ if (!reg)
+ continue;
+
+ offset = of_read_number(reg, na);
+ if (offset != SEC_JR3_OFFSET)
+ continue;
+
+ of_delete_node(np);
+ }
+
return of_psci_fixup(root, psci_version);
}
@@ -73,7 +92,7 @@ static int ppa_init(void *ppa, size_t ppa_size, void *sec_firmware_addr)
/* Copy the secure firmware to secure memory */
memcpy(sec_firmware_addr, buf, firmware_size);
- dma_flush_range(sec_firmware_addr, ppa_size);
+ sync_caches_for_execution();
ret = ppa_entry(sec_firmware_addr, boot_loc_ptr_l, boot_loc_ptr_h);
if (ret) {