1. /************************************************************************************
  2. * I.MX6 change boot partition 1 to User area
  3. * 说明:
  4. * 需要在eMMC中切换U-Boot所在的位置,看一下eMMC的驱动,测试一下效果。
  5. *
  6. * 2017-5-26 台湾 中和区 曾剑锋
  7. ***********************************************************************************/
  8.  
  9. 一、参考文档:
  10. . emmc boot1 boot2 partition
  11. http://www.cnblogs.com/helloworldtoyou/p/6053460.html
  12.  
  13. 二、驱动参考代码(drivers/mmc/core/mmc.c):
  14. /* set up boot partitions */
  15. static ssize_t
  16. setup_boot_partitions(struct device *dev, struct device_attribute *attr,
  17. const char *buf, size_t count)
  18. {
  19. ...
  20. /* enable the boot partition in boot mode */
  21. /* boot enable be -
  22. * 0x00 - disable boot enable.
  23. * 0x08 - boot partition 1 is enabled for boot.
  24. * 0x10 - boot partition 2 is enabled for boot.
  25. * 0x38 - User area is enabled for boot.
  26. */
  27. switch (part & EXT_CSD_BOOT_PARTITION_ENABLE_MASK) {
  28. case :
  29. boot_config = (ext_csd[EXT_CSD_PART_CONFIG]
  30. & ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK
  31. & ~EXT_CSD_BOOT_ACK_ENABLE);
  32. break;
  33. case EXT_CSD_BOOT_PARTITION_PART1:
  34. boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
  35. & ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
  36. | EXT_CSD_BOOT_PARTITION_PART1
  37. | EXT_CSD_BOOT_ACK_ENABLE);
  38. break;
  39. case EXT_CSD_BOOT_PARTITION_PART2:
  40. boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
  41. & ~EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
  42. | EXT_CSD_BOOT_PARTITION_PART2
  43. | EXT_CSD_BOOT_ACK_ENABLE);
  44. break;
  45. case EXT_CSD_BOOT_PARTITION_ENABLE_MASK:
  46. boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
  47. | EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
  48. & ~EXT_CSD_BOOT_ACK_ENABLE);
  49. break;
  50. default:
  51. pr_err("%s: wrong boot config parameter" \
  52. " 00 (disable boot), 08 (enable boot1)," \
  53. "16 (enable boot2), 56 (User area)\n",
  54. mmc_hostname(card->host));
  55. err = -EINVAL;
  56. goto err_rtn;
  57. }
  58. ...
  59. }
  60.  
  61. 三、操作流程:
  62. . 删除User area区域的U-Boot,防止识别到U-Boot,而不进入烧录模式:
  63. dd if=/dev/zero of=/dev/block/mmcblk3 bs= count=
  64. . 切换eMMC启动到User area区域启动:
  65. echo > /sys/block/mmcblk3/device/boot_config

I.MX6 change boot partition 1 to User area的更多相关文章

  1. 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 ...

  2. 翻译wiki(一):Bios boot partition

    文章翻译自wiki,水平有限,若有错万请见谅.原文:https://en.wikipedia.org/wiki/BIOS_boot_partition BIOS boot partition是一个分区 ...

  3. emmc boot1 boot2 partition

    使用mfg tool烧写android5.1的镜像之后,再使用旧版的mfg tool烧写linux或者android镜像,都不能正常启动,而且运行的uboot还是android5.1版本的uboot. ...

  4. 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 ...

  5. 如何解包,编辑,重新打包boot images

    HOWTO: Unpack, Edit, and Repack Boot Images http://forum.xda-developers.com/showthread.php?t=443994 ...

  6. From Disk partition to PostgreSQL installation

    From Disk partition to PostgreSQLinstallation [root@compute mnt]# fdisk /dev/sdb Welcome to fdisk (u ...

  7. Creating a Swap Partition

    Creating a Swap Partition 1.   Use  fdisk /dev/vda  to open your disk in fdisk. (Use gdisk if you ar ...

  8. 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 ...

  9. UEFI boot: how does that actually work, then?

    原文地址:https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/ 翻译:https:/ ...

随机推荐

  1. CSS小知识---table表格

    所用的仍是bootstrap的模板 <link rel="stylesheet" href="css/bootstrap.min.css"> < ...

  2. MongoDB win32-bit 安装

    一念起: 由于本人 用的电脑比较老旧,所以一直用的 是win7 32bit 的操作系统,但是在学习MongoDB的时候 遇到了起步的第一个问题,按照目前 官网最新版MongoDB 3.4.3,已不支持 ...

  3. C# Winform DataGrid 绑定List<> Or ObservableCollection<> 类型无法自动刷新问题

    当DataGrid通过绑定List<> Or ObservableCollection<> 类型数据,通过INofityPropertyChanged接口通知数据改变进行刷新无 ...

  4. 利用同步网盘搭建个人或团队SVN服务器

    这篇文章是以前写的,现在强烈推荐两个站.1.http://git.oschina.com 2.http://www.coding.net. 推荐理由:1.可创建私有项目.2.免费稳定.3.VS2013 ...

  5. Mahout 分类算法

    实验简介 本次课程学习了Mahout 的 Bayes 分类算法. 一.实验环境说明 1. 环境登录 无需密码自动登录,系统用户名 shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu ...

  6. Win32 API编程:显示系统进程列表

    #include <windows.h> #include <tlhelp32.h> // 声明快照函数的头文件 #include "tchar.h" #i ...

  7. NOIP 货车运输

    题目描述 Description A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路.每一条道路对车辆都有重量限制,简称限重.现在有 q 辆货车在运输货物,司机们想知道每辆车在不超过 ...

  8. thinkphp5新特性

    1.惰性加载(需要什么就加载什么,不需要什么就不加载),显著提高了应用性能: 2.支持composer: 3.遵守PSR-2.PSR-4规范: 4.支持单元测试: 5.安全机制,详细的日志能帮你轻轻松 ...

  9. CSS3 网格布局(grid-layout)基础知识 - 网格模板属性(grid-template)使用说明

    CSS3引入了新的网格布局(grid layout),以适应显示和设计技术的发展(尤其是移动设备优先的响应式设计). 主要目标是建立一个稳定可预料且语义正确的网页布局模式,用来替代过往表现不稳定且繁琐 ...

  10. python学习笔记(pict+subprocess)

    这几天看到接口自动化用例的生成,关于这里博主自己也想了想,是否可以根据参数的范围自动生成用例,这样就不用一条一条的写接口测试用例 这里就设计到用例设计的方法,让我想到之前接触过一款微软的用例自动生成工 ...