Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add DMUB support for DCN316

Initialize DMUB for DCN316. Use same funcs as DCN31 for
DCN316.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Prike Liang <Prike.Liang@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Leo Li and committed by
Alex Deucher
868f4357 de7cc1b4

+103 -1
+1 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1920 1920 fw_name_dmub = FIRMWARE_YELLOW_CARP_DMUB; 1921 1921 break; 1922 1922 case IP_VERSION(3, 1, 6): 1923 - dmub_asic = DMUB_ASIC_DCN31B; 1923 + dmub_asic = DMUB_ASIC_DCN316; 1924 1924 fw_name_dmub = FIRMWARE_DCN316_DMUB; 1925 1925 break; 1926 1926
+1
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 98 98 DMUB_ASIC_DCN303, 99 99 DMUB_ASIC_DCN31, 100 100 DMUB_ASIC_DCN31B, 101 + DMUB_ASIC_DCN316, 101 102 DMUB_ASIC_MAX, 102 103 }; 103 104
+2
drivers/gpu/drm/amd/display/dmub/src/Makefile
··· 22 22 23 23 DMUB = dmub_srv.o dmub_srv_stat.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o 24 24 DMUB += dmub_dcn30.o dmub_dcn301.o dmub_dcn302.o dmub_dcn303.o 25 + 25 26 DMUB += dmub_dcn31.o 27 + DMUB += dmub_dcn316.o 26 28 27 29 AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB)) 28 30
+62
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn316.c
··· 1 + /* 2 + * Copyright 2021 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + * Authors: AMD 23 + * 24 + */ 25 + 26 + #include "../dmub_srv.h" 27 + #include "dmub_reg.h" 28 + #include "dmub_dcn316.h" 29 + 30 + #include "dcn/dcn_3_1_6_offset.h" 31 + #include "dcn/dcn_3_1_6_sh_mask.h" 32 + 33 + #define DCN_BASE__INST0_SEG0 0x00000012 34 + #define DCN_BASE__INST0_SEG1 0x000000C0 35 + #define DCN_BASE__INST0_SEG2 0x000034C0 36 + #define DCN_BASE__INST0_SEG3 0x00009000 37 + #define DCN_BASE__INST0_SEG4 0x02403C00 38 + #define DCN_BASE__INST0_SEG5 0 39 + 40 + #define BASE_INNER(seg) DCN_BASE__INST0_SEG##seg 41 + #define CTX dmub 42 + #define REGS dmub->regs_dcn31 43 + #define REG_OFFSET_EXP(reg_name) (BASE(reg##reg_name##_BASE_IDX) + reg##reg_name) 44 + 45 + /* Registers. */ 46 + 47 + const struct dmub_srv_dcn31_regs dmub_srv_dcn316_regs = { 48 + #define DMUB_SR(reg) REG_OFFSET_EXP(reg), 49 + { 50 + DMUB_DCN31_REGS() 51 + DMCUB_INTERNAL_REGS() 52 + }, 53 + #undef DMUB_SR 54 + 55 + #define DMUB_SF(reg, field) FD_MASK(reg, field), 56 + { DMUB_DCN31_FIELDS() }, 57 + #undef DMUB_SF 58 + 59 + #define DMUB_SF(reg, field) FD_SHIFT(reg, field), 60 + { DMUB_DCN31_FIELDS() }, 61 + #undef DMUB_SF 62 + };
+33
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn316.h
··· 1 + /* 2 + * Copyright 2021 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + * Authors: AMD 23 + * 24 + */ 25 + 26 + #ifndef _DMUB_DCN316_H_ 27 + #define _DMUB_DCN316_H_ 28 + 29 + #include "dmub_dcn31.h" 30 + 31 + extern const struct dmub_srv_dcn31_regs dmub_srv_dcn316_regs; 32 + 33 + #endif /* _DMUB_DCN316_H_ */
+4
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
··· 32 32 #include "dmub_dcn302.h" 33 33 #include "dmub_dcn303.h" 34 34 #include "dmub_dcn31.h" 35 + #include "dmub_dcn316.h" 35 36 #include "os_types.h" 36 37 /* 37 38 * Note: the DMUB service is standalone. No additional headers should be ··· 221 220 222 221 case DMUB_ASIC_DCN31: 223 222 case DMUB_ASIC_DCN31B: 223 + case DMUB_ASIC_DCN316: 224 224 dmub->regs_dcn31 = &dmub_srv_dcn31_regs; 225 + if (asic == DMUB_ASIC_DCN316) 226 + dmub->regs_dcn31 = &dmub_srv_dcn316_regs; 225 227 funcs->reset = dmub_dcn31_reset; 226 228 funcs->reset_release = dmub_dcn31_reset_release; 227 229 funcs->backdoor_load = dmub_dcn31_backdoor_load;