John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32924
Change subject: soc/intel/common: Add negative sign check for variable bios_size
......................................................................
soc/intel/common: Add negative sign check for variable bios_size
Clang Static Analyzer found that the rounding operation of
alignment=1UL<<(log2_ceil(bios_size)) is garbage or undefined
if varialbe bios_size is negative. Add sanity check for bios_size
to prevent rounding error.
Signed-off-by: John Zhao <john.zhao(a)intel.com>
Change-Id: Ifc3f3da52d129ef5d6063a46b045603a236be759
---
M src/soc/intel/common/block/fast_spi/fast_spi.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/32924/1
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c
index 455b13c..560c75c 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi.c
@@ -236,7 +236,7 @@
/* Only the IFD BIOS region is memory mapped (at top of 4G) */
fast_spi_get_bios_region(&bios_size);
- if (!bios_size)
+ if (!bios_size || (bios_size < 0))
return;
/* LOCAL APIC default address is 0xFEE0000, bios_size over 16MB will
--
To view, visit https://review.coreboot.org/c/coreboot/+/32924
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifc3f3da52d129ef5d6063a46b045603a236be759
Gerrit-Change-Number: 32924
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao(a)intel.com>
Gerrit-MessageType: newchange
John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32974
Change subject: soc/intel/common: Set GSPI clock value to prevent division by zero
......................................................................
soc/intel/common: Set GSPI clock value to prevent division by zero
Clang Static Analyzer version 8.0.0 detects the division by zero if
gspi_clk_mhz is initialized to 0. gspi_clk_mhz is referred to speed_mhz
in devicetree. Set gspi_clk_mhz to 1 if it is detected as 0 in order to
prevent the division by zero in DIV_ROUND_UP operation. Then the value
of (ref_clk_mhz - 1) will be fed into GSPI's Serial Clock Rate value.
TEST=Built and boot up to kernel.
Change-Id: I6a09474bff114c57d7a9c4c232bb636ff287e4d5
Signed-off-by: John Zhao <john.zhao(a)intel.com>
---
M src/soc/intel/common/block/gspi/gspi.c
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/32974/1
diff --git a/src/soc/intel/common/block/gspi/gspi.c b/src/soc/intel/common/block/gspi/gspi.c
index 81eb7ee..fb3bf7a 100644
--- a/src/soc/intel/common/block/gspi/gspi.c
+++ b/src/soc/intel/common/block/gspi/gspi.c
@@ -437,9 +437,11 @@
{
const uint32_t ref_clk_mhz =
CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ;
- const uint32_t gspi_clk_mhz = gspi_get_bus_clk_mhz(gspi_bus);
+ uint32_t gspi_clk_mhz = gspi_get_bus_clk_mhz(gspi_bus);
- assert(gspi_clk_mhz != 0);
+ if (!gspi_clk_mhz)
+ gspi_clk_mhz = 1;
+
assert(ref_clk_mhz != 0);
return (DIV_ROUND_UP(ref_clk_mhz, gspi_clk_mhz) - 1) & SSCR0_SCR_MASK;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/32974
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6a09474bff114c57d7a9c4c232bb636ff287e4d5
Gerrit-Change-Number: 32974
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao(a)intel.com>
Gerrit-MessageType: newchange
Evgeny Zinoviev has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32683
Change subject: util/autoport: Add info about rank_mirror to readme.md
......................................................................
util/autoport: Add info about rank_mirror to readme.md
inteltool can't detect whether address mapping is normal or
mirrored, which in turn may be cause RAM initialization to
fail when using spd.bin generated by inteltool.
Mention this in readme as it may help someone.
Change-Id: I8d24e4d9332bdcf484987581dd6941e2bf9c4f87
Signed-off-by: Evgeny Zinoviev <me(a)ch1p.io>
---
M util/autoport/readme.md
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/32683/1
diff --git a/util/autoport/readme.md b/util/autoport/readme.md
index 4683d8d..6e0a7ef 100644
--- a/util/autoport/readme.md
+++ b/util/autoport/readme.md
@@ -267,6 +267,10 @@
not forget to copy the data on all the array elements that need it.
* If they use different data, use several files.
+If memory initialization is not working, try enbling rank_mirror, which can't
+be detected by inteltool. To do that, set the lowest bit at the offset `0x3f`
+in `spd.bin` to 1.
+
### `board_info.txt`
`board_info.txt` is a text file used in the board status page to list all
--
To view, visit https://review.coreboot.org/c/coreboot/+/32683
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8d24e4d9332bdcf484987581dd6941e2bf9c4f87
Gerrit-Change-Number: 32683
Gerrit-PatchSet: 1
Gerrit-Owner: Evgeny Zinoviev <me(a)ch1p.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33001
Change subject: soc/intel/common/cse: Don't use CAR_GLOBAL
......................................................................
soc/intel/common/cse: Don't use CAR_GLOBAL
All platforms using this code have NO_CAR_GLOBAL_MIGRATION.
Change-Id: If952ad8129e1fa6e45858cb77ec99c9fec55c4a6
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/common/block/cse/cse.c
1 file changed, 9 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/33001/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 302e6de..6164580 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
-#include <arch/early_variables.h>
#include <assert.h>
#include <commonlib/helpers.h>
#include <console/console.h>
@@ -71,7 +70,7 @@
struct cse_device {
uintptr_t sec_bar;
-} g_cse CAR_GLOBAL;
+} g_cse;
/*
* Initialize the device with provided temporary BAR. If BAR is 0 use a
@@ -80,7 +79,6 @@
*/
void heci_init(uintptr_t tempbar)
{
- struct cse_device *cse = car_get_var_ptr(&g_cse);
#if defined(__SIMPLE_DEVICE__)
pci_devfn_t dev = PCH_DEV_CSE;
#else
@@ -89,7 +87,7 @@
u8 pcireg;
/* Assume it is already initialized, nothing else to do */
- if (cse->sec_bar)
+ if (g_cse.sec_bar)
return;
/* Use default pre-ram bar */
@@ -111,7 +109,7 @@
pcireg |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
pci_write_config8(dev, PCI_COMMAND, pcireg);
- cse->sec_bar = tempbar;
+ g_cse.sec_bar = tempbar;
}
/* Get HECI BAR 0 from PCI configuration space */
@@ -130,20 +128,18 @@
static uint32_t read_bar(uint32_t offset)
{
- struct cse_device *cse = car_get_var_ptr(&g_cse);
/* Reach PCI config space to get BAR in case CAR global not available */
- if (!cse->sec_bar)
- cse->sec_bar = get_cse_bar();
- return read32((void *)(cse->sec_bar + offset));
+ if (!g_cse.sec_bar)
+ g_cse.sec_bar = get_cse_bar();
+ return read32((void *)(g_cse.sec_bar + offset));
}
static void write_bar(uint32_t offset, uint32_t val)
{
- struct cse_device *cse = car_get_var_ptr(&g_cse);
/* Reach PCI config space to get BAR in case CAR global not available */
- if (!cse->sec_bar)
- cse->sec_bar = get_cse_bar();
- return write32((void *)(cse->sec_bar + offset), val);
+ if (!g_cse.sec_bar)
+ g_cse.sec_bar = get_cse_bar();
+ return write32((void *)(g_cse.sec_bar + offset), val);
}
static uint32_t read_cse_csr(void)
--
To view, visit https://review.coreboot.org/c/coreboot/+/33001
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If952ad8129e1fa6e45858cb77ec99c9fec55c4a6
Gerrit-Change-Number: 33001
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange