blob: 81fde68b1cd7c149cc5ec90e4aa9697ef3fd62c3 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (C) 2018 MediaTek Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __PLF_INIT_H__
15#define __PLF_INIT_H__
16
17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/miscdevice.h>
20#include <linux/kallsyms.h>
21
22/*
23 * MET External Symbol
24 */
25extern struct miscdevice met_device;
26
27#ifdef MET_AP_EMI
28#include <mtk_dramc.h>
29extern unsigned int get_dram_data_rate(void); /* in Mhz */
30extern int get_ddr_type(void);
31extern void *mt_cen_emi_base_get(void);
32extern void *mt_chn_emi_base_get(void);
33extern void *get_cur_ddr_ratio(void);
34
35/* New APIs for mt_dramc_nao base get */
36extern void *mt_dramc_nao_chn_base_get(int channel);
37extern void *mt_ddrphy_chn_base_get(int channel);
38extern void *mt_dramc_chn_base_get(int channel);
39
40extern unsigned int (*get_dram_data_rate_symbol)(void); /* in Mhz */
41extern unsigned int (*get_ddr_type_symbol)(void); /* in Mhz */
42
43extern void *(*mt_cen_emi_base_get_symbol)(void);
44extern void *(*mt_chn_emi_base_get_symbol)(int chn);
45
46/* New APIs for mt_dramc_nao base get */
47extern void *(*mt_dramc_nao_chn_base_get_symbol)(int channel);
48extern void *(*mt_ddrphy_chn_base_get_symbol)(int channel);
49extern void *(*mt_dramc_chn_base_get_symbol)(int channel);
50
51extern unsigned int (*get_cur_ddr_ratio_symbol)(void);
52
53#endif
54
55/*
56 * MET devices declaration
57 */
58
59#ifdef MET_AP_EMI
60extern struct metdevice met_emi;
61extern struct metdevice met_sspm_emi;
62#endif
63
64#endif /*__PLF_INIT_H__*/