the following patch was just integrated into master:
commit c1dc9d725ec9d91af1df99bb7da16e602996ac1b
Author: Timothy Pearson <tpearson(a)raptorengineering.com>
Date: Sun Jul 31 00:23:11 2016 -0500
util/cbfstool: Increase initrd offset to 64M
Newer Linux kernels fail to detect the initramfs using the old 16M
offset. Increase the offset to the minimum working value, 64M.
Tested-on: qemu pc, 64-bit virtual CPU, linux 4.6 x86_64
Change-Id: I8678fc33eec23ca8f5e0d58723e04d434cd9d732
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineering.com>
Reviewed-on: https://review.coreboot.org/15999
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
See https://review.coreboot.org/15999 for details.
-gerrit
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16009
-gerrit
commit 9bca3bfcca6691d4a03b9fd8ac3c63ce7c8e6733
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Aug 1 15:56:09 2016 +0200
i2c/w83795: Fix chip type message
(val & 4) == 1 is always false. Since val & 4 is either zero or
non-zero, just drop the second test (for "== 1").
Validated against the data sheet that this is really the right register,
bit and value.
Change-Id: I627df9a9b4fddfff486689e405f52a3b54135eef
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Found-by: Coverity Scan #1241864
---
src/drivers/i2c/w83795/w83795.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/drivers/i2c/w83795/w83795.c b/src/drivers/i2c/w83795/w83795.c
index 24da12c..02b7c37 100644
--- a/src/drivers/i2c/w83795/w83795.c
+++ b/src/drivers/i2c/w83795/w83795.c
@@ -160,7 +160,7 @@ static void w83795_init(struct device *dev, w83795_fan_mode_t mode, u8 dts_src)
val = w83795_read(dev, W83795_REG_CONFIG);
if ((val & W83795_REG_CONFIG_CONFIG48) == 0)
printk(BIOS_INFO, "Found 64 pin W83795G Nuvoton H/W Monitor\n");
- else if ((val & W83795_REG_CONFIG_CONFIG48) == 1)
+ else
printk(BIOS_INFO, "Found 48 pin W83795ADG Nuvoton H/W Monitor\n");
/* Reset */
Vadim Bendebury (vbendeb(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16000
-gerrit
commit 9aac1d3256a6407c765c2f9983178fcfdce7d4f8
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Sun Jul 31 11:19:20 2016 -0700
spi/tpm: read TPM version in larger chunks
The TPM version string has become much longer recently, and the
TPM_FW_VER register available on VID 1ae0 devices supports reading in
arbitrary size quantities.
Let's read 50 bytes at a time to reduce the SPI register read wrapper
overhead, and increase the length limit to 300 bytes to accommodate
longer version strings.
TEST=verified on the Kevin device:
localhost ~ # grep cr50 /sys/firmware/log
Firmware version: RO_A: 0.0.1/84e2dde7 RO_B:* 0.0.2/13eda43f RW_A:* cr50_v1.1.5005-444ddb7 RW_B: cr50_v1.1.5005-5aac83c
cr50_v1.1.5005-444ddb7 private-cr51:v0.0.66-bd9a0fe tpm2:v0.0.259-8f3d735 cryptoc:v0.0.4-5319e83 2016-07-31 10:58:05 vbendeb@kvasha
Change-Id: Ifaf28c1a9a3990372a9cec108c098edbe50d3243
Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
---
src/drivers/spi/tpm/tpm.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c
index 4de62d9..a63bc9b 100644
--- a/src/drivers/spi/tpm/tpm.c
+++ b/src/drivers/spi/tpm/tpm.c
@@ -359,8 +359,14 @@ int tpm2_init(struct spi_slave *spi_if)
/* Let's report device FW version if available. */
if (tpm_info.vendor_id == 0x1ae0) {
int chunk_count = 0;
- uint32_t chunk = 0;
- char vstr[sizeof(chunk) + 1]; /* room for 4 chars + zero */
+ size_t chunk_size;
+ /*
+ * let's read 50 bytes at a time; leave room for the trailing
+ * zero.
+ */
+ char vstr[51];
+
+ chunk_size = sizeof(vstr) - 1;
printk(BIOS_INFO, "Firmware version: ");
@@ -368,21 +374,20 @@ int tpm2_init(struct spi_slave *spi_if)
* Does not really matter what's written, this just makes sure
* the version is reported from the beginning.
*/
- tpm2_write_reg(TPM_FW_VER, &chunk, sizeof(chunk));
+ tpm2_write_reg(TPM_FW_VER, &chunk_size, sizeof(chunk_size));
- /* Print it out in 4 byte chunks. */
- vstr[sizeof(vstr) - 1] = 0;
+ /* Print it out in sizeof(vstr) - 1 byte chunks. */
+ vstr[chunk_size] = 0;
do {
- tpm2_read_reg(TPM_FW_VER, vstr, sizeof(chunk));
+ tpm2_read_reg(TPM_FW_VER, vstr, chunk_size);
printk(BIOS_INFO, "%s", vstr);
/*
- * While string is not over, and no more than 200
+ * While string is not over, and is no longer than 300
* characters.
- * This is likely result in one extra printk()
- * invocation with an empty string, not a big deal.
*/
- } while (vstr[0] && (chunk_count++ < (200 / sizeof(chunk))));
+ } while (vstr[chunk_size - 1] &&
+ (chunk_count++ < (300 / chunk_size)));
printk(BIOS_INFO, "\n");
}
Fabian Kunkel (fabi(a)adv.bruhnspace.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15564
-gerrit
commit 8f2ad66f8910b52620d7322b2e5d04d7967c9634
Author: Fabian Kunkel <fabi(a)adv.bruhnspace.com>
Date: Thu Jul 7 15:15:18 2016 +0200
superio/fintek/f81866d: Add support for UART 3/4
Pins for UART 3/4 are by default GPIO pins.
This patch sets the pins in UART mode.
Since UART 1/3 and 2/4 share the same interrupt line,
the patch needs to enable also shared interrupts.
Datasheet: Name: F81866D/A-I, Release Date: Jan 2012, Version: V0.12P
Link: http://www.alldatasheet.com/datasheet-pdf/pdf/459085/FINTEK/F81866AD-I.html
Change-Id: Ief5d70c8b25a2fb6cd787c45a52410e20b0eaf2e
Signed-off-by: Fabian Kunkel <fabi(a)adv.bruhnspace.com>
---
src/superio/fintek/f81866d/Makefile.inc | 2 +-
src/superio/fintek/f81866d/f81866d_uart.c | 67 ++++++++++++++++++++++++++++
src/superio/fintek/f81866d/fintek_internal.h | 1 +
src/superio/fintek/f81866d/superio.c | 16 +++++++
4 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/src/superio/fintek/f81866d/Makefile.inc b/src/superio/fintek/f81866d/Makefile.inc
index 8654659..b3fd34f 100644
--- a/src/superio/fintek/f81866d/Makefile.inc
+++ b/src/superio/fintek/f81866d/Makefile.inc
@@ -16,5 +16,5 @@
## GNU General Public License for more details.
##
-ramstage-$(CONFIG_SUPERIO_FINTEK_F81866D) += f81866d_hwm.c
+ramstage-$(CONFIG_SUPERIO_FINTEK_F81866D) += f81866d_hwm.c f81866d_uart.c
ramstage-$(CONFIG_SUPERIO_FINTEK_F81866D) += superio.c
diff --git a/src/superio/fintek/f81866d/f81866d_uart.c b/src/superio/fintek/f81866d/f81866d_uart.c
new file mode 100644
index 0000000..9172213
--- /dev/null
+++ b/src/superio/fintek/f81866d/f81866d_uart.c
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 BAP - Bruhnspace Advanced Projects
+ * (Written by Fabian Kunkel <fabi(a)adv.bruhnspace.com> for BAP)
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 <arch/io.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include "fintek_internal.h"
+#include "f81866d.h"
+
+#define LDN_REG 0x07
+#define PORT_SELECT_REGISTER 0x27
+#define MULTI_FUNC_SEL3_REG 0x29
+#define IRQ_SHARE_REGISTER 0xF0
+#define FIFO_SEL_MODE 0xF6
+
+/*
+ * f81866d_uart_init enables all necessary registers for UART 3/4
+ * Fintek needs to know if pins are used as GPIO or UART pins
+ * Share interrupt usage needs to be enabled
+ */
+void f81866d_uart_init(struct device *dev)
+{
+ struct resource *res = find_resource(dev, PNP_IDX_IO0);
+ u8 tmp;
+
+ if (!res) {
+ printk(BIOS_WARNING, "%s: No UART resource found.\n", __func__);
+ return;
+ }
+
+ pnp_enter_conf_mode(dev);
+
+ // Set Port Select Register (Bit 0) = 0
+ // before accessing Multi Function Select 3 Register
+ tmp = pnp_read_config(dev, PORT_SELECT_REGISTER);
+ pnp_write_config(dev, PORT_SELECT_REGISTER, tmp & 0xFE);
+
+ // Set UART 3 function (Bit 4/5), otherwise pin 36-46 are GPIO
+ // Set UART 4 function (Bit 6/7), otherwise pin 44-51 are GPIO
+ tmp = pnp_read_config(dev, MULTI_FUNC_SEL3_REG);
+ pnp_write_config(dev, MULTI_FUNC_SEL3_REG, tmp | 0xF0);
+
+ // Select UART X in LDN register
+ pnp_write_config(dev, LDN_REG, dev->path.pnp.device & 0xff);
+ // Set IRQ trigger mode from active low to high (Bit 3)
+ tmp = pnp_read_config(dev, FIFO_SEL_MODE);
+ pnp_write_config(dev, FIFO_SEL_MODE, tmp | 0x8);
+ // Enable share interrupt (Bit 0)
+ pnp_write_config(dev, IRQ_SHARE_REGISTER, 0x01);
+
+ pnp_exit_conf_mode(dev);
+}
diff --git a/src/superio/fintek/f81866d/fintek_internal.h b/src/superio/fintek/f81866d/fintek_internal.h
index 0405e3e..977a47d 100644
--- a/src/superio/fintek/f81866d/fintek_internal.h
+++ b/src/superio/fintek/f81866d/fintek_internal.h
@@ -23,5 +23,6 @@
#include <device/pnp.h>
void f81866d_hwm_init(struct device *dev);
+void f81866d_uart_init(struct device *dev);
#endif /* SUPERIO_FINTEK_F81866D_INTERNAL_H */
diff --git a/src/superio/fintek/f81866d/superio.c b/src/superio/fintek/f81866d/superio.c
index a616290..775e2e8 100644
--- a/src/superio/fintek/f81866d/superio.c
+++ b/src/superio/fintek/f81866d/superio.c
@@ -40,6 +40,22 @@ static void f81866d_init(struct device *dev)
// Fixing temp sensor read out and init Fan control
f81866d_hwm_init(dev);
break;
+ case F81866D_SP1:
+ // Enable Uart1 and IRQ share register
+ f81866d_uart_init(dev);
+ break;
+ case F81866D_SP2:
+ // Enable Uart2 and IRQ share register
+ f81866d_uart_init(dev);
+ break;
+ case F81866D_SP3:
+ // Enable Uart3 and IRQ share register
+ f81866d_uart_init(dev);
+ break;
+ case F81866D_SP4:
+ // Enable Uart4 and IRQ share register
+ f81866d_uart_init(dev);
+ break;
}
}
Vadim Bendebury (vbendeb(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16000
-gerrit
commit 7bf8f93d28e87d5011cef5bd4dd6dabd4fb753b0
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Sun Jul 31 11:19:20 2016 -0700
spi/tpm: read TPM version in larger chunks
The TPM version string has become much longer recently, and the
TPM_FW_VER register available on VID 1ae0 devices supports reading in
arbitrary size quantities.
Let's increase the string length limit to 300 bytes read 50 bytes at a
time to reduce the SPI register read wrapper overhead.
TEST=verified on the Kevin device:
localhost ~ # grep cr50 /sys/firmware/log
Firmware version: RO_A: 0.0.1/84e2dde7 RO_B:* 0.0.2/13eda43f RW_A:* cr50_v1.1.5005-444ddb7 RW_B: cr50_v1.1.5005-5aac83c
cr50_v1.1.5005-444ddb7 private-cr51:v0.0.66-bd9a0fe tpm2:v0.0.259-8f3d735 cryptoc:v0.0.4-5319e83 2016-07-31 10:58:05 vbendeb@kvasha
Change-Id: Ifaf28c1a9a3990372a9cec108c098edbe50d3243
Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
---
src/drivers/spi/tpm/tpm.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c
index 4de62d9..a63bc9b 100644
--- a/src/drivers/spi/tpm/tpm.c
+++ b/src/drivers/spi/tpm/tpm.c
@@ -359,8 +359,14 @@ int tpm2_init(struct spi_slave *spi_if)
/* Let's report device FW version if available. */
if (tpm_info.vendor_id == 0x1ae0) {
int chunk_count = 0;
- uint32_t chunk = 0;
- char vstr[sizeof(chunk) + 1]; /* room for 4 chars + zero */
+ size_t chunk_size;
+ /*
+ * let's read 50 bytes at a time; leave room for the trailing
+ * zero.
+ */
+ char vstr[51];
+
+ chunk_size = sizeof(vstr) - 1;
printk(BIOS_INFO, "Firmware version: ");
@@ -368,21 +374,20 @@ int tpm2_init(struct spi_slave *spi_if)
* Does not really matter what's written, this just makes sure
* the version is reported from the beginning.
*/
- tpm2_write_reg(TPM_FW_VER, &chunk, sizeof(chunk));
+ tpm2_write_reg(TPM_FW_VER, &chunk_size, sizeof(chunk_size));
- /* Print it out in 4 byte chunks. */
- vstr[sizeof(vstr) - 1] = 0;
+ /* Print it out in sizeof(vstr) - 1 byte chunks. */
+ vstr[chunk_size] = 0;
do {
- tpm2_read_reg(TPM_FW_VER, vstr, sizeof(chunk));
+ tpm2_read_reg(TPM_FW_VER, vstr, chunk_size);
printk(BIOS_INFO, "%s", vstr);
/*
- * While string is not over, and no more than 200
+ * While string is not over, and is no longer than 300
* characters.
- * This is likely result in one extra printk()
- * invocation with an empty string, not a big deal.
*/
- } while (vstr[0] && (chunk_count++ < (200 / sizeof(chunk))));
+ } while (vstr[chunk_size - 1] &&
+ (chunk_count++ < (300 / chunk_size)));
printk(BIOS_INFO, "\n");
}