summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-layerscape/ppa.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-11-28 10:28:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-28 10:30:21 +0100
commit3885852d87f49f6c32f5deb0fb4577e450ce23a7 (patch)
treefe5da499c5244e921f1db1e7b183c0c0950c5a80 /arch/arm/mach-layerscape/ppa.c
parent2237de0cb5638258135fcf104d570ccf9e0971a1 (diff)
downloadbarebox-3885852d87f49f6c32f5deb0fb4577e450ce23a7.tar.gz
barebox-3885852d87f49f6c32f5deb0fb4577e450ce23a7.tar.xz
ARM: Layerscape: PPA: Disable CAAM JR used by secure firmware
JR3 is used by the secure firmware. We have to remove the node from the Linux device tree to prevent Linux from using it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-layerscape/ppa.c')
-rw-r--r--arch/arm/mach-layerscape/ppa.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
index 6070451020..c5eba35b33 100644
--- a/arch/arm/mach-layerscape/ppa.c
+++ b/arch/arm/mach-layerscape/ppa.c
@@ -18,14 +18,33 @@
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);
}