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

Commit 0e3e0a05 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 18c8f350 47b3796d
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -459,6 +459,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);
@@ -468,6 +487,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
@@ -18,7 +18,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*/