Skip to content

Commit

Permalink
MIPS: GCMP: Avoid accessing registers when they are not present
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Jaidev Patwardhan authored and Ralf Baechle committed Nov 2, 2009
1 parent 7098f74 commit 05cf207
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions arch/mips/mti-malta/malta-int.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
*/
int __init gcmp_probe(unsigned long addr, unsigned long size)
{
if (mips_revision_sconid != MIPS_REVISION_SCON_ROCIT) {
gcmp_present = 0;
return gcmp_present;
}

if (gcmp_present >= 0)
return gcmp_present;

Expand Down Expand Up @@ -479,9 +484,14 @@ void __init arch_init_irq(void)
GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
gic_present = 1;
} else {
_msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, MSC01_BIU_ADDRSPACE_SZ);
gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
MSC01_SC_CFG_GICPRES_MSK) >> MSC01_SC_CFG_GICPRES_SHF;
if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) {
_msc01_biu_base = (unsigned long)
ioremap_nocache(MSC01_BIU_REG_BASE,
MSC01_BIU_ADDRSPACE_SZ);
gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
MSC01_SC_CFG_GICPRES_MSK) >>
MSC01_SC_CFG_GICPRES_SHF;
}
}
if (gic_present)
pr_debug("GIC present\n");
Expand Down

0 comments on commit 05cf207

Please sign in to comment.