On Fri, Jan 20, 2012 at 9:45 AM, Wolfgang Kamp - datakamp
<wmkamp(a)datakamp.de> wrote:
> Hello Marc,
>
> I reviewed the code and it looks good.
> But real testing shows an issue with soft restart (UBUNTU).
> The southbridge seems to hang. Coreboot stops because it could not read the SPI ROM of DIMM Module.
> Please see logs.
> The cold start log also reports errors but will successful boot Ubuntu.
>
> Regards
>
> Wolfgang
>
Woflgang,
The ASSERTs in the passing case are non-critical failures for early
heap use. These are AGESA bugs and have been reported to AMD, but they
are not critical.
As you said, The bad failure is this one:
EventLog: EventClass = 7, EventInfo = 4011c00.
Param1 = 0, Param2 = 0.
Param3 = 0, Param4 = 0.
Which is the SPD problem...
#define MEM_ERROR_NO_DIMM_FOUND_ON_SYSTEM 0x04011C00 ///< No DIMMs
have been found
Can you check what happens in AmdMemoryReadSPD(), in dimmSpd.c? Does
it check the correct dimm address? Is the i2c io address set
correctly?
Thanks,
Marc
>
>
> -----Ursprüngliche Nachricht-----
> Von: gerrit code review [mailto:gerrit@coreboot.org]
> Gesendet: Freitag, 20. Januar 2012 00:52
> An: Wolfgang Kamp - datakamp
> Cc: Kerry Sheh
> Betreff: Change in coreboot[master]: Inagua: Synchronize AMD/inagua mainboard.
>
> From Marc Jones <marcj303(a)gmail.com>:
>
> Hello Wolfgang Kamp,
>
> I'd like you to do a code review. Â Please visit
>
> Â Â http://review.coreboot.org/542
>
> to review the following change.
>
> Change subject: Inagua: Synchronize AMD/inagua mainboard.
> .....................................................................
>
> Inagua: Synchronize AMD/inagua mainboard.
>
> AMD/persimmon mainboard code is derived from AMD/inagua mainbard.
> Persimmom update a lot in the last few month, sync these modification to inagua.
>
> Change-Id: Ia038e5a2b9550fe81bb075f31e30b98354758e9e
> Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
> Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
> ---
> M src/mainboard/amd/inagua/BiosCallOuts.c
> M src/mainboard/amd/inagua/BiosCallOuts.h
> M src/mainboard/amd/inagua/Kconfig
> M src/mainboard/amd/inagua/Makefile.inc
> M src/mainboard/amd/inagua/OptionsIds.h
> M src/mainboard/amd/inagua/PlatformGnbPcie.c
> D src/mainboard/amd/inagua/acpi/ssdt2.asl
> D src/mainboard/amd/inagua/acpi/ssdt3.asl
> D src/mainboard/amd/inagua/acpi/ssdt4.asl
> D src/mainboard/amd/inagua/acpi/ssdt5.asl
> M src/mainboard/amd/inagua/acpi_tables.c
> M src/mainboard/amd/inagua/agesawrapper.c
> M src/mainboard/amd/inagua/agesawrapper.h
> M src/mainboard/amd/inagua/buildOpts.c
> M src/mainboard/amd/inagua/devicetree.cb
> M src/mainboard/amd/inagua/dimmSpd.c
> M src/mainboard/amd/inagua/dsdt.asl
> M src/mainboard/amd/inagua/fadt.c
> M src/mainboard/amd/inagua/get_bus_conf.c
> M src/mainboard/amd/inagua/irq_tables.c
> M src/mainboard/amd/inagua/mainboard.c
> M src/mainboard/amd/inagua/mptable.c
> M src/mainboard/amd/inagua/platform_cfg.h
> M src/mainboard/amd/inagua/romstage.c
> 24 files changed, 249 insertions(+), 717 deletions(-)
>
>
> Â git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/542/2
> --
> To view, visit http://review.coreboot.org/542
> To unsubscribe, visit http://review.coreboot.org/settings
>
> Gerrit-MessageType: newchange
> Gerrit-Change-Id: Ia038e5a2b9550fe81bb075f31e30b98354758e9e
> Gerrit-PatchSet: 2
> Gerrit-Project: coreboot
> Gerrit-Branch: master
> Gerrit-Owner: Kerry Sheh <shekairui(a)gmail.com>
> Gerrit-Reviewer: Kerry Sheh <shekairui(a)gmail.com>
> Gerrit-Reviewer: Wolfgang Kamp <wmkamp(a)datakamp.de>
> Gerrit-Reviewer: build bot (Jenkins)
>
>
>
>
> --
> coreboot mailing list: coreboot(a)coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
--
http://se-eng.com
Hello Marc,
I reviewed the code and it looks good.
But real testing shows an issue with soft restart (UBUNTU).
The southbridge seems to hang. Coreboot stops because it could not read the SPI ROM of DIMM Module.
Please see logs.
The cold start log also reports errors but will successful boot Ubuntu.
Regards
Wolfgang
-----Ursprüngliche Nachricht-----
Von: gerrit code review [mailto:gerrit@coreboot.org]
Gesendet: Freitag, 20. Januar 2012 00:52
An: Wolfgang Kamp - datakamp
Cc: Kerry Sheh
Betreff: Change in coreboot[master]: Inagua: Synchronize AMD/inagua mainboard.
From Marc Jones <marcj303(a)gmail.com>:
Hello Wolfgang Kamp,
I'd like you to do a code review. Please visit
http://review.coreboot.org/542
to review the following change.
Change subject: Inagua: Synchronize AMD/inagua mainboard.
.....................................................................
Inagua: Synchronize AMD/inagua mainboard.
AMD/persimmon mainboard code is derived from AMD/inagua mainbard.
Persimmom update a lot in the last few month, sync these modification to inagua.
Change-Id: Ia038e5a2b9550fe81bb075f31e30b98354758e9e
Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
---
M src/mainboard/amd/inagua/BiosCallOuts.c
M src/mainboard/amd/inagua/BiosCallOuts.h
M src/mainboard/amd/inagua/Kconfig
M src/mainboard/amd/inagua/Makefile.inc
M src/mainboard/amd/inagua/OptionsIds.h
M src/mainboard/amd/inagua/PlatformGnbPcie.c
D src/mainboard/amd/inagua/acpi/ssdt2.asl
D src/mainboard/amd/inagua/acpi/ssdt3.asl
D src/mainboard/amd/inagua/acpi/ssdt4.asl
D src/mainboard/amd/inagua/acpi/ssdt5.asl
M src/mainboard/amd/inagua/acpi_tables.c
M src/mainboard/amd/inagua/agesawrapper.c
M src/mainboard/amd/inagua/agesawrapper.h
M src/mainboard/amd/inagua/buildOpts.c
M src/mainboard/amd/inagua/devicetree.cb
M src/mainboard/amd/inagua/dimmSpd.c
M src/mainboard/amd/inagua/dsdt.asl
M src/mainboard/amd/inagua/fadt.c
M src/mainboard/amd/inagua/get_bus_conf.c
M src/mainboard/amd/inagua/irq_tables.c
M src/mainboard/amd/inagua/mainboard.c
M src/mainboard/amd/inagua/mptable.c
M src/mainboard/amd/inagua/platform_cfg.h
M src/mainboard/amd/inagua/romstage.c
24 files changed, 249 insertions(+), 717 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/542/2
--
To view, visit http://review.coreboot.org/542
To unsubscribe, visit http://review.coreboot.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia038e5a2b9550fe81bb075f31e30b98354758e9e
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Kerry Sheh <shekairui(a)gmail.com>
Gerrit-Reviewer: Kerry Sheh <shekairui(a)gmail.com>
Gerrit-Reviewer: Wolfgang Kamp <wmkamp(a)datakamp.de>
Gerrit-Reviewer: build bot (Jenkins)
the following patch was just integrated into master:
commit 5af98c9e3b9c2dc27085247946a48346c33ea4cd
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Wed Jan 18 23:28:52 2012 +0100
Leave SSE and MMX instructions enabled in coreboot
In order to use SSE+MMX optimized payloads we don't want to disable SSE+MMX
instructions in the CPU after romstage.
Change-Id: I51aeb01f04492ad7bc8b1fe181a4ae17fe0ca61e
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Fri Jan 20 14:39:00 2012, giving +2
See http://review.coreboot.org/553 for details.
-gerrit
Kerry Sheh (shekairui(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/568
-gerrit
commit 40d0b33ba8a18805605c7818d45b48ed92d3c439
Author: Kerry Sheh <shekairui(a)gmail.com>
Date: Fri Jan 20 18:50:15 2012 +0800
H8QGI: supermicro/h8qgi xip size increase from 512K to 1M Bytes.
Change-Id: I1fb1aaad68aed8b41253a02cc0bc151c239b0dbe
Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
---
src/mainboard/supermicro/h8qgi/Kconfig | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/mainboard/supermicro/h8qgi/Kconfig b/src/mainboard/supermicro/h8qgi/Kconfig
index e900ea8..201df45 100644
--- a/src/mainboard/supermicro/h8qgi/Kconfig
+++ b/src/mainboard/supermicro/h8qgi/Kconfig
@@ -123,5 +123,19 @@ config VGA_BIOS_ID
depends on VGA_BIOS
default "102b,0532"
+config XIP_ROM_BASE
+ hex
+ default 0xfff00000
+
+config XIP_ROM_SIZE
+ hex
+ default 0x100000
+ help
+ Overwride the default write through caching size as 1M Bytes.
+ On some AMD paltform, one socket support 2 kinds of processor family,
+ Compiling 2 cpu families agesa code will increase the romstage size.
+ In order to execute romstage in place on the flash rom,
+ more space is required to be set as write through caching.
+
endif # BOARD_SUPERMICRO_H8QGI
Kerry Sheh (shekairui(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/569
-gerrit
commit c54bf5d4ccb746743ed456909270a23526eb42dc
Author: Kerry Sheh <shekairui(a)gmail.com>
Date: Fri Jan 20 18:50:17 2012 +0800
HWM: Winbond W83795 HWM support
Supermicro H8QGI-F 1 Unit Chassis contain 8 system Fans,
they are controled by a saparate W83795 Hardware Monitor chip.
This patch add the w83795 HWM support.
Change-Id: I8756f5ed02dc2fa0884cde36e51451fd8aacee27
Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
---
src/mainboard/supermicro/h8qgi/Makefile.inc | 1 +
src/mainboard/supermicro/h8qgi/romstage.c | 9 ++
src/mainboard/supermicro/h8qgi/w83795.c | 186 +++++++++++++++++++++++++++
src/mainboard/supermicro/h8qgi/w83795.h | 73 +++++++++++
4 files changed, 269 insertions(+), 0 deletions(-)
diff --git a/src/mainboard/supermicro/h8qgi/Makefile.inc b/src/mainboard/supermicro/h8qgi/Makefile.inc
index 82264a4..ef81caf 100644
--- a/src/mainboard/supermicro/h8qgi/Makefile.inc
+++ b/src/mainboard/supermicro/h8qgi/Makefile.inc
@@ -17,6 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
+romstage-y += w83795.c
romstage-$(CONFIG_NORTHBRIDGE_AMD_CIMX_RD890) += rd890_cfg.c
romstage-$(CONFIG_SOUTHBRIDGE_AMD_CIMX_SB700) += sb700_cfg.c
romstage-$(CONFIG_SOUTHBRIDGE_AMD_CIMX_SB700) += reset.c
diff --git a/src/mainboard/supermicro/h8qgi/romstage.c b/src/mainboard/supermicro/h8qgi/romstage.c
index 119593e..15828fe 100644
--- a/src/mainboard/supermicro/h8qgi/romstage.c
+++ b/src/mainboard/supermicro/h8qgi/romstage.c
@@ -33,6 +33,7 @@
#include <sb_cimx.h>
#include "superio/nuvoton/wpcm450/wpcm450.h"
#include "superio/winbond/w83627dhg/w83627dhg.h"
+#include "w83795.h"
extern void disable_cache_as_ram(void); /* cache_as_ram.inc */
@@ -119,6 +120,14 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x3C);
+ /* W83627DHG pin89,90 function select is RSTOUT3#, RSTOUT2# by default.
+ * In order to access W83795G/ADG HWM using I2C protocol,
+ * we select function to SDA, SCL function (or GP33, GP32 function).
+ */
+ w83627dhg_enable_i2c(PNP_DEV(0x2E, W83627DHG_SPI));
+ w83795_init(THERMAL_CRUISE_MODE);
+ w83627dhg_enable_serial(PNP_DEV(0x2E, W83627DHG_SP1), CONFIG_TTYS0_BASE);
+
nb_Ht_Init();
post_code(0x3D);
/* Reset for HT, FIDVID, PLL and ucode patch(errata) changes to take affect. */
diff --git a/src/mainboard/supermicro/h8qgi/w83795.c b/src/mainboard/supermicro/h8qgi/w83795.c
new file mode 100644
index 0000000..7832dfa
--- /dev/null
+++ b/src/mainboard/supermicro/h8qgi/w83795.c
@@ -0,0 +1,186 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+#include <console/console.h>
+#include "southbridge/amd/cimx/sb700/smbus.h" /*SMBUS_IO_BASE*/
+#include "w83795.h"
+
+static u32 w83795_set_bank(u8 bank)
+{
+ return do_smbus_write_byte(SMBUS_IO_BASE, W83795_DEV, W83795_REG_BANKSEL, bank);
+}
+
+static u8 w83795_read(u16 reg)
+{
+ u32 ret;
+
+ ret = w83795_set_bank(reg >> 8);
+ if (ret < 0) {
+ printk(BIOS_DEBUG, "read faild to set bank %x\n", reg >> 8);
+ return -1;
+ }
+
+ ret = do_smbus_read_byte(SMBUS_IO_BASE, W83795_DEV, reg & 0xff);
+ return ret;
+}
+
+static u8 w83795_write(u16 reg, u8 value)
+{
+ u32 err;
+
+ err = w83795_set_bank(reg >> 8);
+ if (err < 0) {
+ printk(BIOS_DEBUG, "write faild to set bank %x\n", reg >> 8);
+ return -1;
+ }
+
+ err = do_smbus_write_byte(SMBUS_IO_BASE, W83795_DEV, reg & 0xff, value);
+ return err;
+}
+
+#if 0
+static void w83795_set_speed(void)
+{
+
+}
+
+static void w83795_set_ttti(void)//KR it works
+{
+ u32 i;
+ for (i = 0; i < 6; i++) {
+ //w83795_write(W83795_REG_TTTI(i), 0xa);//10 degree, default 40
+ //w83795_write(W83795_REG_CTFS(i), 0x20);//32 degree, default 80
+ }
+}
+#endif
+
+static void w83795_set_tfmr(w83795_fan_mode_t mode)
+{
+ u8 val;
+ u8 i;
+
+ if ((mode == SMART_FAN_MODE) || (mode == THERMAL_CRUISE_MODE)) {
+ val = 0xFF;
+ } else {
+ val = 0x00;
+ }
+
+ for (i = 0; i < 6; i++)
+ w83795_write(W83795_REG_TFMR(i), val);
+}
+
+static u32 w83795_set_fan_mode(w83795_fan_mode_t mode)
+{
+ if (mode == SPEED_CRUISE_MODE) {
+ w83795_write(W83795_REG_FCMS1, 0xFF);
+ printk(BIOS_INFO, "W83795G/ADG work in Speed Cruise Mode\n");
+ } else {
+ w83795_write(W83795_REG_FCMS1, 0x00);
+ if (mode == THERMAL_CRUISE_MODE) {
+ w83795_write(W83795_REG_FCMS2, 0x00);
+ printk(BIOS_INFO, "W83795G/ADG work in Thermal Cruise Mode\n");
+ } else if (mode == SMART_FAN_MODE) {
+ w83795_write(W83795_REG_FCMS2, 0x3F);
+ printk(BIOS_INFO, "W83795G/ADG work in Smart Fan Mode\n");
+ } else {
+ printk(BIOS_INFO, "W83795G/ADG work in Manual Mode\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static void w83795_set_tss(void)
+{
+ u8 val;
+
+ val = 0x00;
+ w83795_write(W83795_REG_TSS(0), val); /* Temp1, 2 */
+ w83795_write(W83795_REG_TSS(1), val); /* Temp3, 4 */
+ w83795_write(W83795_REG_TSS(2), val); /* Temp5, 6 */
+}
+
+static void w83795_set_fan(w83795_fan_mode_t mode)
+{
+ u8 i;
+
+ /* select temperature sensor (TSS)*/
+ w83795_set_tss();
+
+ /* select Temperature to Fan mapping Relationships (TFMR)*/
+ w83795_set_tfmr(mode);
+
+ /* set fan output controlled mode (FCMS)*/
+ w83795_set_fan_mode(mode);
+
+ /* Set Critical Temperature to Full Speed all fan (CTFS) */
+ for (i = 0; i < 6; i++) {
+ w83795_write(W83795_REG_CTFS(i), 0x50); /* default 80 celsius degree */
+ }
+
+ if (mode == THERMAL_CRUISE_MODE) {
+ /* Set Target Temperature of Temperature Inputs (TTTI) */
+ for (i = 0; i < 6; i++) {
+ w83795_write(W83795_REG_TTTI(i), 0x28); /* default 40 celsius degree */
+ }
+ } else if (mode == SMART_FAN_MODE) {
+ /* Set the Relative Register-at SMART FAN IV Control Mode Table */
+ //SFIV TODO
+ }
+
+ /* Set Hystersis of Temperature (HT) */
+}
+
+void w83795_init(w83795_fan_mode_t mode)
+{
+ u8 i;
+ u8 val;
+
+ if (do_smbus_read_byte(SMBUS_IO_BASE, W83795_DEV, 0x00) < 0) {
+ printk(BIOS_INFO, "W83795G/ADG Nuvoton H/W Monitor not found\n");
+ return;
+ }
+ val = w83795_read(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)
+ printk(BIOS_INFO, "Found 48 pin W83795ADG Nuvoton H/W Monitor\n");
+
+ /* Reset */
+ val |= W83795_REG_CONFIG_INIT;
+ w83795_write(W83795_REG_CONFIG, val);
+
+ /* enable monitoring operations */
+ val = w83795_read(W83795_REG_CONFIG);
+ val |= W83795_REG_CONFIG_START;
+ w83795_write(W83795_REG_CONFIG, val);
+
+ w83795_set_fan(mode);
+
+ printk(BIOS_INFO, "Fan CTFS(celsius) TTTI(celsius)\n");
+ for (i = 0; i < 6; i++) {
+ val = w83795_read(W83795_REG_CTFS(i));
+ printk(BIOS_INFO, " %x %d", i, val);
+ val = w83795_read(W83795_REG_TTTI(i));
+ printk(BIOS_INFO, " %d\n", val);
+ }
+}
+
diff --git a/src/mainboard/supermicro/h8qgi/w83795.h b/src/mainboard/supermicro/h8qgi/w83795.h
new file mode 100644
index 0000000..76623a0
--- /dev/null
+++ b/src/mainboard/supermicro/h8qgi/w83795.h
@@ -0,0 +1,73 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _W83795_H_
+#define _W83795_H_
+
+#define W83795_DEV 0x2F /* Host I2c Addr (strap to addr1 addr0 1 1, 0x5E) */
+
+#define W83795_REG_I2C_ADDR 0xFC
+#define W83795_REG_BANKSEL 0x00
+#define W83795_REG_CONFIG 0x01
+#define W83795_REG_CONFIG_START 0x01
+#define W83795_REG_CONFIG_CONFIG48 0x04
+#define W83795_REG_CONFIG_INIT 0x80
+
+#define W83795_REG_TEMP_CTRL1 0x04 /* Temperature Monitoring Control Register */
+#define W83795_REG_TEMP_CTRL2 0x05 /* Temperature Monitoring Control Register */
+#define W83795_REG_FANIN_CTRL1 0x06
+#define W83795_REG_FANIN_CTRL2 0x07
+#define W83795_REG_TEMP_CTRL1_EN_DTS 0x20 /* Enable DTS (Digital Temperature Sensor) interface from INTEL PECI or AMD SB-TSI. */
+
+#define W83795_REG_TSS(n) (0x209 + (n)) /* Temperature Source Selection Register */
+#define W83795_REG_TTTI(n) (0x260 + (n)) /* tarrget temperature W83795G/ADG will try to tune the fan output to keep */
+#define W83795_REG_CTFS(n) (0x268 + (n)) /* Critical Temperature to Full Speed all fan */
+#define W83795_REG_HT(n) (0x270 + (n)) /* Hystersis of Temperature */
+#define W83795_REG_DTSC 0x301 /* Digital Temperature Sensor Configuration */
+
+#define W83795_REG_DTSE 0x302 /* Digital Temperature Sensor Enable */
+#define W83795_REG_DTS(n) (0x26 + (n))
+#define W83795_REG_VRLSB 0x3C
+
+#define W83795_TEMP_REG_TR1 0x21
+#define W83795_TEMP_REG_TR2 0x22
+#define W83795_TEMP_REG_TR3 0x23
+#define W83795_TEMP_REG_TR4 0x24
+#define W83795_TEMP_REG_TR5 0x1F
+#define W83795_TEMP_REG_TR6 0x20
+
+#define W83795_REG_FCMS1 0x201
+#define W83795_REG_FCMS2 0x208
+#define W83795_REG_TFMR(n) (0x202 + (n)) /*temperature to fam mappig*/
+#define W83795_REG_DFSP 0x20C
+
+#define W83795_REG_FTSH(n) (0x240 + (n) * 2)
+#define W83795_REG_FTSL(n) (0x241 + (n) * 2)
+#define W83795_REG_TFTS 0x250
+
+typedef enum w83795_fan_mode {
+ SPEED_CRUISE_MODE, ///< Fan Speed Cruise mode keeps the fan speed in a specified range
+ THERMAL_CRUISE_MODE, ///< Thermal Cruise mode is an algorithm to control the fan speed to keep the temperature source around the TTTI
+ SMART_FAN_MODE, ///< Smart Fan mode offers 6 slopes to control the fan speed
+ MANUAL_MODE, ///< control manually
+} w83795_fan_mode_t;
+
+void w83795_init(w83795_fan_mode_t mode);
+
+#endif
Kerry Sheh (shekairui(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/566
-gerrit
commit 029f7f455fb12b9ba04478317e1c40f0fc824a1d
Author: Kerry Sheh <shekairui(a)gmail.com>
Date: Fri Jan 20 18:49:07 2012 +0800
SIO: condition compile Nuvoton WPCM450 early_init.c
Compile Nuvoton WPCM450 early_init.c when CONFIG_SUPERIO_NUVOTON_WPCM450
Change-Id: Ie31b8ae6aa45d6f77efa2b61e215ba0987abf878
Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
---
src/superio/nuvoton/wpcm450/Makefile.inc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/superio/nuvoton/wpcm450/Makefile.inc b/src/superio/nuvoton/wpcm450/Makefile.inc
index c70b2fb..b4e4ea7 100644
--- a/src/superio/nuvoton/wpcm450/Makefile.inc
+++ b/src/superio/nuvoton/wpcm450/Makefile.inc
@@ -1,7 +1,7 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2011 Advanced Micro Devices, Inc.
+## Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
##
## 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
@@ -18,6 +18,6 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-romstage-y += early_init.c
+romstage-$(CONFIG_SUPERIO_NUVOTON_WPCM450) += early_init.c
ramstage-$(CONFIG_SUPERIO_NUVOTON_WPCM450) += superio.c
Kerry Sheh (shekairui(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/569
-gerrit
commit 46e3263aaa1e8d150e877a2d710521e4959c5c30
Author: Kerry Sheh <shekairui(a)gmail.com>
Date: Fri Jan 20 14:21:47 2012 +0800
HWM: Winbond W83795 HWM support
Supermicro H8QGI-F 1 Unit Chassis contain 8 system Fans,
they are controled by a saparate W83795 Hardware Monitor chip.
This patch add the w83795 HWM support.
Change-Id: I8756f5ed02dc2fa0884cde36e51451fd8aacee27
Signed-off-by: Kerry Sheh <kerry.she(a)amd.com>
Signed-off-by: Kerry Sheh <shekairui(a)gmail.com>
---
src/mainboard/supermicro/h8qgi/Makefile.inc | 1 +
src/mainboard/supermicro/h8qgi/romstage.c | 9 ++
src/mainboard/supermicro/h8qgi/w83795.c | 186 +++++++++++++++++++++++++++
src/mainboard/supermicro/h8qgi/w83795.h | 73 +++++++++++
4 files changed, 269 insertions(+), 0 deletions(-)
diff --git a/src/mainboard/supermicro/h8qgi/Makefile.inc b/src/mainboard/supermicro/h8qgi/Makefile.inc
index 82264a4..ef81caf 100644
--- a/src/mainboard/supermicro/h8qgi/Makefile.inc
+++ b/src/mainboard/supermicro/h8qgi/Makefile.inc
@@ -17,6 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
+romstage-y += w83795.c
romstage-$(CONFIG_NORTHBRIDGE_AMD_CIMX_RD890) += rd890_cfg.c
romstage-$(CONFIG_SOUTHBRIDGE_AMD_CIMX_SB700) += sb700_cfg.c
romstage-$(CONFIG_SOUTHBRIDGE_AMD_CIMX_SB700) += reset.c
diff --git a/src/mainboard/supermicro/h8qgi/romstage.c b/src/mainboard/supermicro/h8qgi/romstage.c
index 119593e..15828fe 100644
--- a/src/mainboard/supermicro/h8qgi/romstage.c
+++ b/src/mainboard/supermicro/h8qgi/romstage.c
@@ -33,6 +33,7 @@
#include <sb_cimx.h>
#include "superio/nuvoton/wpcm450/wpcm450.h"
#include "superio/winbond/w83627dhg/w83627dhg.h"
+#include "w83795.h"
extern void disable_cache_as_ram(void); /* cache_as_ram.inc */
@@ -119,6 +120,14 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x3C);
+ /* W83627DHG pin89,90 function select is RSTOUT3#, RSTOUT2# by default.
+ * In order to access W83795G/ADG HWM using I2C protocol,
+ * we select function to SDA, SCL function (or GP33, GP32 function).
+ */
+ w83627dhg_enable_i2c(PNP_DEV(0x2E, W83627DHG_SPI));
+ w83795_init(THERMAL_CRUISE_MODE);
+ w83627dhg_enable_serial(PNP_DEV(0x2E, W83627DHG_SP1), CONFIG_TTYS0_BASE);
+
nb_Ht_Init();
post_code(0x3D);
/* Reset for HT, FIDVID, PLL and ucode patch(errata) changes to take affect. */
diff --git a/src/mainboard/supermicro/h8qgi/w83795.c b/src/mainboard/supermicro/h8qgi/w83795.c
new file mode 100644
index 0000000..7832dfa
--- /dev/null
+++ b/src/mainboard/supermicro/h8qgi/w83795.c
@@ -0,0 +1,186 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+#include <console/console.h>
+#include "southbridge/amd/cimx/sb700/smbus.h" /*SMBUS_IO_BASE*/
+#include "w83795.h"
+
+static u32 w83795_set_bank(u8 bank)
+{
+ return do_smbus_write_byte(SMBUS_IO_BASE, W83795_DEV, W83795_REG_BANKSEL, bank);
+}
+
+static u8 w83795_read(u16 reg)
+{
+ u32 ret;
+
+ ret = w83795_set_bank(reg >> 8);
+ if (ret < 0) {
+ printk(BIOS_DEBUG, "read faild to set bank %x\n", reg >> 8);
+ return -1;
+ }
+
+ ret = do_smbus_read_byte(SMBUS_IO_BASE, W83795_DEV, reg & 0xff);
+ return ret;
+}
+
+static u8 w83795_write(u16 reg, u8 value)
+{
+ u32 err;
+
+ err = w83795_set_bank(reg >> 8);
+ if (err < 0) {
+ printk(BIOS_DEBUG, "write faild to set bank %x\n", reg >> 8);
+ return -1;
+ }
+
+ err = do_smbus_write_byte(SMBUS_IO_BASE, W83795_DEV, reg & 0xff, value);
+ return err;
+}
+
+#if 0
+static void w83795_set_speed(void)
+{
+
+}
+
+static void w83795_set_ttti(void)//KR it works
+{
+ u32 i;
+ for (i = 0; i < 6; i++) {
+ //w83795_write(W83795_REG_TTTI(i), 0xa);//10 degree, default 40
+ //w83795_write(W83795_REG_CTFS(i), 0x20);//32 degree, default 80
+ }
+}
+#endif
+
+static void w83795_set_tfmr(w83795_fan_mode_t mode)
+{
+ u8 val;
+ u8 i;
+
+ if ((mode == SMART_FAN_MODE) || (mode == THERMAL_CRUISE_MODE)) {
+ val = 0xFF;
+ } else {
+ val = 0x00;
+ }
+
+ for (i = 0; i < 6; i++)
+ w83795_write(W83795_REG_TFMR(i), val);
+}
+
+static u32 w83795_set_fan_mode(w83795_fan_mode_t mode)
+{
+ if (mode == SPEED_CRUISE_MODE) {
+ w83795_write(W83795_REG_FCMS1, 0xFF);
+ printk(BIOS_INFO, "W83795G/ADG work in Speed Cruise Mode\n");
+ } else {
+ w83795_write(W83795_REG_FCMS1, 0x00);
+ if (mode == THERMAL_CRUISE_MODE) {
+ w83795_write(W83795_REG_FCMS2, 0x00);
+ printk(BIOS_INFO, "W83795G/ADG work in Thermal Cruise Mode\n");
+ } else if (mode == SMART_FAN_MODE) {
+ w83795_write(W83795_REG_FCMS2, 0x3F);
+ printk(BIOS_INFO, "W83795G/ADG work in Smart Fan Mode\n");
+ } else {
+ printk(BIOS_INFO, "W83795G/ADG work in Manual Mode\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static void w83795_set_tss(void)
+{
+ u8 val;
+
+ val = 0x00;
+ w83795_write(W83795_REG_TSS(0), val); /* Temp1, 2 */
+ w83795_write(W83795_REG_TSS(1), val); /* Temp3, 4 */
+ w83795_write(W83795_REG_TSS(2), val); /* Temp5, 6 */
+}
+
+static void w83795_set_fan(w83795_fan_mode_t mode)
+{
+ u8 i;
+
+ /* select temperature sensor (TSS)*/
+ w83795_set_tss();
+
+ /* select Temperature to Fan mapping Relationships (TFMR)*/
+ w83795_set_tfmr(mode);
+
+ /* set fan output controlled mode (FCMS)*/
+ w83795_set_fan_mode(mode);
+
+ /* Set Critical Temperature to Full Speed all fan (CTFS) */
+ for (i = 0; i < 6; i++) {
+ w83795_write(W83795_REG_CTFS(i), 0x50); /* default 80 celsius degree */
+ }
+
+ if (mode == THERMAL_CRUISE_MODE) {
+ /* Set Target Temperature of Temperature Inputs (TTTI) */
+ for (i = 0; i < 6; i++) {
+ w83795_write(W83795_REG_TTTI(i), 0x28); /* default 40 celsius degree */
+ }
+ } else if (mode == SMART_FAN_MODE) {
+ /* Set the Relative Register-at SMART FAN IV Control Mode Table */
+ //SFIV TODO
+ }
+
+ /* Set Hystersis of Temperature (HT) */
+}
+
+void w83795_init(w83795_fan_mode_t mode)
+{
+ u8 i;
+ u8 val;
+
+ if (do_smbus_read_byte(SMBUS_IO_BASE, W83795_DEV, 0x00) < 0) {
+ printk(BIOS_INFO, "W83795G/ADG Nuvoton H/W Monitor not found\n");
+ return;
+ }
+ val = w83795_read(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)
+ printk(BIOS_INFO, "Found 48 pin W83795ADG Nuvoton H/W Monitor\n");
+
+ /* Reset */
+ val |= W83795_REG_CONFIG_INIT;
+ w83795_write(W83795_REG_CONFIG, val);
+
+ /* enable monitoring operations */
+ val = w83795_read(W83795_REG_CONFIG);
+ val |= W83795_REG_CONFIG_START;
+ w83795_write(W83795_REG_CONFIG, val);
+
+ w83795_set_fan(mode);
+
+ printk(BIOS_INFO, "Fan CTFS(celsius) TTTI(celsius)\n");
+ for (i = 0; i < 6; i++) {
+ val = w83795_read(W83795_REG_CTFS(i));
+ printk(BIOS_INFO, " %x %d", i, val);
+ val = w83795_read(W83795_REG_TTTI(i));
+ printk(BIOS_INFO, " %d\n", val);
+ }
+}
+
diff --git a/src/mainboard/supermicro/h8qgi/w83795.h b/src/mainboard/supermicro/h8qgi/w83795.h
new file mode 100644
index 0000000..76623a0
--- /dev/null
+++ b/src/mainboard/supermicro/h8qgi/w83795.h
@@ -0,0 +1,73 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _W83795_H_
+#define _W83795_H_
+
+#define W83795_DEV 0x2F /* Host I2c Addr (strap to addr1 addr0 1 1, 0x5E) */
+
+#define W83795_REG_I2C_ADDR 0xFC
+#define W83795_REG_BANKSEL 0x00
+#define W83795_REG_CONFIG 0x01
+#define W83795_REG_CONFIG_START 0x01
+#define W83795_REG_CONFIG_CONFIG48 0x04
+#define W83795_REG_CONFIG_INIT 0x80
+
+#define W83795_REG_TEMP_CTRL1 0x04 /* Temperature Monitoring Control Register */
+#define W83795_REG_TEMP_CTRL2 0x05 /* Temperature Monitoring Control Register */
+#define W83795_REG_FANIN_CTRL1 0x06
+#define W83795_REG_FANIN_CTRL2 0x07
+#define W83795_REG_TEMP_CTRL1_EN_DTS 0x20 /* Enable DTS (Digital Temperature Sensor) interface from INTEL PECI or AMD SB-TSI. */
+
+#define W83795_REG_TSS(n) (0x209 + (n)) /* Temperature Source Selection Register */
+#define W83795_REG_TTTI(n) (0x260 + (n)) /* tarrget temperature W83795G/ADG will try to tune the fan output to keep */
+#define W83795_REG_CTFS(n) (0x268 + (n)) /* Critical Temperature to Full Speed all fan */
+#define W83795_REG_HT(n) (0x270 + (n)) /* Hystersis of Temperature */
+#define W83795_REG_DTSC 0x301 /* Digital Temperature Sensor Configuration */
+
+#define W83795_REG_DTSE 0x302 /* Digital Temperature Sensor Enable */
+#define W83795_REG_DTS(n) (0x26 + (n))
+#define W83795_REG_VRLSB 0x3C
+
+#define W83795_TEMP_REG_TR1 0x21
+#define W83795_TEMP_REG_TR2 0x22
+#define W83795_TEMP_REG_TR3 0x23
+#define W83795_TEMP_REG_TR4 0x24
+#define W83795_TEMP_REG_TR5 0x1F
+#define W83795_TEMP_REG_TR6 0x20
+
+#define W83795_REG_FCMS1 0x201
+#define W83795_REG_FCMS2 0x208
+#define W83795_REG_TFMR(n) (0x202 + (n)) /*temperature to fam mappig*/
+#define W83795_REG_DFSP 0x20C
+
+#define W83795_REG_FTSH(n) (0x240 + (n) * 2)
+#define W83795_REG_FTSL(n) (0x241 + (n) * 2)
+#define W83795_REG_TFTS 0x250
+
+typedef enum w83795_fan_mode {
+ SPEED_CRUISE_MODE, ///< Fan Speed Cruise mode keeps the fan speed in a specified range
+ THERMAL_CRUISE_MODE, ///< Thermal Cruise mode is an algorithm to control the fan speed to keep the temperature source around the TTTI
+ SMART_FAN_MODE, ///< Smart Fan mode offers 6 slopes to control the fan speed
+ MANUAL_MODE, ///< control manually
+} w83795_fan_mode_t;
+
+void w83795_init(w83795_fan_mode_t mode);
+
+#endif