1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2022 Amlogic, Inc. All rights reserved.
6 #ifndef __MESON_DDR_PMU_H__
7 #define __MESON_DDR_PMU_H__
9 #define MAX_CHANNEL_NUM 8
27 u64 all_cnt; /* The count of all requests come in/out ddr controller */
35 u64 channel_cnt[MAX_CHANNEL_NUM]; /* To save a DMC bandwidth-monitor channel counter */
39 void (*enable)(struct dmc_info *info);
40 void (*disable)(struct dmc_info *info);
41 /* Bind an axi line to a bandwidth-monitor channel */
42 void (*set_axi_filter)(struct dmc_info *info, int axi_id, int chann);
43 int (*irq_handler)(struct dmc_info *info,
44 struct dmc_counter *counter);
45 void (*get_counters)(struct dmc_info *info,
46 struct dmc_counter *counter);
48 int dmc_nr; /* The number of dmc controller */
49 int chann_nr; /* The number of dmc bandwidth monitor channels */
50 struct attribute **fmt_attr;
51 const u64 capability[2];
55 const struct dmc_hw_info *hw_info;
57 void __iomem *ddr_reg[4];
58 unsigned long timer_value; /* Timer value in TIMER register */
59 void __iomem *pll_reg;
60 int irq_num; /* irq vector number */
63 int meson_ddr_pmu_create(struct platform_device *pdev);
64 int meson_ddr_pmu_remove(struct platform_device *pdev);
66 #endif /* __MESON_DDR_PMU_H__ */