Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356458
b: refs/heads/master
c: 7c509ee
h: refs/heads/master
v: v3
  • Loading branch information
Scott Wood authored and Kumar Gala committed Feb 15, 2013
1 parent ed7b758 commit 5799405
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52c5affc545053d37c0b05224bbf70f5336caa20
refs/heads/master: 7c509ee01496a170fe4329f076c334591b6f49d0
26 changes: 23 additions & 3 deletions trunk/arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
const char *vers;
const u32 *psrc;
u32 last_irq;
u32 fsl_version = 0;

/* Default MPIC search parameters */
static const struct of_device_id __initconst mpic_device_id[] = {
Expand Down Expand Up @@ -1314,7 +1315,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
mpic_map(mpic, mpic->paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);

if (mpic->flags & MPIC_FSL) {
u32 brr1, version;
u32 brr1;
int ret;

/*
Expand All @@ -1327,7 +1328,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,

brr1 = _mpic_read(mpic->reg_type, &mpic->thiscpuregs,
MPIC_FSL_BRR1);
version = brr1 & MPIC_FSL_BRR1_VER;
fsl_version = brr1 & MPIC_FSL_BRR1_VER;

/* Error interrupt mask register (EIMR) is required for
* handling individual device error interrupts. EIMR
Expand All @@ -1342,11 +1343,30 @@ struct mpic * __init mpic_alloc(struct device_node *node,
* is the number of vectors which have been consumed by
* ipis and timer interrupts.
*/
if (version >= 0x401) {
if (fsl_version >= 0x401) {
ret = mpic_setup_error_int(mpic, intvec_top - 12);
if (ret)
return NULL;
}

}

/*
* EPR is only available starting with v4.0. To support
* platforms that don't know the MPIC version at compile-time,
* such as qemu-e500, turn off coreint if this MPIC doesn't
* support it. Note that we never enable it if it wasn't
* requested in the first place.
*
* This is done outside the MPIC_FSL check, so that we
* also disable coreint if the MPIC node doesn't have
* an "fsl,mpic" compatible at all. This will be the case
* with device trees generated by older versions of QEMU.
* fsl_version will be zero if MPIC_FSL is not set.
*/
if (fsl_version < 0x400 && (flags & MPIC_ENABLE_COREINT)) {
WARN_ON(ppc_md.get_irq != mpic_get_coreint_irq);
ppc_md.get_irq = mpic_get_irq;
}

/* Reset */
Expand Down

0 comments on commit 5799405

Please sign in to comment.