summaryrefslogtreecommitdiffstats
path: root/board/freescale/common/ns_access.c
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-11-21 17:40:58 +0800
committerYork Sun <yorksun@freescale.com>2014-12-11 09:42:12 -0800
commite87f3b308c454f6e78b02da857936c7d012c385b (patch)
treeae3e48888d8c00e3e6fde259b239d1f8def06717 /board/freescale/common/ns_access.c
parent1a2826f6e02d0d3ec97b77b5b13c13d2ac27fb9d (diff)
downloadblackbird-obmc-uboot-e87f3b308c454f6e78b02da857936c7d012c385b.tar.gz
blackbird-obmc-uboot-e87f3b308c454f6e78b02da857936c7d012c385b.zip
ARM: ls102xa: allow all the peripheral access permission as R/W.
The Central Security Unit (CSU) allows secure world software to change the default access control policies of peripherals/bus slaves, determining which bus masters may access them. This allows peripherals to be separated into distinct security domains. Combined with SMMU configuration of the system masters privileges, these features provide protection against indirect unauthorized access to data. For now we configure all the peripheral access permissions as R/W. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/freescale/common/ns_access.c')
-rw-r--r--board/freescale/common/ns_access.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/board/freescale/common/ns_access.c b/board/freescale/common/ns_access.c
new file mode 100644
index 0000000000..d7de9822d0
--- /dev/null
+++ b/board/freescale/common/ns_access.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2014 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/ns_access.h>
+
+void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num)
+{
+ u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR;
+ u32 *reg;
+ uint32_t val;
+ int i;
+
+ for (i = 0; i < num; i++) {
+ reg = base + ns_dev[i].ind / 2;
+ val = in_be32(reg);
+ if (ns_dev[i].ind % 2 == 0) {
+ val &= 0x0000ffff;
+ val |= ns_dev[i].val << 16;
+ } else {
+ val &= 0xffff0000;
+ val |= ns_dev[i].val;
+ }
+ out_be32(reg, val);
+ }
+}
OpenPOWER on IntegriCloud