红联Linux门户
Linux帮助

linux device tree的board-id、qcom,msm-id、qcom,pmic-id属性

发布时间:2016-10-20 09:49:19来源:linux网站作者:loongembedded
比如以qcom平台为例来说明:
 
1.qcom,board-id
\kernel\Documentation\devicetree\bindings\arm\msm\board-id.txt文件的解释如下:
The cell layout of the qcom,board-idproperty is as follows:  
qcom,board-id = <board_id, reserved>
where board_id is a 32-bit integer whosebit values are defined as follows:  
bits 31-24 = Platform Subtype ID  
bits 23-16 = Platform Version (Major)  
bits 15-8  = Platform Version(Minor)  
bits  7-0  =Platform Type ID
我们这里msm8909-1gb-qrd-skue.dts文件相关内容如下:
qcom,board-id=<0x1000b0x9>;
linux device tree的board-id、qcom,msm-id、qcom,pmic-id属性
and the 'reserved' cell is a 32-bit integerwhose bit values are defined as follows:  
bits 31-13 = Reserved Bits  
bits 12-11 = Panel Detection. 00 - limit to HD, 01 - limit to 720p,  
10 - limit to qHD, 11 - limit to FWVGA  
bits 10-8  = DDR Size. For deviceswith DDR Size as 512MB the value is 0x1,  
default value as 0x0  
bits 7-0   = Platform Subtype
我们这里是reserved= 0x9
linux device tree的board-id、qcom,msm-id、qcom,pmic-id属性
我们的bits 12-11 = Panel Detection. 00 -limit to HD,HD是指HighDefinition(高清),表示分辨率在720p及以上,
In the event that a given device tree isapplicable to all hardware versions
matching a given Platform Type / SubtypeID, the major/minior platform version
fields in the board_id property shall bothbe specified as 0xff.
 
2.qcom,msm-id
下面来看\kernel\Documentation\devicetree\bindings\arm\msm\msm-id.txt的说明
The qcom,msm-id entry specifies the MSMchipset, platform, hardware revision  
and optional manufactured foundry.It can optionally be an array of these to  
indicate multiple hardware that use thesame device tree.It is expected that  
the bootloader will use this information atboot-up to decide which device tree  
to use when given multiple device trees,some of which may not be compatible  
with the actual hardware.  It is the bootloader's responsibility to passthe  
correct device tree to the kernel.
qcom,msm-id入口指定msm芯片组(比如msm8909)、platform(比如QRD平台)、硬件版本(比如QRD平台的硬件版本,见图1)和可选的manufacturedfoundry,msm-id后面可以是一个指示多个硬件平台采用同一个设备树的数组。Bootloader在启动时使用这些信息来决定在多个硬件平台中采用哪个设备树。Bootloader找到匹配的设备树信息(dtb文件)传递给kernel。
Format: 
It is expected that the qcom,msm-id entrybe at the top level of the device  
tree structure.  The format can take one of the two formsbelow:  
qcom,msm-id = <chipset_foundry_id, platform_id, rev_id> [, <c2,p2, r2> ...]  
qcom,msm-id = <chipset_foundry_id, rev_id> [, <c2, r2> ...]//我们采用这种    
If the second format is used one must alsodefine the board-id.  
The "chipset_foundry_id" consistsof three fields as below:  
bits 0-15  = The unique MSMchipset id.  
bits 16-23 = The optional foundry id. If bootloader doesn't find adevice  
treewhich has exact matching foundry-id with hardware it  
choosesthe device tree with foundry-id = 0.  
bits 24-31 = Reserved.
Example:  
qcom,msm-id = <0x1007e 15 0>;  
qcom,board-id= <15 2>;  
qcom,msm-id = <0x1007e 0>;
比如我们Msm8909.dtsi内容如下:
qcom,msm-id =   <245 0>,//对应msm8909
<2580>,//对应MSM8209
<2650>,//对应APQ8009
<2750>;//对应MSM8609
这些值对应于\bootable\bootloader\lk\platform\msm_shared\smem.h的定义:、
/* chip information */  
enum {  
UNKNOWN= 0,  
MDM9200= 57,  
…  
MSM8909  = 245,  
MSM8209  = 258,  
…  
APQ8009  = 265,  
…  
MSM8609  = 275,  
};
 
3.qcom,pmic-id
下面来看\kernel\Documentation\devicetree\bindings\arm\msm\pmic-id.txt的说明
The qcom,pmic-id entry specifies the PMICchips used on a given MSM platform.  
指定一个给定MSM平台使用的PMIC芯片集  
It is expected that the bootloader will usethis information at boot-up to  
decide which device tree to use when givenmultiple device trees, some of which  
may not be compatible with the actualhardware. It is the bootloader's  
responsibility to pass the correct devicetree to the kernel.  
The cell layout of the qcom,pmic-idproperty is as follows:  
qcom,pmic-id = <pmic1 pmic2 pmic3 pmic4> [, <pmic1 pmic2 pmic3pmic4> ...];
where a given "pmic#" cell is a32-bit integer which is defined as follows:  
bits 31-24 = unused  
bits 23-16 = PMIC major version  
bits 15-8  = PMIC minor version  
bits 7-0   = PMIC model number
The PMIC values in each tuple must belisted in ascending order of their global  
SPMI slave id for a given board. Note thatany missing entries need to be  
denoted by 0x0 to complete a given tuple.The ordering of tuples within the  
property is arbitrary.
Examples:  
qcom,pmic-id = <0x10009 0x1000A 0x0 0x0>,  
<0x20109 0x1000A 0x00x0>;
比如我们的msm8909-pm8909.dtsi文件内容如下:
qcom,pmic-id = <0x1000D 0x0 0x0 0x0>;
表示我们msm8909芯片的QRD平台只用到一个PMIC。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25202.html