Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 1 | /* |
| 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 Hermann | fad8c2b | 2008-04-11 18:01:50 +0000 | [diff] [blame] | 30 | #ifndef _SYSINFO_H |
| 31 | #define _SYSINFO_H |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 32 | |
Uwe Hermann | 6a441bf | 2008-03-20 19:54:59 +0000 | [diff] [blame] | 33 | /* Allow a maximum of 16 memory range definitions. */ |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 34 | #define SYSINFO_MAX_MEM_RANGES 16 |
Gabe Black | d3890cc | 2012-03-11 01:57:53 -0800 | [diff] [blame^] | 35 | /* Allow a maximum of 8 GPIOs */ |
| 36 | #define SYSINFO_MAX_GPIOS 8 |
| 37 | |
| 38 | #include <coreboot_tables.h> |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 39 | |
Gabe Black | 5ab2005 | 2012-08-28 16:38:34 -0700 | [diff] [blame] | 40 | struct cb_serial; |
| 41 | |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 42 | struct sysinfo_t { |
| 43 | unsigned int cpu_khz; |
Gabe Black | 5ab2005 | 2012-08-28 16:38:34 -0700 | [diff] [blame] | 44 | struct cb_serial *serial; |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 45 | unsigned short ser_ioport; |
Stefan Reinauer | 4e67731 | 2011-04-16 00:13:17 +0000 | [diff] [blame] | 46 | unsigned long ser_base; // for mmapped serial |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 47 | |
| 48 | int n_memranges; |
| 49 | |
Stefan Reinauer | 34b9f86 | 2008-08-19 17:51:30 +0000 | [diff] [blame] | 50 | struct memrange { |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 51 | unsigned long long base; |
| 52 | unsigned long long size; |
Patrick Georgi | c9a6f0f | 2009-05-17 20:36:45 +0000 | [diff] [blame] | 53 | unsigned int type; |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 54 | } memrange[SYSINFO_MAX_MEM_RANGES]; |
Stefan Reinauer | 95a6e1c | 2008-08-07 10:21:05 +0000 | [diff] [blame] | 55 | |
| 56 | struct cb_cmos_option_table *option_table; |
| 57 | u32 cmos_range_start; |
| 58 | u32 cmos_range_end; |
| 59 | u32 cmos_checksum_location; |
Gabe Black | d3890cc | 2012-03-11 01:57:53 -0800 | [diff] [blame^] | 60 | #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 Crouse | 6c6e433 | 2008-11-11 19:51:14 +0000 | [diff] [blame] | 75 | |
Mathias Krause | 0805201 | 2011-10-20 14:06:26 +0200 | [diff] [blame] | 76 | char *cb_version; |
| 77 | |
Stefan Reinauer | b700254 | 2010-03-25 18:56:26 +0000 | [diff] [blame] | 78 | struct cb_framebuffer *framebuffer; |
| 79 | |
Gabe Black | d3890cc | 2012-03-11 01:57:53 -0800 | [diff] [blame^] | 80 | #if CONFIG_CHROMEOS |
| 81 | int num_gpios; |
| 82 | struct cb_gpio gpios[SYSINFO_MAX_GPIOS]; |
| 83 | #endif |
| 84 | |
Jordan Crouse | 6c6e433 | 2008-11-11 19:51:14 +0000 | [diff] [blame] | 85 | unsigned long *mbtable; /** Pointer to the multiboot table */ |
Philip Prindeville | 9a7c246 | 2011-12-24 22:12:37 -0700 | [diff] [blame] | 86 | |
| 87 | struct cb_header *header; |
| 88 | struct cb_mainboard *mainboard; |
Gabe Black | d3890cc | 2012-03-11 01:57:53 -0800 | [diff] [blame^] | 89 | |
| 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 Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | extern struct sysinfo_t lib_sysinfo; |
Jordan Crouse | f6145c3 | 2008-03-19 23:56:58 +0000 | [diff] [blame] | 100 | |
| 101 | #endif |
| 102 | |