Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2009 Rudolf Marek <r.marek@assembler.cz> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 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. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 18 | */ |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 19 | |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 20 | #ifndef LIBACPI_H |
| 21 | #define LIBACPI_H |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 22 | |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 23 | #include <assert.h> |
| 24 | #include <stdlib.h> |
| 25 | #include <stdint.h> |
Stefan Reinauer | 4cc8c70 | 2012-04-27 21:34:16 +0200 | [diff] [blame] | 26 | #include <arch/acpi.h> |
Sven Schnelle | 0b86c76 | 2011-10-21 21:46:47 +0200 | [diff] [blame] | 27 | |
Stefan Reinauer | 5b73d4d | 2012-04-27 21:55:05 +0200 | [diff] [blame] | 28 | int acpigen_write_len_f(void); |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 29 | void acpigen_patch_len(int len); |
| 30 | void acpigen_set_current(char *curr); |
| 31 | char *acpigen_get_current(void); |
| 32 | int acpigen_write_package(int nr_el); |
| 33 | int acpigen_write_byte(unsigned int data); |
| 34 | int acpigen_emit_byte(unsigned char data); |
Myles Watson | 3fe6b70 | 2009-10-09 20:13:43 +0000 | [diff] [blame] | 35 | int acpigen_emit_stream(const char *data, int size); |
| 36 | int acpigen_emit_namestring(const char *namepath); |
Vladimir Serbinenko | 8ecdc9e | 2014-02-15 18:59:40 +0100 | [diff] [blame^] | 37 | int acpigen_emit_eisaid(const char *eisaid); |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 38 | int acpigen_write_dword(unsigned int data); |
Carl-Daniel Hailfinger | d58671c | 2009-02-17 21:38:51 +0000 | [diff] [blame] | 39 | int acpigen_write_qword(uint64_t data); |
Myles Watson | 3fe6b70 | 2009-10-09 20:13:43 +0000 | [diff] [blame] | 40 | int acpigen_write_name(const char *name); |
| 41 | int acpigen_write_name_dword(const char *name, uint32_t val); |
| 42 | int acpigen_write_name_qword(const char *name, uint64_t val); |
| 43 | int acpigen_write_name_byte(const char *name, uint8_t val); |
| 44 | int acpigen_write_scope(const char *name); |
Rudolf Marek | f997b55 | 2009-02-14 15:40:23 +0000 | [diff] [blame] | 45 | int acpigen_write_PPC(u8 nr); |
Duncan Laurie | 0eefa00 | 2012-07-16 12:11:53 -0700 | [diff] [blame] | 46 | int acpigen_write_PPC_NVS(void); |
Rudolf Marek | f997b55 | 2009-02-14 15:40:23 +0000 | [diff] [blame] | 47 | int acpigen_write_empty_PCT(void); |
Stefan Reinauer | 39205c6 | 2012-04-27 21:49:28 +0200 | [diff] [blame] | 48 | int acpigen_write_empty_PTC(void); |
| 49 | int acpigen_write_TPC(const char *gnvs_tpc_limit); |
Rudolf Marek | f997b55 | 2009-02-14 15:40:23 +0000 | [diff] [blame] | 50 | int acpigen_write_PSS_package(u32 coreFreq, u32 power, u32 transLat, u32 busmLat, |
| 51 | u32 control, u32 status); |
Patrick Georgi | df444bf | 2009-04-21 20:34:36 +0000 | [diff] [blame] | 52 | typedef enum { SW_ALL=0xfc, SW_ANY=0xfd, HW_ALL=0xfe } PSD_coord; |
| 53 | int acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); |
Stefan Reinauer | f69b468 | 2012-04-27 23:12:08 +0200 | [diff] [blame] | 54 | int acpigen_write_CST_package_entry(acpi_cstate_t *cstate); |
Stefan Reinauer | 4cc8c70 | 2012-04-27 21:34:16 +0200 | [diff] [blame] | 55 | int acpigen_write_CST_package(acpi_cstate_t *entry, int nentries); |
Rudolf Marek | f997b55 | 2009-02-14 15:40:23 +0000 | [diff] [blame] | 56 | int acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len); |
Stefan Reinauer | 39205c6 | 2012-04-27 21:49:28 +0200 | [diff] [blame] | 57 | int acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list); |
| 58 | int acpigen_write_TSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); |
Tobias Diedrich | 0fe6e9a | 2010-11-17 16:27:06 +0000 | [diff] [blame] | 59 | int acpigen_write_mem32fixed(int readwrite, u32 base, u32 size); |
| 60 | int acpigen_write_io16(u16 min, u16 max, u8 align, u8 len, u8 decode16); |
Stefan Reinauer | 4cc8c70 | 2012-04-27 21:34:16 +0200 | [diff] [blame] | 61 | int acpigen_write_register(acpi_addr_t *addr); |
Tobias Diedrich | 0fe6e9a | 2010-11-17 16:27:06 +0000 | [diff] [blame] | 62 | int acpigen_write_resourcetemplate_header(void); |
| 63 | int acpigen_write_resourcetemplate_footer(int len); |
| 64 | int acpigen_write_mainboard_resource_template(void); |
| 65 | int acpigen_write_mainboard_resources(const char *scope, const char *name); |
Vladimir Serbinenko | 20ea040 | 2014-02-15 18:57:17 +0100 | [diff] [blame] | 66 | int acpigen_write_irq(u16 mask); |
Uwe Hermann | c70e9fc | 2010-02-15 23:10:19 +0000 | [diff] [blame] | 67 | |
Stefan Reinauer | 4cc8c70 | 2012-04-27 21:34:16 +0200 | [diff] [blame] | 68 | int get_cst_entries(acpi_cstate_t **); |
Sven Schnelle | 5460097 | 2011-10-22 13:41:16 +0200 | [diff] [blame] | 69 | |
Rudolf Marek | 293b5f5 | 2009-02-01 18:35:15 +0000 | [diff] [blame] | 70 | #endif |