blob: bb5b2eea68ccab768a2b3e6e402f4d1d0e6bc163 [file] [log] [blame]
Jordan Crousef6145c32008-03-19 23:56:58 +00001/*
2 * This file is part of the libpayload project.
3 *
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
Uwe Hermannfad8c2b2008-04-11 18:01:50 +000030#ifndef _SYSINFO_H
31#define _SYSINFO_H
Jordan Crousef6145c32008-03-19 23:56:58 +000032
Uwe Hermann6a441bf2008-03-20 19:54:59 +000033/* Allow a maximum of 16 memory range definitions. */
Jordan Crousef6145c32008-03-19 23:56:58 +000034#define SYSINFO_MAX_MEM_RANGES 16
Gabe Blackd3890cc2012-03-11 01:57:53 -080035/* Allow a maximum of 8 GPIOs */
36#define SYSINFO_MAX_GPIOS 8
37
38#include <coreboot_tables.h>
Jordan Crousef6145c32008-03-19 23:56:58 +000039
Gabe Black5ab20052012-08-28 16:38:34 -070040struct cb_serial;
41
Jordan Crousef6145c32008-03-19 23:56:58 +000042struct sysinfo_t {
43 unsigned int cpu_khz;
Gabe Black5ab20052012-08-28 16:38:34 -070044 struct cb_serial *serial;
Jordan Crousef6145c32008-03-19 23:56:58 +000045 unsigned short ser_ioport;
Stefan Reinauer4e677312011-04-16 00:13:17 +000046 unsigned long ser_base; // for mmapped serial
Jordan Crousef6145c32008-03-19 23:56:58 +000047
48 int n_memranges;
49
Stefan Reinauer34b9f862008-08-19 17:51:30 +000050 struct memrange {
Jordan Crousef6145c32008-03-19 23:56:58 +000051 unsigned long long base;
52 unsigned long long size;
Patrick Georgic9a6f0f2009-05-17 20:36:45 +000053 unsigned int type;
Jordan Crousef6145c32008-03-19 23:56:58 +000054 } memrange[SYSINFO_MAX_MEM_RANGES];
Stefan Reinauer95a6e1c2008-08-07 10:21:05 +000055
56 struct cb_cmos_option_table *option_table;
57 u32 cmos_range_start;
58 u32 cmos_range_end;
59 u32 cmos_checksum_location;
Gabe Blackd3890cc2012-03-11 01:57:53 -080060#if CONFIG_CHROMEOS
61 u32 vbnv_start;
62 u32 vbnv_size;
63#endif
64
65 char *version;
66 char *extra_version;
67 char *build;
68 char *compile_time;
69 char *compile_by;
70 char *compile_host;
71 char *compile_domain;
72 char *compiler;
73 char *linker;
74 char *assembler;
Jordan Crouse6c6e4332008-11-11 19:51:14 +000075
Mathias Krause08052012011-10-20 14:06:26 +020076 char *cb_version;
77
Stefan Reinauerb7002542010-03-25 18:56:26 +000078 struct cb_framebuffer *framebuffer;
79
Gabe Blackd3890cc2012-03-11 01:57:53 -080080#if CONFIG_CHROMEOS
81 int num_gpios;
82 struct cb_gpio gpios[SYSINFO_MAX_GPIOS];
83#endif
84
Jordan Crouse6c6e4332008-11-11 19:51:14 +000085 unsigned long *mbtable; /** Pointer to the multiboot table */
Philip Prindeville9a7c2462011-12-24 22:12:37 -070086
87 struct cb_header *header;
88 struct cb_mainboard *mainboard;
Gabe Blackd3890cc2012-03-11 01:57:53 -080089
90#if CONFIG_CHROMEOS
91 void *vdat_addr;
92 u32 vdat_size;
93#endif
94 void *tstamp_table;
95 void *cbmem_cons;
96 void *mrc_cache;
Jordan Crousef6145c32008-03-19 23:56:58 +000097};
98
99extern struct sysinfo_t lib_sysinfo;
Jordan Crousef6145c32008-03-19 23:56:58 +0000100
101#endif
102