Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40808 )
Change subject: soc/amd/picasso/Makefile: Verify bootblock size is power of two
......................................................................
soc/amd/picasso/Makefile: Verify bootblock size is power of two
Enabling caching for bootblock requires its size to be a power of two.
This is because MTRRs have this requirement.
BUG=b:153675909
TEST=Changed bootblock size and saw a build error
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
---
M src/soc/amd/picasso/Makefile.inc
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/40808/1
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index b04e1e9..d137aba 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -189,6 +189,12 @@
# This address must match the BOOTBLOCK logic in arch/x86/memlayout.ld.
PSP_BIOSBIN_DEST=$(shell printf "%x" $(call int-subtract, $(call int-add, $(CONFIG_X86_RESET_VECTOR) 0x10) $(PSP_BIOSBIN_SIZE)))
+# MTRRs sizes must be a power of two. Ensure the bootblock has a compatible size
+# so we can enable caching.
+ifneq ($(call is-power-of-two,$(PSP_BIOSBIN_SIZE)),1)
+$(error Bootblock size $(PSP_BIOSBIN_SIZE) is not a power of two.)
+endif
+
# type = 0x63
ifeq ($(CONFIG_HAVE_ACPI_RESUME),y)
PSP_APOBNV_BASE=$(CONFIG_PSP_APOB_NV_ADDRESS)
--
To view, visit https://review.coreboot.org/c/coreboot/+/40808
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
Gerrit-Change-Number: 40808
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40765 )
Change subject: Makefile: Add is-power-of-two
......................................................................
Makefile: Add is-power-of-two
It is sometimes necessary to verify if a CONFIG_ option is a power of
two at build time. This adds a `make` function `is-power-of-two`.
I chose to define all the values because it's the most straightforward
way to do this with `make`.
BUG=b:147042464
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
---
M Makefile.inc
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/40765/1
diff --git a/Makefile.inc b/Makefile.inc
index e315732..cbec2dd 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -133,6 +133,7 @@
# int-gt: 1 if the first values is greater than the second. 0 otherwise
# int-eq: 1 if the two values are equal. 0 otherwise
# int-align: align $1 to $2 units
+# is-power-of-two:1 if value is a power of two
# file-size: returns the filesize of the given file
# tolower: returns the value in all lowercase
# toupper: returns the value in all uppercase
@@ -151,6 +152,15 @@
int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))
int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) )
int-align-down=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A - \( $$A % $$B \) )
+power-of-twos := 0x00000001 0x00000002 0x00000004 0x00000008 \
+0x00000010 0x00000020 0x00000040 0x00000080 \
+0x00000100 0x00000200 0x00000400 0x00000800 \
+0x00001000 0x00002000 0x00004000 0x00008000 \
+0x00010000 0x00020000 0x00040000 0x00080000 \
+0x00100000 0x00200000 0x00400000 0x00800000 \
+0x01000000 0x02000000 0x04000000 0x08000000 \
+0x10000000 0x20000000 0x40000000 0x80000000
+is-power-of-two=$(if $(filter $(power-of-twos), $(shell printf "0x%08x" $1)),1)
file-size=$(strip $(shell cat $1 | wc -c))
tolower=$(shell echo '$1' | tr '[:upper:]' '[:lower:]')
toupper=$(shell echo '$1' | tr '[:lower:]' '[:upper:]')
@@ -575,6 +585,8 @@
@printf " HOSTCC $(subst $(obj)/,,$(@))\n"
$(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
+APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
+
CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage
FUTILITY?=$(objutil)/futility/futility
--
To view, visit https://review.coreboot.org/c/coreboot/+/40765
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
Gerrit-Change-Number: 40765
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37368 )
Change subject: arch/x86/car: Remove runtime stack alignment enforcing
......................................................................
arch/x86/car: Remove runtime stack alignment enforcing
This is now checked at buildtime.
Change-Id: Ice687b1a4de53de4799e90238c98cfef19a81136
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/intel/car/core2/cache_as_ram.S
M src/cpu/intel/car/non-evict/cache_as_ram.S
M src/cpu/intel/car/p3/cache_as_ram.S
M src/cpu/intel/car/p4-netburst/cache_as_ram.S
M src/cpu/qemu-x86/cache_as_ram_bootblock.S
M src/soc/intel/common/block/cpu/car/cache_as_ram.S
6 files changed, 0 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/37368/1
diff --git a/src/cpu/intel/car/core2/cache_as_ram.S b/src/cpu/intel/car/core2/cache_as_ram.S
index 73618d9..be96633 100644
--- a/src/cpu/intel/car/core2/cache_as_ram.S
+++ b/src/cpu/intel/car/core2/cache_as_ram.S
@@ -173,7 +173,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/non-evict/cache_as_ram.S b/src/cpu/intel/car/non-evict/cache_as_ram.S
index 5a668c4..6c78ddb 100644
--- a/src/cpu/intel/car/non-evict/cache_as_ram.S
+++ b/src/cpu/intel/car/non-evict/cache_as_ram.S
@@ -219,7 +219,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/p3/cache_as_ram.S b/src/cpu/intel/car/p3/cache_as_ram.S
index 5262b18..8c3009a 100644
--- a/src/cpu/intel/car/p3/cache_as_ram.S
+++ b/src/cpu/intel/car/p3/cache_as_ram.S
@@ -161,7 +161,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/p4-netburst/cache_as_ram.S b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
index fdeb0af..8fd240d 100644
--- a/src/cpu/intel/car/p4-netburst/cache_as_ram.S
+++ b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
@@ -372,7 +372,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/qemu-x86/cache_as_ram_bootblock.S b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
index 1fa0018..c1fe52d 100644
--- a/src/cpu/qemu-x86/cache_as_ram_bootblock.S
+++ b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
@@ -37,8 +37,6 @@
movl $_ecar_stack, %esp
/* Align the stack and keep aligned for call to bootblock_c_entry() */
- and $0xfffffff0, %esp
-
/* Restore the BIST result and timestamps. */
#if defined(__x86_64__)
movd %mm1, %rdi
diff --git a/src/soc/intel/common/block/cpu/car/cache_as_ram.S b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
index 0992d85..5d7eafa 100644
--- a/src/soc/intel/common/block/cpu/car/cache_as_ram.S
+++ b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
@@ -174,7 +174,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the two pushes below. */
- andl $0xfffffff0, %esp
sub $8, %esp
/* push TSC value to stack */
--
To view, visit https://review.coreboot.org/c/coreboot/+/37368
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ice687b1a4de53de4799e90238c98cfef19a81136
Gerrit-Change-Number: 37368
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37367 )
Change subject: arch/x86/car.ld: Assert at buildtime that _ecar_stack is aligned
......................................................................
arch/x86/car.ld: Assert at buildtime that _ecar_stack is aligned
This can be used to avoid aligning the stack at runtime.
Change-Id: I3aa068d947b6b6110fd7d002522f28a13e725cf7
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/car.ld
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/37367/1
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index 483a908..2d1723e 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -124,3 +124,4 @@
#if !CONFIG(ROMCC_BOOTBLOCK)
_bogus3 = ASSERT(CONFIG_DCACHE_BSP_STACK_SIZE > 0x0, "BSP stack size not configured");
#endif
+_bogus4 = ASSERT(_ecar_stack == ((_ecar_stack + 0xf) & ~0xf), "_ecar_stack must be 16 aligned");
--
To view, visit https://review.coreboot.org/c/coreboot/+/37367
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3aa068d947b6b6110fd7d002522f28a13e725cf7
Gerrit-Change-Number: 37367
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48142 )
Change subject: mb/kontron/mal10: Move include directories to mb level
......................................................................
mb/kontron/mal10: Move include directories to mb level
Move include directories from carriers and variants to mainboard level
so that the headers can be reused.
Signed-off-by: Felix Singer <felixsinger(a)posteo.net>
Change-Id: I55af05cb84b97d567ce1fc3b6151c34d1eda183f
---
M src/mainboard/kontron/mal10/Makefile.inc
R src/mainboard/kontron/mal10/include/carrier/gpio.h
R src/mainboard/kontron/mal10/include/variant/gpio.h
3 files changed, 1 insertion(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/48142/1
diff --git a/src/mainboard/kontron/mal10/Makefile.inc b/src/mainboard/kontron/mal10/Makefile.inc
index 885786f..7fbab00 100644
--- a/src/mainboard/kontron/mal10/Makefile.inc
+++ b/src/mainboard/kontron/mal10/Makefile.inc
@@ -3,7 +3,5 @@
ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads
subdirs-y += variants/$(VARIANT_DIR)
-CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
-
subdirs-y += carriers/$(CARRIER_DIR)
-CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/carriers/$(CARRIER_DIR)/include
+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
diff --git a/src/mainboard/kontron/mal10/carriers/t10-tni/include/carrier/gpio.h b/src/mainboard/kontron/mal10/include/carrier/gpio.h
similarity index 100%
rename from src/mainboard/kontron/mal10/carriers/t10-tni/include/carrier/gpio.h
rename to src/mainboard/kontron/mal10/include/carrier/gpio.h
diff --git a/src/mainboard/kontron/mal10/variants/mal10/include/variant/gpio.h b/src/mainboard/kontron/mal10/include/variant/gpio.h
similarity index 100%
rename from src/mainboard/kontron/mal10/variants/mal10/include/variant/gpio.h
rename to src/mainboard/kontron/mal10/include/variant/gpio.h
--
To view, visit https://review.coreboot.org/c/coreboot/+/48142
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I55af05cb84b97d567ce1fc3b6151c34d1eda183f
Gerrit-Change-Number: 48142
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47934 )
Change subject: security/intel/txt/ramstage.c: Fix clearing secrets on CBNT
......................................................................
security/intel/txt/ramstage.c: Fix clearing secrets on CBNT
With CBNT it looks like only the the TXT_E2STS_SECRET_STS should be
looked at.
Change-Id: Iff4436501b84f5c209add845b3cd3a62782d17e6
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/security/intel/txt/ramstage.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/47934/1
diff --git a/src/security/intel/txt/ramstage.c b/src/security/intel/txt/ramstage.c
index 80bf3f9..4e38d32 100644
--- a/src/security/intel/txt/ramstage.c
+++ b/src/security/intel/txt/ramstage.c
@@ -90,7 +90,7 @@
return;
/* Check for fatal ACM error and TXT reset */
- if (get_wake_error_status()) {
+// if (get_wake_error_status()) {
/*
* Check if secrets bit needs to be reset. Only platforms that support
* CONFIG(PLATFORM_HAS_DRAM_CLEAR) will be able to run this code.
@@ -106,7 +106,7 @@
intel_txt_log_acm_error(read32((void *)TXT_BIOSACM_ERRORCODE));
die("Waiting for platform reset...\n");
}
- }
+// }
}
BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, check_secrets_txt, NULL);
--
To view, visit https://review.coreboot.org/c/coreboot/+/47934
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iff4436501b84f5c209add845b3cd3a62782d17e6
Gerrit-Change-Number: 47934
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange