高通安卓平台BOARD-ID和MSM-ID

BOARD-ID

说明文档目录:kernel/msm4.14/Documentation/devicetree/bindings/arm/msm/board-id.txt 翻译如下

传统格式

The qcom,board-id entry specifies the MSM platform and subtype revision.
It can optionally be an array of these to indicate multiple hardware that use
the same device tree.  It is expected that the bootloader will use this
information at boot-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 pass the correct device tree to the kernel.

高通的board-id条目指定了MSM平台和其子类型的版本。
他能够可选择地(optionally)成为一个以上类型的组合,用于识别出共用设备树文件的不同的硬件。bootloader(引导装载程序)在给定多个设备树文件时用board id的信息来决定使用哪个设备树文件来启动。(其他的设备树文件跟实际的硬件并不匹配)BOOTLOADER负责将正确的设备树文件传递给内核。

Legacy format:
It is expected that the qcom,board-id entry be at the top level of the device
tree structure.  The format of the entry is:
qcom,board-id = <platform_id, subtype_id> [, <p2, s2> ...]

传统格式:
高通的board-id条目需要放在设备树文件的最开头部分(见下图),格式如下
在这里插入图片描述

qcom,board-id = <platform_id, subtype_id> [, <p2, s2> …]
举例:qcom,board-id = <0x00010b, 0xA>

where platform_id and subtype_id are the numeric values for the platform and
subtype of the current hardware.
The "subtype_id" cell is a 32-bit integer whose bit values are defined as follows:
    bits 31-20 = Reserved bits
    bits 19-16 = Boot Device Type.
		 MSM:
		     0: default (eMMC)
		     2: EMMC_SDC1
		     4: BOOT_UFS
		 MDM:
		     0: default (NAND)
		     3: EMMC_SDC1
    bits 15-8  = DDR Size. For devices with DDR Size as 512MB the value is 0x1, default value as 0x0
    bits 7-0   = Platform Subtype

当board id中的platform_id 和 subtype_id 与 当前的硬件上的 平台类型和子类型一致时,
subtype_id是一个32位的整形数,它的位定义如下

31-2019-1615-87-0
保留位启动设备类型DDR内存尺寸:0x0 为默认值,0x1为512MB平台子类型(Platform Subtype)
In the event that a given device tree is applicable to all hardware versions
matching a given Platform Type / Subtype ID, the major/minior platform version
fields in the board_id property shall both be specified as 0xff.

如果给定的设备树适用于所有硬件版本,匹配给定的平台类型/子类型ID,即主/次平台版本
board_id属性中的字段都应该指定为0xff。

最新的格式

Modern format:
The cell layout of the qcom,board-id property is as follows:
   qcom,board-id = <board_id, reserved>
where board_id is a 32-bit integer whose bit 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

and the 'reserved' cell is a 32-bit integer whose 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 devices with DDR Size as 512MB the value is 0x1,
		 default value as 0x0
    bits 7-0   = Platform Subtype

最新的格式:
qcom,board-id属性的单元格布局如下:

qcom,board-id = <board_id, reserved>

board_id是一个32位的整型数,它的位定义如下:

31-2423-1615-87-0
平台子类型ID(Platform Subtype ID)平台版本(Platform Version (Major))平台版本(Platform Version (Minor))平台类型ID(Platform Type ID)
‘reserved’ 单元也是一个32位的整型数,它的各个位定义如下:
31-1312-1110-87-0
保留位屏幕检测:00 HD, 01 720P, 10 qHD, 11 FWVGADDR内存尺寸:0x0 为默认值,0x1为512MB平台子类型(Platform Subtype)
In the event that a given device tree is applicable to all hardware versions
matching a given Platform Type / Subtype ID, the major/minior platform version
fields in the board_id property shall both be specified as 0xff.

如果给定的设备树适用于所有硬件版本,匹配给定的平台类型/子类型ID,即主/次平台版本
board_id属性中的字段都应该指定为0xff。
Example:
qcom,board-id = <15 0>;
qcom,board-id = <0x01040708, 0>;
qcom,board-id = <0x01ffff08, 0>;
qcom,board-id = <8, 0x100>;

MSM-ID

文档说明目录:kernel/msm4.14/Documentation/devicetree/bindings/arm/msm/msm-id.txt

The qcom,msm-id entry specifies the MSM chipset, platform, hardware revision
and optional manufactured foundry.  It can optionally be an array of these to
indicate multiple hardware that use the same device tree.  It is expected that
the bootloader will use this information at boot-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 pass the
correct device tree to the kernel.

qcom, MSM -id条目指定MSM芯片组,平台,硬件版本和制造厂商。它能够可选择地(optionally)成为一个以上类型的组合,用于识别出共用设备树文件的不同的硬件。bootloader(引导装载程序)在给定多个设备树文件时用board id的信息来决定使用哪个设备树文件来启动。(其他的设备树文件跟实际的硬件并不匹配)BOOTLOADER负责将正确的设备树文件传递给内核。

Format:
It is expected that the qcom,msm-id entry be at the top level of the device
tree structure.  The format can take one of the two forms below:
 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 also define the board-id.

高通的msm-id条目需要放在设备树文件的最开头部分(见下图),格式有如下两种
qcom,msm-id = <chipset_foundry_id, platform_id, rev_id> [, <c2, p2, r2> …]
qcom,msm-id = <chipset_foundry_id, rev_id> [, <c2, r2> …]
第二种格式在使用的过程中,需要同时定义board-id.

The "chipset_foundry_id" consists of three fields as below:
   bits 0-15  = The unique MSM chipset id.  
   bits 16-23 = The optional foundry id. If bootloader doesn't find a device
		tree which has exact matching foundry-id with hardware it
		chooses the device tree with foundry-id = 0.
   bits 24-31 = Reserved.

chipset_foundry_id单元中包含如下三部分的信息:

31-2423-1615-0
保留位厂商ID,如果BOOTLOADER不能够精确匹配硬件厂商ID,那BootLoader会选择厂商ID为0的设备树唯一的芯片ID

Example:
qcom,msm-id = <0x1007e 15 0>;

qcom,board-id= <15 2>;
qcom,msm-id = <0x1007e 0>;

以下是对这段代码的逐行逐段中文解释: --- ### 第一部分:版权与许可信息 ```c // SPDX-License-Identifier: BSD-3-Clause ``` - **SPDX 标识符**:这是文件头部的一个声明,表示该文件遵循 `BSD-3-Clause` 开源许可证协议。 ```c /* * OnePlus 5T (dumpling) device tree * * Copyright (c) 2021, Jami Kettunen <jamipkettunen@gmail.com> */ ``` - 这是一个注释块: - 文件描述:这是一个针对一加手机 5T(代号为 dumpling)设备树(Device Tree)的配置文件。 - 版权归属:作者是 Jami Kettunen,并且在 2021 年发布。 --- ### 第二部分:包含公共头文件 ```c #include "msm8998-oneplus-common.dtsi" ``` - 使用了 C 风格的 `#include` 指令引入了一个外部 Device Tree Source Include (DTSI) 文件。 - `msm8998-oneplus-common.dtsi` 是一个通用的设备树片段,包含了高通骁龙 MSM8998 芯片组一加系列手机的一些共享设置。 --- ### 第三部分:根节点定义 ```c / { model = "OnePlus 5T"; compatible = "oneplus,dumpling", "qcom,msm8998"; chassis-type = "handset"; /* Required for bootloader to select correct board */ qcom,board-id = <8 0 17801 43>; }; ``` #### 解析: 1. `/ { }` 表示设备树中的根节点。 - 所有子节点都将挂载在这个根节点下。 2. ```c model = "OnePlus 5T"; ``` - 定义了模型名称,标明此设备是一加手机 5T。 3. ```c compatible = "oneplus,dumpling", "qcom,msm8998"; ``` - `compatible` 属性用于标识当前硬件兼容性: - `"oneplus,dumpling"` 表明这是特定于 One Plus Dumpling 设备的配置。 - `"qcom,msm8998"` 表明它是基于 Qualcomm MSM8998 SoC 的设备。 4. ```c chassis-type = "handset"; ``` - 声明这是一款手持设备(智能手机或类似产品)。 5. ```c /* Required for bootloader to select correct board */ qcom,board-id = <8 0 17801 43>; ``` - 注释说明这个属性是为了引导程序正确选择板卡而设计的。 - `<8 0 17801 43>` 是一组数字参数,具体含义由高通引导加载程序解析,可能涉及芯片变体、版本或其他内部识别机制。 --- ### 第四部分:帧缓冲区高度调整 ```c /* Update the screen height values from 1920 to 2160 on the 5T */ &framebuffer0 { height = <2160>; }; ``` #### 解析: 1. `&framebuffer0` 引用了已经通过其他 DTS 或 DTSI 文件定义好的节点 `framebuffer0`。 2. 将屏幕的高度从默认值更新为 `2160` 像素: - 这是因为一加 5T 具有一个更高分辨率的显示屏(可能是 AMOLED 类型),需要重新定义其显示区域的高度。 --- ### 第五部分:触控屏尺寸调整 ```c /* Adjust digitizer area height to match the 5T's taller panel */ &rmi4_f12 { touchscreen-y-mm = <137>; }; ``` #### 解析: 1. `&rmi4_f12` 同样引用了一个已存在的节点 `rmi4_f12`,通常代表 Synaptics 触摸控制器的相关配置。 2. 设置触摸屏 Y 方向的实际物理高度为 `137 mm`: - 这个数值确保系统能够准确映射屏幕上用户输入的位置到实际像素坐标上。 - 因为一加 5T 显示面板比之前某些机型更长,所以这里对触控区域也进行了相应的扩展。 --- ### 总结 整个设备树文件的作用可以概括如下: 1. 确定了一加 5T 移动设备的基本硬件特性; 2. 自定义了一些关键组件的具体参数(如显示器分辨率为 2160x... 对应的触控范围)以匹配该型号的特点; 3. 包含必要的元数据供操作系统内核及固件初始化时参考。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值