120 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.3 */4 5#ifndef _DPU_HW_VBIF_H6#define _DPU_HW_VBIF_H7 8#include "dpu_hw_catalog.h"9#include "dpu_hw_mdss.h"10#include "dpu_hw_util.h"11 12struct dpu_hw_vbif;13 14/**15 * struct dpu_hw_vbif_ops : Interface to the VBIF hardware driver functions16 * Assumption is these functions will be called after clocks are enabled17 */18struct dpu_hw_vbif_ops {19 /**20 * set_limit_conf - set transaction limit config21 * @vbif: vbif context driver22 * @xin_id: client interface identifier23 * @rd: true for read limit; false for write limit24 * @limit: outstanding transaction limit25 */26 void (*set_limit_conf)(struct dpu_hw_vbif *vbif,27 u32 xin_id, bool rd, u32 limit);28 29 /**30 * get_limit_conf - get transaction limit config31 * @vbif: vbif context driver32 * @xin_id: client interface identifier33 * @rd: true for read limit; false for write limit34 * @return: outstanding transaction limit35 */36 u32 (*get_limit_conf)(struct dpu_hw_vbif *vbif,37 u32 xin_id, bool rd);38 39 /**40 * set_halt_ctrl - set halt control41 * @vbif: vbif context driver42 * @xin_id: client interface identifier43 * @enable: halt control enable44 */45 void (*set_halt_ctrl)(struct dpu_hw_vbif *vbif,46 u32 xin_id, bool enable);47 48 /**49 * get_halt_ctrl - get halt control50 * @vbif: vbif context driver51 * @xin_id: client interface identifier52 * @return: halt control enable53 */54 bool (*get_halt_ctrl)(struct dpu_hw_vbif *vbif,55 u32 xin_id);56 57 /**58 * set_qos_remap - set QoS priority remap59 * @vbif: vbif context driver60 * @xin_id: client interface identifier61 * @level: priority level62 * @remap_level: remapped level63 */64 void (*set_qos_remap)(struct dpu_hw_vbif *vbif,65 u32 xin_id, u32 level, u32 remap_level);66 67 /**68 * set_mem_type - set memory type69 * @vbif: vbif context driver70 * @xin_id: client interface identifier71 * @value: memory type value72 */73 void (*set_mem_type)(struct dpu_hw_vbif *vbif,74 u32 xin_id, u32 value);75 76 /**77 * clear_errors - clear any vbif errors78 * This function clears any detected pending/source errors79 * on the VBIF interface, and optionally returns the detected80 * error mask(s).81 * @vbif: vbif context driver82 * @pnd_errors: pointer to pending error reporting variable83 * @src_errors: pointer to source error reporting variable84 */85 void (*clear_errors)(struct dpu_hw_vbif *vbif,86 u32 *pnd_errors, u32 *src_errors);87 88 /**89 * set_write_gather_en - set write_gather enable90 * @vbif: vbif context driver91 * @xin_id: client interface identifier92 */93 void (*set_write_gather_en)(struct dpu_hw_vbif *vbif, u32 xin_id);94};95 96struct dpu_hw_vbif {97 /* base */98 struct dpu_hw_blk_reg_map hw;99 100 /* vbif */101 enum dpu_vbif idx;102 const struct dpu_vbif_cfg *cap;103 104 /* ops */105 struct dpu_hw_vbif_ops ops;106};107 108/**109 * dpu_hw_vbif_init() - Initializes the VBIF driver for the passed110 * VBIF catalog entry.111 * @dev: Corresponding device for devres management112 * @cfg: VBIF catalog entry for which driver object is required113 * @addr: Mapped register io address of MDSS114 */115struct dpu_hw_vbif *dpu_hw_vbif_init(struct drm_device *dev,116 const struct dpu_vbif_cfg *cfg,117 void __iomem *addr);118 119#endif /*_DPU_HW_VBIF_H */120