xref: /linux/drivers/gpu/drm/i915/display/intel_dram.h (revision 939faf71cf7ca9ab3d1bd2912ac0e203d4d7156a)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 
6 #ifndef __INTEL_DRAM_H__
7 #define __INTEL_DRAM_H__
8 
9 #include <linux/types.h>
10 
11 struct intel_display;
12 
13 struct dram_info {
14 	enum intel_dram_type {
15 		INTEL_DRAM_UNKNOWN,
16 		INTEL_DRAM_DDR2,
17 		INTEL_DRAM_DDR3,
18 		INTEL_DRAM_DDR4,
19 		INTEL_DRAM_LPDDR3,
20 		INTEL_DRAM_LPDDR4,
21 		INTEL_DRAM_DDR5,
22 		INTEL_DRAM_LPDDR5,
23 		INTEL_DRAM_GDDR,
24 		INTEL_DRAM_GDDR_ECC,
25 		__INTEL_DRAM_TYPE_MAX,
26 	} type;
27 	unsigned int fsb_freq;
28 	unsigned int mem_freq;
29 	u8 num_channels;
30 	u8 num_qgv_points;
31 	u8 num_psf_gv_points;
32 	bool ecc_impacting_de_bw; /* Only valid from Xe3p_LPD onward. */
33 	bool symmetric_memory;
34 	bool has_16gb_dimms;
35 };
36 
37 int intel_dram_detect(struct intel_display *display);
38 unsigned int intel_fsb_freq(struct intel_display *display);
39 unsigned int intel_mem_freq(struct intel_display *display);
40 const struct dram_info *intel_dram_info(struct intel_display *display);
41 const char *intel_dram_type_str(enum intel_dram_type type);
42 
43 #endif /* __INTEL_DRAM_H__ */
44