Merge branch 'acpi-pci'
* acpi-pci: ACPI: Make PCI slot detection driver depend on PCI ACPI/IORT: Stub out ACS functions when CONFIG_PCI is not set arm64: select ACPI PCI code only when both features are enabled PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset ACPI: Allow CONFIG_PCI to be unset for reboot ACPI: Move PCI reset to a separate function
Этот коммит содержится в:
@@ -9,7 +9,6 @@ config ARCH_SUPPORTS_ACPI
|
||||
menuconfig ACPI
|
||||
bool "ACPI (Advanced Configuration and Power Interface) Support"
|
||||
depends on ARCH_SUPPORTS_ACPI
|
||||
depends on PCI
|
||||
select PNP
|
||||
default y if X86
|
||||
help
|
||||
@@ -370,7 +369,7 @@ config ACPI_DEBUG
|
||||
|
||||
config ACPI_PCI_SLOT
|
||||
bool "PCI slot detection driver"
|
||||
depends on SYSFS
|
||||
depends on SYSFS && PCI
|
||||
help
|
||||
This driver creates entries in /sys/bus/pci/slots/ for all PCI
|
||||
slots in the system. This can help correlate PCI bus addresses,
|
||||
|
@@ -39,7 +39,7 @@ acpi-y += processor_core.o
|
||||
acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o
|
||||
acpi-y += ec.o
|
||||
acpi-$(CONFIG_ACPI_DOCK) += dock.o
|
||||
acpi-y += pci_root.o pci_link.o pci_irq.o
|
||||
acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o
|
||||
obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o
|
||||
acpi-y += acpi_lpss.o acpi_apd.o
|
||||
acpi-y += acpi_platform.o
|
||||
|
@@ -77,13 +77,13 @@ acpi-y += \
|
||||
hwacpi.o \
|
||||
hwesleep.o \
|
||||
hwgpe.o \
|
||||
hwpci.o \
|
||||
hwregs.o \
|
||||
hwsleep.o \
|
||||
hwvalid.o \
|
||||
hwxface.o \
|
||||
hwxfsleep.o
|
||||
|
||||
acpi-$(CONFIG_PCI) += hwpci.o
|
||||
acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
|
||||
|
||||
acpi-y += \
|
||||
|
@@ -106,11 +106,20 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
|
||||
struct acpi_gpe_block_info *gpe_block,
|
||||
void *context);
|
||||
|
||||
#ifdef ACPI_PCI_CONFIGURED
|
||||
/*
|
||||
* hwpci - PCI configuration support
|
||||
*/
|
||||
acpi_status
|
||||
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
|
||||
acpi_handle root_pci_device, acpi_handle pci_region);
|
||||
#else
|
||||
static inline acpi_status
|
||||
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle root_pci_device,
|
||||
acpi_handle pci_region)
|
||||
{
|
||||
return AE_SUPPORT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ACHWARE_H__ */
|
||||
|
@@ -364,25 +364,25 @@ acpi_ev_install_space_handler(struct acpi_namespace_node *node,
|
||||
handler = acpi_ex_system_io_space_handler;
|
||||
setup = acpi_ev_io_space_region_setup;
|
||||
break;
|
||||
|
||||
#ifdef ACPI_PCI_CONFIGURED
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
|
||||
handler = acpi_ex_pci_config_space_handler;
|
||||
setup = acpi_ev_pci_config_region_setup;
|
||||
break;
|
||||
|
||||
#endif
|
||||
case ACPI_ADR_SPACE_CMOS:
|
||||
|
||||
handler = acpi_ex_cmos_space_handler;
|
||||
setup = acpi_ev_cmos_region_setup;
|
||||
break;
|
||||
|
||||
#ifdef ACPI_PCI_CONFIGURED
|
||||
case ACPI_ADR_SPACE_PCI_BAR_TARGET:
|
||||
|
||||
handler = acpi_ex_pci_bar_space_handler;
|
||||
setup = acpi_ev_pci_bar_region_setup;
|
||||
break;
|
||||
|
||||
#endif
|
||||
case ACPI_ADR_SPACE_DATA_TABLE:
|
||||
|
||||
handler = acpi_ex_data_table_space_handler;
|
||||
|
@@ -311,6 +311,7 @@ acpi_ex_system_io_space_handler(u32 function,
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
#ifdef ACPI_PCI_CONFIGURED
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_pci_config_space_handler
|
||||
@@ -387,6 +388,7 @@ acpi_ex_pci_config_space_handler(u32 function,
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -420,6 +422,7 @@ acpi_ex_cmos_space_handler(u32 function,
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
#ifdef ACPI_PCI_CONFIGURED
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_pci_bar_space_handler
|
||||
@@ -451,6 +454,7 @@ acpi_ex_pci_bar_space_handler(u32 function,
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@@ -1435,8 +1435,14 @@ dev_put:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool __init iort_enable_acs(struct acpi_iort_node *iort_node)
|
||||
#ifdef CONFIG_PCI
|
||||
static void __init iort_enable_acs(struct acpi_iort_node *iort_node)
|
||||
{
|
||||
static bool acs_enabled __initdata;
|
||||
|
||||
if (acs_enabled)
|
||||
return;
|
||||
|
||||
if (iort_node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) {
|
||||
struct acpi_iort_node *parent;
|
||||
struct acpi_iort_id_mapping *map;
|
||||
@@ -1458,13 +1464,15 @@ static bool __init iort_enable_acs(struct acpi_iort_node *iort_node)
|
||||
if ((parent->type == ACPI_IORT_NODE_SMMU) ||
|
||||
(parent->type == ACPI_IORT_NODE_SMMU_V3)) {
|
||||
pci_request_acs();
|
||||
return true;
|
||||
acs_enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
static inline void iort_enable_acs(struct acpi_iort_node *iort_node) { }
|
||||
#endif
|
||||
|
||||
static void __init iort_init_platform_devices(void)
|
||||
{
|
||||
@@ -1472,7 +1480,6 @@ static void __init iort_init_platform_devices(void)
|
||||
struct acpi_table_iort *iort;
|
||||
struct fwnode_handle *fwnode;
|
||||
int i, ret;
|
||||
bool acs_enabled = false;
|
||||
const struct iort_dev_config *ops;
|
||||
|
||||
/*
|
||||
@@ -1493,8 +1500,7 @@ static void __init iort_init_platform_devices(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!acs_enabled)
|
||||
acs_enabled = iort_enable_acs(iort_node);
|
||||
iort_enable_acs(iort_node);
|
||||
|
||||
ops = iort_get_dev_cfg(iort_node);
|
||||
if (ops) {
|
||||
|
@@ -25,8 +25,13 @@ int acpi_osi_init(void);
|
||||
acpi_status acpi_os_initialize1(void);
|
||||
void init_acpi_device_notify(void);
|
||||
int acpi_scan_init(void);
|
||||
#ifdef CONFIG_PCI
|
||||
void acpi_pci_root_init(void);
|
||||
void acpi_pci_link_init(void);
|
||||
#else
|
||||
static inline void acpi_pci_root_init(void) {}
|
||||
static inline void acpi_pci_link_init(void) {}
|
||||
#endif
|
||||
void acpi_processor_init(void);
|
||||
void acpi_platform_init(void);
|
||||
void acpi_pnp_init(void);
|
||||
|
@@ -769,6 +769,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width)
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
acpi_status
|
||||
acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
|
||||
u64 *value, u32 width)
|
||||
@@ -827,6 +828,7 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
|
||||
|
||||
return (result ? AE_ERROR : AE_OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void acpi_os_execute_deferred(struct work_struct *work)
|
||||
{
|
||||
|
@@ -4,11 +4,35 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/reboot.h>
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static void acpi_pci_reboot(struct acpi_generic_address *rr, u8 reset_value)
|
||||
{
|
||||
unsigned int devfn;
|
||||
struct pci_bus *bus0;
|
||||
|
||||
/* The reset register can only live on bus 0. */
|
||||
bus0 = pci_find_bus(0, 0);
|
||||
if (!bus0)
|
||||
return;
|
||||
/* Form PCI device/function pair. */
|
||||
devfn = PCI_DEVFN((rr->address >> 32) & 0xffff,
|
||||
(rr->address >> 16) & 0xffff);
|
||||
pr_debug("Resetting with ACPI PCI RESET_REG.\n");
|
||||
/* Write the value that resets us. */
|
||||
pci_bus_write_config_byte(bus0, devfn,
|
||||
(rr->address & 0xffff), reset_value);
|
||||
}
|
||||
#else
|
||||
static inline void acpi_pci_reboot(struct acpi_generic_address *rr,
|
||||
u8 reset_value)
|
||||
{
|
||||
pr_warn_once("PCI configuration space access is not supported\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
void acpi_reboot(void)
|
||||
{
|
||||
struct acpi_generic_address *rr;
|
||||
struct pci_bus *bus0;
|
||||
unsigned int devfn;
|
||||
u8 reset_value;
|
||||
|
||||
if (acpi_disabled)
|
||||
@@ -33,17 +57,7 @@ void acpi_reboot(void)
|
||||
* on a device on bus 0. */
|
||||
switch (rr->space_id) {
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
/* The reset register can only live on bus 0. */
|
||||
bus0 = pci_find_bus(0, 0);
|
||||
if (!bus0)
|
||||
return;
|
||||
/* Form PCI device/function pair. */
|
||||
devfn = PCI_DEVFN((rr->address >> 32) & 0xffff,
|
||||
(rr->address >> 16) & 0xffff);
|
||||
printk(KERN_DEBUG "Resetting with ACPI PCI RESET_REG.\n");
|
||||
/* Write the value that resets us. */
|
||||
pci_bus_write_config_byte(bus0, devfn,
|
||||
(rr->address & 0xffff), reset_value);
|
||||
acpi_pci_reboot(rr, reset_value);
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
|
Ссылка в новой задаче
Block a user