Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4243
-gerrit
commit 2ec3479e94ded8e15141970ee9d95354f0f3a9aa
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Apr 24 17:54:37 2013 -0700
elog: Merge elog_validate_and_fill into elog_init_descriptor.
elog_validate_and_fill was called in exactly one place, in
elog_init_descriptor. It didn't actually do what its name implied since the
data in the event log was already "filled" by elog_init_descriptor. Likewise
elog_init_descriptor was delegating an important part of its own job, scanning
through the list of events, to elog_validate_and_fill.
Since one function was basically just a displaced part of the other which
couldn't really stand on its own, this change merges them together.
Built and booted on Link. Ran mosys eventlog list. Added 2000 events with
the SMI handler and ran mosys eventlog list again.
Change-Id: Ic899eeb18146d0f127d0dded207d37d63cbc716f
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/49308
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
---
src/drivers/elog/elog.c | 39 ++++++++++++++++-----------------------
1 file changed, 16 insertions(+), 23 deletions(-)
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 8f47ca2..ca5b3fb 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -354,28 +354,6 @@ static void elog_update_event_buffer_state(struct elog_descriptor *elog)
elog->last_event_size = last_event_size;
}
-static void elog_validate_and_fill(struct elog_descriptor *elog)
-{
- elog_debug("elog_validate_and_fill()\n");
-
- /* Check if the area is empty or not */
- if (elog_is_area_clear(elog)) {
- elog->area_state = ELOG_AREA_EMPTY;
- return;
- }
-
- elog->area_state = ELOG_AREA_HAS_CONTENT;
-
- /* Validate the header */
- if (!elog_is_header_valid(elog_get_header(elog))) {
- elog->header_state = ELOG_HEADER_INVALID;
- return;
- }
-
- elog->header_state = ELOG_HEADER_VALID;
- elog_update_event_buffer_state(elog);
-}
-
/*
* (Re)initialize a new ELOG descriptor
*/
@@ -396,7 +374,22 @@ static void elog_init_descriptor(struct elog_descriptor *elog)
elog->last_event_size = 0;
elog->event_count = 0;
- elog_validate_and_fill(elog);
+ /* Check if the area is empty or not */
+ if (elog_is_area_clear(elog)) {
+ elog->area_state = ELOG_AREA_EMPTY;
+ return;
+ }
+
+ elog->area_state = ELOG_AREA_HAS_CONTENT;
+
+ /* Validate the header */
+ if (!elog_is_header_valid(elog_get_header(elog))) {
+ elog->header_state = ELOG_HEADER_INVALID;
+ return;
+ }
+
+ elog->header_state = ELOG_HEADER_VALID;
+ elog_update_event_buffer_state(elog);
}
/*
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4240
-gerrit
commit de0706b7bc7338b58e53c4116ed4229b9c31393a
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Apr 24 03:16:21 2013 -0700
Make elog_shrink not depend on having seperate memory/flash descriptors.
The way elog_shrink currently works is that it completely clears the data in
the flash/flash descriptor and then recreates it using the part of the log
it's going to keep as stored in the memory descriptor. That scheme depends on
there being to independent copies of the log.
This change reworks elog_shrink so that it moves the data it wants to keep
within a single descriptor and then propogates it to the other and to flash
intact. This way, when one of the descriptors goes away, all we have to do is
remove the code that would update it.
Built and booted into ChromeOS on Link. Ran mosys eventlog list. Added
2000 events to the log and ran mosys eventlog list again. Echoed a 1 into
/sys/firmware/gsmi/clear_eventlog and ran mosys eventlog list.
BRANCH=None
Change-Id: I50d77a4f00ea3c6b3e0ec8996dab1a3b31580205
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/49305
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
---
src/drivers/elog/elog.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index fd638a5..ab255d8 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -621,9 +621,11 @@ static int elog_flash_area_bootstrap(void)
static int elog_shrink(void)
{
struct elog_descriptor *mem = elog_get_mem();
+ struct elog_descriptor *flash = elog_get_flash();
struct event_header *event;
u16 discard_count = 0;
u16 offset = 0;
+ u16 new_size = 0;
elog_debug("elog_shrink()\n");
@@ -645,25 +647,22 @@ static int elog_shrink(void)
discard_count++;
}
- /* Erase flash area */
- elog_flash_erase_area();
+ new_size = mem->next_event_offset - offset;
+ memmove(&mem->data[0], &mem->data[offset], new_size);
+ memset(&mem->data[new_size], ELOG_TYPE_EOL, mem->data_size - new_size);
+ elog_reinit_descriptor(mem);
+
+ elog_flash_erase(flash->backing_store, flash->total_size);
/* Ensure the area was successfully erased */
- if (elog_get_flash()->next_event_offset >= CONFIG_ELOG_FULL_THRESHOLD) {
+ if (mem->next_event_offset >= CONFIG_ELOG_FULL_THRESHOLD) {
printk(BIOS_ERR, "ELOG: Flash area was not erased!\n");
return -1;
}
- /* Write new flash area */
- elog_prepare_empty(elog_get_flash(),
- (u8*)elog_get_event_base(mem, offset),
- mem->next_event_offset - offset);
-
- /* Update memory area from flash */
- if (elog_sync_flash_to_mem() < 0) {
- printk(BIOS_ERR, "Unable to update memory area from flash\n");
- return -1;
- }
+ elog_flash_write(flash->backing_store, mem->backing_store,
+ mem->total_size);
+ elog_reinit_descriptor(flash);
/* Add clear event */
elog_add_event_word(ELOG_TYPE_LOG_CLEAR, offset);
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4238
-gerrit
commit e1f790c2cc11c545cca579769afdb8c7787848de
Author: Shawn Nematbakhsh <shawnn(a)google.com>
Date: Thu Jun 13 19:47:47 2013 -0700
peppy: Add 2GB DRAM configuration.
Currently, all Peppy boards w/ '000' SPD GPIOs have 2GB DRAM. Disable
the second DRAM channel based upon the GPIOs.
Need to change / confirm this for upcoming builds.
Change-Id: I7085ddecb80626cc0bed99ba7b174c6b80350696
Reviewed-on: https://gerrit.chromium.org/gerrit/58620
Commit-Queue: Shawn Nematbakhsh <shawnn(a)chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn(a)chromium.org>
---
src/mainboard/google/peppy/romstage.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mainboard/google/peppy/romstage.c b/src/mainboard/google/peppy/romstage.c
index 46c4f0b..bb65f00 100644
--- a/src/mainboard/google/peppy/romstage.c
+++ b/src/mainboard/google/peppy/romstage.c
@@ -92,6 +92,12 @@ static void copy_spd(struct pei_data *peid)
if (spd_file->len < sizeof(peid->spd_data[0]))
die("Missing SPD data.");
+ /* Index 0 is 2GB config with CH0 only. This is suject to change.
+ * TODO(shawnn): Check the decoding before next build.
+ */
+ if (spd_index == 0)
+ peid->dimm_channel1_disabled = 3;
+
memcpy(peid->spd_data[0],
((char*)CBFS_SUBHEADER(spd_file)) +
spd_index * sizeof(peid->spd_data[0]),
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4236
-gerrit
commit dcf3ec8f2724994dc6a12e8260bcb488270a9411
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Tue May 21 10:46:28 2013 -0700
libpayload: fix wrong endian assumption in sha1.c
Not all platforms !x86 are big endian, hence actually look
at the CONFIG_LITTLE_ENDIAN flag instead of CONFIG_ARCH_X86.
Change-Id: Ibbd8f48b377a1121dd1e045834a94a2d67eda2ab
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/56066
Reviewed-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-by: Ronald G. Minnich <rminnich(a)chromium.org>
Commit-Queue: Stefan Reinauer <reinauer(a)chromium.org>
Tested-by: Stefan Reinauer <reinauer(a)chromium.org>
---
payloads/libpayload/crypto/sha1.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/payloads/libpayload/crypto/sha1.c b/payloads/libpayload/crypto/sha1.c
index 3c97bf1..c973e18 100644
--- a/payloads/libpayload/crypto/sha1.c
+++ b/payloads/libpayload/crypto/sha1.c
@@ -30,18 +30,12 @@ typedef unsigned int u_int;
/* Moved from libpayload.h */
-#ifdef CONFIG_ARCH_X86
+#ifdef CONFIG_LITTLE_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
#else
#define BYTE_ORDER BIG_ENDIAN
#endif
-#if 0
-#include <sys/param.h>
-#include <string.h>
-#include <sha1.h>
-#endif
-
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/*