Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36569 )
Change subject: soc/intel/skylake: add soc implementation for ETR address API
......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36569/4/src/soc/intel/skylake/pmut…
File src/soc/intel/skylake/pmutil.c:
https://review.coreboot.org/c/coreboot/+/36569/4/src/soc/intel/skylake/pmut…
PS4, Line 178: pcicfg(PCH_DEVFN_PMC << 12)->reg32[ETR / sizeof(uint32_t)];
: }
> That should not be exposed outside of pci_mmio_cfg.h. […]
this was requested by Aaron
--
To view, visit https://review.coreboot.org/c/coreboot/+/36569
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iae54af09347d693620b631721576e4b916ea0f0f
Gerrit-Change-Number: 36569
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 23:44:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: comment
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36589 )
Change subject: cpu/x86/smm: Add helper functions to deal with different save states
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36589/1/src/cpu/x86/smm/smihelper.c
File src/cpu/x86/smm/smihelper.c:
https://review.coreboot.org/c/coreboot/+/36589/1/src/cpu/x86/smm/smihelper.…
PS1, Line 33: return EM64T;
code indent should use tabs where possible
--
To view, visit https://review.coreboot.org/c/coreboot/+/36589
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I85325a25dc38d7cfc7eb0dfde621e5ebfeef0e15
Gerrit-Change-Number: 36589
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 22:32:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36570 )
Change subject: soc/intel/common: pmclib: make use of the new ETR address API
......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36570/4/src/soc/intel/common/block…
File src/soc/intel/common/block/pmc/pmclib.c:
https://review.coreboot.org/c/coreboot/+/36570/4/src/soc/intel/common/block…
PS4, Line 432: void pmc_global_reset_lock(void)
: {
: uint32_t *etr = soc_read_pmc_etr_addr();
: uint32_t reg;
:
: reg = read32(etr);
: reg = (reg & ~CF9_GLB_RST) | CF9_LOCK;
: write32(etr, reg);
: }
Is it really worth it to have a function and callback for something that can be written down in 1 or 2 lines of code?
--
To view, visit https://review.coreboot.org/c/coreboot/+/36570
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I49f59efb4a7c7d3d629ac54a7922bbcc8a87714d
Gerrit-Change-Number: 36570
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 20:42:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36569 )
Change subject: soc/intel/skylake: add soc implementation for ETR address API
......................................................................
Patch Set 4: Code-Review-1
(1 comment)
https://review.coreboot.org/c/coreboot/+/36569/4/src/soc/intel/skylake/pmut…
File src/soc/intel/skylake/pmutil.c:
https://review.coreboot.org/c/coreboot/+/36569/4/src/soc/intel/skylake/pmut…
PS4, Line 178: pcicfg(PCH_DEVFN_PMC << 12)->reg32[ETR / sizeof(uint32_t)];
: }
That should not be exposed outside of pci_mmio_cfg.h. Why not use the regular pci ops?
--
To view, visit https://review.coreboot.org/c/coreboot/+/36569
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iae54af09347d693620b631721576e4b916ea0f0f
Gerrit-Change-Number: 36569
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 20:32:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35993 )
Change subject: cpu/x86: Add a prog_run hook to set up caching of XIP stages
......................................................................
cpu/x86: Add a prog_run hook to set up caching of XIP stages
Some platforms lack a non-eviction mode and therefore caching the
whole ROM to speed up XIP stages can be dangerous as it could result
in eviction if too much of the ROM is being accessed. The solution is
to only cache a region, about the size of the stage that the bootblock
is about to load: verstage and/or romstage.
CR0.CD bits are not touched to do this, but this seems to work just
fine on at least model_1067x and model_6ex.
Change-Id: I94d5771a57ffd74d53db3e35fe169d77d7fbb8cd
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/x86/Kconfig
M src/cpu/x86/mtrr/Makefile.inc
A src/cpu/x86/mtrr/xip_cache.c
3 files changed, 73 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/35993/1
diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig
index a8cf54d..b316c1f 100644
--- a/src/cpu/x86/Kconfig
+++ b/src/cpu/x86/Kconfig
@@ -78,6 +78,16 @@
depends on !NO_FIXED_XIP_ROM_SIZE
default 0x10000
+config SETUP_XIP_CACHE
+ bool
+ depends on C_ENVIRONMENT_BOOTBLOCK
+ depends on !NO_XIP_EARLY_STAGES
+ help
+ Select this option to set up an MTRR to cache XIP stages loaded
+ from the bootblock. This is useful on platforms lacking a
+ non-eviction mode and therefore need to be careful to avoid
+ eviction.
+
config CPU_ADDR_BITS
int
default 36
diff --git a/src/cpu/x86/mtrr/Makefile.inc b/src/cpu/x86/mtrr/Makefile.inc
index caa6e9c..dc914de 100644
--- a/src/cpu/x86/mtrr/Makefile.inc
+++ b/src/cpu/x86/mtrr/Makefile.inc
@@ -7,3 +7,5 @@
romstage-y += debug.c
postcar-y += debug.c
ramstage-y += debug.c
+
+bootblock-$(CONFIG_SETUP_XIP_CACHE) += xip_cache.c
diff --git a/src/cpu/x86/mtrr/xip_cache.c b/src/cpu/x86/mtrr/xip_cache.c
new file mode 100644
index 0000000..a45944b
--- /dev/null
+++ b/src/cpu/x86/mtrr/xip_cache.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/cpu.h>
+#include <program_loading.h>
+#include <commonlib/region.h>
+#include <console/console.h>
+#include <cpu/x86/mtrr.h>
+
+#define MAX_ROM_CACHE_SIZE (256 * KiB)
+
+void platform_prog_run(struct prog *prog)
+{
+ uint32_t base = region_device_offset(&prog->rdev);
+ uint32_t size = region_device_sz(&prog->rdev);
+ uint32_t end = base + size;
+ int mtrr_num = get_free_var_mtrr();
+ uint32_t mtrr_mask_size = 4 * KiB;
+ struct cpuinfo_x86 cpu_info;
+
+ get_fms(&cpu_info, cpuid_eax(1));
+ if (cpu_info.x86 == 0xf) {
+ printk(BIOS_DEBUG,
+ "PROG_RUN: CPU does not support caching ROM\n"
+ "The next stage will run slowly\n");
+ return;
+ }
+
+ if (mtrr_num == -1) {
+ printk(BIOS_NOTICE,
+ "PROG_RUN: No MTRR available to cache ROM!\n"
+ "The next stage will run slowly!\n");
+ return;
+ }
+
+ while (ALIGN_DOWN(base, mtrr_mask_size) + mtrr_mask_size < end)
+ mtrr_mask_size *= 2;
+ base = ALIGN_DOWN(base, mtrr_mask_size);
+ if (mtrr_mask_size > MAX_ROM_CACHE_SIZE) {
+ printk(BIOS_WARNING,
+ "PROG_RUN: %dKiB XIP cache requested but limiting to %dKiB!",
+ mtrr_mask_size, MAX_ROM_CACHE_SIZE);
+ mtrr_mask_size = MAX_ROM_CACHE_SIZE;
+ }
+
+ printk(BIOS_DEBUG,
+ "PROG_RUN: Setting MTRR to cache XIP stage. base: 0x%08x, size: 0x%08x\n",
+ base, mtrr_mask_size);
+
+ set_var_mtrr(mtrr_num, base, mtrr_mask_size, MTRR_TYPE_WRPROT);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/35993
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I94d5771a57ffd74d53db3e35fe169d77d7fbb8cd
Gerrit-Change-Number: 35993
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36573 )
Change subject: soc/intel/skylake: lockdown: lock global reset
......................................................................
Uploaded patch set 6: Commit message was updated.
--
To view, visit https://review.coreboot.org/c/coreboot/+/36573
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If190c3c66889ede105d958b423b38ebdcb698332
Gerrit-Change-Number: 36573
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 17:30:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello Kyösti Mälkki, Aaron Durbin, Patrick Rudolph, Subrata Banik, Angel Pons, Arthur Heymans, build bot (Jenkins), Nico Huber, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36573
to look at the new patch set (#6).
Change subject: soc/intel/skylake: lockdown: lock global reset
......................................................................
soc/intel/skylake: lockdown: lock global reset
There are four chipsets selecting PMC_GLOBAL_RESET_ENABLE_LOCK but only
one (apollolake) is actually calling the code. Add the missing call.
Also fix the register offset in a comment in reset code.
Tested successfully on X11SSM-F by reading ETR3.
Change-Id: If190c3c66889ede105d958b423b38ebdcb698332
Signed-off-by: Michael Niewöhner <foss(a)mniewoehner.de>
---
M src/soc/intel/skylake/lockdown.c
M src/soc/intel/skylake/reset.c
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/36573/6
--
To view, visit https://review.coreboot.org/c/coreboot/+/36573
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If190c3c66889ede105d958b423b38ebdcb698332
Gerrit-Change-Number: 36573
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36565 )
Change subject: soc/intel/common: pmclib: add API to get ETR register address
......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36565/3/src/soc/intel/common/block…
File src/soc/intel/common/block/include/intelblocks/pmclib.h:
https://review.coreboot.org/c/coreboot/+/36565/3/src/soc/intel/common/block…
PS3, Line 173: mmconf
> It's still only MMCONF on SKL.
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/36565
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I706f3e220d639a6133625e3cb7267f7009006af2
Gerrit-Change-Number: 36565
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 17:29:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36573 )
Change subject: soc/intel/skylake: lockdown: lock global reset
......................................................................
Uploaded patch set 5: Patch Set 4 was rebased.
--
To view, visit https://review.coreboot.org/c/coreboot/+/36573
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If190c3c66889ede105d958b423b38ebdcb698332
Gerrit-Change-Number: 36573
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 02 Nov 2019 17:29:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment