Home | History | Annotate | Download | only in bfin

Lines Matching refs:cec

1 /* Blackfin Core Event Controller (CEC) model.
57 struct bfin_cec *cec = data;
58 hw_event_queue_deschedule (me, cec->pending);
59 _cec_raise (cec->cpu, cec, -1);
60 cec->pending = NULL;
63 bfin_cec_check_pending (struct hw *me, struct bfin_cec *cec)
65 if (cec->pending)
67 cec->pending = hw_event_queue_schedule (me, 0, bfin_cec_hw_event_callback, cec);
70 _cec_check_pending (SIM_CPU *cpu, struct bfin_cec *cec)
72 bfin_cec_check_pending (cec->me, cec);
76 _cec_imask_write (struct bfin_cec *cec, bu32 value)
78 cec->imask = (value & IVG_MASKABLE_B) | (cec->imask & IVG_UNMASKABLE_B);
85 struct bfin_cec *cec = hw_data (me);
94 mmr_off = addr - cec->base;
101 cec->evt_override = value;
104 _cec_imask_write (cec, value);
105 bfin_cec_check_pending (me, cec);
111 dv_w1c_4 (&cec->ilat, value, 0xffee);
114 cec->iprio = (value & IVG_UNMASKABLE_B);
125 struct bfin_cec *cec = hw_data (me);
133 mmr_off = addr - cec->base;
134 valuep = (void *)((uintptr_t)cec + mmr_base() + mmr_off);
167 struct bfin_cec *cec = hw_data (me);
168 _cec_raise (cec->cpu, cec, my_port);
172 attach_bfin_cec_regs (struct hw *me, struct bfin_cec *cec)
196 cec->base = attach_address;
198 cec->cpu = STATE_CPU (hw_system (me), 0);
199 cec->me = me;
205 struct bfin_cec *cec;
207 cec = HW_ZALLOC (me, struct bfin_cec);
209 set_hw_data (me, cec);
215 attach_bfin_cec_regs (me, cec);
217 /* Initialize the CEC. */
218 cec->imask = IVG_UNMASKABLE_B;
219 cec->ipend = IVG_RST_B | IVG_IRPTEN_B;
264 #define CEC_STATE(cpu) DV_STATE_CACHED (cpu, cec)
267 #define _cec_get_ivg(cec) __cec_get_ivg ((cec)->ipend & ~IVG_EMU_B)
282 _cec_is_supervisor_mode (struct bfin_cec *cec)
284 return (cec->ipend & ~(IVG_EMU_B | IVG_IRPTEN_B));
300 _cec_is_user_mode (struct bfin_cec *cec)
302 return !_cec_is_supervisor_mode (cec);
310 _cec_require_supervisor (SIM_CPU *cpu, struct bfin_cec *cec)
312 if (_cec_is_user_mode (cec))
342 - ILAT/IPEND in CEC is updated depending on current IVG level
432 struct bfin_cec *cec;
438 cec = CEC_STATE (cpu);
439 _cec_require_supervisor (cpu, cec);
442 old_mask = cec->imask;
443 _cec_imask_write (cec, 0);
445 TRACE_EVENTS (cpu, "CLI changed IMASK from %#x to %#x", old_mask, cec->imask);
452 struct bfin_cec *cec;
458 cec = CEC_STATE (cpu);
459 _cec_require_supervisor (cpu, cec);
462 old_mask = cec->imask;
463 _cec_imask_write (cec, ints);
465 TRACE_EVENTS (cpu, "STI changed IMASK from %#x to %#x", old_mask, cec->imask);
468 _cec_check_pending (cpu, cec);
472 cec_irpten_enable (SIM_CPU *cpu, struct bfin_cec *cec)
476 cec->ipend |= IVG_IRPTEN_B;
480 cec_irpten_disable (SIM_CPU *cpu, struct bfin_cec *cec)
484 cec->ipend &= ~IVG_IRPTEN_B;
488 _cec_raise (SIM_CPU *cpu, struct bfin_cec *cec, int ivg)
491 int curr_ivg = _cec_get_ivg (cec);
498 irpten = (cec->ipend & IVG_IRPTEN_B);
510 ivg = __cec_get_ivg (cec->ilat & cec->imask);
523 cec->ilat |= (1 << ivg);
548 else if (!(cec->imask & (1 << ivg)))
558 cec->ipend |= (1 << ivg);
559 cec->ilat &= ~(1 << ivg);
578 cec->ipend &= ~IVG_EMU_B;
609 if ((cec->evt_override & 0xff80) & (1 << ivg))
614 BFIN_TRACE_BRANCH (cpu, oldpc, PCREG, -1, "CEC changed PC (to EVT%i):", ivg);
619 cec_irpten_enable (cpu, cec);
639 TRACE_EVENTS (cpu, "now at EVT%i", _cec_get_ivg (cec));
657 struct bfin_cec *cec;
663 BFIN_TRACE_BRANCH (cpu, oldpc, PCREG, -1, "CEC changed PC");
667 cec = CEC_STATE (cpu);
668 cec->ilat |= (1 << ivg);
669 _cec_check_pending (cpu, cec);
683 struct bfin_cec *cec;
694 BFIN_TRACE_BRANCH (cpu, oldpc, PCREG, -1, "CEC changed PC");
698 cec = CEC_STATE (cpu);
701 cec->ipend &= ~IVG_EMU_B;
703 curr_ivg = _cec_get_ivg (cec);
718 _cec_require_supervisor (cpu, cec);
759 BFIN_TRACE_BRANCH (cpu, oldpc, PCREG, -1, "CEC changed PC (from EVT%i)", ivg);
762 knows current CEC state wrt overflow. */
764 cec->ipend &= ~(1 << ivg);
770 cec_irpten_disable (cpu, cec);
775 if (_cec_get_ivg (cec) == -1)
786 _cec_check_pending (cpu, cec);
795 struct bfin_cec *cec;
802 cec = CEC_STATE (cpu);
803 cec_irpten_disable (cpu, cec);
805 _cec_check_pending (cpu, cec);
814 struct bfin_cec *cec;
821 cec = CEC_STATE (cpu);
822 cec_irpten_enable (cpu, cec);