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 53721bdcc41c6b027a858efabe0c4cec34fe6920
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 ff906f45d591fecf0a1e89e55004385ba7d0e889
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 9b17997c40b6bb02abee7b11fafe42ef356bb7bf
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 d979203..fa5e714 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]),