Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
87a449c8
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
87a449c8
编写于
8月 22, 2006
作者:
M
Matthew McClintock
提交者:
Jon Loeliger
8月 22, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support for FDT in uImage format, error when using FDT from flash
Signed-off-by:
N
Matthew McClintock
<
msm@freescale.com
>
上级
681fc61c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
67 addition
and
5 deletion
+67
-5
common/cmd_bootm.c
common/cmd_bootm.c
+65
-5
include/image.h
include/image.h
+1
-0
tools/mkimage.c
tools/mkimage.c
+1
-0
未找到文件。
common/cmd_bootm.c
浏览文件 @
87a449c8
...
...
@@ -528,7 +528,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
void
(
*
kernel
)(
bd_t
*
,
ulong
,
ulong
,
ulong
,
ulong
);
image_header_t
*
hdr
=
&
header
;
#ifdef CONFIG_OF_FLAT_TREE
char
*
of_flat_tree
;
char
*
of_flat_tree
=
NULL
;
#endif
if
((
s
=
getenv
(
"initrd_high"
))
!=
NULL
)
{
...
...
@@ -737,14 +737,73 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
}
#ifdef CONFIG_OF_FLAT_TREE
if
(
argc
>=
3
)
{
if
(
argc
>=
3
)
{
of_flat_tree
=
(
char
*
)
simple_strtoul
(
argv
[
3
],
NULL
,
16
);
printf
(
"Booting using flat device tree at 0x%x
\n
"
,
hdr
=
(
image_header_t
*
)
of_flat_tree
;
if
(
*
(
ulong
*
)
of_flat_tree
==
OF_DT_HEADER
)
{
#ifndef CFG_NO_FLASH
if
(
addr2info
((
ulong
)
of_flat_tree
)
!=
NULL
)
{
printf
(
"Cannot modify flat device tree stored in flash
\n
"
\
"Copy to memory before using the bootm command
\n
"
);
return
;
}
#endif
}
else
if
(
ntohl
(
hdr
->
ih_magic
)
==
IH_MAGIC
)
{
printf
(
"## Flat Device Tree Image at %08lX
\n
"
,
hdr
);
print_image_hdr
(
hdr
);
if
((
ntohl
(
hdr
->
ih_load
)
<
((
unsigned
long
)
hdr
+
ntohl
(
hdr
->
ih_size
)
+
sizeof
(
hdr
)))
&&
((
ntohl
(
hdr
->
ih_load
)
+
ntohl
(
hdr
->
ih_size
))
>
(
unsigned
long
)
hdr
))
{
printf
(
"ERROR: Load address overwrites Flat Device Tree uImage
\n
"
);
return
;
}
printf
(
" Verifying Checksum ... "
);
memmove
(
&
header
,
(
char
*
)
hdr
,
sizeof
(
image_header_t
));
checksum
=
ntohl
(
header
.
ih_hcrc
);
header
.
ih_hcrc
=
0
;
if
(
checksum
!=
crc32
(
0
,
(
uchar
*
)
&
header
,
sizeof
(
image_header_t
)))
{
printf
(
"ERROR: Flat Device Tree header checksum is invalid
\n
"
);
return
;
}
checksum
=
ntohl
(
hdr
->
ih_dcrc
);
addr
=
(
ulong
)((
uchar
*
)(
hdr
)
+
sizeof
(
image_header_t
));
len
=
ntohl
(
hdr
->
ih_size
);
if
(
checksum
!=
crc32
(
0
,
(
uchar
*
)
addr
,
len
))
{
printf
(
"ERROR: Flat Device Tree checksum is invalid
\n
"
);
return
;
}
printf
(
"OK
\n
"
);
if
(
ntohl
(
hdr
->
ih_type
)
!=
IH_TYPE_FLATDT
)
{
printf
(
"ERROR: uImage not Flat Device Tree type
\n
"
);
return
;
}
if
(
ntohl
(
hdr
->
ih_comp
)
!=
IH_COMP_NONE
)
{
printf
(
"ERROR: uImage is not uncompressed
\n
"
);
return
;
}
if
(
*
((
ulong
*
)(
of_flat_tree
+
sizeof
(
image_header_t
)))
!=
OF_DT_HEADER
)
{
printf
(
"ERROR: uImage data is not a flat device tree
\n
"
);
return
;
}
memmove
((
void
*
)
ntohl
(
hdr
->
ih_load
),
(
void
*
)(
of_flat_tree
+
sizeof
(
image_header_t
)),
ntohl
(
hdr
->
ih_size
));
of_flat_tree
=
(
char
*
)
ntohl
(
hdr
->
ih_load
);
}
else
{
printf
(
"Did not find a flat flat device tree at address %08lX
\n
"
,
of_flat_tree
);
return
;
}
printf
(
" Booting using flat device tree at 0x%x
\n
"
,
of_flat_tree
);
}
#endif
if
(
!
data
)
{
debug
(
"No initrd
\n
"
);
}
...
...
@@ -1272,6 +1331,7 @@ print_type (image_header_t *hdr)
case
IH_TYPE_MULTI
:
type
=
"Multi-File Image"
;
break
;
case
IH_TYPE_FIRMWARE
:
type
=
"Firmware"
;
break
;
case
IH_TYPE_SCRIPT
:
type
=
"Script"
;
break
;
case
IH_TYPE_FLATDT
:
type
=
"Flat Device Tree"
;
break
;
default:
type
=
"Unknown Image"
;
break
;
}
...
...
include/image.h
浏览文件 @
87a449c8
...
...
@@ -124,6 +124,7 @@
#define IH_TYPE_FIRMWARE 5
/* Firmware Image */
#define IH_TYPE_SCRIPT 6
/* Script file */
#define IH_TYPE_FILESYSTEM 7
/* Filesystem Image (any type) */
#define IH_TYPE_FLATDT 8
/* Binary Flat Device Tree Blob */
/*
* Compression Types
...
...
tools/mkimage.c
浏览文件 @
87a449c8
...
...
@@ -130,6 +130,7 @@ table_entry_t type_name[] = {
{
IH_TYPE_RAMDISK
,
"ramdisk"
,
"RAMDisk Image"
,
},
{
IH_TYPE_SCRIPT
,
"script"
,
"Script"
,
},
{
IH_TYPE_STANDALONE
,
"standalone"
,
"Standalone Program"
,
},
{
IH_TYPE_FLATDT
,
"flat_dt"
,
"Flat Device Tree"
,
},
{
-
1
,
""
,
""
,
},
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录