Skip to content

Commit d3b68dd

Browse files
shawnguo2robclark
authored andcommitted
drm/msm/a4xx: add a405_registers for a405 device
A405 device has a different set of registers than a4xx_registers. It has no VMIDMT or XPU registers, and VBIF registers are different. Let's add a405_registers for a405 device. As adreno_is_a405() works only after adreno_gpu_init() gets called, the assignments get moved down after adreno_gpu_init(). Signed-off-by: Shawn Guo <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent dc0fa5e commit d3b68dd

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

drivers/gpu/drm/msm/adreno/a4xx_gpu.c

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,52 @@ static const unsigned int a4xx_registers[] = {
445445
~0 /* sentinel */
446446
};
447447

448+
static const unsigned int a405_registers[] = {
449+
/* RBBM */
450+
0x0000, 0x0002, 0x0004, 0x0021, 0x0023, 0x0024, 0x0026, 0x0026,
451+
0x0028, 0x002B, 0x002E, 0x0034, 0x0037, 0x0044, 0x0047, 0x0066,
452+
0x0068, 0x0095, 0x009C, 0x0170, 0x0174, 0x01AF,
453+
/* CP */
454+
0x0200, 0x0233, 0x0240, 0x0250, 0x04C0, 0x04DD, 0x0500, 0x050B,
455+
0x0578, 0x058F,
456+
/* VSC */
457+
0x0C00, 0x0C03, 0x0C08, 0x0C41, 0x0C50, 0x0C51,
458+
/* GRAS */
459+
0x0C80, 0x0C81, 0x0C88, 0x0C8F,
460+
/* RB */
461+
0x0CC0, 0x0CC0, 0x0CC4, 0x0CD2,
462+
/* PC */
463+
0x0D00, 0x0D0C, 0x0D10, 0x0D17, 0x0D20, 0x0D23,
464+
/* VFD */
465+
0x0E40, 0x0E4A,
466+
/* VPC */
467+
0x0E60, 0x0E61, 0x0E63, 0x0E68,
468+
/* UCHE */
469+
0x0E80, 0x0E84, 0x0E88, 0x0E95,
470+
/* GRAS CTX 0 */
471+
0x2000, 0x2004, 0x2008, 0x2067, 0x2070, 0x2078, 0x207B, 0x216E,
472+
/* PC CTX 0 */
473+
0x21C0, 0x21C6, 0x21D0, 0x21D0, 0x21D9, 0x21D9, 0x21E5, 0x21E7,
474+
/* VFD CTX 0 */
475+
0x2200, 0x2204, 0x2208, 0x22A9,
476+
/* GRAS CTX 1 */
477+
0x2400, 0x2404, 0x2408, 0x2467, 0x2470, 0x2478, 0x247B, 0x256E,
478+
/* PC CTX 1 */
479+
0x25C0, 0x25C6, 0x25D0, 0x25D0, 0x25D9, 0x25D9, 0x25E5, 0x25E7,
480+
/* VFD CTX 1 */
481+
0x2600, 0x2604, 0x2608, 0x26A9,
482+
/* VBIF version 0x20050000*/
483+
0x3000, 0x3007, 0x302C, 0x302C, 0x3030, 0x3030, 0x3034, 0x3036,
484+
0x3038, 0x3038, 0x303C, 0x303D, 0x3040, 0x3040, 0x3049, 0x3049,
485+
0x3058, 0x3058, 0x305B, 0x3061, 0x3064, 0x3068, 0x306C, 0x306D,
486+
0x3080, 0x3088, 0x308B, 0x308C, 0x3090, 0x3094, 0x3098, 0x3098,
487+
0x309C, 0x309C, 0x30C0, 0x30C0, 0x30C8, 0x30C8, 0x30D0, 0x30D0,
488+
0x30D8, 0x30D8, 0x30E0, 0x30E0, 0x3100, 0x3100, 0x3108, 0x3108,
489+
0x3110, 0x3110, 0x3118, 0x3118, 0x3120, 0x3120, 0x3124, 0x3125,
490+
0x3129, 0x3129, 0x340C, 0x340C, 0x3410, 0x3410,
491+
~0 /* sentinel */
492+
};
493+
448494
static struct msm_gpu_state *a4xx_gpu_state_get(struct msm_gpu *gpu)
449495
{
450496
struct msm_gpu_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
@@ -568,13 +614,14 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev)
568614
gpu->perfcntrs = NULL;
569615
gpu->num_perfcntrs = 0;
570616

571-
adreno_gpu->registers = a4xx_registers;
572-
adreno_gpu->reg_offsets = a4xx_register_offsets;
573-
574617
ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 1);
575618
if (ret)
576619
goto fail;
577620

621+
adreno_gpu->registers = adreno_is_a405(adreno_gpu) ? a405_registers :
622+
a4xx_registers;
623+
adreno_gpu->reg_offsets = a4xx_register_offsets;
624+
578625
/* if needed, allocate gmem: */
579626
if (adreno_is_a4xx(adreno_gpu)) {
580627
ret = adreno_gpu_ocmem_init(dev->dev, adreno_gpu,

0 commit comments

Comments
 (0)