@ -47,7 +47,7 @@
( GIC_HIGHEST_NS_PRIORITY < < 16 ) | \
( GIC_HIGHEST_NS_PRIORITY < < 24 ) )
static const unsigned in t * g_irq_sec_ptr ;
static const irq_sec_cfg_ t * g_irq_sec_ptr ;
static unsigned int g_num_irqs ;
/*******************************************************************************
@ -136,11 +136,9 @@ static void tegra_gic_distif_setup(unsigned int gicd_base)
/* Configure SPI secure interrupts now */
if ( g_irq_sec_ptr ) {
/* Read the target CPU mask */
target_cpus = TEGRA_SEC_IRQ_TARGET_MASK & GIC_TARGET_CPU_MASK ;
for ( index = 0 ; index < g_num_irqs ; index + + ) {
irq_num = g_irq_sec_ptr [ index ] ;
irq_num = ( g_irq_sec_ptr + index ) - > irq ;
target_cpus = ( g_irq_sec_ptr + index ) - > target_cpus ;
if ( irq_num > = MIN_SPI_ID ) {
@ -179,7 +177,7 @@ static void tegra_gic_distif_setup(unsigned int gicd_base)
gicd_write_ctlr ( gicd_base , ENABLE_GRP0 | ENABLE_GRP1 ) ;
}
void tegra_gic_setup ( const unsigned in t * irq_sec_ptr , unsigned int num_irqs )
void tegra_gic_setup ( const irq_sec_cfg_ t * irq_sec_ptr , unsigned int num_irqs )
{
g_irq_sec_ptr = irq_sec_ptr ;
g_num_irqs = num_irqs ;
@ -228,12 +226,17 @@ uint32_t tegra_gic_interrupt_type_to_line(uint32_t type,
uint32_t tegra_gic_get_pending_interrupt_type ( void )
{
uint32_t id ;
unsigned int index ;
id = gicc_read_hppir ( TEGRA_GICC_BASE ) & INT_ID_MASK ;
/* Assume that all secure interrupts are S-EL1 interrupts */
if ( id < 1022 )
return INTR_TYPE_S_EL1 ;
/* get the interrupt type */
if ( id < 1022 ) {
for ( index = 0 ; index < g_num_irqs ; index + + ) {
if ( id = = ( g_irq_sec_ptr + index ) - > irq )
return ( g_irq_sec_ptr + index ) - > type ;
}
}
if ( id = = GIC_SPURIOUS_INTERRUPT )
return INTR_TYPE_INVAL ;
@ -291,14 +294,19 @@ void tegra_gic_end_of_interrupt(uint32_t id)
uint32_t tegra_gic_get_interrupt_type ( uint32_t id )
{
uint32_t group ;
unsigned int index ;
group = gicd_get_igroupr ( TEGRA_GICD_BASE , id ) ;
/* Assume that all secure interrupts are S-EL1 interrupts */
if ( group = = GRP0 )
return INTR_TYPE_S_EL1 ;
else
return INTR_TYPE_NS ;
/* get the interrupt type */
if ( group = = GRP0 ) {
for ( index = 0 ; index < g_num_irqs ; index + + ) {
if ( id = = ( g_irq_sec_ptr + index ) - > irq )
return ( g_irq_sec_ptr + index ) - > type ;
}
}
return INTR_TYPE_NS ;
}
# else