1 | /* SPDX-License-Identifier: MIT */ |
2 | /* |
3 | * Copyright 2023 Advanced Micro Devices, Inc. |
4 | * |
5 | * Permission is hereby granted, free of charge, to any person obtaining a |
6 | * copy of this software and associated documentation files (the "Software"), |
7 | * to deal in the Software without restriction, including without limitation |
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
9 | * and/or sell copies of the Software, and to permit persons to whom the |
10 | * Software is furnished to do so, subject to the following conditions: |
11 | * |
12 | * The above copyright notice and this permission notice shall be included in |
13 | * all copies or substantial portions of the Software. |
14 | * |
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
19 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
21 | * OTHER DEALINGS IN THE SOFTWARE. |
22 | * |
23 | * Authors: AMD |
24 | * |
25 | */ |
26 | |
27 | #include "dcn35_mmhubbub.h" |
28 | #include "reg_helper.h" |
29 | |
30 | #define REG(reg) \ |
31 | ((const struct dcn35_mmhubbub_registers *)(mcif_wb30->mcif_wb_regs)) \ |
32 | ->reg |
33 | |
34 | #define CTX mcif_wb30->base.ctx |
35 | |
36 | #undef FN |
37 | #define FN(reg_name, field_name) \ |
38 | ((const struct dcn35_mmhubbub_shift *)(mcif_wb30->mcif_wb_shift)) \ |
39 | ->field_name, \ |
40 | ((const struct dcn35_mmhubbub_mask *)(mcif_wb30->mcif_wb_mask)) \ |
41 | ->field_name |
42 | |
43 | void dcn35_mmhubbub_construct( |
44 | struct dcn30_mmhubbub *mcif_wb30, struct dc_context *ctx, |
45 | const struct dcn35_mmhubbub_registers *mcif_wb_regs, |
46 | const struct dcn35_mmhubbub_shift *mcif_wb_shift, |
47 | const struct dcn35_mmhubbub_mask *mcif_wb_mask, int inst) |
48 | { |
49 | dcn32_mmhubbub_construct( |
50 | mcif_wb30, ctx, |
51 | mcif_wb_regs: (const struct dcn30_mmhubbub_registers *)(mcif_wb_regs), |
52 | mcif_wb_shift: (const struct dcn30_mmhubbub_shift *)(mcif_wb_shift), |
53 | mcif_wb_mask: (const struct dcn30_mmhubbub_mask *)(mcif_wb_mask), inst); |
54 | } |
55 | |
56 | void dcn35_mmhubbub_set_fgcg(struct dcn30_mmhubbub *mcif_wb30, bool enabled) |
57 | { |
58 | REG_UPDATE(MMHUBBUB_CLOCK_CNTL, MMHUBBUB_FGCG_REP_DIS, !enabled); |
59 | } |
60 | |