Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32775
b: refs/heads/master
c: 5d9c5a3
h: refs/heads/master
i:
  32773: 6377893
  32771: 025bd61
  32767: 5ae4f03
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 21, 2006
1 parent 0fb4a30 commit 6dc1197
Show file tree
Hide file tree
Showing 31 changed files with 313 additions and 315 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: efab4cbe99f9b73d208ad9e5ec9388524005e095
refs/heads/master: 5d9c5a32920c5c0e6716b0f6ed16157783dc56a4
25 changes: 18 additions & 7 deletions trunk/arch/sparc/kernel/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#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 @@ -35,6 +34,12 @@ 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 @@ -54,14 +59,20 @@ 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)
{
struct device_node *dp;
int cur_inst;
int nd, cur_inst, err;

nd = prom_root_node;
cur_inst = 0;
for_each_node_by_type(dp, "cpu") {
int err = check_cpu_node(dp->node, &cur_inst,
compare, compare_arg,
prom_node, mid);

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);
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((sparc_cpu_model==sun4m) && (irq < 10))
if(irq < 10)
smp4m_irq_rotate(cpu);
#endif
action = sparc_irq[irq].action;
Expand Down
34 changes: 3 additions & 31 deletions trunk/arch/sparc/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,41 +596,14 @@ 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 *io_unit, *sbi = dp->parent;
struct device_node *busp = dp->parent;
struct linux_prom_registers *regs;
int board, slot;

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

sbi = sbi->parent;
}
if (!sbi)
goto build_resources;
int board = of_getintprop_default(busp, "board#", 0);
int slot;

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 @@ -644,7 +617,6 @@ 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: 3 additions & 6 deletions trunk/arch/sparc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ 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 @@ -457,21 +456,19 @@ 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) {
name = prom_firstprop(node, NULL);
prom_firstprop(node, p->name);
} else {
name = prom_nextprop(node, prev, NULL);
prom_nextprop(node, prev, p->name);
}
if (strlen(name) == 0) {
if (strlen(p->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: 7 additions & 89 deletions trunk/arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ 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 @@ -101,34 +100,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
num, bogosum/(500000/HZ),
(bogosum/(5000/HZ))%100);

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;
};
BUG_ON(sparc_cpu_model != sun4m);
smp4m_smp_done();
}

void cpu_panic(void)
Expand Down Expand Up @@ -294,9 +267,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 @@ -310,34 +283,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)

smp_store_cpu_info(boot_cpu_id);

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;
};
smp4m_boot_cpus();
}

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

ret = smp4m_boot_one_cpu(cpu);

if (!ret) {
cpu_set(cpu, smp_commenced_mask);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ 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 6dc1197

Please sign in to comment.