setup-common.c (0612ec48762bf8712db1925b2e67246d2237ebab) | setup-common.c (a4dc7ff08915a2035aa6d6decc53fa1deaa410bb) |
---|---|
1/* 2 * Common boot and setup code for both 32-bit and 64-bit. 3 * Extracted from arch/powerpc/kernel/setup_64.c. 4 * 5 * Copyright (C) 2001 PPC64 Team, IBM Corp 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License --- 290 unchanged lines hidden (view full) --- 299 .next = c_next, 300 .stop = c_stop, 301 .show = show_cpuinfo, 302}; 303 304void __init check_for_initrd(void) 305{ 306#ifdef CONFIG_BLK_DEV_INITRD | 1/* 2 * Common boot and setup code for both 32-bit and 64-bit. 3 * Extracted from arch/powerpc/kernel/setup_64.c. 4 * 5 * Copyright (C) 2001 PPC64 Team, IBM Corp 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License --- 290 unchanged lines hidden (view full) --- 299 .next = c_next, 300 .stop = c_stop, 301 .show = show_cpuinfo, 302}; 303 304void __init check_for_initrd(void) 305{ 306#ifdef CONFIG_BLK_DEV_INITRD |
307 unsigned long *prop; | 307 const unsigned int *prop; 308 int len; |
308 309 DBG(" -> check_for_initrd()\n"); 310 311 if (of_chosen) { | 309 310 DBG(" -> check_for_initrd()\n"); 311 312 if (of_chosen) { |
312 prop = (unsigned long *)get_property(of_chosen, 313 "linux,initrd-start", NULL); | 313 prop = get_property(of_chosen, "linux,initrd-start", &len); |
314 if (prop != NULL) { | 314 if (prop != NULL) { |
315 initrd_start = (unsigned long)__va(*prop); 316 prop = (unsigned long *)get_property(of_chosen, 317 "linux,initrd-end", NULL); | 315 initrd_start = (unsigned long) 316 __va(of_read_ulong(prop, len / 4)); 317 prop = get_property(of_chosen, 318 "linux,initrd-end", &len); |
318 if (prop != NULL) { | 319 if (prop != NULL) { |
319 initrd_end = (unsigned long)__va(*prop); | 320 initrd_end = (unsigned long) 321 __va(of_read_ulong(prop, len / 4)); |
320 initrd_below_start_ok = 1; 321 } else 322 initrd_start = 0; 323 } 324 } 325 326 /* If we were passed an initrd, set the ROOT_DEV properly if the values 327 * look sensible. If not, clear initrd reference. --- 33 unchanged lines hidden (view full) --- 361 * NOTE: This must match the parsing done in early_init_dt_scan_cpus. 362 */ 363void __init smp_setup_cpu_maps(void) 364{ 365 struct device_node *dn = NULL; 366 int cpu = 0; 367 368 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { | 322 initrd_below_start_ok = 1; 323 } else 324 initrd_start = 0; 325 } 326 } 327 328 /* If we were passed an initrd, set the ROOT_DEV properly if the values 329 * look sensible. If not, clear initrd reference. --- 33 unchanged lines hidden (view full) --- 363 * NOTE: This must match the parsing done in early_init_dt_scan_cpus. 364 */ 365void __init smp_setup_cpu_maps(void) 366{ 367 struct device_node *dn = NULL; 368 int cpu = 0; 369 370 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { |
369 int *intserv; | 371 const int *intserv; |
370 int j, len = sizeof(u32), nthreads = 1; 371 | 372 int j, len = sizeof(u32), nthreads = 1; 373 |
372 intserv = (int *)get_property(dn, "ibm,ppc-interrupt-server#s", 373 &len); | 374 intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len); |
374 if (intserv) 375 nthreads = len / sizeof(int); 376 else { | 375 if (intserv) 376 nthreads = len / sizeof(int); 377 else { |
377 intserv = (int *) get_property(dn, "reg", NULL); | 378 intserv = get_property(dn, "reg", NULL); |
378 if (!intserv) 379 intserv = &cpu; /* assume logical == phys */ 380 } 381 382 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { 383 cpu_set(cpu, cpu_present_map); 384 set_hard_smp_processor_id(cpu, intserv[j]); 385 cpu_set(cpu, cpu_possible_map); --- 4 unchanged lines hidden (view full) --- 390#ifdef CONFIG_PPC64 391 /* 392 * On pSeries LPAR, we need to know how many cpus 393 * could possibly be added to this partition. 394 */ 395 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && 396 (dn = of_find_node_by_path("/rtas"))) { 397 int num_addr_cell, num_size_cell, maxcpus; | 379 if (!intserv) 380 intserv = &cpu; /* assume logical == phys */ 381 } 382 383 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { 384 cpu_set(cpu, cpu_present_map); 385 set_hard_smp_processor_id(cpu, intserv[j]); 386 cpu_set(cpu, cpu_possible_map); --- 4 unchanged lines hidden (view full) --- 391#ifdef CONFIG_PPC64 392 /* 393 * On pSeries LPAR, we need to know how many cpus 394 * could possibly be added to this partition. 395 */ 396 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && 397 (dn = of_find_node_by_path("/rtas"))) { 398 int num_addr_cell, num_size_cell, maxcpus; |
398 unsigned int *ireg; | 399 const unsigned int *ireg; |
399 400 num_addr_cell = prom_n_addr_cells(dn); 401 num_size_cell = prom_n_size_cells(dn); 402 | 400 401 num_addr_cell = prom_n_addr_cells(dn); 402 num_size_cell = prom_n_size_cells(dn); 403 |
403 ireg = (unsigned int *) 404 get_property(dn, "ibm,lrdr-capacity", NULL); | 404 ireg = get_property(dn, "ibm,lrdr-capacity", NULL); |
405 406 if (!ireg) 407 goto out; 408 409 maxcpus = ireg[num_addr_cell + num_size_cell]; 410 411 /* Double maxcpus for processors which have SMT capability */ 412 if (cpu_has_feature(CPU_FTR_SMT)) --- 26 unchanged lines hidden (view full) --- 439 440 vdso_data->processorCount = num_present_cpus(); 441#endif /* CONFIG_PPC64 */ 442} 443#endif /* CONFIG_SMP */ 444 445int __initdata do_early_xmon; 446#ifdef CONFIG_XMON | 405 406 if (!ireg) 407 goto out; 408 409 maxcpus = ireg[num_addr_cell + num_size_cell]; 410 411 /* Double maxcpus for processors which have SMT capability */ 412 if (cpu_has_feature(CPU_FTR_SMT)) --- 26 unchanged lines hidden (view full) --- 439 440 vdso_data->processorCount = num_present_cpus(); 441#endif /* CONFIG_PPC64 */ 442} 443#endif /* CONFIG_SMP */ 444 445int __initdata do_early_xmon; 446#ifdef CONFIG_XMON |
447extern int xmon_no_auto_backtrace; 448 |
|
447static int __init early_xmon(char *p) 448{ 449 /* ensure xmon is enabled */ 450 if (p) { 451 if (strncmp(p, "on", 2) == 0) 452 xmon_init(1); 453 if (strncmp(p, "off", 3) == 0) 454 xmon_init(0); | 449static int __init early_xmon(char *p) 450{ 451 /* ensure xmon is enabled */ 452 if (p) { 453 if (strncmp(p, "on", 2) == 0) 454 xmon_init(1); 455 if (strncmp(p, "off", 3) == 0) 456 xmon_init(0); |
457 if (strncmp(p, "nobt", 4) == 0) 458 xmon_no_auto_backtrace = 1; |
|
455 if (strncmp(p, "early", 5) != 0) 456 return 0; 457 } 458 xmon_init(1); 459 do_early_xmon = 1; 460 461 return 0; 462} --- 81 unchanged lines hidden --- | 459 if (strncmp(p, "early", 5) != 0) 460 return 0; 461 } 462 xmon_init(1); 463 do_early_xmon = 1; 464 465 return 0; 466} --- 81 unchanged lines hidden --- |