Commit 6f982794 authored by Andy Grover's avatar Andy Grover

Merge groveronline.com:/root/bk/linux-2.5

into groveronline.com:/root/bk/linux-acpi
parents 2d00c1cc feb66678
obj-$(CONFIG_ACPI_HT_ONLY) := acpitable.o
obj-$(CONFIG_ACPI_BOOT) := boot.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
This diff is collapsed.
/*
* acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
*
* Copyright (C) 1999 Andrew Henroid
* Copyright (C) 2001 Richard Schaal
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
* Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
* Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
*/
/*
* The following codes are cut&pasted from drivers/acpi. Part of the code
* there can be not updated or delivered yet.
* To avoid conflicts when CONFIG_ACPI is defined, the following codes are
* modified so that they are self-contained in this file.
* -- jun
*/
#ifndef _HEADER_ACPITABLE_H_
#define _HEADER_ACPITABLE_H_
#define dprintk printk
typedef unsigned int ACPI_TBLPTR;
typedef struct { /* ACPI common table header */
char signature[4]; /* identifies type of table */
u32 length; /* length of table,
in bytes, * including header */
u8 revision; /* specification minor version # */
u8 checksum; /* to make sum of entire table == 0 */
char oem_id[6]; /* OEM identification */
char oem_table_id[8]; /* OEM table identification */
u32 oem_revision; /* OEM revision number */
char asl_compiler_id[4]; /* ASL compiler vendor ID */
u32 asl_compiler_revision; /* ASL compiler revision number */
} acpi_table_header __attribute__ ((packed));;
enum {
ACPI_APIC = 0,
ACPI_BOOT,
ACPI_DBGP,
ACPI_DSDT,
ACPI_ECDT,
ACPI_ETDT,
ACPI_FACP,
ACPI_FACS,
ACPI_OEMX,
ACPI_PSDT,
ACPI_SBST,
ACPI_SLIT,
ACPI_SPCR,
ACPI_SRAT,
ACPI_SSDT,
ACPI_SPMI,
ACPI_XSDT,
ACPI_TABLE_COUNT
};
static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
"APIC",
"BOOT",
"DBGP",
"DSDT",
"ECDT",
"ETDT",
"FACP",
"FACS",
"OEM",
"PSDT",
"SBST",
"SLIT",
"SPCR",
"SRAT",
"SSDT",
"SPMI",
"XSDT"
};
struct acpi_table_madt {
acpi_table_header header;
u32 lapic_address;
struct {
u32 pcat_compat:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));;
enum {
ACPI_MADT_LAPIC = 0,
ACPI_MADT_IOAPIC,
ACPI_MADT_INT_SRC_OVR,
ACPI_MADT_NMI_SRC,
ACPI_MADT_LAPIC_NMI,
ACPI_MADT_LAPIC_ADDR_OVR,
ACPI_MADT_IOSAPIC,
ACPI_MADT_LSAPIC,
ACPI_MADT_PLAT_INT_SRC,
ACPI_MADT_ENTRY_COUNT
};
#define RSDP_SIG "RSD PTR "
#define RSDT_SIG "RSDT"
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_MEMORY_MODE 0x01
#define ACPI_LOGICAL_ADDRESSING 0x00
#define ACPI_PHYSICAL_ADDRESSING 0x01
#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */
#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */
#define LO_RSDP_WINDOW_SIZE 0x400
#define HI_RSDP_WINDOW_SIZE 0x20000
#define RSDP_SCAN_STEP 16
#define RSDP_CHECKSUM_LENGTH 20
typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
struct acpi_table_rsdp {
char signature[8];
u8 checksum;
char oem_id[6];
u8 revision;
u32 rsdt_address;
} __attribute__ ((packed));
struct acpi_table_rsdt {
acpi_table_header header;
u32 entry[ACPI_TABLE_COUNT];
} __attribute__ ((packed));
typedef struct {
u8 type;
u8 length;
} acpi_madt_entry_header __attribute__ ((packed));
typedef struct {
u16 polarity:2;
u16 trigger:2;
u16 reserved:12;
} acpi_madt_int_flags __attribute__ ((packed));
struct acpi_table_lapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
struct {
u32 enabled:1;
u32 reserved:31;
} flags __attribute__ ((packed));
} __attribute__ ((packed));
struct acpi_table_ioapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 address;
u32 global_irq_base;
} __attribute__ ((packed));
struct acpi_table_int_src_ovr {
acpi_madt_entry_header header;
u8 bus;
u8 bus_irq;
u32 global_irq;
acpi_madt_int_flags flags;
} __attribute__ ((packed));
struct acpi_table_nmi_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u32 global_irq;
} __attribute__ ((packed));
struct acpi_table_lapic_nmi {
acpi_madt_entry_header header;
u8 acpi_id;
acpi_madt_int_flags flags;
u8 lint;
} __attribute__ ((packed));
struct acpi_table_lapic_addr_ovr {
acpi_madt_entry_header header;
u8 reserved[2];
u64 address;
} __attribute__ ((packed));
struct acpi_table_iosapic {
acpi_madt_entry_header header;
u8 id;
u8 reserved;
u32 global_irq_base;
u64 address;
} __attribute__ ((packed));
struct acpi_table_lsapic {
acpi_madt_entry_header header;
u8 acpi_id;
u8 id;
u8 eid;
u8 reserved[3];
struct {
u32 enabled:1;
u32 reserved:31;
} flags;
} __attribute__ ((packed));
struct acpi_table_plat_int_src {
acpi_madt_entry_header header;
acpi_madt_int_flags flags;
u8 type;
u8 id;
u8 eid;
u8 iosapic_vector;
u32 global_irq;
u32 reserved;
} __attribute__ ((packed));
/*
* ACPI Table Descriptor. One per ACPI table
*/
typedef struct acpi_table_desc {
struct acpi_table_desc *prev;
struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc;
acpi_table_header *pointer;
void *base_pointer;
u8 *aml_pointer;
u64 physical_address;
u32 aml_length;
u32 length;
u32 count;
u16 table_id;
u8 type;
u8 allocation;
u8 loaded_into_namespace;
} acpi_table_desc __attribute__ ((packed));;
#endif
......@@ -61,7 +61,12 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
unsigned long mmu_cr4_features;
EXPORT_SYMBOL_GPL(mmu_cr4_features);
int acpi_disabled __initdata = 0;
#ifdef CONFIG_ACPI_HT_ONLY
int acpi_disabled = 1;
#else
int acpi_disabled = 0;
#endif
EXPORT_SYMBOL(acpi_disabled);
int MCA_bus;
/* for MCA, but anyone else can use it if they want */
......@@ -515,6 +520,10 @@ static void __init parse_cmdline_early (char ** cmdline_p)
if (c == ' ' && !memcmp(from, "acpi=off", 8))
acpi_disabled = 1;
/* "acpismp=force" turns on ACPI again */
else if (!memcmp(from, "acpismp=force", 14))
acpi_disabled = 0;
/*
* highmem=size forces highmem to be exactly 'size' bytes.
* This works even on boxes that have no highmem otherwise.
......
......@@ -49,12 +49,12 @@ config ACPI_HT_ONLY
Full ACPI support (CONFIG_ACPI) is preferred. Use this option
only if you wish to limit ACPI's role to processor enumeration.
There is no command-line option to disable this, but the kernel
will fall back to the MPS table if the MADT is not present.
In this configuration, ACPI defaults to off. It must be enabled
on the command-line with the "acpismp=force" option.
config ACPI_BOOT
bool
depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY || X86 && ACPI
depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN) || X86 && ACPI && !ACPI_HT_ONLY
default y
config ACPI_SLEEP
......@@ -135,6 +135,31 @@ config ACPI_NUMA
bool "NUMA support" if NUMA && (IA64 && !IA64_HP_SIM || X86 && ACPI && !ACPI_HT_ONLY && !X86_64)
default y if IA64 && IA64_SGI_SN
config ACPI_ASUS
tristate "ASUS/Medion Laptop Extras"
depends on X86 && ACPI && !ACPI_HT_ONLY
---help---
This driver provides support for extra features of ACPI-compatible
ASUS laptops. As some of Medion laptops are made by ASUS, it may also
support some Medion laptops (such as 9675 for example). It makes all
the extra buttons generate standard ACPI events that go through
/proc/acpi/events, and (on some models) adds support for changing the
display brightness and output, switching the LCD backlight on and off,
and most importantly, allows you to blink those fancy LEDs intended
for reporting mail and wireless status.
All settings are changed via /proc/acpi/asus directory entries. Owner
and group for these entries can be set with asus_uid and asus_gid
parameters.
More information and a userspace daemon for handling the extra buttons
at <http://sourceforge.net/projects/acpi4asus/>.
If you have an ACPI-compatible ASUS laptop, say Y or M here. This
driver is still under development, so if your laptop is unsupported or
something works not quite as expected, please use the mailing list
available on the above page (acpi4asus-user@lists.sourceforge.net)
config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras"
depends on X86 && ACPI && !ACPI_HT_ONLY
......
......@@ -44,5 +44,6 @@ obj-$(CONFIG_ACPI_THERMAL) += thermal.o
obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
obj-$(CONFIG_ACPI_DEBUG) += debug.o
obj-$(CONFIG_ACPI_NUMA) += numa.o
obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-$(CONFIG_ACPI_BUS) += scan.o
This diff is collapsed.
......@@ -5,8 +5,8 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
* Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002,2003 NEC Corporation
*
* All rights reserved.
*
......@@ -26,8 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <gregkh@us.ibm.com>,
* <h-aono@ap.jp.nec.com>,
* <t-kouchi@cq.jp.nec.com>
* <t-kochi@bq.jp.nec.com>
*
*/
......@@ -35,6 +34,7 @@
#define _ACPIPHP_H
#include <linux/acpi.h>
#include <linux/kobject.h> /* for KOBJ_NAME_LEN */
#include "pci_hotplug.h"
#define dbg(format, arg...) \
......@@ -49,7 +49,7 @@
#define SLOT_MAGIC 0x67267322
/* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 32 /* ACPI{_SUN}-{BUS}:{DEV} */
#define SLOT_NAME_SIZE KOBJ_NAME_LEN /* {_SUN} */
struct acpiphp_bridge;
struct acpiphp_slot;
......@@ -212,11 +212,7 @@ struct acpiphp_func {
#define FUNC_HAS_PS2 (0x00000040)
#define FUNC_HAS_PS3 (0x00000080)
/* not yet */
#define SLOT_SUPPORT_66MHZ (0x00010000)
#define SLOT_SUPPORT_100MHZ (0x00020000)
#define SLOT_SUPPORT_133MHZ (0x00040000)
#define SLOT_SUPPORT_PCIX (0x00080000)
#define FUNC_EXISTS (0x10000000) /* to make sure we call _EJ0 only for existing funcs */
/* function prototypes */
......
......@@ -5,8 +5,8 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
* Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002,2003 NEC Corporation
*
* All rights reserved.
*
......@@ -26,8 +26,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <gregkh@us.ibm.com>,
* <h-aono@ap.jp.nec.com>,
* <t-kouchi@cq.jp.nec.com>
* <t-kochi@bq.jp.nec.com>
*
*/
......@@ -57,7 +56,7 @@ int acpiphp_debug;
static int num_slots;
#define DRIVER_VERSION "0.4"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kouchi@cq.jp.nec.com>"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@us.ibm.com>, Takayoshi Kochi <t-kochi@bq.jp.nec.com>"
#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver"
MODULE_AUTHOR(DRIVER_AUTHOR);
......@@ -376,10 +375,8 @@ static int init_acpi (void)
*/
static void make_slot_name (struct slot *slot)
{
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "ACPI%d-%02x:%02x",
slot->acpi_slot->sun,
slot->acpi_slot->bridge->bus,
slot->acpi_slot->device);
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%u",
slot->acpi_slot->sun);
}
/**
......
/*
* ACPI PCI HotPlug glue functions to ACPI CA subsystem
*
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
* Copyright (c) 2002,2003 NEC Corporation
*
* All rights reserved.
*
......@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <t-kouchi@cq.jp.nec.com>
* Send feedback to <t-kochi@bq.jp.nec.com>
*
*/
......@@ -204,7 +204,6 @@ register_slot (acpi_handle handle, u32 lvl, void *context, void **rv)
if (ACPI_FAILURE(status)) {
err("failed to register interrupt notify handler\n");
kfree(newfunc);
return status;
}
......@@ -617,9 +616,8 @@ find_p2p_bridge (acpi_handle handle, u32 lvl, void *context, void **rv)
/* find hot-pluggable slots, and then find P2P bridge */
static int add_bridges(struct acpi_device *device)
static int add_bridge(acpi_handle handle)
{
acpi_handle *handle = device->handle;
acpi_status status;
unsigned long tmp;
int seg, bus;
......@@ -673,6 +671,12 @@ static int add_bridges(struct acpi_device *device)
}
static void remove_bridge (acpi_handle handle)
{
/* No-op for now .. */
}
static int power_on_slot (struct acpiphp_slot *slot)
{
acpi_status status;
......@@ -725,9 +729,7 @@ static int power_off_slot (struct acpiphp_slot *slot)
list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling);
if (func->flags & FUNC_HAS_PS3) {
dbg("%s: executing _PS3 on %s\n", __FUNCTION__,
func->pci_dev->slot_name);
if (func->flags & (FUNC_HAS_PS3 | FUNC_EXISTS)) {
status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
if (ACPI_FAILURE(status)) {
warn("%s: _PS3 failed\n", __FUNCTION__);
......@@ -740,10 +742,8 @@ static int power_off_slot (struct acpiphp_slot *slot)
list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling);
if (func->flags & FUNC_HAS_EJ0) {
dbg("%s: executing _EJ0 on %s\n", __FUNCTION__,
func->pci_dev->slot_name);
/* We don't want to call _EJ0 on non-existing functions. */
if (func->flags & (FUNC_HAS_EJ0 | FUNC_EXISTS)) {
/* _EJ0 method take one argument */
arg_list.count = 1;
arg_list.pointer = &arg;
......@@ -756,6 +756,7 @@ static int power_off_slot (struct acpiphp_slot *slot)
retval = -1;
goto err_exit;
}
func->flags &= (~FUNC_EXISTS);
}
}
......@@ -835,6 +836,8 @@ static int enable_device (struct acpiphp_slot *slot)
retval = acpiphp_configure_function(func);
if (retval)
goto err_exit;
func->flags |= FUNC_EXISTS;
}
slot->flags |= SLOT_ENABLED;
......@@ -1029,13 +1032,10 @@ static void handle_hotplug_event_func (acpi_handle handle, u32 type, void *conte
}
}
static struct acpi_driver acpi_pci_hp_driver = {
.name = "pci_hp",
.class = "",
.ids = ACPI_PCI_HOST_HID,
.ops = {
.add = add_bridges,
}
static struct acpi_pci_driver acpi_pci_hp_driver = {
.add = add_bridge,
.remove = remove_bridge,
};
/**
......@@ -1044,17 +1044,15 @@ static struct acpi_driver acpi_pci_hp_driver = {
*/
int acpiphp_glue_init (void)
{
acpi_status status;
int num;
if (list_empty(&pci_root_buses))
return -1;
status = acpi_bus_register_driver(&acpi_pci_hp_driver);
num = acpi_pci_register_driver(&acpi_pci_hp_driver);
if (ACPI_FAILURE(status)) {
err("%s: acpi_walk_namespace() failed\n", __FUNCTION__);
if (num <= 0)
return -1;
}
return 0;
}
......
......@@ -4,7 +4,7 @@
* Copyright (c) 1995,2001 Compaq Computer Corporation
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001,2002 IBM Corp.
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
*
......@@ -25,7 +25,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <t-kouchi@cq.jp.nec.com>
* Send feedback to <t-kochi@bq.jp.nec.com>
*
*/
......
......@@ -5,7 +5,7 @@
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
*
* All rights reserved.
......@@ -25,7 +25,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <gregkh@us.ibm.com>,<h-aono@ap.jp.nec.com>
* Send feedback to <gregkh@us.ibm.com>, <t-kochi@bq.jp.nec.com>
*
*/
......
......@@ -106,6 +106,10 @@
:"0"(n_hi), "1"(n_lo))
#ifdef CONFIG_ACPI_HT_ONLY
extern int acpi_lapic;
#define acpi_ioapic 0
#else
#ifndef CONFIG_ACPI_BOOT
#define acpi_lapic 0
#define acpi_ioapic 0
......@@ -120,6 +124,7 @@ extern int acpi_ioapic;
#else
#define acpi_ioapic 0
#endif
#endif
/* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
#define FIX_ACPI_PAGES 4
......
......@@ -403,8 +403,8 @@ int acpi_pci_irq_init (void);
struct acpi_pci_driver {
struct acpi_pci_driver *next;
int (*add)(acpi_handle *handle);
void (*remove)(acpi_handle *handle);
int (*add)(acpi_handle handle);
void (*remove)(acpi_handle handle);
};
int acpi_pci_register_driver(struct acpi_pci_driver *driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment