Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47050 )
Change subject: mb/purism/librem_whl: rename to librem_cnl
......................................................................
mb/purism/librem_whl: rename to librem_cnl
Since Whiskeylake SoC code is actually a subset of soc/intel/cannonlake,
rename the baseboard so that boards using other 'cannonlake family' SoCs
(e.g., Cometlake) can be added with minimal confusion.
Rename the mainboard dir and baseboard name, and adjust any references
to them.
Change-Id: I2af7977f1622070eb8bf8449bc8306f9d75b9851
Signed-off-by: Matt DeVillier <matt.devillier(a)puri.sm>
---
R src/mainboard/purism/librem_cnl/Kconfig
A src/mainboard/purism/librem_cnl/Kconfig.name
R src/mainboard/purism/librem_cnl/Makefile.inc
R src/mainboard/purism/librem_cnl/acpi/mainboard.asl
R src/mainboard/purism/librem_cnl/board_info.txt
R src/mainboard/purism/librem_cnl/devicetree.cb
R src/mainboard/purism/librem_cnl/dsdt.asl
R src/mainboard/purism/librem_cnl/ramstage.c
R src/mainboard/purism/librem_cnl/romstage.c
R src/mainboard/purism/librem_cnl/variants/librem_mini/data.vbt
R src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c
R src/mainboard/purism/librem_cnl/variants/librem_mini/hda_verb.c
R src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h
D src/mainboard/purism/librem_whl/Kconfig.name
14 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/47050/1
diff --git a/src/mainboard/purism/librem_whl/Kconfig b/src/mainboard/purism/librem_cnl/Kconfig
similarity index 90%
rename from src/mainboard/purism/librem_whl/Kconfig
rename to src/mainboard/purism/librem_cnl/Kconfig
index bc25fb5..38be380 100644
--- a/src/mainboard/purism/librem_whl/Kconfig
+++ b/src/mainboard/purism/librem_cnl/Kconfig
@@ -1,4 +1,4 @@
-config BOARD_PURISM_BASEBOARD_LIBREM_WHL
+config BOARD_PURISM_BASEBOARD_LIBREM_CNL
def_bool n
select BOARD_ROMSIZE_KB_16384
select DRIVERS_GENERIC_CBFS_SERIAL
@@ -13,11 +13,11 @@
select SPD_READ_BY_WORD
select USE_LEGACY_8254_TIMER
-if BOARD_PURISM_BASEBOARD_LIBREM_WHL
+if BOARD_PURISM_BASEBOARD_LIBREM_CNL
config MAINBOARD_DIR
string
- default "purism/librem_whl"
+ default "purism/librem_cnl"
config MAINBOARD_FAMILY
string
diff --git a/src/mainboard/purism/librem_cnl/Kconfig.name b/src/mainboard/purism/librem_cnl/Kconfig.name
new file mode 100644
index 0000000..326165ba
--- /dev/null
+++ b/src/mainboard/purism/librem_cnl/Kconfig.name
@@ -0,0 +1,3 @@
+config BOARD_PURISM_LIBREM_MINI
+ bool "Librem Mini"
+ select BOARD_PURISM_BASEBOARD_LIBREM_CNL
diff --git a/src/mainboard/purism/librem_whl/Makefile.inc b/src/mainboard/purism/librem_cnl/Makefile.inc
similarity index 100%
rename from src/mainboard/purism/librem_whl/Makefile.inc
rename to src/mainboard/purism/librem_cnl/Makefile.inc
diff --git a/src/mainboard/purism/librem_whl/acpi/mainboard.asl b/src/mainboard/purism/librem_cnl/acpi/mainboard.asl
similarity index 100%
rename from src/mainboard/purism/librem_whl/acpi/mainboard.asl
rename to src/mainboard/purism/librem_cnl/acpi/mainboard.asl
diff --git a/src/mainboard/purism/librem_whl/board_info.txt b/src/mainboard/purism/librem_cnl/board_info.txt
similarity index 84%
rename from src/mainboard/purism/librem_whl/board_info.txt
rename to src/mainboard/purism/librem_cnl/board_info.txt
index e72dcdf2..ca61edd 100644
--- a/src/mainboard/purism/librem_whl/board_info.txt
+++ b/src/mainboard/purism/librem_cnl/board_info.txt
@@ -1,5 +1,5 @@
Vendor name: Purism
-Board name: librem_whl
+Board name: librem_cnl
Category: desktop
Release year: 2020
ROM package: SOIC-8
diff --git a/src/mainboard/purism/librem_whl/devicetree.cb b/src/mainboard/purism/librem_cnl/devicetree.cb
similarity index 100%
rename from src/mainboard/purism/librem_whl/devicetree.cb
rename to src/mainboard/purism/librem_cnl/devicetree.cb
diff --git a/src/mainboard/purism/librem_whl/dsdt.asl b/src/mainboard/purism/librem_cnl/dsdt.asl
similarity index 100%
rename from src/mainboard/purism/librem_whl/dsdt.asl
rename to src/mainboard/purism/librem_cnl/dsdt.asl
diff --git a/src/mainboard/purism/librem_whl/ramstage.c b/src/mainboard/purism/librem_cnl/ramstage.c
similarity index 100%
rename from src/mainboard/purism/librem_whl/ramstage.c
rename to src/mainboard/purism/librem_cnl/ramstage.c
diff --git a/src/mainboard/purism/librem_whl/romstage.c b/src/mainboard/purism/librem_cnl/romstage.c
similarity index 100%
rename from src/mainboard/purism/librem_whl/romstage.c
rename to src/mainboard/purism/librem_cnl/romstage.c
diff --git a/src/mainboard/purism/librem_whl/variants/librem_mini/data.vbt b/src/mainboard/purism/librem_cnl/variants/librem_mini/data.vbt
similarity index 100%
rename from src/mainboard/purism/librem_whl/variants/librem_mini/data.vbt
rename to src/mainboard/purism/librem_cnl/variants/librem_mini/data.vbt
Binary files differ
diff --git a/src/mainboard/purism/librem_whl/variants/librem_mini/gpio.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c
similarity index 100%
rename from src/mainboard/purism/librem_whl/variants/librem_mini/gpio.c
rename to src/mainboard/purism/librem_cnl/variants/librem_mini/gpio.c
diff --git a/src/mainboard/purism/librem_whl/variants/librem_mini/hda_verb.c b/src/mainboard/purism/librem_cnl/variants/librem_mini/hda_verb.c
similarity index 100%
rename from src/mainboard/purism/librem_whl/variants/librem_mini/hda_verb.c
rename to src/mainboard/purism/librem_cnl/variants/librem_mini/hda_verb.c
diff --git a/src/mainboard/purism/librem_whl/variants/librem_mini/include/variant/gpio.h b/src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h
similarity index 100%
rename from src/mainboard/purism/librem_whl/variants/librem_mini/include/variant/gpio.h
rename to src/mainboard/purism/librem_cnl/variants/librem_mini/include/variant/gpio.h
diff --git a/src/mainboard/purism/librem_whl/Kconfig.name b/src/mainboard/purism/librem_whl/Kconfig.name
deleted file mode 100644
index 41a4003..0000000
--- a/src/mainboard/purism/librem_whl/Kconfig.name
+++ /dev/null
@@ -1,3 +0,0 @@
-config BOARD_PURISM_LIBREM_MINI
- bool "Librem Mini"
- select BOARD_PURISM_BASEBOARD_LIBREM_WHL
--
To view, visit https://review.coreboot.org/c/coreboot/+/47050
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2af7977f1622070eb8bf8449bc8306f9d75b9851
Gerrit-Change-Number: 47050
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45930 )
Change subject: soc/intel/common/block/systemagent/memmap.c: Align cached region
......................................................................
soc/intel/common/block/systemagent/memmap.c: Align cached region
When asked to place cbmem_top(), FSP does not seem to care about
alignment. It can return an address that is MTRR poison, which will
exhaust all variable MTRRs when trying to set up caching for CBMEM.
This will make memory-mapped flash and TSEG caching fail as well.
Safeguard against this by aligning the region to cache to half of its
size, and move it upwards to compensate. It is assumed that caching
memory above the provided bootloader TOLUM address is inconsequential.
TEST=Boot out-of-tree Skylake board, observe no MTRR exhaustion error
messages in console. The boot process also feels more fluid.
Change-Id: Ic64fd6d3d9e8ab4c78d68b910a476f9c4eb2d353
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/soc/intel/common/block/systemagent/memmap.c
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/45930/1
diff --git a/src/soc/intel/common/block/systemagent/memmap.c b/src/soc/intel/common/block/systemagent/memmap.c
index 985f2c4..c59d93e 100644
--- a/src/soc/intel/common/block/systemagent/memmap.c
+++ b/src/soc/intel/common/block/systemagent/memmap.c
@@ -6,6 +6,7 @@
#include <cpu/x86/mtrr.h>
#include <cpu/x86/smm.h>
#include <intelblocks/systemagent.h>
+#include <types.h>
/*
* Expected Host Memory Map (we don't know 100% and not all regions are present on all SoCs):
@@ -55,18 +56,18 @@
void fill_postcar_frame(struct postcar_frame *pcf)
{
- uintptr_t top_of_ram;
+ /* FSP does not seem to bother w.r.t. alignment when asked to place cbmem_top() */
+ uintptr_t top_of_ram = ALIGN_DOWN((uintptr_t)cbmem_top(), 8 * MiB);
/*
* 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
+ * Instruct postcar to cache 16 megs around cbmem top which is
* a safe bet to cover ramstage.
*/
- top_of_ram = (uintptr_t) cbmem_top();
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);
+
+ postcar_frame_add_mtrr(pcf, top_of_ram - 8 * MiB, 16 * MiB, MTRR_TYPE_WRBACK);
/* Cache the TSEG region */
postcar_enable_tseg_cache(pcf);
--
To view, visit https://review.coreboot.org/c/coreboot/+/45930
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic64fd6d3d9e8ab4c78d68b910a476f9c4eb2d353
Gerrit-Change-Number: 45930
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44573 )
Change subject: include/list.h: Add support for GCC9+
......................................................................
include/list.h: Add support for GCC9+
When getting the address of a structure's member that is not on offset 0,
GCC9+ assumes that the address never can be NULL. However the code relied
on the fact that it can be NULL by letting the pointer intentionally
overflow.
Manually calculate the address using uintptr_t. This allows to gracefully
terminate the list_for_each MACRO instead of crashing at the end of the
list.
Tested on qemu-system-arm:
coreboot no longer crashed in the devicetree parser and is able to boot
Linux 5.5.
Change-Id: I0d569b59a23d1269f8575fcbbe92a5a6816aa1f7
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
M src/include/list.h
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/44573/1
diff --git a/src/include/list.h b/src/include/list.h
index 3944878..6f0b54d 100644
--- a/src/include/list.h
+++ b/src/include/list.h
@@ -16,10 +16,10 @@
// Insert list_node node before list_node before in a doubly linked list.
void list_insert_before(struct list_node *node, struct list_node *before);
-#define list_for_each(ptr, head, member) \
- for ((ptr) = container_of((head).next, typeof(*(ptr)), member); \
- &((ptr)->member); \
- (ptr) = container_of((ptr)->member.next, \
+#define list_for_each(ptr, head, member) \
+ for ((ptr) = container_of((head).next, typeof(*(ptr)), member); \
+ (uintptr_t)ptr + (uintptr_t)offsetof(typeof(*(ptr)), member); \
+ (ptr) = container_of((ptr)->member.next, \
typeof(*(ptr)), member))
#endif /* __LIST_H__ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/44573
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0d569b59a23d1269f8575fcbbe92a5a6816aa1f7
Gerrit-Change-Number: 44573
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45974 )
Change subject: configs: Add a weird config for Portwell M107
......................................................................
configs: Add a weird config for Portwell M107
This is not meant for actual use, but to build-test several options.
Please do not try to use it on real hardware. Or maybe do try.
Change-Id: Ife40d055e4c9b295c54cfc6a27af06e9358f7761
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
A configs/config.portwell_m107.debug_smmstore_oxpcie_em100spi
1 file changed, 38 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/45974/1
diff --git a/configs/config.portwell_m107.debug_smmstore_oxpcie_em100spi b/configs/config.portwell_m107.debug_smmstore_oxpcie_em100spi
new file mode 100644
index 0000000..448193d
--- /dev/null
+++ b/configs/config.portwell_m107.debug_smmstore_oxpcie_em100spi
@@ -0,0 +1,38 @@
+# Not meant for actual use. Exercises, among other things:
+# + SMMSTORE
+# + OXPCIE support
+# + FSP MP init
+# + EM100Pro SPI console
+# + Debug options
+CONFIG_VENDOR_PORTWELL=y
+CONFIG_CONSOLE_POST=y
+# CONFIG_CONSOLE_SERIAL is not set
+CONFIG_ENABLE_BUILTIN_COM1=y
+CONFIG_ONBOARD_MEM_KINGSTON=y
+CONFIG_USE_INTEL_FSP_MP_INIT=y
+CONFIG_SOC_INTEL_COMMON_BLOCK_SMM_TCO_ENABLE=y
+CONFIG_SOC_INTEL_DEBUG_CONSENT=y
+CONFIG_PCIEXP_HOTPLUG=y
+CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G=y
+CONFIG_SOFTWARE_I2C=y
+CONFIG_SMMSTORE=y
+CONFIG_SPI_FLASH_NO_FAST_READ=y
+CONFIG_DRIVERS_UART_OXPCIE=y
+CONFIG_DRIVERS_GENESYSLOGIC_GL9755=y
+CONFIG_DISPLAY_HOBS=y
+CONFIG_DISPLAY_VBT=y
+CONFIG_DISPLAY_FSP_ENTRY_POINTS=y
+CONFIG_DISPLAY_UPD_DATA=y
+CONFIG_EM100PRO_SPI_CONSOLE=y
+CONFIG_DISPLAY_MTRRS=y
+CONFIG_GDB_STUB=y
+CONFIG_GDB_WAIT=y
+CONFIG_FATAL_ASSERTS=y
+CONFIG_DEBUG_CBFS=y
+CONFIG_DEBUG_SMBUS=y
+CONFIG_DEBUG_SMI=y
+CONFIG_DEBUG_PERIODIC_SMI=y
+CONFIG_DEBUG_MALLOC=y
+CONFIG_DEBUG_CONSOLE_INIT=y
+CONFIG_REALMODE_DEBUG=y
+CONFIG_DEBUG_BOOT_STATE=y
--
To view, visit https://review.coreboot.org/c/coreboot/+/45974
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ife40d055e4c9b295c54cfc6a27af06e9358f7761
Gerrit-Change-Number: 45974
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44174 )
Change subject: [TESTONLY] smm loader v2 fixups for B85M Pro4
......................................................................
[TESTONLY] smm loader v2 fixups for B85M Pro4
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M src/cpu/x86/mp_init.c
M src/cpu/x86/smm/smm_module_loaderv2.c
M src/include/cpu/x86/smm.h
M src/mainboard/asrock/b85m_pro4/Kconfig
4 files changed, 17 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/44174/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index caed8f4..375c94e 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -726,8 +726,18 @@
* the location of the new SMBASE. If using SMM modules then this
* calculation needs to match that of the module loader.
*/
- perm_smbase = mp_state.perm_smbase;
- perm_smbase -= cpu * runtime->save_state_size;
+ if (CONFIG(X86_SMM_LOADER_VERSION2)) {
+ perm_smbase = smm_get_cpu_smbase(cpu);
+ mp_state.perm_smbase = perm_smbase;
+
+ if (!perm_smbase) {
+ printk(BIOS_ERR, "%s: bad SMBASE for CPU %d\n", __func__, cpu);
+ return;
+ }
+ } else {
+ perm_smbase = mp_state.perm_smbase;
+ perm_smbase -= cpu * runtime->save_state_size;
+ }
printk(BIOS_DEBUG, "New SMBASE 0x%08lx\n", perm_smbase);
diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c
index c084f74..e6ccfdf 100644
--- a/src/cpu/x86/smm/smm_module_loaderv2.c
+++ b/src/cpu/x86/smm/smm_module_loaderv2.c
@@ -173,7 +173,7 @@
* input: cpu_num - cpu number which is used as an index into the
* map to return the smbase
*/
-int smm_get_cpu_smbase(unsigned int cpu_num)
+u32 smm_get_cpu_smbase(unsigned int cpu_num)
{
if (cpu_num < CONFIG_MAX_CPUS) {
if (cpus[cpu_num].active)
diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index 7838223..084d150 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -149,21 +149,19 @@
struct smm_runtime *runtime;
/* The following are only used by X86_SMM_LOADER_VERSION2 */
- #if CONFIG(X86_SMM_LOADER_VERSION2)
+#if CONFIG(X86_SMM_LOADER_VERSION2)
unsigned int smm_entry;
unsigned int smm_main_entry_offset;
unsigned int smram_start;
unsigned int smram_end;
- #endif
+#endif
};
/* Both of these return 0 on success, < 0 on failure. */
int smm_setup_relocation_handler(struct smm_loader_params *params);
int smm_load_module(void *smram, size_t size, struct smm_loader_params *params);
-#if CONFIG(X86_SMM_LOADER_VERSION2)
-int smm_get_cpu_smbase(unsigned int cpu_num);
-#endif
+u32 smm_get_cpu_smbase(unsigned int cpu_num);
/* Backup and restore default SMM region. */
void *backup_default_smm_area(void);
diff --git a/src/mainboard/asrock/b85m_pro4/Kconfig b/src/mainboard/asrock/b85m_pro4/Kconfig
index dc65120..2afc334 100644
--- a/src/mainboard/asrock/b85m_pro4/Kconfig
+++ b/src/mainboard/asrock/b85m_pro4/Kconfig
@@ -17,6 +17,7 @@
select SERIRQ_CONTINUOUS_MODE
select SOUTHBRIDGE_INTEL_LYNXPOINT
select SUPERIO_NUVOTON_NCT6776
+ select X86_SMM_LOADER_VERSION2
config MAINBOARD_DIR
string
--
To view, visit https://review.coreboot.org/c/coreboot/+/44174
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6
Gerrit-Change-Number: 44174
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange