the following patch was just integrated into master:
commit 7454bdf3e28bce0e4bce597885cc69f6a5114f75
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Fri Mar 15 10:47:50 2013 +0100
vendorcode/amd/agesa/*/AGESA.h: Correct "ne" to "be" in comment
The typo is not present anymore in Family 16h (Kabini), so fix it for
the older families (Family 10h, 12h, 14h, 15h, 15h Trinity) too using
the command below.
$ git grep -l ' ne ' src/vendorcode/amd/agesa | xargs sed -i 's/ ne / be /g'
Change-Id: I9cb419251eeec79925f48a5832fac339d40f01d1
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/5543
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See https://review.coreboot.org/5543 for details.
-gerrit
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14211
-gerrit
commit 2dd9fcf665c422970483905579fc5ea6d3bbb5f9
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 12:48:30 2016 -0500
drivers/intel/fsp2_0: signal that FSP components are loaded
In order for the platform code to handle situations where
special actions are required after a piece of code is loaded
use arch_segment_loaded() to signal to the platform code
that the component is fully loaded into memory.
Change-Id: I119cfc9913f15eb4968fe5bf6a56589e2c53f2d1
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/drivers/intel/fsp2_0/util.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index a234a7c..c4fe8dc 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -17,6 +17,7 @@
#include <fsp/util.h>
#include <lib.h>
#include <memrange.h>
+#include <program_loading.h>
#include <string.h>
static bool looks_like_fsp_header(const uint8_t *raw_hdr)
@@ -130,5 +131,8 @@ enum cb_err fsp_load_binary(struct fsp_header *hdr,
if (rdev_readat(&file_data, (void *)hdr->image_base, 0, hdr->image_size) < 0)
return CB_ERR;
+ /* Signal that FSP component has been loaded. */
+ arch_segment_loaded(hdr->image_base, hdr->image_size, SEG_FINAL);
+
return CB_SUCCESS;
}
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14210
-gerrit
commit fa0913fde1b676de9cc31cd3091c48c4da2636f7
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 11:38:13 2016 -0500
soc/intel/apollolake: use CAR code coherency for all CAR stages
The flush L1D to L2 operation was only being used when loading
romstage from bootblock. However, when the FSP-M component is
loaded no code coherency actions are taken. I suspect this is
because the FSP-M component is larger than the 24KiB L1D and
the entry point is early in the image. Thus, when loading
the FSP-M component the earlier part of the image is flushed
out to L2 in the process of loading the latter part of the
component. Also, once verstage is introduced the same
code coherency actions need to be taken as well. Therefore,
position the apollolake code to handle all these cases.
Change-Id: Ie71764f1b420a6072c4f149ad3e37278b6cb70e1
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/soc/intel/apollolake/Makefile.inc | 2 ++
src/soc/intel/apollolake/bootblock/bootblock.c | 9 -------
src/soc/intel/apollolake/car.c | 33 ++++++++++++++++++++++++++
3 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 41ac847..70ab515 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -11,6 +11,7 @@ subdirs-y += ../../../cpu/x86/cache
bootblock-y += bootblock/bootblock.c
bootblock-y += bootblock/cache_as_ram.S
bootblock-y += bootblock/bootblock.c
+bootblock-y += car.c
bootblock-y += gpio.c
bootblock-y += mmap_boot.c
bootblock-y += placeholders.c
@@ -18,6 +19,7 @@ bootblock-y += tsc_freq.c
bootblock-$(CONFIG_SOC_UART_DEBUG) += uart_early.c
romstage-y += placeholders.c
+romstage-y += car.c
romstage-$(CONFIG_PLATFORM_USES_FSP2_0) += romstage.c
romstage-y += gpio.c
romstage-$(CONFIG_SOC_UART_DEBUG) += uart_early.c
diff --git a/src/soc/intel/apollolake/bootblock/bootblock.c b/src/soc/intel/apollolake/bootblock/bootblock.c
index 4ea3f70..a9258e1 100644
--- a/src/soc/intel/apollolake/bootblock/bootblock.c
+++ b/src/soc/intel/apollolake/bootblock/bootblock.c
@@ -12,7 +12,6 @@
#include <arch/cpu.h>
#include <bootblock_common.h>
#include <device/pci.h>
-#include <program_loading.h>
#include <soc/bootblock.h>
#include <soc/cpu.h>
#include <soc/northbridge.h>
@@ -36,14 +35,6 @@ void asmlinkage bootblock_c_entry(void)
main();
}
-void platform_prog_run(struct prog *prog)
-{
- /* Flush L1D cache to L2 */
- msr_t msr = rdmsr(MSR_POWER_MISC);
- msr.lo |= (1 << 8);
- wrmsr(MSR_POWER_MISC, msr);
-}
-
void bootblock_soc_early_init(void)
{
/* Prepare UART for serial console. */
diff --git a/src/soc/intel/apollolake/car.c b/src/soc/intel/apollolake/car.c
new file mode 100644
index 0000000..7646865
--- /dev/null
+++ b/src/soc/intel/apollolake/car.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corp.
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <arch/cpu.h>
+#include <program_loading.h>
+#include <soc/cpu.h>
+
+/*
+ * This file supports the necessary hoops one needs to jump through since
+ * early FSP component and early stages are running from cache-as-ram.
+ */
+
+static void flush_l1d_to_l2(void)
+{
+ msr_t msr = rdmsr(MSR_POWER_MISC);
+ msr.lo |= (1 << 8);
+ wrmsr(MSR_POWER_MISC, msr);
+}
+
+void platform_prog_run(struct prog *prog)
+{
+ /* Flush L1D cache to L2 */
+ flush_l1d_to_l2();
+}
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14215
-gerrit
commit 721019cdc709d2af21a67b732b6f691f0c34f983
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 14:00:47 2016 -0500
soc/intel/apollolake: use platform_segment_loaded() for CAR coherency
Instead of using arch_segment_loaded() implement
platform_segment_loaded() so as not to tangle the notion of
arch and the chipset. Lastly, add a TODO to allow filtering
of the L1D to L2 flush depending on the region loaded.
Change-Id: I52e7cd2ae6e2d95f21bdd2fe1a471a10565309cb
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/soc/intel/apollolake/car.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/soc/intel/apollolake/car.c b/src/soc/intel/apollolake/car.c
index c49d7ef..b0a5b45 100644
--- a/src/soc/intel/apollolake/car.c
+++ b/src/soc/intel/apollolake/car.c
@@ -26,8 +26,10 @@ static void flush_l1d_to_l2(void)
wrmsr(MSR_POWER_MISC, msr);
}
-void arch_segment_loaded(uintptr_t start, size_t size, int flags)
+void platform_segment_loaded(uintptr_t start, size_t size, int flags)
{
+ /* TODO: filter on address to see if L1D flushing required. */
+
/* Flush L1D cache to L2 on final segment loaded */
if (flags & SEG_FINAL)
flush_l1d_to_l2();
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14214
-gerrit
commit 68075825335d9f15fd9bdf15ca7ba32d0078f379
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 13:49:00 2016 -0500
lib/prog_loading: introduce prog_segment_loaded()
In order to not muddle arch vs chipset implementations provide
a generic prog_segment_loaded() which calls platform_segment_loaded()
and arch_segment_loaded() in that order. This allows the arch variants
to live in src/arch while the chipset/platform code can implement
their own.
Change-Id: I17b6497219ec904d92bd286f18c9ec96b2b7af25
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/postcar_loader.c | 2 +-
src/drivers/intel/fsp2_0/util.c | 2 +-
src/include/program_loading.h | 11 +++++++++--
src/lib/cbfs.c | 2 +-
src/lib/prog_ops.c | 12 ++++++++++++
src/lib/rmodule.c | 2 +-
src/lib/selfboot.c | 2 +-
7 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index eba90d4..cc1d460 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -115,7 +115,7 @@ void run_postcar_phase(struct postcar_frame *pcf)
* Signal to rest of system that another update was made to the
* postcar program prior to running it.
*/
- arch_segment_loaded((uintptr_t)rsl.params, sizeof(uintptr_t),
+ prog_segment_loaded((uintptr_t)rsl.params, sizeof(uintptr_t),
SEG_FINAL);
prog_run(&prog);
diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c
index c4fe8dc..743bc9a 100644
--- a/src/drivers/intel/fsp2_0/util.c
+++ b/src/drivers/intel/fsp2_0/util.c
@@ -132,7 +132,7 @@ enum cb_err fsp_load_binary(struct fsp_header *hdr,
return CB_ERR;
/* Signal that FSP component has been loaded. */
- arch_segment_loaded(hdr->image_base, hdr->image_size, SEG_FINAL);
+ prog_segment_loaded(hdr->image_base, hdr->image_size, SEG_FINAL);
return CB_SUCCESS;
}
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 8ac73dd..42addb8 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -37,8 +37,15 @@ enum prog_type {
PROG_BL32,
};
-/* Called for each segment of a program loaded. The SEG_FINAL flag will be
- * set on the last segment loaded. */
+/*
+ * prog_segment_loaded() is called for each segment of a program loaded. The
+ * SEG_FINAL flag will be set on the last segment loaded. The following two
+ * functions, platform_segment_loaded() and arch_segment_loaded(), are called
+ * in that order within prog_segment_loaded(). In short, rely on
+ * prog_segment_loaded() to perform the proper dispatch sequence.
+ */
+void prog_segment_loaded(uintptr_t start, size_t size, int flags);
+void platform_segment_loaded(uintptr_t start, size_t size, int flags);
void arch_segment_loaded(uintptr_t start, size_t size, int flags);
/* Return true if arch supports bounce buffer. */
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 82bfa2d..e1626d7 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -206,7 +206,7 @@ int cbfs_prog_stage_load(struct prog *pstage)
/* Clear area not covered by file. */
memset(&load[fsize], 0, stage.memlen - fsize);
- arch_segment_loaded((uintptr_t)load, stage.memlen, SEG_FINAL);
+ prog_segment_loaded((uintptr_t)load, stage.memlen, SEG_FINAL);
out:
prog_set_area(pstage, load, stage.memlen);
diff --git a/src/lib/prog_ops.c b/src/lib/prog_ops.c
index 67bdcc0..bc889fc 100644
--- a/src/lib/prog_ops.c
+++ b/src/lib/prog_ops.c
@@ -17,6 +17,18 @@
#include <program_loading.h>
/* For each segment of a program loaded this function is called*/
+void prog_segment_loaded(uintptr_t start, size_t size, int flags)
+{
+ platform_segment_loaded(start, size, flags);
+ arch_segment_loaded(start, size, flags);
+}
+
+void __attribute__ ((weak)) platform_segment_loaded(uintptr_t start,
+ size_t size, int flags)
+{
+ /* do nothing */
+}
+
void __attribute__ ((weak)) arch_segment_loaded(uintptr_t start, size_t size,
int flags)
{
diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c
index 9825e6a..7043157 100644
--- a/src/lib/rmodule.c
+++ b/src/lib/rmodule.c
@@ -197,7 +197,7 @@ int rmodule_load(void *base, struct rmodule *module)
return -1;
rmodule_clear_bss(module);
- arch_segment_loaded((uintptr_t)module->location,
+ prog_segment_loaded((uintptr_t)module->location,
rmodule_memory_size(module), SEG_FINAL);
return 0;
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index 7d3e2dd..23eda14 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -452,7 +452,7 @@ static int load_self_segments(
* Each architecture can perform additonal operations
* on the loaded segment
*/
- arch_segment_loaded((uintptr_t)dest, ptr->s_memsz,
+ prog_segment_loaded((uintptr_t)dest, ptr->s_memsz,
last_non_empty == ptr ? SEG_FINAL : 0);
}
}
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14213
-gerrit
commit 040b3369ba7927f16c4f57d960e551b7ba92f1e9
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 13:36:33 2016 -0500
arch/x86: notify the system when the postcar parameter was updated
While rmodule_load() calls arch_segment_loaded() when it's done
loading any pieces of code which further modify it, like changing
parameters within the program itself, need to notify the rest of
the system.
Change-Id: Ia3374b58488120ba6279592a77d7f9c6217f1215
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/arch/x86/postcar_loader.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index 580cc45..eba90d4 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -111,5 +111,12 @@ void run_postcar_phase(struct postcar_frame *pcf)
*(uintptr_t *)rsl.params = pcf->stack;
+ /*
+ * Signal to rest of system that another update was made to the
+ * postcar program prior to running it.
+ */
+ arch_segment_loaded((uintptr_t)rsl.params, sizeof(uintptr_t),
+ SEG_FINAL);
+
prog_run(&prog);
}
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14212
-gerrit
commit 942a9ff655ccc823149f0c5021bab8e7a1a1cb2b
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Mar 31 13:26:46 2016 -0500
soc/intel/apollolake: use arch_segment_loaded() for CAR code coherency
Instead of using platform_prog_run() for flushing programs
from L1D to L2 for code coherency purposes use arch_segment_loaded()
instead as that it's primary purpose. The arch_segment_loaded()
is called within the infrastructure at the appropriate places when
loading programs. Therefore use that to perform the L1D flush
instead of when something is just about to run.
Change-Id: Ib0a6be6f676dcf2c946ef5702471af65d89133e9
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/soc/intel/apollolake/car.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/soc/intel/apollolake/car.c b/src/soc/intel/apollolake/car.c
index 7646865..c49d7ef 100644
--- a/src/soc/intel/apollolake/car.c
+++ b/src/soc/intel/apollolake/car.c
@@ -26,8 +26,9 @@ static void flush_l1d_to_l2(void)
wrmsr(MSR_POWER_MISC, msr);
}
-void platform_prog_run(struct prog *prog)
+void arch_segment_loaded(uintptr_t start, size_t size, int flags)
{
- /* Flush L1D cache to L2 */
- flush_l1d_to_l2();
+ /* Flush L1D cache to L2 on final segment loaded */
+ if (flags & SEG_FINAL)
+ flush_l1d_to_l2();
}