Commit 11bf04c4 authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown

ACPICA: Allow processor to be declared with the Device() instead of Processor()

Allow processor to be declered with the Device(), such as:
Device(CPU1234) {
	Name(_HID, "ACPI007")
	Name(_UID, 1234)
}
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent f18c5a08
...@@ -377,7 +377,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device) ...@@ -377,7 +377,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
/* Use the acpiid in MADT to map cpus in case of SMP */ /* Use the acpiid in MADT to map cpus in case of SMP */
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
#define convert_acpiid_to_cpu(acpi_id) (-1) static int get_cpu_id(acpi_handle handle, u32 acpi_id) {return -1;}
#else #else
static struct acpi_table_madt *madt; static struct acpi_table_madt *madt;
...@@ -483,7 +483,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id) ...@@ -483,7 +483,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
return apic_id; return apic_id;
} }
static int get_apic_id(acpi_handle handle, u32 acpi_id) static int get_cpu_id(acpi_handle handle, u32 acpi_id)
{ {
int i; int i;
int apic_id = -1; int apic_id = -1;
...@@ -506,7 +506,7 @@ static int get_apic_id(acpi_handle handle, u32 acpi_id) ...@@ -506,7 +506,7 @@ static int get_apic_id(acpi_handle handle, u32 acpi_id)
Driver Interface Driver Interface
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int acpi_processor_get_info(struct acpi_processor *pr) static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
{ {
acpi_status status = 0; acpi_status status = 0;
union acpi_object object = { 0 }; union acpi_object object = { 0 };
...@@ -535,6 +535,17 @@ static int acpi_processor_get_info(struct acpi_processor *pr) ...@@ -535,6 +535,17 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No bus mastering arbitration control\n")); "No bus mastering arbitration control\n"));
/* Check if it is a Device with HID and UID */
if (has_uid) {
unsigned long value;
status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
NULL, &value);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Evaluating processor _UID\n");
return -ENODEV;
}
pr->acpi_id = value;
} else {
/* /*
* Evalute the processor object. Note that it is common on SMP to * Evalute the processor object. Note that it is common on SMP to
* have the first (boot) processor with a valid PBLK address while * have the first (boot) processor with a valid PBLK address while
...@@ -551,8 +562,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr) ...@@ -551,8 +562,8 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
* >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c
*/ */
pr->acpi_id = object.processor.proc_id; pr->acpi_id = object.processor.proc_id;
}
cpu_index = get_apic_id(pr->handle, pr->acpi_id); cpu_index = get_cpu_id(pr->handle, pr->acpi_id);
/* Handle UP system running SMP kernel, with no LAPIC in MADT */ /* Handle UP system running SMP kernel, with no LAPIC in MADT */
if (!cpu0_initialized && (cpu_index == -1) && if (!cpu0_initialized && (cpu_index == -1) &&
...@@ -621,7 +632,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) ...@@ -621,7 +632,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
pr = acpi_driver_data(device); pr = acpi_driver_data(device);
result = acpi_processor_get_info(pr); result = acpi_processor_get_info(pr, device->flags.unique_id);
if (result) { if (result) {
/* Processor is physically not present */ /* Processor is physically not present */
return 0; return 0;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/* _HID definitions */ /* _HID definitions */
#define ACPI_POWER_HID "ACPI_PWR" #define ACPI_POWER_HID "ACPI_PWR"
#define ACPI_PROCESSOR_HID "ACPI_CPU" #define ACPI_PROCESSOR_HID "ACPI0007"
#define ACPI_SYSTEM_HID "ACPI_SYS" #define ACPI_SYSTEM_HID "ACPI_SYS"
#define ACPI_THERMAL_HID "ACPI_THM" #define ACPI_THERMAL_HID "ACPI_THM"
#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" #define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
......
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