2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Purpose: Prevent PCMCIA cards from using motherboard resources. */
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
|
|
|
|
#include <acpi/acpi_bus.h>
|
|
|
|
#include <acpi/acpi_drivers.h>
|
|
|
|
|
|
|
|
#define _COMPONENT ACPI_SYSTEM_COMPONENT
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_MODULE_NAME("acpi_motherboard")
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Dell use PNP0C01 instead of PNP0C02 */
|
|
|
|
#define ACPI_MB_HID1 "PNP0C01"
|
|
|
|
#define ACPI_MB_HID2 "PNP0C02"
|
|
|
|
/**
|
|
|
|
* Doesn't care about legacy IO ports, only IO ports beyond 0x1000 are reserved
|
2006-03-28 17:04:00 -05:00
|
|
|
* Doesn't care about the failure of 'request_region', since other may reserve
|
2005-04-16 18:20:36 -04:00
|
|
|
* the io ports as well
|
|
|
|
*/
|
|
|
|
#define IS_RESERVED_ADDR(base, len) \
|
|
|
|
(((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \
|
2005-08-14 21:21:30 -04:00
|
|
|
&& ((base) + (len) > PCIBIOS_MIN_IO))
|
2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* Clearing the flag (IORESOURCE_BUSY) allows drivers to use
|
|
|
|
* the io ports if they really know they can use it, while
|
2006-03-28 17:04:00 -05:00
|
|
|
* still preventing hotplug PCI devices from using it.
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
2006-09-14 17:16:22 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* When CONFIG_PNP is enabled, pnp/system.c binds to PNP0C01
|
|
|
|
* and PNP0C02, redundant with acpi_reserve_io_ranges().
|
|
|
|
* But acpi_reserve_io_ranges() is necessary for !CONFIG_PNP.
|
|
|
|
*/
|
2005-08-05 00:44:28 -04:00
|
|
|
static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
|
|
|
struct resource *requested_res = NULL;
|
|
|
|
|
|
|
|
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
if (res->type == ACPI_RESOURCE_TYPE_IO) {
|
2005-04-16 18:20:36 -04:00
|
|
|
struct acpi_resource_io *io_res = &res->data.io;
|
|
|
|
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
if (io_res->minimum != io_res->maximum)
|
2006-06-27 00:41:40 -04:00
|
|
|
return AE_OK;
|
2005-08-05 00:44:28 -04:00
|
|
|
if (IS_RESERVED_ADDR
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
(io_res->minimum, io_res->address_length)) {
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"Motherboard resources 0x%08x - 0x%08x\n",
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
io_res->minimum,
|
|
|
|
io_res->minimum +
|
|
|
|
io_res->address_length));
|
2005-08-05 00:44:28 -04:00
|
|
|
requested_res =
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
request_region(io_res->minimum,
|
|
|
|
io_res->address_length, "motherboard");
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
} else if (res->type == ACPI_RESOURCE_TYPE_FIXED_IO) {
|
2005-08-05 00:44:28 -04:00
|
|
|
struct acpi_resource_fixed_io *fixed_io_res =
|
|
|
|
&res->data.fixed_io;
|
|
|
|
|
|
|
|
if (IS_RESERVED_ADDR
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
(fixed_io_res->address, fixed_io_res->address_length)) {
|
2005-08-05 00:44:28 -04:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"Motherboard resources 0x%08x - 0x%08x\n",
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
fixed_io_res->address,
|
|
|
|
fixed_io_res->address +
|
|
|
|
fixed_io_res->address_length));
|
2005-08-05 00:44:28 -04:00
|
|
|
requested_res =
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 19:03:00 -04:00
|
|
|
request_region(fixed_io_res->address,
|
|
|
|
fixed_io_res->address_length,
|
2005-08-05 00:44:28 -04:00
|
|
|
"motherboard");
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Memory mapped IO? */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (requested_res)
|
|
|
|
requested_res->flags &= ~IORESOURCE_BUSY;
|
2006-06-27 00:41:40 -04:00
|
|
|
return AE_OK;
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
static int acpi_motherboard_add(struct acpi_device *device)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
|
|
|
if (!device)
|
|
|
|
return -EINVAL;
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_walk_resources(device->handle, METHOD_NAME__CRS,
|
|
|
|
acpi_reserve_io_ranges, NULL);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct acpi_driver acpi_motherboard_driver1 = {
|
2005-08-05 00:44:28 -04:00
|
|
|
.name = "motherboard",
|
|
|
|
.class = "",
|
|
|
|
.ids = ACPI_MB_HID1,
|
|
|
|
.ops = {
|
|
|
|
.add = acpi_motherboard_add,
|
|
|
|
},
|
2005-04-16 18:20:36 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct acpi_driver acpi_motherboard_driver2 = {
|
2005-08-05 00:44:28 -04:00
|
|
|
.name = "motherboard",
|
|
|
|
.class = "",
|
|
|
|
.ids = ACPI_MB_HID2,
|
|
|
|
.ops = {
|
|
|
|
.add = acpi_motherboard_add,
|
|
|
|
},
|
2005-04-16 18:20:36 -04:00
|
|
|
};
|
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
static void __init acpi_request_region (struct acpi_generic_address *addr,
|
|
|
|
unsigned int length, char *desc)
|
|
|
|
{
|
|
|
|
if (!addr->address || !length)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (addr->address_space_id == ACPI_ADR_SPACE_SYSTEM_IO)
|
|
|
|
request_region(addr->address, length, desc);
|
|
|
|
else if (addr->address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
|
|
|
request_mem_region(addr->address, length, desc);
|
|
|
|
}
|
|
|
|
|
2005-08-05 00:44:28 -04:00
|
|
|
static void __init acpi_reserve_resources(void)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm1a_evt_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->pm1_evt_len, "ACPI PM1a_EVT_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm1b_evt_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->pm1_evt_len, "ACPI PM1b_EVT_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm1a_cnt_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->pm1_cnt_len, "ACPI PM1a_CNT_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm1b_cnt_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->pm1_cnt_len, "ACPI PM1b_CNT_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
if (acpi_gbl_FADT->pm_tm_len == 4)
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm_tmr_blk, 4, "ACPI PM_TMR");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_request_region(&acpi_gbl_FADT->xpm2_cnt_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->pm2_cnt_len, "ACPI PM2_CNT_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/* Length of GPE blocks must be a non-negative multiple of 2 */
|
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
if (!(acpi_gbl_FADT->gpe0_blk_len & 0x1))
|
|
|
|
acpi_request_region(&acpi_gbl_FADT->xgpe0_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->gpe0_blk_len, "ACPI GPE0_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-03-28 17:04:00 -05:00
|
|
|
if (!(acpi_gbl_FADT->gpe1_blk_len & 0x1))
|
|
|
|
acpi_request_region(&acpi_gbl_FADT->xgpe1_blk,
|
2006-03-28 17:04:00 -05:00
|
|
|
acpi_gbl_FADT->gpe1_blk_len, "ACPI GPE1_BLK");
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int __init acpi_motherboard_init(void)
|
|
|
|
{
|
|
|
|
acpi_bus_register_driver(&acpi_motherboard_driver1);
|
|
|
|
acpi_bus_register_driver(&acpi_motherboard_driver2);
|
2006-03-28 17:04:00 -05:00
|
|
|
/*
|
2005-04-16 18:20:36 -04:00
|
|
|
* Guarantee motherboard IO reservation first
|
|
|
|
* This module must run after scan.c
|
|
|
|
*/
|
|
|
|
if (!acpi_disabled)
|
2005-08-05 00:44:28 -04:00
|
|
|
acpi_reserve_resources();
|
2005-04-16 18:20:36 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reserve motherboard resources after PCI claim BARs,
|
|
|
|
* but before PCI assign resources for uninitialized PCI devices
|
|
|
|
*/
|
|
|
|
fs_initcall(acpi_motherboard_init);
|