Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33403
Change subject: nb/intel/nehalem: Die if no memory ranks found
......................................................................
nb/intel/nehalem: Die if no memory ranks found
Die if there are no memory ranks found to prevent a division by zero.
Change-Id: I6146dd8420f3734d1a672a9f29a098f47fcb739c
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1229628
---
M src/northbridge/intel/nehalem/raminit.c
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/33403/1
diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c
index 15d6abb..03831e2 100644
--- a/src/northbridge/intel/nehalem/raminit.c
+++ b/src/northbridge/intel/nehalem/raminit.c
@@ -1010,6 +1010,9 @@
}
}
+ if (count == 0)
+ die("No memory ranks found for channel %u\n", channel);
+
info->avg4044[channel] = sum / count;
info->max4048[channel] = max_of_unk;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33403
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6146dd8420f3734d1a672a9f29a098f47fcb739c
Gerrit-Change-Number: 33403
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33357
Change subject: soc/intel/block/cpu: Make MP init options mutually exclusive
......................................................................
soc/intel/block/cpu: Make MP init options mutually exclusive
It shouldn't be the case that multiple or no MP init paths could be
selected.
Change-Id: I65b80805d3cd7b66f8c9f878d3c741b98f24288d
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/soc/intel/common/block/cpu/Kconfig
1 file changed, 30 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/33357/1
diff --git a/src/soc/intel/common/block/cpu/Kconfig b/src/soc/intel/common/block/cpu/Kconfig
index 9ec5307..e602829 100644
--- a/src/soc/intel/common/block/cpu/Kconfig
+++ b/src/soc/intel/common/block/cpu/Kconfig
@@ -51,29 +51,49 @@
ENHANCED NEM guarantees that modified data is always
kept in cache while clean data is replaced.
-menu "Multiple Processor (MP) Initialization Options"
-config USE_COREBOOT_NATIVE_MP_INIT
+choice
+ prompt "Multiple Processor (MP) Initialization Options"
+ default MP_USE_COREBOOT_NATIVE_MP_INIT if !PLATFORM_USES_FSP2_1
+ default MP_USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI if PLATFORM_USES_FSP2_1
+
+config MP_USE_COREBOOT_NATIVE_MP_INIT
bool "Perform MP Initialization by coreboot"
- default y if !PLATFORM_USES_FSP2_1
- default n
+ select USE_COREBOOT_NATIVE_MP_INIT
help
This option allows user to select native coreboot option to perform
multiprocessor initialization.
-config USE_INTEL_FSP_MP_INIT
+config MP_USE_INTEL_FSP_MP_INIT
bool "Perform MP Initialization by FSP"
- default n
+ select USE_INTEL_FSP_MP_INIT
help
This option allows FSP to perform multiprocessor initialization.
-config USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
+config MP_USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
bool "Perform MP Initialization by FSP using coreboot MP PPI service"
depends on FSP_USES_MP_SERVICES_PPI
- default y if PLATFORM_USES_FSP2_1
- default n
+ select USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
select USE_COREBOOT_NATIVE_MP_INIT
help
This option allows FSP to make use of MP services PPI published by
coreboot to perform multiprocessor initialization.
-endmenu # Multiple Processor (MP) Initialization Options
+endchoice
+
+config USE_COREBOOT_NATIVE_MP_INIT
+ bool
+ help
+ This option allows user to select native coreboot option to perform
+ multiprocessor initialization.
+
+config USE_INTEL_FSP_MP_INIT
+ bool
+ help
+ This option allows FSP to perform multiprocessor initialization.
+
+config USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI
+ bool
+ select USE_COREBOOT_NATIVE_MP_INIT
+ help
+ This option allows FSP to make use of MP services PPI published by
+ coreboot to perform multiprocessor initialization.
--
To view, visit https://review.coreboot.org/c/coreboot/+/33357
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I65b80805d3cd7b66f8c9f878d3c741b98f24288d
Gerrit-Change-Number: 33357
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30831
Change subject: vendorcode/eltan Add hashing library used for measured and verified boot.
......................................................................
vendorcode/eltan Add hashing library used for measured and verified boot.
To avoid having the whole 3rdparty/vboot/firmware included a small hashing library
has been created.
Create library which is a 'wrapper' using only sha1, sha256 and sha512 of
3rdparty/vboot/firmware.
Fucntions cb_sha1(), cb_sha256() and cb_sha512 can be used for hashing.
BUG=N/A
TEST=Created binary and verify logging on Facebok FBG-1701
Change-Id: If828bde54c79e836a5b05ff0447645d7e06e819a
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
---
A src/vendorcode/eltan/security/include/cb_sha1.h
A src/vendorcode/eltan/security/include/cb_sha256.h
A src/vendorcode/eltan/security/include/cb_sha512.h
A src/vendorcode/eltan/security/include/cryptolib.h
A src/vendorcode/eltan/security/lib/Makefile.inc
A src/vendorcode/eltan/security/lib/cb_sha1.c
A src/vendorcode/eltan/security/lib/cb_sha256.c
A src/vendorcode/eltan/security/lib/cb_sha512.c
8 files changed, 297 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/30831/1
diff --git a/src/vendorcode/eltan/security/include/cb_sha1.h b/src/vendorcode/eltan/security/include/cb_sha1.h
new file mode 100644
index 0000000..3b72355
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha1.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef __SECURITY_SHA1_H__
+#define __SECURITY_SHA1_H__
+
+uint8_t *cb_sha1(const uint8_t *data, uint64_t len, uint8_t *digest);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cb_sha256.h b/src/vendorcode/eltan/security/include/cb_sha256.h
new file mode 100644
index 0000000..3b45f73
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha256.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef __SECURITY_SHA256_H__
+#define __SECURITY_SHA256_H__
+
+uint8_t *cb_sha256(const uint8_t *data, uint64_t len, uint8_t *digest);
+uint8_t *cb_sha256_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cb_sha512.h b/src/vendorcode/eltan/security/include/cb_sha512.h
new file mode 100644
index 0000000..a383cf0
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha512.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef __SECURITY_SHA512_H__
+#define __SECURITY_SHA512_H__
+
+uint8_t *cb_sha512(const uint8_t *data, uint64_t len, uint8_t *digest);
+uint8_t *cb_sha512_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cryptolib.h b/src/vendorcode/eltan/security/include/cryptolib.h
new file mode 100644
index 0000000..ac1668a
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cryptolib.h
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef __SECURITY_CRYPTOLIB_H__
+#define __SECURITY_CRYPTOLIB_H__
+
+#define NEED_VB2_SHA_LIBRARY
+
+#include <2rsa.h>
+#include <vb21_common.h>
+#include <vb2_api.h>
+
+#include "cb_sha1.h"
+#include "cb_sha512.h"
+#include "cb_sha256.h"
+
+#endif
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/Makefile.inc b/src/vendorcode/eltan/security/lib/Makefile.inc
new file mode 100644
index 0000000..9e2fc39
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/Makefile.inc
@@ -0,0 +1,52 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2018 Eltan B.V.
+#
+# 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; version 2 of the License.
+#
+# 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.
+#
+
+SECURITYLIB_INCLUDES = -I3rdparty/vboot/firmware/2lib/include -I3rdparty/vboot/firmware/lib21/include
+
+CPPFLAGS_common+=$(SECURITYLIB_INCLUDES)
+
+ifeq ($(CONFIG_VERIFIED_BOOT),y)
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2common.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2rsa.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha_utility.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/lib21/packed_key.c
+ifeq ($(CONFIG_VERIFIED_BOOT_USE_SHA512),y)
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += cb_sha512.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+else
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += cb_sha256.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+endif
+endif
+
+ifeq ($(CONFIG_MBOOT),y)
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha1.c
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+ramstage-y += cb_sha1.c
+ramstage-y += cb_sha512.c
+ramstage-y += cb_sha256.c
+
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2common.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2rsa.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha1.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha_utility.c
+romstage-y += $(top)/3rdparty/vboot/firmware/lib21/packed_key.c
+romstage-y += cb_sha1.c
+romstage-y += cb_sha512.c
+romstage-y += cb_sha256.c
+endif
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/cb_sha1.c b/src/vendorcode/eltan/security/lib/cb_sha1.c
new file mode 100644
index 0000000..fd96943
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha1.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha1(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ struct vb2_sha1_context ctx;
+
+ vb2_sha1_init(&ctx);
+ vb2_sha1_update(&ctx, data, len);
+ vb2_sha1_finalize(&ctx, digest);
+
+ return digest;
+}
diff --git a/src/vendorcode/eltan/security/lib/cb_sha256.c b/src/vendorcode/eltan/security/lib/cb_sha256.c
new file mode 100644
index 0000000..b02ebb2
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha256.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha256_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian)
+{
+ int i;
+ const uint8_t *input_ptr;
+ uint8_t result[VB2_SHA256_DIGEST_SIZE];
+ uint8_t *result_ptr;
+ uint64_t remaining_len;
+ struct vb2_sha256_context ctx;
+
+ vb2_sha256_init(&ctx);
+
+ input_ptr = data;
+ remaining_len = len;
+
+ /* Process data in at most UINT32_MAX byte chunks at a time. */
+ while (remaining_len) {
+ uint32_t block_size;
+ block_size = (uint32_t) ((remaining_len >= UINT32_MAX) ?
+ UINT32_MAX : remaining_len);
+ vb2_sha256_update(&ctx, input_ptr, block_size);
+ remaining_len -= block_size;
+ input_ptr += block_size;
+ }
+
+ result_ptr = result;
+ vb2_sha256_finalize(&ctx, result_ptr);
+ for (i = 0; i < VB2_SHA256_DIGEST_SIZE; ++i) {
+ if (endian) {
+ /* use big endian here */
+ digest[i] = *result_ptr++;
+ } else {
+ /* use little endian here */
+ digest[VB2_SHA256_DIGEST_SIZE - i - 1] = *result_ptr++;
+ }
+ }
+ return digest;
+}
+
+uint8_t *cb_sha256(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ /* Returned the little endian SHA256 digest */
+ return cb_sha256_ex(data, len, digest, 0);
+}
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/cb_sha512.c b/src/vendorcode/eltan/security/lib/cb_sha512.c
new file mode 100644
index 0000000..9d713e7
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha512.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha512_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian)
+{
+ int i;
+ const uint8_t *input_ptr;
+ uint8_t result[VB2_SHA512_DIGEST_SIZE];
+ uint8_t *result_ptr;
+ uint64_t remaining_len;
+ struct vb2_sha512_context ctx;
+
+ vb2_sha512_init(&ctx);
+
+ input_ptr = data;
+ remaining_len = len;
+
+ /* Process data in at most UINT32_MAX byte chunks at a time. */
+ while (remaining_len) {
+ uint32_t block_size;
+ block_size = (uint32_t) ((remaining_len >= UINT32_MAX) ?
+ UINT32_MAX : remaining_len);
+ vb2_sha512_update(&ctx, input_ptr, block_size);
+ remaining_len -= block_size;
+ input_ptr += block_size;
+ }
+
+ result_ptr = result;
+ vb2_sha512_finalize(&ctx, result_ptr);
+ for (i = 0; i < VB2_SHA512_DIGEST_SIZE; ++i) {
+ if (endian) {
+ /* use big endian here */
+ digest[i] = *result_ptr++;
+ } else {
+ /* use little endian here */
+ digest[VB2_SHA512_DIGEST_SIZE - i - 1] = *result_ptr++;
+ }
+ }
+ return digest;
+}
+
+uint8_t *cb_sha512(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ /* Returned the little endian SHA512 digest */
+ return cb_sha512_ex(data, len, digest, 0);
+}
\ No newline at end of file
--
To view, visit https://review.coreboot.org/c/coreboot/+/30831
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If828bde54c79e836a5b05ff0447645d7e06e819a
Gerrit-Change-Number: 30831
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-MessageType: newchange
Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31822
Change subject: soc/intel/braswell/acpi/lpc.asl: Allocate used ROM size only
......................................................................
soc/intel/braswell/acpi/lpc.asl: Allocate used ROM size only
Fixed ROM area is allocated.
Reduce the ROM size using CONFIG_COREBOOT_ROMSIZE.
BUG=N/A
TEST=Facebook FBG-1701 booting Embedded Linux
Change-Id: I7a47bf2600f546271c5a65641d29f868ff2748bf
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
---
M src/soc/intel/braswell/acpi/lpc.asl
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31822/1
diff --git a/src/soc/intel/braswell/acpi/lpc.asl b/src/soc/intel/braswell/acpi/lpc.asl
index 6b2ecec..a28eb38 100644
--- a/src/soc/intel/braswell/acpi/lpc.asl
+++ b/src/soc/intel/braswell/acpi/lpc.asl
@@ -3,7 +3,7 @@
*
* Copyright (C) 2007-2009 coresystems GmbH
* Copyright (C) 2013 Google Inc.
- * Copyright (C) 2018 Eltan B.V.
+ * Copyright (C) 2018-2019 Eltan B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -44,7 +44,10 @@
Name (_HID, EISAID("INT0800"))
Name (_CRS, ResourceTemplate()
{
- Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
+ Memory32Fixed(ReadOnly, 0xffffffff -
+ (CONFIG_COREBOOT_ROMSIZE_KB*1024) + 1,
+ CONFIG_COREBOOT_ROMSIZE_KB*1024)
+
})
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31822
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7a47bf2600f546271c5a65641d29f868ff2748bf
Gerrit-Change-Number: 31822
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-MessageType: newchange
Bora Guvendik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33818
Change subject: vendorcode/intel/fsp/fsp2_0/cnl: Update FSP header files for Cannonlake
......................................................................
vendorcode/intel/fsp/fsp2_0/cnl: Update FSP header files for Cannonlake
Update FSP header files with 7.0.64.40 version for Cannonlake platform.
Change-Id: If71e5fb8ae9f48a232b6b507e19145e1c06c2e83
Signed-off-by: Bora Guvendik <bora.guvendik(a)intel.com>
---
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspUpd.h
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspmUpd.h
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FspsUpd.h
M src/vendorcode/intel/fsp/fsp2_0/cannonlake/FsptUpd.h
4 files changed, 6,400 insertions(+), 6,381 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/33818/1
--
To view, visit https://review.coreboot.org/c/coreboot/+/33818
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If71e5fb8ae9f48a232b6b507e19145e1c06c2e83
Gerrit-Change-Number: 33818
Gerrit-PatchSet: 1
Gerrit-Owner: Bora Guvendik <bora.guvendik(a)intel.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33036
Change subject: sb/intel/common: Add a common interface to set final OPs settings
......................................................................
sb/intel/common: Add a common interface to set final OPs settings
This adds a common place to set the final opprefix, optype and opmenu,
with a hook to override the opmenu.
Change-Id: I162ae6bad7da3ea02b96854ee28e70594e210947
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/southbridge/intel/common/spi.c
A src/southbridge/intel/common/spi.h
2 files changed, 79 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/33036/1
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index bf2a44c..0794bb7 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -31,6 +31,8 @@
#include <spi-generic.h>
+#include "spi.h"
+
#define HSFC_FCYCLE_OFF 1 /* 1-2: FLASH Cycle */
#define HSFC_FCYCLE (0x3 << HSFC_FCYCLE_OFF)
#define HSFC_FDBC_OFF 8 /* 8-13: Flash Data Byte Count */
@@ -1041,6 +1043,45 @@
return 0;
}
+void spi_finalize_ops(void)
+{
+ ich_spi_controller *cntlr = &g_cntlr;
+ u16 spi_opprefix;;
+ u16 optype = 0;
+ struct intel_spi_config spi_config = {
+ {0x06, 0x50}, /* OPPREFIXES: EWSR and WREN */
+ { /* OPTYPE and OPCODE */
+ {0x01, WRITE_NO_ADDR}, /* WRSR: Write Status Register */
+ {0x02, WRITE_WITH_ADDR}, /* BYPR: Byte Program */
+ {0x03, READ_WITH_ADDR}, /* READ: Read Data */
+ {0x05, READ_NO_ADDR}, /* RDSR: Read Status Register */
+ {0x20, WRITE_WITH_ADDR}, /* SE20: Sector Erase 0x20 */
+ {0x9f, READ_NO_ADDR}, /* RDID: Read ID */
+ {0xd8, WRITE_WITH_ADDR}, /* BED8: Block Erase 0xd8 */
+ {0x0b, READ_WITH_ADDR}, /* FAST: Fast Read */
+ }
+ };
+ int i;
+
+ if (g_ichspi_lock)
+ return;
+
+ intel_southbridge_override_spi(&spi_config);
+
+ spi_opprefix = spi_config.opprefixes[0]
+ | (spi_config.opprefixes[1] << 8);
+ writew_(spi_opprefix, cntlr->preop);
+ for (i = 0; i < ARRAY_SIZE(spi_config.ops); i++) {
+ optype |= (spi_config.ops[i].type & 3) << (i * 2);
+ writeb_(spi_config.ops[i].op, &cntlr->opmenu[i]);
+ }
+ writew_(optype, &cntlr->optype);
+}
+
+__weak void intel_southbridge_override_spi(struct intel_spi_config *spi_config)
+{
+}
+
static const struct spi_ctrlr spi_ctrlr = {
.xfer_vector = xfer_vectors,
.max_xfer_size = member_size(ich9_spi_regs, fdata),
diff --git a/src/southbridge/intel/common/spi.h b/src/southbridge/intel/common/spi.h
new file mode 100644
index 0000000..fcc5cd8
--- /dev/null
+++ b/src/southbridge/intel/common/spi.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the coreboot project.
+
+ * 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; version 2 of
+ * the License.
+ *
+ * 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.
+ */
+
+#ifndef SOUTHBRIDGE_INTEL_SPI_H
+#define SOUTHBRIDGE_INTEL_SPI_H
+
+enum optype {
+ READ_NO_ADDR = 0,
+ WRITE_NO_ADDR = 1,
+ READ_WITH_ADDR = 2,
+ WRITE_WITH_ADDR = 3
+};
+
+struct intel_spi_op {
+ u8 op;
+ enum optype type;
+};
+
+struct intel_spi_config {
+ u8 opprefixes[2];
+ struct intel_spi_op ops[8];
+};
+
+void spi_finalize_ops(void);
+void intel_southbridge_override_spi(struct intel_spi_config *spi_config);
+
+#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/33036
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I162ae6bad7da3ea02b96854ee28e70594e210947
Gerrit-Change-Number: 33036
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange