Commit 53ca8854 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: whitespace cleanup in prom.c

This patch, originally from Linas Vepstas, cleans up some wonky indentation
and other formatting issues in arch/ppc64/kernel/prom.c.  It does not change
any actual code.
Signed-off-by: default avatarLinas Vepstas <linas@linas.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1ffdc2aa
...@@ -199,16 +199,16 @@ static int __init call_prom(const char *service, int nargs, int nret, ...) ...@@ -199,16 +199,16 @@ static int __init call_prom(const char *service, int nargs, int nret, ...)
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
va_list list; va_list list;
_prom->args.service = ADDR(service); _prom->args.service = ADDR(service);
_prom->args.nargs = nargs; _prom->args.nargs = nargs;
_prom->args.nret = nret; _prom->args.nret = nret;
_prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]); _prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]);
va_start(list, nret); va_start(list, nret);
for (i=0; i < nargs; i++) for (i=0; i < nargs; i++)
_prom->args.args[i] = va_arg(list, prom_arg_t); _prom->args.args[i] = va_arg(list, prom_arg_t);
va_end(list); va_end(list);
for (i=0; i < nret ;i++) for (i=0; i < nret ;i++)
_prom->args.rets[i] = 0; _prom->args.rets[i] = 0;
...@@ -244,17 +244,17 @@ static void __init prom_print(const char *msg) ...@@ -244,17 +244,17 @@ static void __init prom_print(const char *msg)
static void __init prom_print_hex(unsigned long val) static void __init prom_print_hex(unsigned long val)
{ {
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
int i, nibbles = sizeof(val)*2; int i, nibbles = sizeof(val)*2;
char buf[sizeof(val)*2+1]; char buf[sizeof(val)*2+1];
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
for (i = nibbles-1; i >= 0; i--) { for (i = nibbles-1; i >= 0; i--) {
buf[i] = (val & 0xf) + '0'; buf[i] = (val & 0xf) + '0';
if (buf[i] > '9') if (buf[i] > '9')
buf[i] += ('a'-'0'-10); buf[i] += ('a'-'0'-10);
val >>= 4; val >>= 4;
} }
buf[nibbles] = '\0'; buf[nibbles] = '\0';
call_prom("write", 3, 1, _prom->stdout, buf, nibbles); call_prom("write", 3, 1, _prom->stdout, buf, nibbles);
} }
...@@ -343,22 +343,22 @@ static void __init prom_initialize_naca(void) ...@@ -343,22 +343,22 @@ static void __init prom_initialize_naca(void)
{ {
phandle node; phandle node;
char type[64]; char type[64];
unsigned long num_cpus = 0; unsigned long num_cpus = 0;
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
struct naca_struct *_naca = RELOC(naca); struct naca_struct *_naca = RELOC(naca);
struct systemcfg *_systemcfg = RELOC(systemcfg); struct systemcfg *_systemcfg = RELOC(systemcfg);
/* NOTE: _naca->debug_switch is already initialized. */ /* NOTE: _naca->debug_switch is already initialized. */
prom_debug("prom_initialize_naca: start...\n"); prom_debug("prom_initialize_naca: start...\n");
_naca->pftSize = 0; /* ilog2 of htab size. computed below. */ _naca->pftSize = 0; /* ilog2 of htab size. computed below. */
for (node = 0; prom_next_node(&node); ) { for (node = 0; prom_next_node(&node); ) {
type[0] = 0; type[0] = 0;
prom_getprop(node, "device_type", type, sizeof(type)); prom_getprop(node, "device_type", type, sizeof(type));
if (!strcmp(type, RELOC("cpu"))) { if (!strcmp(type, RELOC("cpu"))) {
num_cpus += 1; num_cpus += 1;
/* We're assuming *all* of the CPUs have the same /* We're assuming *all* of the CPUs have the same
...@@ -404,7 +404,7 @@ static void __init prom_initialize_naca(void) ...@@ -404,7 +404,7 @@ static void __init prom_initialize_naca(void)
_naca->pftSize = pft_size[1]; _naca->pftSize = pft_size[1];
} }
} }
} else if (!strcmp(type, RELOC("serial"))) { } else if (!strcmp(type, RELOC("serial"))) {
phandle isa, pci; phandle isa, pci;
struct isa_reg_property reg; struct isa_reg_property reg;
union pci_range ranges; union pci_range ranges;
...@@ -435,7 +435,7 @@ static void __init prom_initialize_naca(void) ...@@ -435,7 +435,7 @@ static void __init prom_initialize_naca(void)
((((unsigned long)ranges.pci64.phys_hi) << 32) | ((((unsigned long)ranges.pci64.phys_hi) << 32) |
(ranges.pci64.phys_lo)) + reg.address; (ranges.pci64.phys_lo)) + reg.address;
} }
} }
} }
if (_systemcfg->platform == PLATFORM_POWERMAC) if (_systemcfg->platform == PLATFORM_POWERMAC)
...@@ -465,8 +465,8 @@ static void __init prom_initialize_naca(void) ...@@ -465,8 +465,8 @@ static void __init prom_initialize_naca(void)
} }
/* We gotta have at least 1 cpu... */ /* We gotta have at least 1 cpu... */
if ( (_systemcfg->processorCount = num_cpus) < 1 ) if ( (_systemcfg->processorCount = num_cpus) < 1 )
PROM_BUG(); PROM_BUG();
_systemcfg->physicalMemorySize = lmb_phys_mem_size(); _systemcfg->physicalMemorySize = lmb_phys_mem_size();
...@@ -496,21 +496,21 @@ static void __init prom_initialize_naca(void) ...@@ -496,21 +496,21 @@ static void __init prom_initialize_naca(void)
_systemcfg->version.minor = SYSTEMCFG_MINOR; _systemcfg->version.minor = SYSTEMCFG_MINOR;
_systemcfg->processor = _get_PVR(); _systemcfg->processor = _get_PVR();
prom_debug("systemcfg->processorCount = 0x%x\n", prom_debug("systemcfg->processorCount = 0x%x\n",
_systemcfg->processorCount); _systemcfg->processorCount);
prom_debug("systemcfg->physicalMemorySize = 0x%x\n", prom_debug("systemcfg->physicalMemorySize = 0x%x\n",
_systemcfg->physicalMemorySize); _systemcfg->physicalMemorySize);
prom_debug("naca->pftSize = 0x%x\n", prom_debug("naca->pftSize = 0x%x\n",
_naca->pftSize); _naca->pftSize);
prom_debug("systemcfg->dCacheL1LineSize = 0x%x\n", prom_debug("systemcfg->dCacheL1LineSize = 0x%x\n",
_systemcfg->dCacheL1LineSize); _systemcfg->dCacheL1LineSize);
prom_debug("systemcfg->iCacheL1LineSize = 0x%x\n", prom_debug("systemcfg->iCacheL1LineSize = 0x%x\n",
_systemcfg->iCacheL1LineSize); _systemcfg->iCacheL1LineSize);
prom_debug("naca->serialPortAddr = 0x%x\n", prom_debug("naca->serialPortAddr = 0x%x\n",
_naca->serialPortAddr); _naca->serialPortAddr);
prom_debug("naca->interrupt_controller = 0x%x\n", prom_debug("naca->interrupt_controller = 0x%x\n",
_naca->interrupt_controller); _naca->interrupt_controller);
prom_debug("systemcfg->platform = 0x%x\n", prom_debug("systemcfg->platform = 0x%x\n",
_systemcfg->platform); _systemcfg->platform);
prom_debug("prom_initialize_naca: end...\n"); prom_debug("prom_initialize_naca: end...\n");
} }
...@@ -547,36 +547,36 @@ static void __init early_cmdline_parse(void) ...@@ -547,36 +547,36 @@ static void __init early_cmdline_parse(void)
#ifdef DEBUG_PROM #ifdef DEBUG_PROM
void prom_dump_lmb(void) void prom_dump_lmb(void)
{ {
unsigned long i; unsigned long i;
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
struct lmb *_lmb = PTRRELOC(&lmb); struct lmb *_lmb = PTRRELOC(&lmb);
prom_printf("\nprom_dump_lmb:\n"); prom_printf("\nprom_dump_lmb:\n");
prom_printf(" memory.cnt = 0x%x\n", prom_printf(" memory.cnt = 0x%x\n",
_lmb->memory.cnt); _lmb->memory.cnt);
prom_printf(" memory.size = 0x%x\n", prom_printf(" memory.size = 0x%x\n",
_lmb->memory.size); _lmb->memory.size);
for (i=0; i < _lmb->memory.cnt ;i++) { for (i=0; i < _lmb->memory.cnt ;i++) {
prom_printf(" memory.region[0x%x].base = 0x%x\n", prom_printf(" memory.region[0x%x].base = 0x%x\n",
i, _lmb->memory.region[i].base); i, _lmb->memory.region[i].base);
prom_printf(" .physbase = 0x%x\n", prom_printf(" .physbase = 0x%x\n",
_lmb->memory.region[i].physbase); _lmb->memory.region[i].physbase);
prom_printf(" .size = 0x%x\n", prom_printf(" .size = 0x%x\n",
_lmb->memory.region[i].size); _lmb->memory.region[i].size);
} }
prom_printf("\n reserved.cnt = 0x%x\n", prom_printf("\n reserved.cnt = 0x%x\n",
_lmb->reserved.cnt); _lmb->reserved.cnt);
prom_printf(" reserved.size = 0x%x\n", prom_printf(" reserved.size = 0x%x\n",
_lmb->reserved.size); _lmb->reserved.size);
for (i=0; i < _lmb->reserved.cnt ;i++) { for (i=0; i < _lmb->reserved.cnt ;i++) {
prom_printf(" reserved.region[0x%x\n].base = 0x%x\n", prom_printf(" reserved.region[0x%x\n].base = 0x%x\n",
i, _lmb->reserved.region[i].base); i, _lmb->reserved.region[i].base);
prom_printf(" .physbase = 0x%x\n", prom_printf(" .physbase = 0x%x\n",
_lmb->reserved.region[i].physbase); _lmb->reserved.region[i].physbase);
prom_printf(" .size = 0x%x\n", prom_printf(" .size = 0x%x\n",
_lmb->reserved.region[i].size); _lmb->reserved.region[i].size);
} }
} }
#endif /* DEBUG_PROM */ #endif /* DEBUG_PROM */
...@@ -584,9 +584,9 @@ static void __init prom_initialize_lmb(void) ...@@ -584,9 +584,9 @@ static void __init prom_initialize_lmb(void)
{ {
phandle node; phandle node;
char type[64]; char type[64];
unsigned long i, offset = reloc_offset(); unsigned long i, offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
struct systemcfg *_systemcfg = RELOC(systemcfg); struct systemcfg *_systemcfg = RELOC(systemcfg);
union lmb_reg_property reg; union lmb_reg_property reg;
unsigned long lmb_base, lmb_size; unsigned long lmb_base, lmb_size;
unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8; unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8;
...@@ -599,11 +599,11 @@ static void __init prom_initialize_lmb(void) ...@@ -599,11 +599,11 @@ static void __init prom_initialize_lmb(void)
if (_systemcfg->platform == PLATFORM_POWERMAC) if (_systemcfg->platform == PLATFORM_POWERMAC)
bytes_per_reg = 12; bytes_per_reg = 12;
for (node = 0; prom_next_node(&node); ) { for (node = 0; prom_next_node(&node); ) {
type[0] = 0; type[0] = 0;
prom_getprop(node, "device_type", type, sizeof(type)); prom_getprop(node, "device_type", type, sizeof(type));
if (strcmp(type, RELOC("memory"))) if (strcmp(type, RELOC("memory")))
continue; continue;
num_regs = prom_getprop(node, "reg", &reg, sizeof(reg)) num_regs = prom_getprop(node, "reg", &reg, sizeof(reg))
...@@ -651,7 +651,7 @@ prom_instantiate_rtas(void) ...@@ -651,7 +651,7 @@ prom_instantiate_rtas(void)
struct rtas_t *_rtas = PTRRELOC(&rtas); struct rtas_t *_rtas = PTRRELOC(&rtas);
struct systemcfg *_systemcfg = RELOC(systemcfg); struct systemcfg *_systemcfg = RELOC(systemcfg);
ihandle prom_rtas; ihandle prom_rtas;
u32 getprop_rval; u32 getprop_rval;
char hypertas_funcs[4]; char hypertas_funcs[4];
prom_debug("prom_instantiate_rtas: start...\n"); prom_debug("prom_instantiate_rtas: start...\n");
...@@ -669,7 +669,7 @@ prom_instantiate_rtas(void) ...@@ -669,7 +669,7 @@ prom_instantiate_rtas(void)
prom_getprop(prom_rtas, "rtas-size", prom_getprop(prom_rtas, "rtas-size",
&getprop_rval, sizeof(getprop_rval)); &getprop_rval, sizeof(getprop_rval));
_rtas->size = getprop_rval; _rtas->size = getprop_rval;
prom_printf("instantiating rtas"); prom_printf("instantiating rtas");
if (_rtas->size != 0) { if (_rtas->size != 0) {
unsigned long rtas_region = RTAS_INSTANTIATE_MAX; unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
...@@ -707,9 +707,9 @@ prom_instantiate_rtas(void) ...@@ -707,9 +707,9 @@ prom_instantiate_rtas(void)
prom_printf(" done\n"); prom_printf(" done\n");
} }
prom_debug("rtas->base = 0x%x\n", _rtas->base); prom_debug("rtas->base = 0x%x\n", _rtas->base);
prom_debug("rtas->entry = 0x%x\n", _rtas->entry); prom_debug("rtas->entry = 0x%x\n", _rtas->entry);
prom_debug("rtas->size = 0x%x\n", _rtas->size); prom_debug("rtas->size = 0x%x\n", _rtas->size);
} }
prom_debug("prom_instantiate_rtas: end...\n"); prom_debug("prom_instantiate_rtas: end...\n");
} }
...@@ -744,7 +744,7 @@ static void __init prom_initialize_tce_table(void) ...@@ -744,7 +744,7 @@ static void __init prom_initialize_tce_table(void)
{ {
phandle node; phandle node;
ihandle phb_node; ihandle phb_node;
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
char compatible[64], path[64], type[64], model[64]; char compatible[64], path[64], type[64], model[64];
unsigned long i, table = 0; unsigned long i, table = 0;
unsigned long base, vbase, align; unsigned long base, vbase, align;
...@@ -775,9 +775,9 @@ static void __init prom_initialize_tce_table(void) ...@@ -775,9 +775,9 @@ static void __init prom_initialize_tce_table(void)
/* Keep the old logic in tack to avoid regression. */ /* Keep the old logic in tack to avoid regression. */
if (compatible[0] != 0) { if (compatible[0] != 0) {
if((strstr(compatible, RELOC("python")) == NULL) && if ((strstr(compatible, RELOC("python")) == NULL) &&
(strstr(compatible, RELOC("Speedwagon")) == NULL) && (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
(strstr(compatible, RELOC("Winnipeg")) == NULL)) (strstr(compatible, RELOC("Winnipeg")) == NULL))
continue; continue;
} else if (model[0] != 0) { } else if (model[0] != 0) {
if ((strstr(model, RELOC("ython")) == NULL) && if ((strstr(model, RELOC("ython")) == NULL) &&
...@@ -853,21 +853,21 @@ static void __init prom_initialize_tce_table(void) ...@@ -853,21 +853,21 @@ static void __init prom_initialize_tce_table(void)
/* Call OF to setup the TCE hardware */ /* Call OF to setup the TCE hardware */
if (call_prom("package-to-path", 3, 1, node, if (call_prom("package-to-path", 3, 1, node,
path, sizeof(path)-1) == PROM_ERROR) { path, sizeof(path)-1) == PROM_ERROR) {
prom_printf("package-to-path failed\n"); prom_printf("package-to-path failed\n");
} else { } else {
prom_printf("opening PHB %s", path); prom_printf("opening PHB %s", path);
} }
phb_node = call_prom("open", 1, 1, path); phb_node = call_prom("open", 1, 1, path);
if ( (long)phb_node <= 0) { if ( (long)phb_node <= 0) {
prom_printf("... failed\n"); prom_printf("... failed\n");
} else { } else {
prom_printf("... done\n"); prom_printf("... done\n");
} }
call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"), call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"),
phb_node, -1, minsize, phb_node, -1, minsize,
(u32) base, (u32) (base >> 32)); (u32) base, (u32) (base >> 32));
call_prom("close", 1, 0, phb_node); call_prom("close", 1, 0, phb_node);
table++; table++;
} }
...@@ -910,15 +910,15 @@ static void __init prom_hold_cpus(unsigned long mem) ...@@ -910,15 +910,15 @@ static void __init prom_hold_cpus(unsigned long mem)
unsigned int cpu_threads, hw_cpu_num; unsigned int cpu_threads, hw_cpu_num;
int propsize; int propsize;
extern void __secondary_hold(void); extern void __secondary_hold(void);
extern unsigned long __secondary_hold_spinloop; extern unsigned long __secondary_hold_spinloop;
extern unsigned long __secondary_hold_acknowledge; extern unsigned long __secondary_hold_acknowledge;
unsigned long *spinloop unsigned long *spinloop
= (void *)virt_to_abs(&__secondary_hold_spinloop); = (void *)virt_to_abs(&__secondary_hold_spinloop);
unsigned long *acknowledge unsigned long *acknowledge
= (void *)virt_to_abs(&__secondary_hold_acknowledge); = (void *)virt_to_abs(&__secondary_hold_acknowledge);
unsigned long secondary_hold unsigned long secondary_hold
= virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold)); = virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold));
struct systemcfg *_systemcfg = RELOC(systemcfg); struct systemcfg *_systemcfg = RELOC(systemcfg);
struct paca_struct *lpaca = PTRRELOC(&paca[0]); struct paca_struct *lpaca = PTRRELOC(&paca[0]);
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -962,12 +962,12 @@ static void __init prom_hold_cpus(unsigned long mem) ...@@ -962,12 +962,12 @@ static void __init prom_hold_cpus(unsigned long mem)
prom_debug(" 1) *acknowledge = 0x%x\n", *acknowledge); prom_debug(" 1) *acknowledge = 0x%x\n", *acknowledge);
prom_debug(" 1) secondary_hold = 0x%x\n", secondary_hold); prom_debug(" 1) secondary_hold = 0x%x\n", secondary_hold);
/* Set the common spinloop variable, so all of the secondary cpus /* Set the common spinloop variable, so all of the secondary cpus
* will block when they are awakened from their OF spinloop. * will block when they are awakened from their OF spinloop.
* This must occur for both SMP and non SMP kernels, since OF will * This must occur for both SMP and non SMP kernels, since OF will
* be trashed when we move the kernel. * be trashed when we move the kernel.
*/ */
*spinloop = 0; *spinloop = 0;
#ifdef CONFIG_HMT #ifdef CONFIG_HMT
for (i=0; i < NR_CPUS; i++) { for (i=0; i < NR_CPUS; i++) {
...@@ -986,7 +986,7 @@ static void __init prom_hold_cpus(unsigned long mem) ...@@ -986,7 +986,7 @@ static void __init prom_hold_cpus(unsigned long mem)
if (strcmp(type, RELOC("okay")) != 0) if (strcmp(type, RELOC("okay")) != 0)
continue; continue;
reg = -1; reg = -1;
prom_getprop(node, "reg", &reg, sizeof(reg)); prom_getprop(node, "reg", &reg, sizeof(reg));
path = (char *) mem; path = (char *) mem;
...@@ -1124,7 +1124,7 @@ static void __init smt_setup(void) ...@@ -1124,7 +1124,7 @@ static void __init smt_setup(void)
ihandle prom_options = 0; ihandle prom_options = 0;
char option[9]; char option[9];
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
struct naca_struct *_naca = RELOC(naca); struct naca_struct *_naca = RELOC(naca);
char found = 0; char found = 0;
if (strstr(RELOC(cmd_line), RELOC("smt-enabled="))) { if (strstr(RELOC(cmd_line), RELOC("smt-enabled="))) {
...@@ -1253,10 +1253,10 @@ static void __init prom_init_stdout(void) ...@@ -1253,10 +1253,10 @@ static void __init prom_init_stdout(void)
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
u32 val; u32 val;
if (prom_getprop(_prom->chosen, "stdout", &val, sizeof(val)) <= 0) if (prom_getprop(_prom->chosen, "stdout", &val, sizeof(val)) <= 0)
prom_panic("cannot find stdout"); prom_panic("cannot find stdout");
_prom->stdout = val; _prom->stdout = val;
} }
static int __init prom_find_machine_type(void) static int __init prom_find_machine_type(void)
...@@ -1306,7 +1306,7 @@ static unsigned long __init check_display(unsigned long mem) ...@@ -1306,7 +1306,7 @@ static unsigned long __init check_display(unsigned long mem)
ihandle ih; ihandle ih;
int i, j; int i, j;
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom); struct prom_t *_prom = PTRRELOC(&prom);
char type[16], *path; char type[16], *path;
static unsigned char default_colors[] = { static unsigned char default_colors[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...@@ -1403,7 +1403,7 @@ static unsigned long __init check_display(unsigned long mem) ...@@ -1403,7 +1403,7 @@ static unsigned long __init check_display(unsigned long mem)
break; break;
#endif /* CONFIG_LOGO_LINUX_CLUT224 */ #endif /* CONFIG_LOGO_LINUX_CLUT224 */
} }
return DOUBLEWORD_ALIGN(mem); return DOUBLEWORD_ALIGN(mem);
} }
...@@ -1592,7 +1592,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs) ...@@ -1592,7 +1592,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs)
{ {
struct bi_record *first, *last; struct bi_record *first, *last;
prom_debug("birec_verify: r6=0x%x\n", (unsigned long)bi_recs); prom_debug("birec_verify: r6=0x%x\n", (unsigned long)bi_recs);
if (bi_recs != NULL) if (bi_recs != NULL)
prom_debug(" tag=0x%x\n", bi_recs->tag); prom_debug(" tag=0x%x\n", bi_recs->tag);
...@@ -1601,7 +1601,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs) ...@@ -1601,7 +1601,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs)
last = (struct bi_record *)(long)bi_recs->data[0]; last = (struct bi_record *)(long)bi_recs->data[0];
prom_debug(" last=0x%x\n", (unsigned long)last); prom_debug(" last=0x%x\n", (unsigned long)last);
if (last != NULL) if (last != NULL)
prom_debug(" last_tag=0x%x\n", last->tag); prom_debug(" last_tag=0x%x\n", last->tag);
...@@ -1609,7 +1609,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs) ...@@ -1609,7 +1609,7 @@ static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs)
return NULL; return NULL;
first = (struct bi_record *)(long)last->data[0]; first = (struct bi_record *)(long)last->data[0];
prom_debug(" first=0x%x\n", (unsigned long)first); prom_debug(" first=0x%x\n", (unsigned long)first);
if ( first == NULL || first != bi_recs ) if ( first == NULL || first != bi_recs )
return NULL; return NULL;
...@@ -1681,9 +1681,9 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1681,9 +1681,9 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
/* Init prom stdout device */ /* Init prom stdout device */
prom_init_stdout(); prom_init_stdout();
prom_debug("klimit=0x%x\n", RELOC(klimit)); prom_debug("klimit=0x%x\n", RELOC(klimit));
prom_debug("offset=0x%x\n", offset); prom_debug("offset=0x%x\n", offset);
prom_debug("->mem=0x%x\n", RELOC(klimit) - offset); prom_debug("->mem=0x%x\n", RELOC(klimit) - offset);
/* check out if we have bi_recs */ /* check out if we have bi_recs */
_prom->bi_recs = prom_bi_rec_verify((struct bi_record *)r6); _prom->bi_recs = prom_bi_rec_verify((struct bi_record *)r6);
...@@ -1713,7 +1713,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1713,7 +1713,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
copy_and_flush(0, KERNELBASE - offset, 0x100, 0); copy_and_flush(0, KERNELBASE - offset, 0x100, 0);
/* Start storing things at klimit */ /* Start storing things at klimit */
mem = RELOC(klimit) - offset; mem = RELOC(klimit) - offset;
/* Get the full OF pathname of the stdout device */ /* Get the full OF pathname of the stdout device */
p = (char *) mem; p = (char *) mem;
...@@ -1728,9 +1728,9 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1728,9 +1728,9 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
_prom->encode_phys_size = (getprop_rval == 1) ? 32 : 64; _prom->encode_phys_size = (getprop_rval == 1) ? 32 : 64;
/* Determine which cpu is actually running right _now_ */ /* Determine which cpu is actually running right _now_ */
if (prom_getprop(_prom->chosen, "cpu", if (prom_getprop(_prom->chosen, "cpu",
&prom_cpu, sizeof(prom_cpu)) <= 0) &prom_cpu, sizeof(prom_cpu)) <= 0)
prom_panic("cannot find boot cpu"); prom_panic("cannot find boot cpu");
cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu); cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval)); prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
...@@ -1739,7 +1739,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1739,7 +1739,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
RELOC(boot_cpuid) = 0; RELOC(boot_cpuid) = 0;
prom_debug("Booting CPU hw index = 0x%x\n", _prom->cpu); prom_debug("Booting CPU hw index = 0x%x\n", _prom->cpu);
/* Get the boot device and translate it to a full OF pathname. */ /* Get the boot device and translate it to a full OF pathname. */
p = (char *) mem; p = (char *) mem;
...@@ -1773,18 +1773,18 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1773,18 +1773,18 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
if (_systemcfg->platform != PLATFORM_POWERMAC) if (_systemcfg->platform != PLATFORM_POWERMAC)
prom_instantiate_rtas(); prom_instantiate_rtas();
/* Initialize some system info into the Naca early... */ /* Initialize some system info into the Naca early... */
prom_initialize_naca(); prom_initialize_naca();
smt_setup(); smt_setup();
/* If we are on an SMP machine, then we *MUST* do the /* If we are on an SMP machine, then we *MUST* do the
* following, regardless of whether we have an SMP * following, regardless of whether we have an SMP
* kernel or not. * kernel or not.
*/ */
prom_hold_cpus(mem); prom_hold_cpus(mem);
prom_debug("after basic inits, mem=0x%x\n", mem); prom_debug("after basic inits, mem=0x%x\n", mem);
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
prom_debug("initrd_start=0x%x\n", RELOC(initrd_start)); prom_debug("initrd_start=0x%x\n", RELOC(initrd_start));
prom_debug("initrd_end=0x%x\n", RELOC(initrd_end)); prom_debug("initrd_end=0x%x\n", RELOC(initrd_end));
...@@ -1796,7 +1796,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1796,7 +1796,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
RELOC(klimit) = mem + offset; RELOC(klimit) = mem + offset;
prom_debug("new klimit is\n"); prom_debug("new klimit is\n");
prom_debug("klimit=0x%x\n", RELOC(klimit)); prom_debug("klimit=0x%x\n", RELOC(klimit));
prom_debug(" ->mem=0x%x\n", mem); prom_debug(" ->mem=0x%x\n", mem);
lmb_reserve(0, __pa(RELOC(klimit))); lmb_reserve(0, __pa(RELOC(klimit)));
...@@ -2081,7 +2081,7 @@ interpret_pci_props(struct device_node *np, unsigned long mem_start, ...@@ -2081,7 +2081,7 @@ interpret_pci_props(struct device_node *np, unsigned long mem_start,
i = 0; i = 0;
adr = (struct address_range *) mem_start; adr = (struct address_range *) mem_start;
while ((l -= sizeof(struct pci_reg_property)) >= 0) { while ((l -= sizeof(struct pci_reg_property)) >= 0) {
if (!measure_only) { if (!measure_only) {
adr[i].space = pci_addrs[i].addr.a_hi; adr[i].space = pci_addrs[i].addr.a_hi;
adr[i].address = pci_addrs[i].addr.a_lo; adr[i].address = pci_addrs[i].addr.a_lo;
adr[i].size = pci_addrs[i].size_lo; adr[i].size = pci_addrs[i].size_lo;
...@@ -2120,7 +2120,7 @@ interpret_dbdma_props(struct device_node *np, unsigned long mem_start, ...@@ -2120,7 +2120,7 @@ interpret_dbdma_props(struct device_node *np, unsigned long mem_start,
i = 0; i = 0;
adr = (struct address_range *) mem_start; adr = (struct address_range *) mem_start;
while ((l -= sizeof(struct reg_property32)) >= 0) { while ((l -= sizeof(struct reg_property32)) >= 0) {
if (!measure_only) { if (!measure_only) {
adr[i].space = 2; adr[i].space = 2;
adr[i].address = rp[i].address + base_address; adr[i].address = rp[i].address + base_address;
adr[i].size = rp[i].size; adr[i].size = rp[i].size;
...@@ -2160,7 +2160,7 @@ interpret_macio_props(struct device_node *np, unsigned long mem_start, ...@@ -2160,7 +2160,7 @@ interpret_macio_props(struct device_node *np, unsigned long mem_start,
i = 0; i = 0;
adr = (struct address_range *) mem_start; adr = (struct address_range *) mem_start;
while ((l -= sizeof(struct reg_property32)) >= 0) { while ((l -= sizeof(struct reg_property32)) >= 0) {
if (!measure_only) { if (!measure_only) {
adr[i].space = 2; adr[i].space = 2;
adr[i].address = rp[i].address + base_address; adr[i].address = rp[i].address + base_address;
adr[i].size = rp[i].size; adr[i].size = rp[i].size;
...@@ -2188,7 +2188,7 @@ interpret_isa_props(struct device_node *np, unsigned long mem_start, ...@@ -2188,7 +2188,7 @@ interpret_isa_props(struct device_node *np, unsigned long mem_start,
i = 0; i = 0;
adr = (struct address_range *) mem_start; adr = (struct address_range *) mem_start;
while ((l -= sizeof(struct reg_property)) >= 0) { while ((l -= sizeof(struct reg_property)) >= 0) {
if (!measure_only) { if (!measure_only) {
adr[i].space = rp[i].space; adr[i].space = rp[i].space;
adr[i].address = rp[i].address; adr[i].address = rp[i].address;
adr[i].size = rp[i].size; adr[i].size = rp[i].size;
...@@ -2217,7 +2217,7 @@ interpret_root_props(struct device_node *np, unsigned long mem_start, ...@@ -2217,7 +2217,7 @@ interpret_root_props(struct device_node *np, unsigned long mem_start,
i = 0; i = 0;
adr = (struct address_range *) mem_start; adr = (struct address_range *) mem_start;
while ((l -= rpsize) >= 0) { while ((l -= rpsize) >= 0) {
if (!measure_only) { if (!measure_only) {
adr[i].space = 0; adr[i].space = 0;
adr[i].address = rp[naddrc - 1]; adr[i].address = rp[naddrc - 1];
adr[i].size = rp[naddrc + nsizec - 1]; adr[i].size = rp[naddrc + nsizec - 1];
...@@ -2295,7 +2295,7 @@ finish_node(struct device_node *np, unsigned long mem_start, ...@@ -2295,7 +2295,7 @@ finish_node(struct device_node *np, unsigned long mem_start,
return mem_start; return mem_start;
} }
/* /**
* finish_device_tree is called once things are running normally * finish_device_tree is called once things are running normally
* (i.e. with text and data mapped to the address they were linked at). * (i.e. with text and data mapped to the address they were linked at).
* It traverses the device tree and fills in the name, type, * It traverses the device tree and fills in the name, type,
...@@ -2346,7 +2346,7 @@ prom_n_size_cells(struct device_node* np) ...@@ -2346,7 +2346,7 @@ prom_n_size_cells(struct device_node* np)
return 1; return 1;
} }
/* /**
* Work out the sense (active-low level / active-high edge) * Work out the sense (active-low level / active-high edge)
* of each interrupt from the device tree. * of each interrupt from the device tree.
*/ */
...@@ -2368,7 +2368,7 @@ prom_get_irq_senses(unsigned char *senses, int off, int max) ...@@ -2368,7 +2368,7 @@ prom_get_irq_senses(unsigned char *senses, int off, int max)
} }
} }
/* /**
* Construct and return a list of the device_nodes with a given name. * Construct and return a list of the device_nodes with a given name.
*/ */
struct device_node * struct device_node *
...@@ -2387,7 +2387,7 @@ find_devices(const char *name) ...@@ -2387,7 +2387,7 @@ find_devices(const char *name)
return head; return head;
} }
/* /**
* Construct and return a list of the device_nodes with a given type. * Construct and return a list of the device_nodes with a given type.
*/ */
struct device_node * struct device_node *
...@@ -2406,7 +2406,7 @@ find_type_devices(const char *type) ...@@ -2406,7 +2406,7 @@ find_type_devices(const char *type)
return head; return head;
} }
/* /**
* Returns all nodes linked together * Returns all nodes linked together
*/ */
struct device_node * struct device_node *
...@@ -2423,7 +2423,7 @@ find_all_nodes(void) ...@@ -2423,7 +2423,7 @@ find_all_nodes(void)
return head; return head;
} }
/* Checks if the given "compat" string matches one of the strings in /** Checks if the given "compat" string matches one of the strings in
* the device's "compatible" property * the device's "compatible" property
*/ */
int int
...@@ -2447,7 +2447,7 @@ device_is_compatible(struct device_node *device, const char *compat) ...@@ -2447,7 +2447,7 @@ device_is_compatible(struct device_node *device, const char *compat)
} }
/* /**
* Indicates whether the root node has a given value in its * Indicates whether the root node has a given value in its
* compatible property. * compatible property.
*/ */
...@@ -2456,7 +2456,7 @@ machine_is_compatible(const char *compat) ...@@ -2456,7 +2456,7 @@ machine_is_compatible(const char *compat)
{ {
struct device_node *root; struct device_node *root;
int rc = 0; int rc = 0;
root = of_find_node_by_path("/"); root = of_find_node_by_path("/");
if (root) { if (root) {
rc = device_is_compatible(root, compat); rc = device_is_compatible(root, compat);
...@@ -2465,7 +2465,7 @@ machine_is_compatible(const char *compat) ...@@ -2465,7 +2465,7 @@ machine_is_compatible(const char *compat)
return rc; return rc;
} }
/* /**
* Construct and return a list of the device_nodes with a given type * Construct and return a list of the device_nodes with a given type
* and compatible property. * and compatible property.
*/ */
...@@ -2488,7 +2488,7 @@ find_compatible_devices(const char *type, const char *compat) ...@@ -2488,7 +2488,7 @@ find_compatible_devices(const char *type, const char *compat)
return head; return head;
} }
/* /**
* Find the device_node with a given full_name. * Find the device_node with a given full_name.
*/ */
struct device_node * struct device_node *
...@@ -2903,7 +2903,7 @@ static int of_finish_dynamic_node(struct device_node *node) ...@@ -2903,7 +2903,7 @@ static int of_finish_dynamic_node(struct device_node *node)
u32 *regs; u32 *regs;
int err = 0; int err = 0;
phandle *ibm_phandle; phandle *ibm_phandle;
node->name = get_property(node, "name", NULL); node->name = get_property(node, "name", NULL);
node->type = get_property(node, "device_type", NULL); node->type = get_property(node, "device_type", NULL);
...@@ -2956,27 +2956,26 @@ static int of_finish_dynamic_node(struct device_node *node) ...@@ -2956,27 +2956,26 @@ static int of_finish_dynamic_node(struct device_node *node)
if (err) goto out; if (err) goto out;
} }
/* now do the rough equivalent of update_dn_pci_info, this /* now do the rough equivalent of update_dn_pci_info, this
* probably is not correct for phb's, but should work for * probably is not correct for phb's, but should work for
* IOAs and slots. * IOAs and slots.
*/ */
node->phb = parent->phb; node->phb = parent->phb;
regs = (u32 *)get_property(node, "reg", NULL); regs = (u32 *)get_property(node, "reg", NULL);
if (regs) { if (regs) {
node->busno = (regs[0] >> 16) & 0xff; node->busno = (regs[0] >> 16) & 0xff;
node->devfn = (regs[0] >> 8) & 0xff; node->devfn = (regs[0] >> 8) & 0xff;
} }
/* fixing up iommu_table */ /* fixing up iommu_table */
if(strcmp(node->name, "pci") == 0 && if (strcmp(node->name, "pci") == 0 &&
get_property(node, "ibm,dma-window", NULL)) { get_property(node, "ibm,dma-window", NULL)) {
node->bussubno = node->busno; node->bussubno = node->busno;
iommu_devnode_init(node); iommu_devnode_init(node);
} } else
else
node->iommu_table = parent->iommu_table; node->iommu_table = parent->iommu_table;
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment