Rockchip RK3588 kernel dts解析之电源模块_rk3588是在哪里配置电压的_loitawu的博客-程序员宅基地

技术标签: rk806  android  linux  RK3588 Kernel DTS解析  RK3588电源  RK3588  

Rockchip RK3588 kernel dts解析之电源模块

RK3588搭配的电源方案有2种

  • 单PMIC方案:1个PMIC(RK806)+3个DCDC(RK860)
  • 双PMIC方案:2个PMIC(RK806)

注意单PIMC核双PMIC的软件不能兼容

单PIMC核双PMIC的软件不能兼容,固件不能互烧,否则可能会烧坏芯片。RK的代码中有做了拦截,如果软件烧错会无法开机,并且在uboot阶段有如下提示log:

spi2: RK806: 2
HW single pmic, the firmware dual pmic(0xe8)!

单pmic方案

  • 硬件设计方案可以参考RK的硬件参考设计
  • 对应的参考完成dts参考:rk3588-evb7-lp4-v10.dts
  • 软件dts的电源配置:rk3588-rk806-single.dtsi
    PMIC(RK806)的配置是在:rk3588-rk806-single.dtsi中,如下:

&spi2 { //RK3588与RK806通信是才用spi接口
	status = "okay";
	//spi的配置,不可修改
	assigned-clocks = <&cru CLK_SPI2>;
	assigned-clock-rates = <200000000>;
	pinctrl-names = "default";
	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
	num-cs = <1>;
//rk806的配置
	rk806single: rk806single@0 {
		compatible = "rockchip,rk806";
		spi-max-frequency = <1000000>;
		reg = <0x0>;

//配置中断脚
		interrupt-parent = <&gpio0>;
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;

		pinctrl-names = "default", "pmic-power-off";
		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, <&rk806_dvs2_null>, <&rk806_dvs3_null>;
		pinctrl-1 = <&rk806_dvs1_pwrdn>;

		/* 2800mv-3500mv */
		low_voltage_threshold = <3000>;
		/* 2700mv-3400mv */
		shutdown_voltage_threshold = <2700>;
		/* 140 160 */
		shutdown_temperture_threshold = <160>;
		hotdie_temperture_threshold = <115>;

		/* 0: restart PMU;
		 * 1: reset all the power off reset registers,
		 *    forcing the state to switch to ACTIVE mode;
		 * 2: Reset all the power off reset registers,
		 *    forcing the state to switch to ACTIVE mode,
		 *    and simultaneously pull down the RESETB PIN for 5mS before releasing
		 */
		pmic-reset-func = <1>;
		
		//下面是pmic rk806需要依赖的外部电源:vcc5v0_sys、vcc_2v0_pldo_s3、vcc_1v1_nldo_s3,注意这三个电源的dts配置需要在最前面,否则可能出现开机的时候由于依赖的电源初始化太慢导致电源初始化异常,表现出来的问题是cpu的变频dvfs没有初始化成功,即cat /d//opp/opp_summary中没有cpu的频率信息。
		vcc1-supply = <&vcc5v0_sys>;
		vcc2-supply = <&vcc5v0_sys>;
		vcc3-supply = <&vcc5v0_sys>;
		vcc4-supply = <&vcc5v0_sys>;
		vcc5-supply = <&vcc5v0_sys>;
		vcc6-supply = <&vcc5v0_sys>;
		vcc7-supply = <&vcc5v0_sys>;
		vcc8-supply = <&vcc5v0_sys>;
		vcc9-supply = <&vcc5v0_sys>;
		vcc10-supply = <&vcc5v0_sys>;
		vcc11-supply = <&vcc_2v0_pldo_s3>;
		vcc12-supply = <&vcc5v0_sys>;
		vcc13-supply = <&vcc_1v1_nldo_s3>;
		vcc14-supply = <&vcc_1v1_nldo_s3>;
		vcca-supply = <&vcc5v0_sys>;
//项目中若没有用到pwerkey或者gpio功能,可以在 dts 里增加pwrkey、gpio 节点,并且显式指明状态为 status = "disabled",这样就不会使能驱动,但是开机信息会有错误 log 报出,可以忽略。
		pwrkey {
			status = "okay";
		};

		pinctrl_rk806: pinctrl_rk806 {
			gpio-controller;
			#gpio-cells = <2>;

			rk806_dvs1_null: rk806_dvs1_null {
				pins = "gpio_pwrctrl2";
				function = "pin_fun0";
			};

			rk806_dvs1_slp: rk806_dvs1_slp {
				pins = "gpio_pwrctrl1";
				function = "pin_fun1";
			};

			rk806_dvs1_pwrdn: rk806_dvs1_pwrdn {
				pins = "gpio_pwrctrl1";
				function = "pin_fun2";
			};

			rk806_dvs1_rst: rk806_dvs1_rst {
				pins = "gpio_pwrctrl1";
				function = "pin_fun3";
			};

			rk806_dvs2_null: rk806_dvs2_null {
				pins = "gpio_pwrctrl2";
				function = "pin_fun0";
			};

			rk806_dvs2_slp: rk806_dvs2_slp {
				pins = "gpio_pwrctrl2";
				function = "pin_fun1";
			};

			rk806_dvs2_pwrdn: rk806_dvs2_pwrdn {
				pins = "gpio_pwrctrl2";
				function = "pin_fun2";
			};

			rk806_dvs2_rst: rk806_dvs2_rst {
				pins = "gpio_pwrctrl2";
				function = "pin_fun3";
			};

			rk806_dvs2_dvs: rk806_dvs2_dvs {
				pins = "gpio_pwrctrl2";
				function = "pin_fun4";
			};

			rk806_dvs2_gpio: rk806_dvs2_gpio {
				pins = "gpio_pwrctrl2";
				function = "pin_fun5";
			};

			rk806_dvs3_null: rk806_dvs3_null {
				pins = "gpio_pwrctrl3";
				function = "pin_fun0";
			};

			rk806_dvs3_slp: rk806_dvs3_slp {
				pins = "gpio_pwrctrl3";
				function = "pin_fun1";
			};

			rk806_dvs3_pwrdn: rk806_dvs3_pwrdn {
				pins = "gpio_pwrctrl3";
				function = "pin_fun2";
			};

			rk806_dvs3_rst: rk806_dvs3_rst {
				pins = "gpio_pwrctrl3";
				function = "pin_fun3";
			};

			rk806_dvs3_dvs: rk806_dvs3_dvs {
				pins = "gpio_pwrctrl3";
				function = "pin_fun4";
			};

			rk806_dvs3_gpio: rk806_dvs3_gpio {
				pins = "gpio_pwrctrl3";
				function = "pin_fun5";
			};
		};
//下面是根据硬件图进行对应的软件配置,以硬件设计一一对应
		regulators {
		//给gpu供电的配置,对应的硬件是RK806的BUCK1
			vdd_gpu_s0: vdd_gpu_mem_s0: DCDC_REG1 { 
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <550000>;
				regulator-max-microvolt = <950000>;
				regulator-ramp-delay = <12500>;
				regulator-name = "vdd_gpu_s0";
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

	........
	//avcc_1v8_s0供电的配置,对应的硬件是RK806的PLDO1	
			avcc_1v8_s0: PLDO_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "avcc_1v8_s0";
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

		........
//vdd_0v75_s3供电的配置,对应的硬件是RK806的NLDO1	
			vdd_0v75_s3: NLDO_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <750000>;
				regulator-max-microvolt = <750000>;
				regulator-name = "vdd_0v75_s3";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <750000>;
				};
			};

		........
		};
	};
};

3个DCDC(RK860)的配置在:rk3588-evb7-lp4-v10.dtsi中,如下:

//I2C0上面挂这1一个RK860-2和一个RK860-3,分别给大核cpu4-5和大核cpu6-7供电
&i2c0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0m2_xfer>;

	vdd_cpu_big0_s0: vdd_cpu_big0_mem_s0: rk8602@42 {
		compatible = "rockchip,rk8602";
		reg = <0x42>;
		vin-supply = <&vcc5v0_sys>;
		regulator-compatible = "rk860x-reg";
		regulator-name = "vdd_cpu_big0_s0";
		regulator-min-microvolt = <550000>;
		regulator-max-microvolt = <1050000>;
		regulator-ramp-delay = <2300>;
		rockchip,suspend-voltage-selector = <1>;
		regulator-boot-on;
		regulator-always-on;
		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};

	vdd_cpu_big1_s0: vdd_cpu_big1_mem_s0: rk8603@43 {
		compatible = "rockchip,rk8603";
		reg = <0x43>;
		vin-supply = <&vcc5v0_sys>;
		regulator-compatible = "rk860x-reg";
		regulator-name = "vdd_cpu_big1_s0";
		regulator-min-microvolt = <550000>;
		regulator-max-microvolt = <1050000>;
		regulator-ramp-delay = <2300>;
		rockchip,suspend-voltage-selector = <1>;
		regulator-boot-on;
		regulator-always-on;
		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};
};
//I2C1上面挂这1一个RK860-2给NPU供电
&i2c1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c1m2_xfer>;

	vdd_npu_s0: vdd_npu_mem_s0: rk8602@42 {
		compatible = "rockchip,rk8602";
		reg = <0x42>;
		vin-supply = <&vcc5v0_sys>;
		regulator-compatible = "rk860x-reg";
		regulator-name = "vdd_npu_s0";
		regulator-min-microvolt = <550000>;
		regulator-max-microvolt = <950000>;
		regulator-ramp-delay = <2300>;
		rockchip,suspend-voltage-selector = <1>;
		regulator-boot-on;
		regulator-always-on;
		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};
};

外部电源配置
外部电源是指pmic依赖的电源,在dts配置的时候这些电源的配置需要在pmic的配置前面,这样开机是才能正常初始化,否则可能出现CPU电源异常的问题,表现为CPU变频无法正常使用,cat /d/opp/opp_summary里面没有cpu的频率信息。
这部分配置在rk3588-evb.dtsirk3588-evb7-lp4.dtsi中:

rk3588-evb.dtsi
//对应硬件图上面12V DC输入电源
vcc12v_dcin: vcc12v-dcin {
    
		compatible = "regulator-fixed";
		regulator-name = "vcc12v_dcin";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
	};

//对应硬件图上面5V 系统电源
	vcc5v0_sys: vcc5v0-sys {
    
		compatible = "regulator-fixed";
		regulator-name = "vcc5v0_sys";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&vcc12v_dcin>;
	};
rk3588-evb7-lp4.dts
	vcc_1v1_nldo_s3: vcc-1v1-nldo-s3 {
    
		compatible = "regulator-fixed";
		regulator-name = "vcc_1v1_nldo_s3";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <1100000>;
		regulator-max-microvolt = <1100000>;
		vin-supply = <&vcc5v0_sys>;
	};

双pmic方案

  • 硬件设计方案可以参考RK的RK3588 EVB1的硬件参考设计
  • 对应的参考完成dts参考:rk3588-evb1-lp4-v10.dts
  • 软件dts的电源配置:
    rk3588-rk806-dual.dtsi (针对RK3588芯片)
    rk3588s-rk806-dual.dtsi (针对RK3588芯片)

2个PMIC(RK806)的配置在rk3588-rk806-dual.dtsi中如下:

&spi2 {//RK3588与RK806通信是才用spi接口
//spi配置,不可修改
        status = "okay";
        assigned-clocks = <&cru CLK_SPI2>;
        assigned-clock-rates = <200000000>;
        num-cs = <2>;
        rk806master@0 {
                compatible = "rockchip,rk806";
                spi-max-frequency = <1000000>;
                reg = <0x0>;
	//配置power脚中断
                interrupt-parent = <&gpio0>;
                interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
                /* 0: restart PMU;
                 * 1: reset all the power off reset registers,
                 *    forcing the state to switch to ACTIVE mode;
                 * 2: Reset all the power off reset registers,
                 *    forcing the state to switch to ACTIVE mode,
                 *    and simultaneously pull down the RESETB PIN for 5mS before releasing
                 */
                pmic-reset-func = <1>;

                vcc1-supply = <&vcc5v0_sys>;
                vcc2-supply = <&vcc5v0_sys>;
                .................
                vcca-supply = <&vcc5v0_sys>;
                regulators {
                        vdd_gpu_s0: DCDC_REG1 {
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <550000>;
                                regulator-max-microvolt = <950000>;
                                regulator-ramp-delay = <12500>;
                                regulator-name = "vdd_gpu_s0";
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                      };
                        vdd_npu_s0: DCDC_REG2 {
                        .................
                        };
                        .................
              };
       };
       rk806slave@1 {
                compatible = "rockchip,rk806";
                spi-max-frequency = <1000000>;
                reg = <0x01>;

                interrupt-parent = <&gpio0>;
                interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
                /* 0: restart PMU;
                 * 1: reset all the power off reset registers,
                 *    forcing the state to switch to ACTIVE mode;
                 * 2: Reset all the power off reset registers,
                 *    forcing the state to switch to ACTIVE mode,
                 *    and simultaneously pull down the RESETB PIN for 5mS before releasing
               */
                pmic-reset-func = <1>;

                vcc1-supply = <&vcc5v0_sys>;
                vcc2-supply = <&vcc5v0_sys>;
                .................
                vcca-supply = <&vcc5v0_sys>;

                pwrkey {
                        status = "disabled";
                };
                regulators {
                        vdd_cpu_big1_s0: DCDC_REG1 {
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <550000>;
                                regulator-max-microvolt = <950000>;
                                regulator-ramp-delay = <12500>;
                                regulator-name = "vdd_cpu_big1_s0";
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
                        vdd_cpu_big0_s0: DCDC_REG2 {
                        .................
                        };
                        .................
                };
       };
};

上一篇:Rockchip RK3588 kernel dts解析之显示模块
下一篇:Rockchip RK3588 kernel dts解析之USB模块

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_43245753/article/details/123496232

智能推荐

Mybatis(3) 属性配置文件-程序员宅基地

属性配置文件在使用Mybatis时候需要编写配置文件以指定其运行时候所需要的信息。包含了一系列的标签,大致有以下的几个类别:properties:属性标签settings:全局配置参数标签typeAliases:类型别名标签typeHandlers:类型处理器标签objectFactory:对象工厂plugins:插件environments:环境集合属性对象environ...

将文本文件(txt)的内容导入到Excel和SQL-程序员宅基地

这两天网络上流传14w条12306账号信息的txt文档,下载下来之后发现在txt文档中看和查询内容都不是很方便。这里我就记录下如何将txt文档导入到excel和SQL的过程。导入到excel1. 新建一个excel,在Ribbon的Data选项中选择From text:2. 文本转换excel 的向导:step 1:使用默认的选项step 2:选择分隔符,在txt中...

搭建socks5服务器-程序员宅基地

一、编译安装:tar zxvf ./ss5-3.8.9-8.tar.gzcd ss5-3.8.9yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel openssl-devel./configuremakemake install二、自启动chmod +x /etc/init.d/ss5chkconfig --add ss5chkconfig --level 34_搭建socks5服务器

HTML5 向网页嵌入视频和音频-程序员宅基地

来源 |http://www.fly63.com/article/detial/9503现在很多网站上都会使用到视频和音频,html5 中提供了展示视频和音频的标签。向网页嵌入视频可以..._网页中镶嵌视频怎么做

SQLite笔记-基本命令-c语言的使用_sqlite使用 c语言-程序员宅基地

一、数据库介绍1、数据库的基本概念数据能够输入计算机并能被计算机程序识别和处理的信息集合数据库数据库是在数据库管理系统管理和控制之下,存放在存储介质上的数据集合2、常用的数据库1)大型数据库1)oracle公司是最早开发数据库的厂商之一,目前oracle关系数据卡产品的市场占有率名列前茅。2)IBM的DB2是第一个具备上网功能的多媒体关系数据库管理系统,支持linux在内的一系列..._sqlite使用 c语言

java jdbc导出pdf_使用Java将数据从数据库中导出为PDF_维几的博客-程序员宅基地

本文将向您展示如何使用 Free Spire.PDF for Java 将数据从Microsoft Access数据库导出到PDF表格。 此外,本文还解决了一些其他的相关问题。如果表格超过一页,如何对表格进行分页?如何格式化表格,例如,如何设置交替行颜色,以及如何在单元格中对齐文本?如何检测到表格底部,以便我们可以在下面添加其他内容?注:JDBC-ODBC Bridge已从Java SE 8中删除..._java将数据库中数据批量写入自定义pdf文件导出

随便推点

IT和烹饪,哪个更难?(2)-程序员宅基地

锐哥:“决胜点在于长期的点滴积累,认证证书、成绩、丰富的经历是求职的表面文章,在目前软件行业里不是很看中这个,真正的‘内功’是需要规划的。至于培训,我倒是很建议直接加入软件公司,你就会学到很多实际的东西。不过,学历教育虽然在职业生涯里不是主要的,但是随着职位的提升却有很重要的意义,能辅助拓展你的职业发展空间,而不是以此为阻碍从而失去更多的机会。 ”“已经工作两年以上的程序员可以有几种基本的

webpack4 filemanager-webpack-plugin 打zip包失败问题_filemanagerplugin 没有生成zip-程序员宅基地

今天webpack4的项目。用filemanager-webpack-plugin 插件打zip包,发现打出的包没有内容,或者不能解压。看了一下filemanager-webpack-plugin,还是2.0.5版本。果断升级目前用的6.1.7版本。配置后发现打包正常了filemanager-webpack-plugin 的 3.0版本以后配置方式有变化,多了events层附上新的配置方式const plg = [ new FileManagerPlugin({ _filemanagerplugin 没有生成zip

[Java]高能-绝对专业-快速傅立叶变换(FFT/DFT)算法实现_java ftt_yaoxinghuo的博客-程序员宅基地

高能️(如果您没有听过或不是要寻找快速傅立叶变换Fast Fourier transform(FTT)/离散傅里叶变换Discrete Fourier Transform(DFT)相关的问题,请直接无视这篇文章)遇到一个通讯专业-波形频谱信号????分析的项目,需要把一组数据做快速傅立叶变换(FTT)后,画出图形(如下图)我也不是通信专业的,不懂什么FFT变换,在专业老师的指导下,网上找了相关的算法的代码(如果没有方向,而且专业性特强,很难找),故分享到这里,供有需要的朋友参考。我一共_java ftt

以下属于python中文分词方向第三方库的是_以下选项中是 Python 中文分词的第三方库的是( )...-程序员宅基地

在数控机床上,确定坐标轴的先后顺序为:()。A.X轴—Y轴—Z轴B.X轴—Z轴—Y轴C.Z轴—Y轴—X轴D.Z轴—X在野外遇见伤病的猛禽,你若要救助时,通知野生动物救护中心,等待时应该怎么做?A、放在纸箱子里并人是幼儿园各种资源的核心。()慢性肾衰竭尿毒症患者出现烦躁不安、胸闷、心悸、咳嗽、咳白色泡沫样痰时应考虑尿毒症引起的心力衰竭。()刘女士,28岁,孕39周,宫口开全2小时后未分娩,检查:胎头..._以下选项中是拍成中文分词的第三方库的是

全球及中国稀土磁性材料行业运行格局及未来前景趋势预测报告2021-2027年版_稀土软磁白皮书-程序员宅基地

全 2020年,全球稀土磁性材料市场规模达到了 百万美元,预计2027年可以达到 百万美元,年复合增长率(CAGR)为 % (2021-2027)。中国市场规模增长快速,预计将由2020年的 百万美元增长到2027年的 百万美元,年复合增长率为 % (2021-2027)。本报告研究“十三五”期间全球及中国市场稀土磁性材料的供给和需求情况,以及“十四五”期间行业发展预测。重点分析全球主要地区稀土磁性材料的的产能、销量、收入和增长潜力,历史数据2016-2020年,预测数据2021-202..._稀土软磁白皮书

Java中基本数据类型和包装类对象使用==和equals()进行比较的结果_基本数据类型的equals比较结果是_未晚ne的博客-程序员宅基地

这是经代码验证后的一个小结,简单明了,希望有所帮助。// 一、值不同:使用 == 和 equals()都是 false// 二、值相同:比较:基本数据类型 ----包装类对象(只要值相同,无论是 == 还是 equals 都是 true)Integer a = 128;int b = 128;System.out.println(a == b); //trueSystem.out.println(a.equals(b)); //true// 二、值相同:包装类对象 ----- 包装类对._基本数据类型的equals比较结果是

推荐文章

热门文章

相关标签