Get rid of hard coded strings in ACPI tables
[coreboot.git] / src / mainboard / via / epia-m / fadt.c
blob101ff191824ca5c0f2bf7d66b8bd9373e89c6daf
1 /*
2 * This file is part of the coreboot project.
4 * (C) Copyright 2004 Nick Barker <nick.barker9@btinternet.com>
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; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * ACPI - create the Fixed ACPI Description Tables (FADT)
25 #include <string.h>
26 #include <arch/acpi.h>
28 void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs,void *dsdt){
29 acpi_header_t *header=&(fadt->header);
31 memset((void *)fadt,0,sizeof(acpi_fadt_t));
32 memcpy(header->signature,"FACP",4);
33 header->length = 244;
34 header->revision = 3;
35 memcpy(header->oem_id,OEM_ID,6);
36 memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
37 memcpy(header->asl_compiler_id,ASLC,4);
38 header->asl_compiler_revision=0;
40 fadt->firmware_ctrl=(u32)facs;
41 fadt->dsdt=(u32)dsdt;
42 fadt->preferred_pm_profile=0;
43 fadt->sci_int=5;
44 fadt->smi_cmd = 0;
45 fadt->acpi_enable = 0;
46 fadt->acpi_disable = 0;
47 fadt->s4bios_req = 0x0;
48 fadt->pstate_cnt = 0x0;
50 fadt->pm1a_evt_blk = 0x400;
51 fadt->pm1b_evt_blk = 0x0;
52 fadt->pm1a_cnt_blk = 0x404;
53 fadt->pm1b_cnt_blk = 0x0;
54 fadt->pm2_cnt_blk = 0x0;
55 fadt->pm_tmr_blk = 0x408;
56 fadt->gpe0_blk = 0x420;
57 fadt->gpe1_blk = 0x0;
59 fadt->pm1_evt_len = 4;
60 fadt->pm1_cnt_len = 2;
61 fadt->pm2_cnt_len = 0;
62 fadt->pm_tmr_len = 4;
63 fadt->gpe0_blk_len = 4;
64 fadt->gpe1_blk_len = 0;
65 fadt->gpe1_base = 0;
66 fadt->cst_cnt = 0;
67 fadt->p_lvl2_lat = 90;
68 fadt->p_lvl3_lat = 900;
69 fadt->flush_size = 0;
70 fadt->flush_stride = 0;
71 fadt->duty_offset = 0;
72 fadt->duty_width = 1;
73 fadt->day_alrm = 125;
74 fadt->mon_alrm = 126;
75 fadt->century = 50;
76 fadt->iapc_boot_arch = 0x1;
77 fadt->flags = 0x4a5;
79 fadt->reset_reg.space_id = 0;
80 fadt->reset_reg.bit_width = 0;
81 fadt->reset_reg.bit_offset = 0;
82 fadt->reset_reg.resv = 0;
83 fadt->reset_reg.addrl = 0x0;
84 fadt->reset_reg.addrh = 0x0;
86 fadt->reset_value = 0;
87 fadt->x_firmware_ctl_l = (u32)facs;
88 fadt->x_firmware_ctl_h = 0;
89 fadt->x_dsdt_l = (u32)dsdt;
90 fadt->x_dsdt_h = 0;
92 fadt->x_pm1a_evt_blk.space_id = 1;
93 fadt->x_pm1a_evt_blk.bit_width = 4;
94 fadt->x_pm1a_evt_blk.bit_offset = 0;
95 fadt->x_pm1a_evt_blk.resv = 0;
96 fadt->x_pm1a_evt_blk.addrl = 0x400;
97 fadt->x_pm1a_evt_blk.addrh = 0x0;
100 fadt->x_pm1b_evt_blk.space_id = 1;
101 fadt->x_pm1b_evt_blk.bit_width = 4;
102 fadt->x_pm1b_evt_blk.bit_offset = 0;
103 fadt->x_pm1b_evt_blk.resv = 0;
104 fadt->x_pm1b_evt_blk.addrl = 0x0;
105 fadt->x_pm1b_evt_blk.addrh = 0x0;
108 fadt->x_pm1a_cnt_blk.space_id = 1;
109 fadt->x_pm1a_cnt_blk.bit_width = 2;
110 fadt->x_pm1a_cnt_blk.bit_offset = 0;
111 fadt->x_pm1a_cnt_blk.resv = 0;
112 fadt->x_pm1a_cnt_blk.addrl = 0x404;
113 fadt->x_pm1a_cnt_blk.addrh = 0x0;
116 fadt->x_pm1b_cnt_blk.space_id = 1;
117 fadt->x_pm1b_cnt_blk.bit_width = 2;
118 fadt->x_pm1b_cnt_blk.bit_offset = 0;
119 fadt->x_pm1b_cnt_blk.resv = 0;
120 fadt->x_pm1b_cnt_blk.addrl = 0x0;
121 fadt->x_pm1b_cnt_blk.addrh = 0x0;
124 fadt->x_pm2_cnt_blk.space_id = 1;
125 fadt->x_pm2_cnt_blk.bit_width = 0;
126 fadt->x_pm2_cnt_blk.bit_offset = 0;
127 fadt->x_pm2_cnt_blk.resv = 0;
128 fadt->x_pm2_cnt_blk.addrl = 0x0;
129 fadt->x_pm2_cnt_blk.addrh = 0x0;
132 fadt->x_pm_tmr_blk.space_id = 1;
133 fadt->x_pm_tmr_blk.bit_width = 4;
134 fadt->x_pm_tmr_blk.bit_offset = 0;
135 fadt->x_pm_tmr_blk.resv = 0;
136 fadt->x_pm_tmr_blk.addrl = 0x408;
137 fadt->x_pm_tmr_blk.addrh = 0x0;
140 fadt->x_gpe0_blk.space_id = 1;
141 fadt->x_gpe0_blk.bit_width = 0;
142 fadt->x_gpe0_blk.bit_offset = 0;
143 fadt->x_gpe0_blk.resv = 0;
144 fadt->x_gpe0_blk.addrl = 0x420;
145 fadt->x_gpe0_blk.addrh = 0x0;
148 fadt->x_gpe1_blk.space_id = 1;
149 fadt->x_gpe1_blk.bit_width = 0;
150 fadt->x_gpe1_blk.bit_offset = 0;
151 fadt->x_gpe1_blk.resv = 0;
152 fadt->x_gpe1_blk.addrl = 0x0;
153 fadt->x_gpe1_blk.addrh = 0x0;
155 header->checksum = acpi_checksum((void *)fadt, sizeof(acpi_fadt_t));