aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/es7000_32.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-02-25 23:50:49 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-26 00:32:25 -0500
commit2b6163bf5772644068694583816fa41e8474239f (patch)
treeb854e9070254ad2942901941b67e8a56d61f7f91 /arch/x86/kernel/apic/es7000_32.c
parentecc25fbd6b9e07b33895c61ddf84006b00f55d99 (diff)
x86: remove update_apic from x86_quirks
Impact: cleanup x86_quirks->update_apic() calling looks crazy. so try to remove it: 1. every apic take wakeup_cpu member directly 2. separate es7000_apic to es7000_apic_cluster 3. use uv_wakeup_cpu directly Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/es7000_32.c')
-rw-r--r--arch/x86/kernel/apic/es7000_32.c127
1 files changed, 98 insertions, 29 deletions
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 320f2d2e4e54..9f6102fc87a1 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -163,17 +163,12 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
163 return 0; 163 return 0;
164} 164}
165 165
166static int __init es7000_update_apic(void) 166static int __init es7000_apic_is_cluster(void)
167{ 167{
168 apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
169
170 /* MPENTIUMIII */ 168 /* MPENTIUMIII */
171 if (boot_cpu_data.x86 == 6 && 169 if (boot_cpu_data.x86 == 6 &&
172 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) { 170 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11))
173 es7000_update_apic_to_cluster(); 171 return 1;
174 apic->wait_for_init_deassert = NULL;
175 apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
176 }
177 172
178 return 0; 173 return 0;
179} 174}
@@ -192,8 +187,6 @@ static void __init setup_unisys(void)
192 else 187 else
193 es7000_plat = ES7000_CLASSIC; 188 es7000_plat = ES7000_CLASSIC;
194 ioapic_renumber_irq = es7000_rename_gsi; 189 ioapic_renumber_irq = es7000_rename_gsi;
195
196 x86_quirks->update_apic = es7000_update_apic;
197} 190}
198 191
199/* 192/*
@@ -310,6 +303,8 @@ static int es7000_check_dsdt(void)
310 return 0; 303 return 0;
311} 304}
312 305
306static int __initdata es7000_acpi_ret;
307
313/* Hook from generic ACPI tables.c */ 308/* Hook from generic ACPI tables.c */
314static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 309static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
315{ 310{
@@ -332,8 +327,19 @@ static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
332 */ 327 */
333 unmap_unisys_acpi_oem_table(oem_addr); 328 unmap_unisys_acpi_oem_table(oem_addr);
334 } 329 }
335 return ret; 330
331 es7000_acpi_ret = ret;
332
333 return ret && !es7000_apic_is_cluster();
336} 334}
335static int __init es7000_acpi_madt_oem_check_cluster(char *oem_id,
336 char *oem_table_id)
337{
338 int ret = es7000_acpi_ret;
339
340 return ret && es7000_apic_is_cluster();
341}
342
337#else /* !CONFIG_ACPI: */ 343#else /* !CONFIG_ACPI: */
338static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 344static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
339{ 345{
@@ -416,11 +422,8 @@ static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
416 422
417static void es7000_wait_for_init_deassert(atomic_t *deassert) 423static void es7000_wait_for_init_deassert(atomic_t *deassert)
418{ 424{
419#ifndef CONFIG_ES7000_CLUSTERED_APIC
420 while (!atomic_read(deassert)) 425 while (!atomic_read(deassert))
421 cpu_relax(); 426 cpu_relax();
422#endif
423 return;
424} 427}
425 428
426static unsigned int es7000_get_apic_id(unsigned long x) 429static unsigned int es7000_get_apic_id(unsigned long x)
@@ -659,37 +662,103 @@ static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
659 return cpuid_apic >> index_msb; 662 return cpuid_apic >> index_msb;
660} 663}
661 664
662void __init es7000_update_apic_to_cluster(void)
663{
664 apic->target_cpus = target_cpus_cluster;
665 apic->irq_delivery_mode = dest_LowestPrio;
666 /* logical delivery broadcast to all procs: */
667 apic->irq_dest_mode = 1;
668
669 apic->init_apic_ldr = es7000_init_apic_ldr_cluster;
670
671 apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster;
672}
673
674static int probe_es7000(void) 665static int probe_es7000(void)
675{ 666{
676 /* probed later in mptable/ACPI hooks */ 667 /* probed later in mptable/ACPI hooks */
677 return 0; 668 return 0;
678} 669}
679 670
671static int __initdata es7000_mps_ret;
680static __init int 672static __init int
681es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) 673es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
682{ 674{
675 int ret = 0;
676
683 if (mpc->oemptr) { 677 if (mpc->oemptr) {
684 struct mpc_oemtable *oem_table = 678 struct mpc_oemtable *oem_table =
685 (struct mpc_oemtable *)mpc->oemptr; 679 (struct mpc_oemtable *)mpc->oemptr;
686 680
687 if (!strncmp(oem, "UNISYS", 6)) 681 if (!strncmp(oem, "UNISYS", 6))
688 return parse_unisys_oem((char *)oem_table); 682 ret = parse_unisys_oem((char *)oem_table);
689 } 683 }
690 return 0; 684
685 es7000_mps_ret = ret;
686
687 return ret && !es7000_apic_is_cluster();
688}
689
690static __init int
691es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, char *productid)
692{
693 int ret = es7000_mps_ret;
694
695 return ret && es7000_apic_is_cluster();
691} 696}
692 697
698struct apic apic_es7000_cluster = {
699
700 .name = "es7000",
701 .probe = probe_es7000,
702 .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
703 .apic_id_registered = es7000_apic_id_registered,
704
705 .irq_delivery_mode = dest_LowestPrio,
706 /* logical delivery broadcast to all procs: */
707 .irq_dest_mode = 1,
708
709 .target_cpus = target_cpus_cluster,
710 .disable_esr = 1,
711 .dest_logical = 0,
712 .check_apicid_used = es7000_check_apicid_used,
713 .check_apicid_present = es7000_check_apicid_present,
714
715 .vector_allocation_domain = es7000_vector_allocation_domain,
716 .init_apic_ldr = es7000_init_apic_ldr_cluster,
717
718 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
719 .setup_apic_routing = es7000_setup_apic_routing,
720 .multi_timer_check = NULL,
721 .apicid_to_node = es7000_apicid_to_node,
722 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
723 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
724 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
725 .setup_portio_remap = NULL,
726 .check_phys_apicid_present = es7000_check_phys_apicid_present,
727 .enable_apic_mode = es7000_enable_apic_mode,
728 .phys_pkg_id = es7000_phys_pkg_id,
729 .mps_oem_check = es7000_mps_oem_check_cluster,
730
731 .get_apic_id = es7000_get_apic_id,
732 .set_apic_id = NULL,
733 .apic_id_mask = 0xFF << 24,
734
735 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster,
736 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
737
738 .send_IPI_mask = es7000_send_IPI_mask,
739 .send_IPI_mask_allbutself = NULL,
740 .send_IPI_allbutself = es7000_send_IPI_allbutself,
741 .send_IPI_all = es7000_send_IPI_all,
742 .send_IPI_self = default_send_IPI_self,
743
744 .wakeup_cpu = wakeup_secondary_cpu_via_mip,
745
746 .trampoline_phys_low = 0x467,
747 .trampoline_phys_high = 0x469,
748
749 .wait_for_init_deassert = NULL,
750
751 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
752 .smp_callin_clear_local_apic = NULL,
753 .inquire_remote_apic = default_inquire_remote_apic,
754
755 .read = native_apic_mem_read,
756 .write = native_apic_mem_write,
757 .icr_read = native_apic_icr_read,
758 .icr_write = native_apic_icr_write,
759 .wait_icr_idle = native_apic_wait_icr_idle,
760 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
761};
693 762
694struct apic apic_es7000 = { 763struct apic apic_es7000 = {
695 764
@@ -737,7 +806,7 @@ struct apic apic_es7000 = {
737 .send_IPI_all = es7000_send_IPI_all, 806 .send_IPI_all = es7000_send_IPI_all,
738 .send_IPI_self = default_send_IPI_self, 807 .send_IPI_self = default_send_IPI_self,
739 808
740 .wakeup_cpu = NULL, 809 .wakeup_cpu = wakeup_secondary_cpu_via_init,
741 810
742 .trampoline_phys_low = 0x467, 811 .trampoline_phys_low = 0x467,
743 .trampoline_phys_high = 0x469, 812 .trampoline_phys_high = 0x469,