diff mbox series

platform/chrome: cros_ec_lpc: switch primary DMI data for Framework Laptop

Message ID 20240806-platform-chrome-cros_ec_lpcs-change-the-default-disposition-of-the-framework-laptop-v1-1-09e0d602b215@howett.net (mailing list archive)
State Accepted
Commit 62be134abf4250474a7a694837064bc783d2b291
Headers show
Series platform/chrome: cros_ec_lpc: switch primary DMI data for Framework Laptop | expand

Commit Message

Dustin L. Howett Aug. 7, 2024, 2:54 a.m. UTC
Framework Computer appears to be moving away from the Microchip embedded
controller seen in the Framework Laptop 13 with Intel Core 11th, 12th
and 13th generation processors. All newer models use a Nuvoton NPCX
embedded controller.

Changing the default DMI match for Framework's products to match their
newer product lines will reduce churn in this part of the cros_ec_lpc
driver.

The new match tables are:

- Microchip EC models
  - "Laptop" (product, exact match) for the 11th gen. Intel Core
  - "12th Gen Intel Core" (product, exact match)
  - "13th Gen Intel Core" (product, exact match)
- Nuvoton NPCX models
  - "Laptop" (product family, partial match)

---
Signed-off-by: Dustin L. Howett <dustin@howett.net>
---
 drivers/platform/chrome/cros_ec_lpc.c | 36 ++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)


---
base-commit: de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
change-id: 20240531-platform-chrome-cros_ec_lpcs-change-the-default-disposition-of-the-framework-laptop-2249a26c88af

Best regards,

Comments

Alexandru Stan Aug. 7, 2024, 3:27 a.m. UTC | #1
On Tue, Aug 6, 2024 at 7:54 PM Dustin L. Howett <dustin@howett.net> wrote:
>
> Framework Computer appears to be moving away from the Microchip embedded
> controller seen in the Framework Laptop 13 with Intel Core 11th, 12th
> and 13th generation processors. All newer models use a Nuvoton NPCX
> embedded controller.
>
> Changing the default DMI match for Framework's products to match their
> newer product lines will reduce churn in this part of the cros_ec_lpc
> driver.
>
> The new match tables are:
>
> - Microchip EC models
>   - "Laptop" (product, exact match) for the 11th gen. Intel Core
>   - "12th Gen Intel Core" (product, exact match)
>   - "13th Gen Intel Core" (product, exact match)
> - Nuvoton NPCX models
>   - "Laptop" (product family, partial match)
>
> ---
> Signed-off-by: Dustin L. Howett <dustin@howett.net>
> ---
>  drivers/platform/chrome/cros_ec_lpc.c | 36 ++++++++++++++++++++++++++---------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index f0470248b109..c784119ab5dc 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -631,12 +631,12 @@ static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, cros_ec_lpc_acpi_device_ids);
>
> -static const struct lpc_driver_data framework_laptop_amd_lpc_driver_data __initconst = {
> +static const struct lpc_driver_data framework_laptop_npcx_lpc_driver_data __initconst = {
>         .quirks = CROS_EC_LPC_QUIRK_REMAP_MEMORY,
>         .quirk_mmio_memory_base = 0xE00,
>  };
>
> -static const struct lpc_driver_data framework_laptop_11_lpc_driver_data __initconst = {
> +static const struct lpc_driver_data framework_laptop_mec_lpc_driver_data __initconst = {
>         .quirks = CROS_EC_LPC_QUIRK_ACPI_ID|CROS_EC_LPC_QUIRK_AML_MUTEX,
>         .quirk_acpi_id = "PNP0C09",
>         .quirk_aml_mutex_name = "ECMT",
> @@ -696,21 +696,39 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
>         },
>         /* A small number of non-Chromebook/box machines also use the ChromeOS EC */
>         {
> -               /* the Framework Laptop 13 (AMD Ryzen) and 16 (AMD Ryzen) */
> +               /* Framework Laptop (11th Gen Intel Core) */
>                 .matches = {
>                         DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
> -                       DMI_MATCH(DMI_PRODUCT_NAME, "AMD Ryzen"),
> -                       DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"),
> +                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Laptop"),
>                 },
> -               .driver_data = (void *)&framework_laptop_amd_lpc_driver_data,
> +               .driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
>         },
>         {
> -               /* the Framework Laptop (Intel 11th, 12th, 13th Generation) */
> +               /* Framework Laptop (12th Gen Intel Core) */
>                 .matches = {
>                         DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
> -                       DMI_MATCH(DMI_PRODUCT_NAME, "Laptop"),
> +                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "12th Gen Intel Core"),
>                 },
> -               .driver_data = (void *)&framework_laptop_11_lpc_driver_data,
> +               .driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
> +       },
> +       {
> +               /* Framework Laptop (13th Gen Intel Core) */
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
> +                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "13th Gen Intel Core"),
> +               },
> +               .driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
> +       },
> +       {
> +               /*
> +                * All remaining Framework Laptop models (13 AMD Ryzen, 16 AMD
> +                * Ryzen, Intel Core Ultra)
> +                */
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
> +                       DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"),
> +               },
> +               .driver_data = (void *)&framework_laptop_npcx_lpc_driver_data,
>         },
>         { /* sentinel */ }
>  };
>
> ---
> base-commit: de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
> change-id: 20240531-platform-chrome-cros_ec_lpcs-change-the-default-disposition-of-the-framework-laptop-2249a26c88af
>
> Best regards,
> --
> Dustin L. Howett <dustin@howett.net>
>

Thank you! Can confirm, the new designs are NPCX based, so it's a good default.

I would even go further and say npcx doesn't have to be in the struct
name (since it's mostly the default settings that might work on
non-npcx chips that aren't microchip), but that's more like a nit.

Reviewed-by: Alexandru M Stan <ams@frame.work>

Alexandru M. Stan (amstan)
System Software Engineer
Tzung-Bi Shih Aug. 7, 2024, 12:51 p.m. UTC | #2
On Tue, Aug 06, 2024 at 09:54:09PM -0500, Dustin L. Howett wrote:
> Framework Computer appears to be moving away from the Microchip embedded
> controller seen in the Framework Laptop 13 with Intel Core 11th, 12th
> and 13th generation processors. All newer models use a Nuvoton NPCX
> embedded controller.
> 
> Changing the default DMI match for Framework's products to match their
> newer product lines will reduce churn in this part of the cros_ec_lpc
> driver.
> 
> [...]

Applied to

    https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

Thanks!

[1/1] platform/chrome: cros_ec_lpc: switch primary DMI data for Framework Laptop
      commit: 62be134abf4250474a7a694837064bc783d2b291
diff mbox series

Patch

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index f0470248b109..c784119ab5dc 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -631,12 +631,12 @@  static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = {
 };
 MODULE_DEVICE_TABLE(acpi, cros_ec_lpc_acpi_device_ids);
 
-static const struct lpc_driver_data framework_laptop_amd_lpc_driver_data __initconst = {
+static const struct lpc_driver_data framework_laptop_npcx_lpc_driver_data __initconst = {
 	.quirks = CROS_EC_LPC_QUIRK_REMAP_MEMORY,
 	.quirk_mmio_memory_base = 0xE00,
 };
 
-static const struct lpc_driver_data framework_laptop_11_lpc_driver_data __initconst = {
+static const struct lpc_driver_data framework_laptop_mec_lpc_driver_data __initconst = {
 	.quirks = CROS_EC_LPC_QUIRK_ACPI_ID|CROS_EC_LPC_QUIRK_AML_MUTEX,
 	.quirk_acpi_id = "PNP0C09",
 	.quirk_aml_mutex_name = "ECMT",
@@ -696,21 +696,39 @@  static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
 	},
 	/* A small number of non-Chromebook/box machines also use the ChromeOS EC */
 	{
-		/* the Framework Laptop 13 (AMD Ryzen) and 16 (AMD Ryzen) */
+		/* Framework Laptop (11th Gen Intel Core) */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMD Ryzen"),
-			DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Laptop"),
 		},
-		.driver_data = (void *)&framework_laptop_amd_lpc_driver_data,
+		.driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
 	},
 	{
-		/* the Framework Laptop (Intel 11th, 12th, 13th Generation) */
+		/* Framework Laptop (12th Gen Intel Core) */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Laptop"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "12th Gen Intel Core"),
 		},
-		.driver_data = (void *)&framework_laptop_11_lpc_driver_data,
+		.driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
+	},
+	{
+		/* Framework Laptop (13th Gen Intel Core) */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "13th Gen Intel Core"),
+		},
+		.driver_data = (void *)&framework_laptop_mec_lpc_driver_data,
+	},
+	{
+		/*
+		 * All remaining Framework Laptop models (13 AMD Ryzen, 16 AMD
+		 * Ryzen, Intel Core Ultra)
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Framework"),
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"),
+		},
+		.driver_data = (void *)&framework_laptop_npcx_lpc_driver_data,
 	},
 	{ /* sentinel */ }
 };