xref: /openbmc/linux/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1a5bde2f9SAlex Deucher /*
2a5bde2f9SAlex Deucher  * Copyright 2014 Advanced Micro Devices, Inc.
3a5bde2f9SAlex Deucher  *
4a5bde2f9SAlex Deucher  * Permission is hereby granted, free of charge, to any person obtaining a
5a5bde2f9SAlex Deucher  * copy of this software and associated documentation files (the "Software"),
6a5bde2f9SAlex Deucher  * to deal in the Software without restriction, including without limitation
7a5bde2f9SAlex Deucher  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8a5bde2f9SAlex Deucher  * and/or sell copies of the Software, and to permit persons to whom the
9a5bde2f9SAlex Deucher  * Software is furnished to do so, subject to the following conditions:
10a5bde2f9SAlex Deucher  *
11a5bde2f9SAlex Deucher  * The above copyright notice and this permission notice shall be included in
12a5bde2f9SAlex Deucher  * all copies or substantial portions of the Software.
13a5bde2f9SAlex Deucher  *
14a5bde2f9SAlex Deucher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15a5bde2f9SAlex Deucher  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16a5bde2f9SAlex Deucher  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17a5bde2f9SAlex Deucher  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18a5bde2f9SAlex Deucher  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19a5bde2f9SAlex Deucher  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20a5bde2f9SAlex Deucher  * OTHER DEALINGS IN THE SOFTWARE.
21a5bde2f9SAlex Deucher  *
22a5bde2f9SAlex Deucher  */
23a5bde2f9SAlex Deucher 
24a5bde2f9SAlex Deucher #ifndef __AMDGPU_ATOMFIRMWARE_H__
25a5bde2f9SAlex Deucher #define __AMDGPU_ATOMFIRMWARE_H__
26a5bde2f9SAlex Deucher 
27ae2e2013SHuang Rui #define get_index_into_master_table(master_table, table_name) (offsetof(struct master_table, table_name) / sizeof(uint16_t))
28ae2e2013SHuang Rui 
295968c6a2SHawking Zhang uint32_t amdgpu_atomfirmware_query_firmware_capability(struct amdgpu_device *adev);
3058ff791aSHawking Zhang bool amdgpu_atomfirmware_gpu_virtualization_supported(struct amdgpu_device *adev);
31a5bde2f9SAlex Deucher void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
32a5bde2f9SAlex Deucher int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
33631cdbd2SAlex Deucher int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
34ad02e08eSOri Messinger 	int *vram_width, int *vram_type, int *vram_vendor);
3579077ee1SAlex Deucher int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
3659b0b509SAlex Deucher int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
37511c4348SHawking Zhang bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
388b6da23fSHawking Zhang bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev);
3939932ef7SJohn Clements bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, uint8_t* i2c_address);
4082a52030SHawking Zhang bool amdgpu_atomfirmware_mem_training_supported(struct amdgpu_device *adev);
41cffd6f9dSHawking Zhang bool amdgpu_atomfirmware_dynamic_boot_config_supported(struct amdgpu_device *adev);
429a244ebeSHawking Zhang int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev);
43*ba75f6ebSHawking Zhang int amdgpu_atomfirmware_asic_init(struct amdgpu_device *adev, bool fb_reset);
44a5bde2f9SAlex Deucher 
45a5bde2f9SAlex Deucher #endif
46