aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-05-22 16:13:49 -0700
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-11-24 06:26:30 +0100
commitd80cd2ad80b2b9debfce1fce5f94c773cb51c8cc (patch)
treeba390a5febfe561fa9f22f1bc5cba059d60809cc /src
parentcfe0235c6fb5574b54139c6e7bd31da974e4ef23 (diff)
slippy: Clean up for easier porting
Minor tweaks to variable names in the slippy mainboard that make it easier to base a new board from without as much renaming. Also properly set up the thermal variables for the thermal zone that is defined in ACPI instead of using the generic setup from WTM2. Change-Id: I752c1a50bfdc06b6ddad95bd1331c6870b9f9df2 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/56328 Reviewed-on: http://review.coreboot.org/4183 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/slippy/acpi_tables.c23
-rw-r--r--src/mainboard/google/slippy/ec.c14
-rw-r--r--src/mainboard/google/slippy/ec.h18
-rw-r--r--src/mainboard/google/slippy/gpio.h2
-rw-r--r--src/mainboard/google/slippy/mainboard.c2
-rw-r--r--src/mainboard/google/slippy/smihandler.c6
-rw-r--r--src/mainboard/google/slippy/thermal.h40
7 files changed, 40 insertions, 65 deletions
diff --git a/src/mainboard/google/slippy/acpi_tables.c b/src/mainboard/google/slippy/acpi_tables.c
index 16a1c6a9ed..5d46d37492 100644
--- a/src/mainboard/google/slippy/acpi_tables.c
+++ b/src/mainboard/google/slippy/acpi_tables.c
@@ -43,29 +43,18 @@ unsigned long acpi_create_slic(unsigned long current);
static void acpi_update_thermal_table(global_nvs_t *gnvs)
{
- gnvs->f4of = FAN4_THRESHOLD_OFF;
- gnvs->f4on = FAN4_THRESHOLD_ON;
- gnvs->f4pw = FAN4_PWM;
+ gnvs->tmps = CTDP_SENSOR_ID;
- gnvs->f3of = FAN3_THRESHOLD_OFF;
- gnvs->f3on = FAN3_THRESHOLD_ON;
- gnvs->f3pw = FAN3_PWM;
+ gnvs->f1of = CTDP_NOMINAL_THRESHOLD_OFF;
+ gnvs->f1on = CTDP_NOMINAL_THRESHOLD_ON;
- gnvs->f2of = FAN2_THRESHOLD_OFF;
- gnvs->f2on = FAN2_THRESHOLD_ON;
- gnvs->f2pw = FAN2_PWM;
-
- gnvs->f1of = FAN1_THRESHOLD_OFF;
- gnvs->f1on = FAN1_THRESHOLD_ON;
- gnvs->f1pw = FAN1_PWM;
-
- gnvs->f0of = FAN0_THRESHOLD_OFF;
- gnvs->f0on = FAN0_THRESHOLD_ON;
- gnvs->f0pw = FAN0_PWM;
+ gnvs->f0of = CTDP_DOWN_THRESHOLD_OFF;
+ gnvs->f0on = CTDP_DOWN_THRESHOLD_ON;
gnvs->tcrt = CRITICAL_TEMPERATURE;
gnvs->tpsv = PASSIVE_TEMPERATURE;
gnvs->tmax = MAX_TEMPERATURE;
+ gnvs->flvl = 1;
}
static void acpi_create_gnvs(global_nvs_t *gnvs)
diff --git a/src/mainboard/google/slippy/ec.c b/src/mainboard/google/slippy/ec.c
index 3c2598739b..0919f0feec 100644
--- a/src/mainboard/google/slippy/ec.c
+++ b/src/mainboard/google/slippy/ec.c
@@ -24,25 +24,25 @@
#include <ec/google/chromeec/ec.h>
#include "ec.h"
-void slippy_ec_init(void)
+void mainboard_ec_init(void)
{
- printk(BIOS_DEBUG, "slippy_ec_init\n");
+ printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0);
/* Restore SCI event mask on resume. */
if (acpi_slp_type == 3) {
- google_chromeec_log_events(SLIPPY_EC_LOG_EVENTS |
- SLIPPY_EC_S3_WAKE_EVENTS);
+ google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
+ MAINBOARD_EC_S3_WAKE_EVENTS);
/* Disable SMI and wake events */
google_chromeec_set_smi_mask(0);
/* Clear pending events */
while (google_chromeec_get_event() != 0);
- google_chromeec_set_sci_mask(SLIPPY_EC_SCI_EVENTS);
+ google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
} else {
- google_chromeec_log_events(SLIPPY_EC_LOG_EVENTS |
- SLIPPY_EC_S5_WAKE_EVENTS);
+ google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
+ MAINBOARD_EC_S5_WAKE_EVENTS);
}
/* Clear wake events, these are enabled on entry to sleep */
diff --git a/src/mainboard/google/slippy/ec.h b/src/mainboard/google/slippy/ec.h
index 312e79f968..11d2453837 100644
--- a/src/mainboard/google/slippy/ec.h
+++ b/src/mainboard/google/slippy/ec.h
@@ -17,15 +17,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef SLIPPY_EC_H
-#define SLIPPY_EC_H
+#ifndef MAINBOARD_EC_H
+#define MAINBOARD_EC_H
#include <ec/google/chromeec/ec_commands.h>
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
#define EC_SMI_GPI 34 /* GPIO34 is EC_SMI# */
-#define SLIPPY_EC_SCI_EVENTS \
+#define MAINBOARD_EC_SCI_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\
@@ -37,26 +37,26 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER))
-#define SLIPPY_EC_SMI_EVENTS \
+#define MAINBOARD_EC_SMI_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED))
/* EC can wake from S5 with lid or power button */
-#define SLIPPY_EC_S5_WAKE_EVENTS \
+#define MAINBOARD_EC_S5_WAKE_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON))
/* EC can wake from S3 with lid or power button or key press */
-#define SLIPPY_EC_S3_WAKE_EVENTS \
- (SLIPPY_EC_S5_WAKE_EVENTS |\
+#define MAINBOARD_EC_S3_WAKE_EVENTS \
+ (MAINBOARD_EC_S5_WAKE_EVENTS |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED))
/* Log EC wake events plus EC shutdown events */
-#define SLIPPY_EC_LOG_EVENTS \
+#define MAINBOARD_EC_LOG_EVENTS \
(EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
#ifndef __ACPI__
-extern void slippy_ec_init(void);
+extern void mainboard_ec_init(void);
#endif
#endif
diff --git a/src/mainboard/google/slippy/gpio.h b/src/mainboard/google/slippy/gpio.h
index cc7467439b..7fb670b4c6 100644
--- a/src/mainboard/google/slippy/gpio.h
+++ b/src/mainboard/google/slippy/gpio.h
@@ -20,7 +20,7 @@
#ifndef SLIPPY_GPIO_H
#define SLIPPY_GPIO_H
-#include "southbridge/intel/lynxpoint/lp_gpio.h"
+struct pch_lp_gpio_map;
const struct pch_lp_gpio_map mainboard_gpio_map[] = {
LP_GPIO_UNUSED, /* 0: UNUSED */
diff --git a/src/mainboard/google/slippy/mainboard.c b/src/mainboard/google/slippy/mainboard.c
index f8d164886e..cce2260fcf 100644
--- a/src/mainboard/google/slippy/mainboard.c
+++ b/src/mainboard/google/slippy/mainboard.c
@@ -142,7 +142,7 @@ static void verb_setup(void)
static void mainboard_init(device_t dev)
{
- slippy_ec_init();
+ mainboard_ec_init();
}
// mainboard_enable is executed as first thing after
diff --git a/src/mainboard/google/slippy/smihandler.c b/src/mainboard/google/slippy/smihandler.c
index bbdb7f9a4d..428af5f5c5 100644
--- a/src/mainboard/google/slippy/smihandler.c
+++ b/src/mainboard/google/slippy/smihandler.c
@@ -117,7 +117,7 @@ void mainboard_smi_sleep(u8 slp_typ)
while (google_chromeec_get_event() != 0);
/* Enable wake events */
- google_chromeec_set_wake_mask(SLIPPY_EC_S3_WAKE_EVENTS);
+ google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
}
#define APMC_FINALIZE 0xcb
@@ -144,13 +144,13 @@ int mainboard_smi_apmc(u8 apmc)
google_chromeec_set_smi_mask(0);
/* Clear all pending events */
while (google_chromeec_get_event() != 0);
- google_chromeec_set_sci_mask(SLIPPY_EC_SCI_EVENTS);
+ google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
break;
case APM_CNT_ACPI_DISABLE:
google_chromeec_set_sci_mask(0);
/* Clear all pending events */
while (google_chromeec_get_event() != 0);
- google_chromeec_set_smi_mask(SLIPPY_EC_SMI_EVENTS);;
+ google_chromeec_set_smi_mask(MAINBOARD_EC_SMI_EVENTS);;
break;
}
return 0;
diff --git a/src/mainboard/google/slippy/thermal.h b/src/mainboard/google/slippy/thermal.h
index cb67d805e5..fceaeca6b9 100644
--- a/src/mainboard/google/slippy/thermal.h
+++ b/src/mainboard/google/slippy/thermal.h
@@ -20,38 +20,24 @@
#ifndef THERMAL_H
#define THERMAL_H
-/* Fan is OFF */
-#define FAN4_THRESHOLD_OFF 0
-#define FAN4_THRESHOLD_ON 0
-#define FAN4_PWM 0x00
-
-/* Fan is at LOW speed */
-#define FAN3_THRESHOLD_OFF 48
-#define FAN3_THRESHOLD_ON 55
-#define FAN3_PWM 0x40
-
-/* Fan is at MEDIUM speed */
-#define FAN2_THRESHOLD_OFF 52
-#define FAN2_THRESHOLD_ON 64
-#define FAN2_PWM 0x80
-
-/* Fan is at HIGH speed */
-#define FAN1_THRESHOLD_OFF 60
-#define FAN1_THRESHOLD_ON 68
-#define FAN1_PWM 0xb0
-
-/* Fan is at FULL speed */
-#define FAN0_THRESHOLD_OFF 66
-#define FAN0_THRESHOLD_ON 78
-#define FAN0_PWM 0xff
+/* Config TDP Sensor ID */
+#define CTDP_SENSOR_ID 1 /* PECI */
+
+/* Config TDP Nominal */
+#define CTDP_NOMINAL_THRESHOLD_OFF 0
+#define CTDP_NOMINAL_THRESHOLD_ON 0
+
+/* Config TDP Down */
+#define CTDP_DOWN_THRESHOLD_OFF 80
+#define CTDP_DOWN_THRESHOLD_ON 90
/* Temperature which OS will shutdown at */
-#define CRITICAL_TEMPERATURE 100
+#define CRITICAL_TEMPERATURE 104
/* Temperature which OS will throttle CPU */
-#define PASSIVE_TEMPERATURE 90
+#define PASSIVE_TEMPERATURE 100
/* Tj_max value for calculating PECI CPU temperature */
-#define MAX_TEMPERATURE 105
+#define MAX_TEMPERATURE 105
#endif