Qualcomm、MTK平台DDR driver主要做ddr controller初始化以及不同ddr memory timing设定、ddr block infor的配置等,所以真正需要客户做的工作主要是后者(ddr memory timing设定、ddr block infor的配置)。为了更好地使OEM客户能够更方便地完成特定ddr memory driver工作,两个平台都尽量方便oem engineer,都使用脚本化来完成ddr timing设置,以将oem engineer从繁杂的寄存器设定中解放出来。
MTK 平台以turn key模式成功上位,在ddr driver更是将turn key发挥到极致。MTK采用的是verify机制,市面上主流ddr memory MTK会先认证并将参数合入到MemoryDeviceList_MT6582.xls里,如果客户使用的是没有认证的ddr可以提认证需求,当然也是可以自己调timing的。所以oem engineer 只需将认证的ddr memory配置到custom_MemoryDevice.h
#define CS_PART_NUMBER[0] H9TP32A8JDACPR_KGM
new编译时会调用emigen,emigen.pl脚本会解析MemoryDeviceList_MT6582.xls生成custom_emi.c文件,里面即有ddr timing parameter。
EMI_SETTINGS emi_settings[] =
{
//H9TP32A8JDACPR_KGM
{
0x0, /* sub_version */
0x0202, /* TYPE */
9, /* EMMC ID/FW ID checking length */
0, /* FW length */
{0x90,0x01,0x4A,0x48,0x34,0x47,0x31,0x64,0x04,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, /* NAND_EMMC_ID */
{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, /* FW_ID */
0x0002A3AE, /* EMI_CONA_VAL */
0xAA00AA00, /* DRAMC_DRVCTL0_VAL */
0xAA00AA00, /* DRAMC_DRVCTL1_VAL */
0x44584493, /* DRAMC_ACTIM_VAL */
0x01000000, /* DRAMC_GDDR3CTL1_VAL */
0xF0048683, /* DRAMC_CONF1_VAL */
0xA00632D1, /* DRAMC_DDR2CTL_VAL */
0xBF080401, /* DRAMC_TEST2_3_VAL */
0x0340633F, /* DRAMC_CONF2_VAL */
0x51642342, /* DRAMC_PD_CTRL_VAL */
0x00008888, /* DRAMC_PADCTL3_VAL */
0x88888888, /* DRAMC_DQODLY_VAL */
0x00000000, /* DRAMC_ADDR_OUTPUT_DLY */
0x00000000, /* DRAMC_CLK_OUTPUT_DLY */
0x01000510, /* DRAMC_ACTIM1_VAL*/
0x07800000, /* DRAMC_MISCTL0_VAL*/
0x04002600, /* DRAMC_ACTIM05T_VAL*/
{0x20000000,0x20000000,0,0}, /* DRAM RANK SIZE */
{0,0,0,0,0,0,0,0,0,0}, /* reserved 10 */
0x00C30001, /* LPDDR2_MODE_REG1 */
0x00060002, /* LPDDR2_MODE_REG2 */
0x00020003, /* LPDDR2_MODE_REG3 */
0x00000006, /* LPDDR2_MODE_REG5 */
0x00FF000A, /* LPDDR2_MODE_REG10 */
0x0000003F, /* LPDDR2_MODE_REG63 */
},
}
Qualcomm平台ddr driver hal相对MTK 的trun key模式,oem engineer的参与感会强一些,虽然也是脚本化,不需要coding,但是ddr timming parameter需要oem engineer在ddr memory datasheet里去查询,并能理解参数的意义及timing unit,将参数正确填入8974_cdp_jedec_ddr_4_die_interleave_dal.xml。然后通过python命令解析
python cdt_generator.py 8974_cdp_jedec_ddr_4_die_interleave_dal.xml binfile.bin
把生成的boot_cdt_array.c copy到\secboot3\msm8974,重新build sbl1即可。
boot_cdt_array.c里有ddr timing parameter
uint8config_data_table[CONFIG_DATA_TABLE_MAX_SIZE] =
{
/*Header */
0x43,0x44, 0x54, 0x00,
0x01,0x00,
0x00,0x00, 0x00, 0x00,
0x00,0x00, 0x00, 0x00,
/*Meta data */
0x16,0x00,
0x05,0x00,
0x1B,0x00,
0x88,0x01,
/*Block data */
0x02, 0x01, 0x01, 0x00, 0x00,
0x01,0x00, 0x00, 0x00,
0x00,0x52, 0x44, 0x44,
0xFF,0xFF, 0x00, 0x00,
0x02,0x00, 0x00, 0x00,
0xB8,0x00, 0x00, 0x00,
0x03,0x00, 0x00, 0x00,
0x01,0x00, 0x00, 0x00,
0x00,0x00, 0x00, 0x00,
0x05,0x00, 0x00, 0x00,
0x14,0x05, 0x00, 0x00,
0xA4,0x01, 0x00, 0x00,
0x60,0xAE, 0x0A, 0x00,
0x76,0x02, 0x00, 0x00,
0x40,0x01, 0x00, 0x00,
0x58,0x98, 0x00, 0x00,
0x78,0x05, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x0E,0x01, 0x00, 0x00,
0x64,0x00, 0x00, 0x00,
0x96,0x00, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0xF0,0x00, 0x00, 0x00,
0x02,0x00, 0x00, 0x00,
0x0E,0x00, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x0E,0x00, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x20,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x03,0x00, 0x00, 0x00,
0xF0,0x00, 0x00, 0x00,
0xF4,0x01, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x04,0x00, 0x00, 0x00,
0x05,0x00, 0x00, 0x00,
0x80,0x84, 0x1E, 0x00,
0x10,0x27, 0x00, 0x00,
0x04,0x00, 0x00, 0x00,
0x10,0x0E, 0x00, 0x00,
0x84,0x03, 0x00, 0x00,
0x10,0x27, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x96,0x00, 0x00, 0x00,
0xF4,0x01, 0x00, 0x00,
0x80,0xA2, 0x00, 0x00,
0x00,0x20, 0x00, 0x00,
0x19,0x00, 0x00, 0x00,
0x37,0x00, 0x00, 0x00,
0x00,0x00, 0x00, 0x00,
0x00,0x00, 0x00, 0x00,
0x05,0x00, 0x00, 0x00,
0x14,0x05, 0x00, 0x00,
0xA4,0x01, 0x00, 0x00,
0x60,0xAE, 0x0A, 0x00,
0x76,0x02, 0x00, 0x00,
0x40,0x01, 0x00, 0x00,
0x58,0x98, 0x00, 0x00,
0x78,0x05, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x0E,0x01, 0x00, 0x00,
0x64,0x00, 0x00, 0x00,
0x96,0x00, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0xF0,0x00, 0x00, 0x00,
0x02,0x00, 0x00, 0x00,
0x0E,0x00, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x0E,0x00, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x20,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x03,0x00, 0x00, 0x00,
0xF0,0x00, 0x00, 0x00,
0xF4,0x01, 0x00, 0x00,
0x4B,0x00, 0x00, 0x00,
0x08,0x00, 0x00, 0x00,
0x04,0x00, 0x00, 0x00,
0x05,0x00, 0x00, 0x00,
0x80,0x84, 0x1E, 0x00,
0x10,0x27, 0x00, 0x00,
0x04,0x00, 0x00, 0x00,
0x10,0x0E, 0x00, 0x00,
0x84,0x03, 0x00, 0x00,
0x10,0x27, 0x00, 0x00,
0x0A,0x00, 0x00, 0x00,
0x96,0x00, 0x00, 0x00,
0xF4,0x01, 0x00, 0x00,
0x80,0xA2, 0x00, 0x00,
0x00,0x20, 0x00, 0x00,
0x19,0x00, 0x00, 0x00,
0x37,0x00, 0x00, 0x00,
};
MTK平台trun key模式,oem engineer只需要知道该key打开哪扇抽屉(which ddr memory),直接打开取出即可,甚至不需要知道抽屉里东西长啥样。而qualcomm平台更多的是告诉oem engineer配置的方法,至于所要用的材料需要oem engineer自己找到,然后提供便捷的方法将材料烹饪成最终美味菜肴。至于孰优孰劣,在此不便轻下结论。