diff options
Diffstat (limited to 'arch/x86/kernel/apic/es7000_32.c')
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 8593582d8022..9536b3fe43f8 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -460,6 +460,12 @@ static unsigned long es7000_check_apicid_present(int bit) | |||
460 | return physid_isset(bit, phys_cpu_present_map); | 460 | return physid_isset(bit, phys_cpu_present_map); |
461 | } | 461 | } |
462 | 462 | ||
463 | static int es7000_early_logical_apicid(int cpu) | ||
464 | { | ||
465 | /* on es7000, logical apicid is the same as physical */ | ||
466 | return early_per_cpu(x86_bios_cpu_apicid, cpu); | ||
467 | } | ||
468 | |||
463 | static unsigned long calculate_ldr(int cpu) | 469 | static unsigned long calculate_ldr(int cpu) |
464 | { | 470 | { |
465 | unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu); | 471 | unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu); |
@@ -504,12 +510,6 @@ static void es7000_setup_apic_routing(void) | |||
504 | nr_ioapics, cpumask_bits(es7000_target_cpus())[0]); | 510 | nr_ioapics, cpumask_bits(es7000_target_cpus())[0]); |
505 | } | 511 | } |
506 | 512 | ||
507 | static int es7000_apicid_to_node(int logical_apicid) | ||
508 | { | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | |||
513 | static int es7000_cpu_present_to_apicid(int mps_cpu) | 513 | static int es7000_cpu_present_to_apicid(int mps_cpu) |
514 | { | 514 | { |
515 | if (!mps_cpu) | 515 | if (!mps_cpu) |
@@ -528,18 +528,6 @@ static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap) | |||
528 | ++cpu_id; | 528 | ++cpu_id; |
529 | } | 529 | } |
530 | 530 | ||
531 | /* Mapping from cpu number to logical apicid */ | ||
532 | static int es7000_cpu_to_logical_apicid(int cpu) | ||
533 | { | ||
534 | #ifdef CONFIG_SMP | ||
535 | if (cpu >= nr_cpu_ids) | ||
536 | return BAD_APICID; | ||
537 | return cpu_2_logical_apicid[cpu]; | ||
538 | #else | ||
539 | return logical_smp_processor_id(); | ||
540 | #endif | ||
541 | } | ||
542 | |||
543 | static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) | 531 | static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
544 | { | 532 | { |
545 | /* For clustered we don't have a good way to do this yet - hack */ | 533 | /* For clustered we don't have a good way to do this yet - hack */ |
@@ -561,7 +549,7 @@ static unsigned int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask) | |||
561 | * The cpus in the mask must all be on the apic cluster. | 549 | * The cpus in the mask must all be on the apic cluster. |
562 | */ | 550 | */ |
563 | for_each_cpu(cpu, cpumask) { | 551 | for_each_cpu(cpu, cpumask) { |
564 | int new_apicid = es7000_cpu_to_logical_apicid(cpu); | 552 | int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); |
565 | 553 | ||
566 | if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) { | 554 | if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) { |
567 | WARN(1, "Not a valid mask!"); | 555 | WARN(1, "Not a valid mask!"); |
@@ -578,7 +566,7 @@ static unsigned int | |||
578 | es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask, | 566 | es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask, |
579 | const struct cpumask *andmask) | 567 | const struct cpumask *andmask) |
580 | { | 568 | { |
581 | int apicid = es7000_cpu_to_logical_apicid(0); | 569 | int apicid = early_per_cpu(x86_cpu_to_logical_apicid, 0); |
582 | cpumask_var_t cpumask; | 570 | cpumask_var_t cpumask; |
583 | 571 | ||
584 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) | 572 | if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC)) |
@@ -632,7 +620,7 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, | |||
632 | } | 620 | } |
633 | 621 | ||
634 | /* We've been warned by a false positive warning.Use __refdata to keep calm. */ | 622 | /* We've been warned by a false positive warning.Use __refdata to keep calm. */ |
635 | struct apic __refdata apic_es7000_cluster = { | 623 | static struct apic __refdata apic_es7000_cluster = { |
636 | 624 | ||
637 | .name = "es7000", | 625 | .name = "es7000", |
638 | .probe = probe_es7000, | 626 | .probe = probe_es7000, |
@@ -655,8 +643,6 @@ struct apic __refdata apic_es7000_cluster = { | |||
655 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, | 643 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, |
656 | .setup_apic_routing = es7000_setup_apic_routing, | 644 | .setup_apic_routing = es7000_setup_apic_routing, |
657 | .multi_timer_check = NULL, | 645 | .multi_timer_check = NULL, |
658 | .apicid_to_node = es7000_apicid_to_node, | ||
659 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, | ||
660 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | 646 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, |
661 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | 647 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, |
662 | .setup_portio_remap = NULL, | 648 | .setup_portio_remap = NULL, |
@@ -695,9 +681,11 @@ struct apic __refdata apic_es7000_cluster = { | |||
695 | .icr_write = native_apic_icr_write, | 681 | .icr_write = native_apic_icr_write, |
696 | .wait_icr_idle = native_apic_wait_icr_idle, | 682 | .wait_icr_idle = native_apic_wait_icr_idle, |
697 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 683 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
684 | |||
685 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, | ||
698 | }; | 686 | }; |
699 | 687 | ||
700 | struct apic __refdata apic_es7000 = { | 688 | static struct apic __refdata apic_es7000 = { |
701 | 689 | ||
702 | .name = "es7000", | 690 | .name = "es7000", |
703 | .probe = probe_es7000, | 691 | .probe = probe_es7000, |
@@ -720,8 +708,6 @@ struct apic __refdata apic_es7000 = { | |||
720 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, | 708 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, |
721 | .setup_apic_routing = es7000_setup_apic_routing, | 709 | .setup_apic_routing = es7000_setup_apic_routing, |
722 | .multi_timer_check = NULL, | 710 | .multi_timer_check = NULL, |
723 | .apicid_to_node = es7000_apicid_to_node, | ||
724 | .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, | ||
725 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | 711 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, |
726 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | 712 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, |
727 | .setup_portio_remap = NULL, | 713 | .setup_portio_remap = NULL, |
@@ -758,4 +744,12 @@ struct apic __refdata apic_es7000 = { | |||
758 | .icr_write = native_apic_icr_write, | 744 | .icr_write = native_apic_icr_write, |
759 | .wait_icr_idle = native_apic_wait_icr_idle, | 745 | .wait_icr_idle = native_apic_wait_icr_idle, |
760 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 746 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
747 | |||
748 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, | ||
761 | }; | 749 | }; |
750 | |||
751 | /* | ||
752 | * Need to check for es7000 followed by es7000_cluster, so this order | ||
753 | * in apic_drivers is important. | ||
754 | */ | ||
755 | apic_drivers(apic_es7000, apic_es7000_cluster); | ||