Skip to content

Commit 815e45b

Browse files
austriancoderlynxeye-dev
authored andcommitted
drm/etnaviv: determine product, customer and eco id
They will be used for extended HWDB support. Signed-off-by: Christian Gmeiner <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent 8ed226f commit 815e45b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,13 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
333333
gpu->identity.revision = etnaviv_field(chipIdentity,
334334
VIVS_HI_CHIP_IDENTITY_REVISION);
335335
} else {
336+
u32 chipDate = gpu_read(gpu, VIVS_HI_CHIP_DATE);
336337

337338
gpu->identity.model = gpu_read(gpu, VIVS_HI_CHIP_MODEL);
338339
gpu->identity.revision = gpu_read(gpu, VIVS_HI_CHIP_REV);
340+
gpu->identity.product_id = gpu_read(gpu, VIVS_HI_CHIP_PRODUCT_ID);
341+
gpu->identity.customer_id = gpu_read(gpu, VIVS_HI_CHIP_CUSTOMER_ID);
342+
gpu->identity.eco_id = gpu_read(gpu, VIVS_HI_CHIP_ECO_ID);
339343

340344
/*
341345
* !!!! HACK ALERT !!!!
@@ -350,7 +354,6 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
350354

351355
/* Another special case */
352356
if (etnaviv_is_model_rev(gpu, GC300, 0x2201)) {
353-
u32 chipDate = gpu_read(gpu, VIVS_HI_CHIP_DATE);
354357
u32 chipTime = gpu_read(gpu, VIVS_HI_CHIP_TIME);
355358

356359
if (chipDate == 0x20080814 && chipTime == 0x12051100) {
@@ -373,6 +376,12 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
373376
gpu->identity.model = chipModel_GC3000;
374377
gpu->identity.revision &= 0xffff;
375378
}
379+
380+
if (etnaviv_is_model_rev(gpu, GC1000, 0x5037) && (chipDate == 0x20120617))
381+
gpu->identity.eco_id = 1;
382+
383+
if (etnaviv_is_model_rev(gpu, GC320, 0x5303) && (chipDate == 0x20140511))
384+
gpu->identity.eco_id = 1;
376385
}
377386

378387
dev_info(gpu->dev, "model: GC%x, revision: %x\n",

drivers/gpu/drm/etnaviv/etnaviv_gpu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ struct etnaviv_gem_submit;
1515
struct etnaviv_vram_mapping;
1616

1717
struct etnaviv_chip_identity {
18-
/* Chip model. */
1918
u32 model;
20-
21-
/* Revision value.*/
2219
u32 revision;
20+
u32 product_id;
21+
u32 customer_id;
22+
u32 eco_id;
2323

2424
/* Supported feature fields. */
2525
u32 features;

0 commit comments

Comments
 (0)