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>
This commit is contained in:
parent
cfe0235c6f
commit
d80cd2ad80
|
@ -43,29 +43,18 @@ unsigned long acpi_create_slic(unsigned long current);
|
||||||
|
|
||||||
static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
||||||
{
|
{
|
||||||
gnvs->f4of = FAN4_THRESHOLD_OFF;
|
gnvs->tmps = CTDP_SENSOR_ID;
|
||||||
gnvs->f4on = FAN4_THRESHOLD_ON;
|
|
||||||
gnvs->f4pw = FAN4_PWM;
|
|
||||||
|
|
||||||
gnvs->f3of = FAN3_THRESHOLD_OFF;
|
gnvs->f1of = CTDP_NOMINAL_THRESHOLD_OFF;
|
||||||
gnvs->f3on = FAN3_THRESHOLD_ON;
|
gnvs->f1on = CTDP_NOMINAL_THRESHOLD_ON;
|
||||||
gnvs->f3pw = FAN3_PWM;
|
|
||||||
|
|
||||||
gnvs->f2of = FAN2_THRESHOLD_OFF;
|
gnvs->f0of = CTDP_DOWN_THRESHOLD_OFF;
|
||||||
gnvs->f2on = FAN2_THRESHOLD_ON;
|
gnvs->f0on = CTDP_DOWN_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->tcrt = CRITICAL_TEMPERATURE;
|
gnvs->tcrt = CRITICAL_TEMPERATURE;
|
||||||
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
||||||
gnvs->tmax = MAX_TEMPERATURE;
|
gnvs->tmax = MAX_TEMPERATURE;
|
||||||
|
gnvs->flvl = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void acpi_create_gnvs(global_nvs_t *gnvs)
|
static void acpi_create_gnvs(global_nvs_t *gnvs)
|
||||||
|
|
|
@ -24,25 +24,25 @@
|
||||||
#include <ec/google/chromeec/ec.h>
|
#include <ec/google/chromeec/ec.h>
|
||||||
#include "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);
|
post_code(0xf0);
|
||||||
|
|
||||||
/* Restore SCI event mask on resume. */
|
/* Restore SCI event mask on resume. */
|
||||||
if (acpi_slp_type == 3) {
|
if (acpi_slp_type == 3) {
|
||||||
google_chromeec_log_events(SLIPPY_EC_LOG_EVENTS |
|
google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
|
||||||
SLIPPY_EC_S3_WAKE_EVENTS);
|
MAINBOARD_EC_S3_WAKE_EVENTS);
|
||||||
|
|
||||||
/* Disable SMI and wake events */
|
/* Disable SMI and wake events */
|
||||||
google_chromeec_set_smi_mask(0);
|
google_chromeec_set_smi_mask(0);
|
||||||
|
|
||||||
/* Clear pending events */
|
/* Clear pending events */
|
||||||
while (google_chromeec_get_event() != 0);
|
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 {
|
} else {
|
||||||
google_chromeec_log_events(SLIPPY_EC_LOG_EVENTS |
|
google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
|
||||||
SLIPPY_EC_S5_WAKE_EVENTS);
|
MAINBOARD_EC_S5_WAKE_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear wake events, these are enabled on entry to sleep */
|
/* Clear wake events, these are enabled on entry to sleep */
|
||||||
|
|
|
@ -17,15 +17,15 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SLIPPY_EC_H
|
#ifndef MAINBOARD_EC_H
|
||||||
#define SLIPPY_EC_H
|
#define MAINBOARD_EC_H
|
||||||
|
|
||||||
#include <ec/google/chromeec/ec_commands.h>
|
#include <ec/google/chromeec/ec_commands.h>
|
||||||
|
|
||||||
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
|
#define EC_SCI_GPI 36 /* GPIO36 is EC_SCI# */
|
||||||
#define EC_SMI_GPI 34 /* GPIO34 is EC_SMI# */
|
#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_CLOSED) |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\
|
EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_AC_CONNECTED) |\
|
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_THERMAL_OVERLOAD) |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER))
|
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_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED))
|
||||||
|
|
||||||
/* EC can wake from S5 with lid or power button */
|
/* 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_LID_OPEN) |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON))
|
EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON))
|
||||||
|
|
||||||
/* EC can wake from S3 with lid or power button or key press */
|
/* EC can wake from S3 with lid or power button or key press */
|
||||||
#define SLIPPY_EC_S3_WAKE_EVENTS \
|
#define MAINBOARD_EC_S3_WAKE_EVENTS \
|
||||||
(SLIPPY_EC_S5_WAKE_EVENTS |\
|
(MAINBOARD_EC_S5_WAKE_EVENTS |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED))
|
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED))
|
||||||
|
|
||||||
/* Log EC wake events plus EC shutdown events */
|
/* 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_THERMAL_SHUTDOWN) |\
|
||||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
|
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN))
|
||||||
|
|
||||||
#ifndef __ACPI__
|
#ifndef __ACPI__
|
||||||
extern void slippy_ec_init(void);
|
extern void mainboard_ec_init(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef SLIPPY_GPIO_H
|
#ifndef SLIPPY_GPIO_H
|
||||||
#define 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[] = {
|
const struct pch_lp_gpio_map mainboard_gpio_map[] = {
|
||||||
LP_GPIO_UNUSED, /* 0: UNUSED */
|
LP_GPIO_UNUSED, /* 0: UNUSED */
|
||||||
|
|
|
@ -142,7 +142,7 @@ static void verb_setup(void)
|
||||||
|
|
||||||
static void mainboard_init(device_t dev)
|
static void mainboard_init(device_t dev)
|
||||||
{
|
{
|
||||||
slippy_ec_init();
|
mainboard_ec_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// mainboard_enable is executed as first thing after
|
// mainboard_enable is executed as first thing after
|
||||||
|
|
|
@ -117,7 +117,7 @@ void mainboard_smi_sleep(u8 slp_typ)
|
||||||
while (google_chromeec_get_event() != 0);
|
while (google_chromeec_get_event() != 0);
|
||||||
|
|
||||||
/* Enable wake events */
|
/* 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
|
#define APMC_FINALIZE 0xcb
|
||||||
|
@ -144,13 +144,13 @@ int mainboard_smi_apmc(u8 apmc)
|
||||||
google_chromeec_set_smi_mask(0);
|
google_chromeec_set_smi_mask(0);
|
||||||
/* Clear all pending events */
|
/* Clear all pending events */
|
||||||
while (google_chromeec_get_event() != 0);
|
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;
|
break;
|
||||||
case APM_CNT_ACPI_DISABLE:
|
case APM_CNT_ACPI_DISABLE:
|
||||||
google_chromeec_set_sci_mask(0);
|
google_chromeec_set_sci_mask(0);
|
||||||
/* Clear all pending events */
|
/* Clear all pending events */
|
||||||
while (google_chromeec_get_event() != 0);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -20,38 +20,24 @@
|
||||||
#ifndef THERMAL_H
|
#ifndef THERMAL_H
|
||||||
#define THERMAL_H
|
#define THERMAL_H
|
||||||
|
|
||||||
/* Fan is OFF */
|
/* Config TDP Sensor ID */
|
||||||
#define FAN4_THRESHOLD_OFF 0
|
#define CTDP_SENSOR_ID 1 /* PECI */
|
||||||
#define FAN4_THRESHOLD_ON 0
|
|
||||||
#define FAN4_PWM 0x00
|
|
||||||
|
|
||||||
/* Fan is at LOW speed */
|
/* Config TDP Nominal */
|
||||||
#define FAN3_THRESHOLD_OFF 48
|
#define CTDP_NOMINAL_THRESHOLD_OFF 0
|
||||||
#define FAN3_THRESHOLD_ON 55
|
#define CTDP_NOMINAL_THRESHOLD_ON 0
|
||||||
#define FAN3_PWM 0x40
|
|
||||||
|
|
||||||
/* Fan is at MEDIUM speed */
|
/* Config TDP Down */
|
||||||
#define FAN2_THRESHOLD_OFF 52
|
#define CTDP_DOWN_THRESHOLD_OFF 80
|
||||||
#define FAN2_THRESHOLD_ON 64
|
#define CTDP_DOWN_THRESHOLD_ON 90
|
||||||
#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
|
|
||||||
|
|
||||||
/* Temperature which OS will shutdown at */
|
/* Temperature which OS will shutdown at */
|
||||||
#define CRITICAL_TEMPERATURE 100
|
#define CRITICAL_TEMPERATURE 104
|
||||||
|
|
||||||
/* Temperature which OS will throttle CPU */
|
/* Temperature which OS will throttle CPU */
|
||||||
#define PASSIVE_TEMPERATURE 90
|
#define PASSIVE_TEMPERATURE 100
|
||||||
|
|
||||||
/* Tj_max value for calculating PECI CPU temperature */
|
/* Tj_max value for calculating PECI CPU temperature */
|
||||||
#define MAX_TEMPERATURE 105
|
#define MAX_TEMPERATURE 105
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue