summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Van Patten <timvp@google.com>2023-02-08 11:51:18 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-21 23:19:33 +0000
commit44f130fc78856566fa0661f5cbad2c34c7f76b6f (patch)
tree1b737c1f5bb1bc8320042d40e5b6f5acfa0c5a72
parent493c4baa285f9256700c32513d16df69a759b291 (diff)
downloadchrome-ec-44f130fc78856566fa0661f5cbad2c34c7f76b6f.tar.gz
Remove CONFIG_HOST_EVENT64
The config option CONFIG_HOST_EVENT64 has been unconditionally enabled since 2017. This CL removes the option entirely, to clarify that 64 bit host event support is enabled by default. BRANCH=none BUG=b:261141172 TEST=Manually build and flash, verify device boots TEST=ectool version Change-Id: I806c12b8e69955dd19d32ad96587050fd189bea4 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4255275 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
-rw-r--r--common/ec_features.c6
-rw-r--r--common/host_event_commands.c16
-rw-r--r--common/mkbp_fifo.c2
-rw-r--r--common/mkbp_info.c4
-rw-r--r--include/config.h3
-rw-r--r--include/host_command.h7
-rw-r--r--util/config_allowed.txt1
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/hostevent.c4
8 files changed, 7 insertions, 36 deletions
diff --git a/common/ec_features.c b/common/ec_features.c
index 7a69575500..2387067587 100644
--- a/common/ec_features.c
+++ b/common/ec_features.c
@@ -115,10 +115,8 @@ uint32_t get_feature_flags0(void)
uint32_t get_feature_flags1(void)
{
uint32_t result =
- EC_FEATURE_MASK_1(EC_FEATURE_UNIFIED_WAKE_MASKS)
-#ifdef CONFIG_HOST_EVENT64
- | EC_FEATURE_MASK_1(EC_FEATURE_HOST_EVENT64)
-#endif
+ EC_FEATURE_MASK_1(EC_FEATURE_UNIFIED_WAKE_MASKS) |
+ EC_FEATURE_MASK_1(EC_FEATURE_HOST_EVENT64)
#ifdef CONFIG_EXTERNAL_STORAGE
| EC_FEATURE_MASK_1(EC_FEATURE_EXEC_IN_RAM)
#endif
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index f0c4b0b929..5b050204d1 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -39,11 +39,13 @@ static void host_event_set_bit(host_event_t *ev, uint8_t bit)
if (bit == 0)
return;
-#ifdef CONFIG_HOST_EVENT64
+ /*
+ * The overall host event implementation assumes it's running on and
+ * communicating with little-endian architectures.
+ */
if (bit > 32)
*(ptr + 1) = HOST_EVENT_32BIT_MASK(bit - 32);
else
-#endif
*ptr = HOST_EVENT_32BIT_MASK(bit);
}
@@ -138,14 +140,12 @@ int lpc_get_next_host_event(void)
host_event_t ev;
int evt_idx = __builtin_ffs(lpc_host_events);
-#ifdef CONFIG_HOST_EVENT64
if (evt_idx == 0) {
int evt_idx_high = __builtin_ffs(lpc_host_events >> 32);
if (evt_idx_high)
evt_idx = 32 + evt_idx_high;
}
-#endif
if (evt_idx) {
host_event_set_bit(&ev, evt_idx);
@@ -268,9 +268,7 @@ static void host_events_atomic_or(host_event_t *e, host_event_t m)
atomic_t *ptr = (atomic_t *)e;
atomic_or(ptr, (uint32_t)m);
-#ifdef CONFIG_HOST_EVENT64
atomic_or(ptr + 1, (uint32_t)(m >> 32));
-#endif
}
static void host_events_atomic_clear(host_event_t *e, host_event_t m)
@@ -278,15 +276,12 @@ static void host_events_atomic_clear(host_event_t *e, host_event_t m)
atomic_t *ptr = (atomic_t *)e;
atomic_clear_bits(ptr, (uint32_t)m);
-#ifdef CONFIG_HOST_EVENT64
atomic_clear_bits(ptr + 1, (uint32_t)(m >> 32));
-#endif
}
#if !defined(CONFIG_HOSTCMD_X86) && defined(CONFIG_MKBP_EVENT)
static void host_events_send_mkbp_event(host_event_t e)
{
-#ifdef CONFIG_HOST_EVENT64
/*
* If event bits in the upper 32-bit are set, indicate 64-bit host
* event.
@@ -294,7 +289,6 @@ static void host_events_send_mkbp_event(host_event_t e)
if (!(uint32_t)e)
mkbp_send_event(EC_MKBP_EVENT_HOST_EVENT64);
else
-#endif
mkbp_send_event(EC_MKBP_EVENT_HOST_EVENT);
}
#endif
@@ -397,7 +391,6 @@ static int host_get_next_event(uint8_t *out)
}
DECLARE_EVENT_SOURCE(EC_MKBP_EVENT_HOST_EVENT, host_get_next_event);
-#ifdef CONFIG_HOST_EVENT64
static int host_get_next_event64(uint8_t *out)
{
host_event_t event_out = events;
@@ -409,7 +402,6 @@ static int host_get_next_event64(uint8_t *out)
}
DECLARE_EVENT_SOURCE(EC_MKBP_EVENT_HOST_EVENT64, host_get_next_event64);
#endif
-#endif
/**
* Clear one or more host event bits from copy B.
diff --git a/common/mkbp_fifo.c b/common/mkbp_fifo.c
index dfcf87814e..97cbcfc00f 100644
--- a/common/mkbp_fifo.c
+++ b/common/mkbp_fifo.c
@@ -49,10 +49,8 @@ static int get_data_size(enum ec_mkbp_event e)
case EC_MKBP_EVENT_KEY_MATRIX:
return KEYBOARD_COLS_MAX;
-#ifdef CONFIG_HOST_EVENT64
case EC_MKBP_EVENT_HOST_EVENT64:
return sizeof(uint64_t);
-#endif
case EC_MKBP_EVENT_HOST_EVENT:
case EC_MKBP_EVENT_BUTTON:
diff --git a/common/mkbp_info.c b/common/mkbp_info.c
index c195eda888..c8cc6e7f58 100644
--- a/common/mkbp_info.c
+++ b/common/mkbp_info.c
@@ -1,4 +1,4 @@
-/* Copyright 2021 The ChromiumOS Authors.
+/* Copyright 2021 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -120,12 +120,10 @@ static enum ec_status mkbp_get_info(struct host_cmd_handler_args *args)
args->response_size = sizeof(r->host_event);
break;
-#ifdef CONFIG_HOST_EVENT64
case EC_MKBP_EVENT_HOST_EVENT64:
r->host_event64 = host_get_events();
args->response_size = sizeof(r->host_event64);
break;
-#endif
#ifdef CONFIG_MKBP_INPUT_DEVICES
case EC_MKBP_EVENT_BUTTON:
diff --git a/include/config.h b/include/config.h
index f9dee49661..c7951bb6c2 100644
--- a/include/config.h
+++ b/include/config.h
@@ -2489,9 +2489,6 @@
/* clear bit(s) to mask reporting of an EC_HOST_EVENT_XXX event(s) */
#define CONFIG_HOST_EVENT_REPORT_MASK 0xffffffffffffffffULL
-/* Config option to support 64-bit hostevents and wake-masks. */
-#define CONFIG_HOST_EVENT64
-
/*
* The host commands are sorted in the .rodata.hcmds section so use the binary
* search algorithm to match a command to its handler
diff --git a/include/host_command.h b/include/host_command.h
index 7dd0a74dfd..f54244b571 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -132,17 +132,10 @@ struct host_command {
int version_mask;
};
-#ifdef CONFIG_HOST_EVENT64
typedef uint64_t host_event_t;
#define HOST_EVENT_CPRINTS(str, e) CPRINTS("%s 0x%016" PRIx64, str, e)
#define HOST_EVENT_CCPRINTF(str, e) ccprintf("%s 0x%016" PRIx64 "\n", str, e)
-#else
-typedef uint32_t host_event_t;
-#define HOST_EVENT_CPRINTS(str, e) CPRINTS("%s 0x%08x", str, e)
-#define HOST_EVENT_CCPRINTF(str, e) ccprintf("%s 0x%08x\n", str, e)
-#endif
-
/**
* Return a pointer to the memory-mapped buffer.
*
diff --git a/util/config_allowed.txt b/util/config_allowed.txt
index 7fa6ba652f..d1808beec5 100644
--- a/util/config_allowed.txt
+++ b/util/config_allowed.txt
@@ -477,7 +477,6 @@ CONFIG_HOSTCMD_SECTION_SORTED
CONFIG_HOSTCMD_SKUID
CONFIG_HOSTCMD_X86
CONFIG_HOST_ESPI_VW_POWER_SIGNAL
-CONFIG_HOST_EVENT64
CONFIG_HOST_EVENT_REPORT_MASK
CONFIG_HOST_INTERFACE_ESPI_EC_CHAN_BITMAP
CONFIG_HOST_INTERFACE_ESPI_EC_MAX_FREQ
diff --git a/zephyr/test/drivers/default/src/console_cmd/hostevent.c b/zephyr/test/drivers/default/src/console_cmd/hostevent.c
index 85717e88d1..1db57f5836 100644
--- a/zephyr/test/drivers/default/src/console_cmd/hostevent.c
+++ b/zephyr/test/drivers/default/src/console_cmd/hostevent.c
@@ -12,11 +12,7 @@
#include <zephyr/shell/shell.h>
#include <zephyr/ztest.h>
-#ifdef CONFIG_HOST_EVENT64
#define HOSTEVENT_PRINT_FORMAT "016" PRIx64
-#else
-#define HOSTEVENT_PRINT_FORMAT "08" PRIx32
-#endif
struct console_cmd_hostevent_fixture {
struct host_events_ctx ctx;