Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10261
-gerrit
commit a87cd6c3b6c5d056fae9c1dcc44237f88657f607
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue May 19 16:25:20 2015 -0500
prog_loading: add region_device representing memory
One can remove the struct buffer_area and use the region_device
embedded in the struct prog to represent the in-memory loaded
program. Do this by introducing a addrspace_32bit mem_region_device
that can have region_device operations performed on it. The
addrspace_32bit name was chosen to make it explicit that 32-bits
of address space is supported at the max.
Change-Id: Ifffa0ef301141de940e54581b5a7b6cd81311ead
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/program_loading.h | 34 ++++++++++++++++++----------------
src/lib/prog_loaders.c | 3 +++
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index f820149..fcc6dcb 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -34,11 +34,6 @@ enum {
* set on the last segment loaded. */
void arch_segment_loaded(uintptr_t start, size_t size, int flags);
-struct buffer_area {
- void *data;
- size_t size;
-};
-
enum prog_type {
PROG_VERSTAGE,
PROG_ROMSTAGE,
@@ -51,28 +46,27 @@ enum prog_type {
struct prog {
enum prog_type type;
const char *name;
- /* Source of program content to load. */
+ /* Source of program content to load. After loading program it
+ * represents the memory region of the stages and payload. For
+ * achitectures that use a bounce buffer then it would represent
+ * the bounce buffer. */
struct region_device rdev;
- /* The area can mean different things depending on what type the
- * program is. A stage after being loaded reflects the memory occupied
- * by the program, Since payloads are multi-segment one can't express
- * the memory layout with one range. Instead this field is updated
- * to reflect the bounce buffer used. */
- struct buffer_area area;
/* Entry to program with optional argument. It's up to the architecture
* to decide if argument is passed. */
void (*entry)(void *);
void *arg;
};
+/* Only valid for loaded programs. */
static inline size_t prog_size(const struct prog *prog)
{
- return prog->area.size;
+ return region_device_sz(&prog->rdev);
}
+/* Only valid for loaded programs. */
static inline void *prog_start(const struct prog *prog)
{
- return prog->area.data;
+ return rdev_mmap_full(&prog->rdev);
}
static inline void *prog_entry(const struct prog *prog)
@@ -85,10 +79,18 @@ static inline void *prog_entry_arg(const struct prog *prog)
return prog->arg;
}
+/* region_device representing the 32-bit flat address space. */
+extern const struct mem_region_device addrspace_32bit;
+
+static inline void prog_memory_init(struct prog *prog, uintptr_t ptr,
+ size_t size)
+{
+ rdev_chain(&prog->rdev, &addrspace_32bit.rdev, ptr, size);
+}
+
static inline void prog_set_area(struct prog *prog, void *start, size_t size)
{
- prog->area.data = start;
- prog->area.size = size;
+ prog_memory_init(prog, (uintptr_t)start, size);
}
static inline void prog_set_entry(struct prog *prog, void *e, void *arg)
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 881cd99..7799994 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -35,6 +35,9 @@
#include <symbols.h>
#include <timestamp.h>
+/* Only can represent up to 1 byte less than size_t. */
+const struct mem_region_device addrspace_32bit = MEM_REGION_DEV_INIT(0, ~0UL);
+
#define DEFAULT_CBFS_LOADER_PRESENT \
(!ENV_VERSTAGE || (ENV_VERSTAGE && !CONFIG_RETURN_FROM_VERSTAGE))
the following patch was just integrated into master:
commit 920d17ca334e6e095798bebe7a092e1b6f01e12e
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Tue May 26 00:10:52 2015 +0300
AGESA: Halt on S3 resume failure
Change-Id: Ib6ac8ab3aca991fa623fedcd87a20470248d58e4
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/10298
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan(a)koparo.com>
See http://review.coreboot.org/10298 for details.
-gerrit
the following patch was just integrated into master:
commit 5fdb95e3df40b8ed201c0232481c4f1996f41deb
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Jan 1 17:51:51 2015 +0200
AGESA: Split S3 support file
Separate it to low-memory backup in romstage and MTRR recovery
in ramstage. How much of the MTRR part we really need will be
resolved later.
Change-Id: Ic64b3f74cf6ef0954eda6e84754745de81c465b2
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/8607
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan(a)koparo.com>
See http://review.coreboot.org/8607 for details.
-gerrit
the following patch was just integrated into master:
commit 300caced970febaa84357e60cee872553a872af5
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Tue Dec 16 19:50:47 2014 +0200
AGESA: Refactor OEM S3 storage
Use function prototypes that match more closely with the structure
of other OEM hooks in agesawrappers.
Change-Id: Id241fdce78a21a5138ef60ac2f841b694da92241
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/8606
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan(a)koparo.com>
See http://review.coreboot.org/8606 for details.
-gerrit
the following patch was just integrated into master:
commit 90a54b087419faf15bef27f5dbd57e79de667f99
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun May 24 09:06:03 2015 +0300
AGESA: Move S3 related SPI writes again
This is more agesawrapper-related code than CPU.
Change-Id: I3058ef965a83aed1972e02f0f566f81d5dbd7adf
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/10295
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <edward.ocallaghan(a)koparo.com>
See http://review.coreboot.org/10295 for details.
-gerrit
the following patch was just integrated into master:
commit 7138ee445c713867edd67c20fef10444f7aea6d1
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue May 26 11:26:34 2015 -0500
cbmem: remove cbmem_set_top()
Now that the users of cbmem_set_top() always provide a consistent
cbmem_top() value there's no need to have cbmem_set_top() around.
Therefore, delete it.
Change-Id: I0c96e2b8b829eddbeb1fdf755ed59c51ea689d1b
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: http://review.coreboot.org/10314
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/10314 for details.
-gerrit
the following patch was just integrated into master:
commit 1de648e272a7da523f05ca9d19226a308c1af852
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Tue May 26 06:46:41 2015 +0300
CBMEM console: Fix buffer without EARLY_CBMEM_INIT
On S3 resume, CBMEM_ID_CONSOLE from previous boot is found in ramstage,
even when romstage did not create it. So buffer did not get cleared
on S3 resume path.
Also do not allocate for preram_cbmem_console in CAR when there
are no means to back it up to ram.
Change-Id: I175cebbb938adf2a7414703fefffb8da796e9fa9
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/10301
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/10301 for details.
-gerrit
the following patch was just integrated into master:
commit e03441753ca775df4aacd0a15046d15001fed66e
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Tue May 26 06:23:02 2015 +0300
timestamp: Fix collection without EARLY_CBMEM_INIT
With LATE_CBMEM_INIT, do not search for the initial collection from
CBMEM in ramstage. On S3 resume this would find the non-empty
collection from previous run of ramstage. Start with an empty table
instead.
Remove a spurious error message as the stamps get stashed and
will be copied to CBMEM later.
Change-Id: Ib94049531c0ac23af25407bd2ca7644ee0163d69
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/10300
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See http://review.coreboot.org/10300 for details.
-gerrit