summaryrefslogtreecommitdiff
path: root/src/soc/mediatek
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek')
-rw-r--r--src/soc/mediatek/common/Kconfig15
-rw-r--r--src/soc/mediatek/common/include/soc/dramc_param_common.h2
-rw-r--r--src/soc/mediatek/common/memory.c8
-rw-r--r--src/soc/mediatek/mt8186/include/soc/dramc_param.h1
-rw-r--r--src/soc/mediatek/mt8188/include/soc/dramc_param.h1
-rw-r--r--src/soc/mediatek/mt8192/include/soc/dramc_param.h1
-rw-r--r--src/soc/mediatek/mt8195/include/soc/dramc_param.h1
7 files changed, 24 insertions, 5 deletions
diff --git a/src/soc/mediatek/common/Kconfig b/src/soc/mediatek/common/Kconfig
index 898918a621..55ea5ecd44 100644
--- a/src/soc/mediatek/common/Kconfig
+++ b/src/soc/mediatek/common/Kconfig
@@ -8,6 +8,21 @@ config SOC_MEDIATEK_COMMON
if SOC_MEDIATEK_COMMON
+config MEDIATEK_DRAM_ADAPTIVE
+ bool
+ default n if SOC_MEDIATEK_MT8173
+ default n if SOC_MEDIATEK_MT8183
+ default n if SOC_MEDIATEK_MT8192
+ default y
+ help
+ Starting from MT8195, MediaTek platform supports "dram adaptive" to
+ automatically detect dram information, including channel, rank, die
+ size..., and can automatically configure EMI settings. So we can just
+ pass a placeholder param blob to `mt_mem_init_run` by enabling this
+ option.
+ Platforms (MT8173, MT8183, MT8192) which do not support "dram adaptive"
+ need to implement `get_sdram_config` to get the DRAM configuration info.
+
config MEDIATEK_DRAM_DVFS
bool
default n
diff --git a/src/soc/mediatek/common/include/soc/dramc_param_common.h b/src/soc/mediatek/common/include/soc/dramc_param_common.h
index 429f3c64a9..7dd8bba5d8 100644
--- a/src/soc/mediatek/common/include/soc/dramc_param_common.h
+++ b/src/soc/mediatek/common/include/soc/dramc_param_common.h
@@ -101,4 +101,6 @@ struct ddr_base_info {
u32 data_rate;
};
+const struct sdram_info *get_sdram_config(void);
+
#endif
diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c
index be72023dac..72ea37eea3 100644
--- a/src/soc/mediatek/common/memory.c
+++ b/src/soc/mediatek/common/memory.c
@@ -313,7 +313,13 @@ static void mt_mem_init_run(struct dramc_param *dparam,
void mt_mem_init(struct dramc_param *dparam)
{
- const struct sdram_info *sdram_param = get_sdram_config();
+ const struct sdram_info *sdram_param = NULL;
+ static struct sdram_info fake_sdram_param;
+
+ if (CONFIG(MEDIATEK_DRAM_ADAPTIVE))
+ sdram_param = &fake_sdram_param;
+ else
+ sdram_param = get_sdram_config();
mt_mem_init_run(dparam, sdram_param);
}
diff --git a/src/soc/mediatek/mt8186/include/soc/dramc_param.h b/src/soc/mediatek/mt8186/include/soc/dramc_param.h
index 2d6212b169..29380c2127 100644
--- a/src/soc/mediatek/mt8186/include/soc/dramc_param.h
+++ b/src/soc/mediatek/mt8186/include/soc/dramc_param.h
@@ -78,7 +78,6 @@ struct dramc_param {
struct dramc_data dramc_datas;
};
-const struct sdram_info *get_sdram_config(void);
struct dramc_param *get_dramc_param_from_blob(void *blob);
void dump_param_header(const void *blob);
int initialize_dramc_param(void *blob);
diff --git a/src/soc/mediatek/mt8188/include/soc/dramc_param.h b/src/soc/mediatek/mt8188/include/soc/dramc_param.h
index 88e2a90e61..740e27b6f7 100644
--- a/src/soc/mediatek/mt8188/include/soc/dramc_param.h
+++ b/src/soc/mediatek/mt8188/include/soc/dramc_param.h
@@ -98,7 +98,6 @@ struct dramc_param {
struct dramc_data dramc_datas;
};
-const struct sdram_info *get_sdram_config(void);
struct dramc_param *get_dramc_param_from_blob(void *blob);
void dump_param_header(const void *blob);
int validate_dramc_param(const void *blob);
diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_param.h b/src/soc/mediatek/mt8192/include/soc/dramc_param.h
index c4f1293479..fca82bee62 100644
--- a/src/soc/mediatek/mt8192/include/soc/dramc_param.h
+++ b/src/soc/mediatek/mt8192/include/soc/dramc_param.h
@@ -73,7 +73,6 @@ struct dramc_param {
struct dramc_data dramc_datas;
};
-const struct sdram_info *get_sdram_config(void);
struct dramc_param *get_dramc_param_from_blob(void *blob);
void dump_param_header(const void *blob);
int validate_dramc_param(const void *blob);
diff --git a/src/soc/mediatek/mt8195/include/soc/dramc_param.h b/src/soc/mediatek/mt8195/include/soc/dramc_param.h
index 7c66b70246..0885ee0651 100644
--- a/src/soc/mediatek/mt8195/include/soc/dramc_param.h
+++ b/src/soc/mediatek/mt8195/include/soc/dramc_param.h
@@ -73,7 +73,6 @@ struct dramc_param {
struct dramc_data dramc_datas;
};
-const struct sdram_info *get_sdram_config(void);
struct dramc_param *get_dramc_param_from_blob(void *blob);
void dump_param_header(const void *blob);
int validate_dramc_param(const void *blob);