~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/x86/kernel/apic/es7000_32.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
460
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
469
static unsigned long calculate_ldr(int cpu)
464
470
{
465
471
        unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
504
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
513
static int es7000_cpu_present_to_apicid(int mps_cpu)
514
514
{
515
515
        if (!mps_cpu)
528
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
531
static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
544
532
{
545
533
        /* For clustered we don't have a good way to do this yet - hack */
561
549
         * The cpus in the mask must all be on the apic cluster.
562
550
         */
563
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
554
                if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
567
555
                        WARN(1, "Not a valid mask!");
578
566
es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
579
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
570
        cpumask_var_t cpumask;
583
571
 
584
572
        if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
632
620
}
633
621
 
634
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
625
        .name                           = "es7000",
638
626
        .probe                          = probe_es7000,
655
643
        .ioapic_phys_id_map             = es7000_ioapic_phys_id_map,
656
644
        .setup_apic_routing             = es7000_setup_apic_routing,
657
645
        .multi_timer_check              = NULL,
658
 
        .apicid_to_node                 = es7000_apicid_to_node,
659
 
        .cpu_to_logical_apicid          = es7000_cpu_to_logical_apicid,
660
646
        .cpu_present_to_apicid          = es7000_cpu_present_to_apicid,
661
647
        .apicid_to_cpu_present          = es7000_apicid_to_cpu_present,
662
648
        .setup_portio_remap             = NULL,
695
681
        .icr_write                      = native_apic_icr_write,
696
682
        .wait_icr_idle                  = native_apic_wait_icr_idle,
697
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
690
        .name                           = "es7000",
703
691
        .probe                          = probe_es7000,
720
708
        .ioapic_phys_id_map             = es7000_ioapic_phys_id_map,
721
709
        .setup_apic_routing             = es7000_setup_apic_routing,
722
710
        .multi_timer_check              = NULL,
723
 
        .apicid_to_node                 = es7000_apicid_to_node,
724
 
        .cpu_to_logical_apicid          = es7000_cpu_to_logical_apicid,
725
711
        .cpu_present_to_apicid          = es7000_cpu_present_to_apicid,
726
712
        .apicid_to_cpu_present          = es7000_apicid_to_cpu_present,
727
713
        .setup_portio_remap             = NULL,
758
744
        .icr_write                      = native_apic_icr_write,
759
745
        .wait_icr_idle                  = native_apic_wait_icr_idle,
760
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);