Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33137
Change subject: soc/intel/cannonlake: Do not read SPD again if index hasn't changed
......................................................................
soc/intel/cannonlake: Do not read SPD again if index hasn't changed
With the recent refactoring of memory configuration in
CB:32513 ("soc/intel/cannonlake: Support different SPD read type for
each slot"), meminit_cbfs_spd_index ends up reading SPD from CBFS for
each slot. However, for mainboards that use the same SPD index for
each slot this is unneccessary. This change adds a check to see if
spd_data_ptr is not NULL and current spd index is the same as the last
call to decide if SPD read from CBFS should be skipped.
TEST=Verified that SPD gets read only once on hatch.
Change-Id: I91963b55cea534c92207b2cd9f0caa96df8f222b
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/soc/intel/cannonlake/cnl_memcfg_init.c
1 file changed, 21 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/33137/1
diff --git a/src/soc/intel/cannonlake/cnl_memcfg_init.c b/src/soc/intel/cannonlake/cnl_memcfg_init.c
index 4ebd997..d3e5e83 100644
--- a/src/soc/intel/cannonlake/cnl_memcfg_init.c
+++ b/src/soc/intel/cannonlake/cnl_memcfg_init.c
@@ -91,18 +91,29 @@
static void meminit_cbfs_spd_index(FSP_M_CONFIG *mem_cfg,
int spd_index, uint8_t mem_slot)
{
- size_t spd_data_len;
- uintptr_t spd_data_ptr;
- struct region_device spd_rdev;
+ static size_t spd_data_len;
+ static uintptr_t spd_data_ptr;
+ static int last_spd_index;
assert(mem_slot < NUM_DIMM_SLOT);
- printk(BIOS_DEBUG, "SPD INDEX = %d\n", spd_index);
- if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0)
- die("spd.bin not found or incorrect index\n");
- spd_data_len = region_device_sz(&spd_rdev);
- /* Memory leak is ok since we have memory mapped boot media */
- assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED));
- spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev);
+
+ if ((spd_data_ptr == 0) || (last_spd_index != spd_index)) {
+ struct region_device spd_rdev;
+
+ printk(BIOS_DEBUG, "SPD INDEX = %d\n", spd_index);
+
+ if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0)
+ die("spd.bin not found or incorrect index\n");
+
+ spd_data_len = region_device_sz(&spd_rdev);
+
+ /* Memory leak is ok since we have memory mapped boot media */
+ assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED));
+
+ spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev);
+ last_spd_index = spd_index;
+ }
+
meminit_spd_data(mem_cfg, mem_slot, spd_data_len, spd_data_ptr);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33137
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I91963b55cea534c92207b2cd9f0caa96df8f222b
Gerrit-Change-Number: 33137
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33144
Change subject: arch/riscv/Kconfig: Make correct default value for CONFIG_ARCH_RISCV_M
......................................................................
arch/riscv/Kconfig: Make correct default value for CONFIG_ARCH_RISCV_M
Change-Id: Ib9329904060cab48d527de1b1ccdab5b6fe71b99
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/arch/riscv/Kconfig
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/33144/1
diff --git a/src/arch/riscv/Kconfig b/src/arch/riscv/Kconfig
index 9d325af..25a3980 100644
--- a/src/arch/riscv/Kconfig
+++ b/src/arch/riscv/Kconfig
@@ -24,8 +24,8 @@
# one implementation that will not have it due
# to security concerns.
bool
- default n if ARCH_RISCV_M_DISABLED
- default y
+ default y if ARCH_RISCV && !ARCH_RISCV_M_DISABLED
+ default n
config ARCH_RISCV_S
# S (supervisor) mode is for kernels. It is optional.
--
To view, visit https://review.coreboot.org/c/coreboot/+/33144
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib9329904060cab48d527de1b1ccdab5b6fe71b99
Gerrit-Change-Number: 33144
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33154
Change subject: mb/google/link: Prevent null pointer dereference
......................................................................
mb/google/link: Prevent null pointer dereference
Only check the lastidread if there is one.
Change-Id: I81248192fe52b2d536976385715bc54aa73d450c
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1375985
---
M src/mainboard/google/link/i915.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/33154/1
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c
index 12d424c..35a30c9 100644
--- a/src/mainboard/google/link/i915.c
+++ b/src/mainboard/google/link/i915.c
@@ -173,7 +173,7 @@
if (verbose & vio)
printk(BIOS_SPEW, "\texpect %08lx\n", id->data);
/* we're looking for something. */
- if (lastidread->addr == id->addr){
+ if ((lastidread != NULL) && (lastidread->addr == id->addr)) {
/* they're going to be polling.
* just do it 1000 times
*/
--
To view, visit https://review.coreboot.org/c/coreboot/+/33154
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I81248192fe52b2d536976385715bc54aa73d450c
Gerrit-Change-Number: 33154
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33065
Change subject: soc/intel/apollolake/Kconfig: Add CONSOLE_UART_BASE_ADDRESS
......................................................................
soc/intel/apollolake/Kconfig: Add CONSOLE_UART_BASE_ADDRESS
Set CONSOLE_UART_BASE_ADDRESS for SoC's internal UART.
Allows to build SeaBios without manually specifying the MMIO address.
Tested on Up squared: The serial works in SeaBios.
Change-Id: I32c18aa6f767cfaf14e3b86796d7d7a32ff1d3d5
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/soc/intel/apollolake/Kconfig
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/33065/1
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index 217d1ea..bce276c 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -361,6 +361,14 @@
int
default 100
+config CONSOLE_UART_BASE_ADDRESS
+ hex
+ default 0xddffc000 if UART_FOR_CONSOLE = 0
+ default 0xddffe000 if UART_FOR_CONSOLE = 1
+ default 0xde000000 if UART_FOR_CONSOLE = 2
+ depends on DRIVERS_UART_8250MEM_32
+ depends on CONSOLE_SERIAL
+
config APL_SKIP_SET_POWER_LIMITS
bool
default n
--
To view, visit https://review.coreboot.org/c/coreboot/+/33065
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I32c18aa6f767cfaf14e3b86796d7d7a32ff1d3d5
Gerrit-Change-Number: 33065
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange