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

比如以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>;


圖1

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


圖2

我們的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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章