Jonathan A. Kollasch (jakllsch(a)kollasch.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10984
-gerrit
commit f27d88d0fbd4ea896a697cb0c4e08afb7aaaa1c9
Author: Jonathan A. Kollasch <jakllsch(a)kollasch.net>
Date: Mon Jul 20 09:51:34 2015 -0500
nvidia southbridges: don't touch 0x78 in LPC bridge with Fam10h
Based on the observations that AMD Fam10h with both Nvidia CK804 (Asus
KFSN4-DRE) and MCP55 (Sun Ultra 40 M2) need to avoid adjusting the LPC
bridge register 0x78 (particularly the 0x7b byte) to get to ramstage:
Assume that there's something about this register that adjusting it the
way we do for K8 is something that can/should be universally avoided on
all Fam10h systems with these chipsets.
Change-Id: I1eceeb20ecaefef4c61c11e19d1f5a59f91a0a2f
Signed-off-by: Jonathan A. Kollasch <jakllsch(a)kollasch.net>
---
src/mainboard/asus/kfsn4-dre/romstage.c | 9 ---------
src/southbridge/nvidia/ck804/early_setup.c | 14 ++++++++++++++
src/southbridge/nvidia/ck804/early_setup_car.c | 14 +++++++++++++-
src/southbridge/nvidia/mcp55/early_setup_car.c | 7 +++++++
4 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/src/mainboard/asus/kfsn4-dre/romstage.c b/src/mainboard/asus/kfsn4-dre/romstage.c
index aa72021..cf36a72 100644
--- a/src/mainboard/asus/kfsn4-dre/romstage.c
+++ b/src/mainboard/asus/kfsn4-dre/romstage.c
@@ -67,15 +67,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
#include "resourcemap.c"
#include "cpu/amd/quadcore/quadcore.c"
-/*
- * Avoid crash (complete with severe memory corruption!) during initial CAR boot
- * in ck804_early_setup_x().
- * Interestingly once the system is fully booted into Linux this can be set, but
- * not before! Apparently something isn't initialized but the amount of effort
- * required to fix this is non-negligible and of unknown real-world benefit
- */
-#define CK804_SKIP_PCI_REG_78_INIT 1
-
#define CK804_MB_SETUP \
RES_PORT_IO_8, SYSCTRL_IO_BASE + 0xc0+33, ~(0x0f),(0x04 | 0x01), /* -ENOINFO Proprietary BIOS sets this register; "When in Rome..."*/
diff --git a/src/southbridge/nvidia/ck804/early_setup.c b/src/southbridge/nvidia/ck804/early_setup.c
index c0a8766..9c0a783 100644
--- a/src/southbridge/nvidia/ck804/early_setup.c
+++ b/src/southbridge/nvidia/ck804/early_setup.c
@@ -152,10 +152,24 @@ static void ck804_early_setup(void)
RES_PCI_IO, PCI_ADDR(CK804B_BUSN, CK804B_DEVN_BASE + 9, 0, 0x74), 0xffffffc0, 0x00000000,
#endif
+#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10)
+ /*
+ * Avoid crash (complete with severe memory corruption!) during initial CAR boot
+ * in ck804_early_setup_x() on Fam10h systems by not touching 0x78.
+ * Interestingly once the system is fully booted into Linux this can be set, but
+ * not before! Apparently something isn't initialized but the amount of effort
+ * required to fix this is non-negligible and of unknown real-world benefit
+ */
+#else
RES_PCI_IO, PCI_ADDR(0, CK804_DEVN_BASE + 1, 0, 0x78), 0xc0ffffff, 0x19000000,
+#endif
RES_PCI_IO, PCI_ADDR(0, CK804_DEVN_BASE + 1, 0, 0xe0), 0xfffffeff, 0x00000100,
#if CONFIG_CK804_NUM > 1
+ /*
+ * Avoid touching 0x78 for CONFIG_NORTHBRIDGE_AMD_AMDFAM10 for
+ * non-primary chain too???
+ */
RES_PCI_IO, PCI_ADDR(CK804B_BUSN, CK804B_DEVN_BASE + 1, 0, 0x78), 0xc0ffffff, 0x20000000,
RES_PCI_IO, PCI_ADDR(CK804B_BUSN, CK804B_DEVN_BASE + 1, 0, 0xe0), 0xfffffeff, 0x00000000,
RES_PCI_IO, PCI_ADDR(CK804B_BUSN, CK804B_DEVN_BASE + 1, 0, 0xe8), 0xffffff00, 0x000000ff,
diff --git a/src/southbridge/nvidia/ck804/early_setup_car.c b/src/southbridge/nvidia/ck804/early_setup_car.c
index 8065d20..87fdbdd 100644
--- a/src/southbridge/nvidia/ck804/early_setup_car.c
+++ b/src/southbridge/nvidia/ck804/early_setup_car.c
@@ -142,7 +142,15 @@ static void ck804_early_setup(unsigned ck804_num, unsigned *busn,
CK804_MB_SETUP
#endif
-#ifndef CK804_SKIP_PCI_REG_78_INIT
+#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10)
+ /*
+ * Avoid crash (complete with severe memory corruption!) during initial CAR boot
+ * in ck804_early_setup_x() on Fam10h systems by not touching 0x78.
+ * Interestingly once the system is fully booted into Linux this can be set, but
+ * not before! Apparently something isn't initialized but the amount of effort
+ * required to fix this is non-negligible and of unknown real-world benefit
+ */
+#else
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0x78), 0xc0ffffff, 0x19000000,
#endif
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0xe0), 0xfffffeff, 0x00000100,
@@ -239,6 +247,10 @@ static void ck804_early_setup(unsigned ck804_num, unsigned *busn,
RES_PCI_IO, PCI_ADDR(0, 9, 0, 0x4c), 0xfe00ffff, 0x00440000,
RES_PCI_IO, PCI_ADDR(0, 9, 0, 0x74), 0xffffffc0, 0x00000000,
+ /*
+ * Avoid touching 0x78 for CONFIG_NORTHBRIDGE_AMD_AMDFAM10 for
+ * non-primary chains too???
+ */
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0x78), 0xc0ffffff, 0x20000000,
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0xe0), 0xfffffeff, 0x00000000,
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0xe8), 0xffffff00, 0x000000ff,
diff --git a/src/southbridge/nvidia/mcp55/early_setup_car.c b/src/southbridge/nvidia/mcp55/early_setup_car.c
index 4970a4c..1c0df10 100644
--- a/src/southbridge/nvidia/mcp55/early_setup_car.c
+++ b/src/southbridge/nvidia/mcp55/early_setup_car.c
@@ -242,7 +242,14 @@ static void mcp55_early_setup(unsigned mcp55_num, unsigned *busn,
RES_PCI_IO, PCI_ADDR(0, 6, 0, 0x74), 0xFFFFFFC0, 0x00000000,
RES_PCI_IO, PCI_ADDR(0, 6, 0, 0xC0), 0x00000000, 0xCB8410DE,
RES_PCI_IO, PCI_ADDR(0, 6, 0, 0xC4), 0xFFFFFFF8, 0x00000007,
+#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10)
+ /*
+ * Touching BUID+1.0 0x78 this way this early on Fam10h systems
+ * causes unrecoverable issues during CAR.
+ */
+#else
RES_PCI_IO, PCI_ADDR(0, 1, 0, 0x78), 0xC0FFFFFF, 0x19000000,
+#endif
#if CONFIG_MCP55_USE_AZA
RES_PCI_IO, PCI_ADDR(0, 6, 1, 0x40), 0x00000000, 0xCB8410DE,
Jonathan A. Kollasch (jakllsch(a)kollasch.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10983
-gerrit
commit 597fa2d582eda5f8dde4037d5beda4137ca7dc8b
Author: Jonathan A. Kollasch <jakllsch(a)kollasch.net>
Date: Mon Jul 20 07:43:32 2015 -0500
amdfam10/northbridge: fix amdfam10_scan_chain()
Fixes two issues introduced recently:
- The subordinate bus limit was reduced from essentially unlimited
(0xfc) to 0 additional busses. This caused config space of
subordinate busses of a non-primary HT IO chain to become
unrouted (and thus invisible) during initial scan.
- The HTcap+0x14 register is *not* the same on K8 and 10h. 10h
has isochronous HT link buffer controls where K8 had bus numbers.
These two issues resulted in the non-primary IO chain not having
resources allocated to subordinate busses due to the devices being
invisible during initial scan, and for MMIO accesses to devices on
the base bus of the non-primary chain to stall the whole machine,
presumably due to invalid HT buffer allocations.
Change-Id: I7a1f51bd91ab3dae6ed1c447209b36003830f3dc
Signed-off-by: Jonathan A. Kollasch <jakllsch(a)kollasch.net>
---
src/northbridge/amd/amdfam10/northbridge.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index f6f2641..7a0109e 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -142,7 +142,6 @@ static void set_vga_enable_reg(u32 nodeid, u32 linkn)
}
typedef enum {
- HT_ROUTE_CLOSE,
HT_ROUTE_SCAN,
HT_ROUTE_FINAL,
} scan_state;
@@ -166,17 +165,8 @@ static void ht_route_link(struct bus *link, scan_state mode)
* not correctly configured
*/
busses = pci_read_config32(link->dev, link->cap + 0x14);
- busses &= 0xff000000;
- busses |= parent->secondary & 0xff;
- if (mode == HT_ROUTE_CLOSE) {
- busses |= 0xfeff << 8;
- } else if (mode == HT_ROUTE_SCAN) {
- busses |= ((u32) link->secondary & 0xff) << 8;
- busses |= 0xfc << 16;
- } else if (mode == HT_ROUTE_FINAL) {
- busses |= ((u32) link->secondary & 0xff) << 8;
- busses |= ((u32) link->subordinate & 0xff) << 16;
- }
+ busses &= 0xffff00ff;
+ busses |= ((u32) link->secondary & 0xff) << 8;
pci_write_config32(link->dev, link->cap + 0x14, busses);
if (mode == HT_ROUTE_FINAL) {
@@ -190,6 +180,7 @@ static void ht_route_link(struct bus *link, scan_state mode)
static void amdfam10_scan_chain(struct bus *link)
{
unsigned int next_unitid;
+ uint16_t sub;
/* See if there is an available configuration space mapping
* register in function 1.
@@ -205,7 +196,10 @@ static void amdfam10_scan_chain(struct bus *link)
ht_route_link(link, HT_ROUTE_SCAN);
/* set the config map space */
+ sub = link->subordinate;
+ link->subordinate = 0xfc;
set_config_map_reg(link);
+ link->subordinate = sub;
/* Now we can scan all of the subordinate busses i.e. the
* chain on the hypertranport link
WANG Siyuan (wangsiyuanbuaa(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10720
-gerrit
commit f23f8928bc90f821f8b0b6bf045fba213bd25d92
Author: WANG Siyuan <wangsiyuanbuaa(a)gmail.com>
Date: Tue Jun 23 22:28:17 2015 +0800
AMD binary PI: add southbridge support for fan control
1. Add functions to support fan control.
2. When IMC firmware is added, the current firmwares' layout
cause build error. There is not enough space to add some firmwares,
so HUDSON_PSP_OFFSET is added to fix this problem.
Change-Id: Ie470a88cb9da256d9f72ea56bf268c15df195784
Signed-off-by: WANG Siyuan <wangsiyuanbuaa(a)gmail.com>
Signed-off-by: WANG Siyuan <SiYuan.Wang(a)amd.com>
---
src/southbridge/amd/pi/hudson/Makefile.inc | 11 ++-
src/southbridge/amd/pi/hudson/acpi/fch.asl | 6 +-
src/southbridge/amd/pi/hudson/hudson.c | 9 +++
src/southbridge/amd/pi/hudson/imc.c | 105 +++++++++++++++++++++++++++++
src/southbridge/amd/pi/hudson/imc.h | 31 +++++++++
5 files changed, 159 insertions(+), 3 deletions(-)
diff --git a/src/southbridge/amd/pi/hudson/Makefile.inc b/src/southbridge/amd/pi/hudson/Makefile.inc
index d2fd7dc..4df14c0 100644
--- a/src/southbridge/amd/pi/hudson/Makefile.inc
+++ b/src/southbridge/amd/pi/hudson/Makefile.inc
@@ -45,6 +45,10 @@ ramstage-y += reset.c
romstage-$(CONFIG_USBDEBUG_IN_ROMSTAGE) += enable_usbdebug.c
ramstage-$(CONFIG_USBDEBUG) += enable_usbdebug.c
romstage-y += early_setup.c
+ifeq ($(CONFIG_HUDSON_IMC_FWM), y)
+romstage-y += imc.c
+ramstage-y += imc.c
+endif
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c smi_util.c
ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c smi_util.c
@@ -109,10 +113,15 @@ HUDSON_PSP_DIRECTORY_POSITION=$(call int-align,\
65536)
HUDSON_PSP_DIRECTORY_SIZE=256
else ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y)
+ifeq ($(CONFIG_HUDSON_IMC_FWM), y)
+HUDSON_PSP_OFFSET=131072
+else
+HUDSON_PSP_OFFSET=0
+endif
HUDSON_PSP_DIRECTORY_POSITION=$(call int-align,\
$(call int-add,\
$(HUDSON_FWM_POSITION) $(ROMSIG_SIZE) $(CBFS_HEADER_SIZE) $(XHCI_FWM_SIZE)\
- $(CBFS_HEADER_SIZE) $(GEC_FWM_SIZE) $(CBFS_HEADER_SIZE) $(IMC_FWM_SIZE) $(CBFS_HEADER_SIZE)),\
+ $(CBFS_HEADER_SIZE) $(GEC_FWM_SIZE) $(CBFS_HEADER_SIZE) $(IMC_FWM_SIZE) $(CBFS_HEADER_SIZE) $(HUDSON_PSP_OFFSET)),\
65536)
HUDSON_PSP_DIRECTORY_SIZE=256
else
diff --git a/src/southbridge/amd/pi/hudson/acpi/fch.asl b/src/southbridge/amd/pi/hudson/acpi/fch.asl
index b4d6899..cee721f 100644
--- a/src/southbridge/amd/pi/hudson/acpi/fch.asl
+++ b/src/southbridge/amd/pi/hudson/acpi/fch.asl
@@ -160,9 +160,11 @@ Method(_INI, 0) {
/* Determine the OS we're running on */
OSFL()
+#if IS_ENABLED(CONFIG_ACPI_ENABLE_THERMAL_ZONE)
/* TODO: It is unstable. */
- //#include "acpi/AmdImc.asl" /* Hudson IMC function */
- //ITZE() /* enable IMC Fan Control*/
+ #include "acpi/AmdImc.asl" /* Hudson IMC function */
+ ITZE() /* enable IMC Fan Control*/
+#endif
} /* End Method(_SB._INI) */
Method(OSFL, 0){
diff --git a/src/southbridge/amd/pi/hudson/hudson.c b/src/southbridge/amd/pi/hudson/hudson.c
index 9b6e6a3..4ef65e9 100644
--- a/src/southbridge/amd/pi/hudson/hudson.c
+++ b/src/southbridge/amd/pi/hudson/hudson.c
@@ -30,6 +30,9 @@
#include "hudson.h"
#include "smbus.h"
#include "smi.h"
+#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
+#include "fchec.h"
+#endif
/* Offsets from ACPI_MMIO_BASE
* This is defined by AGESA, but we don't include AGESA headers to avoid
@@ -130,6 +133,12 @@ static void hudson_init(void *chip_info)
static void hudson_final(void *chip_info)
{
+#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
+ agesawrapper_fchecfancontrolservice();
+#if !IS_ENABLED(CONFIG_ACPI_ENABLE_THERMAL_ZONE)
+ enable_imc_thermal_zone();
+#endif
+#endif
}
struct chip_operations southbridge_amd_pi_hudson_ops = {
diff --git a/src/southbridge/amd/pi/hudson/imc.c b/src/southbridge/amd/pi/hudson/imc.c
new file mode 100644
index 0000000..9282c94
--- /dev/null
+++ b/src/southbridge/amd/pi/hudson/imc.c
@@ -0,0 +1,105 @@
+/*
+ * 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
+ */
+
+#define __SIMPLE_DEVICE__
+
+#include "imc.h"
+#include <arch/io.h>
+#include <device/device.h>
+#include <delay.h>
+#include <Porting.h>
+#include <AGESA.h>
+#include <Lib/amdlib.h>
+#include <Proc/Fch/Common/FchCommonCfg.h>
+#include <Proc/Fch/Fch.h>
+#include <Proc/Fch/FchPlatform.h>
+
+#define VACPI_MMIO_VBASE ((u8 *)ACPI_MMIO_BASE)
+
+void imc_reg_init(void)
+{
+ u8 reg8;
+ /* Init Power Management Block 2 (PM2) Registers.
+ * Check BKDG for AMD Family 16h for details. */
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x00), 0x06);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x01), 0x06);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x02), 0xf7);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x03), 0xff);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x04), 0xff);
+
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x10), 0x06);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x11), 0x06);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x12), 0xf7);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x13), 0xff);
+ write8((VACPI_MMIO_VBASE + PMIO2_BASE + 0x14), 0xff);
+
+ reg8 = pci_read_config8(PCI_DEV(0, 0x18, 0x3), 0x1E4);
+ reg8 &= 0x8F;
+ reg8 |= 0x10;
+ pci_write_config8(PCI_DEV(0, 0x18, 0x3), 0x1E4, reg8);
+}
+
+#ifndef __PRE_RAM__
+void enable_imc_thermal_zone(void)
+{
+ AMD_CONFIG_PARAMS StdHeader;
+ UINT8 FunNum;
+ UINT8 regs[9];
+ int i;
+
+ regs[0] = 0;
+ regs[1] = 0;
+ FunNum = Fun_80;
+ for (i = 0; i <= 1; i++)
+ WriteECmsg(MSG_REG0 + i, AccessWidth8, ®s[i], &StdHeader);
+ WriteECmsg(MSG_SYS_TO_IMC, AccessWidth8, &FunNum, &StdHeader);
+ WaitForEcLDN9MailboxCmdAck(&StdHeader);
+
+ for (i = 2; i <= 9; i++)
+ ReadECmsg(MSG_REG0 + i, AccessWidth8, ®s[i], &StdHeader);
+
+ /* enable thermal zone 0 */
+ regs[2] |= 1;
+ regs[0] = 0;
+ regs[1] = 0;
+ FunNum = Fun_81;
+ for (i = 0; i <= 9; i++)
+ WriteECmsg(MSG_REG0 + i, AccessWidth8, ®s[i], &StdHeader);
+ WriteECmsg(MSG_SYS_TO_IMC, AccessWidth8, &FunNum, &StdHeader);
+ WaitForEcLDN9MailboxCmdAck(&StdHeader);
+}
+#endif
+
+/* Bettong Hardware Monitor Fan Control
+ * Hardware limitation:
+ * HWM will fail to read the input temperature via I2C if other
+ * software switches the I2C address. AMD recommends using IMC
+ * to control fans, instead of HWM.
+ */
+void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+{
+ /* Enable IMC fan control. the recommand way */
+ imc_reg_init();
+
+ FchParams->Imc.ImcEnable = TRUE;
+ FchParams->Hwm.HwmControl = 1; /* 1 IMC, 0 HWM */
+ FchParams->Imc.ImcEnableOverWrite = 1; /* 2 disable IMC, 1 enable IMC, 0 following hw strap setting */
+
+ LibAmdMemFill(&(FchParams->Imc.EcStruct), 0, sizeof(FCH_EC), FchParams->StdHeader);
+}
diff --git a/src/southbridge/amd/pi/hudson/imc.h b/src/southbridge/amd/pi/hudson/imc.h
new file mode 100644
index 0000000..4824ac5
--- /dev/null
+++ b/src/southbridge/amd/pi/hudson/imc.h
@@ -0,0 +1,31 @@
+/*
+ * 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 HUDSON_IMC_H
+#define HUDSON_IMC_H
+
+#include "Porting.h"
+#include "AGESA.h"
+#include <FchCommonCfg.h>
+
+void imc_reg_init(void);
+void enable_imc_thermal_zone(void);
+void oem_fan_control(FCH_DATA_BLOCK *FchParams);
+
+#endif
WANG Siyuan (wangsiyuanbuaa(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10721
-gerrit
commit 8e3987b223807184655e98dce1ba2deba84ad391
Author: WANG Siyuan <wangsiyuanbuaa(a)gmail.com>
Date: Tue Jun 23 22:43:03 2015 +0800
amd/bettong: Enable fan control
1. Use enable_imc_thermal_zone to enable fan control.
2. The ACPI method ITZE works on Ubuntu 14.04 and Windows 7
but does not work on Windows 8, so I didn't use it.
After this issue is fixed, I'll add ACPI_ENABLE_THERMAL_ZONE
in bettong/Kconfig.
3. Fan control works on Bettong. I used "APU Validation Toolkit"
to test on Windows 8. This tool can put load to APU. The fan's
behaviour is just like bettong/fchec.c defined. When the temperature
is 40 Celsius, the fan start to run.
Change-Id: I0fc22974a7a7cf3f6bdf5f1c66be95219a177e12
Signed-off-by: WANG Siyuan <wangsiyuanbuaa(a)gmail.com>
Signed-off-by: WANG Siyuan <SiYuan.Wang(a)amd.com>
---
src/mainboard/amd/bettong/BiosCallOuts.c | 3 ++
src/mainboard/amd/bettong/Makefile.inc | 3 ++
src/mainboard/amd/bettong/fchec.c | 67 ++++++++++++++++++++++++++++++++
src/mainboard/amd/bettong/fchec.h | 31 +++++++++++++++
src/vendorcode/amd/Kconfig | 2 +-
5 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/amd/bettong/BiosCallOuts.c b/src/mainboard/amd/bettong/BiosCallOuts.c
index 1add1f5..0311baa 100644
--- a/src/mainboard/amd/bettong/BiosCallOuts.c
+++ b/src/mainboard/amd/bettong/BiosCallOuts.c
@@ -76,6 +76,9 @@ AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr)
} else if (StdHeader->Func == AMD_INIT_ENV) {
FCH_DATA_BLOCK *FchParams_env = (FCH_DATA_BLOCK *)FchData;
printk(BIOS_DEBUG, "Fch OEM config in INIT ENV ");
+#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
+ oem_fan_control(FchParams_env);
+#endif
/* XHCI configuration */
#if CONFIG_HUDSON_XHCI_ENABLE
diff --git a/src/mainboard/amd/bettong/Makefile.inc b/src/mainboard/amd/bettong/Makefile.inc
index b9cd644..70722ee 100644
--- a/src/mainboard/amd/bettong/Makefile.inc
+++ b/src/mainboard/amd/bettong/Makefile.inc
@@ -22,3 +22,6 @@ romstage-y += PlatformGnbPcie.c
ramstage-y += BiosCallOuts.c
ramstage-y += PlatformGnbPcie.c
+ifeq ($(CONFIG_HUDSON_IMC_FWM), y)
+ramstage-y += fchec.c
+endif
diff --git a/src/mainboard/amd/bettong/fchec.c b/src/mainboard/amd/bettong/fchec.c
new file mode 100644
index 0000000..3458f9b
--- /dev/null
+++ b/src/mainboard/amd/bettong/fchec.c
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 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.
+ */
+
+#include "fchec.h"
+
+void agesawrapper_fchecfancontrolservice()
+{
+ FCH_DATA_BLOCK LateParams;
+
+ /* Thermal Zone Parameter */
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg0 = 0x00;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg1 = 0x00; /* Zone */
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg2 = 0x3d;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg3 = 0xc6;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg4 = 0x00;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg5 = 0x04;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg6 = 0x98; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg7 = 0x01;
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg8 = 0x01; /* PWM steping rate in unit of PWM level percentage */
+ LateParams.Imc.EcStruct.MsgFun81Zone0MsgReg9 = 0x00;
+
+ /* IMC Fan Policy temperature thresholds */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg0 = 0x00;
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg1 = 0x00; /* Zone */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg2 = 0x3c; /*AC0 threshold in Celsius */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg3 = 0x28; /*AC1 threshold in Celsius */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg4 = 0xff; /*AC2 threshold in Celsius */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg5 = 0xff; /*AC3 threshold in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg6 = 0xff; /*AC4 threshold in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg7 = 0xff; /*AC5 threshold in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg8 = 0xff; /*AC6 threshold in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgReg9 = 0xff; /*AC7 lowest threshold in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgRegA = 0x4b; /*critical threshold* in Celsius, 0xFF is not define */
+ LateParams.Imc.EcStruct.MsgFun83Zone0MsgRegB = 0x00;
+
+ /* IMC Fan Policy PWM Settings */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg0 = 0x00;
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg1 = 0x00; /* Zone */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg2 = 0x50; /* AL0 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg3 = 0x32; /* AL1 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg4 = 0xff; /* AL2 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg5 = 0xff; /* AL3 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg6 = 0xff; /* AL4 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg7 = 0xff; /* AL5 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg8 = 0xff; /* AL6 percentage */
+ LateParams.Imc.EcStruct.MsgFun85Zone0MsgReg9 = 0xff; /* AL7 percentage */
+
+ LateParams.Imc.EcStruct.IMCFUNSupportBitMap = 0x111;
+
+ FchECfancontrolservice(&LateParams);
+}
diff --git a/src/mainboard/amd/bettong/fchec.h b/src/mainboard/amd/bettong/fchec.h
new file mode 100644
index 0000000..13305d8
--- /dev/null
+++ b/src/mainboard/amd/bettong/fchec.h
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+#ifndef AMD_BETTONG_FCHEC
+#define AMD_BETTONG_FCHEC
+
+#include "imc.h"
+#include "Porting.h"
+#include "AGESA.h"
+#include "FchCommonCfg.h"
+
+extern VOID FchECfancontrolservice (IN VOID *FchDataPtr);
+void agesawrapper_fchecfancontrolservice(void);
+
+#endif
diff --git a/src/vendorcode/amd/Kconfig b/src/vendorcode/amd/Kconfig
index 9720c79..2591cf9 100644
--- a/src/vendorcode/amd/Kconfig
+++ b/src/vendorcode/amd/Kconfig
@@ -34,7 +34,7 @@ choice
config CPU_AMD_AGESA_BINARY_PI
bool "binary PI"
- select HUDSON_DISABLE_IMC
+ select HUDSON_DISABLE_IMC if CPU_AMD_PI_00730F01 || CPU_AMD_PI_00630F01
help
Use a binary PI package. Generally, these will be stored in the
"3rdparty/blobs" directory. For some processors, these must be obtained
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10981
-gerrit
commit 65ae5fdc587656162c0c4ec7366eaa41bdb82a76
Author: Marc Jones <marc.jones(a)se-eng.com>
Date: Sun Jul 19 16:20:41 2015 -0600
vendorcode: Fixup AGESA PI Kconfig variables
The *_SELECTED Kconfig variable are not needed with the
options contained within and if CPU_AMD_AGESA_BINARY_PI
introduced in e4c17ce8. It also removes the need to
source and select the default prior to selecting the
AGESA source or AGESA PI option.
Change-Id: Iffa366f575f7f155bd6c7e7ece2a985f747c83be
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/vendorcode/amd/Kconfig | 36 +-----------------------------------
src/vendorcode/amd/pi/Kconfig | 29 +++++++++++------------------
2 files changed, 12 insertions(+), 53 deletions(-)
diff --git a/src/vendorcode/amd/Kconfig b/src/vendorcode/amd/Kconfig
index 9720c79..3c66eaf 100644
--- a/src/vendorcode/amd/Kconfig
+++ b/src/vendorcode/amd/Kconfig
@@ -21,8 +21,6 @@ if CPU_AMD_PI
menu "AMD Platform Initialization"
-source src/vendorcode/amd/pi/Kconfig
-
choice
prompt "AGESA source"
default CPU_AMD_AGESA_BINARY_PI if CPU_AMD_PI
@@ -50,39 +48,7 @@ config CPU_AMD_AGESA_OPENSOURCE
endchoice
if CPU_AMD_AGESA_BINARY_PI
-
-config AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_PATH
- string "AGESA PI directory path"
- default AGESA_BINARY_PI_PATH_DEFAULT if AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- help
- Specify where to find the AGESA headers and binary file
- for AMD platform initialization.
-
-config AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_FILE
- string "AGESA PI binary file name"
- default AGESA_BINARY_PI_FILE_DEFAULT if AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- help
- Specify the binary file to use for AMD platform initialization.
-
-config AGESA_BINARY_PI_LOCATION_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_LOCATION
- string "AGESA PI binary address in ROM"
- default AGESA_BINARY_PI_LOCATION_DEFAULT if AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- help
- Specify the ROM address at which to store the binary Platform
- Initialization code.
-
+source src/vendorcode/amd/pi/Kconfig
endif
endmenu
diff --git a/src/vendorcode/amd/pi/Kconfig b/src/vendorcode/amd/pi/Kconfig
index 4f7a952..5919b6b 100644
--- a/src/vendorcode/amd/pi/Kconfig
+++ b/src/vendorcode/amd/pi/Kconfig
@@ -27,35 +27,28 @@
if CPU_AMD_PI_00630F01 || CPU_AMD_PI_00730F01 || CPU_AMD_PI_00660F01
-config AGESA_BINARY_PI_DEFAULTS # dummy
- def_bool y
- select AGESA_BINARY_PI_LOCATION_DEFAULT_SELECTED
- select AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- select AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
-
-config AGESA_BINARY_PI_PATH_DEFAULT
- string
+config AGESA_BINARY_PI_PATH
+ string "AGESA PI directory path"
default "3rdparty/blobs/pi/amd/00630F01" if CPU_AMD_PI_00630F01
default "3rdparty/blobs/pi/amd/00730F01" if CPU_AMD_PI_00730F01
default "3rdparty/blobs/pi/amd/00660F01" if CPU_AMD_PI_00660F01
help
- The default binary file name to use for AMD platform initialization.
+ Specify where to find the AGESA headers and binary file
+ for AMD platform initialization.
-config AGESA_BINARY_PI_FILE_DEFAULT
- string
+config AGESA_BINARY_PI_FILE
+ string "AGESA PI binary file name"
default "FP3/AGESA.bin" if CPU_AMD_PI_00630F01
default "FT3b/AGESA.bin" if CPU_AMD_PI_00730F01
default "FP4/AGESA.bin" if CPU_AMD_PI_00660F01
help
- The default binary file name to use for AMD platform initialization.
+ Specify the binary file to use for AMD platform initialization.
-config AGESA_BINARY_PI_LOCATION_DEFAULT
- hex
- default 0xFFE00000 if CPU_AMD_PI_00630F01
- default 0xFFE00000 if CPU_AMD_PI_00730F01
- default 0xFFE00000 if CPU_AMD_PI_00660F01
+config AGESA_BINARY_PI_LOCATION
+ string "AGESA PI binary address in ROM"
+ default 0xFFE00000
help
- The default ROM address at which to store the binary Platform
+ Specify the ROM address at which to store the binary Platform
Initialization code.
endif
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10981
-gerrit
commit 30e7453b7f3dfbd96730a56432582a284f24f7c8
Author: Marc Jones <marc.jones(a)se-eng.com>
Date: Fri Jul 17 17:34:50 2015 -0600
vendorcode: Fixup AGESA PI Kconfig variables
The *_SELECTED Kconfig variable are not needed with the
options contained within and if CPU_AMD_AGESA_BINARY_PI
introduced in e4c17ce8. It also removes the need to
source and select the default prior to selecting the
AGESA source or AGESA PI option.
Change-Id: Iffa366f575f7f155bd6c7e7ece2a985f747c83be
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/vendorcode/amd/Kconfig | 36 +-----------------------------------
src/vendorcode/amd/pi/Kconfig | 33 ++++++++++++---------------------
2 files changed, 13 insertions(+), 56 deletions(-)
diff --git a/src/vendorcode/amd/Kconfig b/src/vendorcode/amd/Kconfig
index 9720c79..3c66eaf 100644
--- a/src/vendorcode/amd/Kconfig
+++ b/src/vendorcode/amd/Kconfig
@@ -21,8 +21,6 @@ if CPU_AMD_PI
menu "AMD Platform Initialization"
-source src/vendorcode/amd/pi/Kconfig
-
choice
prompt "AGESA source"
default CPU_AMD_AGESA_BINARY_PI if CPU_AMD_PI
@@ -50,39 +48,7 @@ config CPU_AMD_AGESA_OPENSOURCE
endchoice
if CPU_AMD_AGESA_BINARY_PI
-
-config AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_PATH
- string "AGESA PI directory path"
- default AGESA_BINARY_PI_PATH_DEFAULT if AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- help
- Specify where to find the AGESA headers and binary file
- for AMD platform initialization.
-
-config AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_FILE
- string "AGESA PI binary file name"
- default AGESA_BINARY_PI_FILE_DEFAULT if AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- help
- Specify the binary file to use for AMD platform initialization.
-
-config AGESA_BINARY_PI_LOCATION_DEFAULT_SELECTED
- bool
- default n
-
-config AGESA_BINARY_PI_LOCATION
- string "AGESA PI binary address in ROM"
- default AGESA_BINARY_PI_LOCATION_DEFAULT if AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
- help
- Specify the ROM address at which to store the binary Platform
- Initialization code.
-
+source src/vendorcode/amd/pi/Kconfig
endif
endmenu
diff --git a/src/vendorcode/amd/pi/Kconfig b/src/vendorcode/amd/pi/Kconfig
index 4f7a952..5af7658 100644
--- a/src/vendorcode/amd/pi/Kconfig
+++ b/src/vendorcode/amd/pi/Kconfig
@@ -27,35 +27,26 @@
if CPU_AMD_PI_00630F01 || CPU_AMD_PI_00730F01 || CPU_AMD_PI_00660F01
-config AGESA_BINARY_PI_DEFAULTS # dummy
- def_bool y
- select AGESA_BINARY_PI_LOCATION_DEFAULT_SELECTED
- select AGESA_BINARY_PI_PATH_DEFAULT_SELECTED
- select AGESA_BINARY_PI_FILE_DEFAULT_SELECTED
-
-config AGESA_BINARY_PI_PATH_DEFAULT
- string
+config AGESA_BINARY_PI_PATH
+ string "AGESA PI directory path"
default "3rdparty/blobs/pi/amd/00630F01" if CPU_AMD_PI_00630F01
default "3rdparty/blobs/pi/amd/00730F01" if CPU_AMD_PI_00730F01
default "3rdparty/blobs/pi/amd/00660F01" if CPU_AMD_PI_00660F01
help
- The default binary file name to use for AMD platform initialization.
+ Specify where to find the AGESA headers and binary file
+ for AMD platform initialization.
-config AGESA_BINARY_PI_FILE_DEFAULT
- string
- default "FP3/AGESA.bin" if CPU_AMD_PI_00630F01
- default "FT3b/AGESA.bin" if CPU_AMD_PI_00730F01
- default "FP4/AGESA.bin" if CPU_AMD_PI_00660F01
+config AGESA_BINARY_PI_FILE
+ string "AGESA PI binary file name"
+ default "AGESA.bin"
help
- The default binary file name to use for AMD platform initialization.
+ Specify the binary file to use for AMD platform initialization.
-config AGESA_BINARY_PI_LOCATION_DEFAULT
- hex
- default 0xFFE00000 if CPU_AMD_PI_00630F01
- default 0xFFE00000 if CPU_AMD_PI_00730F01
- default 0xFFE00000 if CPU_AMD_PI_00660F01
+config AGESA_BINARY_PI_LOCATION
+ string "AGESA PI binary address in ROM"
+ default 0xFFE00000
help
- The default ROM address at which to store the binary Platform
+ Specify the ROM address at which to store the binary Platform
Initialization code.
endif
Tobias Diedrich (ranma+coreboot(a)tdiedrich.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10940
-gerrit
commit 59d8aede5f7aea6360bd6dfeb5291ef5153d98f7
Author: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
Date: Sun Jun 21 18:25:38 2015 +0200
pcengines/apu1: Add k10temp thermal zone.
lm-sensors output (both ACPI & Linux k10temp):
acpitz-virtual-0
Adapter: Virtual device
temp1: +54.0 C (crit = +100.0 C)
k10temp-pci-00c3
Adapter: PCI adapter
temp1: +54.0 C (high = +70.0 C)
(crit = +100.0 C, hyst = +97.0 C)
Change-Id: Id9c5b783ba424246816677099ec6651814e59f21
Signed-off-by: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
---
src/mainboard/pcengines/apu1/acpi/thermal.asl | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/pcengines/apu1/acpi/thermal.asl b/src/mainboard/pcengines/apu1/acpi/thermal.asl
index baa4043..3e89ebf 100644
--- a/src/mainboard/pcengines/apu1/acpi/thermal.asl
+++ b/src/mainboard/pcengines/apu1/acpi/thermal.asl
@@ -15,7 +15,9 @@
* Foundation, Inc.
*/
-/* Thermal Zones have been #if 0 for a long time.
- * Removing it for now because it doesn't seem to
- * do anything when enabled anyway.
- */
+Scope (\_SB.PCI0) {
+ Device (K10M) {
+ Name (_ADR, 0x00180003)
+ #include <northbridge/amd/amdfam10/thermal_mixin.asl>
+ }
+}