Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83632?usp=email )
Change subject: ec/starlabs/merlin: Move the chip id check ......................................................................
ec/starlabs/merlin: Move the chip id check
As the merlin EC supports both the IT8987 and IT5570, move the check into the code so the same variant directory can be used for both chips.
Change-Id: I8c43a367e42f7e56ddd26b1c8fe7bf4b275d4ac3 Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/83632 Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/ec/starlabs/merlin/ite.c M src/ec/starlabs/merlin/variants/apl/ecdefs.h M src/ec/starlabs/merlin/variants/glk/ecdefs.h M src/ec/starlabs/merlin/variants/kbl/ecdefs.h M src/ec/starlabs/merlin/variants/merlin/ecdefs.h 5 files changed, 5 insertions(+), 15 deletions(-)
Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, approved
diff --git a/src/ec/starlabs/merlin/ite.c b/src/ec/starlabs/merlin/ite.c index 031447a..2f8bced 100644 --- a/src/ec/starlabs/merlin/ite.c +++ b/src/ec/starlabs/merlin/ite.c @@ -9,6 +9,9 @@ #include "ec.h" #include "ecdefs.h"
+#define ITE_IT5570 0x5570 +#define ITE_IT8987 0x8987 + uint16_t ec_get_version(void) { return (ec_read(ECRAM_MAJOR_VERSION) << 8) | ec_read(ECRAM_MINOR_VERSION); @@ -50,9 +53,8 @@
const uint16_t chip_id = ec_get_chip_id(dev->path.pnp.port);
- if (chip_id != ITE_CHIPID_VAL) { - printk(BIOS_ERR, "ITE: Expected chip ID 0x%04x, but got 0x%04x instead.\n", - ITE_CHIPID_VAL, chip_id); + if (chip_id != ITE_IT5570 && chip_id != ITE_IT8987) { + printk(BIOS_ERR, "ITE: Unsupported chip ID 0x%04x.\n", chip_id); return; }
diff --git a/src/ec/starlabs/merlin/variants/apl/ecdefs.h b/src/ec/starlabs/merlin/variants/apl/ecdefs.h index 5cbe14e..e4857aa 100644 --- a/src/ec/starlabs/merlin/variants/apl/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/apl/ecdefs.h @@ -10,9 +10,6 @@ #ifndef _EC_STARLABS_APL_EC_DEFS_H #define _EC_STARLABS_APL_EC_DEFS_H
-/* IT8987 chip ID byte values. */ -#define ITE_CHIPID_VAL 0x8987 - /* EC RAM offsets. */ #define ECRAM_TRACKPAD_STATE 0x14 #define ECRAM_KBL_STATE 0x18 diff --git a/src/ec/starlabs/merlin/variants/glk/ecdefs.h b/src/ec/starlabs/merlin/variants/glk/ecdefs.h index b2e2f2f..c97e252 100644 --- a/src/ec/starlabs/merlin/variants/glk/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/glk/ecdefs.h @@ -10,9 +10,6 @@ #ifndef _EC_STARLABS_GLK_EC_DEFS_H #define _EC_STARLABS_GLK_EC_DEFS_H
-/* IT8987 chip ID byte values. */ -#define ITE_CHIPID_VAL 0x8987 - /* EC RAM offsets. */ #define ECRAM_TRACKPAD_STATE 0x14 #define ECRAM_KBL_STATE 0x19 diff --git a/src/ec/starlabs/merlin/variants/kbl/ecdefs.h b/src/ec/starlabs/merlin/variants/kbl/ecdefs.h index 8f3355d..deda3ae 100644 --- a/src/ec/starlabs/merlin/variants/kbl/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/kbl/ecdefs.h @@ -10,9 +10,6 @@ #ifndef _EC_STARLABS_KBL_EC_DEFS_H #define _EC_STARLABS_KBL_EC_DEFS_H
-/* IT8987 chip ID byte values */ -#define ITE_CHIPID_VAL 0x8987 - /* EC RAM offsets */ #define ECRAM_TRACKPAD_STATE 0x14 #define ECRAM_KBL_STATE 0x18 diff --git a/src/ec/starlabs/merlin/variants/merlin/ecdefs.h b/src/ec/starlabs/merlin/variants/merlin/ecdefs.h index 832f9c78..d5caf8a 100644 --- a/src/ec/starlabs/merlin/variants/merlin/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/merlin/ecdefs.h @@ -10,9 +10,6 @@ #ifndef _EC_STARLABS_MERLIN_EC_DEFS_H #define _EC_STARLABS_MERLIN_EC_DEFS_H
-/* IT5570 chip ID byte values */ -#define ITE_CHIPID_VAL 0x5570 - /* EC RAM offsets */ #define ECRAM_KBL_BRIGHTNESS 0x09 #define ECRAM_KBL_TIMEOUT 0x10