Debian Codegraph @

src/vendorcode/mediatek/mt8192/include/emi.h

raw symbols SCIP
1 /* SPDX-License-Identifier: BSD-3-Clause */
2
3 #ifndef __EMI_H__
4 #define __EMI_H__
5
6 #include <soc/addressmap.h>
7 #include <dramc_top.h>
8
9 #define EMI_APB_BASE EMI_BASE
10
11 #if __ETT__
12 #define emi_log printf
13 #elif __FLASH_TOOL_DA__
14 #define emi_log LOGD
15 #else
16 #define emi_log(_x_...) printk(BIOS_INFO, _x_)
17 #endif
18
19 struct isu_info_t {
20 unsigned int buf_size;
21 unsigned long long buf_addr;
22 unsigned long long ver_addr;
23 unsigned long long con_addr;
24 };
25
26 #define EMI_ISU_BUF_SIZE 0x800000
27 #define LAST_EMI_MAGIC_PATTERN 0x19870611
28 typedef struct {
29 unsigned int isu_magic;
30 unsigned int isu_ctrl;
31 unsigned int isu_dram_type;
32 unsigned int isu_diff_us;
33 unsigned int isu_buf_l;
34 unsigned int isu_buf_h;
35 unsigned int isu_version;
36 unsigned int snst_last;
37 unsigned int snst_past;
38 unsigned int os_flag_sspm;
39 unsigned int os_flag_ap;
40 } LAST_EMI_INFO_T;
41 #define DEF_LAST_EMI LAST_EMI_INFO_T
42
43 void emi_init(void);
44 void emi_init2(void);
45 void clr_emi_mpu_prot(void);
46 void dis_emi_apb_prot(void);
47 int get_row_width_by_emi(unsigned int rank);
48 int get_channel_nr_by_emi(void);
49 int get_rank_nr_by_emi(void);
50 void get_rank_size_by_emi(unsigned long long dram_rank_size[DRAMC_MAX_RK]);
51 void set_cen_emi_cona(unsigned int cona_val);
52 void set_cen_emi_conf(unsigned int conf_val);
53 void set_cen_emi_conh(unsigned int conh_val);
54 void set_chn_emi_cona(unsigned int cona_val);
55 void set_chn_emi_conc(unsigned int conc_val);
56 unsigned int get_cen_emi_cona(void);
57 unsigned int get_chn_emi_cona(void);
58 void phy_addr_to_dram_addr(dram_addr_t *dram_addr, unsigned long long phy_addr);
59 unsigned int set_emi_before_rank1_mem_test(void);
60 void restore_emi_after_rank1_mem_test(void);
61 void get_emi_isu_info(struct isu_info_t *isu_info_ptr);
62 void reserve_emi_isu_buf(void);
63 void reserve_emi_mbist_buf(void);
64 void record_emi_snst(void);
65 unsigned long long platform_memory_size(void);
66
67 #endif /* __EMI_H__ */
68