Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
f1737152
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,发现更多精彩内容 >>
提交
f1737152
编写于
6月 05, 2015
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://git.denx.de/u-boot-fdt
上级
d85cd291
3c4c142e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
0 deletion
+60
-0
common/fdt_support.c
common/fdt_support.c
+25
-0
common/image-fdt.c
common/image-fdt.c
+4
-0
doc/device-tree-bindings/root.txt
doc/device-tree-bindings/root.txt
+4
-0
include/fdt_support.h
include/fdt_support.h
+27
-0
未找到文件。
common/fdt_support.c
浏览文件 @
f1737152
...
...
@@ -194,6 +194,31 @@ static inline int fdt_setprop_uxx(void *fdt, int nodeoffset, const char *name,
return
fdt_setprop_u32
(
fdt
,
nodeoffset
,
name
,
(
uint32_t
)
val
);
}
int
fdt_root
(
void
*
fdt
)
{
char
*
serial
;
int
err
;
err
=
fdt_check_header
(
fdt
);
if
(
err
<
0
)
{
printf
(
"fdt_root: %s
\n
"
,
fdt_strerror
(
err
));
return
err
;
}
serial
=
getenv
(
"serial#"
);
if
(
serial
)
{
err
=
fdt_setprop
(
fdt
,
0
,
"serial-number"
,
serial
,
strlen
(
serial
)
+
1
);
if
(
err
<
0
)
{
printf
(
"WARNING: could not set serial-number %s.
\n
"
,
fdt_strerror
(
err
));
return
err
;
}
}
return
0
;
}
int
fdt_initrd
(
void
*
fdt
,
ulong
initrd_start
,
ulong
initrd_end
)
{
...
...
common/image-fdt.c
浏览文件 @
f1737152
...
...
@@ -471,6 +471,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
int
ret
=
-
EPERM
;
int
fdt_ret
;
if
(
fdt_root
(
blob
)
<
0
)
{
printf
(
"ERROR: root node setup failed
\n
"
);
goto
err
;
}
if
(
fdt_chosen
(
blob
)
<
0
)
{
printf
(
"ERROR: /chosen node create failed
\n
"
);
goto
err
;
...
...
doc/device-tree-bindings/root.txt
0 → 100644
浏览文件 @
f1737152
The root node
Optional properties:
- serial-number : a string representing the device's serial number
include/fdt_support.h
浏览文件 @
f1737152
...
...
@@ -16,8 +16,35 @@ u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
const
char
*
prop
,
const
u32
dflt
);
u32
fdt_getprop_u32_default
(
const
void
*
fdt
,
const
char
*
path
,
const
char
*
prop
,
const
u32
dflt
);
/**
* Add data to the root of the FDT before booting the OS.
*
* See doc/device-tree-bindings/root.txt
*
* @param fdt FDT address in memory
* @return 0 if ok, or -FDT_ERR_... on error
*/
int
fdt_root
(
void
*
fdt
);
/**
* Add chosen data the FDT before booting the OS.
*
* In particular, this adds the kernel command line (bootargs) to the FDT.
*
* @param fdt FDT address in memory
* @return 0 if ok, or -FDT_ERR_... on error
*/
int
fdt_chosen
(
void
*
fdt
);
/**
* Add initrd information to the FDT before booting the OS.
*
* @param fdt FDT address in memory
* @return 0 if ok, or -FDT_ERR_... on error
*/
int
fdt_initrd
(
void
*
fdt
,
ulong
initrd_start
,
ulong
initrd_end
);
void
do_fixup_by_path
(
void
*
fdt
,
const
char
*
path
,
const
char
*
prop
,
const
void
*
val
,
int
len
,
int
create
);
void
do_fixup_by_path_u32
(
void
*
fdt
,
const
char
*
path
,
const
char
*
prop
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录