hsin-hsiung wang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33186
Change subject: mediatek/mt8183: modify vdram1 voltage ......................................................................
mediatek/mt8183: modify vdram1 voltage
Dram DVFS needs calibration with different vdram1 voltage to get correct parameters, so we provide a api to change vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/1
diff --git a/src/soc/mediatek/mt8183/include/soc/mt6358.h b/src/soc/mediatek/mt8183/include/soc/mt6358.h index 02937ba..c90e6e4 100644 --- a/src/soc/mediatek/mt8183/include/soc/mt6358.h +++ b/src/soc/mediatek/mt8183/include/soc/mt6358.h @@ -26,6 +26,9 @@ PMIC_PWRHOLD = 0x0a08, PMIC_CPSDSA4 = 0x0a2e, PMIC_VDRAM1_VOSEL_SLEEP = 0x160a, + PMIC_VDRAM1_OP_EN = 0x1610, + PMIC_VDRAM1_DBG0 = 0x161e, + PMIC_VDRAM1_VOSEL = 0x1626, PMIC_SMPS_ANA_CON0 = 0x1808, };
@@ -38,5 +41,7 @@
void mt6358_init(void); void pmic_set_power_hold(bool enable); +unsigned int pmic_get_vdram1_vol(void); +void pmic_set_vdram1_vol(unsigned int vdram_uv);
#endif /* __SOC_MEDIATEK_MT6358_H__ */ diff --git a/src/soc/mediatek/mt8183/mt6358.c b/src/soc/mediatek/mt8183/mt6358.c index 7054243..ea4e7bd 100644 --- a/src/soc/mediatek/mt8183/mt6358.c +++ b/src/soc/mediatek/mt8183/mt6358.c @@ -733,6 +733,29 @@ pwrap_write_field(PMIC_PWRHOLD, (enable) ? 1 : 0, 0x1, 0); }
+unsigned int pmic_get_vdram1_vol(void) +{ + unsigned int vol_reg; + + vol_reg = pwrap_read_field(PMIC_VDRAM1_DBG0, 0x7F, 0); + return (500000 + vol_reg * 12500); +} + +void pmic_set_vdram1_vol(unsigned int vdram_uv) +{ + unsigned int vol_reg; + + if (500000 > vdram_uv) + vol_reg = 0; + else if (vdram_uv > 1300000) + vol_reg = 0x40; + else + vol_reg = (vdram_uv - 500000) / 12500; + + pwrap_write_field(PMIC_VDRAM1_OP_EN, 1, 0x7F, 0); + pwrap_write_field(PMIC_VDRAM1_VOSEL, vol_reg, 0x7F, 0); +} + static void pmic_wdt_set(void) { /* [5]=1, RG_WDTRSTB_DEB */
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: modify vdram1 voltage ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/33186/1/src/soc/mediatek/mt8183/mt6358.c File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/#/c/33186/1/src/soc/mediatek/mt8183/mt6358.c@748 PS1, Line 748: if (500000 > vdram_uv) Comparisons should place the constant on the right side of the test
hsin-hsiung wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: modify vdram1 voltage ......................................................................
Patch Set 3:
This change is ready for review.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: modify vdram1 voltage ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/#/c/33186/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/33186/3//COMMIT_MSG@7 PS3, Line 7: modify vdram1 allow modifying vdram1 voltage
https://review.coreboot.org/#/c/33186/3//COMMIT_MSG@9 PS3, Line 9: Dram DVFS needs calibration with different vdram1 voltage to get correct : parameters, so we provide a api to change vdram1 voltage. DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
https://review.coreboot.org/#/c/33186/3/src/soc/mediatek/mt8183/mt6358.c File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/#/c/33186/3/src/soc/mediatek/mt8183/mt6358.c@741 PS3, Line 741: return (500000 + vol_reg * 12500); no need to quote. i.e.,
return 500000 + vol_reg * 12500;
Hello You-Cheng Syu, Tristan Hsieh, Hung-Te Lin, Huayang Duan, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33186
to look at the new patch set (#4).
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/4
Hello You-Cheng Syu, Tristan Hsieh, Hung-Te Lin, Huayang Duan, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33186
to look at the new patch set (#5).
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/5
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
Patch Set 5: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/#/c/33186/5/src/soc/mediatek/mt8183/mt6358.c File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/#/c/33186/5/src/soc/mediatek/mt8183/mt6358.c@744 PS5, Line 744: vdram_uv Does this need to be microvolts? I'd generally prefer to always keep voltages in millivolts where possible, since most coreboot code is doing it that way and consistency avoids potential confusion.
https://review.coreboot.org/#/c/33186/5/src/soc/mediatek/mt8183/mt6358.c@748 PS5, Line 748: if (vdram_uv < 500000) I assume this function is called from some board file with hardcoded values? If so, you should assert() that the input is in the valid range, not just silently clamp it.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
Patch Set 5:
Where is this API used? Can you upload that patch as well to demonstrate why we need it?
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
Patch Set 6: Code-Review+1
Yu-Ping Wu has uploaded a new patch set (#7) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/7
Yu-Ping Wu has uploaded a new patch set (#8) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/8
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 8: Code-Review+1
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 8:
Please upload the patches that are using this API so we can review with context.
hsin-hsiung wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 8:
Patch Set 8:
Please upload the patches that are using this API so we can review with context.
Hi Julius, I already ask our dram owner to upload his code. Many thanks.
hsin-hsiung wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 9:
This change is ready for review.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 9:
(3 comments)
https://review.coreboot.org/c/coreboot/+/33186/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/33186/3//COMMIT_MSG@7 PS3, Line 7: modify vdram1
allow modifying vdram1 voltage
Done
https://review.coreboot.org/c/coreboot/+/33186/3//COMMIT_MSG@9 PS3, Line 9: Dram DVFS needs calibration with different vdram1 voltage to get correct : parameters, so we provide a api to change vdram1 voltage.
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. […]
Done
https://review.coreboot.org/c/coreboot/+/33186/3/src/soc/mediatek/mt8183/mt6... File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/c/coreboot/+/33186/3/src/soc/mediatek/mt8183/mt6... PS3, Line 741: return (500000 + vol_reg * 12500);
no need to quote. i.e., […]
Ack
Yu-Ping Wu has uploaded a new patch set (#10) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/10
Hello Yu-Ping Wu, Julius Werner, You-Cheng Syu, Tristan Hsieh, Hung-Te Lin, Huayang Duan, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33186
to look at the new patch set (#11).
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/11
Yu-Ping Wu has uploaded a new patch set (#15) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/15
Yu-Ping Wu has uploaded a new patch set (#16) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/16
Yu-Ping Wu has uploaded a new patch set (#19) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/19
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 19:
(1 comment)
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... PS5, Line 748: if (vdram_uv < 500000)
I assume this function is called from some board file with hardcoded values? If so, you should asser […]
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 21: Code-Review+2
(1 comment)
Per comments in
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... PS5, Line 744: vdram_uv
Does this need to be microvolts? I'd generally prefer to always keep voltages in millivolts where po […]
Per comments in CL:33391, some settings do need ".5"mv. In comparison to introducing floating points, I think maintaining these in uv may be better.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 21:
(1 comment)
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... File src/soc/mediatek/mt8183/mt6358.c:
https://review.coreboot.org/c/coreboot/+/33186/5/src/soc/mediatek/mt8183/mt6... PS5, Line 744: vdram_uv
Per comments in CL:33391, some settings do need ".5"mv. […]
Ack
Yu-Ping Wu has uploaded a new patch set (#24) to the change originally created by hsin-hsiung wang. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: soc/mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
soc/mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/33186/24
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: soc/mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
Patch Set 24: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/33186 )
Change subject: soc/mediatek/mt8183: Allow modifying vdram1 voltage ......................................................................
soc/mediatek/mt8183: Allow modifying vdram1 voltage
DRAM DVFS needs to be calibrated with different vdram1 voltages to get correct parameters. A new API is added to allow changing vdram1 voltage.
BUG=b:80501386 BRANCH=none TEST=measure vdram1 voltage with multimeter
Change-Id: Ia15ab3a2e1668e5b4873d317b57a38ebee037709 Signed-off-by: Hsin-Hsiung Wang hsin-hsiung.wang@mediatek.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33186 Reviewed-by: Hung-Te Lin hungte@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/mediatek/mt8183/include/soc/mt6358.h M src/soc/mediatek/mt8183/mt6358.c 2 files changed, 26 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Hung-Te Lin: Looks good to me, approved
diff --git a/src/soc/mediatek/mt8183/include/soc/mt6358.h b/src/soc/mediatek/mt8183/include/soc/mt6358.h index bb5f019..6ed654c 100644 --- a/src/soc/mediatek/mt8183/include/soc/mt6358.h +++ b/src/soc/mediatek/mt8183/include/soc/mt6358.h @@ -29,6 +29,9 @@ PMIC_VCORE_DBG0 = 0x149e, PMIC_VCORE_VOSEL = 0x14aa, PMIC_VDRAM1_VOSEL_SLEEP = 0x160a, + PMIC_VDRAM1_OP_EN = 0x1610, + PMIC_VDRAM1_DBG0 = 0x161e, + PMIC_VDRAM1_VOSEL = 0x1626, PMIC_SMPS_ANA_CON0 = 0x1808, PMIC_VSIM2_ANA_CON0 = 0x1e30, }; @@ -46,5 +49,7 @@ void pmic_init_scp_voltage(void); unsigned int pmic_get_vcore_vol(void); void pmic_set_vcore_vol(unsigned int vcore_uv); +unsigned int pmic_get_vdram1_vol(void); +void pmic_set_vdram1_vol(unsigned int vdram_uv);
#endif /* __SOC_MEDIATEK_MT6358_H__ */ diff --git a/src/soc/mediatek/mt8183/mt6358.c b/src/soc/mediatek/mt8183/mt6358.c index 3600b6a..9ee27b9 100644 --- a/src/soc/mediatek/mt8183/mt6358.c +++ b/src/soc/mediatek/mt8183/mt6358.c @@ -826,6 +826,27 @@ pwrap_write_field(PMIC_VCORE_VOSEL, vol_reg, 0x7F, 0); }
+unsigned int pmic_get_vdram1_vol(void) +{ + unsigned int vol_reg; + + vol_reg = pwrap_read_field(PMIC_VDRAM1_DBG0, 0x7F, 0); + return 500000 + vol_reg * 12500; +} + +void pmic_set_vdram1_vol(unsigned int vdram_uv) +{ + unsigned int vol_reg; + + assert(vdram_uv >= 500000); + assert(vdram_uv <= 1300000); + + vol_reg = (vdram_uv - 500000) / 12500; + + pwrap_write_field(PMIC_VDRAM1_OP_EN, 1, 0x7F, 0); + pwrap_write_field(PMIC_VDRAM1_VOSEL, vol_reg, 0x7F, 0); +} + static void pmic_wdt_set(void) { /* [5]=1, RG_WDTRSTB_DEB */