/* * Copyright 2014 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. * Copyright 2009 Jerome Glisse. * * 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 "amdgpu.h" #include "amdgpu_gfx.h" #include "amdgpu_rlc.h" /** * amdgpu_gfx_rlc_enter_safe_mode - Set RLC into safe mode * * @adev: amdgpu_device pointer * @xcc_id: xcc accelerated compute core id * * Set RLC enter into safe mode if RLC is enabled and haven't in safe mode. */ void amdgpu_gfx_rlc_enter_safe_mode(struct amdgpu_device *adev, int xcc_id) { … } /** * amdgpu_gfx_rlc_exit_safe_mode - Set RLC out of safe mode * * @adev: amdgpu_device pointer * @xcc_id: xcc accelerated compute core id * * Set RLC exit safe mode if RLC is enabled and have entered into safe mode. */ void amdgpu_gfx_rlc_exit_safe_mode(struct amdgpu_device *adev, int xcc_id) { … } /** * amdgpu_gfx_rlc_init_sr - Init save restore block * * @adev: amdgpu_device pointer * @dws: the size of save restore block * * Allocate and setup value to save restore block of rlc. * Returns 0 on succeess or negative error code if allocate failed. */ int amdgpu_gfx_rlc_init_sr(struct amdgpu_device *adev, u32 dws) { … } /** * amdgpu_gfx_rlc_init_csb - Init clear state block * * @adev: amdgpu_device pointer * * Allocate and setup value to clear state block of rlc. * Returns 0 on succeess or negative error code if allocate failed. */ int amdgpu_gfx_rlc_init_csb(struct amdgpu_device *adev) { … } /** * amdgpu_gfx_rlc_init_cpt - Init cp table * * @adev: amdgpu_device pointer * * Allocate and setup value to cp table of rlc. * Returns 0 on succeess or negative error code if allocate failed. */ int amdgpu_gfx_rlc_init_cpt(struct amdgpu_device *adev) { … } /** * amdgpu_gfx_rlc_setup_cp_table - setup cp the buffer of cp table * * @adev: amdgpu_device pointer * * Write cp firmware data into cp table. */ void amdgpu_gfx_rlc_setup_cp_table(struct amdgpu_device *adev) { … } /** * amdgpu_gfx_rlc_fini - Free BO which used for RLC * * @adev: amdgpu_device pointer * * Free three BO which is used for rlc_save_restore_block, rlc_clear_state_block * and rlc_jump_table_block. */ void amdgpu_gfx_rlc_fini(struct amdgpu_device *adev) { … } static int amdgpu_gfx_rlc_init_microcode_v2_0(struct amdgpu_device *adev) { … } static void amdgpu_gfx_rlc_init_microcode_v2_1(struct amdgpu_device *adev) { … } static void amdgpu_gfx_rlc_init_microcode_v2_2(struct amdgpu_device *adev) { … } static void amdgpu_gfx_rlc_init_microcode_v2_3(struct amdgpu_device *adev) { … } static void amdgpu_gfx_rlc_init_microcode_v2_4(struct amdgpu_device *adev) { … } int amdgpu_gfx_rlc_init_microcode(struct amdgpu_device *adev, uint16_t version_major, uint16_t version_minor) { … }