/*******************************************************************************
* emmc boot_config文件不能存在
* 说明:
* 新版本的内核中没有去实现这个功能,自己参考添加。
*
* 2017-9-30 深圳 龙华樟坑村 曾剑锋
*******************************************************************************/ 一、参考文档:
. Boot from eMMC mmcblk3boot0 or mmcblk3boot1.
https://community.nxp.com/thread/429311
. eMMC分区
http://www.lijiangang.cn/post/2017-01-05-emmcfen-qu 二、参考代码:
. Linux 3.14.52中sysfs系统中节点生成信息:
. https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.14.52_1.1.0_ga/drivers/mmc/core/mmc.c#L1086
. 相关代码:
static struct attribute *mmc_std_attrs[] = {
&dev_attr_cid.attr,
&dev_attr_csd.attr,
&dev_attr_date.attr,
&dev_attr_erase_size.attr,
&dev_attr_preferred_erase_size.attr,
&dev_attr_fwrev.attr,
&dev_attr_hwrev.attr,
&dev_attr_manfid.attr,
&dev_attr_name.attr,
&dev_attr_oemid.attr,
&dev_attr_prv.attr,
&dev_attr_serial.attr,
&dev_attr_enhanced_area_offset.attr,
&dev_attr_enhanced_area_size.attr,
&dev_attr_raw_rpmb_size_mult.attr,
&dev_attr_rel_sectors.attr,
&dev_attr_boot_info.attr, // --> boot_info
&dev_attr_boot_config.attr, // --> boot_config
&dev_attr_boot_bus_config.attr, // --> boot_bus_config
NULL,
};
. Linux 4.1.15中sysfs系统中节点生成信息:
. https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_4.1.15_1.0.0_ga/drivers/mmc/core/mmc.c#L740
. 相关代码:
static struct attribute *mmc_std_attrs[] = {
&dev_attr_cid.attr,
&dev_attr_csd.attr,
&dev_attr_date.attr,
&dev_attr_erase_size.attr,
&dev_attr_preferred_erase_size.attr,
&dev_attr_fwrev.attr,
&dev_attr_ffu_capable.attr,
&dev_attr_hwrev.attr,
&dev_attr_manfid.attr,
&dev_attr_name.attr,
&dev_attr_oemid.attr,
&dev_attr_prv.attr,
&dev_attr_serial.attr,
&dev_attr_enhanced_area_offset.attr,
&dev_attr_enhanced_area_size.attr,
&dev_attr_raw_rpmb_size_mult.attr,
&dev_attr_rel_sectors.attr,
NULL,
};
. 由上可知,在4..15内核中并未以同样的方式实现配置选择boot分区启动的代码。
. 如果使用4.X版本的内核,需要使用mmc-utils工具包。
. shell cmd: mmc bootpart enable /dev/mmcblk3
2. 不过在Android中执行shell有时候还不一定可行,使能分区可写,直接dd掉里面的内容,内部ROM程序触发未能找到U-Boot异常进入烧录模式。
05-11 22:50