Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7214
-gerrit
commit 8efd704f7b93c302a6c8319a4fdb3e996092ff8b
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Apr 2 20:46:13 2014 -0500
baytrail: handle MRC being an ELF file
Provide the option to embed MRC as an ELF file and not just
binary blob. This allows for MRC to be relocated.
BUG=chrome-os-partner:27654
BRANCH=rambi
TEST=Built and booted rambi.
Change-Id: I2e177c155a3074e4e1d450b1a73b7299aebd5286
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192893
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
(cherry picked from commit 89c97d5e2023b8c5cc780e1b1d532d0a586512f9)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/soc/intel/baytrail/Makefile.inc | 8 +++++++-
src/soc/intel/baytrail/romstage/raminit.c | 15 +++++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/soc/intel/baytrail/Makefile.inc b/src/soc/intel/baytrail/Makefile.inc
index 94f3241..464b639 100644
--- a/src/soc/intel/baytrail/Makefile.inc
+++ b/src/soc/intel/baytrail/Makefile.inc
@@ -88,10 +88,16 @@ ifeq ($(CONFIG_HAVE_ME_BIN),y)
mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre
endif
+# If an MRC file is an ELF file determine the entry address and first loadable
+# section offset in the file. Subtract the offset from the entry address to
+# determine the final location.
+mrcelfoffset = $(shell readelf -S -W $(CONFIG_MRC_FILE) | sed -e 's/\[ /[0/' | awk '$$3 ~ /PROGBITS/ { print "0x"$$5; exit }' )
+mrcelfentry = $(shell readelf -h -W $(CONFIG_MRC_FILE) | grep 'Entry point address' | awk '{print $$NF }')
+
# Add memory reference code blob.
cbfs-files-$(CONFIG_HAVE_MRC) += mrc.bin
mrc.bin-file := $(call strip_quotes,$(CONFIG_MRC_FILE))
-mrc.bin-position := $(CONFIG_MRC_BIN_ADDRESS)
+mrc.bin-position := $(if $(findstring elf,$(CONFIG_MRC_FILE)),$(shell printf "0x%x" $$(( $(mrcelfentry) - $(mrcelfoffset) )) ),$(CONFIG_MRC_BIN_ADDRESS))
mrc.bin-type := 0xab
PHONY += baytrail_add_me
diff --git a/src/soc/intel/baytrail/romstage/raminit.c b/src/soc/intel/baytrail/romstage/raminit.c
index d5ee031..72d8e51 100644
--- a/src/soc/intel/baytrail/romstage/raminit.c
+++ b/src/soc/intel/baytrail/romstage/raminit.c
@@ -146,13 +146,20 @@ void raminit(struct mrc_params *mp, int prev_sleep_state)
#endif
}
- mrc_entry = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab,
- NULL);
-
- if (mrc_entry == NULL) {
+ /* Determine if mrc.bin is in the cbfs. */
+ if (cbfs_get_file_content(CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab, NULL) ==
+ NULL) {
printk(BIOS_DEBUG, "Couldn't find mrc.bin\n");
return;
}
+
+ /*
+ * The entry point is currently the first instruction. Handle the
+ * case of an ELF file being put in the cbfs by setting the entry
+ * to the CONFIG_MRC_BIN_ADDRESS.
+ */
+ mrc_entry = (void *)(uintptr_t)CONFIG_MRC_BIN_ADDRESS;
+
if (mp->mainboard.dram_info_location == DRAM_INFO_SPD_SMBUS)
enable_smbus();
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7212
-gerrit
commit a39ce9d4c4c20321be25364d2e347eba9ae170d8
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Mar 19 11:48:33 2014 -0500
baytrail: move cache-as-ram base address to 0xfe000000
Moving the cache-as-ram base address to 0xfe000000 will
provide more breathing room in the physical address space.
It will also allow for larger SPI roms in the future.
BUG=chrome-os-partner:27045
BRANCH=baytrail
CQ-DEPEND=CL:*157278
TEST=Built and booted. Suspended and resumes. Vboot works, MRC
settings are being saved as well.
Change-Id: I618c069e504f545e02de5ac54e057566f0b5d6c9
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/190700
Reviewed-by: Bernie Thompson <bhthompson(a)chromium.org>
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
(cherry picked from commit 73c07a319d678f3e9be2fac64599c94f91c9ad9c)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/soc/intel/baytrail/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/soc/intel/baytrail/Kconfig b/src/soc/intel/baytrail/Kconfig
index 3669c30..bc90b11 100644
--- a/src/soc/intel/baytrail/Kconfig
+++ b/src/soc/intel/baytrail/Kconfig
@@ -113,7 +113,7 @@ endif # HAVE_MRC
config DCACHE_RAM_BASE
hex
- default 0xff800000
+ default 0xfe000000
config DCACHE_RAM_SIZE
hex
the following patch was just integrated into master:
commit 2c9d2cf75c6b12132f1f2c43ef9c01b51f741d26
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Mon Oct 27 23:29:29 2014 +1100
{arch,cpu,drivers,ec}: Don't hide pointers behind typedefs
Change-Id: Id88bb4367d6045f6fbf185f0562ac72c04ee5f84
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
Reviewed-on: http://review.coreboot.org/7146
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/7146 for details.
-gerrit