Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35029 )
Change subject: soc/intel/{cnl, dnv, icl, skl}: Make top_of_ram align
......................................................................
soc/intel/{cnl, dnv, icl, skl}: Make top_of_ram align
This patch makes top_of_ram aligned in order to meet MTRR
alignment requirments.
Change-Id: I62d89cb35d8b5082d49c80aea55ac34dbb3b10ff
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/soc/intel/cannonlake/romstage/romstage.c
M src/soc/intel/denverton_ns/romstage.c
M src/soc/intel/icelake/romstage/romstage.c
M src/soc/intel/skylake/romstage/romstage_fsp20.c
4 files changed, 27 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/35029/1
diff --git a/src/soc/intel/cannonlake/romstage/romstage.c b/src/soc/intel/cannonlake/romstage/romstage.c
index 9e2f2f8..d83da7f 100644
--- a/src/soc/intel/cannonlake/romstage/romstage.c
+++ b/src/soc/intel/cannonlake/romstage/romstage.c
@@ -133,6 +133,7 @@
bool s3wake;
struct postcar_frame pcf;
uintptr_t top_of_ram;
+ const size_t top_of_ram_size = 16*MiB;
struct chipset_power_state *ps = pmc_get_power_state();
console_init();
@@ -155,12 +156,14 @@
* We need to make sure ramstage will be run cached. At this
* point exact location of ramstage in cbmem is not known.
* Instruct postcar to cache 16 megs under cbmem top which is
- * a safe bet to cover ramstage.
+ * a safe bet to cover ramstage. This satisfies MTRR alignment
+ * requirements as well.
*/
- top_of_ram = (uintptr_t) cbmem_top();
+ top_of_ram = ALIGN_DOWN((uintptr_t)cbmem_top(), top_of_ram_size);
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
- top_of_ram -= 16*MiB;
- postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+ top_of_ram -= top_of_ram_size;
+ postcar_frame_add_mtrr(&pcf, top_of_ram, top_of_ram_size,
+ MTRR_TYPE_WRBACK);
/* Cache the ROM as WP just below 4GiB. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
diff --git a/src/soc/intel/denverton_ns/romstage.c b/src/soc/intel/denverton_ns/romstage.c
index af65d38..0d8d4c8 100644
--- a/src/soc/intel/denverton_ns/romstage.c
+++ b/src/soc/intel/denverton_ns/romstage.c
@@ -142,6 +142,7 @@
struct postcar_frame pcf;
uintptr_t top_of_ram;
+ const size_t top_of_ram_size = 16*MiB;
console_init();
@@ -164,10 +165,12 @@
* We need to make sure ramstage will be run cached. At this point exact
* location of ramstage in cbmem is not known. Instruct postcar to cache
* 16 megs under cbmem top which is a safe bet to cover ramstage.
+ * This satisfies MTRR alignment requirements as well.
*/
- top_of_ram = (uintptr_t)cbmem_top();
- postcar_frame_add_mtrr(&pcf, top_of_ram - 16 * MiB, 16 * MiB,
- MTRR_TYPE_WRBACK);
+ top_of_ram = ALIGN_DOWN((uintptr_t)cbmem_top(), top_of_ram_size);
+ top_of_ram -= top_of_ram_size;
+ postcar_frame_add_mtrr(&pcf, top_of_ram, top_of_ram_size,
+ MTRR_TYPE_WRBACK);
/* Cache the memory-mapped boot media. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
diff --git a/src/soc/intel/icelake/romstage/romstage.c b/src/soc/intel/icelake/romstage/romstage.c
index 4d0cc17..a083788 100644
--- a/src/soc/intel/icelake/romstage/romstage.c
+++ b/src/soc/intel/icelake/romstage/romstage.c
@@ -117,6 +117,7 @@
bool s3wake;
struct postcar_frame pcf;
uintptr_t top_of_ram;
+ const size_t top_of_ram_size = 16*MiB;
struct chipset_power_state *ps = pmc_get_power_state();
console_init();
@@ -139,12 +140,14 @@
* We need to make sure ramstage will be run cached. At this
* point exact location of ramstage in cbmem is not known.
* Instruct postcar to cache 16 megs under cbmem top which is
- * a safe bet to cover ramstage.
+ * a safe bet to cover ramstage. This satisfies MTRR alignment
+ * requirements as well.
*/
- top_of_ram = (uintptr_t) cbmem_top();
+ top_of_ram = ALIGN_DOWN((uintptr_t)cbmem_top(), top_of_ram_size);
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
- top_of_ram -= 16*MiB;
- postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+ top_of_ram -= top_of_ram_size;
+ postcar_frame_add_mtrr(&pcf, top_of_ram, top_of_ram_size,
+ MTRR_TYPE_WRBACK);
/* Cache the ROM as WP just below 4GiB. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c
index 1d925b3..0977614 100644
--- a/src/soc/intel/skylake/romstage/romstage_fsp20.c
+++ b/src/soc/intel/skylake/romstage/romstage_fsp20.c
@@ -145,6 +145,7 @@
bool s3wake;
struct postcar_frame pcf;
uintptr_t top_of_ram;
+ const size_t top_of_ram_size = 16*MiB;
struct chipset_power_state *ps;
console_init();
@@ -166,12 +167,14 @@
* We need to make sure ramstage will be run cached. At this
* point exact location of ramstage in cbmem is not known.
* Instruct postcar to cache 16 megs under cbmem top which is
- * a safe bet to cover ramstage.
+ * a safe bet to cover ramstage. This satisfies MTRR alignment
+ * requirements as well.
*/
- top_of_ram = (uintptr_t) cbmem_top();
+ top_of_ram = ALIGN_DOWN((uintptr_t)cbmem_top(), top_of_ram_size);
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
- top_of_ram -= 16*MiB;
- postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+ top_of_ram -= top_of_ram_size;
+ postcar_frame_add_mtrr(&pcf, top_of_ram, top_of_ram_size,
+ MTRR_TYPE_WRBACK);
if (CONFIG(HAVE_SMI_HANDLER)) {
/* Cache the TSEG region. */
--
To view, visit https://review.coreboot.org/c/coreboot/+/35029
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I62d89cb35d8b5082d49c80aea55ac34dbb3b10ff
Gerrit-Change-Number: 35029
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34791 )
Change subject: soc/intel/cannonlake: Speed up postcar loading using intermediate caching
......................................................................
soc/intel/cannonlake: Speed up postcar loading using intermediate caching
This patch ensures intermediate caching is enabled to speed up
loading and decompression of next stage as we are still in romstage
and car tear down will be handled by next stage at its entry.
TEST=cbmem -t shows ~2-4ms time savings in warm reboot case with this
CL.
Change-Id: I3ba63887acb5c4bdeaf3e21c24fb0e631362962c
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/soc/intel/cannonlake/romstage/romstage.c
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/34791/1
diff --git a/src/soc/intel/cannonlake/romstage/romstage.c b/src/soc/intel/cannonlake/romstage/romstage.c
index 94b9899..04a9d53 100644
--- a/src/soc/intel/cannonlake/romstage/romstage.c
+++ b/src/soc/intel/cannonlake/romstage/romstage.c
@@ -127,6 +127,21 @@
printk(BIOS_DEBUG, "%d DIMMs found\n", mem_info->dimm_cnt);
}
+/*
+ * Make sure we are enabling intermediate caching to speed up next stage
+ * (postcar/romstage) loading and decompression as we are still in romstage
+ * and car tear down will be handled by next stage at its entry.
+ */
+static void enable_ramstage_caching(uintptr_t base, size_t size)
+{
+ int mtrr = get_free_var_mtrr();
+
+ if (mtrr == -1)
+ return;
+
+ set_var_mtrr(mtrr, base, size, MTRR_TYPE_WRPROT);
+}
+
asmlinkage void car_stage_entry(void)
{
bool s3wake;
@@ -160,6 +175,8 @@
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
top_of_ram -= 16*MiB;
postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+ /* enabling intermediate caching */
+ enable_ramstage_caching(top_of_ram, 16*MiB);
/* Cache the ROM as WP just below 4GiB. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
--
To view, visit https://review.coreboot.org/c/coreboot/+/34791
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3ba63887acb5c4bdeaf3e21c24fb0e631362962c
Gerrit-Change-Number: 34791
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34805 )
Change subject: arch/x86: Add postcar_frame_add_ramcache() API
......................................................................
arch/x86: Add postcar_frame_add_ramcache() API
This patch adds new API for intermediate caching top_of_ram
and setting up required MTRR for next stage.
Change-Id: Iddafb573afb4799de64754a94816d7f3f2f4982f
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/arch/x86/include/arch/cpu.h
M src/arch/x86/postcar_loader.c
2 files changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/34805/1
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 293ca02..7dc4049 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -329,6 +329,13 @@
void postcar_frame_add_romcache(struct postcar_frame *pcf, int type);
/*
+ * Add variable MTRR covering the Top of RAM with given MTRR type.
+ */
+void postcar_frame_add_ramcache(struct postcar_frame *pcf,
+ uintptr_t addr, size_t size, int type);
+
+
+/*
* Push used MTRR and Max MTRRs on to the stack
* and return pointer to stack top.
*/
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index 35e139f..8a1f6cb 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -120,6 +120,29 @@
postcar_frame_add_mtrr(pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, type);
}
+/*
+ * Make sure we are enabling intermediate caching to speed up next stage
+ * (postcar/romstage) loading and decompression as we are still in romstage
+ * and CAR tear down will be handled by next stage at its entry.
+ */
+static void enable_top_of_ram_cache(uintptr_t base, size_t size)
+{
+ int mtrr = get_free_var_mtrr();
+
+ if (mtrr == -1)
+ return;
+
+ set_var_mtrr(mtrr, base, size, MTRR_TYPE_WRPROT);
+}
+
+void postcar_frame_add_ramcache(struct postcar_frame *pcf,
+ uintptr_t addr, size_t size, int type)
+{
+ /* enable intermediate caching for Top of RAM */
+ enable_top_of_ram_cache(addr, size);
+ postcar_frame_add_mtrr(pcf, addr, size, type);
+}
+
void *postcar_commit_mtrrs(struct postcar_frame *pcf)
{
/*
--
To view, visit https://review.coreboot.org/c/coreboot/+/34805
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iddafb573afb4799de64754a94816d7f3f2f4982f
Gerrit-Change-Number: 34805
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30747
Change subject: cpu/amd/microcode: Search all containers
......................................................................
cpu/amd/microcode: Search all containers
Currently, it’s aborted if the first file is not found.
The commit was only tested with all microcode containers present in
CBFS.
If only one microcode update container is present, which is not the
first, it is skipped.
Change the return to continue to traverse all elements.
Fixes: 83e4c5613 (cpu/amd/microcode: Update parser to use stock microcode blobs)
Change-Id: I5195ff0334cf49cadc25de31822a9f2f2cd90490
Signed-off-by: Paul Menzel <pmenzel(a)molgen.mpg.de>
---
M src/cpu/amd/microcode/microcode.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/30747/1
diff --git a/src/cpu/amd/microcode/microcode.c b/src/cpu/amd/microcode/microcode.c
index e8ab175..622c6db 100644
--- a/src/cpu/amd/microcode/microcode.c
+++ b/src/cpu/amd/microcode/microcode.c
@@ -214,7 +214,7 @@
spin_unlock(romstage_microcode_cbfs_lock());
#endif
#endif
- return;
+ continue;
}
amd_update_microcode(ucode, ucode_len, equivalent_processor_rev_id);
--
To view, visit https://review.coreboot.org/c/coreboot/+/30747
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5195ff0334cf49cadc25de31822a9f2f2cd90490
Gerrit-Change-Number: 30747
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
Pavel Sayekat has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35011 )
Change subject: Doc/mb/asus: Add H110M-E/M.2 Documentation
......................................................................
Doc/mb/asus: Add H110M-E/M.2 Documentation
Followed and adapted from the ASRock H110M-DVS Documentation
Signed-off-by: Pavel Sayekat <pavelsayekat(a)gmail.com>
Change-Id: I6c5aad50b513935eab70b502df1d95fb3413fa6b
---
A Documentation/mainboard/asus/h110m-e_m2.md
1 file changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/35011/1
diff --git a/Documentation/mainboard/asus/h110m-e_m2.md b/Documentation/mainboard/asus/h110m-e_m2.md
new file mode 100644
index 0000000..134dca8
--- /dev/null
+++ b/Documentation/mainboard/asus/h110m-e_m2.md
@@ -0,0 +1,136 @@
+# ASUS H110M-E/M.2
+
+This page describes how to run coreboot on the [ASUS H110M-E/M.2].
+
+## Required proprietary blobs
+
+Mainboard is based on Intel Skylake/Kaby Lake processor and H110 Chipset.
+Intel company provides [Firmware Support Package (2.0)](../../soc/intel/fsp/index.md)
+(intel FSP 2.0) to initialize this generation silicon. Please see this
+[document](../../soc/intel/code_development_model/code_development_model.md).
+
+FSP Information:
+
+```eval_rst
++-----------------------------+-------------------+-------------------+
+| FSP Project Name | Directory | Specification |
++-----------------------------+-------------------+-------------------+
+| 7th Generation Intel® Core™ | KabylakeFspBinPkg | 2.0 |
+| processors and chipsets | | |
+| (formerly Kaby Lake) | | |
++-----------------------------+-------------------+-------------------+
+```
+
+## Building coreboot
+
+The following steps set the default parameters for this board to build a
+fully working image:
+
+```bash
+make distclean
+touch .config
+./util/scripts/config --enable VENDOR_ASUS
+./util/scripts/config --enable BOARD_ASUS_H110M_E_M2
+./util/scripts/config --enable CONFIG_ADD_FSP_BINARIES
+./util/scripts/config --enable CONFIG_FSP_USE_REPO
+./util/scripts/config --set-str REALTEK_8168_MACADDRESS "xx:xx:xx:xx:xx:xx"
+make olddefconfig
+```
+
+However, it is strongly advised to use `make menuconfig` afterwards
+(or instead), so that you can see all of the settings.
+
+Use the following command to disable the serial console if debugging
+output is not required:
+
+```bash
+./util/scripts/config --disable CONSOLE_SERIAL
+```
+
+However, a more flexible method is to change the console log level from
+within an OS using `util/nvramtool`, or with the `nvramcui` payload.
+
+Now, run `make` to build the coreboot image.
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. By default, only
+the BIOS region of the flash is writable. If you wish to change any
+other region, such as the Management Engine or firmware descriptor, then
+an external programmer is required (unless you find a clever way around
+the flash protection). More information about this [here](../../flash_tutorial/index.md).
+
+### External programming
+
+The flash chip is a 16 MiB socketed DIP-8 chip. Specifically, it's a
+GIgaDevice GD25B128CPIG, whose datasheet can be found [here][GD25B128CPIG].
+The chip is located to the bottom right-hand side of the board. For
+a precise location, refer to section 1.3 (Motherboard Layout) of the
+[H110M-E/M.2 manual], where the chip is labelled "128Mb BIOS". Take note of
+the chip's orientation, remove it from its socket, and flash it with
+an external programmer. For reference, the notch in the chip should be
+facing towards the bottom of the board.
+
+## Known issues
+
+- The VGA port doesn't work. Discrete graphic card is used as primary
+ device for display output (if CONFIG_ONBOARD_VGA_IS_PRIMARY is not
+ set). Dynamic switching between iGPU and PEG is not yet supported.
+
+- SuperIO GPIO pin is used to reset Realtek chip. However, since the
+ Logical Device 7 (GPIO7, GPIO8) is not initialized, the network
+ chip is in a reset state all the time.
+
+## Untested
+
+- parallel port
+- PS/2 keyboard
+- PS/2 mouse
+- EHCI debug
+- TPM
+- infrared module
+- chassis intrusion header
+- chassis speaker header
+
+## Working
+
+- integrated graphics init with libgfxinit (see [Known issues](#known-issues))
+- PCIe x1
+- PEG x16 Gen3
+- SATA
+- USB
+- serial port
+- onboard audio
+- using `me_cleaner`
+- using `flashrom`
+
+## TODO
+
+- NCT5539D GPIOs
+- onboard network (see [Known issues](#known-issues))
+- S3 suspend/resume
+- Wake-on-LAN
+- hardware monitor
+
+## Technology
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Skylake/Kaby Lake (LGA1151) |
++------------------+--------------------------------------------------+
+| PCH | Intel Sunrise Point H110 |
++------------------+--------------------------------------------------+
+| Super I/O | Nuvoton NCT5539D |
++------------------+--------------------------------------------------+
+| EC | None |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+[ASUS H110M-E/M.2]: https://www.asus.com/Motherboards/H110M-E-M-2/overview/
+[GD25B128CPIG]: https://www.gigadevice.com/datasheet/gd25b127d/ [The closest match found]
+[flashrom]: https://flashrom.org/Flashrom
+[ASUS H110M-E/M.2 manual]: https://dlcdnets.asus.com/pub/ASUS/mb/LGA1151/H110M-E_M2/E11622_H110M-E_M2_…
--
To view, visit https://review.coreboot.org/c/coreboot/+/35011
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6c5aad50b513935eab70b502df1d95fb3413fa6b
Gerrit-Change-Number: 35011
Gerrit-PatchSet: 1
Gerrit-Owner: Pavel Sayekat
Gerrit-MessageType: newchange