[rtems commit] bsps/arm: Fix GIC tm27 support

Sebastian Huber sebh at rtems.org
Wed Sep 10 08:35:10 UTC 2014


Module:    rtems
Branch:    master
Commit:    90f44cd2dd55a0a109d5a4423ba158e29b8f6fbf
Changeset: http://git.rtems.org/rtems/commit/?id=90f44cd2dd55a0a109d5a4423ba158e29b8f6fbf

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 10 10:41:35 2014 +0200

bsps/arm: Fix GIC tm27 support

---

 c/src/lib/libbsp/arm/shared/include/arm-gic-tm27.h |   44 +++++++++++++-------
 1 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/c/src/lib/libbsp/arm/shared/include/arm-gic-tm27.h b/c/src/lib/libbsp/arm/shared/include/arm-gic-tm27.h
index 0c61881..95f3077 100644
--- a/c/src/lib/libbsp/arm/shared/include/arm-gic-tm27.h
+++ b/c/src/lib/libbsp/arm/shared/include/arm-gic-tm27.h
@@ -7,7 +7,7 @@
  */
 
 /*
- * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2013-2014 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -34,17 +34,19 @@
 
 #define MUST_WAIT_FOR_INTERRUPT 1
 
-#define ARM_GIC_TM27_IRQ ARM_GIC_IRQ_SGI_13
+#define ARM_GIC_TM27_IRQ_LOW ARM_GIC_IRQ_SGI_12
 
-#define ARM_GIC_TM27_PRIO_LOW 0xfe
+#define ARM_GIC_TM27_IRQ_HIGH ARM_GIC_IRQ_SGI_13
+
+#define ARM_GIC_TM27_PRIO_LOW 0x80
 
 #define ARM_GIC_TM27_PRIO_HIGH 0x00
 
 static inline void Install_tm27_vector(void (*handler)(rtems_vector_number))
 {
   rtems_status_code sc = rtems_interrupt_handler_install(
-    ARM_GIC_TM27_IRQ,
-    "TM27",
+    ARM_GIC_TM27_IRQ_LOW,
+    "tm27 low",
     RTEMS_INTERRUPT_UNIQUE,
     (rtems_interrupt_handler) handler,
     NULL
@@ -52,16 +54,31 @@ static inline void Install_tm27_vector(void (*handler)(rtems_vector_number))
   assert(sc == RTEMS_SUCCESSFUL);
 
   sc = arm_gic_irq_set_priority(
-    ARM_GIC_TM27_IRQ,
+    ARM_GIC_TM27_IRQ_LOW,
     ARM_GIC_TM27_PRIO_LOW
   );
   assert(sc == RTEMS_SUCCESSFUL);
+
+  sc = rtems_interrupt_handler_install(
+    ARM_GIC_TM27_IRQ_HIGH,
+    "tm27 high",
+    RTEMS_INTERRUPT_UNIQUE,
+    (rtems_interrupt_handler) handler,
+    NULL
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  sc = arm_gic_irq_set_priority(
+    ARM_GIC_TM27_IRQ_HIGH,
+    ARM_GIC_TM27_PRIO_HIGH
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
 }
 
 static inline void Cause_tm27_intr(void)
 {
   rtems_status_code sc = arm_gic_irq_generate_software_irq(
-    ARM_GIC_TM27_IRQ,
+    ARM_GIC_TM27_IRQ_LOW,
     ARM_GIC_IRQ_SOFTWARE_IRQ_TO_SELF,
     0
   );
@@ -70,18 +87,15 @@ static inline void Cause_tm27_intr(void)
 
 static inline void Clear_tm27_intr(void)
 {
-  rtems_status_code sc = arm_gic_irq_set_priority(
-    ARM_GIC_TM27_IRQ,
-    ARM_GIC_TM27_PRIO_LOW
-  );
-  assert(sc == RTEMS_SUCCESSFUL);
+  /* Nothing to do */
 }
 
 static inline void Lower_tm27_intr(void)
 {
-  rtems_status_code sc = arm_gic_irq_set_priority(
-    ARM_GIC_TM27_IRQ,
-    ARM_GIC_TM27_PRIO_HIGH
+  rtems_status_code sc = arm_gic_irq_generate_software_irq(
+    ARM_GIC_TM27_IRQ_HIGH,
+    ARM_GIC_IRQ_SOFTWARE_IRQ_TO_SELF,
+    0
   );
   assert(sc == RTEMS_SUCCESSFUL);
 }



More information about the vc mailing list