summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2019-10-31 16:51:52 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-11-04 11:43:49 +0000
commit816326576ace8a46af1dba4a2b9e8d80ea2cbc7d (patch)
treeddbcecaca14f44434107e5fe3828fb25c0de2f1d /src
parentab0d687fc5ab7fb07e7c383c10902b586415c9bf (diff)
downloadcoreboot-816326576ace8a46af1dba4a2b9e8d80ea2cbc7d.tar.xz
include: Remove EC_EVENT_* from elog.h
All of the EC_EVENT_* macros can be replaced with the EC_HOST_EVENT_* macros defined in ec_commands.h, which is synchronized from Chromium OS ec repository. BRANCH=none BUG=none TEST=emerge-kukui coreboot Change-Id: I12c7101866d8365b87a6483a160187cc9526010a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36499 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Diffstat (limited to 'src')
-rw-r--r--src/ec/google/chromeec/ec.c4
-rw-r--r--src/include/elog.h31
-rw-r--r--src/mainboard/google/parrot/smihandler.c8
-rw-r--r--src/mainboard/google/stout/ec.c11
4 files changed, 14 insertions, 40 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index 2715e0b7f6..a9921467f4 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -97,7 +97,7 @@ void log_recovery_mode_switch(void)
static void google_chromeec_elog_add_recovery_event(void *unused)
{
uint64_t *events = cbmem_find(CBMEM_ID_EC_HOSTEVENT);
- uint8_t event_byte = EC_EVENT_KEYBOARD_RECOVERY;
+ uint8_t event_byte = EC_HOST_EVENT_KEYBOARD_RECOVERY;
if (!events)
return;
@@ -107,7 +107,7 @@ static void google_chromeec_elog_add_recovery_event(void *unused)
if (*events &
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT))
- event_byte = EC_EVENT_KEYBOARD_RECOVERY_HWREINIT;
+ event_byte = EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT;
elog_add_event_byte(ELOG_TYPE_EC_EVENT, event_byte);
}
diff --git a/src/include/elog.h b/src/include/elog.h
index 0328a865a4..1692a809fc 100644
--- a/src/include/elog.h
+++ b/src/include/elog.h
@@ -61,37 +61,6 @@
/* Embedded controller event */
#define ELOG_TYPE_EC_EVENT 0x91
-#define EC_EVENT_LID_CLOSED 0x01
-#define EC_EVENT_LID_OPEN 0x02
-#define EC_EVENT_POWER_BUTTON 0x03
-#define EC_EVENT_AC_CONNECTED 0x04
-#define EC_EVENT_AC_DISCONNECTED 0x05
-#define EC_EVENT_BATTERY_LOW 0x06
-#define EC_EVENT_BATTERY_CRITICAL 0x07
-#define EC_EVENT_BATTERY 0x08
-#define EC_EVENT_THERMAL_THRESHOLD 0x09
-#define EC_EVENT_DEVICE_EVENT 0x0a
-#define EC_EVENT_THERMAL 0x0b
-#define EC_EVENT_USB_CHARGER 0x0c
-#define EC_EVENT_KEY_PRESSED 0x0d
-#define EC_EVENT_INTERFACE_READY 0x0e
-#define EC_EVENT_KEYBOARD_RECOVERY 0x0f
-#define EC_EVENT_THERMAL_SHUTDOWN 0x10
-#define EC_EVENT_BATTERY_SHUTDOWN 0x11
-#define EC_EVENT_FAN_ERROR 0x12
-#define EC_EVENT_THROTTLE_STOP 0x13
-#define EC_EVENT_HANG_DETECT 0x14
-#define EC_EVENT_HANG_REBOOT 0x15
-#define EC_EVENT_PD_MCU 0x16
-#define EC_EVENT_BATTERY_STATUS 0x17
-#define EC_EVENT_PANIC 0x18
-#define EC_EVENT_KEYBOARD_FASTBOOT 0x19
-#define EC_EVENT_RTC 0x1a
-#define EC_EVENT_MKBP 0x1b
-#define EC_EVENT_USB_MUX 0x1c
-#define EC_EVENT_MODE_CHANGE 0x1d
-#define EC_EVENT_KEYBOARD_RECOVERY_HWREINIT 0x1e
-#define EC_EVENT_EXTENDED 0x1f
/* Power */
#define ELOG_TYPE_POWER_FAIL 0x92
diff --git a/src/mainboard/google/parrot/smihandler.c b/src/mainboard/google/parrot/smihandler.c
index 5883cdcae9..92d361dd4c 100644
--- a/src/mainboard/google/parrot/smihandler.c
+++ b/src/mainboard/google/parrot/smihandler.c
@@ -42,7 +42,7 @@ static u8 mainboard_smi_ec(void)
#if CONFIG(ELOG_GSMI)
if (!battery_critical_logged)
elog_add_event_byte(ELOG_TYPE_EC_EVENT,
- EC_EVENT_BATTERY_CRITICAL);
+ EC_HOST_EVENT_BATTERY_CRITICAL);
battery_critical_logged = 1;
#endif
break;
@@ -50,7 +50,8 @@ static u8 mainboard_smi_ec(void)
printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n");
#if CONFIG(ELOG_GSMI)
- elog_add_event_byte(ELOG_TYPE_EC_EVENT, EC_EVENT_LID_CLOSED);
+ elog_add_event_byte(ELOG_TYPE_EC_EVENT,
+ EC_HOST_EVENT_LID_CLOSED);
#endif
/* Go to S5 */
write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10));
@@ -71,7 +72,8 @@ void mainboard_smi_gpi(u32 gpi_sts)
printk(BIOS_DEBUG, "LID CLOSED, SHUTDOWN\n");
#if CONFIG(ELOG_GSMI)
- elog_add_event_byte(ELOG_TYPE_EC_EVENT, EC_EVENT_LID_CLOSED);
+ elog_add_event_byte(ELOG_TYPE_EC_EVENT,
+ EC_HOST_EVENT_LID_CLOSED);
#endif
/* Go to S5 */
write_pmbase32(PM1_CNT, read_pmbase32(PM1_CNT) | (0xf << 10));
diff --git a/src/mainboard/google/stout/ec.c b/src/mainboard/google/stout/ec.c
index a54b80b633..660bb76361 100644
--- a/src/mainboard/google/stout/ec.c
+++ b/src/mainboard/google/stout/ec.c
@@ -76,7 +76,8 @@ void stout_ec_finalize_smm(void)
printk(BIOS_ERR, " EC Fan Error\n");
critical_shutdown = 1;
#if CONFIG(ELOG_GSMI)
- elog_add_event_word(EC_EVENT_BATTERY_CRITICAL, EC_EVENT_FAN_ERROR);
+ elog_add_event_word(EC_HOST_EVENT_BATTERY_CRITICAL,
+ EC_HOST_EVENT_THROTTLE_START);
#endif
}
@@ -86,7 +87,8 @@ void stout_ec_finalize_smm(void)
printk(BIOS_ERR, " EC Thermal Device Error\n");
critical_shutdown = 1;
#if CONFIG(ELOG_GSMI)
- elog_add_event_word(EC_EVENT_BATTERY_CRITICAL, EC_EVENT_THERMAL);
+ elog_add_event_word(EC_HOST_EVENT_BATTERY_CRITICAL,
+ EC_HOST_EVENT_THERMAL);
#endif
}
@@ -98,14 +100,15 @@ void stout_ec_finalize_smm(void)
printk(BIOS_ERR, " EC Critical Battery Error\n");
critical_shutdown = 1;
#if CONFIG(ELOG_GSMI)
- elog_add_event_word(ELOG_TYPE_EC_EVENT, EC_EVENT_BATTERY_CRITICAL);
+ elog_add_event_word(ELOG_TYPE_EC_EVENT,
+ EC_HOST_EVENT_BATTERY_CRITICAL);
#endif
}
if ((ec_reg & 0x8F) == 0x8F) {
printk(BIOS_ERR, " EC Read Battery Error\n");
#if CONFIG(ELOG_GSMI)
- elog_add_event_word(ELOG_TYPE_EC_EVENT, EC_EVENT_BATTERY);
+ elog_add_event_word(ELOG_TYPE_EC_EVENT, EC_HOST_EVENT_BATTERY);
#endif
}