* [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support
@ 2026-12-04 4:20 Wang Yang
2026-12-04 4:20 ` [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds Wang Yang
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:20 UTC (permalink / raw)
To: linux-kernel
Cc: Benson Leung, Tzung-Bi Shih, Guenter Roeck, chrome-platform,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
Troy Mitchell, devicetree, linux-riscv, spacemit, Philipp Zabel,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Aurelien Jarno, Conor Dooley, Krishnamoorthi M, yh_chung
This series enables the built-in keyboard on the DeepComputing FML13V05.
The SpacemiT K3 host exposes the EC command window through the eSPI
Peripheral Channel. The EC implements the Chrome EC host protocol, and
the existing Chrome EC keyboard driver reports input events.
Changes since v1:
- Share LPC-style polling, protocol v2/v3 transfers and readmem between
the LPC and K3 transports. Keep the K3 window mapping and recovery in
the K3 transport. A command that times out is not replayed.
- Let the EC core request the IRQ. Existing transports keep their
low-level default and K3 uses the rising edge specified by the board.
- Add the EC binding before the controller binding that references it.
Derive the CPU window from ranges and specify the link frequency in Hz.
The second peripheral base retains the vendor board value, 0xcac8c000.
- Correct the pin pull settings, command status clearing and negotiated
clock selection. Check packet bounds and EC readiness. On resume,
check a pending recovery before enabling the EC event IRQ.
- Order the five RISC-V configuration entries using savedefconfig.
The AMD host RFC models chip-select targets and controller operations.
K3 needs a CPU-mapped Peripheral Channel window and a way to recover the
host link following a timeout. The Aspeed series covers the BMC side.
On next-20261202, an earlier revision booted on FML13V05 from NVMe with
test-only PCIe and DT additions. After a mainboard reset with the EC
still powered, the EC reported FML13V05-V01.06. The built-in keyboard
reported a left Shift press and release, and the EC IRQ count rose from
zero to two. The change since that test is confined to the K3 EC
transport's link check at probe and resume.
OpenAI Codex assisted with refactoring, review of v1 feedback, commit
messages and test preparation.
v1: https://lore.kernel.org/all/20261118085742.1817536-1-yang.wang@deepcomputing.io/
AMD RFC: https://lore.kernel.org/all/20260804115259.4065638-1-krishnamoorthi.m@amd.com/
Aspeed: https://lore.kernel.org/all/20260313-upstream_espi-v1-0-9504428e1f43@aspeedtech.com/
Wang Yang (13):
platform/chrome: Correct LPC EC readmem bounds
platform/chrome: Extract LPC-style EC protocol helpers
platform/chrome: Allow transport-specific LPC response timeouts
platform/chrome: Allow transports to select EC IRQ flags
dt-bindings: embedded-controller: Add SpacemiT K3 EC window
dt-bindings: bus: Add SpacemiT K3 Intel eSPI controller
bus: Add SpacemiT K3 eSPI controller support
platform/chrome: Allow ChromeOS platform support on RISC-V
platform/chrome: Add SpacemiT K3 eSPI EC transport
riscv: dts: spacemit: Add K3 eSPI pin group
riscv: dts: spacemit: Describe the K3 eSPI controller
riscv: dts: spacemit: Enable the FML13V05 EC keyboard
riscv: defconfig: Enable the FML13V05 EC keyboard modules
.../bindings/bus/spacemit,k3-espi.yaml | 149 ++++
.../spacemit,k3-cros-ec.yaml | 77 ++
.../spacemit/k3-deepcomputing-fml13v05.dts | 137 +++
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 24 +
arch/riscv/boot/dts/spacemit/k3.dtsi | 30 +
arch/riscv/configs/defconfig | 5 +
drivers/bus/Kconfig | 10 +
drivers/bus/Makefile | 1 +
drivers/bus/spacemit-k3-espi.c | 799 ++++++++++++++++++
drivers/platform/chrome/Kconfig | 20 +-
drivers/platform/chrome/Makefile | 4 +-
drivers/platform/chrome/cros_ec.c | 3 +-
.../platform/chrome/cros_ec_espi_spacemit.c | 568 +++++++++++++
drivers/platform/chrome/cros_ec_lpc.c | 239 +-----
drivers/platform/chrome/cros_ec_lpc_proto.c | 246 ++++++
drivers/platform/chrome/cros_ec_lpc_proto.h | 36 +
include/linux/platform_data/cros_ec_proto.h | 2 +
include/linux/spacemit-k3-espi.h | 20 +
18 files changed, 2152 insertions(+), 218 deletions(-)
create mode 100644 Documentation/devicetree/bindings/bus/spacemit,k3-espi.yaml
create mode 100644 Documentation/devicetree/bindings/embedded-controller/spacemit,k3-cros-ec.yaml
create mode 100644 drivers/bus/spacemit-k3-espi.c
create mode 100644 drivers/platform/chrome/cros_ec_espi_spacemit.c
create mode 100644 drivers/platform/chrome/cros_ec_lpc_proto.c
create mode 100644 drivers/platform/chrome/cros_ec_lpc_proto.h
create mode 100644 include/linux/spacemit-k3-espi.h
base-commit: 799dd936553182df5770dde7f38d94c8337df75a
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
@ 2026-12-04 4:20 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 02/13] platform/chrome: Extract LPC-style EC protocol helpers Wang Yang
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Benson Leung, Tzung-Bi Shih, Guenter Roeck, chrome-platform
Reject offsets outside the EC memory map before calculating the
remaining space. Allow fixed-length reads ending exactly at the
end of the map and reject oversized reads without underflow.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/cros_ec_lpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 1e683e90a9df..4ddd3ca0effa 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -417,7 +417,7 @@ static int cros_ec_lpc_readmem(struct cros_ec_device *ec, unsigned int offset,
int cnt = 0;
int ret;
- if (offset >= EC_MEMMAP_SIZE - bytes)
+ if (offset >= EC_MEMMAP_SIZE || bytes > EC_MEMMAP_SIZE - offset)
return -EINVAL;
/* fixed length */
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 02/13] platform/chrome: Extract LPC-style EC protocol helpers
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
2026-12-04 4:20 ` [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 03/13] platform/chrome: Allow transport-specific LPC response timeouts Wang Yang
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Benson Leung, Tzung-Bi Shih, Guenter Roeck, chrome-platform
Move response polling, v2/v3 host commands and readmem into shared
helpers. Keep LPC ACPI/DMI/MEC enumeration and hardware byte access
in the LPC driver. Use a static byte-access table and pass the device
specific memory-map base to the shared readmem helper.
Link the helpers into the existing cros-ec-proto module so LPC
keeps its existing module filename and protocol dependency.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/Kconfig | 6 +
drivers/platform/chrome/Makefile | 3 +-
drivers/platform/chrome/cros_ec_lpc.c | 239 ++-----------------
drivers/platform/chrome/cros_ec_lpc_proto.c | 245 ++++++++++++++++++++
drivers/platform/chrome/cros_ec_lpc_proto.h | 32 +++
5 files changed, 309 insertions(+), 216 deletions(-)
create mode 100644 drivers/platform/chrome/cros_ec_lpc_proto.c
create mode 100644 drivers/platform/chrome/cros_ec_lpc_proto.h
diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
index ca2e8442026e..2c11eb4ec95d 100644
--- a/drivers/platform/chrome/Kconfig
+++ b/drivers/platform/chrome/Kconfig
@@ -140,10 +140,16 @@ config CROS_EC_UART
To compile this driver as a module, choose M here: the
module will be called cros_ec_uart.
+config CROS_EC_LPC_PROTO
+ bool
+ help
+ Include the LPC-style host command helpers in cros-ec-proto.
+
config CROS_EC_LPC
tristate "ChromeOS Embedded Controller (LPC)"
depends on CROS_EC && ACPI && (X86 || COMPILE_TEST)
depends on HAS_IOPORT
+ select CROS_EC_LPC_PROTO
help
If you say Y here, you get support for talking to the ChromeOS EC
over an LPC bus, including the LPC Microchip EC (MEC) variant.
diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
index b981a1bb5bd8..00d3d9fba1e0 100644
--- a/drivers/platform/chrome/Makefile
+++ b/drivers/platform/chrome/Makefile
@@ -25,7 +25,8 @@ endif
obj-$(CONFIG_CROS_EC_TYPEC) += cros-ec-typec.o
obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o
-cros-ec-proto-objs := cros_ec_proto.o cros_ec_trace.o
+cros-ec-proto-y := cros_ec_proto.o cros_ec_trace.o
+cros-ec-proto-$(CONFIG_CROS_EC_LPC_PROTO) += cros_ec_lpc_proto.o
obj-$(CONFIG_CROS_EC_PROTO) += cros-ec-proto.o
obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT) += cros_kbd_led_backlight.o
obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_chardev.o
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 4ddd3ca0effa..08b635abbd13 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -27,6 +27,7 @@
#include "cros_ec.h"
#include "cros_ec_lpc_mec.h"
+#include "cros_ec_lpc_proto.h"
#define DRV_NAME "cros_ec_lpcs"
#define ACPI_DRV_NAME "GOOG0004"
@@ -206,239 +207,47 @@ static int cros_ec_lpc_direct_write(struct cros_ec_lpc *ec_lpc, unsigned int off
return sum;
}
-static int ec_response_timed_out(struct cros_ec_lpc *ec_lpc)
+static int cros_ec_lpc_read(struct cros_ec_device *ec, unsigned int offset,
+ unsigned int length, u8 *dest)
{
- unsigned long one_second = jiffies + HZ;
- u8 data;
- int ret;
-
- usleep_range(200, 300);
- do {
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_CMD, 1, &data);
- if (ret < 0)
- return ret;
- if (!(data & EC_LPC_STATUS_BUSY_MASK))
- return 0;
- usleep_range(100, 200);
- } while (time_before(jiffies, one_second));
+ struct cros_ec_lpc *ec_lpc = ec->priv;
- return 1;
+ return ec_lpc->read(ec_lpc, offset, length, dest);
}
-static int cros_ec_pkt_xfer_lpc(struct cros_ec_device *ec,
- struct cros_ec_command *msg)
+static int cros_ec_lpc_write(struct cros_ec_device *ec, unsigned int offset,
+ unsigned int length, const u8 *src)
{
struct cros_ec_lpc *ec_lpc = ec->priv;
- struct ec_host_response response;
- u8 sum;
- int ret = 0;
- u8 *dout;
-
- ret = cros_ec_prepare_tx(ec, msg);
- if (ret < 0)
- goto done;
-
- /* Write buffer */
- ret = ec_lpc->write(ec_lpc, EC_LPC_ADDR_HOST_PACKET, ret, ec->dout);
- if (ret < 0)
- goto done;
-
- /* Here we go */
- sum = EC_COMMAND_PROTOCOL_3;
- ret = ec_lpc->write(ec_lpc, EC_LPC_ADDR_HOST_CMD, 1, &sum);
- if (ret < 0)
- goto done;
-
- ret = ec_response_timed_out(ec_lpc);
- if (ret < 0)
- goto done;
- if (ret) {
- dev_warn(ec->dev, "EC response timed out\n");
- ret = -EIO;
- goto done;
- }
-
- /* Check result */
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_DATA, 1, &sum);
- if (ret < 0)
- goto done;
- msg->result = ret;
- ret = cros_ec_check_result(ec, msg);
- if (ret)
- goto done;
-
- /* Read back response */
- dout = (u8 *)&response;
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_PACKET, sizeof(response),
- dout);
- if (ret < 0)
- goto done;
- sum = ret;
- msg->result = response.result;
-
- if (response.data_len > msg->insize) {
- dev_err(ec->dev,
- "packet too long (%d bytes, expected %d)",
- response.data_len, msg->insize);
- ret = -EMSGSIZE;
- goto done;
- }
+ return ec_lpc->write(ec_lpc, offset, length, src);
+}
- /* Read response and process checksum */
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_PACKET +
- sizeof(response), response.data_len,
- msg->data);
- if (ret < 0)
- goto done;
- sum += ret;
-
- if (sum) {
- dev_err(ec->dev,
- "bad packet checksum %02x\n",
- response.checksum);
- ret = -EBADMSG;
- goto done;
- }
+static const struct cros_ec_lpc_io cros_ec_lpc_io = {
+ .read = cros_ec_lpc_read,
+ .write = cros_ec_lpc_write,
+};
- /* Return actual amount of data received */
- ret = response.data_len;
-done:
- return ret;
+static int cros_ec_pkt_xfer_lpc(struct cros_ec_device *ec,
+ struct cros_ec_command *msg)
+{
+ return cros_ec_lpc_pkt_xfer(ec, &cros_ec_lpc_io, msg);
}
static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec,
struct cros_ec_command *msg)
{
- struct cros_ec_lpc *ec_lpc = ec->priv;
- struct ec_lpc_host_args args;
- u8 sum;
- int ret = 0;
-
- if (msg->outsize > EC_PROTO2_MAX_PARAM_SIZE ||
- msg->insize > EC_PROTO2_MAX_PARAM_SIZE) {
- dev_err(ec->dev,
- "invalid buffer sizes (out %d, in %d)\n",
- msg->outsize, msg->insize);
- return -EINVAL;
- }
-
- /* Now actually send the command to the EC and get the result */
- args.flags = EC_HOST_ARGS_FLAG_FROM_HOST;
- args.command_version = msg->version;
- args.data_size = msg->outsize;
-
- /* Initialize checksum */
- sum = msg->command + args.flags + args.command_version + args.data_size;
-
- /* Copy data and update checksum */
- ret = ec_lpc->write(ec_lpc, EC_LPC_ADDR_HOST_PARAM, msg->outsize,
- msg->data);
- if (ret < 0)
- goto done;
- sum += ret;
-
- /* Finalize checksum and write args */
- args.checksum = sum;
- ret = ec_lpc->write(ec_lpc, EC_LPC_ADDR_HOST_ARGS, sizeof(args),
- (u8 *)&args);
- if (ret < 0)
- goto done;
-
- /* Here we go */
- sum = msg->command;
- ret = ec_lpc->write(ec_lpc, EC_LPC_ADDR_HOST_CMD, 1, &sum);
- if (ret < 0)
- goto done;
-
- ret = ec_response_timed_out(ec_lpc);
- if (ret < 0)
- goto done;
- if (ret) {
- dev_warn(ec->dev, "EC response timed out\n");
- ret = -EIO;
- goto done;
- }
-
- /* Check result */
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_DATA, 1, &sum);
- if (ret < 0)
- goto done;
- msg->result = ret;
- ret = cros_ec_check_result(ec, msg);
- if (ret)
- goto done;
-
- /* Read back args */
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_ARGS, sizeof(args), (u8 *)&args);
- if (ret < 0)
- goto done;
-
- if (args.data_size > msg->insize) {
- dev_err(ec->dev,
- "packet too long (%d bytes, expected %d)",
- args.data_size, msg->insize);
- ret = -ENOSPC;
- goto done;
- }
-
- /* Start calculating response checksum */
- sum = msg->command + args.flags + args.command_version + args.data_size;
-
- /* Read response and update checksum */
- ret = ec_lpc->read(ec_lpc, EC_LPC_ADDR_HOST_PARAM, args.data_size,
- msg->data);
- if (ret < 0)
- goto done;
- sum += ret;
-
- /* Verify checksum */
- if (args.checksum != sum) {
- dev_err(ec->dev,
- "bad packet checksum, expected %02x, got %02x\n",
- args.checksum, sum);
- ret = -EBADMSG;
- goto done;
- }
-
- /* Return actual amount of data received */
- ret = args.data_size;
-done:
- return ret;
+ return cros_ec_lpc_cmd_xfer(ec, &cros_ec_lpc_io, msg);
}
-/* Returns num bytes read, or negative on error. Doesn't need locking. */
-static int cros_ec_lpc_readmem(struct cros_ec_device *ec, unsigned int offset,
- unsigned int bytes, void *dest)
+static int cros_ec_cmd_readmem_lpc(struct cros_ec_device *ec,
+ unsigned int offset, unsigned int bytes,
+ void *dest)
{
struct cros_ec_lpc *ec_lpc = ec->priv;
- int i = offset;
- char *s = dest;
- int cnt = 0;
- int ret;
-
- if (offset >= EC_MEMMAP_SIZE || bytes > EC_MEMMAP_SIZE - offset)
- return -EINVAL;
-
- /* fixed length */
- if (bytes) {
- ret = ec_lpc->read(ec_lpc, ec_lpc->mmio_memory_base + offset, bytes, s);
- if (ret < 0)
- return ret;
- return bytes;
- }
-
- /* string */
- for (; i < EC_MEMMAP_SIZE; i++, s++) {
- ret = ec_lpc->read(ec_lpc, ec_lpc->mmio_memory_base + i, 1, s);
- if (ret < 0)
- return ret;
- cnt++;
- if (!*s)
- break;
- }
- return cnt;
+ return cros_ec_lpc_readmem(ec, &cros_ec_lpc_io, ec_lpc->mmio_memory_base,
+ offset, bytes, dest);
}
static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
@@ -645,7 +454,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)
ec_dev->phys_name = dev_name(dev);
ec_dev->cmd_xfer = cros_ec_cmd_xfer_lpc;
ec_dev->pkt_xfer = cros_ec_pkt_xfer_lpc;
- ec_dev->cmd_readmem = cros_ec_lpc_readmem;
+ ec_dev->cmd_readmem = cros_ec_cmd_readmem_lpc;
ec_dev->priv = ec_lpc;
/*
diff --git a/drivers/platform/chrome/cros_ec_lpc_proto.c b/drivers/platform/chrome/cros_ec_lpc_proto.c
new file mode 100644
index 000000000000..1dfc32a6ecd7
--- /dev/null
+++ b/drivers/platform/chrome/cros_ec_lpc_proto.c
@@ -0,0 +1,245 @@
+// SPDX-License-Identifier: GPL-2.0
+// LPC-style host command protocol for ChromeOS Embedded Controllers.
+// Copyright (C) 2012-2015 Google, Inc
+
+#include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/export.h>
+#include <linux/platform_data/cros_ec_commands.h>
+#include <linux/platform_data/cros_ec_proto.h>
+
+#include "cros_ec_lpc_proto.h"
+
+static int ec_response_timed_out(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io)
+{
+ unsigned long one_second = jiffies + HZ;
+ u8 data;
+ int ret;
+
+ usleep_range(200, 300);
+ do {
+ ret = io->read(ec, EC_LPC_ADDR_HOST_CMD, 1, &data);
+ if (ret < 0)
+ return ret;
+ if (!(data & EC_LPC_STATUS_BUSY_MASK))
+ return 0;
+ usleep_range(100, 200);
+ } while (time_before(jiffies, one_second));
+
+ return 1;
+}
+
+int cros_ec_lpc_pkt_xfer(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io,
+ struct cros_ec_command *msg)
+{
+ struct ec_host_response response;
+ u8 sum;
+ int ret = 0;
+ u8 *dout;
+
+ ret = cros_ec_prepare_tx(ec, msg);
+ if (ret < 0)
+ goto done;
+
+ /* Write buffer */
+ ret = io->write(ec, EC_LPC_ADDR_HOST_PACKET, ret, ec->dout);
+ if (ret < 0)
+ goto done;
+
+ /* Here we go */
+ sum = EC_COMMAND_PROTOCOL_3;
+ ret = io->write(ec, EC_LPC_ADDR_HOST_CMD, 1, &sum);
+ if (ret < 0)
+ goto done;
+
+ ret = ec_response_timed_out(ec, io);
+ if (ret < 0)
+ goto done;
+ if (ret) {
+ dev_warn(ec->dev, "EC response timed out\n");
+ ret = -EIO;
+ goto done;
+ }
+
+ /* Check result */
+ ret = io->read(ec, EC_LPC_ADDR_HOST_DATA, 1, &sum);
+ if (ret < 0)
+ goto done;
+ msg->result = ret;
+ ret = cros_ec_check_result(ec, msg);
+ if (ret)
+ goto done;
+
+ /* Read back response */
+ dout = (u8 *)&response;
+ ret = io->read(ec, EC_LPC_ADDR_HOST_PACKET, sizeof(response), dout);
+ if (ret < 0)
+ goto done;
+ sum = ret;
+
+ msg->result = response.result;
+
+ if (response.data_len > msg->insize) {
+ dev_err(ec->dev,
+ "packet too long (%d bytes, expected %d)",
+ response.data_len, msg->insize);
+ ret = -EMSGSIZE;
+ goto done;
+ }
+
+ /* Read response and process checksum */
+ ret = io->read(ec, EC_LPC_ADDR_HOST_PACKET + sizeof(response),
+ response.data_len, msg->data);
+ if (ret < 0)
+ goto done;
+ sum += ret;
+
+ if (sum) {
+ dev_err(ec->dev,
+ "bad packet checksum %02x\n",
+ response.checksum);
+ ret = -EBADMSG;
+ goto done;
+ }
+
+ /* Return actual amount of data received */
+ ret = response.data_len;
+done:
+ return ret;
+}
+EXPORT_SYMBOL_GPL(cros_ec_lpc_pkt_xfer);
+
+int cros_ec_lpc_cmd_xfer(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io,
+ struct cros_ec_command *msg)
+{
+ struct ec_lpc_host_args args;
+ u8 sum;
+ int ret = 0;
+
+ if (msg->outsize > EC_PROTO2_MAX_PARAM_SIZE ||
+ msg->insize > EC_PROTO2_MAX_PARAM_SIZE) {
+ dev_err(ec->dev,
+ "invalid buffer sizes (out %d, in %d)\n",
+ msg->outsize, msg->insize);
+ return -EINVAL;
+ }
+
+ /* Now actually send the command to the EC and get the result */
+ args.flags = EC_HOST_ARGS_FLAG_FROM_HOST;
+ args.command_version = msg->version;
+ args.data_size = msg->outsize;
+
+ /* Initialize checksum */
+ sum = msg->command + args.flags + args.command_version + args.data_size;
+
+ /* Copy data and update checksum */
+ ret = io->write(ec, EC_LPC_ADDR_HOST_PARAM, msg->outsize, msg->data);
+ if (ret < 0)
+ goto done;
+ sum += ret;
+
+ /* Finalize checksum and write args */
+ args.checksum = sum;
+ ret = io->write(ec, EC_LPC_ADDR_HOST_ARGS, sizeof(args), (u8 *)&args);
+ if (ret < 0)
+ goto done;
+
+ /* Here we go */
+ sum = msg->command;
+ ret = io->write(ec, EC_LPC_ADDR_HOST_CMD, 1, &sum);
+ if (ret < 0)
+ goto done;
+
+ ret = ec_response_timed_out(ec, io);
+ if (ret < 0)
+ goto done;
+ if (ret) {
+ dev_warn(ec->dev, "EC response timed out\n");
+ ret = -EIO;
+ goto done;
+ }
+
+ /* Check result */
+ ret = io->read(ec, EC_LPC_ADDR_HOST_DATA, 1, &sum);
+ if (ret < 0)
+ goto done;
+ msg->result = ret;
+ ret = cros_ec_check_result(ec, msg);
+ if (ret)
+ goto done;
+
+ /* Read back args */
+ ret = io->read(ec, EC_LPC_ADDR_HOST_ARGS, sizeof(args), (u8 *)&args);
+ if (ret < 0)
+ goto done;
+
+ if (args.data_size > msg->insize) {
+ dev_err(ec->dev,
+ "packet too long (%d bytes, expected %d)",
+ args.data_size, msg->insize);
+ ret = -ENOSPC;
+ goto done;
+ }
+
+ /* Start calculating response checksum */
+ sum = msg->command + args.flags + args.command_version + args.data_size;
+
+ /* Read response and update checksum */
+ ret = io->read(ec, EC_LPC_ADDR_HOST_PARAM, args.data_size, msg->data);
+ if (ret < 0)
+ goto done;
+ sum += ret;
+
+ /* Verify checksum */
+ if (args.checksum != sum) {
+ dev_err(ec->dev,
+ "bad packet checksum, expected %02x, got %02x\n",
+ args.checksum, sum);
+ ret = -EBADMSG;
+ goto done;
+ }
+
+ /* Return actual amount of data received */
+ ret = args.data_size;
+done:
+ return ret;
+}
+EXPORT_SYMBOL_GPL(cros_ec_lpc_cmd_xfer);
+
+/* Returns num bytes read, or negative on error. Doesn't need locking. */
+int cros_ec_lpc_readmem(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io, unsigned int memmap_base,
+ unsigned int offset, unsigned int bytes, void *dest)
+{
+ int i = offset;
+ char *s = dest;
+ int cnt = 0;
+ int ret;
+
+ if (offset >= EC_MEMMAP_SIZE || bytes > EC_MEMMAP_SIZE - offset)
+ return -EINVAL;
+
+ /* fixed length */
+ if (bytes) {
+ ret = io->read(ec, memmap_base + offset, bytes, s);
+ if (ret < 0)
+ return ret;
+ return bytes;
+ }
+
+ /* string */
+ for (; i < EC_MEMMAP_SIZE; i++, s++) {
+ ret = io->read(ec, memmap_base + i, 1, s);
+ if (ret < 0)
+ return ret;
+ cnt++;
+ if (!*s)
+ break;
+ }
+
+ return cnt;
+}
+EXPORT_SYMBOL_GPL(cros_ec_lpc_readmem);
diff --git a/drivers/platform/chrome/cros_ec_lpc_proto.h b/drivers/platform/chrome/cros_ec_lpc_proto.h
new file mode 100644
index 000000000000..7f884ffe823a
--- /dev/null
+++ b/drivers/platform/chrome/cros_ec_lpc_proto.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __CROS_EC_LPC_PROTO_H
+#define __CROS_EC_LPC_PROTO_H
+
+#include <linux/types.h>
+
+struct cros_ec_device;
+struct cros_ec_command;
+
+/**
+ * struct cros_ec_lpc_io - byte access to an LPC-style EC interface
+ * @read: Read bytes, returning their checksum or a negative error.
+ * @write: Write bytes, returning their checksum or a negative error.
+ */
+struct cros_ec_lpc_io {
+ int (*read)(struct cros_ec_device *ec, unsigned int offset,
+ unsigned int length, u8 *dest);
+ int (*write)(struct cros_ec_device *ec, unsigned int offset,
+ unsigned int length, const u8 *src);
+};
+
+int cros_ec_lpc_pkt_xfer(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io,
+ struct cros_ec_command *msg);
+int cros_ec_lpc_cmd_xfer(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io,
+ struct cros_ec_command *msg);
+int cros_ec_lpc_readmem(struct cros_ec_device *ec,
+ const struct cros_ec_lpc_io *io, unsigned int memmap_base,
+ unsigned int offset, unsigned int bytes, void *dest);
+
+#endif /* __CROS_EC_LPC_PROTO_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 03/13] platform/chrome: Allow transport-specific LPC response timeouts
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
2026-12-04 4:20 ` [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds Wang Yang
2026-12-04 4:21 ` [PATCH v2 02/13] platform/chrome: Extract LPC-style EC protocol helpers Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags Wang Yang
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Benson Leung, Tzung-Bi Shih, Guenter Roeck, chrome-platform
Preserve the LPC default of one second and -EIO. Let a transport
supply a deadline and timeout error without copying the polling loop.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/cros_ec_lpc_proto.c | 9 +++++----
drivers/platform/chrome/cros_ec_lpc_proto.h | 4 ++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec_lpc_proto.c b/drivers/platform/chrome/cros_ec_lpc_proto.c
index 1dfc32a6ecd7..f0bd70e70a9c 100644
--- a/drivers/platform/chrome/cros_ec_lpc_proto.c
+++ b/drivers/platform/chrome/cros_ec_lpc_proto.c
@@ -13,7 +13,8 @@
static int ec_response_timed_out(struct cros_ec_device *ec,
const struct cros_ec_lpc_io *io)
{
- unsigned long one_second = jiffies + HZ;
+ unsigned long timeout = jiffies + (io->response_timeout_ms ?
+ msecs_to_jiffies(io->response_timeout_ms) : HZ);
u8 data;
int ret;
@@ -25,7 +26,7 @@ static int ec_response_timed_out(struct cros_ec_device *ec,
if (!(data & EC_LPC_STATUS_BUSY_MASK))
return 0;
usleep_range(100, 200);
- } while (time_before(jiffies, one_second));
+ } while (time_before(jiffies, timeout));
return 1;
}
@@ -59,7 +60,7 @@ int cros_ec_lpc_pkt_xfer(struct cros_ec_device *ec,
goto done;
if (ret) {
dev_warn(ec->dev, "EC response timed out\n");
- ret = -EIO;
+ ret = io->timeout_error ?: -EIO;
goto done;
}
@@ -158,7 +159,7 @@ int cros_ec_lpc_cmd_xfer(struct cros_ec_device *ec,
goto done;
if (ret) {
dev_warn(ec->dev, "EC response timed out\n");
- ret = -EIO;
+ ret = io->timeout_error ?: -EIO;
goto done;
}
diff --git a/drivers/platform/chrome/cros_ec_lpc_proto.h b/drivers/platform/chrome/cros_ec_lpc_proto.h
index 7f884ffe823a..9276fb09807d 100644
--- a/drivers/platform/chrome/cros_ec_lpc_proto.h
+++ b/drivers/platform/chrome/cros_ec_lpc_proto.h
@@ -11,12 +11,16 @@ struct cros_ec_command;
* struct cros_ec_lpc_io - byte access to an LPC-style EC interface
* @read: Read bytes, returning their checksum or a negative error.
* @write: Write bytes, returning their checksum or a negative error.
+ * @response_timeout_ms: Response timeout in milliseconds, or zero for one second.
+ * @timeout_error: Negative timeout error, or zero for the LPC default (-EIO).
*/
struct cros_ec_lpc_io {
int (*read)(struct cros_ec_device *ec, unsigned int offset,
unsigned int length, u8 *dest);
int (*write)(struct cros_ec_device *ec, unsigned int offset,
unsigned int length, const u8 *src);
+ unsigned int response_timeout_ms;
+ int timeout_error;
};
int cros_ec_lpc_pkt_xfer(struct cros_ec_device *ec,
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
` (2 preceding siblings ...)
2026-12-04 4:21 ` [PATCH v2 03/13] platform/chrome: Allow transport-specific LPC response timeouts Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window Wang Yang
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Benson Leung, Tzung-Bi Shih, Guenter Roeck, chrome-platform
Initialize IRQ flags to IRQF_TRIGGER_LOW | IRQF_ONESHOT when the EC
device is allocated. Use these flags when registering the interrupt so
a transport can rely on the trigger type configured by its firmware.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/cros_ec.c | 3 ++-
include/linux/platform_data/cros_ec_proto.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 81631b363402..5c2ce6b74975 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -63,6 +63,7 @@ struct cros_ec_device *cros_ec_device_alloc(struct device *dev)
return NULL;
ec_dev->dev = dev;
+ ec_dev->irqflags = IRQF_TRIGGER_LOW | IRQF_ONESHOT;
ec_dev->max_response = sizeof(struct ec_response_get_protocol_info);
ec_dev->max_request = sizeof(struct ec_params_rwsig_action);
ec_dev->suspend_timeout_ms = EC_HOST_SLEEP_TIMEOUT_DEFAULT;
@@ -247,7 +248,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
err = devm_request_threaded_irq(dev, ec_dev->irq,
cros_ec_irq_handler,
cros_ec_irq_thread,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ ec_dev->irqflags,
"chromeos-ec", ec_dev);
if (err)
goto exit;
diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
index a1ccecf5e1f8..6307f520db55 100644
--- a/include/linux/platform_data/cros_ec_proto.h
+++ b/include/linux/platform_data/cros_ec_proto.h
@@ -111,6 +111,7 @@ struct cros_ec_command {
* @proto_version: The protocol version used for this device.
* @priv: Private data.
* @irq: Interrupt to use.
+ * @irqflags: Interrupt request flags, defaulting to IRQF_TRIGGER_LOW | IRQF_ONESHOT.
* @id: Device id.
* @din: Input buffer (for data from EC). This buffer will always be
* dword-aligned and include enough space for up to 7 word-alignment
@@ -181,6 +182,7 @@ struct cros_ec_device {
u16 proto_version;
void *priv;
int irq;
+ unsigned long irqflags;
u8 *din;
u8 *dout;
int din_size;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
` (3 preceding siblings ...)
2026-12-04 4:21 ` [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 08/13] platform/chrome: Allow ChromeOS platform support on RISC-V Wang Yang
2026-12-04 4:21 ` [PATCH v2 09/13] platform/chrome: Add SpacemiT K3 eSPI EC transport Wang Yang
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Benson Leung,
Guenter Roeck, Yixun Lan, Troy Mitchell, devicetree,
chrome-platform, linux-riscv, spacemit
Describe the K3 non-linear peripheral window before the controller
binding references it. Reuse the existing keyboard and I2C tunnel
schemas. Keep the Google EC binding unchanged.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
.../spacemit,k3-cros-ec.yaml | 77 +++++++++++++++++++
1 file changed, 77 insertions(+)
create mode 100644 Documentation/devicetree/bindings/embedded-controller/spacemit,k3-cros-ec.yaml
diff --git a/Documentation/devicetree/bindings/embedded-controller/spacemit,k3-cros-ec.yaml b/Documentation/devicetree/bindings/embedded-controller/spacemit,k3-cros-ec.yaml
new file mode 100644
index 000000000000..fa9343e3ebf7
--- /dev/null
+++ b/Documentation/devicetree/bindings/embedded-controller/spacemit,k3-cros-ec.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/embedded-controller/spacemit,k3-cros-ec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ChromeOS EC on the SpacemiT K3 peripheral window
+
+maintainers:
+ - Wang Yang <yang.wang@deepcomputing.io>
+
+description: |
+ The embedded controller implements ChromeOS EC host commands through the
+ memory-mapped peripheral window of the SpacemiT K3 eSPI controller. The
+ window uses a non-linear LPC register layout. Offset 0x00 provides host
+ command writes and status reads; offset 0x01 provides host data/results.
+ Protocol v2 arguments and parameters are at 0x10 and 0x18, protocol v3
+ packets at 0x100, and the EC memory map at 0x200. This programming interface
+ is distinct from an EC connected to an ordinary SPI controller. Child
+ functions use the common ChromeOS EC host-command interface. Devices on
+ an EC-controlled I2C bus are described below an I2C tunnel child.
+
+properties:
+ compatible:
+ const: spacemit,k3-cros-ec
+
+ reg:
+ maxItems: 1
+ description: EC peripheral memory window, at least 0x300 bytes.
+
+ interrupts:
+ maxItems: 1
+
+ wakeup-source: true
+
+ keyboard-controller:
+ $ref: /schemas/input/google,cros-ec-keyb.yaml#
+
+patternProperties:
+ "^i2c-tunnel[0-9]*$":
+ type: object
+ $ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ bus {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ ec@0 {
+ compatible = "spacemit,k3-cros-ec";
+ reg = <0x0 0x1000>;
+ interrupt-parent = <&gpio>;
+ interrupts = <1 11 IRQ_TYPE_EDGE_RISING>;
+
+ i2c-tunnel {
+ compatible = "google,cros-ec-i2c-tunnel";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ google,remote-bus = <4>;
+
+ battery@b {
+ compatible = "sbs,sbs-battery";
+ reg = <0xb>;
+ };
+ };
+ };
+ };
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 08/13] platform/chrome: Allow ChromeOS platform support on RISC-V
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
` (4 preceding siblings ...)
2026-12-04 4:21 ` [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
2026-12-04 4:21 ` [PATCH v2 09/13] platform/chrome: Add SpacemiT K3 eSPI EC transport Wang Yang
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Benson Leung, Tzung-Bi Shih, chrome-platform
Allow RISC-V boards to enable ChromeOS EC and its child drivers
without selecting COMPILE_TEST.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
index 2c11eb4ec95d..2e4fec3820f5 100644
--- a/drivers/platform/chrome/Kconfig
+++ b/drivers/platform/chrome/Kconfig
@@ -5,7 +5,7 @@
menuconfig CHROME_PLATFORMS
bool "Platform support for Chrome hardware"
- depends on X86 || ARM || ARM64 || COMPILE_TEST
+ depends on X86 || ARM || ARM64 || RISCV || COMPILE_TEST
depends on !CPU_BIG_ENDIAN || COMPILE_TEST
help
Say Y here to get to see options for platform support for
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 09/13] platform/chrome: Add SpacemiT K3 eSPI EC transport
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
` (5 preceding siblings ...)
2026-12-04 4:21 ` [PATCH v2 08/13] platform/chrome: Allow ChromeOS platform support on RISC-V Wang Yang
@ 2026-12-04 4:21 ` Wang Yang
6 siblings, 0 replies; 8+ messages in thread
From: Wang Yang @ 2026-12-04 4:21 UTC (permalink / raw)
To: linux-kernel
Cc: Benson Leung, Tzung-Bi Shih, Yixun Lan, Troy Mitchell,
Guenter Roeck, chrome-platform, linux-riscv, spacemit
Map the K3 non-linear window and reuse the common LPC-style protocol
helpers. Keep K3 readiness, five-second timeout and link recovery
in the vendor backend. Recover a timed-out link without replaying
a command that may already have executed. Let the EC core request
the firmware-configured event IRQ.
Use module cros_ec_espi_spacemit, CONFIG_CROS_EC_SPACEMIT_K3 and
compatible spacemit,k3-cros-ec. This is a K3-specific interface.
Require the firmware event IRQ before accessing the EC. Serialize host
commands and direct memory reads with link recovery. Retry transient
negotiation failures, then wait for the EC ID on the established link.
Give the already negotiated link time to publish its ID before resetting
it at probe. Recover synchronously during protocol negotiation. Once
the core installs the dedicated GPIO IRQ action, defer link recovery to
a workqueue so the GPIO bank thread can service other pins. Prevent
queued recovery from outliving a failed probe. Reject window accesses
while recovery is active. Check request and response sizes against the
K3 packet window.
Check a pending link recovery before enabling the event IRQ on resume.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/Kconfig | 12 +
drivers/platform/chrome/Makefile | 1 +
.../platform/chrome/cros_ec_espi_spacemit.c | 568 ++++++++++++++++++
3 files changed, 581 insertions(+)
create mode 100644 drivers/platform/chrome/cros_ec_espi_spacemit.c
diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
index 2e4fec3820f5..11a8320b202d 100644
--- a/drivers/platform/chrome/Kconfig
+++ b/drivers/platform/chrome/Kconfig
@@ -160,6 +160,18 @@ config CROS_EC_LPC
To compile this driver as a module, choose M here: the
module will be called cros_ec_lpcs.
+config CROS_EC_SPACEMIT_K3
+ tristate "SpacemiT K3 ChromeOS EC over eSPI"
+ depends on CROS_EC && SPACEMIT_ESPI_BUS
+ select CROS_EC_LPC_PROTO
+ help
+ Support a ChromeOS EC connected through the SpacemiT K3 eSPI
+ peripheral shared-memory window. The transport supports host
+ command protocol versions 2 and 3 and EC event interrupts.
+
+ To compile this driver as a module, choose M here: the module
+ will be called cros_ec_espi_spacemit.
+
config CROS_EC_PROTO
tristate
help
diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
index 00d3d9fba1e0..a0731d359104 100644
--- a/drivers/platform/chrome/Makefile
+++ b/drivers/platform/chrome/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o
obj-$(CONFIG_CROS_EC_ISHTP) += cros_ec_ishtp.o
obj-$(CONFIG_CROS_TYPEC_SWITCH) += cros_typec_switch.o
obj-$(CONFIG_CROS_EC_RPMSG) += cros_ec_rpmsg.o
+obj-$(CONFIG_CROS_EC_SPACEMIT_K3) += cros_ec_espi_spacemit.o
obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
obj-$(CONFIG_CROS_EC_UART) += cros_ec_uart.o
cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_mec.o
diff --git a/drivers/platform/chrome/cros_ec_espi_spacemit.c b/drivers/platform/chrome/cros_ec_espi_spacemit.c
new file mode 100644
index 000000000000..cb5c37d1a24d
--- /dev/null
+++ b/drivers/platform/chrome/cros_ec_espi_spacemit.c
@@ -0,0 +1,568 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * ChromeOS EC interface for the SpacemiT K3 eSPI controller
+ *
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * Copyright (c) 2024 SpacemiT, Inc.
+ *
+ * This driver provides the SpacemiT K3 eSPI window for ChromeOS EC communication.
+ * It converts LPC I/O port accesses to eSPI shared memory accesses while maintaining
+ * compatibility with the existing ChromeOS EC protocol stack.
+ */
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/jiffies.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/of.h>
+#include <linux/platform_data/cros_ec_commands.h>
+#include <linux/platform_data/cros_ec_proto.h>
+#include <linux/platform_device.h>
+#include <linux/pm_wakeup.h>
+#include <linux/slab.h>
+#include <linux/spacemit-k3-espi.h>
+#include <linux/suspend.h>
+#include <linux/workqueue.h>
+
+#include "cros_ec.h"
+#include "cros_ec_lpc_proto.h"
+
+#define DRV_NAME "cros_ec_espi_spacemit"
+
+/* eSPI shared memory access timeout */
+#define ESPI_CMD_TIMEOUT_MS 5000
+
+/*
+ * After an EC reboot the transport may recover well before the EC firmware
+ * finishes repopulating the shared memory window. Allow a longer grace period
+ * here so the first post-reboot command does not immediately fall into another
+ * full timeout cycle.
+ */
+#define ESPI_READY_TIMEOUT_MS 20000
+#define ESPI_READY_POLL_INTERVAL_US 20000
+#define ESPI_RECOVERY_RETRY_INTERVAL_MS 5000
+#define ESPI_INVALID_STATUS_VALUE 0xff
+#define ESPI_INVALID_STATUS_MAX_POLLS 5
+
+/*
+ * eSPI Shared Memory Address Mapping for EC Communication
+ *
+ * This driver converts LPC I/O port accesses to eSPI shared memory accesses.
+ * The original LPC addresses are mapped to offsets within the eSPI shared memory region.
+ *
+ * Memory Layout in eSPI Shared Memory:
+ * 0x000: Host command register (EC_LPC_ADDR_HOST_CMD -> 0x000)
+ * 0x001: Host data register (EC_LPC_ADDR_HOST_DATA -> 0x001)
+ * 0x010-0x013: Host arguments (4 bytes; 0x014-0x017 reserved)
+ * 0x018-0x113: Protocol v2 parameters (up to 252 bytes)
+ * 0x100-0x1FF: Packet data area (256 bytes for protocol v3)
+ * 0x200-0x2FF: Memory map region (256 bytes)
+ *
+ * Protocol v2 parameters and protocol v3 packets are used separately.
+ */
+
+/* eSPI shared memory offsets */
+#define ESPI_HOST_CMD_OFFSET 0x000 /* EC_LPC_ADDR_HOST_CMD -> 0x000 */
+#define ESPI_HOST_DATA_OFFSET 0x001 /* EC_LPC_ADDR_HOST_DATA -> 0x001 */
+#define ESPI_HOST_ARGS_OFFSET 0x010 /* EC_LPC_ADDR_HOST_ARGS -> 0x010 */
+#define ESPI_HOST_PARAM_OFFSET 0x018 /* EC_LPC_ADDR_HOST_PARAM -> 0x018 */
+#define ESPI_HOST_PACKET_OFFSET 0x100 /* EC_LPC_ADDR_HOST_PACKET -> 0x100 */
+#define ESPI_MEMMAP_OFFSET 0x200 /* EC_LPC_ADDR_MEMMAP -> 0x200 */
+#define ESPI_HOST_PARAM_SIZE EC_PROTO2_MAX_PARAM_SIZE
+
+/**
+ * struct cros_ec_espi - eSPI device-specific data
+ * @espi_shared_mem_base: Base address of eSPI shared memory region
+ * @invalid_status_polls: Consecutive absent-endpoint status reads
+ * @needs_recovery: Restore the link before the next window access.
+ * @ec: EC whose peripheral window is being recovered.
+ * @recovery_work: Restore the link outside the GPIO interrupt thread.
+ * @io_mutex: Serialize window accesses and changes to the recovery state.
+ */
+struct cros_ec_espi {
+ void __iomem *espi_shared_mem_base;
+ unsigned int invalid_status_polls;
+ bool needs_recovery;
+ struct cros_ec_device *ec;
+ struct work_struct recovery_work;
+ /* Serialize commands, direct reads and recovery state transitions. */
+ struct mutex io_mutex;
+};
+
+/* Validate an entire transfer before touching the shared window. */
+static int lpc_to_espi_offset(struct cros_ec_device *ec, u32 lpc_addr,
+ unsigned int length)
+{
+ u32 start, size, offset;
+
+ if (lpc_addr == EC_LPC_ADDR_HOST_CMD || lpc_addr == EC_LPC_ADDR_HOST_DATA) {
+ if (length != 1)
+ return -EMSGSIZE;
+ return lpc_addr == EC_LPC_ADDR_HOST_CMD ?
+ ESPI_HOST_CMD_OFFSET : ESPI_HOST_DATA_OFFSET;
+ }
+
+ if (lpc_addr >= EC_LPC_ADDR_MEMMAP &&
+ lpc_addr < EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SIZE) {
+ start = EC_LPC_ADDR_MEMMAP;
+ size = EC_MEMMAP_SIZE;
+ offset = ESPI_MEMMAP_OFFSET;
+ } else if (ec->proto_version > 2 &&
+ lpc_addr >= EC_LPC_ADDR_HOST_PACKET &&
+ lpc_addr < EC_LPC_ADDR_HOST_PACKET + EC_LPC_HOST_PACKET_SIZE) {
+ start = EC_LPC_ADDR_HOST_PACKET;
+ size = EC_LPC_HOST_PACKET_SIZE;
+ offset = ESPI_HOST_PACKET_OFFSET;
+ } else if (ec->proto_version <= 2 &&
+ lpc_addr >= EC_LPC_ADDR_HOST_ARGS &&
+ lpc_addr < EC_LPC_ADDR_HOST_PARAM) {
+ start = EC_LPC_ADDR_HOST_ARGS;
+ size = EC_LPC_ADDR_HOST_PARAM - EC_LPC_ADDR_HOST_ARGS;
+ offset = ESPI_HOST_ARGS_OFFSET;
+ } else if (ec->proto_version <= 2 &&
+ lpc_addr >= EC_LPC_ADDR_HOST_PARAM &&
+ lpc_addr < EC_LPC_ADDR_HOST_PARAM + ESPI_HOST_PARAM_SIZE) {
+ start = EC_LPC_ADDR_HOST_PARAM;
+ size = ESPI_HOST_PARAM_SIZE;
+ offset = ESPI_HOST_PARAM_OFFSET;
+ } else {
+ return -EINVAL;
+ }
+
+ if (length > size - (lpc_addr - start))
+ return -EMSGSIZE;
+
+ return offset + lpc_addr - start;
+}
+
+/* Return the checksum of the bytes read from the peripheral window. */
+static int cros_ec_espi_read_bytes(struct cros_ec_device *ec,
+ unsigned int offset, unsigned int length,
+ u8 *dest)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+ void __iomem *addr;
+ int espi_offset;
+ u8 sum = 0;
+ int i;
+
+ espi_offset = lpc_to_espi_offset(ec, offset, length);
+ if (espi_offset < 0)
+ return espi_offset;
+
+ for (i = 0; i < length; ++i) {
+ addr = ec_espi->espi_shared_mem_base + espi_offset + i;
+
+ /* eSPI shared memory: 1-byte access */
+ dest[i] = readb(addr);
+ sum += dest[i];
+ }
+
+ if (offset == EC_LPC_ADDR_HOST_CMD) {
+ if (*dest == ESPI_INVALID_STATUS_VALUE)
+ ec_espi->invalid_status_polls++;
+ else
+ ec_espi->invalid_status_polls = 0;
+ }
+
+ if (offset == EC_LPC_ADDR_HOST_CMD &&
+ ec_espi->invalid_status_polls >= ESPI_INVALID_STATUS_MAX_POLLS)
+ return -ETIMEDOUT;
+
+ /* Return checksum of all bytes read */
+ return sum;
+}
+
+/* Return the checksum of the bytes written to the peripheral window. */
+static int cros_ec_espi_write_bytes(struct cros_ec_device *ec,
+ unsigned int offset, unsigned int length,
+ const u8 *msg)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+ void __iomem *addr;
+ int espi_offset;
+ u8 sum = 0;
+ int i;
+
+ espi_offset = lpc_to_espi_offset(ec, offset, length);
+ if (espi_offset < 0)
+ return espi_offset;
+
+ for (i = 0; i < length; ++i) {
+ addr = ec_espi->espi_shared_mem_base + espi_offset + i;
+
+ /* eSPI shared memory: 1-byte access */
+ writeb(msg[i], addr);
+ sum += msg[i];
+ }
+
+ /* Return checksum of all bytes written */
+ return sum;
+}
+
+static const struct cros_ec_lpc_io cros_ec_espi_io = {
+ .read = cros_ec_espi_read_bytes,
+ .write = cros_ec_espi_write_bytes,
+ .response_timeout_ms = ESPI_CMD_TIMEOUT_MS,
+ .timeout_error = -ETIMEDOUT,
+};
+
+static int cros_ec_pkt_xfer_espi_once(struct cros_ec_device *ec,
+ struct cros_ec_command *msg)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+
+ if (msg->outsize > EC_LPC_HOST_PACKET_SIZE - sizeof(struct ec_host_request) ||
+ msg->insize > EC_LPC_HOST_PACKET_SIZE - sizeof(struct ec_host_response))
+ return -EMSGSIZE;
+
+ ec_espi->invalid_status_polls = 0;
+ usleep_range(500, 1000);
+
+ return cros_ec_lpc_pkt_xfer(ec, &cros_ec_espi_io, msg);
+}
+
+static int cros_ec_cmd_xfer_espi_once(struct cros_ec_device *ec,
+ struct cros_ec_command *msg)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+
+ if (msg->outsize > ESPI_HOST_PARAM_SIZE || msg->insize > ESPI_HOST_PARAM_SIZE)
+ return -EMSGSIZE;
+
+ ec_espi->invalid_status_polls = 0;
+ usleep_range(500, 1000);
+
+ return cros_ec_lpc_cmd_xfer(ec, &cros_ec_espi_io, msg);
+}
+
+static bool cros_ec_espi_valid_id(const u8 *buf)
+{
+ return buf[0] == 'E' && buf[1] == 'C';
+}
+
+static int cros_ec_espi_read_id(struct cros_ec_device *ec, u8 *buf)
+{
+ return cros_ec_espi_read_bytes(ec, EC_LPC_ADDR_MEMMAP + EC_MEMMAP_ID, 2, buf);
+}
+
+static int cros_ec_espi_wait_for_id(struct cros_ec_device *ec,
+ unsigned long deadline)
+{
+ u8 id[2];
+ int ret;
+
+ do {
+ ret = cros_ec_espi_read_id(ec, id);
+ if (ret < 0)
+ return ret;
+ if (cros_ec_espi_valid_id(id)) {
+ /* The ID appears before the command window is ready. */
+ msleep(100);
+ return 0;
+ }
+ usleep_range(ESPI_READY_POLL_INTERVAL_US,
+ ESPI_READY_POLL_INTERVAL_US + 10000);
+ } while (time_before(jiffies, deadline));
+
+ return -ETIMEDOUT;
+}
+
+static int cros_ec_espi_recover_controller(struct cros_ec_device *ec,
+ unsigned long deadline)
+{
+ unsigned long interval = msecs_to_jiffies(ESPI_RECOVERY_RETRY_INTERVAL_MS);
+ int ret;
+
+ do {
+ ret = spacemit_k3_espi_recover(ec->dev->parent);
+ if (!ret)
+ return cros_ec_espi_wait_for_id(ec, deadline);
+ if (ret != -ETIMEDOUT && ret != -EBUSY && ret != -EIO)
+ return ret;
+ if (time_after_eq(jiffies + interval, deadline))
+ break;
+ msleep(ESPI_RECOVERY_RETRY_INTERVAL_MS);
+ } while (time_before(jiffies, deadline));
+
+ return ret;
+}
+
+/* The parent may already have negotiated the link and mapped the window. */
+static int cros_ec_espi_check_link(struct cros_ec_device *ec)
+{
+ unsigned long deadline = jiffies + msecs_to_jiffies(ESPI_READY_TIMEOUT_MS);
+ int ret;
+
+ ret = cros_ec_espi_wait_for_id(ec, jiffies +
+ msecs_to_jiffies(ESPI_RECOVERY_RETRY_INTERVAL_MS));
+ if (ret == -ETIMEDOUT)
+ ret = cros_ec_espi_recover_controller(ec, deadline);
+
+ return ret;
+}
+
+static void cros_ec_espi_recovery_work(struct work_struct *work)
+{
+ struct cros_ec_espi *ec_espi = container_of(work, struct cros_ec_espi,
+ recovery_work);
+ unsigned long deadline = jiffies + msecs_to_jiffies(ESPI_READY_TIMEOUT_MS);
+ int ret;
+
+ mutex_lock(&ec_espi->io_mutex);
+ if (!ec_espi->needs_recovery) {
+ mutex_unlock(&ec_espi->io_mutex);
+ return;
+ }
+ mutex_unlock(&ec_espi->io_mutex);
+
+ /* While recovery owns the window, new callers return -EHOSTDOWN. */
+ ret = cros_ec_espi_recover_controller(ec_espi->ec, deadline);
+ if (ret) {
+ dev_warn_ratelimited(ec_espi->ec->dev, "link recovery failed: %d\n", ret);
+ return;
+ }
+
+ mutex_lock(&ec_espi->io_mutex);
+ ec_espi->needs_recovery = false;
+ mutex_unlock(&ec_espi->io_mutex);
+}
+
+/* Called with io_mutex held. */
+static int cros_ec_espi_ensure_ready(struct cros_ec_device *ec)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+ unsigned long deadline;
+ int ret;
+
+ if (!ec_espi->needs_recovery)
+ return 0;
+
+ /*
+ * The core negotiates the protocol before requesting our dedicated
+ * IRQ. Once its action is installed, transfers may already run in
+ * the GPIO interrupt thread, even before cros_ec_register() returns.
+ */
+ if (irq_has_action(ec->irq)) {
+ queue_work(system_freezable_wq, &ec_espi->recovery_work);
+ return -EHOSTDOWN;
+ }
+
+ /* The initial protocol negotiation needs a working link immediately. */
+ deadline = jiffies + msecs_to_jiffies(ESPI_READY_TIMEOUT_MS);
+ ret = cros_ec_espi_recover_controller(ec, deadline);
+ ec_espi->needs_recovery = !!ret;
+ return ret;
+}
+
+static int cros_ec_espi_xfer(struct cros_ec_device *ec,
+ struct cros_ec_command *msg,
+ int (*xfer_once)(struct cros_ec_device *ec,
+ struct cros_ec_command *msg))
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+ int ret;
+
+ mutex_lock(&ec_espi->io_mutex);
+ ret = cros_ec_espi_ensure_ready(ec);
+ if (ret)
+ goto unlock;
+
+ ret = xfer_once(ec, msg);
+ /*
+ * A lost completion does not mean that the EC did not execute the
+ * command. Repair the link without replaying a potentially destructive
+ * operation, such as an I2C passthrough write.
+ */
+ if (ret == -ETIMEDOUT) {
+ ec_espi->needs_recovery = true;
+ cros_ec_espi_ensure_ready(ec);
+ }
+unlock:
+ mutex_unlock(&ec_espi->io_mutex);
+
+ return ret;
+}
+
+static int cros_ec_pkt_xfer_espi(struct cros_ec_device *ec,
+ struct cros_ec_command *msg)
+{
+ return cros_ec_espi_xfer(ec, msg, cros_ec_pkt_xfer_espi_once);
+}
+
+static int cros_ec_cmd_xfer_espi(struct cros_ec_device *ec,
+ struct cros_ec_command *msg)
+{
+ return cros_ec_espi_xfer(ec, msg, cros_ec_cmd_xfer_espi_once);
+}
+
+static int cros_ec_espi_readmem(struct cros_ec_device *ec, unsigned int offset,
+ unsigned int bytes, void *dest)
+{
+ struct cros_ec_espi *ec_espi = ec->priv;
+ int ret;
+
+ mutex_lock(&ec_espi->io_mutex);
+ ret = cros_ec_espi_ensure_ready(ec);
+ if (!ret)
+ ret = cros_ec_lpc_readmem(ec, &cros_ec_espi_io, EC_LPC_ADDR_MEMMAP,
+ offset, bytes, dest);
+ mutex_unlock(&ec_espi->io_mutex);
+
+ return ret;
+}
+
+static int cros_ec_espi_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct cros_ec_device *ec;
+ struct cros_ec_espi *ec_espi;
+ struct resource *res;
+ int irq, ret;
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
+ ec_espi = devm_kzalloc(dev, sizeof(*ec_espi), GFP_KERNEL);
+ if (!ec_espi)
+ return -ENOMEM;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res || resource_size(res) < 0x300)
+ return -EINVAL;
+ ec_espi->espi_shared_mem_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(ec_espi->espi_shared_mem_base))
+ return PTR_ERR(ec_espi->espi_shared_mem_base);
+
+ mutex_init(&ec_espi->io_mutex);
+
+ ec = cros_ec_device_alloc(dev);
+ if (!ec)
+ return -ENOMEM;
+
+ ec->phys_name = dev_name(dev);
+ ec->irq = irq;
+ /* Use the IRQ trigger type specified by the board's device tree. */
+ ec->irqflags = IRQF_ONESHOT;
+ ec->cmd_xfer = cros_ec_cmd_xfer_espi;
+ ec->pkt_xfer = cros_ec_pkt_xfer_espi;
+ ec->cmd_readmem = cros_ec_espi_readmem;
+ ec->priv = ec_espi;
+ platform_set_drvdata(pdev, ec);
+ ec_espi->ec = ec;
+ INIT_WORK(&ec_espi->recovery_work, cros_ec_espi_recovery_work);
+
+ ret = cros_ec_espi_check_link(ec);
+ if (ret)
+ return dev_err_probe(dev, ret, "EC is not ready\n");
+
+ if (of_property_read_bool(dev->of_node, "wakeup-source")) {
+ ret = devm_device_init_wakeup(dev);
+ if (ret)
+ return ret;
+ }
+
+ ret = cros_ec_register(ec);
+ if (ret) {
+ /* An IRQ during registration may already have queued recovery. */
+ disable_work_sync(&ec_espi->recovery_work);
+ return dev_err_probe(dev, ret, "failed to register EC\n");
+ }
+
+ return 0;
+}
+
+static void cros_ec_espi_remove(struct platform_device *pdev)
+{
+ struct cros_ec_device *ec = platform_get_drvdata(pdev);
+ struct cros_ec_espi *ec_espi = ec->priv;
+
+ disable_work_sync(&ec_espi->recovery_work);
+ cros_ec_unregister(ec);
+}
+
+static const struct of_device_id cros_ec_espi_of_match[] = {
+ { .compatible = "spacemit,k3-cros-ec" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, cros_ec_espi_of_match);
+
+#ifdef CONFIG_PM_SLEEP
+static int cros_ec_espi_prepare(struct device *dev)
+{
+ struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+
+ return cros_ec_suspend_prepare(ec_dev);
+}
+
+static void cros_ec_espi_complete(struct device *dev)
+{
+ struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+
+ cros_ec_resume_complete(ec_dev);
+}
+
+static int cros_ec_espi_suspend_late(struct device *dev)
+{
+ struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+ struct cros_ec_espi *ec_espi = ec_dev->priv;
+
+ disable_work_sync(&ec_espi->recovery_work);
+ return cros_ec_suspend_late(ec_dev);
+}
+
+static int cros_ec_espi_resume_early(struct device *dev)
+{
+ struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+ struct cros_ec_espi *ec_espi = ec_dev->priv;
+ int ret = 0;
+
+ /* Recovery work is still frozen when the core sends its resume event. */
+ mutex_lock(&ec_espi->io_mutex);
+ if (ec_espi->needs_recovery) {
+ ret = cros_ec_espi_check_link(ec_dev);
+ ec_espi->needs_recovery = !!ret;
+ }
+ enable_work(&ec_espi->recovery_work);
+ mutex_unlock(&ec_espi->io_mutex);
+
+ /* Balance suspend_late() even if the link needs another recovery. */
+ cros_ec_resume_early(ec_dev);
+ return ret;
+}
+#endif
+
+static const struct dev_pm_ops cros_ec_espi_pm_ops = {
+#ifdef CONFIG_PM_SLEEP
+ .prepare = cros_ec_espi_prepare,
+ .complete = cros_ec_espi_complete,
+#endif
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_espi_suspend_late,
+ cros_ec_espi_resume_early)
+};
+
+static struct platform_driver cros_ec_espi_driver = {
+ .driver = {
+ .name = DRV_NAME,
+ .of_match_table = cros_ec_espi_of_match,
+ .pm = &cros_ec_espi_pm_ops,
+ /*
+ * Child devices may probe before us, and they racily
+ * check our drvdata pointer. Force synchronous probe until
+ * those races are resolved.
+ */
+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
+ },
+ .probe = cros_ec_espi_probe,
+ .remove = cros_ec_espi_remove,
+};
+
+module_platform_driver(cros_ec_espi_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SpacemiT K3 eSPI transport for the ChromeOS EC protocol");
+MODULE_ALIAS("platform:" DRV_NAME);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-12-04 4:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
2026-12-04 4:20 ` [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds Wang Yang
2026-12-04 4:21 ` [PATCH v2 02/13] platform/chrome: Extract LPC-style EC protocol helpers Wang Yang
2026-12-04 4:21 ` [PATCH v2 03/13] platform/chrome: Allow transport-specific LPC response timeouts Wang Yang
2026-12-04 4:21 ` [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags Wang Yang
2026-12-04 4:21 ` [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window Wang Yang
2026-12-04 4:21 ` [PATCH v2 08/13] platform/chrome: Allow ChromeOS platform support on RISC-V Wang Yang
2026-12-04 4:21 ` [PATCH v2 09/13] platform/chrome: Add SpacemiT K3 eSPI EC transport Wang Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox