diff options
Diffstat (limited to 'arch/sparc64/kernel/mdesc.c')
-rw-r--r-- | arch/sparc64/kernel/mdesc.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c index 9246c2cf9574..f0e16045fb16 100644 --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c | |||
@@ -473,6 +473,53 @@ static void __init set_core_ids(void) | |||
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | static void __init mark_proc_ids(struct mdesc_node *mp, int proc_id) | ||
477 | { | ||
478 | int i; | ||
479 | |||
480 | for (i = 0; i < mp->num_arcs; i++) { | ||
481 | struct mdesc_node *t = mp->arcs[i].arc; | ||
482 | const u64 *id; | ||
483 | |||
484 | if (strcmp(mp->arcs[i].name, "back")) | ||
485 | continue; | ||
486 | |||
487 | if (strcmp(t->name, "cpu")) | ||
488 | continue; | ||
489 | |||
490 | id = md_get_property(t, "id", NULL); | ||
491 | if (*id < NR_CPUS) | ||
492 | cpu_data(*id).proc_id = proc_id; | ||
493 | } | ||
494 | } | ||
495 | |||
496 | static void __init __set_proc_ids(const char *exec_unit_name) | ||
497 | { | ||
498 | struct mdesc_node *mp; | ||
499 | int idx; | ||
500 | |||
501 | idx = 0; | ||
502 | md_for_each_node_by_name(mp, exec_unit_name) { | ||
503 | const char *type; | ||
504 | int len; | ||
505 | |||
506 | type = md_get_property(mp, "type", &len); | ||
507 | if (!find_in_proplist(type, "int", len) && | ||
508 | !find_in_proplist(type, "integer", len)) | ||
509 | continue; | ||
510 | |||
511 | mark_proc_ids(mp, idx); | ||
512 | |||
513 | idx++; | ||
514 | } | ||
515 | } | ||
516 | |||
517 | static void __init set_proc_ids(void) | ||
518 | { | ||
519 | __set_proc_ids("exec_unit"); | ||
520 | __set_proc_ids("exec-unit"); | ||
521 | } | ||
522 | |||
476 | static void __init get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned char def) | 523 | static void __init get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned char def) |
477 | { | 524 | { |
478 | u64 val; | 525 | u64 val; |
@@ -574,9 +621,15 @@ static void __init mdesc_fill_in_cpu_data(void) | |||
574 | #endif | 621 | #endif |
575 | 622 | ||
576 | c->core_id = 0; | 623 | c->core_id = 0; |
624 | c->proc_id = -1; | ||
577 | } | 625 | } |
578 | 626 | ||
627 | #ifdef CONFIG_SMP | ||
628 | sparc64_multi_core = 1; | ||
629 | #endif | ||
630 | |||
579 | set_core_ids(); | 631 | set_core_ids(); |
632 | set_proc_ids(); | ||
580 | 633 | ||
581 | smp_fill_in_sib_core_maps(); | 634 | smp_fill_in_sib_core_maps(); |
582 | } | 635 | } |