summaryrefslogtreecommitdiff
path: root/src/ec/starlabs/merlin/ite.c
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2024-03-26 09:09:22 +0000
committerFelix Held <felix-coreboot@felixheld.de>2024-09-10 13:41:16 +0000
commitc4a6eb09f98d59bed375e653de4d91a85ebe8098 (patch)
treefc28337ad45d1b89fb1aa9c24dfcae2d461d1760 /src/ec/starlabs/merlin/ite.c
parentd380ca64d04c39055988c0dac2ea00e2b67a794a (diff)
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>
Diffstat (limited to 'src/ec/starlabs/merlin/ite.c')
-rw-r--r--src/ec/starlabs/merlin/ite.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ec/starlabs/merlin/ite.c b/src/ec/starlabs/merlin/ite.c
index 031447a716..2f8bced324 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 @@ static void merlin_init(struct device *dev)
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;
}