aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/chrp/nvram.c5
-rw-r--r--arch/powerpc/platforms/chrp/pci.c11
-rw-r--r--arch/powerpc/platforms/chrp/setup.c21
3 files changed, 17 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c
index 150f67d6f90c..0dd4a64757d9 100644
--- a/arch/powerpc/platforms/chrp/nvram.c
+++ b/arch/powerpc/platforms/chrp/nvram.c
@@ -67,13 +67,14 @@ static void chrp_nvram_write(int addr, unsigned char val)
67void __init chrp_nvram_init(void) 67void __init chrp_nvram_init(void)
68{ 68{
69 struct device_node *nvram; 69 struct device_node *nvram;
70 unsigned int *nbytes_p, proplen; 70 const unsigned int *nbytes_p;
71 unsigned int proplen;
71 72
72 nvram = of_find_node_by_type(NULL, "nvram"); 73 nvram = of_find_node_by_type(NULL, "nvram");
73 if (nvram == NULL) 74 if (nvram == NULL)
74 return; 75 return;
75 76
76 nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen); 77 nbytes_p = get_property(nvram, "#bytes", &proplen);
77 if (nbytes_p == NULL || proplen != sizeof(unsigned int)) 78 if (nbytes_p == NULL || proplen != sizeof(unsigned int))
78 return; 79 return;
79 80
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 6d7ac649b45e..0f4340506c75 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -214,11 +214,11 @@ void __init
214chrp_find_bridges(void) 214chrp_find_bridges(void)
215{ 215{
216 struct device_node *dev; 216 struct device_node *dev;
217 int *bus_range; 217 const int *bus_range;
218 int len, index = -1; 218 int len, index = -1;
219 struct pci_controller *hose; 219 struct pci_controller *hose;
220 unsigned int *dma; 220 const unsigned int *dma;
221 char *model, *machine; 221 const char *model, *machine;
222 int is_longtrail = 0, is_mot = 0, is_pegasos = 0; 222 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
223 struct device_node *root = find_path_device("/"); 223 struct device_node *root = find_path_device("/");
224 struct resource r; 224 struct resource r;
@@ -246,7 +246,7 @@ chrp_find_bridges(void)
246 dev->full_name); 246 dev->full_name);
247 continue; 247 continue;
248 } 248 }
249 bus_range = (int *) get_property(dev, "bus-range", &len); 249 bus_range = get_property(dev, "bus-range", &len);
250 if (bus_range == NULL || len < 2 * sizeof(int)) { 250 if (bus_range == NULL || len < 2 * sizeof(int)) {
251 printk(KERN_WARNING "Can't get bus-range for %s\n", 251 printk(KERN_WARNING "Can't get bus-range for %s\n",
252 dev->full_name); 252 dev->full_name);
@@ -312,8 +312,7 @@ chrp_find_bridges(void)
312 312
313 /* check the first bridge for a property that we can 313 /* check the first bridge for a property that we can
314 use to set pci_dram_offset */ 314 use to set pci_dram_offset */
315 dma = (unsigned int *) 315 dma = get_property(dev, "ibm,dma-ranges", &len);
316 get_property(dev, "ibm,dma-ranges", &len);
317 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) { 316 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
318 pci_dram_offset = dma[2] - dma[3]; 317 pci_dram_offset = dma[2] - dma[3];
319 printk("pci_dram_offset = %lx\n", pci_dram_offset); 318 printk("pci_dram_offset = %lx\n", pci_dram_offset);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index be39742db809..488dbd9b51ae 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -226,8 +226,7 @@ static void __init pegasos_set_l2cr(void)
226 /* Enable L2 cache if needed */ 226 /* Enable L2 cache if needed */
227 np = find_type_devices("cpu"); 227 np = find_type_devices("cpu");
228 if (np != NULL) { 228 if (np != NULL) {
229 unsigned int *l2cr = (unsigned int *) 229 const unsigned int *l2cr = get_property(np, "l2cr", NULL);
230 get_property (np, "l2cr", NULL);
231 if (l2cr == NULL) { 230 if (l2cr == NULL) {
232 printk ("Pegasos l2cr : no cpu l2cr property found\n"); 231 printk ("Pegasos l2cr : no cpu l2cr property found\n");
233 return; 232 return;
@@ -252,7 +251,7 @@ static void briq_restart(char *cmd)
252void __init chrp_setup_arch(void) 251void __init chrp_setup_arch(void)
253{ 252{
254 struct device_node *root = find_path_device ("/"); 253 struct device_node *root = find_path_device ("/");
255 char *machine = NULL; 254 const char *machine = NULL;
256 255
257 /* init to some ~sane value until calibrate_delay() runs */ 256 /* init to some ~sane value until calibrate_delay() runs */
258 loops_per_jiffy = 50000000/HZ; 257 loops_per_jiffy = 50000000/HZ;
@@ -353,7 +352,7 @@ static void __init chrp_find_openpic(void)
353 struct device_node *np, *root; 352 struct device_node *np, *root;
354 int len, i, j; 353 int len, i, j;
355 int isu_size, idu_size; 354 int isu_size, idu_size;
356 unsigned int *iranges, *opprop = NULL; 355 const unsigned int *iranges, *opprop = NULL;
357 int oplen = 0; 356 int oplen = 0;
358 unsigned long opaddr; 357 unsigned long opaddr;
359 int na = 1; 358 int na = 1;
@@ -363,8 +362,7 @@ static void __init chrp_find_openpic(void)
363 return; 362 return;
364 root = of_find_node_by_path("/"); 363 root = of_find_node_by_path("/");
365 if (root) { 364 if (root) {
366 opprop = (unsigned int *) get_property 365 opprop = get_property(root, "platform-open-pic", &oplen);
367 (root, "platform-open-pic", &oplen);
368 na = prom_n_addr_cells(root); 366 na = prom_n_addr_cells(root);
369 } 367 }
370 if (opprop && oplen >= na * sizeof(unsigned int)) { 368 if (opprop && oplen >= na * sizeof(unsigned int)) {
@@ -381,7 +379,7 @@ static void __init chrp_find_openpic(void)
381 379
382 printk(KERN_INFO "OpenPIC at %lx\n", opaddr); 380 printk(KERN_INFO "OpenPIC at %lx\n", opaddr);
383 381
384 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); 382 iranges = get_property(np, "interrupt-ranges", &len);
385 if (iranges == NULL) 383 if (iranges == NULL)
386 len = 0; /* non-distributed mpic */ 384 len = 0; /* non-distributed mpic */
387 else 385 else
@@ -467,8 +465,8 @@ static void __init chrp_find_8259(void)
467 * from anyway 465 * from anyway
468 */ 466 */
469 for (np = find_devices("pci"); np != NULL; np = np->next) { 467 for (np = find_devices("pci"); np != NULL; np = np->next) {
470 unsigned int *addrp = (unsigned int *) 468 const unsigned int *addrp = get_property(np,
471 get_property(np, "8259-interrupt-acknowledge", NULL); 469 "8259-interrupt-acknowledge", NULL);
472 470
473 if (addrp == NULL) 471 if (addrp == NULL)
474 continue; 472 continue;
@@ -527,7 +525,7 @@ void __init
527chrp_init2(void) 525chrp_init2(void)
528{ 526{
529 struct device_node *device; 527 struct device_node *device;
530 unsigned int *p = NULL; 528 const unsigned int *p = NULL;
531 529
532#ifdef CONFIG_NVRAM 530#ifdef CONFIG_NVRAM
533 chrp_nvram_init(); 531 chrp_nvram_init();
@@ -545,8 +543,7 @@ chrp_init2(void)
545 */ 543 */
546 device = find_devices("rtas"); 544 device = find_devices("rtas");
547 if (device) 545 if (device)
548 p = (unsigned int *) get_property 546 p = get_property(device, "rtas-event-scan-rate", NULL);
549 (device, "rtas-event-scan-rate", NULL);
550 if (p && *p) { 547 if (p && *p) {
551 /* 548 /*
552 * Arrange to call chrp_event_scan at least *p times 549 * Arrange to call chrp_event_scan at least *p times