2022-01-26 22:27:42

by Dustin Howett

[permalink] [raw]
Subject: [PATCH v2 0/2] platform/chrome: add support for the Framework Laptop

This patch series adds support for the Framework Laptop to the cros_ec
LPC driver.

The Framework Laptop is a non-Chromebook laptop that uses the ChromeOS
Embedded Controller. Since the machine was designed to present a more
normal device profile, it does not report all 512 I/O ports that are
typically used by cros_ec_lpcs. Because of this, changes to the driver's
port reservation scheme were required.

Since this EC driver probes the MEC range first, and uses only the MEC
range if that probe succeeds[^1], we can get by without requesting the
entire port range required by non-MEC embedded controllers until
absolutely necessary.

[^1]: this includes "memory mapped" read - where the traditional LPC EC
requires I/O ports 0x900-0x9FF, the MEC EC multiplexes reads/writes
over the same eight ports, 0x800-0x807.

Changelog in v2:
Cleaned up the commit subjects per request.

Dustin L. Howett (2):
platform/chrome: cros_ec_lpcs: detect the Framework Laptop
platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first

drivers/platform/chrome/cros_ec_lpc.c | 47 ++++++++++-----
include/linux/platform_data/cros_ec_commands.h | 4 +
2 files changed, 38 insertions(+), 13 deletions(-)

--
2.34.1


2022-01-26 22:27:48

by Dustin Howett

[permalink] [raw]
Subject: [PATCH v2 1/2] platform/chrome: cros_ec_lpcs: detect the Framework Laptop

The Framework Laptop identifies itself in DMI with manufacturer
"Framework" and product "Laptop".

Signed-off-by: Dustin L. Howett <[email protected]>
---
drivers/platform/chrome/cros_ec_lpc.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index d6306d2a096f..458eb59db2ff 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -500,6 +500,14 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
DMI_MATCH(DMI_PRODUCT_NAME, "Glimmer"),
},
},
+ /* A small number of non-Chromebook/box machines also use the ChromeOS EC */
+ {
+ /* the Framework Laptop */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Laptop"),
+ },
+ },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);
--
2.34.1

2022-01-27 09:18:45

by Tzung-Bi Shih

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] platform/chrome: add support for the Framework Laptop

On Wed, Jan 26, 2022 at 12:00:18PM -0600, Dustin L. Howett wrote:
> This patch series adds support for the Framework Laptop to the cros_ec
> LPC driver.
>
> The Framework Laptop is a non-Chromebook laptop that uses the ChromeOS
> Embedded Controller. Since the machine was designed to present a more
> normal device profile, it does not report all 512 I/O ports that are
> typically used by cros_ec_lpcs. Because of this, changes to the driver's
> port reservation scheme were required.
>
> Since this EC driver probes the MEC range first, and uses only the MEC
> range if that probe succeeds[^1], we can get by without requesting the
> entire port range required by non-MEC embedded controllers until
> absolutely necessary.
>
> [^1]: this includes "memory mapped" read - where the traditional LPC EC
> requires I/O ports 0x900-0x9FF, the MEC EC multiplexes reads/writes
> over the same eight ports, 0x800-0x807.
>
> Changelog in v2:
> Cleaned up the commit subjects per request.
>
> Dustin L. Howett (2):
> platform/chrome: cros_ec_lpcs: detect the Framework Laptop
> platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first

For the series,
Reviewed-by: Tzung-Bi Shih <[email protected]>