linux/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c

/*
 * Copyright 2014 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/module.h>

#include "amdgpu.h"
#include "amdgpu_ucode.h"

#define AMDGPU_UCODE_NAME_MAX

static void amdgpu_ucode_print_common_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_gfx_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_rlc_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
{}

void amdgpu_ucode_print_gpu_info_hdr(const struct common_firmware_header *hdr)
{}

static int amdgpu_ucode_validate(const struct firmware *fw)
{}

bool amdgpu_ucode_hdr_version(union amdgpu_firmware_header *hdr,
				uint16_t hdr_major, uint16_t hdr_minor)
{}

enum amdgpu_firmware_load_type
amdgpu_ucode_get_load_type(struct amdgpu_device *adev, int load_type)
{}

const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id)
{}

static inline int amdgpu_ucode_is_valid(uint32_t fw_version)
{}

#define FW_VERSION_ATTR(name, mode, field)

FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();
FW_VERSION_ATTR();

static struct attribute *fw_attrs[] =;

#define to_dev_attr(x)

static umode_t amdgpu_ucode_sys_visible(struct kobject *kobj,
					struct attribute *attr, int idx)
{}

static const struct attribute_group fw_attr_group =;

int amdgpu_ucode_sysfs_init(struct amdgpu_device *adev)
{}

void amdgpu_ucode_sysfs_fini(struct amdgpu_device *adev)
{}

static int amdgpu_ucode_init_single_fw(struct amdgpu_device *adev,
				       struct amdgpu_firmware_info *ucode,
				       uint64_t mc_addr, void *kptr)
{}

static int amdgpu_ucode_patch_jt(struct amdgpu_firmware_info *ucode,
				uint64_t mc_addr, void *kptr)
{}

int amdgpu_ucode_create_bo(struct amdgpu_device *adev)
{}

void amdgpu_ucode_free_bo(struct amdgpu_device *adev)
{}

int amdgpu_ucode_init_bo(struct amdgpu_device *adev)
{}

static const char *amdgpu_ucode_legacy_naming(struct amdgpu_device *adev, int block_type)
{}

void amdgpu_ucode_ip_version_decode(struct amdgpu_device *adev, int block_type, char *ucode_prefix, int len)
{}

/*
 * amdgpu_ucode_request - Fetch and validate amdgpu microcode
 *
 * @adev: amdgpu device
 * @fw: pointer to load firmware to
 * @fmt: firmware name format string
 * @...: variable arguments
 *
 * This is a helper that will use request_firmware and amdgpu_ucode_validate
 * to load and run basic validation on firmware. If the load fails, remap
 * the error code to -ENODEV, so that early_init functions will fail to load.
 */
int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw,
			 const char *fmt, ...)
{}

/*
 * amdgpu_ucode_release - Release firmware microcode
 *
 * @fw: pointer to firmware to release
 */
void amdgpu_ucode_release(const struct firmware **fw)
{}