Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32796
b: refs/heads/master
c: 12157a8
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jul 21, 2006
1 parent 0bbb6b1 commit f55a2c1
Show file tree
Hide file tree
Showing 25 changed files with 308 additions and 313 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: 9df3f3d28bca0157e2bab2f3171d2ad4f0930634
refs/heads/master: 12157a8d78af50842774bedb80b7b84a87f60951
25 changes: 7 additions & 18 deletions trunk/arch/sparc/kernel/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <asm/page.h>
#include <asm/oplib.h>
#include <asm/prom.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/cpudata.h>
Expand All @@ -34,12 +35,6 @@ static int check_cpu_node(int nd, int *cur_inst,
int (*compare)(int, int, void *), void *compare_arg,
int *prom_node, int *mid)
{
char node_str[128];

prom_getstring(nd, "device_type", node_str, sizeof(node_str));
if (strcmp(node_str, "cpu"))
return -ENODEV;

if (!compare(nd, *cur_inst, compare_arg)) {
if (prom_node)
*prom_node = nd;
Expand All @@ -59,20 +54,14 @@ static int check_cpu_node(int nd, int *cur_inst,
static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
int *prom_node, int *mid)
{
int nd, cur_inst, err;
struct device_node *dp;
int cur_inst;

nd = prom_root_node;
cur_inst = 0;

err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
prom_node, mid);
if (!err)
return 0;

nd = prom_getchild(nd);
while ((nd = prom_getsibling(nd)) != 0) {
err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
prom_node, mid);
for_each_node_by_type(dp, "cpu") {
int err = check_cpu_node(dp->node, &cur_inst,
compare, compare_arg,
prom_node, mid);
if (!err)
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void handler_irq(int irq, struct pt_regs * regs)
disable_pil_irq(irq);
#ifdef CONFIG_SMP
/* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
if(irq < 10)
if((sparc_cpu_model==sun4m) && (irq < 10))
smp4m_irq_rotate(cpu);
#endif
action = sparc_irq[irq].action;
Expand Down
34 changes: 31 additions & 3 deletions trunk/arch/sparc/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,41 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
static int pil_to_sbus[] = {
0, 0, 1, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 0,
};
struct device_node *busp = dp->parent;
struct device_node *io_unit, *sbi = dp->parent;
struct linux_prom_registers *regs;
int board = of_getintprop_default(busp, "board#", 0);
int slot;
int board, slot;

while (sbi) {
if (!strcmp(sbi->name, "sbi"))
break;

sbi = sbi->parent;
}
if (!sbi)
goto build_resources;

regs = of_get_property(dp, "reg", NULL);
if (!regs)
goto build_resources;

slot = regs->which_io;

/* If SBI's parent is not io-unit or the io-unit lacks
* a "board#" property, something is very wrong.
*/
if (!sbi->parent || strcmp(sbi->parent->name, "io-unit")) {
printk("%s: Error, parent is not io-unit.\n",
sbi->full_name);
goto build_resources;
}
io_unit = sbi->parent;
board = of_getintprop_default(io_unit, "board#", -1);
if (board == -1) {
printk("%s: Error, lacks board# property.\n",
io_unit->full_name);
goto build_resources;
}

for (i = 0; i < op->num_irqs; i++) {
int this_irq = op->irqs[i];
int sbusl = pil_to_sbus[this_irq];
Expand All @@ -617,6 +644,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
}
}

build_resources:
build_device_resources(op, parent);

op->dev.parent = parent;
Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/sparc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
static struct property *tmp = NULL;
struct property *p;
int len;
const char *name;

if (tmp) {
p = tmp;
Expand All @@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s

p->name = (char *) (p + 1);
if (special_name) {
strcpy(p->name, special_name);
p->length = special_len;
p->value = prom_early_alloc(special_len);
memcpy(p->value, special_val, special_len);
} else {
if (prev == NULL) {
prom_firstprop(node, p->name);
name = prom_firstprop(node, NULL);
} else {
prom_nextprop(node, prev, p->name);
name = prom_nextprop(node, prev, NULL);
}
if (strlen(p->name) == 0) {
if (strlen(name) == 0) {
tmp = p;
return NULL;
}
strcpy(p->name, name);
p->length = prom_getproplen(node, p->name);
if (p->length <= 0) {
p->length = 0;
Expand Down
96 changes: 89 additions & 7 deletions trunk/arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void __cpuinit smp_store_cpu_info(int id)
void __init smp_cpus_done(unsigned int max_cpus)
{
extern void smp4m_smp_done(void);
extern void smp4d_smp_done(void);
unsigned long bogosum = 0;
int cpu, num;

Expand All @@ -100,8 +101,34 @@ void __init smp_cpus_done(unsigned int max_cpus)
num, bogosum/(500000/HZ),
(bogosum/(5000/HZ))%100);

BUG_ON(sparc_cpu_model != sun4m);
smp4m_smp_done();
switch(sparc_cpu_model) {
case sun4:
printk("SUN4\n");
BUG();
break;
case sun4c:
printk("SUN4C\n");
BUG();
break;
case sun4m:
smp4m_smp_done();
break;
case sun4d:
smp4d_smp_done();
break;
case sun4e:
printk("SUN4E\n");
BUG();
break;
case sun4u:
printk("SUN4U\n");
BUG();
break;
default:
printk("UNKNOWN!\n");
BUG();
break;
};
}

void cpu_panic(void)
Expand Down Expand Up @@ -267,9 +294,9 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
extern void smp4m_boot_cpus(void);
extern void smp4d_boot_cpus(void);
int i, cpuid, extra;

BUG_ON(sparc_cpu_model != sun4m);
printk("Entering SMP Mode...\n");

extra = 0;
Expand All @@ -283,7 +310,34 @@ void __init smp_prepare_cpus(unsigned int max_cpus)

smp_store_cpu_info(boot_cpu_id);

smp4m_boot_cpus();
switch(sparc_cpu_model) {
case sun4:
printk("SUN4\n");
BUG();
break;
case sun4c:
printk("SUN4C\n");
BUG();
break;
case sun4m:
smp4m_boot_cpus();
break;
case sun4d:
smp4d_boot_cpus();
break;
case sun4e:
printk("SUN4E\n");
BUG();
break;
case sun4u:
printk("SUN4U\n");
BUG();
break;
default:
printk("UNKNOWN!\n");
BUG();
break;
};
}

/* Set this up early so that things like the scheduler can init
Expand Down Expand Up @@ -323,9 +377,37 @@ void __init smp_prepare_boot_cpu(void)
int __cpuinit __cpu_up(unsigned int cpu)
{
extern int smp4m_boot_one_cpu(int);
int ret;

ret = smp4m_boot_one_cpu(cpu);
extern int smp4d_boot_one_cpu(int);
int ret=0;

switch(sparc_cpu_model) {
case sun4:
printk("SUN4\n");
BUG();
break;
case sun4c:
printk("SUN4C\n");
BUG();
break;
case sun4m:
ret = smp4m_boot_one_cpu(cpu);
break;
case sun4d:
ret = smp4d_boot_one_cpu(cpu);
break;
case sun4e:
printk("SUN4E\n");
BUG();
break;
case sun4u:
printk("SUN4U\n");
BUG();
break;
default:
printk("UNKNOWN!\n");
BUG();
break;
};

if (!ret) {
cpu_set(cpu, smp_commenced_mask);
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ EXPORT_SYMBOL(prom_node_has_property);
EXPORT_SYMBOL(prom_setprop);
EXPORT_SYMBOL(saved_command_line);
EXPORT_SYMBOL(prom_apply_obio_ranges);
EXPORT_SYMBOL(prom_getname);
EXPORT_SYMBOL(prom_feval);
EXPORT_SYMBOL(prom_getbool);
EXPORT_SYMBOL(prom_getstring);
Expand Down
Loading

0 comments on commit f55a2c1

Please sign in to comment.