blob: 419ec5293350421ce835fc498ab4641ef800972d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: BSD-3-Clause */
Gabe Black9fd7a1f2011-12-05 12:09:22 +00002/*
3 * This file is part of the libpayload project.
4 *
5 * Copyright (C) 2008 Advanced Micro Devices, Inc.
Gabe Black9fd7a1f2011-12-05 12:09:22 +00006 */
7
8#ifndef _COREBOOT_SYSINFO_H
9#define _COREBOOT_SYSINFO_H
10
Bin Meng164e7572016-02-27 22:57:55 -080011#include <asm/coreboot_tables.h>
Gabe Black9fd7a1f2011-12-05 12:09:22 +000012
Bin Meng44f621f2015-08-13 00:29:08 -070013/* Maximum number of memory range definitions */
14#define SYSINFO_MAX_MEM_RANGES 32
Simon Glassbc30b212012-10-12 18:48:46 +000015/* Allow a maximum of 8 GPIOs */
Bin Meng44f621f2015-08-13 00:29:08 -070016#define SYSINFO_MAX_GPIOS 8
Gabe Black9fd7a1f2011-12-05 12:09:22 +000017
18struct sysinfo_t {
Gabe Black9fd7a1f2011-12-05 12:09:22 +000019 int n_memranges;
Gabe Black9fd7a1f2011-12-05 12:09:22 +000020 struct memrange {
21 unsigned long long base;
22 unsigned long long size;
23 unsigned int type;
24 } memrange[SYSINFO_MAX_MEM_RANGES];
25
Gabe Black9fd7a1f2011-12-05 12:09:22 +000026 u32 cmos_range_start;
27 u32 cmos_range_end;
28 u32 cmos_checksum_location;
Simon Glassbc30b212012-10-12 18:48:46 +000029 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 Black9fd7a1f2011-12-05 12:09:22 +000042
43 struct cb_framebuffer *framebuffer;
44
Simon Glassbc30b212012-10-12 18:48:46 +000045 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 Gmeiner65e63392020-05-14 15:16:22 +020052 u64 smbios_start;
53 u32 smbios_size;
Simon Glassbc30b212012-10-12 18:48:46 +000054
55 struct cb_serial *serial;
Gabe Black9fd7a1f2011-12-05 12:09:22 +000056};
57
58extern struct sysinfo_t lib_sysinfo;
59
Bin Mengd75fb952016-02-27 22:57:56 -080060int get_coreboot_info(struct sysinfo_t *info);
61
Gabe Black9fd7a1f2011-12-05 12:09:22 +000062#endif