Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154858
b: refs/heads/master
c: 0365070
h: refs/heads/master
v: v3
  • Loading branch information
Tim Anderson authored and Ralf Baechle committed Jul 3, 2009
1 parent cb6cc26 commit 407a748
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 63 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: a214cef9a5d06894785dca1f967c9c324cc84c17
refs/heads/master: 0365070f05f12f1648b4adf22cfb52ec7a8a371c
2 changes: 1 addition & 1 deletion trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ config MIPS_MALTA
select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_SUPPORTS_MIPS_CMP if BROKEN # because SYNC_R4K is broken
select SYS_SUPPORTS_MIPS_CMP
select SYS_SUPPORTS_MULTITHREADING
select SYS_SUPPORTS_SMARTMIPS
help
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/mips/include/asm/amon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Amon support
*/

int amon_cpu_avail(int);
void amon_cpu_start(int, unsigned long, unsigned long,
unsigned long, unsigned long);
2 changes: 2 additions & 0 deletions trunk/arch/mips/include/asm/gic.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,7 @@ extern void gic_init(unsigned long gic_base_addr,

extern unsigned int gic_get_int(void);
extern void gic_send_ipi(unsigned int intr);
extern unsigned int plat_ipi_call_int_xlate(unsigned int);
extern unsigned int plat_ipi_resched_int_xlate(unsigned int);

#endif /* _ASM_GICREGS_H */
66 changes: 5 additions & 61 deletions trunk/arch/mips/kernel/smp-cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,80 +37,24 @@
#include <asm/mipsregs.h>
#include <asm/mipsmtregs.h>
#include <asm/mips_mt.h>

/*
* Crude manipulation of the CPU masks to control which
* which CPU's are brought online during initialisation
*
* Beware... this needs to be called after CPU discovery
* but before CPU bringup
*/
static int __init allowcpus(char *str)
{
cpumask_t cpu_allow_map;
char buf[256];
int len;

cpus_clear(cpu_allow_map);
if (cpulist_parse(str, &cpu_allow_map) == 0) {
cpu_set(0, cpu_allow_map);
cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
buf[len] = '\0';
pr_debug("Allowable CPUs: %s\n", buf);
return 1;
} else
return 0;
}
__setup("allowcpus=", allowcpus);
#include <asm/amon.h>
#include <asm/gic.h>

static void ipi_call_function(unsigned int cpu)
{
unsigned int action = 0;

pr_debug("CPU%d: %s cpu %d status %08x\n",
smp_processor_id(), __func__, cpu, read_c0_status());

switch (cpu) {
case 0:
action = GIC_IPI_EXT_INTR_CALLFNC_VPE0;
break;
case 1:
action = GIC_IPI_EXT_INTR_CALLFNC_VPE1;
break;
case 2:
action = GIC_IPI_EXT_INTR_CALLFNC_VPE2;
break;
case 3:
action = GIC_IPI_EXT_INTR_CALLFNC_VPE3;
break;
}
gic_send_ipi(action);
gic_send_ipi(plat_ipi_call_int_xlate(cpu));
}


static void ipi_resched(unsigned int cpu)
{
unsigned int action = 0;

pr_debug("CPU%d: %s cpu %d status %08x\n",
smp_processor_id(), __func__, cpu, read_c0_status());

switch (cpu) {
case 0:
action = GIC_IPI_EXT_INTR_RESCHED_VPE0;
break;
case 1:
action = GIC_IPI_EXT_INTR_RESCHED_VPE1;
break;
case 2:
action = GIC_IPI_EXT_INTR_RESCHED_VPE2;
break;
case 3:
action = GIC_IPI_EXT_INTR_RESCHED_VPE3;
break;
}
gic_send_ipi(action);
gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
}

/*
Expand Down Expand Up @@ -206,7 +150,7 @@ static void cmp_boot_secondary(int cpu, struct task_struct *idle)
(unsigned long)(gp + sizeof(struct thread_info)));
#endif

amon_cpu_start(cpu, pc, sp, gp, a0);
amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0);
}

/*
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/mips/mti-malta/malta-int.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ static int gic_resched_int_base;
static int gic_call_int_base;
#define GIC_RESCHED_INT(cpu) (gic_resched_int_base+(cpu))
#define GIC_CALL_INT(cpu) (gic_call_int_base+(cpu))

unsigned int plat_ipi_call_int_xlate(unsigned int cpu)
{
return GIC_CALL_INT(cpu);
}

unsigned int plat_ipi_resched_int_xlate(unsigned int cpu)
{
return GIC_RESCHED_INT(cpu);
}
#endif /* CONFIG_MIPS_MT_SMP */

static struct irqaction i8259irq = {
Expand Down

0 comments on commit 407a748

Please sign in to comment.