Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8fe0d26 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Program the secvid registers in the soft reset path



The secure buffer registers were not being programmed in the soft
reset path which was causing a failure for the critical packets
workaround and forcing a hard reset.

Change-Id: Ic0dedbad998767a1ffdfe265e52fae7baa18d203
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 8974a108
Loading
Loading
Loading
Loading
+25 −16
Original line number Diff line number Diff line
@@ -1312,6 +1312,28 @@ static void _update_threshold_count(struct adreno_device *adreno_dev,
		adreno_dev->lm_threshold_cross = adj;
}

static void _set_secvid(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	/* Program GPU contect protection init values */
	if (device->mmu.secured) {
		if (adreno_is_a4xx(adreno_dev))
			adreno_writereg(adreno_dev,
				ADRENO_REG_RBBM_SECVID_TRUST_CONFIG, 0x2);
		adreno_writereg(adreno_dev,
				ADRENO_REG_RBBM_SECVID_TSB_CONTROL, 0x0);

		adreno_writereg64(adreno_dev,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_BASE,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_BASE_HI,
			KGSL_IOMMU_SECURE_BASE);
		adreno_writereg(adreno_dev,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_SIZE,
			KGSL_IOMMU_SECURE_SIZE);
	}
}

/**
 * _adreno_start - Power up the GPU and prepare to accept commands
 * @adreno_dev: Pointer to an adreno_device structure
@@ -1358,22 +1380,7 @@ static int _adreno_start(struct adreno_device *adreno_dev)
	if (status)
		goto error_pwr_off;

	/* Program GPU contect protection init values */
	if (device->mmu.secured) {
		if (adreno_is_a4xx(adreno_dev))
			adreno_writereg(adreno_dev,
				ADRENO_REG_RBBM_SECVID_TRUST_CONFIG, 0x2);
		adreno_writereg(adreno_dev,
				ADRENO_REG_RBBM_SECVID_TSB_CONTROL, 0x0);

		adreno_writereg64(adreno_dev,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_BASE,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_BASE_HI,
			KGSL_IOMMU_SECURE_BASE);
		adreno_writereg(adreno_dev,
			ADRENO_REG_RBBM_SECVID_TSB_TRUSTED_SIZE,
			KGSL_IOMMU_SECURE_SIZE);
	}
	_set_secvid(device);

	status = adreno_ocmem_malloc(adreno_dev);
	if (status) {
@@ -2132,6 +2139,8 @@ static int adreno_soft_reset(struct kgsl_device *device)
	/* start of new CFF after reset */
	kgsl_cffdump_open(device);

	_set_secvid(device);

	/* Enable 64 bit gpu addr if feature is set */
	if (gpudev->enable_64bit &&
			adreno_support_64bit(adreno_dev))