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

Commit 09e63e25 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add support for loading legacy GMU firmware"

parents bd97dbaf 1de583f1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -460,7 +460,8 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.minor = 8,
		.patchid = ANY_ID,
		.features = ADRENO_64BIT | ADRENO_CONTENT_PROTECTION |
			ADRENO_IOCOHERENT | ADRENO_PREEMPTION | ADRENO_GPMU,
			ADRENO_IOCOHERENT | ADRENO_PREEMPTION | ADRENO_GPMU |
			ADRENO_IFPC,
		.sqefw_name = "a630_sqe.fw",
		.zap_name = "a608_zap",
		.gpudev = &adreno_a6xx_gpudev,
+23 −0
Original line number Diff line number Diff line
@@ -452,6 +452,25 @@ static int a6xx_rpmh_power_off_gpu(struct kgsl_device *device)
	return 0;
}

static int _load_legacy_gmu_fw(struct kgsl_device *device,
	struct gmu_device *gmu)
{
	const struct firmware *fw = gmu->fw_image;
	u32 *fwptr = (u32 *)fw->data;
	int i;

	if (fw->size > MAX_GMUFW_SIZE)
		return -EINVAL;

	for (i = 0; i < (fw->size >> 2); i++)
		gmu_core_regwrite(device,
			A6XX_GMU_CM3_ITCM_START + i, fwptr[i]);

	/* Proceed only after the FW is written */
	wmb();
	return 0;
}

static int load_gmu_fw(struct kgsl_device *device)
{
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
@@ -461,6 +480,10 @@ static int load_gmu_fw(struct kgsl_device *device)
	struct gmu_block_header *blk;
	struct gmu_memdesc *md;

	if (adreno_is_a630(ADRENO_DEVICE(device)) ||
		adreno_is_a615_family(ADRENO_DEVICE(device)))
		return _load_legacy_gmu_fw(device, gmu);

	while (fw < (uint8_t *)gmu->fw_image->data + gmu->fw_image->size) {
		blk = (struct gmu_block_header *)fw;
		fw += sizeof(*blk);
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include <linux/firmware.h>
#include "kgsl_hfi.h"

#define MAX_GMUFW_SIZE	0x2000	/* in bytes */
#define MAX_GMUFW_SIZE	0x8000	/* in bytes */

#define BWMEM_SIZE	(12 + (4 * NUM_BW_LEVELS))	/*in bytes*/

+6 −2
Original line number Diff line number Diff line
@@ -104,8 +104,12 @@ bool gmu_core_scales_bandwidth(struct kgsl_device *device)
{
	if (device->gmu_core.type == GMU_CORE_TYPE_PCC)
		return false;
	else
		return gmu_core_gpmu_isenabled(device);
	else {
		struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

		return gmu_core_gpmu_isenabled(device) &&
			   (ADRENO_GPUREV(adreno_dev) >= ADRENO_REV_A640);
	}
}

int gmu_core_start(struct kgsl_device *device)