u-boot移植5:添加自动补全和默认分区表
2016-08-19 17:31
176 查看
1. uboot中的添加默认的分区表:
diff --git a/include/configs/lip2440.h b/include/configs/lip2440.hindex 1b98fac..ef1a4ee 100644
--- a/include/configs/lip2440.h
+++ b/include/configs/lip2440.h
@@ -89,6 +89,7 @@
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE /* a tab to complete */
/* autoboot */
#define CONFIG_BOOTDELAY 5
@@ -192,6 +193,12 @@
#define CONFIG_YAFFS2
#define CONFIG_RBTREE
+#define MTDIDS_DEFAULT "nand0=nandflash0"
+#define MTDPARTS_DEFAULT "mtdparts=nandflash0:512k@0(uboot)," \
+ "512k(uboot-env)," \
+ "4M(kernel)," \
+ "-(root)"
+
/* additions for new relocation code, must be added to all boards */
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \
2. 修改的解释:
nand0=nandflash0 :将nand0 命名为 nandflash0
MTDIDS_DEFAULT 对应 uboot 参数中的 mtdids
MTDPARTS_DEFAULT 对应 uboot 参数中的 mtdparts
对于mtdparts 中参数的解释如下:
mtdparts=mtd-id:<size1>@<offset1>(<name1>),<size2>@<offset2>(<name2>)
需要注意的几点:
mtd-id 必须要跟你当前平台的flash的mtd-id一致,不然整个mtdparts会失效 怎样获取到当前平台的flash的mtd-id?在bootargs参数列表中,可以指定当前flash的mtd-id,指定 mtdid s:nand0=gen_nand.1,前面的nand0则表示第一个flash
size在设置的时候可以为实际的size(xxM,xxk,xx),也可以为'-'这表示剩余的所有空间。相关信息可以查看drivers/mtd/cmdlinepart.c中的注释找到相关描述。
3. uboot重新启动:
LIP2440 # mtdparts (或者 mtd)mtdparts variable not set, see 'help mtdparts'
no partitions defined
defaults:
mtdids : nand0=nandflash0
mtdparts: mtdparts=nandflash0:512k@0(uboot),512k(uboot-env),4M(kernel),-(root)
LIP2440 # mtdparts default
LIP2440 # mtd
device nand0 <nandflash0>, # parts = 4
#: name size offset mask_flags
0: uboot 0x00080000 0x00000000 0
1: uboot-env 0x00080000 0x00080000 0
2: kernel 0x00400000 0x00100000 0
3: root 0x0fb00000 0x00500000 0
active partition: nand0,0 - (uboot) 0x00080000 @ 0x00000000
defaults:
mtdids : nand0=nandflash0
mtdparts: mtdparts=nandflash0:512k@0(uboot),512k(uboot-env),4M(kernel),-(root)
LIP2440 #
4. uboot 参数中添加分区表:
如果将 uboot 使用默认的分区表,需要:将 mtdparts default 加到 bootargs 参数中去
在 uboot 命令行中: set mtdparts $default 并保存
在 uboot 命令行中: set mtdparts nandflash0:512k@0(uboot),512k(uboot-env),4M(kernel),-(root)
并保存
5. uboot 中的分区和 linux 分区的区别:
一般要设置成相同,但如果不同,是不影响系统启动的,当内核启动之后,分区是使用内核中设置的分区。
在uboot中的分区可以用在 nand erase.part [分区的助记符(比如 root)]
相关文章推荐
- u-boot-2009.08在mini2440上的移植(四)---增加DM9000驱动和命令自动补全功能 ——调试心得
- u-boot-2009.08在mini2440上的移植(四)---增加DM9000驱动和命令自动补全功能
- U-Boot的移植之(一)基础篇:添加新的目标板定义
- U-Boot的移植之(一)基础篇:添加新的目标板定义
- fl2440的U-boot-2010.09移植(四) 添加NOR Flash启动支持
- AT91SAM9260下的U-Boot移植和添加LCD驱动支持
- u-boot-2012.04.01移植到TQ2440(七):添加分区信息并启动jffs2文件系统
- U-Boot移植日志(4)--添加一种新的Flash驱动
- u-boot移植(九)支持引导内核,命令补全
- u-boot移植(六)添加nandflash支持
- S3C6410移植u-boot-2010.3(4)uboot的dnw功能添加
- u-boot-2008.10移植并添加vga芯片ch7004的驱动
- PyCon 2011 - Hidden Treasures of the Python Standard Library - 为Python命令行添加了按键自动补全内容和命令历史功能
- Windows下为GTK库添加tags并在VIM中实现代码自动补全和跳转
- U-boot分析与移植(4)----U-boot 添加命令
- U-Boot的移植之(一)基础篇:添加新的目标板定义
- 第一次移植uboot(3)(添加DM9000网卡支持)
- VA添加QT进行代码自动补全
- Linux添加PATH,即命令自动补全功能
- 为python命令行添加Tab键自动补全功能