Christian Gmeiner (christian.gmeiner(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2527
-gerrit
commit e4607d6d5f494facca0ef59bfb3625abcbc0309c
Author: Christian Gmeiner <christian.gmeiner(a)gmail.com>
Date: Tue Feb 26 14:24:17 2013 +0100
OT200: reset MFGTP7 (backlight pwm)
The CS5536 companion device has three different power domains.
* working domain
* standby domain
* RTC domain
When the system is "off" only the standby domain is powered.
MFGPT[7:6] are member of the standby power domain.
MFGPT7 is used to control the backlight of the device and so the
timer gets used and configured during system boot. If the system
does a reboot the timer stays configured and the Linux driver
can not use it:
"ot200-backlight: ot200-backlight.0: MFGPT 7 not availale"
The cs5535-mfgpt has a function to hard-reset all MFGPTs but the
system hangs after the first access to a MFGPT register - cause
unknown.
/*
* This is a sledgehammer that resets all MFGPT timers. This is required by
* some broken BIOSes which leave the system in an unstable state
* (TinyBIOS 0.98, for example; fixed in 0.99). It's uncertain as to
* whether or not this secret MSR can be used to release individual timers.
* Jordan tells me that he and Mitch once played w/ it, but it's unclear
* what the results of that were (and they experienced some instability).
*/
static void reset_all_timers(void)
{
uint32_t val, dummy;
/* The following undocumented bit resets the MFGPT timers */
val = 0xFF; dummy = 0;
wrmsr(MSR_MFGPT_SETUP, val, dummy);
}
After playing around with this undocumented MSR it looks like I only
need to set bit 7 to free the MFGPT7.
BTW, all MFGPT[0:5] will be reset during pll_reset().
Change-Id: I54a8d479ce495b0fc2f54db766a8d793bbb5d704
Signed-off-by: Christian Gmeiner <christian.gmeiner(a)gmail.com>
---
src/mainboard/bachmann/ot200/mainboard.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/mainboard/bachmann/ot200/mainboard.c b/src/mainboard/bachmann/ot200/mainboard.c
index f8aefec..ed70376 100644
--- a/src/mainboard/bachmann/ot200/mainboard.c
+++ b/src/mainboard/bachmann/ot200/mainboard.c
@@ -21,6 +21,7 @@
#include <device/smbus.h>
#include <smbios.h>
#include <console/console.h>
+#include <cpu/x86/msr.h>
/* overwrite a weak function to fill SMBIOS table with a custom value */
static u8 hw_rev = 0;
@@ -43,6 +44,7 @@ static void init(struct device *dev)
unsigned int i;
u32 chksum = 0;
char block[20];
+ msr_t reset;
device_t eeprom_dev = dev_find_slot_on_smbus(1, 0x52);
if (eeprom_dev == 0) {
@@ -63,6 +65,11 @@ static void init(struct device *dev)
hw_rev = block[5];
printk(BIOS_DEBUG, "hw revision: %u\n", hw_rev);
+
+ /* Reset MFGPT7 (standby power domain) */
+ reset = rdmsr(0x5140002b);
+ reset.lo = 1 << 7;
+ wrmsr(0x5140002b, reset);
}
static void mainboard_enable(struct device *dev)
Jens Rottmann (JRottmann(a)LiPPERTembedded.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2454
-gerrit
commit 2cb3675e5f92acea85a3c1d75bf4f30693d18370
Author: Jens Rottmann <JRottmann(a)LiPPERTembedded.de>
Date: Tue Feb 19 15:01:06 2013 +0100
AMD SB800: don't switch clock from 14 to 48 MHz for smscsuperio
The power up default for the 14M_25M_48M_OSC switchable clock output ball of
the SB800 chipset is 14 MHz. sb800/bootblock.c changes this to 48 MHz,
which is the correct value for almost all SIOs. However, not for
'smscsuperio' (SMSC SCH311x), which needs the original 14 MHz and is not
configurable for other clock speeds. A wrong SIO clock supply results in
funny RS232 output (wrong bit speed) and non-working PS/2.
We could switch back to 14 MHz in the mainboard's romstage.c, but then the
clock frequency would change twice. The resulting short 48 MHz burst causes
a handful of rubbish characters on RS232 on every boot until the SIO clock
has stabilized again.
This patch skips the SB800 clock switch if the SIO Kconfig requests 14 MHz.
This does not affect any boards currently in the repository (yet).
Change-Id: Icff41fd88dc41c08f3700ab4f786852f04eff2a4
Signed-off-by: Jens Rottmann <JRottmann(a)LiPPERTembedded.de>
---
src/southbridge/amd/cimx/sb800/bootblock.c | 13 ++++++++++---
src/superio/Kconfig | 3 +++
src/superio/smsc/Kconfig | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/southbridge/amd/cimx/sb800/bootblock.c b/src/southbridge/amd/cimx/sb800/bootblock.c
index 0a339b0..030ddc6 100644
--- a/src/southbridge/amd/cimx/sb800/bootblock.c
+++ b/src/southbridge/amd/cimx/sb800/bootblock.c
@@ -97,10 +97,17 @@ static void enable_clocks(void)
reg8 &= ~(1 << 1);
outb(reg8, 0xCD7);
- // Program SB800 MiscCntrl Device_CLK1_sel for 48 MHz (default is 14 MHz)
+ // Program SB800 MiscClkCntrl register to configure clock output on the
+ // 14M_25M_48M_OSC ball usually used for the Super-I/O.
+ // Almost all SIOs need 48 MHz, only the SMSC SCH311x wants 14 MHz,
+ // which is the SB800's power up default. We could switch back to 14
+ // in the mainboard's romstage.c, but then the clock frequency would
+ // change twice.
reg32 = *acpi_mmio;
- reg32 &= ~((1 << 0) | (1 << 2));
- reg32 |= 1 << 1;
+ reg32 &= ~((1 << 2) | (3 << 0)); // enable, 14 MHz (power up default)
+#if !CONFIG_SUPERIO_WANTS_14MHZ_CLOCK
+ reg32 |= 2 << 0; // Device_CLK1_sel = 48 MHz
+#endif
*acpi_mmio = reg32;
}
diff --git a/src/superio/Kconfig b/src/superio/Kconfig
index 00fee97..d0ca249 100644
--- a/src/superio/Kconfig
+++ b/src/superio/Kconfig
@@ -17,6 +17,9 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+config SUPERIO_WANTS_14MHZ_CLOCK
+ bool
+
source src/superio/fintek/Kconfig
source src/superio/intel/Kconfig
source src/superio/ite/Kconfig
diff --git a/src/superio/smsc/Kconfig b/src/superio/smsc/Kconfig
index 8d66fc5..1a3b709 100644
--- a/src/superio/smsc/Kconfig
+++ b/src/superio/smsc/Kconfig
@@ -44,6 +44,7 @@ config SUPERIO_SMSC_MEC1308
bool
config SUPERIO_SMSC_SMSCSUPERIO
bool
+ select SUPERIO_WANTS_14MHZ_CLOCK
config SUPERIO_SMSC_SIO1036
bool
config SUPERIO_SMSC_SCH4037
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2483
-gerrit
commit 5ffb6d6e4cadd548cfd9017a48a1d40f216e570e
Author: Zheng Bao <fishbaozi(a)gmail.com>
Date: Tue Feb 26 18:10:52 2013 +0800
documentation: Complete the AMD-S3.txt
Fix some typos and finish empty sections.
Change-Id: I08cc971e763252b035ab8ed2118180140e34ac72
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: Zheng Bao <fishbaozi(a)gmail.com>
---
documentation/AMD-S3.txt | 37 +++++++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)
diff --git a/documentation/AMD-S3.txt b/documentation/AMD-S3.txt
index 1ef87c0..48d4c8f 100644
--- a/documentation/AMD-S3.txt
+++ b/documentation/AMD-S3.txt
@@ -13,7 +13,7 @@
/_/ \_\_| |_|_____/ |_____/ |____/
- S3 in Coreboot (V 1.1)
+ S3 in Coreboot (V 1.2)
----------------------------------------
Zheng Bao
<zheng.bao(a)amd.com>
@@ -22,7 +22,7 @@
Introduction
============
This document is about how the feature S3 is implemented on coreboot,
-specificly on AMD platform. This topic deals with ACPI spec, hardware,
+specifically on AMD platform. This topic deals with ACPI spec, hardware,
BIOS, OS. We try to help coreboot users to realize their own S3.
S3 in a nutshell
@@ -103,20 +103,45 @@ Lifecycle of booting, sleeping and waking Coreboot and Ubuntu
=============================================================
1. Cold boot.
For a system with S3 feature, the BIOS needs to save some data to
-non-volitile storage at cold boot stage. What data need to be save are
+non-volatile storage at cold boot stage. What data need to be save are
provided by AmdS3Save. After the wrapper calls the AmdS3Save, it gets
the VolatileStorage and NvStorage, which are where the data are
located. It is the wrappers's responsibility to save the data.[3][4]
-Currently, the wrappers allocate a CBFS modules in BIOS image. Todo
+Currently, the wrappers allocate a CBFS modules in BIOS image. To do
that, the wrapper needs to have the ability to write flash chips. It
is not as comprehensive as flashrom. But for the SST chip on Parmer,
MX chip on Thather, coreboot works well.[5]
2. OS goes in S3.
-
-3. BIOS detect S3 wakeup
+For Linux, besides the kernel needs to do some saving, most distributions
+run some scripts. For Ubuntu, scripts are located at /usr/lib/pm-utils/sleep.d.
+ # ls /usr/lib/pm-utils/sleep.d
+ 000kernel-change 49bluetooth 90clock 95led
+ 00logging 55NetworkManager 94cpufreq 98video-quirk-db-handler
+ 00powersave 60_wpa_supplicant 95anacron 99video
+ 01PulseAudio 75modules 95hdparm-apm
+The script with lower prefix runs before the one with higher prefix.
+99video is the last one.
+Those scripts have hooks called hibernate, suspend, thaw, resume. For
+each script, suspend is called when system sleeps and wakeup is called
+when system wakeups.
+
+3. Firmware detects S3 wakeup
+As we mentioned, Firmware detects the SLP_TYPx to find out if the board
+wakes up. In romstage.c, AmdInitReset and AmdInitEarly are called
+as they are during cold boot. AmdInitResume and AmdS3LateRestore are
+called only during resume. For whole ramstage, Coreboot goes through
+almost the same way as cold boot, other than not calling the AmdInitMid,
+AmdInitLate and AmdS3Save, and restoring all the MTRRs.
+At last step of coreboot stage, coreboot finds out the wakeup vector in FADT,
+written by OS, and jump.
4. OS resumes.
+When Linux resumes, all the sleeping scripts call their resume
+hooks. If we are more lucky, all the scripts can go through. More
+chances that the 99video hangs or fails to get the display
+back. Sometimes it can fixed if CONFIG_S3_VGA_ROM_RUN is unset in
+Coreboot/Kconfig. That needs more troubleshooting.
Reference
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2483
-gerrit
commit 61f0d1cf8c817c587df52f17c77be02a4684db90
Author: Zheng Bao <fishbaozi(a)gmail.com>
Date: Tue Feb 26 16:20:11 2013 +0800
documentation: Complete the AMD-S3.txt
Fix some typos and finish empty sections.
Change-Id: I08cc971e763252b035ab8ed2118180140e34ac72
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: Zheng Bao <fishbaozi(a)gmail.com>
---
documentation/AMD-S3.txt | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/documentation/AMD-S3.txt b/documentation/AMD-S3.txt
index 1ef87c0..14f444a 100644
--- a/documentation/AMD-S3.txt
+++ b/documentation/AMD-S3.txt
@@ -13,7 +13,7 @@
/_/ \_\_| |_|_____/ |_____/ |____/
- S3 in Coreboot (V 1.1)
+ S3 in Coreboot (V 1.2)
----------------------------------------
Zheng Bao
<zheng.bao(a)amd.com>
@@ -22,7 +22,7 @@
Introduction
============
This document is about how the feature S3 is implemented on coreboot,
-specificly on AMD platform. This topic deals with ACPI spec, hardware,
+specifically on AMD platform. This topic deals with ACPI spec, hardware,
BIOS, OS. We try to help coreboot users to realize their own S3.
S3 in a nutshell
@@ -103,20 +103,41 @@ Lifecycle of booting, sleeping and waking Coreboot and Ubuntu
=============================================================
1. Cold boot.
For a system with S3 feature, the BIOS needs to save some data to
-non-volitile storage at cold boot stage. What data need to be save are
+non-volatile storage at cold boot stage. What data need to be save are
provided by AmdS3Save. After the wrapper calls the AmdS3Save, it gets
the VolatileStorage and NvStorage, which are where the data are
located. It is the wrappers's responsibility to save the data.[3][4]
-Currently, the wrappers allocate a CBFS modules in BIOS image. Todo
+Currently, the wrappers allocate a CBFS modules in BIOS image. To do
that, the wrapper needs to have the ability to write flash chips. It
is not as comprehensive as flashrom. But for the SST chip on Parmer,
MX chip on Thather, coreboot works well.[5]
2. OS goes in S3.
-
-3. BIOS detect S3 wakeup
+For Linux, besides the kernel needs to do some saving, most distributions
+run some scripts. For Ubuntu, scripts are located at /usr/lib/pm-utils/sleep.d.
+ # ls /usr/lib/pm-utils/sleep.d
+ 000kernel-change 49bluetooth 90clock 95led
+ 00logging 55NetworkManager 94cpufreq 98video-quirk-db-handler
+ 00powersave 60_wpa_supplicant 95anacron 99video
+ 01PulseAudio 75modules 95hdparm-apm
+The script with lower prefix runs before the one with higher prefix.
+99video is the last one.
+
+3. Firmware detects S3 wakeup
+As we mentioned, Firmware detects the SLP_TYPx to find out if the board
+wakes up. In romstage.c, AmdInitReset and AmdInitEarly are called
+as they are during cold boot. AmdInitResume and AmdS3LateRestore are
+called only during resume. For whole ramstage, Coreboot goes through
+almost the same way as cold boot, other than not calling the AmdInitMid,
+AmdInitLate and AmdS3Save, and restoring all the MTRRs.
+At last step of coreboot stage, coreboot finds out the wakeup vector in FADT,
+written by OS, and jump.
4. OS resumes.
+When Linux resume, all the sleeping scripts continues. If we are more lucky,
+all the scripts can go through. More chances that the 99video hangs or fails
+to get the display back. Sometimes it can fixed if CONFIG_S3_VGA_ROM_RUN is
+unset in Coreboot/Kconfig. That needs more troubleshooting.
Reference
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2524
-gerrit
commit 281a6b1b4bd4257044d436b5a714379677717b5e
Author: Zheng Bao <fishbaozi(a)gmail.com>
Date: Tue Feb 26 14:48:57 2013 +0800
gitconfig: Give up commiting when non-ascii character is in commit message.
' ' is 0x20, '~' is 0x7E. The character not between ' ' and '~' could be
treated as non-ascii one, which makes the project less global.
Change-Id: If0bbc4bb6b1f8a0d123d00e2b8e6b29cc78abda0
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: Zheng Bao <fishbaozi(a)gmail.com>
---
util/gitconfig/commit-msg | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
index 1a4e865..c1e1893 100755
--- a/util/gitconfig/commit-msg
+++ b/util/gitconfig/commit-msg
@@ -37,6 +37,12 @@ add_ChangeId() {
exit 1
fi
+ if LANG= grep '[^ -~]' "$MSG" > /dev/null
+ then
+ echo "Aborting commit due to non-ascii characters in commit message."
+ exit 1
+ fi
+
# Does Change-Id: already exist? if so, exit (no change).
if grep -i '^Change-Id: I[0-9a-f]\{40\}$' "$MSG" >/dev/null
then
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2523
-gerrit
commit 5b7b02b81c02e952af11fe958a5529df5529fd10
Author: Zheng Bao <fishbaozi(a)gmail.com>
Date: Tue Feb 26 14:40:35 2013 +0800
gitconfig: Give up commiting if the commit message is empty.
With or without this change, git itself gives up commiting and
prints the same error message.
This just makes the commit-msg take more responsible. It also
helps us how to give up commiting.
Change-Id: I8b6e9eb258dde43776a4d55b4d198b2cc42535f0
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: Zheng Bao <fishbaozi(a)gmail.com>
---
util/gitconfig/commit-msg | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
index 82f0581..1a4e865 100755
--- a/util/gitconfig/commit-msg
+++ b/util/gitconfig/commit-msg
@@ -33,7 +33,8 @@ add_ChangeId() {
' "$MSG" | git stripspace`
if test -z "$clean_message"
then
- return
+ echo "Aborting commit due to empty commit message."
+ exit 1
fi
# Does Change-Id: already exist? if so, exit (no change).
the following patch was just integrated into master:
commit 37ef52d44b3d527d6a4fb84eaffa4260b7521d4a
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Nov 21 01:52:27 2012 -0800
libpayload: Correct a constant used for scanning for USB controllers.
When checking to see if a PCI device exists at a particular bus/dev/func,
libpayload was checking the vendor and device id fields together against a 16
bit 0xffff. The two fields together are 32 bits, however, so the check was
never true, and all dev/func combinations on a particular bus would be
checked. That was slightly wasteful, but had relatively small impact.
Change-Id: Iad537295c33083243940b18e7a99af92857e1ef2
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: http://review.coreboot.org/2521
Tested-by: build bot (Jenkins)
Reviewed-by: Dave Frodin <dave.frodin(a)se-eng.com>
Reviewed-by: Anton Kochkov <anton.kochkov(a)gmail.com>
Build-Tested: build bot (Jenkins) at Tue Feb 26 02:35:54 2013, giving +1
Reviewed-By: Anton Kochkov <anton.kochkov(a)gmail.com> at Tue Feb 26 07:39:06 2013, giving +2
See http://review.coreboot.org/2521 for details.
-gerrit
the following patch was just integrated into master:
commit b4523bb691037f78a0823299ef44c0e350e17759
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Nov 21 01:01:50 2012 -0800
libpayload: Change the measurement interval for get_cpu_speed to 2 ms.
The interval used to be about 55 ms which is excessively long. Coreboot only
waits for 2 ms and gets a reasonable answer. That should be good enough for us
as well.
Change-Id: I4d4e8b25b6ba540c9e9839ed0bbaa1f04f67cce1
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: http://review.coreboot.org/2520
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov(a)gmail.com>
Build-Tested: build bot (Jenkins) at Tue Feb 26 02:27:48 2013, giving +1
Reviewed-By: Anton Kochkov <anton.kochkov(a)gmail.com> at Tue Feb 26 07:37:15 2013, giving +2
See http://review.coreboot.org/2520 for details.
-gerrit