// SPDX-License-Identifier: GPL-2.0-only OR MIT/* Copyright (c) 2023 Imagination Technologies Ltd. */#include"pvr_ccb.h"#include"pvr_device.h"#include"pvr_device_info.h"#include"pvr_fw.h"#include"pvr_fw_info.h"#include"pvr_fw_startstop.h"#include"pvr_fw_trace.h"#include"pvr_gem.h"#include"pvr_power.h"#include"pvr_rogue_fwif_dev_info.h"#include"pvr_rogue_heap_config.h"#include"pvr_vm.h"#include<drm/drm_drv.h>#include<drm/drm_managed.h>#include<drm/drm_mm.h>#include<drm/drm_print.h>#include<linux/clk.h>#include<linux/firmware.h>#include<linux/math.h>#include<linux/minmax.h>#include<linux/sizes.h>#define FW_MAX_SUPPORTED_MAJOR_VERSION 1#define FW_BOOT_TIMEOUT_USEC 5000000/* Config heap occupies top 192k of the firmware heap. */#define PVR_ROGUE_FW_CONFIG_HEAP_GRANULARITY SZ_64K#define PVR_ROGUE_FW_CONFIG_HEAP_SIZE (3 * PVR_ROGUE_FW_CONFIG_HEAP_GRANULARITY)/* Main firmware allocations should come from the remainder of the heap. */#define PVR_ROGUE_FW_MAIN_HEAP_BASE ROGUE_FW_HEAP_BASE/* Offsets from start of configuration area of FW heap. */#define PVR_ROGUE_FWIF_CONNECTION_CTL_OFFSET 0#define PVR_ROGUE_