Rockchip RK3588 kernel dts解析之电源模块_瑞芯微 rk806-程序员宅基地

技术标签: 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

智能推荐

9.任务段(TSS)_tss段-程序员宅基地

文章浏览阅读1k次。在调用门、中断门与陷阱门中,一旦出现权限切换,那么就会有堆栈的 ,切换。而且,由于CS的CPL发生改变,也导致了SS也必须要切换。切换时,会有新的ESP和SS(CS是由中断门或者调用门指定)这2个值从哪里来的呢?答案: TSS (Task-state segment ),任务状态段TSS就是一块内存,大小104个节不要把TSS与任务切换联系到一起TSS的意义就在于可以同时换掉一堆寄存器..._tss段

学习使用简单的php-程序员宅基地

文章浏览阅读47次。配置文件在:/etc/php5/$中,不同的模式含有自己的php.ini配置文件。php可以运行于多种模式:cgi、fastcgi、cli、web模块模式等4种;我现在使用的模式是cli模式,这里进行一次测试。在ubuntu下需要安装sudo apt-get install php5-devphp应该是php5的链接。修改config.m4文件:..._php 简单项目 为学习用

解决ios,iphone的safari浏览器h5自动放大,input获得焦点页面被放大_ios浏览器小于15像素的时候会进行放大-程序员宅基地

文章浏览阅读1.2k次。得到焦点之前设置font-size:16像素。_ios浏览器小于15像素的时候会进行放大

SpringBootAdmin 服务搭建记录_spring boot admin client与spring boot admin server都-程序员宅基地

文章浏览阅读520次。搭建过程网上很多, 主要是各个依赖的版本, 导致的各种 jar 包问题, 此处记录下我的 pom 和 yml 文件目录SpringAdmin server pom文件1. SpringAdmin server 配置(1) pom文件<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-p..._spring boot admin client与spring boot admin server都配置spring-boot-starter-

python3中图像识别的应用open-CV库_python open-cv 小图搜大图-程序员宅基地

文章浏览阅读1.4k次。python3中图像识别的应用open-CV库什么是open-CV?OpenCV是一个基于BSD许可(开源)发行的跨平台计算机视觉库,可以运行在Linux、Windows、Android和Mac OS操作系统上。它轻量级而且高效——由一系列 C 函数和少量 C++ 类构成,同时提供了Python、Ruby、MATLAB等语言的接口,实现了图像处理和计算机视觉方面的很多通用算法(百度百科)。代码:定义图像识别的类import cv2import osfrom PIL import ImageGr_python open-cv 小图搜大图

Linux下安装anaconda3_anaconda do you wish to process the-程序员宅基地

文章浏览阅读1w次,点赞2次,收藏19次。1.下载anaconda清华大学开源软件镜像站anaconda下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/2.安装Anaconda$ sudo sh Anaconda3-5.3.0-Linux-x86_64.sh [sudo] andrew 的密码: Welcome to Anaconda3 5.3.0In o..._anaconda do you wish to process the

随便推点

k8s 安装 kubernetes-dashboard-2.X_kubernetes 2.x-程序员宅基地

文章浏览阅读10w+次。安装使用 k8s 原生的 web图形化界面_kubernetes 2.x

saltstack自动化运维管理——saltstack之salt远程执行_salt 远程执行命令-程序员宅基地

文章浏览阅读287次。目录一、Salt命令的构成1、target2、funcation3、arguments二、编写远程执行模块1、编写模块2、了解YAML语法3、SLS4、配置管理(1)方法一(2)方法二(3)方法三(4)一些例子一、Salt命令的构成Salt命令由三个主要部分构成:salt '<target>' <function> [arguments]1、targettarget: 指定哪些minion, 默认的规则是使用glob匹配minion id。salt '*' test._salt 远程执行命令

关于协方差,协方差矩阵的个人理解_协方差矩阵的ρ-程序员宅基地

文章浏览阅读1.9k次,点赞3次,收藏10次。文章目录协方差协方差定义举例说明方差相关系数协方差矩阵(covariance matrix)举例说明数学符号表示协方差矩阵的应用马氏距离数学符号定义PCA降维使用sklearn中的np.cov遇到的坑协方差协方差定义协方差(Covariance)在概率论和统计学中用于衡量两个变量的总体误差。设有随机变量XXX和随机变量YYY,则协方差定义为:Cov(X,Y)=E((X−E[x])(Y−E[Y]))=E((Y−E[Y])(X−E[X]))Cov(X,Y)=E((X-E[x])(Y-E[Y]))_协方差矩阵的ρ

【LaTeX】LaTeX/Algorithms 伪代码_latex algorithm return-程序员宅基地

文章浏览阅读1.5k次,点赞2次,收藏4次。algorithmic和algorithmicx介绍下algorithmic和algorithmicx,这两个包很像,很多命令都是一样的,只是algorithmic的命令都是大写,algorithmicx的命令都是首字母大写,其他小写(EndFor两个大写)。下面是algorithmic的基本命令。\STATE <text>\IF{<condition>} \STATE{<text>} \ENDIF\FOR{<condition>} \STATE{_latex algorithm return

Linux和Windows操作系统,MySQL数据库备份(导出)和恢复(导入)_.nb3文件如何打开-程序员宅基地

文章浏览阅读1.3k次。方式一:通过终端执行命令(适用于Linux操作系统)备份:将DATABASENAME数据库备份到/opt目录生成DATABASENAME.db备份文件mysqldump -uUSERNAME-pPASSWORD--routines --databases DATABASENAME> /opt/DATABASENAME.db登录MySQL:mysql -uUSERNAME -pPASSWORD删除数据库:drop database DATABASENAME;创建数据库:crea..._.nb3文件如何打开

推荐文章

热门文章

相关标签