[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 09/32] hw/cxl/device: Add cheap EVENTS implementation (8.2
From: |
Ben Widawsky |
Subject: |
[RFC PATCH v2 09/32] hw/cxl/device: Add cheap EVENTS implementation (8.2.9.1) |
Date: |
Tue, 5 Jan 2021 08:53:00 -0800 |
Using the previously implemented stubbed helpers, it is now possible to
easily add the missing, required commands to the implementation.
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
hw/cxl/cxl-mailbox-utils.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
index 0e94f5a95f..890e486ea1 100644
--- a/hw/cxl/cxl-mailbox-utils.c
+++ b/hw/cxl/cxl-mailbox-utils.c
@@ -37,6 +37,14 @@
* a register interface that already deals with it.
*/
+enum {
+ EVENTS = 0x01,
+ #define GET_RECORDS 0x0
+ #define CLEAR_RECORDS 0x1
+ #define GET_INTERRUPT_POLICY 0x2
+ #define SET_INTERRUPT_POLICY 0x3
+};
+
/* 8.2.8.4.5.1 Command Return Codes */
typedef enum {
CXL_MBOX_SUCCESS = 0x0,
@@ -105,10 +113,23 @@ struct cxl_cmd {
return CXL_MBOX_SUCCESS; \
}
+define_mailbox_handler_zeroed(EVENTS_GET_RECORDS, 0x20);
+define_mailbox_handler_nop(EVENTS_CLEAR_RECORDS);
+define_mailbox_handler_zeroed(EVENTS_GET_INTERRUPT_POLICY, 4);
+define_mailbox_handler_nop(EVENTS_SET_INTERRUPT_POLICY);
+
+#define IMMEDIATE_CONFIG_CHANGE (1 << 1)
+#define IMMEDIATE_LOG_CHANGE (1 << 4)
+
#define CXL_CMD(s, c, in, cel_effect) \
[s][c] = { stringify(s##_##c), cmd_##s##_##c, in, cel_effect }
-static struct cxl_cmd cxl_cmd_set[256][256] = {};
+static struct cxl_cmd cxl_cmd_set[256][256] = {
+ CXL_CMD(EVENTS, GET_RECORDS, 1, 0),
+ CXL_CMD(EVENTS, CLEAR_RECORDS, ~0, IMMEDIATE_LOG_CHANGE),
+ CXL_CMD(EVENTS, GET_INTERRUPT_POLICY, 0, 0),
+ CXL_CMD(EVENTS, SET_INTERRUPT_POLICY, 4, IMMEDIATE_CONFIG_CHANGE),
+};
#undef CXL_CMD
--
2.30.0
- Re: [RFC PATCH v2 05/32] hw/cxl/device: Implement the CAP array (8.2.8.1-2), (continued)
[RFC PATCH v2 06/32] hw/cxl/device: Add device status (8.2.8.3), Ben Widawsky, 2021/01/05
[RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Ben Widawsky, 2021/01/05
- Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Jonathan Cameron, 2021/01/06
- Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Ben Widawsky, 2021/01/06
- Re: [Linuxarm] Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Jonathan Cameron, 2021/01/06
- Re: [Linuxarm] Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Ben Widawsky, 2021/01/06
- Re: [Linuxarm] Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Ben Widawsky, 2021/01/06
- Re: [Linuxarm] Re: [RFC PATCH v2 07/32] hw/cxl/device: Implement basic mailbox (8.2.8.4), Ben Widawsky, 2021/01/08
[RFC PATCH v2 09/32] hw/cxl/device: Add cheap EVENTS implementation (8.2.9.1),
Ben Widawsky <=
[RFC PATCH v2 08/32] hw/cxl/device: Add memory devices (8.2.8.5), Ben Widawsky, 2021/01/05
[RFC PATCH v2 10/32] hw/cxl/device: Placeholder for firmware commands, Ben Widawsky, 2021/01/05
[RFC PATCH v2 11/32] hw/cxl/device: Timestamp implementation (8.2.9.3), Ben Widawsky, 2021/01/05
[RFC PATCH v2 13/32] hw/pxb: Use a type for realizing expanders, Ben Widawsky, 2021/01/05
[RFC PATCH v2 12/32] hw/cxl/device: Add log commands (8.2.9.4) + CEL, Ben Widawsky, 2021/01/05
[RFC PATCH v2 32/32] qtest/cxl: Add very basic sanity tests, Ben Widawsky, 2021/01/05
[RFC PATCH v2 30/32] tests/acpi: Add new CEDT files, Ben Widawsky, 2021/01/05
[RFC PATCH v2 29/32] Temp: acpi/cxl: Add ACPI0017 (CEDT awareness), Ben Widawsky, 2021/01/05
[RFC PATCH v2 14/32] hw/pci/cxl: Create a CXL bus type, Ben Widawsky, 2021/01/05