summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8188/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8188/include')
-rw-r--r--src/soc/mediatek/mt8188/include/soc/dramc_param.h45
-rw-r--r--src/soc/mediatek/mt8188/include/soc/dramc_soc.h51
-rw-r--r--src/soc/mediatek/mt8188/include/soc/emi.h15
3 files changed, 96 insertions, 15 deletions
diff --git a/src/soc/mediatek/mt8188/include/soc/dramc_param.h b/src/soc/mediatek/mt8188/include/soc/dramc_param.h
new file mode 100644
index 0000000000..225872b7c3
--- /dev/null
+++ b/src/soc/mediatek/mt8188/include/soc/dramc_param.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+
+/*
+ * This file is created based on MT8188 Functional Specification
+ * Chapter number: 3.7
+ */
+
+#ifndef __SOC_MEDIATEK_MT8188_DRAMC_PARAM_H__
+#define __SOC_MEDIATEK_MT8188_DRAMC_PARAM_H__
+
+/*
+ * NOTE: This file is shared between coreboot and dram blob. Any change in this
+ * file should be synced to the other repository.
+ */
+
+#include <soc/dramc_param_common.h>
+#include <soc/dramc_soc.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#define DRAMC_PARAM_HEADER_VERSION 1
+
+struct sdram_params {
+ /* Not needed for full calibration */
+};
+
+struct dramc_data {
+ struct ddr_base_info ddr_info;
+ struct sdram_params freq_params[DRAM_DFS_SHU_MAX];
+};
+
+struct dramc_param {
+ struct dramc_param_header header;
+ void (*do_putc)(unsigned char c);
+ 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);
+int is_valid_dramc_param(const void *blob);
+int initialize_dramc_param(void *blob);
+
+#endif /* __SOC_MEDIATEK_MT8188_DRAMC_PARAM_H__ */
diff --git a/src/soc/mediatek/mt8188/include/soc/dramc_soc.h b/src/soc/mediatek/mt8188/include/soc/dramc_soc.h
new file mode 100644
index 0000000000..9ec8b716a5
--- /dev/null
+++ b/src/soc/mediatek/mt8188/include/soc/dramc_soc.h
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+
+/*
+ * This file is created based on MT8188 Functional Specification
+ * Chapter number: 3.7
+ */
+
+#ifndef __SOC_MEDIATEK_MT8188_DRAMC_SOC_H__
+#define __SOC_MEDIATEK_MT8188_DRAMC_SOC_H__
+
+#include <soc/dramc_soc_common.h>
+#include <stdint.h>
+
+typedef enum {
+ CHANNEL_A = 0,
+ CHANNEL_B,
+ CHANNEL_C,
+ CHANNEL_D,
+ CHANNEL_MAX,
+} DRAM_CHANNEL_T;
+
+typedef enum {
+ RANK_0 = 0,
+ RANK_1,
+ RANK_MAX,
+} DRAM_RANK_T;
+
+typedef enum {
+ SRAM_SHU0 = 0,
+ SRAM_SHU1,
+ SRAM_SHU2,
+ SRAM_SHU3,
+ SRAM_SHU4,
+ SRAM_SHU5,
+ SRAM_SHU6,
+ SRAM_SHU7,
+ DRAM_DFS_SRAM_MAX,
+} DRAM_DFS_SRAM_SHU_T;
+
+typedef enum {
+ DRVP = 0,
+ DRVN,
+ ODTP,
+ ODTN,
+ NTODT,
+ IMP_DRV_MAX,
+} DRAM_IMP_DRV_T;
+
+#define DRAM_DFS_SHU_MAX DRAM_DFS_SRAM_MAX
+
+#endif /* __SOC_MEDIATEK_MT8188_DRAMC_SOC_H__ */
diff --git a/src/soc/mediatek/mt8188/include/soc/emi.h b/src/soc/mediatek/mt8188/include/soc/emi.h
deleted file mode 100644
index cbf65c3c08..0000000000
--- a/src/soc/mediatek/mt8188/include/soc/emi.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
-
-/*
- * This file is created based on MT8188 Functional Specification
- * Chapter number: 3.7
- */
-
-#ifndef SOC_MEDIATEK_MT8188_EMI_H
-#define SOC_MEDIATEK_MT8188_EMI_H
-
-#include <stddef.h>
-
-size_t sdram_size(void);
-
-#endif /* SOC_MEDIATEK_MT8188_EMI_H */