libpayload: Put coreboot version into lib_sysinfo
authorMathias Krause <mathias.krause@secunet.com>
Thu, 20 Oct 2011 12:06:26 +0000 (14:06 +0200)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Thu, 3 Nov 2011 18:02:55 +0000 (19:02 +0100)
Change-Id: I22319efe90e475c66b9556f734a7a5e54f7c59bc
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/394
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
payloads/libpayload/arch/i386/coreboot.c
payloads/libpayload/include/sysinfo.h

index bdef4e85d3de9866651233e99d26e05cb5893d7b..365445ed651b3b9701adf2b6d5eb5f5423d8c9cc 100644 (file)
@@ -82,6 +82,12 @@ static void cb_parse_serial(unsigned char *ptr, struct sysinfo_t *info)
        info->ser_ioport = ser->baseaddr;
 }
 
+static void cb_parse_version(unsigned char *ptr, struct sysinfo_t *info)
+{
+       struct cb_string *ver = (struct cb_string *)ptr;
+       info->cb_version = (char *)ver->string;
+}
+
 #ifdef CONFIG_NVRAM
 static void cb_parse_optiontable(unsigned char *ptr, struct sysinfo_t *info)
 {
@@ -148,6 +154,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
                case CB_TAG_SERIAL:
                        cb_parse_serial(ptr, info);
                        break;
+               case CB_TAG_VERSION:
+                       cb_parse_version(ptr, info);
+                       break;
 #ifdef CONFIG_NVRAM
                case CB_TAG_CMOS_OPTION_TABLE:
                        cb_parse_optiontable(ptr, info);
index e357704995d2430d7986227a1638707323266628..c1d2002279906b1cb9cadb98fdd81327e75cf591 100644 (file)
@@ -51,6 +51,8 @@ struct sysinfo_t {
        u32 cmos_range_end;
        u32 cmos_checksum_location;
 
+       char *cb_version;
+
        struct cb_framebuffer *framebuffer;
 
        unsigned long *mbtable; /** Pointer to the multiboot table */