summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2011-10-03 16:41:50 -0700
committerVadim Bendebury <vbendeb@chromium.org>2011-10-03 17:15:16 -0700
commitc80db17943527bdb9c4bdb434343389426449a77 (patch)
treebc6c5625279f54ebb8f730620846a20db976b860 /arch
parent5cac8a8221c9470c75f81399e3a92eeda28a9851 (diff)
Process all cbmem table references consistently.
A few CBMEM table entries are included in coreboot to let u-boot discover the locations of those entries. They all are passed using the same structure within coreboot table. This patch makes use of that structure for all communicated entries (timestam, console and MRC cache). It does not make sense to keep types of pointers in the sysinfo table, as nobody but the respective users of those fields use the types. Let's keep the pointers as void *, this also allows to reduce the amount of include files in systinfo.h and hide the timestamp structures in timestamp.c. BUG=chrome-os-partner:4200 TEST=manual . build the new firmware and program it on a stumpy . restart the machine . after it comes up to ChromeOS, run the cbmem.py utility Observe that timstamp values are displayed, and there is an entry with index 1000 (added by u-boot to the coreboot timestamp table). Change-Id: Icb808145c4c62cee939eceb3d5bf5afb3bcd00d9 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/8711 Reviewed-by: Stefan Reinauer <reinauer@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/coreboot/tables.c20
-rw-r--r--arch/x86/cpu/coreboot/timestamp.c12
-rw-r--r--arch/x86/include/asm/ic/coreboot/sysinfo.h8
-rw-r--r--arch/x86/include/asm/ic/coreboot/tables.h6
4 files changed, 38 insertions, 8 deletions
diff --git a/arch/x86/cpu/coreboot/tables.c b/arch/x86/cpu/coreboot/tables.c
index 18aa1149a5a..90994aed15c 100644
--- a/arch/x86/cpu/coreboot/tables.c
+++ b/arch/x86/cpu/coreboot/tables.c
@@ -119,7 +119,7 @@ static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info)
static void cb_parse_fdt(unsigned char *ptr, struct sysinfo_t *info)
{
- info->sys_fdt = (struct fdt_header *)(((struct cb_fdt *)ptr) + 1);
+ info->sys_fdt = (((struct cb_fdt *)ptr) + 1);
}
static void cb_parse_vdat(unsigned char *ptr, struct sysinfo_t *info)
@@ -132,7 +132,17 @@ static void cb_parse_vdat(unsigned char *ptr, struct sysinfo_t *info)
static void cb_parse_tstamp(unsigned char *ptr, struct sysinfo_t *info)
{
- info->tstamp_table = ((struct cb_tstamp *)ptr)->tstamp_tab;
+ info->tstamp_table = ((struct cb_cbmem_tab *)ptr)->cbmem_tab;
+}
+
+static void cb_parse_cbmem_cons(unsigned char *ptr, struct sysinfo_t *info)
+{
+ info->cbmem_cons = ((struct cb_cbmem_tab *)ptr)->cbmem_tab;
+}
+
+static void cb_parse_mrc_cache(unsigned char *ptr, struct sysinfo_t *info)
+{
+ info->mrc_cache = ((struct cb_cbmem_tab *)ptr)->cbmem_tab;
}
static void cb_parse_framebuffer(unsigned char *ptr, struct sysinfo_t *info)
@@ -245,6 +255,12 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_TIMESTAMPS:
cb_parse_tstamp(ptr, info);
break;
+ case CB_TAG_CBMEM_CONSOLE:
+ cb_parse_cbmem_cons(ptr, info);
+ break;
+ case CB_TAG_MRC_CACHE:
+ cb_parse_mrc_cache(ptr, info);
+ break;
}
ptr += rec->size;
diff --git a/arch/x86/cpu/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c
index 3a16d37a7c0..37285778019 100644
--- a/arch/x86/cpu/coreboot/timestamp.c
+++ b/arch/x86/cpu/coreboot/timestamp.c
@@ -21,6 +21,18 @@
#include <coreboot/timestamp.h>
#include <asm/ic/coreboot/sysinfo.h>
+struct timestamp_entry {
+ uint32_t entry_id;
+ uint64_t entry_stamp;
+} __attribute__((packed));
+
+struct timestamp_table {
+ uint64_t base_time;
+ uint32_t max_entries;
+ uint32_t num_entries;
+ struct timestamp_entry entries[0]; /* Variable number of entries */
+} __attribute__((packed));
+
static struct timestamp_table *ts_table;
void timestamp_init(void)
diff --git a/arch/x86/include/asm/ic/coreboot/sysinfo.h b/arch/x86/include/asm/ic/coreboot/sysinfo.h
index 3cd797fb5e5..d2f40d9dd33 100644
--- a/arch/x86/include/asm/ic/coreboot/sysinfo.h
+++ b/arch/x86/include/asm/ic/coreboot/sysinfo.h
@@ -33,8 +33,6 @@
#include <common.h>
#include <compiler.h>
#include <asm/ic/coreboot/tables.h>
-#include <fdt.h>
-#include <coreboot/timestamp.h>
/* Allow a maximum of 16 memory range definitions. */
#define SYSINFO_MAX_MEM_RANGES 16
@@ -80,8 +78,10 @@ struct sysinfo_t {
unsigned long *mbtable; /** Pointer to the multiboot table */
void *vdat_addr;
u32 vdat_size;
- struct fdt_header *sys_fdt;
- struct timestamp_table *tstamp_table;
+ void *sys_fdt;
+ void *tstamp_table;
+ void *cbmem_cons;
+ void *mrc_cache;
};
extern struct sysinfo_t lib_sysinfo;
diff --git a/arch/x86/include/asm/ic/coreboot/tables.h b/arch/x86/include/asm/ic/coreboot/tables.h
index 85b12582f5d..fb14ccd39f6 100644
--- a/arch/x86/include/asm/ic/coreboot/tables.h
+++ b/arch/x86/include/asm/ic/coreboot/tables.h
@@ -197,10 +197,12 @@ struct cb_vdat {
};
#define CB_TAG_TIMESTAMPS 0x0016
-struct cb_tstamp {
+#define CB_TAG_CBMEM_CONSOLE 0x0017
+#define CB_TAG_MRC_CACHE 0x0018
+struct cb_cbmem_tab {
uint32_t tag;
uint32_t size;
- void *tstamp_tab;
+ void *cbmem_tab;
};
#define CB_TAG_CMOS_OPTION_TABLE 0x00c8