36 #define GRLIB_IO_AREA 0xfff00000 39 #define GRLIB_CONF_AREA 0xff000 40 #define GRLIB_AHB_SLAVE_CONF_AREA (1 << 11) 42 #define GRLIB_AHB_CONF_WORDS 8 43 #define GRLIB_APB_CONF_WORDS 2 44 #define GRLIB_AHB_MASTERS 64 45 #define GRLIB_AHB_SLAVES 64 46 #define GRLIB_APB_SLAVES 16 48 #if defined(RTEMS_MULTIPROCESSING) 49 #define GRLIB_CLOCK_INDEX \ 50 (rtems_configuration_get_user_multiprocessing_table() ? GRLIB_Cpu_Index : 0) 52 #define GRLIB_CLOCK_INDEX 0 55 #if defined(RTEMS_SMP) 56 #define GRLIB_COUNTER_GPTIMER_INDEX (GRLIB_CLOCK_INDEX + 1) 58 #define GRLIB_COUNTER_GPTIMER_INDEX GRLIB_CLOCK_INDEX 61 #define GRLIB_GPTIMER_0_FREQUENCY_SET_BY_BOOT_LOADER 1000000 63 #define GRLIB_IRQMPSTATUS_CPUNR 28 75 extern uint32_t GRLIB_Cpu_Index;
76 extern const unsigned char GRLIB_mp_irq;
78 extern volatile struct irqmp_regs *GRLIB_IrqCtrl_Regs;
80 extern int GRLIB_IrqCtrl_EIrq;
83 void gptimer_initialize(
void);
84 void irqmp_initialize(
void);
86 static inline uint32_t grlib_up_counter_frequency(
void)
92 return ambapp_freq_get(&ambapp_plb, GRLIB_IrqCtrl_Adev);
98 static inline uint32_t grlib_get_cpu_count(
102 uint32_t mpstat = irqmp->mpstat;
104 return ((mpstat >> GRLIB_IRQMPSTATUS_CPUNR) & 0xf) + 1;
107 #define GRLIB_IRQCTRL_ACQUIRE( _lock_context ) \ 108 rtems_interrupt_lock_acquire( &GRLIB_IrqCtrl_Lock, _lock_context ) 110 #define GRLIB_IRQCTRL_RELEASE( _lock_context ) \ 111 rtems_interrupt_lock_release( &GRLIB_IrqCtrl_Lock, _lock_context ) 113 #define GRLIB_Cpu_Unmask_interrupt( _source, _cpu ) \ 115 rtems_interrupt_lock_context _lock_context; \ 116 GRLIB_IRQCTRL_ACQUIRE( &_lock_context ); \ 117 GRLIB_IrqCtrl_Regs->mask[_cpu] |= (1U << (_source)); \ 118 GRLIB_IRQCTRL_RELEASE( &_lock_context ); \ 121 #define GRLIB_Cpu_Mask_interrupt( _source, _cpu ) \ 123 rtems_interrupt_lock_context _lock_context; \ 124 GRLIB_IRQCTRL_ACQUIRE( &_lock_context ); \ 125 GRLIB_IrqCtrl_Regs->mask[_cpu] &= ~(1U << (_source)); \ 126 GRLIB_IRQCTRL_RELEASE( &_lock_context ); \ 129 #define GRLIB_Enable_interrupt_broadcast( _source ) \ 131 rtems_interrupt_lock_context _lock_context; \ 132 uint32_t _mask = 1U << ( _source ); \ 133 GRLIB_IRQCTRL_ACQUIRE( &_lock_context ); \ 134 GRLIB_IrqCtrl_Regs->bcast |= _mask; \ 135 GRLIB_IRQCTRL_RELEASE( &_lock_context ); \ 138 #define GRLIB_Disable_interrupt_broadcast( _source ) \ 140 rtems_interrupt_lock_context _lock_context; \ 141 uint32_t _mask = 1U << ( _source ); \ 142 GRLIB_IRQCTRL_ACQUIRE( &_lock_context ); \ 143 GRLIB_IrqCtrl_Regs->bcast &= ~_mask; \ 144 GRLIB_IRQCTRL_RELEASE( &_lock_context ); \ 147 #define BSP_Cpu_Is_interrupt_masked( _source, _cpu ) \ 148 (!(GRLIB_IrqCtrl_Regs->mask[_cpu] & (1U << (_source))))
ISR lock control.
Definition: isrlock.h:56
Common GRLIB AMBA Core Register definitions.