aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2007-02-02 11:48:19 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:22 -0500
commitad71860a17ba33eb0e673e9e2cf5ba0d8e3e3fdd (patch)
tree9f60547a2e8782c04d7cd1c41bc874047008458c /arch
parenta4bbb810dedaecf74d54b16b6dd3c33e95e1024c (diff)
ACPICA: minimal patch to integrate new tables into Linux
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/acpi/boot.c17
-rw-r--r--arch/ia64/kernel/acpi.c8
-rw-r--r--arch/ia64/sn/kernel/io_common.c17
-rw-r--r--arch/ia64/sn/kernel/iomv.c10
-rw-r--r--arch/x86_64/kernel/time.c18
5 files changed, 36 insertions, 34 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index cbcb2c27f48b..9adabc4dba70 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -716,33 +716,26 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
716 printk(KERN_WARNING PREFIX "Unable to map FADT\n"); 716 printk(KERN_WARNING PREFIX "Unable to map FADT\n");
717 return 0; 717 return 0;
718 } 718 }
719 /* initialize sci_int early for INT_SRC_OVR MADT parsing */
720 acpi_fadt.sci_int = fadt->sci_int;
721
722 /* initialize rev and apic_phys_dest_mode for x86_64 genapic */
723 acpi_fadt.revision = fadt->revision;
724 acpi_fadt.force_apic_physical_destination_mode =
725 fadt->force_apic_physical_destination_mode;
726 719
727#ifdef CONFIG_X86_PM_TIMER 720#ifdef CONFIG_X86_PM_TIMER
728 /* detect the location of the ACPI PM Timer */ 721 /* detect the location of the ACPI PM Timer */
729 if (fadt->revision >= FADT2_REVISION_ID) { 722 if (fadt->header.revision >= FADT2_REVISION_ID) {
730 /* FADT rev. 2 */ 723 /* FADT rev. 2 */
731 if (fadt->xpm_tmr_blk.address_space_id != 724 if (fadt->xpm_timer_block.space_id !=
732 ACPI_ADR_SPACE_SYSTEM_IO) 725 ACPI_ADR_SPACE_SYSTEM_IO)
733 return 0; 726 return 0;
734 727
735 pmtmr_ioport = fadt->xpm_tmr_blk.address; 728 pmtmr_ioport = fadt->xpm_timer_block.address;
736 /* 729 /*
737 * "X" fields are optional extensions to the original V1.0 730 * "X" fields are optional extensions to the original V1.0
738 * fields, so we must selectively expand V1.0 fields if the 731 * fields, so we must selectively expand V1.0 fields if the
739 * corresponding X field is zero. 732 * corresponding X field is zero.
740 */ 733 */
741 if (!pmtmr_ioport) 734 if (!pmtmr_ioport)
742 pmtmr_ioport = fadt->V1_pm_tmr_blk; 735 pmtmr_ioport = fadt->pm_timer_block;
743 } else { 736 } else {
744 /* FADT rev. 1 */ 737 /* FADT rev. 1 */
745 pmtmr_ioport = fadt->V1_pm_tmr_blk; 738 pmtmr_ioport = fadt->pm_timer_block;
746 } 739 }
747 if (pmtmr_ioport) 740 if (pmtmr_ioport)
748 printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", 741 printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index ef2fe474f107..aa6f96720984 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -76,7 +76,7 @@ const char *acpi_get_sysname(void)
76{ 76{
77#ifdef CONFIG_IA64_GENERIC 77#ifdef CONFIG_IA64_GENERIC
78 unsigned long rsdp_phys; 78 unsigned long rsdp_phys;
79 struct acpi20_table_rsdp *rsdp; 79 struct acpi_table_rsdp *rsdp;
80 struct acpi_table_xsdt *xsdt; 80 struct acpi_table_xsdt *xsdt;
81 struct acpi_table_header *hdr; 81 struct acpi_table_header *hdr;
82 82
@@ -87,8 +87,8 @@ const char *acpi_get_sysname(void)
87 return "dig"; 87 return "dig";
88 } 88 }
89 89
90 rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys); 90 rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);
91 if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { 91 if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {
92 printk(KERN_ERR 92 printk(KERN_ERR
93 "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); 93 "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
94 return "dig"; 94 return "dig";
@@ -96,7 +96,7 @@ const char *acpi_get_sysname(void)
96 96
97 xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address); 97 xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
98 hdr = &xsdt->header; 98 hdr = &xsdt->header;
99 if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { 99 if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {
100 printk(KERN_ERR 100 printk(KERN_ERR
101 "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); 101 "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
102 return "dig"; 102 return "dig";
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index d4dd8f4b6b8d..65979f1fb353 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -25,7 +25,6 @@
25#include "xtalk/xwidgetdev.h" 25#include "xtalk/xwidgetdev.h"
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27#include <asm/sn/sn2/sn_hwperf.h> 27#include <asm/sn/sn2/sn_hwperf.h>
28#include <asm/sn/acpi.h>
29 28
30extern void sn_init_cpei_timer(void); 29extern void sn_init_cpei_timer(void);
31extern void register_sn_procfs(void); 30extern void register_sn_procfs(void);
@@ -37,7 +36,6 @@ extern void sn_legacy_pci_window_fixup(struct pci_controller *, u64, u64);
37extern void sn_io_acpi_init(void); 36extern void sn_io_acpi_init(void);
38extern void sn_io_init(void); 37extern void sn_io_init(void);
39 38
40
41static struct list_head sn_sysdata_list; 39static struct list_head sn_sysdata_list;
42 40
43/* sysdata list struct */ 41/* sysdata list struct */
@@ -50,6 +48,15 @@ int sn_ioif_inited; /* SN I/O infrastructure initialized? */
50 48
51struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */ 49struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */
52 50
51int sn_acpi_base_support()
52{
53 struct acpi_table_header *header;
54 (void)acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header);
55 if (header && header->oem_revision >= 0x20101)
56 return 1;
57 return 0;
58}
59
53/* 60/*
54 * Hooks and struct for unsupported pci providers 61 * Hooks and struct for unsupported pci providers
55 */ 62 */
@@ -286,7 +293,7 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
286 list_add_tail(&pcidev_info->pdi_list, 293 list_add_tail(&pcidev_info->pdi_list,
287 &(SN_PLATFORM_DATA(dev->bus)->pcidev_info)); 294 &(SN_PLATFORM_DATA(dev->bus)->pcidev_info));
288 295
289 if (SN_ACPI_BASE_SUPPORT()) 296 if (sn_acpi_base_support())
290 sn_acpi_slot_fixup(dev, pcidev_info); 297 sn_acpi_slot_fixup(dev, pcidev_info);
291 else 298 else
292 sn_more_slot_fixup(dev, pcidev_info); 299 sn_more_slot_fixup(dev, pcidev_info);
@@ -498,7 +505,7 @@ void __devinit
498sn_pci_fixup_bus(struct pci_bus *bus) 505sn_pci_fixup_bus(struct pci_bus *bus)
499{ 506{
500 507
501 if (SN_ACPI_BASE_SUPPORT()) 508 if (sn_acpi_base_support())
502 sn_acpi_bus_fixup(bus); 509 sn_acpi_bus_fixup(bus);
503 else 510 else
504 sn_bus_fixup(bus); 511 sn_bus_fixup(bus);
@@ -546,7 +553,7 @@ sn_io_early_init(void)
546 553
547 printk(KERN_INFO "ACPI DSDT OEM Rev 0x%x\n", 554 printk(KERN_INFO "ACPI DSDT OEM Rev 0x%x\n",
548 acpi_gbl_DSDT->oem_revision); 555 acpi_gbl_DSDT->oem_revision);
549 if (SN_ACPI_BASE_SUPPORT()) 556 if (sn_acpi_base_support())
550 sn_io_acpi_init(); 557 sn_io_acpi_init();
551 else 558 else
552 sn_io_init(); 559 sn_io_init();
diff --git a/arch/ia64/sn/kernel/iomv.c b/arch/ia64/sn/kernel/iomv.c
index 4aa4f301d56d..b1a47da118b1 100644
--- a/arch/ia64/sn/kernel/iomv.c
+++ b/arch/ia64/sn/kernel/iomv.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
@@ -16,7 +16,6 @@
16#include <asm/sn/pda.h> 16#include <asm/sn/pda.h>
17#include <asm/sn/sn_cpuid.h> 17#include <asm/sn/sn_cpuid.h>
18#include <asm/sn/shub_mmr.h> 18#include <asm/sn/shub_mmr.h>
19#include <asm/sn/acpi.h>
20 19
21#define IS_LEGACY_VGA_IOPORT(p) \ 20#define IS_LEGACY_VGA_IOPORT(p) \
22 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df)) 21 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df))
@@ -26,9 +25,12 @@
26 * @port: port to convert 25 * @port: port to convert
27 * 26 *
28 * Legacy in/out instructions are converted to ld/st instructions 27 * Legacy in/out instructions are converted to ld/st instructions
29 * on IA64. This routine will convert a port number into a valid 28 * on IA64. This routine will convert a port number into a valid
30 * SN i/o address. Used by sn_in*() and sn_out*(). 29 * SN i/o address. Used by sn_in*() and sn_out*().
31 */ 30 */
31
32extern int sn_acpi_base_support();
33
32void *sn_io_addr(unsigned long port) 34void *sn_io_addr(unsigned long port)
33{ 35{
34 if (!IS_RUNNING_ON_SIMULATOR()) { 36 if (!IS_RUNNING_ON_SIMULATOR()) {
@@ -37,7 +39,7 @@ void *sn_io_addr(unsigned long port)
37 /* On sn2, legacy I/O ports don't point at anything */ 39 /* On sn2, legacy I/O ports don't point at anything */
38 if (port < (64 * 1024)) 40 if (port < (64 * 1024))
39 return NULL; 41 return NULL;
40 if (SN_ACPI_BASE_SUPPORT()) 42 if (sn_acpi_base_support())
41 return (__ia64_mk_io_addr(port)); 43 return (__ia64_mk_io_addr(port));
42 else 44 else
43 return ((void *)(port | __IA64_UNCACHED_OFFSET)); 45 return ((void *)(port | __IA64_UNCACHED_OFFSET));
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 5cc76d0d331f..335cc91c49b7 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -498,7 +498,7 @@ static unsigned long get_cmos_time(void)
498{ 498{
499 unsigned int year, mon, day, hour, min, sec; 499 unsigned int year, mon, day, hour, min, sec;
500 unsigned long flags; 500 unsigned long flags;
501 unsigned extyear = 0; 501 unsigned century = 0;
502 502
503 spin_lock_irqsave(&rtc_lock, flags); 503 spin_lock_irqsave(&rtc_lock, flags);
504 504
@@ -510,9 +510,9 @@ static unsigned long get_cmos_time(void)
510 mon = CMOS_READ(RTC_MONTH); 510 mon = CMOS_READ(RTC_MONTH);
511 year = CMOS_READ(RTC_YEAR); 511 year = CMOS_READ(RTC_YEAR);
512#ifdef CONFIG_ACPI 512#ifdef CONFIG_ACPI
513 if (acpi_fadt.revision >= FADT2_REVISION_ID && 513 if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
514 acpi_fadt.century) 514 acpi_gbl_FADT.century)
515 extyear = CMOS_READ(acpi_fadt.century); 515 century = CMOS_READ(acpi_gbl_FADT.century);
516#endif 516#endif
517 } while (sec != CMOS_READ(RTC_SECONDS)); 517 } while (sec != CMOS_READ(RTC_SECONDS));
518 518
@@ -530,10 +530,10 @@ static unsigned long get_cmos_time(void)
530 BCD_TO_BIN(mon); 530 BCD_TO_BIN(mon);
531 BCD_TO_BIN(year); 531 BCD_TO_BIN(year);
532 532
533 if (extyear) { 533 if (century) {
534 BCD_TO_BIN(extyear); 534 BCD_TO_BIN(century);
535 year += extyear; 535 year += century * 100;
536 printk(KERN_INFO "Extended CMOS year: %d\n", extyear); 536 printk(KERN_INFO "Extended CMOS year: %d\n", century * 100);
537 } else { 537 } else {
538 /* 538 /*
539 * x86-64 systems only exists since 2002. 539 * x86-64 systems only exists since 2002.
@@ -954,7 +954,7 @@ __cpuinit int unsynchronized_tsc(void)
954 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { 954 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
955#ifdef CONFIG_ACPI 955#ifdef CONFIG_ACPI
956 /* But TSC doesn't tick in C3 so don't use it there */ 956 /* But TSC doesn't tick in C3 so don't use it there */
957 if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000) 957 if (acpi_gbl_FADT.header.length > 0 && acpi_gbl_FADT.C3latency < 1000)
958 return 1; 958 return 1;
959#endif 959#endif
960 return 0; 960 return 0;