1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: #include <sys/machine.h>
15: #ifdef CPU_CORE_ARMV7A
16:
17: 18: 19: 20:
21:
22: #include <kernel.h>
23: #include "../../../sysdepend.h"
24:
25:
26: Noinit(EXPORT FP knl_intvec_tbl[N_INTVEC]);
27:
28:
29: Noinit(EXPORT FP knl_hll_inthdr_tbl[N_INTVEC]);
30:
31:
32: EXPORT const FP knl_svcvec_tbl[N_SVCHDR] = {
33: NULL, NULL, NULL, NULL, NULL, NULL,
34: NULL,
35: knl_dispatch_to_schedtsk,
36: knl_dispatch_entry,
37: NULL,
38: NULL
39: };
40:
41:
42: 43: 44:
45: EXPORT ER knl_define_inthdr( INT intno, ATR intatr, FP inthdr )
46: {
47: if((inthdr != NULL) && ((intatr & TA_HLNG) != 0 )) {
48: knl_hll_inthdr_tbl[intno] = inthdr;
49: inthdr = knl_hll_inthdr;
50: }
51: knl_intvec_tbl[intno] = inthdr;
52:
53: return E_OK;
54: }
55:
56:
57: 58: 59:
60:
61:
62: LOCAL const UW GICD_ICFGR_inival[] =
63: {
64: 0xAAAAAAAAuL,
65: 0x55540000uL,
66: 0xFD555555uL,
67: 0x7FFFFFFFuL,
68: 0x55555555uL,
69: 0xD57F5555uL,
70: 0xFFFFFFFFuL,
71: 0xFFFFFFFFuL,
72: 0xFFFFFFFFuL,
73: 0xFFFFFFFFuL,
74: 0xFFFFFFFFuL,
75: 0xFFFFFFFFuL,
76: 0xFFFFFFFFuL,
77: 0xFFFFFFFFuL,
78: 0xFFFFFFFFuL,
79: 0x7D5FD57FuL,
80: 0x557D7DDFuL,
81: 0x557D557DuL,
82: 0x5555557DuL,
83: 0x55555555uL,
84: 0xF5555555uL,
85: 0x5555FFFFuL,
86: 0x55555555uL,
87: 0xFFDD5555uL,
88: 0xFFFFFFFFuL,
89: 0xFFFFFFFFuL,
90: 0xFFFFFFFFuL,
91: 0x5FFFFFDFuL,
92: 0x55555555uL,
93: 0x55555555uL,
94: 0x55555555uL,
95: 0x55555555uL,
96: };
97:
98: EXPORT ER knl_init_interrupt( void )
99: {
100: INT i;
101: _UW *reg;
102:
103:
104: for(i = 0; i < N_INTVEC; i++) knl_intvec_tbl[i] = (FP)NULL;
105:
106:
107: knl_define_inthdr(INTNO_SYSTICK, TA_HLNG, (FP)knl_timer_handler);
108:
109:
110: reg = (_UW*)GICD_IGROUPR(0);
111: for (i = 0; i < GICD_IGROUPR_N; i++) {
112: reg[i] = 0x00000000uL;
113: }
114:
115: reg = (_UW*)GICD_ICFGR(0);
116: for (i = 0; i < GICD_ICFGR_N; i++) {
117: reg[i] = GICD_ICFGR_inival[i];
118: }
119:
120: reg = (_UW*)GICD_IPRIORITYR(0);
121: for (i = 0; i < GICD_IPRIORITYR_N; i++) {
122: reg[i] = 0xF8F8F8F8uL;
123: }
124:
125: reg = (_UW*)GICD_ITARGETR(0);
126: for (i = 8; i < GICD_ITARGETR_N; i++) {
127: reg[i] = 0x01010101uL;
128: }
129:
130: reg = (_UW*)GICD_ICENABLER(0);
131: for (i = 0; i < GICD_ICENABLER_N; i++) {
132: reg[i] = 0xFFFFFFFFuL;
133: }
134:
135: out_w(GICC_PMR, 31<<3);
136: out_w(GICC_BPR, 0x00000002UL);
137: out_w(GICC_CTLR, 0x00000003UL);
138: out_w(GICD_CTLR, 0x00000001uL);
139:
140: return E_OK;
141: }
142:
143: #endif