Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8385
-gerrit
commit 1a71c71eb47d2697d1d974229c2d7dfabe831bf1
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sat Feb 7 07:07:16 2015 +0200
AMD cimx/sb800: Disable unused GPP ports
If devicetree.cb has GPP port off, really disable it before even
trying to do link training.
Change-Id: I810945da28d86768e88249dc4d29a50ad9f9959b
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/vendorcode/amd/cimx/sb800/Gpp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/vendorcode/amd/cimx/sb800/Gpp.c b/src/vendorcode/amd/cimx/sb800/Gpp.c
index 6f3bb7c..ae7f3ce 100644
--- a/src/vendorcode/amd/cimx/sb800/Gpp.c
+++ b/src/vendorcode/amd/cimx/sb800/Gpp.c
@@ -293,7 +293,10 @@ PreInitGppLink (
// Mask out non-applicable ports according to the target link configuration mode
for ( portId = 0; portId < MAX_GPP_PORTS; portId++ ) {
- pConfig->PORTCONFIG[portId].PortCfg.PortPresent &= (reg32Value >> portId) & BIT0;
+ if (!(reg32Value & (1 << portId)))
+ pConfig->PORTCONFIG[portId].PortCfg.PortPresent = false;
+ else if (!pConfig->PORTCONFIG[portId].PortCfg.PortPresent)
+ reg32Value &= ~(1 << portId);
}
//
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8383
-gerrit
commit 46578c8c5b63dd5485f69bdcc8076cfdf8c220e3
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sat Feb 7 09:13:02 2015 +0200
drivers/pc80/mc146818rtc: Fix checksum range test
When writing multiple bytes, only the last address was tested
if it was in LB_CKS_RANGE.
Change-Id: I34c0484e9758ef88e7005d0599f6055dc4f4fc59
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/drivers/pc80/mc146818rtc.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c
index b18f22f..030980a 100644
--- a/src/drivers/pc80/mc146818rtc.c
+++ b/src/drivers/pc80/mc146818rtc.c
@@ -243,11 +243,19 @@ static enum cb_err set_cmos_value(unsigned long bit, unsigned long length,
unsigned long byte,byte_bit;
unsigned long i;
unsigned char uchar, mask;
- unsigned int chksum_update_needed = 0;
+ unsigned int chksum_update_needed = 1;
ret = vret;
byte = bit / 8; /* find the byte where the data starts */
byte_bit = bit % 8; /* find the bit where the data starts */
+
+ if (length == 0)
+ return CB_SUCCESS;
+
+ /* Check if write stays outside of LB_CKS_RANGE. */
+ if ((byte + (length-1)/8 < LB_CKS_RANGE_START) || (byte > LB_CKS_RANGE_END))
+ chksum_update_needed = 0;
+
if (length <= 8) { /* one byte or less */
mask = (1 << length) - 1;
mask <<= byte_bit;
@@ -256,23 +264,18 @@ static enum cb_err set_cmos_value(unsigned long bit, unsigned long length,
uchar &= ~mask;
uchar |= (ret[0] << byte_bit);
cmos_write(uchar, byte);
- if (byte >= LB_CKS_RANGE_START && byte <= LB_CKS_RANGE_END)
- chksum_update_needed = 1;
} else { /* more that one byte so transfer the whole bytes */
if (byte_bit || length % 8)
return CB_ERR_ARG;
for (i = 0; length; i++, length -= 8, byte++)
cmos_write(ret[i], byte);
- if (byte >= LB_CKS_RANGE_START &&
- byte <= LB_CKS_RANGE_END)
- chksum_update_needed = 1;
}
- if (chksum_update_needed) {
+ if (chksum_update_needed)
cmos_set_checksum(LB_CKS_RANGE_START, LB_CKS_RANGE_END,
LB_CKS_LOC);
- }
+
return CB_SUCCESS;
}