aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/amd/bettong/BiosCallOuts.c21
-rw-r--r--src/mainboard/amd/db-ft3b-lc/BiosCallOuts.c2
-rw-r--r--src/mainboard/amd/lamar/BiosCallOuts.c2
-rw-r--r--src/mainboard/amd/olivehillplus/BiosCallOuts.c2
-rw-r--r--src/mainboard/bap/ode_e21XX/BiosCallOuts.c2
-rw-r--r--src/mainboard/pcengines/apu2/BiosCallOuts.c2
-rw-r--r--src/southbridge/amd/pi/hudson/imc.c18
-rw-r--r--src/southbridge/amd/pi/hudson/imc.h5
8 files changed, 26 insertions, 28 deletions
diff --git a/src/mainboard/amd/bettong/BiosCallOuts.c b/src/mainboard/amd/bettong/BiosCallOuts.c
index b251a5a5e7..8ea10d9080 100644
--- a/src/mainboard/amd/bettong/BiosCallOuts.c
+++ b/src/mainboard/amd/bettong/BiosCallOuts.c
@@ -26,6 +26,7 @@
#include "imc.h"
#include "hudson.h"
#include <stdlib.h>
+#include <string.h>
#include "northbridge/amd/pi/dimmSpd.h"
#include "northbridge/amd/pi/agesawrapper.h"
#include <boardid.h>
@@ -52,6 +53,25 @@ static const GPIO_CONTROL oem_bettong_gpio[] = {
{64, Function1, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE | FCH_GPIO_OUTPUT_ENABLE | DrvStrengthSel_12mA},
{-1}
};
+
+/* 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.
+ */
+static 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 */
+
+ memset(&FchParams->Imc.EcStruct, 0, sizeof(FCH_EC));
+}
+
/**
* Fch Oem setting callback
*
@@ -72,6 +92,7 @@ AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN 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);
diff --git a/src/mainboard/amd/db-ft3b-lc/BiosCallOuts.c b/src/mainboard/amd/db-ft3b-lc/BiosCallOuts.c
index 9a51f5bf29..5930a4f577 100644
--- a/src/mainboard/amd/db-ft3b-lc/BiosCallOuts.c
+++ b/src/mainboard/amd/db-ft3b-lc/BiosCallOuts.c
@@ -123,7 +123,7 @@ static const CODEC_TBL_LIST CodecTableList[] =
* software switches the I2C address. AMD recommends using IMC
* to control fans, instead of HWM.
*/
-void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
{
FCH_HWM_FAN_CTR oem_factl[5] = {
/*temperature input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */
diff --git a/src/mainboard/amd/lamar/BiosCallOuts.c b/src/mainboard/amd/lamar/BiosCallOuts.c
index b0cdcc0dad..7a73ffee33 100644
--- a/src/mainboard/amd/lamar/BiosCallOuts.c
+++ b/src/mainboard/amd/lamar/BiosCallOuts.c
@@ -138,7 +138,7 @@ static const CODEC_TBL_LIST CodecTableList[] =
* software switches the I2C address. AMD recommends using IMC
* to control fans, instead of HWM.
*/
-void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
{
FCH_HWM_FAN_CTR oem_factl[5] = {
/*temperature input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */
diff --git a/src/mainboard/amd/olivehillplus/BiosCallOuts.c b/src/mainboard/amd/olivehillplus/BiosCallOuts.c
index 36dcb14539..939f3bfa1b 100644
--- a/src/mainboard/amd/olivehillplus/BiosCallOuts.c
+++ b/src/mainboard/amd/olivehillplus/BiosCallOuts.c
@@ -106,7 +106,7 @@ static const CODEC_TBL_LIST CodecTableList[] =
* software switches the I2C address. AMD recommends using IMC
* to control fans, instead of HWM.
*/
-void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
{
FCH_HWM_FAN_CTR oem_factl[5] = {
/*temperature input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */
diff --git a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
index dd73c47ed8..28e6e5a9a3 100644
--- a/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
+++ b/src/mainboard/bap/ode_e21XX/BiosCallOuts.c
@@ -108,7 +108,7 @@ static const CODEC_TBL_LIST CodecTableList[] =
* software switches the I2C address. AMD recommends using IMC
* to control fans, instead of HWM.
*/
-void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
{
FCH_HWM_FAN_CTR oem_factl[5] = {
/*temperature input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */
diff --git a/src/mainboard/pcengines/apu2/BiosCallOuts.c b/src/mainboard/pcengines/apu2/BiosCallOuts.c
index ec9c71966c..58227790c1 100644
--- a/src/mainboard/pcengines/apu2/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu2/BiosCallOuts.c
@@ -53,7 +53,7 @@ const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
* software switches the I2C address. AMD recommends using IMC
* to control fans, instead of HWM.
*/
-void oem_fan_control(FCH_DATA_BLOCK *FchParams)
+static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
{
FchParams->Imc.ImcEnable = FALSE;
FchParams->Hwm.HwMonitorEnable = FALSE;
diff --git a/src/southbridge/amd/pi/hudson/imc.c b/src/southbridge/amd/pi/hudson/imc.c
index d11bb88801..53e97fbae3 100644
--- a/src/southbridge/amd/pi/hudson/imc.c
+++ b/src/southbridge/amd/pi/hudson/imc.c
@@ -81,21 +81,3 @@ void enable_imc_thermal_zone(void)
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
index 7e407304eb..0fcc187a4e 100644
--- a/src/southbridge/amd/pi/hudson/imc.h
+++ b/src/southbridge/amd/pi/hudson/imc.h
@@ -16,12 +16,7 @@
#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