Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 2 | /* |
| 3 | * This file is part of the libpayload project. |
| 4 | * |
| 5 | * Copyright (C) 2008 Advanced Micro Devices, Inc. |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _COREBOOT_SYSINFO_H |
| 9 | #define _COREBOOT_SYSINFO_H |
| 10 | |
Bin Meng | 164e757 | 2016-02-27 22:57:55 -0800 | [diff] [blame] | 11 | #include <asm/coreboot_tables.h> |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 12 | |
Bin Meng | 44f621f | 2015-08-13 00:29:08 -0700 | [diff] [blame] | 13 | /* Maximum number of memory range definitions */ |
| 14 | #define SYSINFO_MAX_MEM_RANGES 32 |
Simon Glass | bc30b21 | 2012-10-12 18:48:46 +0000 | [diff] [blame] | 15 | /* Allow a maximum of 8 GPIOs */ |
Bin Meng | 44f621f | 2015-08-13 00:29:08 -0700 | [diff] [blame] | 16 | #define SYSINFO_MAX_GPIOS 8 |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 17 | |
| 18 | struct sysinfo_t { |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 19 | int n_memranges; |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 20 | struct memrange { |
| 21 | unsigned long long base; |
| 22 | unsigned long long size; |
| 23 | unsigned int type; |
| 24 | } memrange[SYSINFO_MAX_MEM_RANGES]; |
| 25 | |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 26 | u32 cmos_range_start; |
| 27 | u32 cmos_range_end; |
| 28 | u32 cmos_checksum_location; |
Simon Glass | bc30b21 | 2012-10-12 18:48:46 +0000 | [diff] [blame] | 29 | u32 vbnv_start; |
| 30 | u32 vbnv_size; |
| 31 | |
| 32 | char *version; |
| 33 | char *extra_version; |
| 34 | char *build; |
| 35 | char *compile_time; |
| 36 | char *compile_by; |
| 37 | char *compile_host; |
| 38 | char *compile_domain; |
| 39 | char *compiler; |
| 40 | char *linker; |
| 41 | char *assembler; |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 42 | |
| 43 | struct cb_framebuffer *framebuffer; |
| 44 | |
Simon Glass | bc30b21 | 2012-10-12 18:48:46 +0000 | [diff] [blame] | 45 | int num_gpios; |
| 46 | struct cb_gpio gpios[SYSINFO_MAX_GPIOS]; |
| 47 | |
| 48 | void *vdat_addr; |
| 49 | u32 vdat_size; |
| 50 | void *tstamp_table; |
| 51 | void *cbmem_cons; |
Christian Gmeiner | 65e6339 | 2020-05-14 15:16:22 +0200 | [diff] [blame] | 52 | u64 smbios_start; |
| 53 | u32 smbios_size; |
Simon Glass | bc30b21 | 2012-10-12 18:48:46 +0000 | [diff] [blame] | 54 | |
| 55 | struct cb_serial *serial; |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | extern struct sysinfo_t lib_sysinfo; |
| 59 | |
Bin Meng | d75fb95 | 2016-02-27 22:57:56 -0800 | [diff] [blame] | 60 | int get_coreboot_info(struct sysinfo_t *info); |
| 61 | |
Gabe Black | 9fd7a1f | 2011-12-05 12:09:22 +0000 | [diff] [blame] | 62 | #endif |