Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225717
b: refs/heads/master
c: e2305e3
h: refs/heads/master
i:
  225715: a9a72fa
v: v3
  • Loading branch information
Daniel Hellstrom authored and David S. Miller committed Jan 4, 2011
1 parent 4ded909 commit 2fde1e8
Show file tree
Hide file tree
Showing 4 changed files with 30 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: 53aea7caf2e27108912b9b9dbc5bfe18dbbaec9d
refs/heads/master: e2305e37d4c82ef55be54e9edc8a7e2250739b4f
12 changes: 12 additions & 0 deletions trunk/arch/sparc/include/asm/leon.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ static inline void sparc_leon3_disable_cache(void)
"sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2");
};

static inline unsigned long sparc_leon3_asr17(void)
{
u32 asr17;
__asm__ __volatile__ ("rd %%asr17, %0\n\t" : "=r"(asr17));
return asr17;
};

static inline int sparc_leon3_cpuid(void)
{
return sparc_leon3_asr17() >> 28;
}

#endif /*!__ASSEMBLY__*/

#ifdef CONFIG_SMP
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/sparc/include/asm/leon_amba.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ struct leon3_irqctrl_regs_map {
u32 mpbroadcast;
u32 notused02;
u32 notused03;
u32 notused10;
u32 notused11;
u32 notused12;
u32 ampctrl;
u32 icsel[2];
u32 notused13;
u32 notused20;
u32 notused21;
Expand All @@ -112,6 +111,7 @@ struct leon3_irqctrl_regs_map {
u32 force[16];
/* Extended IRQ registers */
u32 intid[16]; /* 0xc0 */
u32 unused[(0x1000-0x100)/4];
};

struct leon3_apbuart_regs_map {
Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/sparc/kernel/leon_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void __init leon_init_timers(irq_handler_t counter_fn)
struct device_node *rootnp, *np;
struct property *pp;
int len;
int cpu, icsel;

leondebug_irq_disable = 0;
leon_debug_irqout = 0;
Expand Down Expand Up @@ -160,6 +161,19 @@ void __init leon_init_timers(irq_handler_t counter_fn)
LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0);
# endif

/*
* The IRQ controller may (if implemented) consist of multiple
* IRQ controllers, each mapped on a 4Kb boundary.
* Each CPU may be routed to different IRQCTRLs, however
* we assume that all CPUs (in SMP system) is routed to the
* same IRQ Controller, and for non-SMP only one IRQCTRL is
* accessed anyway.
* In AMP systems, Linux must run on CPU0 for the time being.
*/
cpu = sparc_leon3_cpuid();
icsel = LEON3_BYPASS_LOAD_PA(&leon3_irqctrl_regs->icsel[cpu/8]);
icsel = (icsel >> ((7 - (cpu&0x7)) * 4)) & 0xf;
leon3_irqctrl_regs += icsel;
} else {
goto bad;
}
Expand Down

0 comments on commit 2fde1e8

Please sign in to comment.