SMEM介绍
SMEM :shared memory,是高通平台各子系统共享信息的一种机制,通过SMEM机制,PBL可以将信息传递给SBL1,SBL1可以将信息传递给RPM、LK。下面分析一个SMEM信息传递的具体实现过程。
1 Platform id信息
SBL1会将board level platform id信息通过SMEM机制保存,LK在启动过程中会自动platform detect,检测当前平台board infor信息,根据检测到的board infor加载相应的device tree
SBL1:从emmc中读取platform id等CDT信息,并保存到约定的smem中
voidboot_config_data_table_init(bl_shared_data_type* bl_shared_data)
{
/*populate configuration data table's info*/
config_data_table_info.size =config_data_table_size;
config_data_table_info.cdt_ptr =config_data_table; //platform id & ddr default parameter
boot_update_config_data_table(&config_data_table_info);
/*put a pointer to the table info into sblshared data so next sbl can access it*/
bl_shared_data->sbl_shared_data->config_data_table_info =&config_data_table_info;
}
LK通过读取smem获取platform infor信息
static void platform_detect()
{
ret= smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
&board_info_v8,
board_info_len);
board.platform= board_info_v8.board_info_v3.msm_id;
board.platform_version= board_info_v8.board_info_v3.msm_version;
board.platform_hw= board_info_v8.board_info_v3.hw_platform;
board.platform_subtype= board_info_v8.platform_subtype;
}
同理,SBL1可通过SMEM将DDR default parameter传递给RPM,当然也可以将OEM定制信息通过SMEM保存,在启动阶段根据不同OEM信息进行相应的特制化。
2 如何在SBL1和LK间通过SMEM传递客制化信息
step1. Add a new enum (i.e SMEM_OEM_MAGIC_INFO = XXX)in smem_mem_type
step 2. After the boot_smem_init() is called, you use smem_alloc() to allocate the SMEM space for your data,i.e:
- smem_oem_magic_ptr = (uint32 *) smem_alloc( SMEM_OEM_MAGIC_INFO, sizeof(uint32));
step3. On lk side add a new enum (i.e SMEM_OEM_MAGIC_INFO =XXX) in smem_mem_type_t
step4. In lk code, you can usethe smem_read_alloc_entry() to read data which is passed from SBL1,i.e:
- smem_read_alloc_entry( SMEM_OEM_MAGIC_INFO,&apps_oem_magic_info, sizeof( uint32));
最新文章
- 借助 Lucene.Net 构建站内搜索引擎(上)
- OpenCV 第一课(安装与配置)
- hibernate中load和get方法的区别
- java 堆栈 静态
- Unity3D研究院之Machine动画脚本自动生成AnimatorController
- Ehcache(2.9.x) - API Developer Guide, Searching a Cache
- Python基本语法[二],python入门到精通[四] (转)
- (c#)SKYPE API项目总结(一)
- struts2修改文件上传的大小
- php下redis的安装教程
- 第7天:input和label标签
- mac SecureCRT设置
- 【JDBC】java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
- YAML 知识点
- 一个free异常引发的异常
- [CocoaPods]如何使用CocoaPods插件
- packetfence 7.2网络准入部署(二)
- defer 的常用场景
- @Styles的nameSpace是什么
- systemtap 调试postgrel
热门文章
- FileOutputStream&;FileInputStream&;异常的使用
- VMware在宿主上没有VMnet0、VMnet8,解决方法
- AnyConnect使用说明(手机版)
- 动手实现一个vue中的模态对话框组件
- 【移动开发】targetSdkVersion的作用
- APP自动化框架LazyAndroid使用手册(1)--框架简介
- Git之(六)标签管理
- Dynamics CRM 本地插件注册器连CRMAn unsecured or incorrectly secured fault was received from the other party
- Python+Tkinter 密保小工具
- C++ 中const作用