drm/msm: Come out of secure before executing GPMU initialization

There isn't any need to be in secure mode when executing the GPMU
initalization so swap out to eliminate it as a variable when
GPMU init goes broken.

Change-Id: Ic0dedbad07b8cde80e257f71999002e9cbc47c24
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
Jordan Crouse 2017-02-13 10:14:33 -07:00
parent 8b98ed8588
commit e5de360e6f
2 changed files with 13 additions and 10 deletions

View file

@ -744,10 +744,6 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
if (ret)
return ret;
ret = a5xx_power_init(gpu);
if (ret)
return ret;
/*
* Send a pipeline event stat to get misbehaving counters to start
* ticking correctly
@ -785,6 +781,12 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
gpu_write(gpu, REG_A5XX_RBBM_SECVID_TRUST_CNTL, 0x0);
}
/* Next, start the power */
ret = a5xx_power_init(gpu);
if (ret)
return ret;
/* Last step - yield the ringbuffer */
a5xx_preempt_start(gpu);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -250,8 +250,9 @@ static int a5xx_gpmu_init(struct msm_gpu *gpu)
gpu->funcs->flush(gpu, ring);
/* This is "fatal" because the CP is left in a bad state */
if (!a5xx_idle(gpu, ring)) {
DRM_ERROR("%s: Unable to load GPMU firmware. GPMU will not be active\n",
DRM_ERROR("%s: Unable to load GPMU firmwaren",
gpu->name);
return -EINVAL;
}
@ -268,18 +269,18 @@ static int a5xx_gpmu_init(struct msm_gpu *gpu)
* won't have advanced power collapse.
*/
if (spin_usecs(gpu, 25, REG_A5XX_GPMU_GENERAL_0, 0xFFFFFFFF,
0xBABEFACE))
0xBABEFACE)) {
DRM_ERROR("%s: GPMU firmware initialization timed out\n",
gpu->name);
return 0;
}
if (!adreno_is_a530(adreno_gpu)) {
u32 val = gpu_read(gpu, REG_A5XX_GPMU_GENERAL_1);
if (val) {
if (val)
DRM_ERROR("%s: GPMU firmare initialization failed: %d\n",
gpu->name, val);
return -EIO;
}
}
/* FIXME: Clear GPMU interrupts? */