mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 04:34:11 +08:00
37224470c8
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits) ACPI: suppress power button event on S3 resume ACPI: resolve merge conflict between sem2mutex and processor_perflib.c ACPI: use for_each_possible_cpu() instead of for_each_cpu() ACPI: delete newly added debugging macros in processor_perflib.c ACPI: UP build fix for bugzilla-5737 Enable P-state software coordination via _PDC P-state software coordination for speedstep-centrino P-state software coordination for acpi-cpufreq P-state software coordination for ACPI core ACPI: create acpi_thermal_resume() ACPI: create acpi_fan_suspend()/acpi_fan_resume() ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend() ACPI: create acpi_device_suspend()/acpi_device_resume() ACPI: replace spin_lock_irq with mutex for ec poll mode ACPI: Allow a WAN module enable/disable on a Thinkpad X60. sem2mutex: acpi, acpi_link_lock ACPI: delete unused acpi_bus_drivers_lock sem2mutex: drivers/acpi/processor_perflib.c ACPI add ia64 exports to build acpi_memhotplug as a module ACPI: asus_acpi_init(): propagate correct return value ... Manual resolve of conflicts in: arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c include/acpi/processor.h
278 lines
6.4 KiB
C
278 lines
6.4 KiB
C
#ifndef __ACPI_PROCESSOR_H
|
|
#define __ACPI_PROCESSOR_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/cpu.h>
|
|
|
|
#include <asm/acpi.h>
|
|
|
|
#define ACPI_PROCESSOR_BUSY_METRIC 10
|
|
|
|
#define ACPI_PROCESSOR_MAX_POWER 8
|
|
#define ACPI_PROCESSOR_MAX_C2_LATENCY 100
|
|
#define ACPI_PROCESSOR_MAX_C3_LATENCY 1000
|
|
|
|
#define ACPI_PROCESSOR_MAX_THROTTLING 16
|
|
#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
|
|
#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
|
|
|
|
#define ACPI_PDC_REVISION_ID 0x1
|
|
|
|
#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
|
|
#define ACPI_PSD_REV0_ENTRIES 5
|
|
|
|
/*
|
|
* Types of coordination defined in ACPI 3.0. Same macros can be used across
|
|
* P, C and T states
|
|
*/
|
|
#define DOMAIN_COORD_TYPE_SW_ALL 0xfc
|
|
#define DOMAIN_COORD_TYPE_SW_ANY 0xfd
|
|
#define DOMAIN_COORD_TYPE_HW_ALL 0xfe
|
|
|
|
/* Power Management */
|
|
|
|
struct acpi_processor_cx;
|
|
|
|
struct acpi_power_register {
|
|
u8 descriptor;
|
|
u16 length;
|
|
u8 space_id;
|
|
u8 bit_width;
|
|
u8 bit_offset;
|
|
u8 reserved;
|
|
u64 address;
|
|
} __attribute__ ((packed));
|
|
|
|
struct acpi_processor_cx_policy {
|
|
u32 count;
|
|
struct acpi_processor_cx *state;
|
|
struct {
|
|
u32 time;
|
|
u32 ticks;
|
|
u32 count;
|
|
u32 bm;
|
|
} threshold;
|
|
};
|
|
|
|
struct acpi_processor_cx {
|
|
u8 valid;
|
|
u8 type;
|
|
u32 address;
|
|
u32 latency;
|
|
u32 latency_ticks;
|
|
u32 power;
|
|
u32 usage;
|
|
struct acpi_processor_cx_policy promotion;
|
|
struct acpi_processor_cx_policy demotion;
|
|
};
|
|
|
|
struct acpi_processor_power {
|
|
struct acpi_processor_cx *state;
|
|
unsigned long bm_check_timestamp;
|
|
u32 default_state;
|
|
u32 bm_activity;
|
|
int count;
|
|
struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
|
|
};
|
|
|
|
/* Performance Management */
|
|
|
|
struct acpi_psd_package {
|
|
acpi_integer num_entries;
|
|
acpi_integer revision;
|
|
acpi_integer domain;
|
|
acpi_integer coord_type;
|
|
acpi_integer num_processors;
|
|
} __attribute__ ((packed));
|
|
|
|
struct acpi_pct_register {
|
|
u8 descriptor;
|
|
u16 length;
|
|
u8 space_id;
|
|
u8 bit_width;
|
|
u8 bit_offset;
|
|
u8 reserved;
|
|
u64 address;
|
|
} __attribute__ ((packed));
|
|
|
|
struct acpi_processor_px {
|
|
acpi_integer core_frequency; /* megahertz */
|
|
acpi_integer power; /* milliWatts */
|
|
acpi_integer transition_latency; /* microseconds */
|
|
acpi_integer bus_master_latency; /* microseconds */
|
|
acpi_integer control; /* control value */
|
|
acpi_integer status; /* success indicator */
|
|
};
|
|
|
|
struct acpi_processor_performance {
|
|
unsigned int state;
|
|
unsigned int platform_limit;
|
|
struct acpi_pct_register control_register;
|
|
struct acpi_pct_register status_register;
|
|
unsigned int state_count;
|
|
struct acpi_processor_px *states;
|
|
struct acpi_psd_package domain_info;
|
|
cpumask_t shared_cpu_map;
|
|
unsigned int shared_type;
|
|
};
|
|
|
|
/* Throttling Control */
|
|
|
|
struct acpi_processor_tx {
|
|
u16 power;
|
|
u16 performance;
|
|
};
|
|
|
|
struct acpi_processor_throttling {
|
|
int state;
|
|
u32 address;
|
|
u8 duty_offset;
|
|
u8 duty_width;
|
|
int state_count;
|
|
struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
|
|
};
|
|
|
|
/* Limit Interface */
|
|
|
|
struct acpi_processor_lx {
|
|
int px; /* performace state */
|
|
int tx; /* throttle level */
|
|
};
|
|
|
|
struct acpi_processor_limit {
|
|
struct acpi_processor_lx state; /* current limit */
|
|
struct acpi_processor_lx thermal; /* thermal limit */
|
|
struct acpi_processor_lx user; /* user limit */
|
|
};
|
|
|
|
struct acpi_processor_flags {
|
|
u8 power:1;
|
|
u8 performance:1;
|
|
u8 throttling:1;
|
|
u8 limit:1;
|
|
u8 bm_control:1;
|
|
u8 bm_check:1;
|
|
u8 has_cst:1;
|
|
u8 power_setup_done:1;
|
|
};
|
|
|
|
struct acpi_processor {
|
|
acpi_handle handle;
|
|
u32 acpi_id;
|
|
u32 id;
|
|
u32 pblk;
|
|
int performance_platform_limit;
|
|
struct acpi_processor_flags flags;
|
|
struct acpi_processor_power power;
|
|
struct acpi_processor_performance *performance;
|
|
struct acpi_processor_throttling throttling;
|
|
struct acpi_processor_limit limit;
|
|
|
|
/* the _PDC objects for this processor, if any */
|
|
struct acpi_object_list *pdc;
|
|
};
|
|
|
|
struct acpi_processor_errata {
|
|
u8 smp;
|
|
struct {
|
|
u8 throttle:1;
|
|
u8 fdma:1;
|
|
u8 reserved:6;
|
|
u32 bmisx;
|
|
} piix4;
|
|
};
|
|
|
|
extern int acpi_processor_preregister_performance(
|
|
struct acpi_processor_performance **performance);
|
|
|
|
extern int acpi_processor_register_performance(struct acpi_processor_performance
|
|
*performance, unsigned int cpu);
|
|
extern void acpi_processor_unregister_performance(struct
|
|
acpi_processor_performance
|
|
*performance,
|
|
unsigned int cpu);
|
|
|
|
/* note: this locks both the calling module and the processor module
|
|
if a _PPC object exists, rmmod is disallowed then */
|
|
int acpi_processor_notify_smm(struct module *calling_module);
|
|
|
|
/* for communication between multiple parts of the processor kernel module */
|
|
extern struct acpi_processor *processors[NR_CPUS];
|
|
extern struct acpi_processor_errata errata;
|
|
|
|
void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
|
|
|
|
#ifdef ARCH_HAS_POWER_INIT
|
|
void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
|
|
unsigned int cpu);
|
|
#else
|
|
static inline void acpi_processor_power_init_bm_check(struct
|
|
acpi_processor_flags
|
|
*flags, unsigned int cpu)
|
|
{
|
|
flags->bm_check = 1;
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
/* in processor_perflib.c */
|
|
|
|
#ifdef CONFIG_CPU_FREQ
|
|
void acpi_processor_ppc_init(void);
|
|
void acpi_processor_ppc_exit(void);
|
|
int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
|
|
#else
|
|
static inline void acpi_processor_ppc_init(void)
|
|
{
|
|
return;
|
|
}
|
|
static inline void acpi_processor_ppc_exit(void)
|
|
{
|
|
return;
|
|
}
|
|
static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
|
|
{
|
|
static unsigned int printout = 1;
|
|
if (printout) {
|
|
printk(KERN_WARNING
|
|
"Warning: Processor Platform Limit event detected, but not handled.\n");
|
|
printk(KERN_WARNING
|
|
"Consider compiling CPUfreq support into your kernel.\n");
|
|
printout = 0;
|
|
}
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_CPU_FREQ */
|
|
|
|
/* in processor_throttling.c */
|
|
int acpi_processor_get_throttling_info(struct acpi_processor *pr);
|
|
int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
|
|
extern struct file_operations acpi_processor_throttling_fops;
|
|
|
|
/* in processor_idle.c */
|
|
int acpi_processor_power_init(struct acpi_processor *pr,
|
|
struct acpi_device *device);
|
|
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
|
|
int acpi_processor_power_exit(struct acpi_processor *pr,
|
|
struct acpi_device *device);
|
|
|
|
/* in processor_thermal.c */
|
|
int acpi_processor_get_limit_info(struct acpi_processor *pr);
|
|
extern struct file_operations acpi_processor_limit_fops;
|
|
|
|
#ifdef CONFIG_CPU_FREQ
|
|
void acpi_thermal_cpufreq_init(void);
|
|
void acpi_thermal_cpufreq_exit(void);
|
|
#else
|
|
static inline void acpi_thermal_cpufreq_init(void)
|
|
{
|
|
return;
|
|
}
|
|
static inline void acpi_thermal_cpufreq_exit(void)
|
|
{
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
#endif
|