Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/etnaviv: determine product, customer and eco id

They will be used for extended HWDB support.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

authored by

Christian Gmeiner and committed by
Lucas Stach
815e45bb 8ed226ff

+13 -4
+10 -1
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 333 333 gpu->identity.revision = etnaviv_field(chipIdentity, 334 334 VIVS_HI_CHIP_IDENTITY_REVISION); 335 335 } else { 336 + u32 chipDate = gpu_read(gpu, VIVS_HI_CHIP_DATE); 336 337 337 338 gpu->identity.model = gpu_read(gpu, VIVS_HI_CHIP_MODEL); 338 339 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); 339 343 340 344 /* 341 345 * !!!! HACK ALERT !!!! ··· 354 350 355 351 /* Another special case */ 356 352 if (etnaviv_is_model_rev(gpu, GC300, 0x2201)) { 357 - u32 chipDate = gpu_read(gpu, VIVS_HI_CHIP_DATE); 358 353 u32 chipTime = gpu_read(gpu, VIVS_HI_CHIP_TIME); 359 354 360 355 if (chipDate == 0x20080814 && chipTime == 0x12051100) { ··· 376 373 gpu->identity.model = chipModel_GC3000; 377 374 gpu->identity.revision &= 0xffff; 378 375 } 376 + 377 + if (etnaviv_is_model_rev(gpu, GC1000, 0x5037) && (chipDate == 0x20120617)) 378 + gpu->identity.eco_id = 1; 379 + 380 + if (etnaviv_is_model_rev(gpu, GC320, 0x5303) && (chipDate == 0x20140511)) 381 + gpu->identity.eco_id = 1; 379 382 } 380 383 381 384 dev_info(gpu->dev, "model: GC%x, revision: %x\n",
+3 -3
drivers/gpu/drm/etnaviv/etnaviv_gpu.h
··· 15 15 struct etnaviv_vram_mapping; 16 16 17 17 struct etnaviv_chip_identity { 18 - /* Chip model. */ 19 18 u32 model; 20 - 21 - /* Revision value.*/ 22 19 u32 revision; 20 + u32 product_id; 21 + u32 customer_id; 22 + u32 eco_id; 23 23 24 24 /* Supported feature fields. */ 25 25 u32 features;