Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61132 )
Change subject: soc/mediatek: Extract dramc_param_header to a common header ......................................................................
soc/mediatek: Extract dramc_param_header to a common header
To be shared with different SOCs, move the dramc_param_header struct as well DRAMC_PARAM_FLAG and DRAMC_PARAM_CONFIG enums to a common header file dramc_param_common.h.
TEST=fast calibration pass BUG=b:204226005
Signed-off-by: Xi Chen xixi.chen@mediatek.corp-partner.google.com Change-Id: I087971799803e47e34c30063b2b0bd0cfc5795ac Reviewed-on: https://review.coreboot.org/c/coreboot/+/61132 Reviewed-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: Yu-Ping Wu yupingso@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- A src/soc/mediatek/common/include/soc/dramc_param_common.h M src/soc/mediatek/mt8186/include/soc/dramc_param.h M src/soc/mediatek/mt8192/include/soc/dramc_param.h M src/soc/mediatek/mt8195/include/soc/dramc_param.h 4 files changed, 34 insertions(+), 36 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved Rex-BC Chen: Looks good to me, but someone else must approve
diff --git a/src/soc/mediatek/common/include/soc/dramc_param_common.h b/src/soc/mediatek/common/include/soc/dramc_param_common.h new file mode 100644 index 0000000..1b68d61 --- /dev/null +++ b/src/soc/mediatek/common/include/soc/dramc_param_common.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __SOC_MEDIATEK_DRAMC_PARAM_COMMON_H__ +#define __SOC_MEDIATEK_DRAMC_PARAM_COMMON_H__ + +/* + * NOTE: This file is shared between coreboot and dram blob. Any change in this + * file should be synced to the other repository. + */ + +enum DRAMC_PARAM_FLAG { + DRAMC_FLAG_HAS_SAVED_DATA = 0x0001, +}; + +enum DRAMC_PARAM_CONFIG { + DRAMC_CONFIG_EMCP = 0x0001, + DRAMC_CONFIG_DVFS = 0x0002, + DRAMC_CONFIG_FAST_K = 0x0004, +}; + +struct dramc_param_header { + u16 version; /* DRAMC_PARAM_HEADER_VERSION, set in coreboot */ + u16 size; /* size of whole dramc_param, set in coreboot */ + u16 status; /* DRAMC_PARAM_STATUS_CODES, set in dram blob */ + u16 flags; /* DRAMC_PARAM_FLAG, set in dram blob */ + u16 config; /* DRAMC_PARAM_CONFIG, set in coreboot */ +}; + +#endif diff --git a/src/soc/mediatek/mt8186/include/soc/dramc_param.h b/src/soc/mediatek/mt8186/include/soc/dramc_param.h index 81f518f..5559b0a 100644 --- a/src/soc/mediatek/mt8186/include/soc/dramc_param.h +++ b/src/soc/mediatek/mt8186/include/soc/dramc_param.h @@ -10,6 +10,7 @@
#include <stdint.h> #include <sys/types.h> +#include <soc/dramc_param_common.h> #include <soc/dramc_soc.h>
#define DRAMC_PARAM_HEADER_VERSION 1 @@ -27,10 +28,6 @@ DRAMC_ERR_FAST_CALIBRATION, };
-enum DRAMC_PARAM_FLAGS { - DRAMC_FLAG_HAS_SAVED_DATA = 0x0001, -}; - enum SDRAM_DVFS_FLAG { DRAMC_DISABLE_DVFS, DRAMC_ENABLE_DVFS, @@ -56,14 +53,6 @@ SDRAM_VOLTAGE_LVCORE_LVDRAM, };
-struct dramc_param_header { - u16 version; /* DRAMC_PARAM_HEADER_VERSION, update in the coreboot */ - u16 size; /* size of whole dramc_param, update in the coreboot */ - u16 status; /* DRAMC_PARAM_STATUS_CODES, update in the dram blob */ - u16 flags; /* DRAMC_PARAM_FLAGS, update in the dram blob */ - u16 config; /* DRAMC_PARAM_CONFIG, set in coreboot */ -}; - struct sdram_info { u32 ddr_type; /* SDRAM_DDR_TYPE */ u32 ddr_geometry; /* SDRAM_DDR_GEOMETRY_TYPE */ diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_param.h b/src/soc/mediatek/mt8192/include/soc/dramc_param.h index 7d6efda..09501b0 100644 --- a/src/soc/mediatek/mt8192/include/soc/dramc_param.h +++ b/src/soc/mediatek/mt8192/include/soc/dramc_param.h @@ -10,9 +10,10 @@
#include <stdint.h> #include <sys/types.h> +#include <soc/dramc_param_common.h> #include <soc/dramc_soc.h>
-#define DRAMC_PARAM_HEADER_VERSION 6 +#define DRAMC_PARAM_HEADER_VERSION 7
enum DRAMC_PARAM_STATUS_CODES { DRAMC_SUCCESS = 0, @@ -27,10 +28,6 @@ DRAMC_ERR_FAST_CALIBRATION, };
-enum DRAMC_PARAM_FLAGS { - DRAMC_FLAG_HAS_SAVED_DATA = 0x0001, -}; - enum SDRAM_DVFS_FLAG { DRAMC_DISABLE_DVFS, DRAMC_ENABLE_DVFS, @@ -56,13 +53,6 @@ SDRAM_VOLTAGE_LVCORE_LVDRAM, };
-struct dramc_param_header { - u16 version; /* DRAMC_PARAM_HEADER_VERSION, update in the coreboot */ - u16 size; /* size of whole dramc_param, update in the coreboot */ - u16 status; /* DRAMC_PARAM_STATUS_CODES, update in the dram blob */ - u16 flags; /* DRAMC_PARAM_FLAGS, update in the dram blob */ -}; - struct sdram_info { u32 ddr_type; /* SDRAM_DDR_TYPE */ u32 ddr_geometry; /* SDRAM_DDR_GEOMETRY_TYPE */ diff --git a/src/soc/mediatek/mt8195/include/soc/dramc_param.h b/src/soc/mediatek/mt8195/include/soc/dramc_param.h index 0e1b62c..bfa5f8d 100644 --- a/src/soc/mediatek/mt8195/include/soc/dramc_param.h +++ b/src/soc/mediatek/mt8195/include/soc/dramc_param.h @@ -10,9 +10,10 @@
#include <stdint.h> #include <sys/types.h> +#include <soc/dramc_param_common.h> #include <soc/dramc_soc.h>
-#define DRAMC_PARAM_HEADER_VERSION 7 +#define DRAMC_PARAM_HEADER_VERSION 8
enum DRAMC_PARAM_STATUS_CODES { DRAMC_SUCCESS = 0, @@ -27,10 +28,6 @@ DRAMC_ERR_FAST_CALIBRATION, };
-enum DRAMC_PARAM_FLAGS { - DRAMC_FLAG_HAS_SAVED_DATA = 0x0001, -}; - enum SDRAM_DVFS_FLAG { DRAMC_DISABLE_DVFS, DRAMC_ENABLE_DVFS, @@ -56,13 +53,6 @@ SDRAM_VOLTAGE_LVCORE_LVDRAM, };
-struct dramc_param_header { - u16 version; /* DRAMC_PARAM_HEADER_VERSION, update in the coreboot */ - u16 size; /* size of whole dramc_param, update in the coreboot */ - u16 status; /* DRAMC_PARAM_STATUS_CODES, update in the dram blob */ - u16 flags; /* DRAMC_PARAM_FLAGS, update in the dram blob */ -}; - struct sdram_info { u32 ddr_type; /* SDRAM_DDR_TYPE */ u32 ddr_geometry; /* SDRAM_DDR_GEOMETRY_TYPE */
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.