Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35725 )
Change subject: device/software_i2c: Add function to recover bus
......................................................................
device/software_i2c: Add function to recover bus
As the software bus might be in unknown state, add a function to reset
it to known (idle) state.
Copied from linux kernel.
Tested on Supermicro X11SSH-TF.
Change-Id: I264471e872cb353b28a6b71cc64a11aec59e63f2
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/device/software_i2c.c
M src/include/device/i2c_simple.h
2 files changed, 48 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/35725/1
diff --git a/src/device/software_i2c.c b/src/device/software_i2c.c
index 5dc9990..eecb670 100644
--- a/src/device/software_i2c.c
+++ b/src/device/software_i2c.c
@@ -343,3 +343,49 @@
"SDA %d, SCL %d\n", bus, bits, software_i2c[bus]->get_sda(bus),
software_i2c[bus]->get_scl(bus));
}
+
+/*
+ * Try to recover the bus from unknown state.
+ * Useful if the power rail or reset line isn't under firmware control.
+ */
+#define RECOVERY_CLK_CNT 9
+
+int i2c_recover_bus(unsigned bus)
+{
+ int i = 0, scl = 1;
+
+ printk(BIOS_INFO, "software_i2c(%d): Trying i2c bus recovery\n", bus);
+
+ /*
+ * If we can set SDA, we will always create a STOP to ensure additional
+ * pulses will do no harm. This is achieved by letting SDA follow SCL
+ * half a cycle later. Check the 'incomplete_write_byte' fault injector
+ * for details.
+ */
+ software_i2c[bus]->set_scl(bus, 1);
+ wait(bus);
+ software_i2c[bus]->set_sda(bus, 1);
+ wait(bus);
+
+ /*
+ * By this time SCL is high, as we need to give 9 falling-rising edges
+ */
+ while (i++ < RECOVERY_CLK_CNT * 2) {
+ if (scl) {
+ /* SCL shouldn't be low here */
+ if (!software_i2c[bus]->get_scl(bus)) {
+ printk(BIOS_ERR, "software_i2c(%d): SCL stuck low\n", bus);
+ return 1;
+ break;
+ }
+ }
+
+ scl = !scl;
+ software_i2c[bus]->set_scl(bus, scl);
+ /* Creating STOP again, see above */
+ wait(bus);
+ software_i2c[bus]->set_sda(bus, scl);
+ wait(bus);
+ }
+ return 0;
+}
diff --git a/src/include/device/i2c_simple.h b/src/include/device/i2c_simple.h
index e3cc892..7f508b2 100644
--- a/src/include/device/i2c_simple.h
+++ b/src/include/device/i2c_simple.h
@@ -45,6 +45,8 @@
int i2c_write_field(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t data,
uint8_t mask, uint8_t shift);
+int i2c_recover_bus(unsigned int bus);
+
/*
* software_i2c is supposed to be a debug feature. It's usually not compiled in,
* but when it is it can be dynamically enabled at runtime for certain busses.
--
To view, visit https://review.coreboot.org/c/coreboot/+/35725
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I264471e872cb353b28a6b71cc64a11aec59e63f2
Gerrit-Change-Number: 35725
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Rizwan Qureshi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35402 )
Change subject: soc/intel/common/block/cse: Add boot partition related APIs
......................................................................
Patch Set 41:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35402/38/src/soc/intel/common/bloc…
File src/soc/intel/common/block/cse/cse_bp.c:
https://review.coreboot.org/c/coreboot/+/35402/38/src/soc/intel/common/bloc…
PS38, Line 103: force_cse_init
> cse_init_bp_info() call is must in every API to intialize boot partition info. […]
Then you don't need this complicated implementation. you only need 2 things
1. You just need one variable which says whether information is initialized or not.
which you already have as part of "total_number_of_bp" or you can create a new variable.
2. just update the info wherever you are modifying it. You are doing it in only 1 place i.e., in cse_set_next_boot_partition().
--
To view, visit https://review.coreboot.org/c/coreboot/+/35402
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iaa62409c0616d5913d21374a8a6804f82258eb4f
Gerrit-Change-Number: 35402
Gerrit-PatchSet: 41
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Andrey Petrov <anpetrov(a)fb.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Wed, 11 Dec 2019 12:12:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Comment-In-Reply-To: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-MessageType: comment
Hello Frans Hendriks,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/37615
to review the following change.
Change subject: mb/{facebook/portwell}; Remove empty onboard.h
......................................................................
mb/{facebook/portwell}; Remove empty onboard.h
Defines in onboard.h are moved to other files.
Remove this empty and unused file.
BUG=N/A
TEST=build
Change-Id: Ide10b352eadcffad2d4221865124f64466af5a1c
Signed-off-by: Wim Vervoorn <wvervoorn(a)eltan.com>
---
D src/mainboard/facebook/fbg1701/onboard.h
D src/mainboard/portwell/m107/onboard.h
2 files changed, 0 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/37615/1
diff --git a/src/mainboard/facebook/fbg1701/onboard.h b/src/mainboard/facebook/fbg1701/onboard.h
deleted file mode 100644
index e69de29..0000000
--- a/src/mainboard/facebook/fbg1701/onboard.h
+++ /dev/null
diff --git a/src/mainboard/portwell/m107/onboard.h b/src/mainboard/portwell/m107/onboard.h
deleted file mode 100644
index 3a5dee2..0000000
--- a/src/mainboard/portwell/m107/onboard.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2013 Google Inc.
- * Copyright (C) 2015 Intel Corp.
- * 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 ONBOARD_H
-#define ONBOARD_H
-
-/* SD CARD gpio */
-#define SDCARD_CD 81 /* Not used */
-
-#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/37615
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ide10b352eadcffad2d4221865124f64466af5a1c
Gerrit-Change-Number: 37615
Gerrit-PatchSet: 1
Gerrit-Owner: Wim Vervoorn <wvervoorn(a)eltan.com>
Gerrit-Reviewer: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-Reviewer: Wim Vervoorn <wvervoorn(a)eltan.com>
Gerrit-MessageType: newchange
Hello Frans Hendriks,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/37614
to review the following change.
Change subject: mb/facebook/fbg1701: Move verified items to board_verified_boot.h
......................................................................
mb/facebook/fbg1701: Move verified items to board_verified_boot.h
Items in onboard.h are related to verified or measured boot.
Move the items to board_verified_boot.h and remove onboard.h.
BUG=N/A
TEST=build
Change-Id: Icfc8d6d8351f0654c277e81c7f3cc2b0a947866a
Signed-off-by: Wim Vervoorn <wvervoorn(a)eltan.com>
---
M src/mainboard/facebook/fbg1701/board_mboot.h
M src/mainboard/facebook/fbg1701/board_verified_boot.h
M src/mainboard/facebook/fbg1701/onboard.h
3 files changed, 11 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/37614/1
diff --git a/src/mainboard/facebook/fbg1701/board_mboot.h b/src/mainboard/facebook/fbg1701/board_mboot.h
index 5cfb091..69272de 100644
--- a/src/mainboard/facebook/fbg1701/board_mboot.h
+++ b/src/mainboard/facebook/fbg1701/board_mboot.h
@@ -14,6 +14,7 @@
*/
#include <mboot.h>
+#include "board_verified_boot.h"
const mboot_measure_item_t mb_log_list[] = {
{ "config", CBFS_TYPE_RAW, MBOOT_PCR_INDEX_0, EV_NO_ACTION, NULL },
diff --git a/src/mainboard/facebook/fbg1701/board_verified_boot.h b/src/mainboard/facebook/fbg1701/board_verified_boot.h
index 0f79579..20f5328 100644
--- a/src/mainboard/facebook/fbg1701/board_verified_boot.h
+++ b/src/mainboard/facebook/fbg1701/board_verified_boot.h
@@ -17,6 +17,15 @@
#define BOARD_VERIFIED_BOOT_H
#include <vboot_check.h>
-#include "onboard.h"
+
+/* Define the items to be measured or verified */
+#define FSP (const char *)"fsp.bin"
+#define CMOS_LAYOUT (const char *)"cmos_layout.bin"
+#define RAMSTAGE (const char *)CONFIG_CBFS_PREFIX"/ramstage"
+#define ROMSTAGE (const char *)CONFIG_CBFS_PREFIX"/romstage"
+#define PAYLOAD (const char *)CONFIG_CBFS_PREFIX"/payload"
+#define POSTCAR (const char *)CONFIG_CBFS_PREFIX"/postcar"
+#define OP_ROM_VBT (const char *)"vbt.bin"
+#define MICROCODE (const char *)"cpu_microcode_blob.bin"
#endif
diff --git a/src/mainboard/facebook/fbg1701/onboard.h b/src/mainboard/facebook/fbg1701/onboard.h
index 715f76a..e69de29 100644
--- a/src/mainboard/facebook/fbg1701/onboard.h
+++ b/src/mainboard/facebook/fbg1701/onboard.h
@@ -1,31 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2013 Google Inc.
- * Copyright (C) 2015 Intel Corp.
- * 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 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 ONBOARD_H
-#define ONBOARD_H
-
-/* Define the items to be measured or verified */
-#define FSP (const char *)"fsp.bin"
-#define CMOS_LAYOUT (const char *)"cmos_layout.bin"
-#define RAMSTAGE (const char *)CONFIG_CBFS_PREFIX"/ramstage"
-#define ROMSTAGE (const char *)CONFIG_CBFS_PREFIX"/romstage"
-#define PAYLOAD (const char *)CONFIG_CBFS_PREFIX"/payload"
-#define POSTCAR (const char *)CONFIG_CBFS_PREFIX"/postcar"
-#define OP_ROM_VBT (const char *)"vbt.bin"
-#define MICROCODE (const char *)"cpu_microcode_blob.bin"
-
-#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/37614
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icfc8d6d8351f0654c277e81c7f3cc2b0a947866a
Gerrit-Change-Number: 37614
Gerrit-PatchSet: 1
Gerrit-Owner: Wim Vervoorn <wvervoorn(a)eltan.com>
Gerrit-Reviewer: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-Reviewer: Wim Vervoorn <wvervoorn(a)eltan.com>
Gerrit-MessageType: newchange
Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36824 )
Change subject: mb/amd/padmelon: Use Prairie Falcon configuration
......................................................................
mb/amd/padmelon: Use Prairie Falcon configuration
While Merlin Falcon binaries are not available, make it explicit that it's
compiling for Prairie Falcon (it was being surreptitious about it).
Board Padmelon accepts 3 different SOC, just changing some resistors
(soldered or not): Brown Falcon, Prairie Falcon and Merlin Falcon. Code for
Brown Falcon is not currently available.
BUG=None
TEST=Build with prairie falcon.
Change-Id: I1663e4403a32a7d626dd2fa06763f18f4230457e
Signed-off-by: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
---
M src/mainboard/amd/padmelon/Kconfig
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/36824/1
diff --git a/src/mainboard/amd/padmelon/Kconfig b/src/mainboard/amd/padmelon/Kconfig
index 3d8efb1..5179ca7 100644
--- a/src/mainboard/amd/padmelon/Kconfig
+++ b/src/mainboard/amd/padmelon/Kconfig
@@ -17,7 +17,7 @@
config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
- select SOC_AMD_MERLINFALCON
+ select SOC_AMD_PRAIRIEFALCON
select BOARD_ROMSIZE_KB_8192
select DRIVERS_I2C_GENERIC
select DRIVERS_PS2_KEYBOARD
--
To view, visit https://review.coreboot.org/c/coreboot/+/36824
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1663e4403a32a7d626dd2fa06763f18f4230457e
Gerrit-Change-Number: 36824
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-MessageType: newchange