summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-05-21 10:22:55 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-05-22 21:56:40 -0700
commit8f6fff795bdfff6e98395b5aa3fc9127fa5748c1 (patch)
treecc9cb57f2b69300975b4691c3fcd329e77c831d5
parentdf06639b1d4fd2798e577f9aead6bc4495d5f3b5 (diff)
downloadchrome-ec-8f6fff795bdfff6e98395b5aa3fc9127fa5748c1.tar.gz
lpc/espi: convert remaning CONFIG_LPC to CONFIG_HOSTCMD_X86
We have converted all LPC-only configs to HOSTCMD_LPC so the remaining CONFIG_LPC defines represent the common case. BRANCH=none BUG=chromium:818804 TEST=Full stack builds and works on yorp (espi) and grunt (lpc) Change-Id: Iba9a48f2cab12fadd0d9ab8eab0d5d5476eab238 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1067503 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/build.mk2
-rw-r--r--common/ec_features.c2
-rw-r--r--common/host_command.c6
-rw-r--r--common/host_event_commands.c32
-rw-r--r--common/main.c2
-rw-r--r--common/motion_sense.c2
-rw-r--r--core/nds32/ec.lds.S4
-rw-r--r--include/console_channel.inc2
-rw-r--r--include/host_command.h2
-rw-r--r--power/common.c2
10 files changed, 28 insertions, 28 deletions
diff --git a/common/build.mk b/common/build.mk
index a6f2fd2d1c..d1d6f88ee4 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -76,7 +76,7 @@ common-$(CONFIG_LED_PWM)+=led_pwm.o
common-$(CONFIG_LID_ANGLE)+=motion_lid.o math_util.o
common-$(CONFIG_LID_ANGLE_UPDATE)+=lid_angle.o
common-$(CONFIG_LID_SWITCH)+=lid_switch.o
-common-$(CONFIG_LPC)+=acpi.o port80.o ec_features.o
+common-$(CONFIG_HOSTCMD_X86)+=acpi.o port80.o ec_features.o
common-$(CONFIG_MAG_CALIBRATE)+= mag_cal.o math_util.o vec3.o mat33.o mat44.o
common-$(CONFIG_MKBP_EVENT)+=mkbp_event.o
common-$(CONFIG_ONEWIRE)+=onewire.o
diff --git a/common/ec_features.c b/common/ec_features.c
index 28ed2a1364..bf4ef03011 100644
--- a/common/ec_features.c
+++ b/common/ec_features.c
@@ -40,7 +40,7 @@ uint32_t get_feature_flags0(void)
#ifdef CONFIG_PSTORE
| EC_FEATURE_MASK_0(EC_FEATURE_PSTORE)
#endif
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
| EC_FEATURE_MASK_0(EC_FEATURE_PORT80)
#endif
#ifdef CONFIG_TEMP_SENSOR
diff --git a/common/host_command.c b/common/host_command.c
index 0900d9e1d4..f80f43a4c5 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -36,7 +36,7 @@ static struct host_cmd_handler_args *pending_args;
/* Verify Boot Mode */
static int g_vboot_mode;
-#ifndef CONFIG_LPC
+#ifndef CONFIG_HOSTCMD_X86
/*
* Simulated memory map. Must be word-aligned, because some of the elements
* in the memory map are words.
@@ -91,7 +91,7 @@ static uint32_t hc_suppressed_cnt[ARRAY_SIZE(hc_suppressed_cmd)];
uint8_t *host_get_memmap(int offset)
{
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
return lpc_get_memmap_range() + offset;
#else
return host_memmap + offset;
@@ -520,7 +520,7 @@ DECLARE_HOST_COMMAND(EC_CMD_READ_TEST,
host_command_read_test,
EC_VER_MASK(0));
-#ifndef CONFIG_LPC
+#ifndef CONFIG_HOSTCMD_X86
/*
* Host command to read memory map is not needed on LPC, because LPC can
* directly map the data to the host's memory space.
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index 52d4049120..2762a8bd56 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -46,7 +46,7 @@ static void host_event_set_bit(host_event_t *ev, uint8_t bit)
*ptr = HOST_EVENT_32BIT_MASK(bit);
}
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
#define LPC_SYSJUMP_TAG 0x4c50 /* "LP" */
#define LPC_SYSJUMP_OLD_VERSION 1
@@ -228,7 +228,7 @@ static host_event_t events;
static host_event_t events_copy_b;
/* Lazy wake masks */
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
static struct lazy_wake_masks {
host_event_t s3_lazy_wm;
host_event_t s5_lazy_wm;
@@ -258,7 +258,7 @@ static void host_events_atomic_clear(host_event_t *e, host_event_t m)
#endif
}
-#if !defined(CONFIG_LPC) && defined(CONFIG_MKBP_EVENT)
+#if !defined(CONFIG_HOSTCMD_X86) && defined(CONFIG_MKBP_EVENT)
static void host_events_send_mkbp_event(host_event_t e)
{
#ifdef CONFIG_HOST_EVENT64
@@ -288,7 +288,7 @@ void host_set_events(host_event_t mask)
mask &= CONFIG_HOST_EVENT_REPORT_MASK;
#endif
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
/*
* Host only cares about the events for which the masks are set either
* in wake mask, SCI mask or SMI mask. In addition to that, there are
@@ -309,7 +309,7 @@ void host_set_events(host_event_t mask)
host_events_atomic_or(&events, mask);
host_events_atomic_or(&events_copy_b, mask);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
lpc_set_host_event_state(events);
#else
*(host_event_t *)host_get_memmap(EC_MEMMAP_HOST_EVENTS) = events;
@@ -319,7 +319,7 @@ void host_set_events(host_event_t mask)
#endif
host_events_send_mkbp_event(events);
#endif /* CONFIG_MKBP_EVENT */
-#endif /* !CONFIG_LPC */
+#endif /* !CONFIG_HOSTCMD_X86 */
}
void host_set_single_event(enum host_event_code event)
@@ -355,17 +355,17 @@ void host_clear_events(host_event_t mask)
host_events_atomic_clear(&events, mask);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
lpc_set_host_event_state(events);
#else
*(host_event_t *)host_get_memmap(EC_MEMMAP_HOST_EVENTS) = events;
#ifdef CONFIG_MKBP_EVENT
host_events_send_mkbp_event(events);
#endif
-#endif /* !CONFIG_LPC */
+#endif /* !CONFIG_HOSTCMD_X86 */
}
-#ifndef CONFIG_LPC
+#ifndef CONFIG_HOSTCMD_X86
static int host_get_next_event(uint8_t *out)
{
uint32_t event_out = (uint32_t)events;
@@ -435,7 +435,7 @@ static int command_host_event(int argc, char **argv)
host_clear_events(i);
else if (!strcasecmp(argv[1], "clearb"))
host_clear_events_b(i);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
else if (!strcasecmp(argv[1], "smi"))
lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, i);
else if (!strcasecmp(argv[1], "sci"))
@@ -453,7 +453,7 @@ static int command_host_event(int argc, char **argv)
/* Print current SMI/SCI status */
HOST_EVENT_CCPRINTF("Events: ", host_get_events());
HOST_EVENT_CCPRINTF("Events-B: ", events_copy_b);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
HOST_EVENT_CCPRINTF("SMI mask: ",
lpc_get_host_event_mask(LPC_HOST_EVENT_SMI));
HOST_EVENT_CCPRINTF("SCI mask: ",
@@ -472,7 +472,7 @@ DECLARE_CONSOLE_COMMAND(hostevent, command_host_event,
/*****************************************************************************/
/* Host commands */
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
static int host_event_get_smi_mask(struct host_cmd_handler_args *args)
{
@@ -552,7 +552,7 @@ uint8_t lpc_is_active_wm_set_by_host(void)
return active_wm_set_by_host;
}
-#endif /* CONFIG_LPC */
+#endif /* CONFIG_HOSTCMD_X86 */
static int host_event_get_b(struct host_cmd_handler_args *args)
{
@@ -602,7 +602,7 @@ static int host_event_action_get(struct host_cmd_handler_args *args)
case EC_HOST_EVENT_B:
r->value = events_copy_b;
break;
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
case EC_HOST_EVENT_SCI_MASK:
r->value = lpc_get_host_event_mask(LPC_HOST_EVENT_SCI);
break;
@@ -643,7 +643,7 @@ static int host_event_action_set(struct host_cmd_handler_args *args)
host_event_t mask_value __unused = (host_event_t)(p->value);
switch (p->mask_type) {
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
case EC_HOST_EVENT_SCI_MASK:
lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, mask_value);
break;
@@ -723,7 +723,7 @@ DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT,
#define LAZY_WAKE_MASK_SYSJUMP_TAG 0x4C4D /* LM - Lazy Mask*/
#define LAZY_WAKE_MASK_HOOK_VERSION 1
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
int get_lazy_wake_mask(enum power_state state, host_event_t *mask)
{
int ret = EC_SUCCESS;
diff --git a/common/main.c b/common/main.c
index 58f01812ef..6adea9b049 100644
--- a/common/main.c
+++ b/common/main.c
@@ -160,7 +160,7 @@ test_mockable __keep int main(void)
* done, lpc always report mask needs to be initialized
* correctly.
*/
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
lpc_init_mask();
#endif
#ifdef HAS_TASK_KEYSCAN
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 3d7e3e5b98..95123a506d 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -62,7 +62,7 @@ static int accel_disp;
#define SENSOR_ACTIVE(_sensor) (sensor_active & (_sensor)->active_mask)
-#if defined(CONFIG_LPC) || defined(TEST_MOTION_LID)
+#if defined(CONFIG_HOSTCMD_X86) || defined(TEST_MOTION_LID)
#define UPDATE_HOST_MEM_MAP
#endif
diff --git a/core/nds32/ec.lds.S b/core/nds32/ec.lds.S
index 807534f512..5c1f8b6f79 100644
--- a/core/nds32/ec.lds.S
+++ b/core/nds32/ec.lds.S
@@ -21,7 +21,7 @@ MEMORY
{
FLASH (rx) : ORIGIN = FW_OFF(SECTION), LENGTH = FW_SIZE(SECTION)
IRAM (rw) : ORIGIN = CONFIG_RAM_BASE, LENGTH = CONFIG_RAM_SIZE
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
H2RAM (rw) : ORIGIN = CONFIG_H2RAM_BASE, LENGTH = CONFIG_H2RAM_SIZE
#endif
}
@@ -226,7 +226,7 @@ SECTIONS
__image_size = LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
.h2ram (NOLOAD) : {
. += CONFIG_H2RAM_HOST_LPC_IO_BASE;
*(.h2ram.pool.hostcmd)
diff --git a/include/console_channel.inc b/include/console_channel.inc
index 080da34821..bcd92373f6 100644
--- a/include/console_channel.inc
+++ b/include/console_channel.inc
@@ -51,7 +51,7 @@ CONSOLE_CHANNEL(CC_LIDANGLE, "lidangle")
#ifdef HAS_TASK_LIGHTBAR
CONSOLE_CHANNEL(CC_LIGHTBAR, "lightbar")
#endif
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
CONSOLE_CHANNEL(CC_LPC, "lpc")
#endif
CONSOLE_CHANNEL(CC_MOTION_LID, "motionlid")
diff --git a/include/host_command.h b/include/host_command.h
index f83ffcc616..1f9718fa5f 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -184,7 +184,7 @@ host_event_t host_get_events(void);
*/
int host_is_event_set(enum host_event_code event);
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
/*
* Get lazy wake masks for the sleep state provided
diff --git a/power/common.c b/power/common.c
index d4fc0aecee..0979b577af 100644
--- a/power/common.c
+++ b/power/common.c
@@ -209,7 +209,7 @@ void power_set_state(enum power_state new_state)
want_g3_exit = 0;
}
-#ifdef CONFIG_LPC
+#ifdef CONFIG_HOSTCMD_X86
/* If host doesn't program s0ix lazy wake mask, use default s0ix mask */
#define DEFAULT_WAKE_MASK_S0IX (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN) | \