Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick
......................................................................
x86: Prevent Kconfig errors resulting in a brick
Always select USE_LEGACY_8254_TIMER if we know we have to.
Fixes boot failure (Linux kernel/GRUB2 hangs with no console output)
on X11SSH-TF using SeaBIOS as payload.
Change-Id: Ica0c20255f661dd61edc3a7d15646b7447c4658e
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M payloads/external/GRUB2/Kconfig.name
M payloads/external/SeaBIOS/Kconfig.name
M src/device/Kconfig
M src/soc/intel/common/block/timer/Kconfig
4 files changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/34709/1
diff --git a/payloads/external/GRUB2/Kconfig.name b/payloads/external/GRUB2/Kconfig.name
index fe60d76..40629ad 100644
--- a/payloads/external/GRUB2/Kconfig.name
+++ b/payloads/external/GRUB2/Kconfig.name
@@ -1,6 +1,7 @@
config PAYLOAD_GRUB2
bool "GRUB2"
depends on ARCH_X86 || ARCH_ARM
+ select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
help
Select this option if you want to build a coreboot image
with a GRUB2 payload. If you don't know what this is
diff --git a/payloads/external/SeaBIOS/Kconfig.name b/payloads/external/SeaBIOS/Kconfig.name
index bb1f30c..8f92997 100644
--- a/payloads/external/SeaBIOS/Kconfig.name
+++ b/payloads/external/SeaBIOS/Kconfig.name
@@ -1,6 +1,7 @@
config PAYLOAD_SEABIOS
bool "SeaBIOS"
depends on ARCH_X86
+ select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
help
Select this option if you want to build a coreboot image
with a SeaBIOS payload. If you don't know what this is
diff --git a/src/device/Kconfig b/src/device/Kconfig
index e605bc2..ebf6bfb 100644
--- a/src/device/Kconfig
+++ b/src/device/Kconfig
@@ -86,6 +86,7 @@
bool "Run VGA Option ROMs"
depends on PCI && (ARCH_X86 || ARCH_PPC64) && !MAINBOARD_FORCE_NATIVE_VGA_INIT
select HAVE_VGA_TEXT_FRAMEBUFFER
+ select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
help
Execute VGA Option ROMs in coreboot if found. This can be used
to enable PCI/AGP/PCI-E video cards when not using a SeaBIOS
diff --git a/src/soc/intel/common/block/timer/Kconfig b/src/soc/intel/common/block/timer/Kconfig
index a214ef0..66bf9cf 100644
--- a/src/soc/intel/common/block/timer/Kconfig
+++ b/src/soc/intel/common/block/timer/Kconfig
@@ -5,7 +5,6 @@
config USE_LEGACY_8254_TIMER
bool "Use Legacy 8254 Timer"
- default y if PAYLOAD_SEABIOS || VGA_ROM_RUN
default n
help
This sets the FSP UPD to enable Legacy 8254 clock gating. As per
--
To view, visit https://review.coreboot.org/c/coreboot/+/34709
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ica0c20255f661dd61edc3a7d15646b7447c4658e
Gerrit-Change-Number: 34709
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32020
Change subject: [WIP]x86: Introduce the blobolator
......................................................................
[WIP]x86: Introduce the blobolator
This is a PoC to run arbitrary code and blobs inside an emulated
virtual machine using libx86emu, thus the name blobolator.
The libx86emu has been patched to the following:
* redirect IO to the host machine it's running on
* trace IO
* start in protected mode
* add mechanism to drop IO access
* add Kconfig to debug code it is running
Implemented features:
* Run ramstage in libx86emu
* Run postcar in libx86emu
TODO:
* Add support to trace only blobs, not stages.
* Improve translation of known IO to human readable format
** COM
** PCI
** APIC
** PIT
** POST
Tested on qemu. Sucessfully run ramstage in blobolator.
Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/Kconfig
M src/arch/x86/boot.c
M src/mainboard/emulation/qemu-i440fx/romstage.c
M src/mainboard/emulation/qemu-q35/romstage.c
M src/vendorcode/Makefile.inc
A src/vendorcode/libx86emu/Makefile.inc
A src/vendorcode/libx86emu/blobolator.c
A src/vendorcode/libx86emu/decode.c
A src/vendorcode/libx86emu/include/decode.h
A src/vendorcode/libx86emu/include/mem.h
A src/vendorcode/libx86emu/include/ops.h
A src/vendorcode/libx86emu/include/prim_ops.h
A src/vendorcode/libx86emu/include/x86emu.h
A src/vendorcode/libx86emu/include/x86emu_int.h
A src/vendorcode/libx86emu/mem.c
A src/vendorcode/libx86emu/ops.c
A src/vendorcode/libx86emu/ops2.c
A src/vendorcode/libx86emu/prim_ops.c
18 files changed, 14,512 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/32020/1
--
To view, visit https://review.coreboot.org/c/coreboot/+/32020
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I13e47f45e69376d046f35c04363fe3db1cfaa610
Gerrit-Change-Number: 32020
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34632 )
Change subject: Documentation: Add guidelines for new mainboard ports
......................................................................
Documentation: Add guidelines for new mainboard ports
This is WIP and partly copied from https://www.coreboot.org/Motherboard_Porting_Guide
It also list what should be documented for new mainboard ports.
Change-Id: I134dbf2341696ba0dd33c3d52bf787b8eaabbdab
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
M Documentation/getting_started/index.md
A Documentation/getting_started/new_mainboard_ports.md
M Documentation/getting_started/writing_documentation.md
3 files changed, 95 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/34632/1
diff --git a/Documentation/getting_started/index.md b/Documentation/getting_started/index.md
index 52d873e..7821ee1 100644
--- a/Documentation/getting_started/index.md
+++ b/Documentation/getting_started/index.md
@@ -7,3 +7,4 @@
* [Gerrit Guidelines](gerrit_guidelines.md)
* [Documentation License](license.md)
* [Writing Documentation](writing_documentation.md)
+* [Adding new mainboards](new_mainboard_ports.md)
diff --git a/Documentation/getting_started/new_mainboard_ports.md b/Documentation/getting_started/new_mainboard_ports.md
new file mode 100644
index 0000000..cb7cd9b
--- /dev/null
+++ b/Documentation/getting_started/new_mainboard_ports.md
@@ -0,0 +1,91 @@
+# Adding new mainboards
+
+Mainboard code is placed under `src/mainboards`. It glues the HW components
+together by selecting appropiate northbridge, southbridge, on-board HW and
+drivers.
+
+It provides the devicetree.cb, configures GPIOs, audio codecs, a static ACPI
+board desciption and allows the romstage code to retrieve the SPD for
+DRAM training.
+
+## Starting a new port from scratch
+
+1. Identify your platform
+ Try to find out as much as possible about the current hardware.
+ Dump information with existing tools:
+ * lspci
+ * lsusb
+ * superiotool
+ * inteltool
+ * ectool
+ * dmidecode
+ * acpidump
+
+ Have a look at the mainboard schematics to see how those components are
+ connected.
+2. Find a similar existing board
+ It a good idea to find a similar board and use it as reference. You should
+ then provide a proper GPIO configuration and devicetree.cb.
+3. Find a similar SuperIo or BMC
+ To debug coreboot you should get the serial console working first. If your
+ board has a SuperIO or BMC try to find a compatible one.
+ Some boards have UART hardware on the SoC, makeing external components
+ obsolete.
+4. Start with a minimal bootable configuration. That is:
+ * serial is working
+ * SPD reading/DRAM is working
+ * A payload that is able to boot an operating system
+5. Be able to recover from a bad flash. You should use external flashing as
+ it's likely that you will brick your platform on the first attempts.
+ Make sure to backup the original firmware (if any).
+
+## Code submission
+
+Here's a checklist for new mainboard ports:
+
+1. Try to not duplicate code, use variants scheme instead.
+2. Split changes logical into top level directories:
+ `src/mainboard` , `src/northbridge`, `src/ec`, ...
+3. Provide good documentation, see point 4
+4. In the commit message describe as much as possible or point to the
+ documentation, satisfying the following questions:
+ * Where's the flash IC located?
+ * Can you flash incircuit?
+ * Are there pinheaders for flashing?
+ * Is the flash hardware write-protected?
+ * Which flash IC is usually equipped?
+ * If the board features an BMC, can it be used for developing and
+ debugging?
+ * What was tested and is working?
+ * What was tested and isn't working?
+ * What wasn't tested (due to lack of testing equipment)?
+ * Are blobs necessary?
+ * How can the board be debugged?
+ * Are there serial, EHCI debug, xHCI debug or BMC connections?
+ * Does it have a SuperIO?
+
+ In addition please descibe:
+ * How to retrieve blobs, like dumping them from vendor firmware
+
+ See [Writing Documentation] for more details.
+
+5. What you should **not** document:
+ * Steps or instructions how to flash the board
+ * Steps or instructions how to use a specific application for flashing
+ * Please do not provide pictures of the whole board or it's backplate
+ connectors
+6. Recommand a flashing method as descibed in [Flashing tutorial]
+7. If you are working at/for a hardware vendor, please provide free board
+ schematics as well.
+8. Provide a picture of the flash IC or flash connector.
+ * The picture should be less than 800pc in width and compressed with
+ 70% compression to reduce size.
+ * You must own the Copyright
+ * Try to cut of uninteresting parts of the image, like tables, cables, ...
+
+Once done submit your board to Gerrit. Please follow the [Gerrit Guidelines] as
+well.
+
+[Writing Documentation]: writing_documentation.md
+[Flashing tutorial]: ../flash_tutorial/index.md
+[Gerrit Guidelines]: gerrit_guidelines.md
diff --git a/Documentation/getting_started/writing_documentation.md b/Documentation/getting_started/writing_documentation.md
index fb942a4..0b820fc 100644
--- a/Documentation/getting_started/writing_documentation.md
+++ b/Documentation/getting_started/writing_documentation.md
@@ -49,6 +49,8 @@
the current theme doesn't allow bigger images.
12. Shouldn't cover implementation details; for details, the code is the
reference.
+13. New mainboard ports should also add documentation. See
+ [Adding new mainboards] for more details.
## Referencing markdown documents
@@ -122,3 +124,4 @@
[Markdown Guide]: https://www.markdownguide.org/
[Gerrit Guidelines]: gerrit_guidelines.md
[review.coreboot.org]: https://review.coreboot.org
+[Adding new mainboards]: new_mainboard_ports.md
--
To view, visit https://review.coreboot.org/c/coreboot/+/34632
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I134dbf2341696ba0dd33c3d52bf787b8eaabbdab
Gerrit-Change-Number: 34632
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34360 )
Change subject: cpu/intel/speedstep: Add comment to clarify define
......................................................................
cpu/intel/speedstep: Add comment to clarify define
Add a comment to clarify that the define must match the define in
southbridge headers.
Change-Id: Ie0e97b170c81e3bca38975d6a3fe9a368c70e622
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/include/cpu/intel/speedstep.h
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/34360/1
diff --git a/src/include/cpu/intel/speedstep.h b/src/include/cpu/intel/speedstep.h
index 05d83ed..660e5ae 100644
--- a/src/include/cpu/intel/speedstep.h
+++ b/src/include/cpu/intel/speedstep.h
@@ -25,6 +25,7 @@
/* MWAIT coordination I/O base address. This must match
* the \_PR_.CP00 PM base address.
+ * PMB0_BASE - 0x10 should match PMBASE for legacy C-state emulation.
*/
#define PMB0_BASE 0x510
--
To view, visit https://review.coreboot.org/c/coreboot/+/34360
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie0e97b170c81e3bca38975d6a3fe9a368c70e622
Gerrit-Change-Number: 34360
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34992 )
Change subject: soc/intel/common: Make use of clflush in common platform_segment_loaded
......................................................................
soc/intel/common: Make use of clflush in common platform_segment_loaded
This patch clear cache lines based on platform_segment_loaded() supplied
start and size values before loading the targeted stage.
This changes is required to fix hang issues appeared due to marking DRAM
ranges as WB (CONFIG_MARK_DRAM_CACHE_WB) to speed up next stage loading/
decompression/execution time.
Idea is to run clflush on those ranges just before tearing down the CAR
(running invd instruction) and after that postcar frame will set up new MTRR
ranges.
Change-Id: I591f21cb4199477af271f0dd6c073e1c11831bfd
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/soc/intel/common/block/cpu/Kconfig
M src/soc/intel/common/block/cpu/Makefile.inc
A src/soc/intel/common/block/cpu/car/car.c
3 files changed, 71 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/34992/1
diff --git a/src/soc/intel/common/block/cpu/Kconfig b/src/soc/intel/common/block/cpu/Kconfig
index 8cc572d..0d1506b 100644
--- a/src/soc/intel/common/block/cpu/Kconfig
+++ b/src/soc/intel/common/block/cpu/Kconfig
@@ -66,3 +66,15 @@
help
This option allows FSP to make use of MP services PPI published by
coreboot to perform multiprocessor initialization.
+
+config MARK_DRAM_CACHE_WB
+ bool
+ default n
+ help
+ This option allows you to select how DRAM intermediate cache is set up.
+ Till discovering DRAM ranges, system will make use of CAR and CAR tear
+ down will handle by postcar/ramstage, that means entire postcar/ramstage
+ stage will execute from UC range. Intention here is to optimize the boot
+ flow hence enabling the caching for applicable DRAM ranges before CAR
+ tear down and setting up new DRAM based MTRR range. MTRR type WB
+ provides best optimization.
diff --git a/src/soc/intel/common/block/cpu/Makefile.inc b/src/soc/intel/common/block/cpu/Makefile.inc
index a6c4f37..63a2ac9 100644
--- a/src/soc/intel/common/block/cpu/Makefile.inc
+++ b/src/soc/intel/common/block/cpu/Makefile.inc
@@ -5,6 +5,7 @@
romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CAR) += car/exit_car.S
romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CPU) += cpulib.c
+romstage-$(CONFIG_MARK_DRAM_CACHE_WB) += car.c
postcar-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CAR) += car/exit_car.S
postcar-$(CONFIG_FSP_CAR) += car/exit_car_fsp.S
diff --git a/src/soc/intel/common/block/cpu/car/car.c b/src/soc/intel/common/block/cpu/car/car.c
new file mode 100644
index 0000000..82d8e9a
--- /dev/null
+++ b/src/soc/intel/common/block/cpu/car/car.c
@@ -0,0 +1,58 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Intel Corp.
+ *
+ * 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.
+ *
+ * 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 <assert.h>
+#include <cbmem.h>
+#include <cpu/x86/cache.h>
+#include <program_loading.h>
+
+static inline int is_usable_dram_addr(uintptr_t addr)
+{
+ return (addr < (uintptr_t) cbmem_top());
+}
+
+/*
+ * CLFLUSH the impacted WB'ed cache lines before loading postcar/ramstage
+ * in order to avoid getting stuck while tearing down (invd) the CAR.
+ */
+static void flush_cache(uintptr_t start, size_t size)
+{
+ uintptr_t end;
+ uintptr_t addr;
+
+ end = start + (ALIGN_DOWN(size + 4096, 4096));
+ for (addr = start; addr < end; addr += 64)
+ clflush((void *)addr);
+}
+
+void platform_segment_loaded(uintptr_t start, size_t size, int flags)
+{
+ /* Bail out if this is not the final segment. */
+ if (!(flags & SEG_FINAL))
+ return;
+
+ char start_dram_check = is_usable_dram_addr(start);
+ char end_dram_check = is_usable_dram_addr(start + size - 1);
+
+ /*
+ * Bail out if loaded program segment does not lie in
+ * usable DRAM region.
+ */
+ if (!start_dram_check && !end_dram_check)
+ return;
+
+ flush_cache(start, size);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/34992
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I591f21cb4199477af271f0dd6c073e1c11831bfd
Gerrit-Change-Number: 34992
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
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-MessageType: newchange