rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* |
| 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 | */ |
| 25 | extern struct miscdevice met_device; |
| 26 | |
| 27 | #ifdef MET_AP_EMI |
| 28 | #include <mtk_dramc.h> |
| 29 | extern unsigned int get_dram_data_rate(void); /* in Mhz */ |
| 30 | extern int get_ddr_type(void); |
| 31 | extern void *mt_cen_emi_base_get(void); |
| 32 | extern void *mt_chn_emi_base_get(void); |
| 33 | extern void *get_cur_ddr_ratio(void); |
| 34 | |
| 35 | /* New APIs for mt_dramc_nao base get */ |
| 36 | extern void *mt_dramc_nao_chn_base_get(int channel); |
| 37 | extern void *mt_ddrphy_chn_base_get(int channel); |
| 38 | extern void *mt_dramc_chn_base_get(int channel); |
| 39 | |
| 40 | extern unsigned int (*get_dram_data_rate_symbol)(void); /* in Mhz */ |
| 41 | extern unsigned int (*get_ddr_type_symbol)(void); /* in Mhz */ |
| 42 | |
| 43 | extern void *(*mt_cen_emi_base_get_symbol)(void); |
| 44 | extern void *(*mt_chn_emi_base_get_symbol)(int chn); |
| 45 | |
| 46 | /* New APIs for mt_dramc_nao base get */ |
| 47 | extern void *(*mt_dramc_nao_chn_base_get_symbol)(int channel); |
| 48 | extern void *(*mt_ddrphy_chn_base_get_symbol)(int channel); |
| 49 | extern void *(*mt_dramc_chn_base_get_symbol)(int channel); |
| 50 | |
| 51 | extern unsigned int (*get_cur_ddr_ratio_symbol)(void); |
| 52 | |
| 53 | #endif |
| 54 | |
| 55 | /* |
| 56 | * MET devices declaration |
| 57 | */ |
| 58 | |
| 59 | #ifdef MET_AP_EMI |
| 60 | extern struct metdevice met_emi; |
| 61 | extern struct metdevice met_sspm_emi; |
| 62 | #endif |
| 63 | |
| 64 | #endif /*__PLF_INIT_H__*/ |