aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-02 01:06:15 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-02 01:06:15 -0500
commit59ed2f59e4ea6a32f9591e378da7935f713a7000 (patch)
treea1276a611dbb1bc44685ef8af363e99603e60047 /arch/i386
parent9ad11ab48b1ad618bf47076e9e579f267f5306c2 (diff)
parentb8e4d89357fc434618a59c1047cac72641191805 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/acpi/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c6
-rw-r--r--arch/i386/kernel/acpi/cstate.c58
-rw-r--r--arch/i386/kernel/acpi/processor.c75
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c71
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c12
-rw-r--r--arch/i386/kernel/mpparse.c8
7 files changed, 83 insertions, 149 deletions
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile
index 267ca48e1b6c..d51c7313cae8 100644
--- a/arch/i386/kernel/acpi/Makefile
+++ b/arch/i386/kernel/acpi/Makefile
@@ -3,6 +3,6 @@ obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
4 4
5ifneq ($(CONFIG_ACPI_PROCESSOR),) 5ifneq ($(CONFIG_ACPI_PROCESSOR),)
6obj-y += cstate.o 6obj-y += cstate.o processor.o
7endif 7endif
8 8
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 2111529dea77..f21fa0d4482f 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -464,7 +464,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
464 * success: return IRQ number (>=0) 464 * success: return IRQ number (>=0)
465 * failure: return < 0 465 * failure: return < 0
466 */ 466 */
467int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) 467int acpi_register_gsi(u32 gsi, int triggering, int polarity)
468{ 468{
469 unsigned int irq; 469 unsigned int irq;
470 unsigned int plat_gsi = gsi; 470 unsigned int plat_gsi = gsi;
@@ -476,14 +476,14 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
476 if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { 476 if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
477 extern void eisa_set_level_irq(unsigned int irq); 477 extern void eisa_set_level_irq(unsigned int irq);
478 478
479 if (edge_level == ACPI_LEVEL_SENSITIVE) 479 if (triggering == ACPI_LEVEL_SENSITIVE)
480 eisa_set_level_irq(gsi); 480 eisa_set_level_irq(gsi);
481 } 481 }
482#endif 482#endif
483 483
484#ifdef CONFIG_X86_IO_APIC 484#ifdef CONFIG_X86_IO_APIC
485 if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) { 485 if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
486 plat_gsi = mp_register_gsi(gsi, edge_level, active_high_low); 486 plat_gsi = mp_register_gsi(gsi, triggering, polarity);
487 } 487 }
488#endif 488#endif
489 acpi_gsi_to_irq(plat_gsi, &irq); 489 acpi_gsi_to_irq(plat_gsi, &irq);
diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/i386/kernel/acpi/cstate.c
index 4c3036ba65df..25db49ef1770 100644
--- a/arch/i386/kernel/acpi/cstate.c
+++ b/arch/i386/kernel/acpi/cstate.c
@@ -14,64 +14,6 @@
14#include <acpi/processor.h> 14#include <acpi/processor.h>
15#include <asm/acpi.h> 15#include <asm/acpi.h>
16 16
17static void acpi_processor_power_init_intel_pdc(struct acpi_processor_power
18 *pow)
19{
20 struct acpi_object_list *obj_list;
21 union acpi_object *obj;
22 u32 *buf;
23
24 /* allocate and initialize pdc. It will be used later. */
25 obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL);
26 if (!obj_list) {
27 printk(KERN_ERR "Memory allocation error\n");
28 return;
29 }
30
31 obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
32 if (!obj) {
33 printk(KERN_ERR "Memory allocation error\n");
34 kfree(obj_list);
35 return;
36 }
37
38 buf = kmalloc(12, GFP_KERNEL);
39 if (!buf) {
40 printk(KERN_ERR "Memory allocation error\n");
41 kfree(obj);
42 kfree(obj_list);
43 return;
44 }
45
46 buf[0] = ACPI_PDC_REVISION_ID;
47 buf[1] = 1;
48 buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
49
50 obj->type = ACPI_TYPE_BUFFER;
51 obj->buffer.length = 12;
52 obj->buffer.pointer = (u8 *) buf;
53 obj_list->count = 1;
54 obj_list->pointer = obj;
55 pow->pdc = obj_list;
56
57 return;
58}
59
60/* Initialize _PDC data based on the CPU vendor */
61void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
62 unsigned int cpu)
63{
64 struct cpuinfo_x86 *c = cpu_data + cpu;
65
66 pow->pdc = NULL;
67 if (c->x86_vendor == X86_VENDOR_INTEL)
68 acpi_processor_power_init_intel_pdc(pow);
69
70 return;
71}
72
73EXPORT_SYMBOL(acpi_processor_power_init_pdc);
74
75/* 17/*
76 * Initialize bm_flags based on the CPU cache properties 18 * Initialize bm_flags based on the CPU cache properties
77 * On SMP it depends on cache configuration 19 * On SMP it depends on cache configuration
diff --git a/arch/i386/kernel/acpi/processor.c b/arch/i386/kernel/acpi/processor.c
new file mode 100644
index 000000000000..9f4cc02717ec
--- /dev/null
+++ b/arch/i386/kernel/acpi/processor.c
@@ -0,0 +1,75 @@
1/*
2 * arch/i386/kernel/acpi/processor.c
3 *
4 * Copyright (C) 2005 Intel Corporation
5 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
6 * - Added _PDC for platforms with Intel CPUs
7 */
8
9#include <linux/kernel.h>
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/acpi.h>
13
14#include <acpi/processor.h>
15#include <asm/acpi.h>
16
17static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
18{
19 struct acpi_object_list *obj_list;
20 union acpi_object *obj;
21 u32 *buf;
22
23 /* allocate and initialize pdc. It will be used later. */
24 obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL);
25 if (!obj_list) {
26 printk(KERN_ERR "Memory allocation error\n");
27 return;
28 }
29
30 obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
31 if (!obj) {
32 printk(KERN_ERR "Memory allocation error\n");
33 kfree(obj_list);
34 return;
35 }
36
37 buf = kmalloc(12, GFP_KERNEL);
38 if (!buf) {
39 printk(KERN_ERR "Memory allocation error\n");
40 kfree(obj);
41 kfree(obj_list);
42 return;
43 }
44
45 buf[0] = ACPI_PDC_REVISION_ID;
46 buf[1] = 1;
47 buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
48
49 if (cpu_has(c, X86_FEATURE_EST))
50 buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
51
52 obj->type = ACPI_TYPE_BUFFER;
53 obj->buffer.length = 12;
54 obj->buffer.pointer = (u8 *) buf;
55 obj_list->count = 1;
56 obj_list->pointer = obj;
57 pr->pdc = obj_list;
58
59 return;
60}
61
62/* Initialize _PDC data based on the CPU vendor */
63void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
64{
65 unsigned int cpu = pr->id;
66 struct cpuinfo_x86 *c = cpu_data + cpu;
67
68 pr->pdc = NULL;
69 if (c->x86_vendor == X86_VENDOR_INTEL)
70 init_intel_pdc(pr, c);
71
72 return;
73}
74
75EXPORT_SYMBOL(arch_acpi_processor_init_pdc);
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 7975e79d5fa4..3852d0a4c1b5 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -295,68 +295,6 @@ acpi_cpufreq_guess_freq (
295} 295}
296 296
297 297
298/*
299 * acpi_processor_cpu_init_pdc_est - let BIOS know about the SMP capabilities
300 * of this driver
301 * @perf: processor-specific acpi_io_data struct
302 * @cpu: CPU being initialized
303 *
304 * To avoid issues with legacy OSes, some BIOSes require to be informed of
305 * the SMP capabilities of OS P-state driver. Here we set the bits in _PDC
306 * accordingly, for Enhanced Speedstep. Actual call to _PDC is done in
307 * driver/acpi/processor.c
308 */
309static void
310acpi_processor_cpu_init_pdc_est(
311 struct acpi_processor_performance *perf,
312 unsigned int cpu,
313 struct acpi_object_list *obj_list
314 )
315{
316 union acpi_object *obj;
317 u32 *buf;
318 struct cpuinfo_x86 *c = cpu_data + cpu;
319 dprintk("acpi_processor_cpu_init_pdc_est\n");
320
321 if (!cpu_has(c, X86_FEATURE_EST))
322 return;
323
324 /* Initialize pdc. It will be used later. */
325 if (!obj_list)
326 return;
327
328 if (!(obj_list->count && obj_list->pointer))
329 return;
330
331 obj = obj_list->pointer;
332 if ((obj->buffer.length == 12) && obj->buffer.pointer) {
333 buf = (u32 *)obj->buffer.pointer;
334 buf[0] = ACPI_PDC_REVISION_ID;
335 buf[1] = 1;
336 buf[2] = ACPI_PDC_EST_CAPABILITY_SMP;
337 perf->pdc = obj_list;
338 }
339 return;
340}
341
342
343/* CPU specific PDC initialization */
344static void
345acpi_processor_cpu_init_pdc(
346 struct acpi_processor_performance *perf,
347 unsigned int cpu,
348 struct acpi_object_list *obj_list
349 )
350{
351 struct cpuinfo_x86 *c = cpu_data + cpu;
352 dprintk("acpi_processor_cpu_init_pdc\n");
353 perf->pdc = NULL;
354 if (cpu_has(c, X86_FEATURE_EST))
355 acpi_processor_cpu_init_pdc_est(perf, cpu, obj_list);
356 return;
357}
358
359
360static int 298static int
361acpi_cpufreq_cpu_init ( 299acpi_cpufreq_cpu_init (
362 struct cpufreq_policy *policy) 300 struct cpufreq_policy *policy)
@@ -367,14 +305,7 @@ acpi_cpufreq_cpu_init (
367 unsigned int result = 0; 305 unsigned int result = 0;
368 struct cpuinfo_x86 *c = &cpu_data[policy->cpu]; 306 struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
369 307
370 union acpi_object arg0 = {ACPI_TYPE_BUFFER};
371 u32 arg0_buf[3];
372 struct acpi_object_list arg_list = {1, &arg0};
373
374 dprintk("acpi_cpufreq_cpu_init\n"); 308 dprintk("acpi_cpufreq_cpu_init\n");
375 /* setup arg_list for _PDC settings */
376 arg0.buffer.length = 12;
377 arg0.buffer.pointer = (u8 *) arg0_buf;
378 309
379 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); 310 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
380 if (!data) 311 if (!data)
@@ -382,9 +313,7 @@ acpi_cpufreq_cpu_init (
382 313
383 acpi_io_data[cpu] = data; 314 acpi_io_data[cpu] = data;
384 315
385 acpi_processor_cpu_init_pdc(&data->acpi_data, cpu, &arg_list);
386 result = acpi_processor_register_performance(&data->acpi_data, cpu); 316 result = acpi_processor_register_performance(&data->acpi_data, cpu);
387 data->acpi_data.pdc = NULL;
388 317
389 if (result) 318 if (result)
390 goto err_free; 319 goto err_free;
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 9a826cde4fd1..c173c0fa117a 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -362,22 +362,10 @@ static struct acpi_processor_performance p;
362 */ 362 */
363static int centrino_cpu_init_acpi(struct cpufreq_policy *policy) 363static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
364{ 364{
365 union acpi_object arg0 = {ACPI_TYPE_BUFFER};
366 u32 arg0_buf[3];
367 struct acpi_object_list arg_list = {1, &arg0};
368 unsigned long cur_freq; 365 unsigned long cur_freq;
369 int result = 0, i; 366 int result = 0, i;
370 unsigned int cpu = policy->cpu; 367 unsigned int cpu = policy->cpu;
371 368
372 /* _PDC settings */
373 arg0.buffer.length = 12;
374 arg0.buffer.pointer = (u8 *) arg0_buf;
375 arg0_buf[0] = ACPI_PDC_REVISION_ID;
376 arg0_buf[1] = 1;
377 arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP_MSR;
378
379 p.pdc = &arg_list;
380
381 /* register with ACPI core */ 369 /* register with ACPI core */
382 if (acpi_processor_register_performance(&p, cpu)) { 370 if (acpi_processor_register_performance(&p, cpu)) {
383 dprintk(KERN_INFO PFX "obtaining ACPI data failed\n"); 371 dprintk(KERN_INFO PFX "obtaining ACPI data failed\n");
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 91a64016956e..0102f3d50e57 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -1080,7 +1080,7 @@ void __init mp_config_acpi_legacy_irqs (void)
1080 1080
1081#define MAX_GSI_NUM 4096 1081#define MAX_GSI_NUM 4096
1082 1082
1083int mp_register_gsi (u32 gsi, int edge_level, int active_high_low) 1083int mp_register_gsi (u32 gsi, int triggering, int polarity)
1084{ 1084{
1085 int ioapic = -1; 1085 int ioapic = -1;
1086 int ioapic_pin = 0; 1086 int ioapic_pin = 0;
@@ -1129,7 +1129,7 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1129 1129
1130 mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); 1130 mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
1131 1131
1132 if (edge_level) { 1132 if (triggering == ACPI_LEVEL_SENSITIVE) {
1133 /* 1133 /*
1134 * For PCI devices assign IRQs in order, avoiding gaps 1134 * For PCI devices assign IRQs in order, avoiding gaps
1135 * due to unused I/O APIC pins. 1135 * due to unused I/O APIC pins.
@@ -1151,8 +1151,8 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1151 } 1151 }
1152 1152
1153 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, 1153 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
1154 edge_level == ACPI_EDGE_SENSITIVE ? 0 : 1, 1154 triggering == ACPI_EDGE_SENSITIVE ? 0 : 1,
1155 active_high_low == ACPI_ACTIVE_HIGH ? 0 : 1); 1155 polarity == ACPI_ACTIVE_HIGH ? 0 : 1);
1156 return gsi; 1156 return gsi;
1157} 1157}
1158 1158