Xi Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48261 )
Change subject: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
src/mediatek/mt8192: pass regulator function pointer to dram blob
For dram power HV or LV control, dram blob and coreboot have different api and implementations, coreboot will pass regulator get/set pointer to dram blob, blob can leverage coreboot regulator implementation.
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: Id44fe4d6c7a7448b63b400744cbc331055e94024 --- M src/soc/mediatek/mt8192/include/soc/dramc_param.h M src/soc/mediatek/mt8192/memory.c 2 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/48261/1
diff --git a/src/soc/mediatek/mt8192/include/soc/dramc_param.h b/src/soc/mediatek/mt8192/include/soc/dramc_param.h index 180311e..95a29d6 100644 --- a/src/soc/mediatek/mt8192/include/soc/dramc_param.h +++ b/src/soc/mediatek/mt8192/include/soc/dramc_param.h @@ -6,9 +6,10 @@ #include <stdint.h> #include <sys/types.h> #include <soc/dramc_common_mt8192.h> +#include <soc/regulator.h>
enum { - DRAMC_PARAM_HEADER_VERSION = 5, + DRAMC_PARAM_HEADER_VERSION = 6, };
enum DRAMC_PARAM_STATUS_CODES { @@ -53,6 +54,10 @@ DRAM_VOLTAGE_LVCORE_LVDRAM, };
+typedef uint32_t (*get_regulator_vol_ptr)(enum mtk_regulator regulator); +typedef void (*set_regulator_vol_ptr)(enum mtk_regulator regulator, + uint32_t voltage_uv); + struct dramc_param_header { u32 checksum; /* checksum of dramc_datas, update in the coreboot */ u16 version; /* DRAMC_PARAM_HEADER_VERSION, update in the coreboot */ @@ -131,10 +136,16 @@ struct sdram_params freq_params[DRAM_DFS_SHU_MAX]; };
+struct dram_power_control { + get_regulator_vol_ptr get_regulator_vol; + set_regulator_vol_ptr set_regulator_vol; +}; + struct dramc_param { struct dramc_param_header header; void (*do_putc)(unsigned char c); struct dramc_data dramc_datas; + struct dram_power_control dram_power_ctl; };
struct dramc_param_ops { diff --git a/src/soc/mediatek/mt8192/memory.c b/src/soc/mediatek/mt8192/memory.c index 97bcc22..666aa00 100644 --- a/src/soc/mediatek/mt8192/memory.c +++ b/src/soc/mediatek/mt8192/memory.c @@ -93,6 +93,10 @@
dparam->do_putc = do_putchar;
+ /* init dram power control pointer with regulator mainboard API */ + dparam->dram_power_ctl.get_regulator_vol = mainboard_get_regulator_vol; + dparam->dram_power_ctl.set_regulator_vol = mainboard_set_regulator_vol; + prog_set_entry(&dram, prog_entry(&dram), dparam); prog_run(&dram); if (dparam->header.status != DRAMC_SUCCESS) {
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48261 )
Change subject: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
Patch Set 1: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... File src/soc/mediatek/mt8192/include/soc/dramc_param.h:
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... PS1, Line 57: ptr how about _cb for callback ?
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... PS1, Line 148: dram how about remove dram_ prefix to shorten the naming ?
Hello Hung-Te Lin, Cindy Ching, build bot (Jenkins), Yidi Lin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48261
to look at the new patch set (#2).
Change subject: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
src/mediatek/mt8192: pass regulator function pointer to dram blob
For dram power HV or LV control, dram blob and coreboot have different api and implementations, coreboot will pass regulator get/set pointer to dram blob, blob can leverage coreboot regulator implementation.
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: Id44fe4d6c7a7448b63b400744cbc331055e94024 --- M src/soc/mediatek/mt8192/include/soc/dramc_param.h M src/soc/mediatek/mt8192/memory.c 2 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/48261/2
Xi Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48261 )
Change subject: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... File src/soc/mediatek/mt8192/include/soc/dramc_param.h:
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... PS1, Line 57: ptr
how about _cb for callback ?
Ack
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... PS1, Line 148: dram
how about remove dram_ prefix to shorten the naming ?
Ack
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48261 )
Change subject: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... File src/soc/mediatek/mt8192/include/soc/dramc_param.h:
https://review.coreboot.org/c/coreboot/+/48261/1/src/soc/mediatek/mt8192/inc... PS1, Line 57: ptr
Ack
Note: 'cb' is also a commonly-used abbreviation for 'coreboot', e.g. CB:48261 (a link to this change). I don't really mind the suffix, though.
Attention is currently required from: Xi Chen, Yidi Lin. Hello Hung-Te Lin, build bot (Jenkins), Cindy Ching, Yidi Lin, Yidi Lin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48261
to look at the new patch set (#8).
Change subject: TEST-ONLY: src/mediatek/mt8192: pass regulator function pointer to dram blob ......................................................................
TEST-ONLY: src/mediatek/mt8192: pass regulator function pointer to dram blob
For dram power HV or LV control, dram blob and coreboot have different api and implementations, coreboot will pass regulator get/set pointer to dram blob, blob can leverage coreboot regulator implementation.
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: Id44fe4d6c7a7448b63b400744cbc331055e94024 --- M src/soc/mediatek/mt8192/include/soc/dramc_param.h M src/soc/mediatek/mt8192/memory.c 2 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/48261/8
Attention is currently required from: Yidi Lin. Hello Hung-Te Lin, build bot (Jenkins), Cindy Ching, Yidi Lin, Yidi Lin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48261
to look at the new patch set (#9).
Change subject: TEST-ONLY: src/mediatek/mt8192: HV LV control ......................................................................
TEST-ONLY: src/mediatek/mt8192: HV LV control
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: Id44fe4d6c7a7448b63b400744cbc331055e94024 --- M src/soc/mediatek/common/include/soc/dramc_param.h M src/soc/mediatek/common/memory.c 2 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/48261/9
Xi Chen has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/48261 )
Change subject: TEST-ONLY: src/mediatek/mt8192: HV LV control ......................................................................
Abandoned