source: rtems/c/src/lib/libbsp/arm/edb7312/irq/irq.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*
2 * Cirrus EP7312 Intererrupt handler
3 *
4 * Copyright (c) 2010 embedded brains GmbH.
5 *
6 * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
7 *
8 * Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.org/license/LICENSE.
13*/
14
15#include <rtems/score/armv4.h>
16
17#include <bsp.h>
18#include <bsp/irq.h>
19#include <bsp/irq-generic.h>
20
21#include <ep7312.h>
22
23void edb7312_interrupt_dispatch(rtems_vector_number vector)
24{
25  bsp_interrupt_handler_dispatch(vector);
26}
27
28rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
29{
30    if(vector >= BSP_EXTFIQ && vector <= BSP_SSEOTI)
31    {
32        /* interrupt managed by INTMR1 and INTSR1 */
33        *EP7312_INTMR1 |= (1 << vector);
34    }
35    else if(vector >= BSP_KBDINT && vector <= BSP_SS2TX)
36    {
37        /* interrupt managed by INTMR2 and INTSR2 */
38        *EP7312_INTMR2 |= (1 << (vector - 16));
39    }
40    else if(vector >= BSP_UTXINT2 && vector <= BSP_URXINT2)
41    {
42        /* interrupt managed by INTMR2 and INTSR2 */
43        *EP7312_INTMR2 |= (1 << (vector - 7));
44    }
45    else if(vector == BSP_DAIINT)
46    {
47        /* interrupt managed by INTMR3 and INTSR3 */
48        *EP7312_INTMR3 |= (1 << (vector - 21));
49    }
50
51  return RTEMS_SUCCESSFUL;
52}
53
54rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
55{
56    if(vector >= BSP_EXTFIQ && vector <= BSP_SSEOTI)
57    {
58        /* interrupt managed by INTMR1 and INTSR1 */
59        *EP7312_INTMR1 &= ~(1 << vector);
60    }
61    else if(vector >= BSP_KBDINT && vector <= BSP_SS2TX)
62    {
63        /* interrupt managed by INTMR2 and INTSR2 */
64        *EP7312_INTMR2 &= ~(1 << (vector - 16));
65    }
66    else if(vector >= BSP_UTXINT2 && vector <= BSP_URXINT2)
67    {
68        /* interrupt managed by INTMR2 and INTSR2 */
69        *EP7312_INTMR2 &= ~(1 << (vector - 7));
70    }
71    else if(vector == BSP_DAIINT)
72    {
73        /* interrupt managed by INTMR3 and INTSR3 */
74        *EP7312_INTMR3 &= ~(1 << (vector - 21));
75    }
76
77  return RTEMS_SUCCESSFUL;
78}
79
80rtems_status_code bsp_interrupt_facility_initialize(void)
81{
82  uint32_t int_stat = 0;
83
84  /* mask all interrupts */
85  *EP7312_INTMR1 = 0x0;
86  *EP7312_INTMR2 = 0x0;
87  *EP7312_INTMR3 = 0x0;
88 
89  /* clear all pending interrupt status' */
90  int_stat = *EP7312_INTSR1;
91  if(int_stat & EP7312_INTR1_EXTFIQ)
92  {
93  }
94  if(int_stat & EP7312_INTR1_BLINT)
95  {
96      *EP7312_BLEOI = 0xFFFFFFFF;
97  }
98  if(int_stat & EP7312_INTR1_WEINT)
99  {
100      *EP7312_TEOI = 0xFFFFFFFF;
101  }
102  if(int_stat & EP7312_INTR1_MCINT)
103  {
104  }
105  if(int_stat & EP7312_INTR1_CSINT)
106  {
107      *EP7312_COEOI = 0xFFFFFFFF;
108  }
109  if(int_stat & EP7312_INTR1_EINT1)
110  {
111  }
112  if(int_stat & EP7312_INTR1_EINT2)
113  {
114  }
115  if(int_stat & EP7312_INTR1_EINT3)
116  {
117  }
118  if(int_stat & EP7312_INTR1_TC1OI)
119  {
120      *EP7312_TC1EOI = 0xFFFFFFFF;
121  }
122  if(int_stat & EP7312_INTR1_TC2OI)
123  {
124      *EP7312_TC2EOI = 0xFFFFFFFF;
125  }
126  if(int_stat & EP7312_INTR1_RTCMI)
127  {
128      *EP7312_RTCEOI = 0xFFFFFFFF;
129  }
130  if(int_stat & EP7312_INTR1_TINT)
131  {
132      *EP7312_TEOI = 0xFFFFFFFF;
133  }
134  if(int_stat & EP7312_INTR1_URXINT1)
135  {
136  }
137  if(int_stat & EP7312_INTR1_UTXINT1)
138  {
139  }
140  if(int_stat & EP7312_INTR1_UMSINT)
141  {
142      *EP7312_UMSEOI = 0xFFFFFFFF;
143  }
144  if(int_stat & EP7312_INTR1_SSEOTI)
145  {
146      *EP7312_SYNCIO;
147  }
148  int_stat = *EP7312_INTSR1;
149 
150  int_stat = *EP7312_INTSR2;
151  if(int_stat & EP7312_INTR2_KBDINT)
152  {
153      *EP7312_KBDEOI = 0xFFFFFFFF;
154  }
155  if(int_stat & EP7312_INTR2_SS2RX)
156  {
157  }
158  if(int_stat & EP7312_INTR2_SS2TX)
159  {
160  }
161  if(int_stat & EP7312_INTR2_URXINT2)
162  {
163  }
164  if(int_stat & EP7312_INTR2_UTXINT2)
165  {
166  }
167  int_stat = *EP7312_INTSR2;
168 
169  int_stat = *EP7312_INTSR3;
170  if(int_stat & EP7312_INTR2_DAIINT)
171  {
172  }
173  int_stat = *EP7312_INTSR3;
174
175  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
176
177  return RTEMS_SUCCESSFUL;
178}
Note: See TracBrowser for help on using the repository browser.