/* * Copyright 2016 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 <drm/amdgpu_drm.h> #include "amdgpu.h" #include "atomfirmware.h" #include "amdgpu_atomfirmware.h" #include "atom.h" #include "atombios.h" #include "soc15_hw_ip.h" firmware_info; /* * Helper function to query firmware capability * * @adev: amdgpu_device pointer * * Return firmware_capability in firmwareinfo table on success or 0 if not */ uint32_t amdgpu_atomfirmware_query_firmware_capability(struct amdgpu_device *adev) { … } /* * Helper function to query gpu virtualizaiton capability * * @adev: amdgpu_device pointer * * Return true if gpu virtualization is supported or false if not */ bool amdgpu_atomfirmware_gpu_virtualization_supported(struct amdgpu_device *adev) { … } void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev) { … } static int amdgpu_atomfirmware_allocate_fb_v2_1(struct amdgpu_device *adev, struct vram_usagebyfirmware_v2_1 *fw_usage, int *usage_bytes) { … } static int amdgpu_atomfirmware_allocate_fb_v2_2(struct amdgpu_device *adev, struct vram_usagebyfirmware_v2_2 *fw_usage, int *usage_bytes) { … } int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) { … } igp_info; umc_info; vram_info; vram_module; static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev, int atom_mem_type) { … } int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, int *vram_width, int *vram_type, int *vram_vendor) { … } /* * Return true if vbios enabled ecc by default, if umc info table is available * or false if ecc is not enabled or umc info table is not available */ bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev) { … } /* * Helper function to query sram ecc capablity * * @adev: amdgpu_device pointer * * Return true if vbios supports sram ecc or false if not */ bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev) { … } /* * Helper function to query dynamic boot config capability * * @adev: amdgpu_device pointer * * Return true if vbios supports dynamic boot config or false if not */ bool amdgpu_atomfirmware_dynamic_boot_config_supported(struct amdgpu_device *adev) { … } /** * amdgpu_atomfirmware_ras_rom_addr -- Get the RAS EEPROM addr from VBIOS * @adev: amdgpu_device pointer * @i2c_address: pointer to u8; if not NULL, will contain * the RAS EEPROM address if the function returns true * * Return true if VBIOS supports RAS EEPROM address reporting, * else return false. If true and @i2c_address is not NULL, * will contain the RAS ROM address. */ bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, u8 *i2c_address) { … } smu_info; gfx_info; int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev) { … } int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev) { … } /* * Helper function to query two stage mem training capability * * @adev: amdgpu_device pointer * * Return true if two stage mem training is supported or false if not */ bool amdgpu_atomfirmware_mem_training_supported(struct amdgpu_device *adev) { … } int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev) { … } /* * Helper function to execute asic_init table * * @adev: amdgpu_device pointer * @fb_reset: flag to indicate whether fb is reset or not * * Return 0 if succeed, otherwise failed */ int amdgpu_atomfirmware_asic_init(struct amdgpu_device *adev, bool fb_reset) { … }