Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/28431
to look at the new patch set (#2).
Change subject: util/lint: update whitespace checking rules
......................................................................
util/lint: update whitespace checking rules
- Check payloads, the root Makefiles and toolchain.inc
- 3rdparty is already not checked, so remove
- The marks around COPYING, LICENSE, and README were not needed
- Skip checking .ico files
Change-Id: Ic4a1709224604b36362d82e249c2916fca0336a2
Signed-off-by: Martin Roth <martinr(a)coreboot.org>
---
M util/lint/lint-stable-003-whitespace
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/28431/2
--
To view, visit https://review.coreboot.org/28431
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic4a1709224604b36362d82e249c2916fca0336a2
Gerrit-Change-Number: 28431
Gerrit-PatchSet: 2
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Werner Zeh <werner.zeh(a)siemens.com>
Martin Roth has posted comments on this change. ( https://review.coreboot.org/28431 )
Change subject: util/lint: update whitespace checking rules
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/28431/1/util/lint/lint-stable-003-whitespace
File util/lint/lint-stable-003-whitespace:
https://review.coreboot.org/#/c/28431/1/util/lint/lint-stable-003-whitespac…
PS1, Line 19: Make*
> Do you plan to have something else than Makefile*?
No. This is to pick up Makefile and Makefile.inc.
I'll update to Makefile*
--
To view, visit https://review.coreboot.org/28431
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4a1709224604b36362d82e249c2916fca0336a2
Gerrit-Change-Number: 28431
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Comment-Date: Mon, 03 Sep 2018 18:56:44 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/28446
Change subject: lib/gpio.c: Check num_gpio
......................................................................
lib/gpio.c: Check num_gpio
Several functions in src/lib/gpio.c don't check for valid number of gpio,
which must be at least 1 and at most 32 (due to returning int). Create a
function to execute the test, and call it from wherever needed.
BUG=b:113788440
TEST=Add a fake code to southbridge_final calling the functions with and
without valid num_gpio, printing the result. Build and boot grunt, check
results.
Change-Id: I08c47fcd784e14e25ec1409571c1e59cb2e50ed8
Signed-off-by: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
---
M src/lib/gpio.c
1 file changed, 12 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/28446/1
diff --git a/src/lib/gpio.c b/src/lib/gpio.c
index 4549166..001994a 100644
--- a/src/lib/gpio.c
+++ b/src/lib/gpio.c
@@ -20,6 +20,13 @@
#include <delay.h>
#include <gpio.h>
+static void _check_num(const char *name, int num)
+{
+ if ((num > 32) && (num < 1)) {
+ printk(BIOS_WARNING, "%s: %d ", name, num);
+ die("is an invalid number of GPIOs");
+ }
+}
static uint32_t _gpio_base2_value(const gpio_t gpio[], int num_gpio)
{
uint32_t result = 0;
@@ -38,6 +45,7 @@
{
int i;
+ _check_num(__func__, num_gpio);
for (i = 0; i < num_gpio; i++)
gpio_input(gpio[i]);
@@ -48,6 +56,7 @@
{
int i;
+ _check_num(__func__, num_gpio);
for (i = 0; i < num_gpio; i++)
gpio_input_pulldown(gpio[i]);
@@ -58,6 +67,7 @@
{
int i;
+ _check_num(__func__, num_gpio);
for (i = 0; i < num_gpio; i++)
gpio_input_pullup(gpio[i]);
@@ -82,8 +92,8 @@
int index;
int temp;
char value[32];
- if ((num_gpio > 32) && (num_gpio < 1))
- die("gpio_base3_value: Invalid number of GPIOs");
+
+ _check_num(__func__, num_gpio);
/* Enable internal pull up */
for (index = 0; index < num_gpio; ++index)
--
To view, visit https://review.coreboot.org/28446
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08c47fcd784e14e25ec1409571c1e59cb2e50ed8
Gerrit-Change-Number: 28446
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/28445
Change subject: lib/gpio.c: Fix _gpio_base3_value invalid shift
......................................................................
lib/gpio.c: Fix _gpio_base3_value invalid shift
In function _gpio_base3_value(), if gpio_num is 32 and gpio[31] is floating,
the end result is 1 << 32, which does not fit into a int. To avoid a possible
error, in this condition set value to 0xffffffff.
Add a comment explaining why and the work around.
BUG=b:113788440
TEST=Add a fake code to southbridge_final calling the function and printing
the result. Build and boot grunt, check result.
Change-Id: I0b79725bcbaf120587c7440e176643aaa7a1d5bb
Signed-off-by: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
---
M src/lib/gpio.c
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/28445/1
diff --git a/src/lib/gpio.c b/src/lib/gpio.c
index da74849..4549166 100644
--- a/src/lib/gpio.c
+++ b/src/lib/gpio.c
@@ -75,7 +75,7 @@
* internally pulled to.
*/
- static const char tristate_char[] = {[0] = '0', [1] = '1', [Z] = 'Z'};
+ static const char tristate_char[] = {[0] = '0', [1] = '1', [2] = 'Z'};
uint32_t result = 0;
int has_z = 0;
int binary_below = 0;
@@ -138,6 +138,14 @@
* '2' at 3^1: Add 2^(1+1) = 4 to account for binaries 1000-1011
* Stop adding for lower digits (3^0), all already accounted
* now. We know that there can be no binary numbers 1020-102X.
+ *
+ * If gpio_num is 32 and gpio[31] is floating, the end result is
+ * 1 << 32, which does not fit into a int. To avoid a possible
+ * error, in this condition the value will be set to 0xffffffff.
+ * There's a second condition which would set this value, to
+ * have all inputs as 1. To differentiate between these results,
+ * the caller needs to test if gpio[31] is floating. If gpio_num
+ * is less than 32, no care is needed.
*/
if (binary_first && !has_z) {
switch (temp) {
@@ -147,7 +155,10 @@
binary_below += 1 << index;
break;
case 2: /* Account for binaries 0 to 2^(index+1) - 1. */
- binary_below += 1 << (index + 1);
+ if (index >= 31)
+ binary_below = 0xffffffff;
+ else
+ binary_below += 1 << (index + 1);
has_z = 1;
}
}
--
To view, visit https://review.coreboot.org/28445
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b79725bcbaf120587c7440e176643aaa7a1d5bb
Gerrit-Change-Number: 28445
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/28443
to look at the new patch set (#2).
Change subject: cpu/intel/model_206ax: detect number of MCE banks
......................................................................
cpu/intel/model_206ax: detect number of MCE banks
My CPU (3770k) supports 9 MCE banks, but the code is hardcoded to reset
only 7. This causes Linux to spuriously log errors during boot and S3
resume.
Fix this by reading the real value from the right MSR.
Change-Id: Id05645009259fd77b4de49bde518361eeae46617
Signed-off-by: Dan Elkouby <streetwalkermc(a)gmail.com>
---
M src/cpu/intel/model_206ax/model_206ax.h
M src/cpu/intel/model_206ax/model_206ax_init.c
2 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/28443/2
--
To view, visit https://review.coreboot.org/28443
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id05645009259fd77b4de49bde518361eeae46617
Gerrit-Change-Number: 28443
Gerrit-PatchSet: 2
Gerrit-Owner: Dan Elkouby <streetwalkermc(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>