From: louisqi <louisqi@viatech.com.cn>
To: len.brown@intel.com, venkatesh.pallipadi@intel.com,
linux-acpi@vger.kernel.org
Subject: [PATCH] ACPI: Add _PDC object evaluate for VIA.
Date: Sat, 27 Sep 2008 16:52:00 +0800 [thread overview]
Message-ID: <48DDF430.8060806@viatech.com.cn> (raw)
Dear Brown & Pallipadi:
Attached is a patch to support _PDC object evaluate for VIA CPUs.
The routine "arch_acpi_processor_init_pdc" which is at
"arch/x86/kernel/acpi/processor.c" currently only supports INTEL CPUs.
The patch has been tested on the "VIA VX800"chipset + "VIA C7-M1.8G" CPU.
It should work for other VIA chipset / BIOS that implements the _PDC object.
Thanks
Louis
--------------------------------------------------------------------------------
[PATCH] ACPI: Add _PDC object evaluate for VIA.
Frome: Louis Qi <louisqi@viatech.com.cn>
The current routine "arch_acpi_processor_init_pdc" only supports INTEL CPUs.
This patch add support for VIA CPUs.
Signed-off-by: Louis Qi <louisqi@viatech.com.cn>
---
--- 2.6.26.5/arch/x86/kernel/acpi/processor.c.orig 2008-09-27 15:46:14.000000000
+0800
+++ 2.6.26.5/arch/x86/kernel/acpi/processor.c 2008-09-27 15:46:14.000000000 +0800
@@ -66,6 +66,55 @@ static void init_intel_pdc(struct acpi_p
return;
}
+static void init_via_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
+{
+ struct acpi_object_list *obj_list;
+ union acpi_object *obj;
+ u32 *buf;
+
+ /* allocate and initialize pdc. It will be used later. */
+ obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL);
+ if (!obj_list) {
+ printk(KERN_ERR "Memory allocation error\n");
+ return;
+ }
+
+ obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
+ if (!obj) {
+ printk(KERN_ERR "Memory allocation error\n");
+ kfree(obj_list);
+ return;
+ }
+
+ buf = kmalloc(12, GFP_KERNEL);
+ if (!buf) {
+ printk(KERN_ERR "Memory allocation error\n");
+ kfree(obj);
+ kfree(obj_list);
+ return;
+ }
+
+ buf[0] = ACPI_PDC_REVISION_ID;
+ buf[1] = 1;
+ buf[2] = 0;
+
+ if (cpu_has(c, X86_FEATURE_EST))
+ buf[2] |= ACPI_PDC_P_FFH;
+
+ if (cpu_has(c, X86_FEATURE_ACPI))
+ buf[2] |= ACPI_PDC_T_FFH;
+
+ obj->type = ACPI_TYPE_BUFFER;
+ obj->buffer.length = 12;
+ obj->buffer.pointer = (u8 *) buf;
+ obj_list->count = 1;
+ obj_list->pointer = obj;
+ pr->pdc = obj_list;
+
+ return;
+}
+
+
/* Initialize _PDC data based on the CPU vendor */
void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
{
@@ -74,6 +123,8 @@ void arch_acpi_processor_init_pdc(struct
pr->pdc = NULL;
if (c->x86_vendor == X86_VENDOR_INTEL)
init_intel_pdc(pr, c);
+ else if (c->x86_vendor == X86_VENDOR_CENTAUR)
+ init_via_pdc(pr, c);
return;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2008-09-27 9:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-27 8:52 louisqi [this message]
2008-09-27 16:05 ` [PATCH] ACPI: Add _PDC object evaluate for VIA Ingo Molnar
2008-09-28 2:40 ` louisqi
2008-10-08 2:19 ` louisqi
2008-10-08 23:47 ` Pallipadi, Venkatesh
2008-10-09 0:46 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DDF430.8060806@viatech.com.cn \
--to=louisqi@viatech.com.cn \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=venkatesh.pallipadi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.