blob: 845e0f0ae4897f9d0c3c958127298cccb4a99f7a [file] [log] [blame]
Duncan Laurie63ebc802015-09-08 16:09:28 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Duncan Laurie63ebc802015-09-08 16:09:28 -070014 */
15
16#ifndef _INTEL_COMMON_ACPI_H_
17#define _INTEL_COMMON_ACPI_H_
18
19#include <stdint.h>
20
21/*
22 * SOC specific handler to provide the wake source data for ACPI _SWS.
23 *
24 * @pm1: PM1_STS register with only enabled events set
25 * @gpe0: GPE0_STS registers with only enabled events set
26 *
27 * return the number of registers in the gpe0 array or -1 if nothing
28 * is provided by this function.
29 */
30int soc_fill_acpi_wake(uint32_t *pm1, uint32_t **gpe0);
31
Hannah Williamsf8daa372016-04-18 13:40:04 -070032#if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_ACPI)
33
34/*
35 * cpu_get_bus_clock returns the bus clock frequency in KHz.
36 * This is the value the clock ratio is multiplied with.
37 */
38uint32_t cpu_get_bus_clock(void);
39
40/*
41 * cpu_get_coord_type returns coordination type (SW_ANY or SW_ALL or HW_ALL)
42 * which is used to populate _PSD object.
43 */
44int cpu_get_coord_type(void);
45
46/*
47 * cpu_config_tdp_levels returns the number of TDP levels supported
48 * by this processor
49 */
50int cpu_config_tdp_levels(void);
51
52/*
53 * cpu_get_min_ratio returns the minimum frequency ratio that is supported
54 * by this processor
55 */
56uint32_t cpu_get_min_ratio(void);
57
58/*
59 * cpu_get_max_ratio returns the nominal TDP ratio if available or the
60 * maximum non turbo frequency ratio for this processor
61 */
62uint32_t cpu_get_max_ratio(void);
63
64/*
65 * cpu_get_power_max calculates CPU TDP in mW
66 */
67uint32_t cpu_get_power_max(void);
68
69/*
70 * cpu_get_max_turbo_ratio returns the maximum turbo ratio limit for the
71 * processor
72 */
73uint32_t cpu_get_max_turbo_ratio(void);
74
75/*
76 * get_cstate_map returns a table of processor specific acpi_cstate_t entries
77 * and number of entries in the table
78 */
79acpi_cstate_t *soc_get_cstate_map(int *num_entries);
80
81/*
82 * get_soc_tss_table returns a table of processor specific acpi_tstate_t entries
83 * and number of entries in the table
84 */
85acpi_tstate_t *soc_get_tss_table(int *num_entries);
86
87/*
Elyes HAOUAS038e7242016-07-29 18:31:16 +020088 * soc_get_acpi_base_address returns the ACPI base address for the SOC
Hannah Williamsf8daa372016-04-18 13:40:04 -070089 */
90uint16_t soc_get_acpi_base_address(void);
91
92#endif /* CONFIG_SOC_INTEL_COMMON_ACPI */
Duncan Laurie63ebc802015-09-08 16:09:28 -070093#endif