Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18e94a33 authored by Aaron Lu's avatar Aaron Lu Committed by Bjorn Helgaas
Browse files

PCI: Make a shareable UUID for PCI firmware ACPI _DSM



The PCI Firmware Specification, r3.0, sec 4.6.4.1.3, defines a single UUID
for an ACPI _DSM method to provide device-specific control functions.  This
_DSM method support several functions, including PCI Express Slot
Information, PCI Express Slot Number, PCI Bus Capabilities, etc.

Move the UUID definition from pci/pci-label.c, where it could be used only
for one function, to pci/pci-acpi.c where it can be shared for all these
functions.

[bhelgaas: changelog]
Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c89ac443
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,15 @@
#include <linux/pm_qos.h>
#include <linux/pm_qos.h>
#include "pci.h"
#include "pci.h"


/*
 * The UUID is defined in the PCI Firmware Specification available here:
 * https://www.pcisig.com/members/downloads/pcifw_r3_1_13Dec10.pdf
 */
const u8 pci_acpi_dsm_uuid[] = {
	0xd0, 0x37, 0xc9, 0xe5, 0x53, 0x35, 0x7a, 0x4d,
	0x91, 0x17, 0xea, 0x4d, 0x19, 0xc3, 0x43, 0x4d
};

phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle)
phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle)
{
{
	acpi_status status = AE_NOT_EXIST;
	acpi_status status = AE_NOT_EXIST;
+2 −9
Original line number Original line Diff line number Diff line
@@ -31,8 +31,6 @@
#include <linux/pci-acpi.h>
#include <linux/pci-acpi.h>
#include "pci.h"
#include "pci.h"


#define	DEVICE_LABEL_DSM	0x07

#ifdef CONFIG_DMI
#ifdef CONFIG_DMI
enum smbios_attr_enum {
enum smbios_attr_enum {
	SMBIOS_ATTR_NONE = 0,
	SMBIOS_ATTR_NONE = 0,
@@ -148,11 +146,6 @@ static inline void pci_remove_smbiosname_file(struct pci_dev *pdev)
#endif
#endif


#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI
static const char device_label_dsm_uuid[] = {
	0xD0, 0x37, 0xC9, 0xE5, 0x53, 0x35, 0x7A, 0x4D,
	0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D
};

enum acpi_attr_enum {
enum acpi_attr_enum {
	ACPI_ATTR_LABEL_SHOW,
	ACPI_ATTR_LABEL_SHOW,
	ACPI_ATTR_INDEX_SHOW,
	ACPI_ATTR_INDEX_SHOW,
@@ -179,7 +172,7 @@ static int dsm_get_label(struct device *dev, char *buf,
	if (!handle)
	if (!handle)
		return -1;
		return -1;


	obj = acpi_evaluate_dsm(handle, device_label_dsm_uuid, 0x2,
	obj = acpi_evaluate_dsm(handle, pci_acpi_dsm_uuid, 0x2,
				DEVICE_LABEL_DSM, NULL);
				DEVICE_LABEL_DSM, NULL);
	if (!obj)
	if (!obj)
		return -1;
		return -1;
@@ -219,7 +212,7 @@ static bool device_has_dsm(struct device *dev)
	if (!handle)
	if (!handle)
		return false;
		return false;


	return !!acpi_check_dsm(handle, device_label_dsm_uuid, 0x2,
	return !!acpi_check_dsm(handle, pci_acpi_dsm_uuid, 0x2,
				1 << DEVICE_LABEL_DSM);
				1 << DEVICE_LABEL_DSM);
}
}


+3 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,9 @@ static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { }
static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { }
#endif
#endif


extern const u8 pci_acpi_dsm_uuid[];
#define DEVICE_LABEL_DSM	0x07

#else	/* CONFIG_ACPI */
#else	/* CONFIG_ACPI */
static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }
static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }