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

Commit d30a3f40 authored by Shrenuj Bansal's avatar Shrenuj Bansal Committed by Matt Wagantall
Browse files

msm: kgsl: Add support to load the zap shader firmware for A530



Use the PIL loader API subsystem_get() to get the zap shader
ucode authorized and protected.

Change-Id: I1de22220547441a0afa4d38606fef2a2d943b1a2
Signed-off-by: default avatarShrenuj Bansal <shrenujb@codeaurora.org>
parent ea68740e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.features = ADRENO_GPMU | ADRENO_SPTP_PC,
		.pm4fw_name = "a530_pm4.fw",
		.pfpfw_name = "a530_pfp.fw",
		.zap_name = "a530_zap",
		.gpudev = &adreno_a5xx_gpudev,
		.gmem_size = SZ_1M,
		.num_protected_regs = 0x20,
+2 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ struct adreno_busy_data {
 * @features: Common adreno features supported by this core
 * @pm4fw_name: Filename for th PM4 firmware
 * @pfpfw_name: Filename for the PFP firmware
 * @zap_name: Filename for the Zap Shader ucode
 * @gpudev: Pointer to the GPU family specific functions for this core
 * @gmem_size: Amount of binning memory (GMEM/OCMEM) to reserve for the core
 * @pm4_jt_idx: Index of the jump table in the PM4 microcode
@@ -208,6 +209,7 @@ struct adreno_gpu_core {
	unsigned long features;
	const char *pm4fw_name;
	const char *pfpfw_name;
	const char *zap_name;
	struct adreno_gpudev *gpudev;
	size_t gmem_size;
	unsigned int pm4_jt_idx;
+15 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
 *
 */
#include <linux/firmware.h>
#include <soc/qcom/subsystem_restart.h>

#include "adreno.h"
#include "a5xx_reg.h"
@@ -24,6 +25,8 @@
#include "kgsl_log.h"
#include "kgsl.h"

static int zap_ucode_loaded;

void a5xx_snapshot(struct adreno_device *adreno_dev,
		struct kgsl_snapshot *snapshot);

@@ -1178,6 +1181,7 @@ int a5xx_microcode_read(struct adreno_device *adreno_dev)
int a5xx_microcode_load(struct adreno_device *adreno_dev,
						unsigned int start_type)
{
	void *ptr;
	struct kgsl_device *device = &adreno_dev->dev;
	uint64_t gpuaddr;

@@ -1193,6 +1197,17 @@ int a5xx_microcode_load(struct adreno_device *adreno_dev,
	kgsl_regwrite(device, A5XX_CP_PFP_INSTR_BASE_HI,
				((uint64_t)(gpuaddr) >> 32));

	/* Load the zap shader firmware through PIL if its available */
	if (adreno_dev->gpucore->zap_name && !zap_ucode_loaded) {
		ptr = subsystem_get(adreno_dev->gpucore->zap_name);

		/* Disable content protecttion if the above call fails */
		if (IS_ERR_OR_NULL(ptr))
			device->mmu.secured = false;

		zap_ucode_loaded = 1;
	}

	return 0;
}