高通设置LDO电压

news/2024/10/17 21:20:47/

高通平台如何设置LDO电压,以LDO17为例,默认给屏供电,设置为2.85V现在设置为3.3V。


修改的rpm和sbl部分代码,修改LDO17电压为3.3V 。

修改如下:
(1)、

--- a/RPM.BF.2.2/rpm_proc/core/systemdrivers/pmic/config/msm8937/pm_config_target.c
+++ b/RPM.BF.2.2/rpm_proc/core/systemdrivers/pmic/config/msm8937/pm_config_target.c
@@ -66,7 +66,7 @@ static pm_rpm_ldo_rail_info_type ldo_rail_a[] =
     {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__IPEAK, PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 1775, 3325, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO14  ULT P50
     {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__IPEAK, PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 1775, 3325, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO15  ULT P50
     {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__NPM, PM_NPA_BYPASS_DISALLOWED,   PM_DROOP_DETECT_DIS, 1800, 1800, 0, PM_SETTLING_ERR_EN, PM_SETTLING_EN, 0},   // LDO16   P50 - removed in 8909
-    {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__NPM,   PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 2800, 2900, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO17  ULT P600
+    {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__NPM,   PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 2800, 3300, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO17  ULT P600
     {5, 50,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__NPM,   PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 2675, 2725, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO18  ULT P150
     {5, 62.5,   0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__IPEAK,   PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 1225, 1375, 0, PM_SETTLING_ERR_DIS, PM_SETTLING_EN, 0},   // LDO19  LDO WLAN
     {5, 250,  0, PM_ACCESS_ALLOWED, PM_NONE,      PM_NPA_SW_MODE_LDO__NPM,   PM_NPA_BYPASS_DISALLOWED, PM_DROOP_DETECT_DIS, 1740, 1740, 0, PM_SETTLING_ERR_EN, PM_SETTLING_EN, 0},   // LDO20  LDO XO LDO  - LN_LDO

(2)、

--- a/BOOT.BF.3.3/boot_images/core/systemdrivers/pmic/target/msm8937_pm8937_pmi8937/system/src/pm_sbl_boot_oem.c
+++ b/BOOT.BF.3.3/boot_images/core/systemdrivers/pmic/target/msm8937_pm8937_pmi8937/system/src/pm_sbl_boot_oem.c
@@ -75,7 +75,9 @@ pm_err_flag_type
 pm_driver_post_init (void)
 {
     pm_err_flag_type err_flag = PM_ERR_FLAG__SUCCESS;
-
+       pm_ldo_sw_enable(0, PM_LDO_17, PM_OFF); //disable LDO
+       pm_ldo_volt_level(0, PM_LDO_17, 3300000); //change LDO range
+       pm_ldo_sw_enable(0, PM_LDO_17, PM_ON); //enable LDO again

     return err_flag;
 }


(3)、

--- a/kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8937-mdss-panels.dtsi
+++ b/kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8937-mdss-panels.dtsi
@@ -35,8 +35,8 @@qcom,panel-supply-entry@0 {reg = <0>;qcom,supply-name = "vdd";
-                       qcom,supply-min-voltage = <2850000>;
-                       qcom,supply-max-voltage = <2850000>;
+                       qcom,supply-min-voltage = <3300000>;
+                       qcom,supply-max-voltage = <3300000>;qcom,supply-enable-load = <100000>;qcom,supply-disable-load = <100>;};


高通官方给出的修改建议:


1. LDO default voltage, range and default using devices can be found at PMIC device specification
doc
Such as 80-NJ117-1 table 3-7 for PM8994, 80-NT390-1 table 3-6 for PM8952
2. If you want to change the LDO voltage, please check first
a. can't set the LDO voltage bigger than the max programmable range
b. check HW, confirm the voltage don't impact other devices
c. Don't suggest change the LDO which used by RF or GPS default to other devices
3. LDO comman range and index
File: \rpm_proc\core\systemdrivers\pmic\config\common\pm_config_common.c
N1200, such as PM8994 L1
pm_pwr_volt_info_type n1200_volt[3] =
{
{ 375000, 1537500, 12500}, //LDO 0 (auto low range)
{ 375000, 1537500, 12500}, //LDO 1 (ultra low range)
{ 750000, 1537500, 12500}, //LDO 2 (low range)
};
N600, such as L26
pm_pwr_volt_info_type n600_volt[3] =
{
{ 0, 0, 0}, //LDO //invalid range -- place holder
{ 375000, 1287500, 12500}, //LDO 1 (ultra low range)
{ 750000, 1537500, 12500}, //LDO 2 (low range)
};
Other, N300, such as L2
pm_pwr_volt_info_type nmos_volt[3] =
{
{ 0, 0, 0}, //invalid range -- place holder
{ 0, 0, 0}, //invalid range -- place holder
{ 750000, 1537500, 12500}, //LDO 2 (low range)
};
PMOS LDO,
pm_pwr_volt_info_type pmos_volt[5] =
{
{ 0, 0, 0}, //invalid range -- place holder
{ 0, 0, 0}, //invalid range -- place holder
{ 750000, 1537500, 12500}, //LDO 2 (low range)
{1500000, 3075000, 25000}, //LDO 3 (mid range)
{1750000, 4900000, 50000}, //LDO 4(high range)
};4. LDO control by RPM, need to check or change the range at RPM first
You must set the voltage in one range according above table, RPM will check it, if it is not right, will
crash.
Such as PMOS,
index 2: 750mv to 1537MV
index 3: 1500mv to 3075mv
index 4: 1750mv to 4900mv
Example for L23 of PM8994,
rpm_proc\core\systemdrivers\pmic\config\msm8996\pm_config_target.c
pm_rpm_ldo_rail_info_type ldo_rail_a[] =
{
{10, 200, 0, PM_ACCESS_ALLOWED, PM_NONE, PM_NPA_SW_MODE_LDO__IPEAK,
PM_NPA_BYPASS_ALLOWED, PM_DROOP_DETECT_DIS, 2700, 2900, 0,
PM_SETTLING_ERR_EN, PM_SETTLING_EN, 0}, // LDO23 P600
}
L23 min voltage is 2700mv, max voltage is 2900mv,
From index range, L23 current index is 3,
If change L23 to 3V, can change 2900 to 3075 directly,
If change L23 to 3.3V, for PMOS index 3 max voltage is 3075V, need change to index 4,
So, can change min 1750 max 3300 or just change max to 3300, min still keep 2700
But can't change min to 1700, for index 4, min voltage is 17505. Change the codes at SBL
If LDO range is changed, must change it at SBL before RPM loaded, else will crash at RPM for
index diff.
a. If index don't change, don't need to enable LDO also, don't need to change any codes at SBL,
just need to change at kernel
b. If index don't change, need to enable LDO at SBL
pm_ldo_volt_level(0, PM_LDO_23, 3000000); //set LDO voltage
pm_ldo_sw_enable(0, PM_LDO_23, PM_ON); //enable LDO at SBL
c. If index change, LDO default is off
pm_ldo_volt_level(0, PM_LDO_23, 3300000); //change LDO range
pm_ldo_sw_enable(0, PM_LDO_23, PM_ON); //enable LDO
d. If index change, LDO default is on, need to disable it first, then change the index
pm_ldo_sw_enable(0, PM_LDO_23, PM_OFF); //disable LDO
pm_ldo_volt_level(0, PM_LDO_23, 3300000); //change LDO range
pm_ldo_sw_enable(0, PM_LDO_23, PM_ON); //enable LDO again
e. Where add the codes?
1) Old platform, such as msm8916, msm8939/8909
boot_images\core\systemdrivers\pmic\framework\src\pm_init.c
At the end of function pm_oem_init( )
2) msm8952/53/37/76 platform
This file is pm_sbl_boot_oem.c, but need to change at the right platform path,
At the end of function pm_driver_post_init ( )
Path for diff platform,
boot_images\core\systemdrivers\pmic\target\msm8953_pm8953_pmi8950\system\src\
boot_images\core\systemdrivers\pmic\target\msm8952_pm8950_pmi8950\system\src\
boot_images\core\systemdrivers\pmic\target\msm8976_pm8950_pmi8950_pm8004\
system\src
3) msm8994/96 change at XBL
\boot_images\QcomPkg\Library\PmicLib\target\msm8996_pm8994_pmi8994\system\src\
pm_sbl_boot_oem.c
At the end of function pm_driver_post_init ( )
4) At new platform must add in pm_driver_post_init ( ), if add in pm_device_post_init( ), for LDO
don't init, also will crash at RPM
6. Change the voltage at kernel
Change voltage min, max and init value at dtsi
\arch\arm\boot\dts\qcom\msm8996-regulator.dtsi
rpm-regulator-ldoa23 {
status = "okay";
pm8994_l23: regulator-l23 {
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
qcom,init-voltage = <2800000>;
status = "okay";
};
};
7. How to use the LDO at kernel side
Can check the doc 80-NV610-47 for PM8952 and 80-NM328-63 for PM8994.
One attention, must call egulator_set_optimum_mode( ) before enable LDO, it will set LDO to
normal mode.
Can check the sample codes in msm_hsusb_ldo_enable( )
static int msm_hsusb_ldo_enable( )
{
case USB_PHY_REG_3P3_ON:
ret = regulator_set_optimum_mode(hsusb_3p3,
USB_PHY_3P3_HPM_LOAD);
ret = regulator_enable(hsusb_3p3);
break;
case USB_PHY_REG_3P3_OFF:
ret = regulator_disable(hsusb_3p3);
ret = regulator_set_optimum_mode(hsusb_3p3, 0);
break;
}




http://www.ppmy.cn/news/431945.html

相关文章

android 高通分区表,高通智能机分区表详细解析

很不错的帖子,以前很多firmware里不了解的二进制格式的系统镜像都能知道大概作用了 Label Purpose of this partition Modem Partition for modemFsc Cookie partition to store Modem File System’s cookies.Ssd Partition for ssd diag modul…

android 高通替换开机logo,高通平台 开机logo 替换

经过两天的奋战终于把开机logo给搞定了啊。 首先修改开机logo要从哪里入手呢?先分析一下源码看看. ---> 1 voiddisplay_image_on_screen()2 {3 struct fbimage default_fbimg, *fbimg;4 bool flag = true;5 6 fbcon_clear();7 fbimg =fetch_image_from_partition(); //从sp…

高通联机修改IMEI等参数的相关解析

目前来说。手机芯片被高通与mtk占领大多市场。系统版本越高对底层安全参数限制就越高。区别与早期高通芯片。直接就可以联机修改imei等相关数据。今天只对高通芯片imei等参数的修改做个简单的解析说明更改高通芯片imei等参数一般有以下几种方法1----联机软件修改串码2---修改基…

MSM8976平台概述

MSM8976是从8952平台继承下来的&#xff0c;包含两组&#xff08;cluster&#xff09;core&#xff1a; 四个A72cpu核&#xff0c;支持最高1.8G主频&#xff08;MSM8976SG最高支持2G主频&#xff09;&#xff0c;有1MB大小的L2 CACHE 四个A53cpu核&#xff0c;支持最高1.4G主频…

高通8976pro手机下载端口变成900e解决办法

个人碰到两次了&#xff0c;给驱动的同事&#xff0c;都是无解&#xff0c;百度了很多相关的问题&#xff0c;什么切线&#xff0c;还有进入到fastboot模式&#xff0c;我的是adb设备都找不到的&#xff0c;无法进入fastboot模式&#xff0c;无法进入recovery模式。 第二次实在…

管理类联考——英语——趣味篇——阅读——考题的来源

Part One考研英语阅读——Part A 1.卫报 《卫报》( The Guardian)是英国的全国性综合内容日报。与《泰晤士报》、《每日电讯报》被合称为英国三大报。由约翰爱德华容泰勒创办于1821年5月5日。该报注重报道国际新闻&#xff0c;擅长发表评论和分析性专题文章。一般公众视《卫报…

【C语言复习】第二篇、VS2017软件的使用以及常用小技巧

目录 1、VS2017软件无法打开stdio.h文件的解决办法 2、VS2017软件解决scanf函数问题以及如何建立初始模板 2.1、visual Studio使用scanf函数出现报错问题 2.2、如何实现新建一个.c文件就有初始模板 3、VS2017软件如何显示代码行号&#xff1f; 4、VS2017软件如何快速复制…

JS 刷新保持iframe页面并支持浏览器前进后退

参考资料 html5新特性&#xff1a;利用history的pushState等方法来解决使用ajax导致页面后退和前进的问题击按钮切换iframe的src&#xff0c;这个路径如何不会被记录到history中&#xff1f;iframe 后退 浏览器history 问题ajax与HTML5 history pushState/replaceState实例 目…