MSM8937的sbl1和CDT

PBL的功能

       8937是基于cortex A53的,系统在上电的一刻起,会执行固化在application process(即处理器)的ROM里的一段代码(称为PBL,primary bootloader)。这段程序的主要功能是启动起来和接口探测,支持紧急下载模式(Emergency download mode),通过L2TCm加载和验证SBL1 ELF,加载RPM的固件到RPM的code ram。

SBL1的功能

        初始化memory子系统(总线,DDR,clock和CDT),加载和验证TrustZone,DEVCFG,RPM_FW,APPS BL image,dump memory通过usb2.0和Sahara协议,usb driver support,usb charging(usb充电),thermal check(温度检测),PMIC 的驱动,配置DDR,flash L1/L2/ETB

缩写

CDT:software Configuration Data Table  配置数据表

CDB:configuration data block配置数据块

CDT结构

CDT主要包括3个主要部分

-CDT header   CDT头部

>>magic number 4字节,magicnumber是0x43445400 

>>version number 2字节无符号书 小端对齐

>>两个reserved fields 两个4字节保留区域,应该是留作以后使用

-block meta section  数据数员元素

>>block offset 定义了对应的CDB的第一个字节在CDT的偏移

>>block size 定义了对应的CDB的大小

-individual CDBs

>>CDB0-Platform ID 平台ID

>>CDB1-DDR parameters DDR的参数

>>其它CDB-用户定义的数据

CDT的结构如下表所示

CDB的定义

CDB0是platform ID 平台ID

BLOCK0

CDB0 is fixed to be a 4 or 5-byte platform ID value.

Byte 0 (the most significant byte) represents the version number. From MSM8974 onwards, value 0x3 is used.

Byte 1 represents the platform type. 

It has the following values:

0x0 – Unknown or unprogrammed

0x1 – Core development platform (CDP)

0x2 – Form factor accurate (FFA)

0x3 – Forward looking user interface device (FLUID)

0x4 – Fused

0x5 – Reserved for OEMs

0x7 – MTP for MDM chipset

0x8 – MTP for MSM/APQ

0x9 – Large qualcomm user interface device (LiQUID)

0x19 – Automotive development platform (ADP)

Byte 2 is the hardware major version number.

Byte 3 is the hardware minor version number.

Byte 4 is the fused platform flavor number.

For example, a Circiut switched fallback (CSFB) device would have platform ID of 0x02, 0x02,0x01, 0x0, 0x01. A Simultaneous voice and LTE (SVLTE) type II device would have platform IDof 0x02, 0x02, 0x01, 0x0, 0x03.

BLOCK1

The DDR parameter header is comprised of four attributes:num_of_devicesize_of_param version_numberchecksum

ddr参数的一些属性

DDR参数属性的定义

示例

uint8 config_data_table[CONFIG_DATA_TABLE_MAX_SIZE] = 
{
	/* Header */

	0x43, 0x44, 0x54, 0x00, //魔数0x43445400 小端
	0x01, 0x00, 0x00, 0x00, //版本 1,后面的32个字节为保留字节
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 

	/* Meta data */

	0x16, 0x00, 0x06, 0x00, //表明CDB0的偏移为0x16,大小为0x6
	0x1C, 0x00, 0xC8, 0x01, //表明CDB1的偏移为0x1C,大小为0x1C8

	/* Block data */

	#ifdef FEATURE_RUMI_BOOT
	0x03, 0x0F, 0x01, 0x00, 0x00, 0x00,
    #else
	0x03, 0x08, 0x01, 0x00, 0x00, 0x00,//表明version为3,8表明为MTP版本,major为1,minor为0,subtype为0
    #endif
	
	            0x02, 0x00, 
	0x00, 0x00, 0x00, 0x52, 
	0x44, 0x44, 0xFF, 0xFF, 
	0x00, 0x00, 0x02, 0x00, 
	0x00, 0x00, 0xCC, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x05, 0x00, 
	0x00, 0x00, 0x0E, 0x00, 
	0x00, 0x00, 0x0A, 0x00, 
	0x00, 0x00, 0x08, 0x00, 
	0x00, 0x00, 0x20, 0x00, 
	0x00, 0x00, 0x0E, 0x00, 
	0x00, 0x00, 0x0A, 0x00, 
	0x00, 0x00, 0x08, 0x00, 
	0x00, 0x00, 0x20, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x34, 0x08, 
	0x00, 0x00, 0xA4, 0x01, 
	0x00, 0x00, 0x60, 0xAE, 
	0x0A, 0x00, 0x58, 0x98, 
	0x00, 0x00, 0x98, 0x08, 
	0x00, 0x00, 0x4B, 0x00, 
	0x00, 0x00, 0x4B, 0x00, 
	0x00, 0x00, 0x0E, 0x01, 
	0x00, 0x00, 0xF0, 0x00, 
	0x00, 0x00, 0x64, 0x00, 
	0x00, 0x00, 0x96, 0x00, 
	0x00, 0x00, 0x4B, 0x00, 
	0x00, 0x00, 0xF0, 0x00, 
	0x00, 0x00, 0xF4, 0x01, 
	0x00, 0x00, 0x4B, 0x00, 
	0x00, 0x00, 0x04, 0x00, 
	0x00, 0x00, 0x10, 0x0E, 
	0x00, 0x00, 0x84, 0x03, 
	0x00, 0x00, 0x0A, 0x00, 
	0x00, 0x00, 0x96, 0x00, 
	0x00, 0x00, 0x23, 0x00, 
	0x00, 0x00, 0x12, 0x00, 
	0x00, 0x00, 0x23, 0x00, 
	0x00, 0x00, 0x12, 0x00, 
	0x00, 0x00, 0x19, 0x00, 
	0x00, 0x00, 0x37, 0x00, 
	0x00, 0x00, 0x01, 0x00, 
	0x00, 0x00, 0x08, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 

};


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值