From dea4b46f213da5109775331388acdf898ca2c2af Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Sun, 26 Jan 2025 16:02:39 +0100 Subject: [PATCH] etnaviv: hwdb: fix lookup of GC3000 in i.MX6QP For whatever reason NXP decided to call the GC3000 in the i.MX6QP a GC2000+. This being a lie is marked in the IP core by the upper half of the revision register being all ones. The kernel driver already fixes the model and revision when it encounters this core, but this breaks matching in the HWDB, which uses the bogus model/rev from the core. Revert the fixup done by the kernel for the lookup in the HWDB. Fixes: 2192e620bb0c ("etnaviv: hwdb: Add etna_query_feature_db(..)") Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/etnaviv/hwdb/etna_hwdb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/etnaviv/hwdb/etna_hwdb.c b/src/etnaviv/hwdb/etna_hwdb.c index 5db372f7fa9..3d7e50b5475 100644 --- a/src/etnaviv/hwdb/etna_hwdb.c +++ b/src/etnaviv/hwdb/etna_hwdb.c @@ -17,7 +17,18 @@ bool etna_query_feature_db(struct etna_core_info *info) { - gcsFEATURE_DATABASE *db = gcQueryFeatureDB(info->model, info->revision, info->product_id, + uint32_t model = info->model; + uint32_t revision = info->revision; + + /* More confusion due to NXP calling the GC3000 in the i.MX6QP a GC2000+: + * the kernel already fixes this up to the real model and revision, but + * to match the HWDB entry we must revert this fixup for the lookup. */ + if (model == 0x3000 && revision == 0x5450) { + model = 0x2000; + revision = 0xffff5450; + } + + gcsFEATURE_DATABASE *db = gcQueryFeatureDB(model, revision, info->product_id, info->eco_id, info->customer_id); if (!db)