Skip to contentSkip to conversation

ARM: prima2: add NetWork on Chip driver for atlas7

PATCH New Barry Song 1 participant 1 message Mar 25, 2015

Subsystems (3)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 ARM: prima2: add NetWork on Chip driver for atlas7

From: Guo Zeng <[email protected]>

CSR atlas7 uses a NoC bus, SoC is splitted into mutiple MACROs. Every MACRO holds some hardware modules.
All the devices connected to NoC MRCROs are described using sub-node to this MARCO. For example, AUDMSCM MARCO includes multimediam nodes such as KAS, AC97, IACC, I2S, USP0~3, LVDS etc.
For each MARCO, there is at least a firewall sub-node. This firewall can detect illegal hardware access for security protection.
For CPU access, an external abort will generate for it; for other DMA access, interrupts will trigger to CPU. In the abort and interrupt handlers, we can dump the status.

---
 .../devicetree/bindings/bus/atlas7-noc.txt         |  34 +
 arch/arm/mach-prima2/Kconfig                       |   8 +
 arch/arm/mach-prima2/Makefile                      |   2 +
 arch/arm/mach-prima2/common.c                      |   8 +
 arch/arm/mach-prima2/common.h                      |   6 +
 arch/arm/mach-prima2/noc.c                         | 931 +++++++++++++++++++++
 6 files changed, 989 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/atlas7-noc.txt
 create mode 100644 arch/arm/mach-prima2/noc.c
Documentation/devicetree/bindings/bus/atlas7-noc.txt new file +34 -0
new file mode 100644
index 0000000..449ddb5
@@ -0,0 +1,34 @@
+Device tree bindings for CSRatlas7 NoC(Network on Chip)
+
+CSR atlas7 uses a NoC bus, SoC is splitted into mutiple MACROs. Every MACRO
+holds some hardware modules. For each MACRO
+properties:
+- compatible : Should be "arteris, flexnoc"
+- #address-cells: should be 1
+- #size-cells: should be 1
+- ranges : the child address space are mapped 1:1 onto the parent address space
+
+Sub-nodes:
+All the devices connected to noc are described using sub-node to noc. For
+example, AUDMSCM MARCO includes multimediam nodes such as KAS, AC97, IACC, I2S,
+USP0~3, LVDS.
+For each MARCO, there is at least a firewall sub-node. This firewall can detect
+illegal hardware access for security protection.
+
+Firewall sub-nodes:
+properties:
+- compatible : Should be one of
+	"sirf,nocfw-cpum",
+	"sirf,nocfw-cgum",
+	"sirf,nocfw-btm",
+	"sirf,nocfw-gnssm",
+	"sirf,nocfw-gpum",
+	"sirf,nocfw-mediam",
+	"sirf,nocfw-vdifm",
+	"sirf,nocfw-audiom",
+	"sirf,nocfw-ddrm",
+	"sirf,nocfw-rtcm",
+	"sirf,nocfw-dramfw",
+	"sirf,nocfw-spramfw"
+- reg: A resource specifier for the register space
+- interrupts : Should be the interrupt number - optional
arch/arm/mach-prima2/Kconfig +8 -0
index 9ab8932..2500f8b 100644
@@ -42,4 +42,12 @@ config ARCH_PRIMA2
 config SIRF_IRQ
 	bool
 
+config ATLAS7DA_NOC
+        bool "CSR A7DA NOC"
+        default y
+	help
+          Support CSR SiRFSoC A7DA Platform NOC bus, with security dram/reg
+          firewall and related configure for validation, with errlog shown
+          on data abort or interrupt handler when bus transaction failed.
+
 endif
arch/arm/mach-prima2/Makefile +2 -0
index d7d02b0..1248418 100644
@@ -2,6 +2,8 @@ obj-y += rstc.o
 obj-y += common.o
 obj-y += rtciobrg.o
 obj-$(CONFIG_SUSPEND) += pm.o sleep.o
+
+obj-$(CONFIG_ATLAS7DA_NOC) += noc.o
 obj-$(CONFIG_SMP) += platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)  += hotplug.o
 
arch/arm/mach-prima2/common.c +8 -0
index 8cadb30..4a9dcad 100644
@@ -15,6 +15,13 @@
 #include <linux/of_platform.h>
 #include "common.h"
 
+static void __init sirfsoc_init_mach(void)
+{
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+	sirfsoc_noc_init();
+}
+
 static void __init sirfsoc_init_late(void)
 {
 	sirfsoc_pm_init();
@@ -60,6 +67,7 @@ static const char *const atlas7_dt_match[] __initconst = {
 DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
 	/* Maintainer: Barry Song <[email protected]> */
 	.smp            = smp_ops(sirfsoc_smp_ops),
+	.init_machine   = sirfsoc_init_mach,
 	.dt_compat      = atlas7_dt_match,
 MACHINE_END
 #endif
arch/arm/mach-prima2/common.h +6 -0
index 3916a66..122d8f9 100644
@@ -28,4 +28,10 @@ extern int sirfsoc_pm_init(void);
 static inline int sirfsoc_pm_init(void) { return 0; }
 #endif
 
+#ifdef CONFIG_ATLAS7DA_NOC
+extern int sirfsoc_noc_init(void);
+#else
+static inline void sirfsoc_noc_init(void) { return 0; }
+#endif
+
 #endif
arch/arm/mach-prima2/noc.c new file +931 -0

931 lines not on this page · raw message

Signature · 1 line
1.9.1