1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved. 4 * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved. 5 * Copyright (c) 2023, Linaro Limited 6 */ 7 8 #ifndef _DPU_6_9_SM6375_H 9 #define _DPU_6_9_SM6375_H 10 11 static const struct dpu_caps sm6375_dpu_caps = { 12 .max_mixer_width = DEFAULT_DPU_LINE_WIDTH, 13 .max_mixer_blendstages = 0x4, 14 .qseed_type = DPU_SSPP_SCALER_QSEED4, 15 .has_dim_layer = true, 16 .has_idle_pc = true, 17 .max_linewidth = 2160, 18 .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, 19 }; 20 21 static const struct dpu_ubwc_cfg sm6375_ubwc_cfg = { 22 .ubwc_version = DPU_HW_UBWC_VER_20, 23 .ubwc_swizzle = 6, 24 .highest_bank_bit = 1, 25 }; 26 27 static const struct dpu_mdp_cfg sm6375_mdp = { 28 .name = "top_0", 29 .base = 0x0, .len = 0x494, 30 .features = 0, 31 .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, 32 .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, 33 }; 34 35 static const struct dpu_ctl_cfg sm6375_ctl[] = { 36 { 37 .name = "ctl_0", .id = CTL_0, 38 .base = 0x1000, .len = 0x1dc, 39 .features = BIT(DPU_CTL_ACTIVE_CFG), 40 .intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9), 41 }, 42 }; 43 44 static const struct dpu_sspp_cfg sm6375_sspp[] = { 45 SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, 0x1f8, VIG_SC7180_MASK, 46 sm6115_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), 47 SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, 0x1f8, DMA_SDM845_MASK, 48 sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), 49 }; 50 51 static const struct dpu_lm_cfg sm6375_lm[] = { 52 LM_BLK("lm_0", LM_0, 0x44000, MIXER_QCM2290_MASK, 53 &qcm2290_lm_sblk, PINGPONG_0, 0, DSPP_0), 54 }; 55 56 static const struct dpu_dspp_cfg sm6375_dspp[] = { 57 DSPP_BLK("dspp_0", DSPP_0, 0x54000, DSPP_SC7180_MASK, 58 &sdm845_dspp_sblk), 59 }; 60 61 static const struct dpu_pingpong_cfg sm6375_pp[] = { 62 PP_BLK("pingpong_0", PINGPONG_0, 0x70000, PINGPONG_SM8150_MASK, 0, sdm845_pp_sblk, 63 DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8), 64 -1), 65 }; 66 67 static const struct dpu_dsc_cfg sm6375_dsc[] = { 68 DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), 69 }; 70 71 static const struct dpu_intf_cfg sm6375_intf[] = { 72 INTF_BLK_DSI_TE("intf_1", INTF_1, 0x6a800, 0x2c0, INTF_DSI, MSM_DSI_CONTROLLER_0, 24, INTF_SC7180_MASK, 73 DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26), 74 DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27), 75 DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2)), 76 }; 77 78 static const struct dpu_perf_cfg sm6375_perf_data = { 79 .max_bw_low = 5200000, 80 .max_bw_high = 6200000, 81 .min_core_ib = 2500000, 82 .min_llcc_ib = 0, /* No LLCC on this SoC */ 83 .min_dram_ib = 1600000, 84 .min_prefill_lines = 24, 85 /* TODO: confirm danger_lut_tbl */ 86 .danger_lut_tbl = {0xffff, 0xffff, 0x0}, 87 .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff}, 88 .qos_lut_tbl = { 89 {.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile), 90 .entries = sm6350_qos_linear_macrotile 91 }, 92 {.nentry = ARRAY_SIZE(sm6350_qos_linear_macrotile), 93 .entries = sm6350_qos_linear_macrotile 94 }, 95 {.nentry = ARRAY_SIZE(sc7180_qos_nrt), 96 .entries = sc7180_qos_nrt 97 }, 98 }, 99 .cdp_cfg = { 100 {.rd_enable = 1, .wr_enable = 1}, 101 {.rd_enable = 1, .wr_enable = 0} 102 }, 103 .clk_inefficiency_factor = 105, 104 .bw_inefficiency_factor = 120, 105 }; 106 107 const struct dpu_mdss_cfg dpu_sm6375_cfg = { 108 .caps = &sm6375_dpu_caps, 109 .ubwc = &sm6375_ubwc_cfg, 110 .mdp = &sm6375_mdp, 111 .ctl_count = ARRAY_SIZE(sm6375_ctl), 112 .ctl = sm6375_ctl, 113 .sspp_count = ARRAY_SIZE(sm6375_sspp), 114 .sspp = sm6375_sspp, 115 .mixer_count = ARRAY_SIZE(sm6375_lm), 116 .mixer = sm6375_lm, 117 .dspp_count = ARRAY_SIZE(sm6375_dspp), 118 .dspp = sm6375_dspp, 119 .dsc_count = ARRAY_SIZE(sm6375_dsc), 120 .dsc = sm6375_dsc, 121 .pingpong_count = ARRAY_SIZE(sm6375_pp), 122 .pingpong = sm6375_pp, 123 .intf_count = ARRAY_SIZE(sm6375_intf), 124 .intf = sm6375_intf, 125 .vbif_count = ARRAY_SIZE(sdm845_vbif), 126 .vbif = sdm845_vbif, 127 .perf = &sm6375_perf_data, 128 .mdss_irqs = BIT(MDP_SSPP_TOP0_INTR) | \ 129 BIT(MDP_SSPP_TOP0_INTR2) | \ 130 BIT(MDP_SSPP_TOP0_HIST_INTR) | \ 131 BIT(MDP_INTF1_INTR) | \ 132 BIT(MDP_INTF1_TEAR_INTR), 133 }; 134 135 #endif 136