I.MX6 change boot partition 1 to User area
/************************************************************************************
* I.MX6 change boot partition 1 to User area
* 说明:
* 需要在eMMC中切换U-Boot所在的位置,看一下eMMC的驱动,测试一下效果。
*
* 2017-5-26 台湾 中和区 曾剑锋
***********************************************************************************/ 一、参考文档:
. emmc boot1 boot2 partition
http://www.cnblogs.com/helloworldtoyou/p/6053460.html 二、驱动参考代码(drivers/mmc/core/mmc.c):
/* set up boot partitions */
static ssize_t
setup_boot_partitions(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
...
/* enable the boot partition in boot mode */
/* boot enable be -
* 0x00 - disable boot enable.
* 0x08 - boot partition 1 is enabled for boot.
* 0x10 - boot partition 2 is enabled for boot.
* 0x38 - User area is enabled for boot.
*/
switch (part & EXT_CSD_BOOT_PARTITION_ENABLE_MASK) {
case :
boot_config = (ext_csd[EXT_CSD_PART_CONFIG]
& ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK
& ~EXT_CSD_BOOT_ACK_ENABLE);
break;
case EXT_CSD_BOOT_PARTITION_PART1:
boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
& ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
| EXT_CSD_BOOT_PARTITION_PART1
| EXT_CSD_BOOT_ACK_ENABLE);
break;
case EXT_CSD_BOOT_PARTITION_PART2:
boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
& ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
| EXT_CSD_BOOT_PARTITION_PART2
| EXT_CSD_BOOT_ACK_ENABLE);
break;
case EXT_CSD_BOOT_PARTITION_ENABLE_MASK:
boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
| EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
& ~EXT_CSD_BOOT_ACK_ENABLE);
break;
default:
pr_err("%s: wrong boot config parameter" \
" 00 (disable boot), 08 (enable boot1)," \
"16 (enable boot2), 56 (User area)\n",
mmc_hostname(card->host));
err = -EINVAL;
goto err_rtn;
}
...
} 三、操作流程:
. 删除User area区域的U-Boot,防止识别到U-Boot,而不进入烧录模式:
dd if=/dev/zero of=/dev/block/mmcblk3 bs= count=
. 切换eMMC启动到User area区域启动:
echo > /sys/block/mmcblk3/device/boot_config
I.MX6 change boot partition 1 to User area的更多相关文章
- You cannot change a partition into an extended one or vice versa Delete it first
在Linux扩展LVM时,使用fdisk创建分区时,在磁盘上新建扩展分区(逻辑分区),修改分区格式,指定分区类型为8e时,报错"You cannot change a partition i ...
- 翻译wiki(一):Bios boot partition
文章翻译自wiki,水平有限,若有错万请见谅.原文:https://en.wikipedia.org/wiki/BIOS_boot_partition BIOS boot partition是一个分区 ...
- emmc boot1 boot2 partition
使用mfg tool烧写android5.1的镜像之后,再使用旧版的mfg tool烧写linux或者android镜像,都不能正常启动,而且运行的uboot还是android5.1版本的uboot. ...
- How To Backup Your Android Phone’s Boot, Recovery And System Partition Images -- RomDump
One can’t stress enough on the importance of backups and when it comes to tinkering with your Androi ...
- 如何解包,编辑,重新打包boot images
HOWTO: Unpack, Edit, and Repack Boot Images http://forum.xda-developers.com/showthread.php?t=443994 ...
- From Disk partition to PostgreSQL installation
From Disk partition to PostgreSQLinstallation [root@compute mnt]# fdisk /dev/sdb Welcome to fdisk (u ...
- Creating a Swap Partition
Creating a Swap Partition 1. Use fdisk /dev/vda to open your disk in fdisk. (Use gdisk if you ar ...
- WARNING: Re-reading the partition table failed with error 22: Invalid argument
在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument&qu ...
- UEFI boot: how does that actually work, then?
原文地址:https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/ 翻译:https:/ ...
随机推荐
- phpword使用
composer 安装 https://packagist.org/packages/phpoffice/phpword 开发文档:http://phpword.readthedocs.io/en/l ...
- 一键配置IP地址脚本
#/bin/bash NETPWD='/etc/sysconfig/network-scripts/' read -p "please enten net num(1,2,3,4) : &q ...
- vue切换路由模式{hash/history}
vue中常用的路由模式 hash(#):默认路由模式 histroy(/)切换路由模式 切换路由模式 export default new Router({ // 路由模式:hash(默认),hist ...
- Java学习笔记50:JSONObject与JSONArray的使用(转)
Java不像PHP解析和生产JSON总是一个比较痛苦的过程.但是使用JSONObject和JSONArray会让整个过程相对舒服一些. 需要依赖的包:commons-lang.jar commons- ...
- CentOS 7安装Xfce和VNC
很多VPS商提供的CentOS 7镜像只有最小化安装,这样就只能在命令行下操作,如果要调试代码的话,还是图形化界面方便,而且CentOS自带的Gnome和KDE都比较占内存.启动桌面后就占用了400M ...
- oracle 10g和11g将表到缓存到内存中
alter table 表名 cache;alter table 表名 storage(buffer_pool keep);
- CentOS上使用sendmail发送邮件
设置方法 set from=fromUser@domain.com smtp=smtp.domain.com set smtp-auth-user=username smtp-auth-passwor ...
- .NET中如何测试Private和Protected方法
TDD是1)写测试2)写通过这些测试的代码,3)然后重构的实践.在,NET社区中, 这个概念逐渐变得非常流行,这归功于它所增加的质量保证.此时,它很容易测试public方法,但是一个普遍的问题出现了, ...
- Python中的X[:,0]和X[:,1]
https://blog.csdn.net/csj664103736/article/details/72828584 python中 x=x[1:] 是什么意思 将x的第二位到最后一位的内容赋给x. ...
- Flume-NG源码阅读之SinkGroups和SinkRunner
在AbstractConfigurationProvider类中loadSinks方法会调用loadSinkGroups方法将所有的sink和sinkgroup放到了Map<String, Si ...