blob: a5781f1af45d1bb899ae65e8daf08e357509a051 [file] [log] [blame]
Simon Glass9b3e6d42020-09-22 12:45:14 -06001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4 */
5
6#ifndef __ASM_INTEL_ACPI_H__
7#define __ASM_INTEL_ACPI_H__
8
9struct acpi_cstate;
10struct acpi_ctx;
11struct acpi_tstate;
12struct udevice;
13
14/**
15 * acpi_generate_cpu_header() - Start generating an ACPI CPU entry
16 *
17 * Generates the ACPI information for a CPU. After this, the caller should
18 * generate_p_state_entries(), generate_t_state_entries and then
19 * acpigen_pop_len() to close off this package.
20 *
21 * @ctx: ACPI context pointer
22 * @core_id: CPU core number, as numbered by the SoC
23 * @c_state_map: Information about each C state
24 * @num_cstates: Number of entries in @c_state_map
25 * @return 0 if OK, -ve on error
26 */
27int acpi_generate_cpu_header(struct acpi_ctx *ctx, int core_id,
28 const struct acpi_cstate *c_state_map,
29 int num_cstates);
30
31/**
32 * acpi_generate_cpu_package_final() - Write out the CPU PPKG entry
33 *
34 * This writes information about the CPUs in the package
35 *
36 * @ctx: ACPI context pointer
37 * @cores_per_package: Number of CPU cores in each package in the SoC
38 */
39int acpi_generate_cpu_package_final(struct acpi_ctx *ctx,
40 int cores_per_package);
41
42void generate_p_state_entries(struct acpi_ctx *ctx, int core,
43 int cores_per_package);
44void generate_t_state_entries(struct acpi_ctx *ctx, int core,
45 int cores_per_package, struct acpi_tstate *entry,
46 int nentries);
47int southbridge_inject_dsdt(const struct udevice *dev, struct acpi_ctx *ctx);
48
49int intel_southbridge_write_acpi_tables(const struct udevice *dev,
50 struct acpi_ctx *ctx);
51
52#endif /* __ASM_INTEL_ACPI_H__ */