Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
8e5f0497
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,发现更多精彩内容 >>
提交
8e5f0497
编写于
12月 27, 2017
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://git.denx.de/u-boot-dm
上级
7e3caa81
4ace3040
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
98 addition
and
4 deletion
+98
-4
README
README
+9
-0
arch/arm/lib/bootm-fdt.c
arch/arm/lib/bootm-fdt.c
+12
-0
board/freescale/ls1046ardb/eth.c
board/freescale/ls1046ardb/eth.c
+51
-0
common/fdt_support.c
common/fdt_support.c
+21
-4
include/configs/ls1046ardb.h
include/configs/ls1046ardb.h
+2
-0
include/fdt_support.h
include/fdt_support.h
+3
-0
未找到文件。
README
浏览文件 @
8e5f0497
...
...
@@ -1603,6 +1603,15 @@ The following options need to be configured:
See doc/README.link-local for more information.
- MAC address from environment variables
FDT_SEQ_MACADDR_FROM_ENV
Fix-up device tree with MAC addresses fetched sequentially from
environment variables. This config work on assumption that
non-usable ethernet node of device-tree are either not present
or their status has been marked as "disabled".
- CDP Options:
CONFIG_CDP_DEVICE_ID
...
...
arch/arm/lib/bootm-fdt.c
浏览文件 @
8e5f0497
...
...
@@ -25,6 +25,13 @@
DECLARE_GLOBAL_DATA_PTR
;
#ifdef CONFIG_FMAN_ENET
__weak
int
fdt_update_ethernet_dt
(
void
*
blob
)
{
return
0
;
}
#endif
int
arch_fixup_fdt
(
void
*
blob
)
{
int
ret
=
0
;
...
...
@@ -64,5 +71,10 @@ int arch_fixup_fdt(void *blob)
#endif
#endif
#ifdef CONFIG_FMAN_ENET
ret
=
fdt_update_ethernet_dt
(
blob
);
if
(
ret
)
return
ret
;
#endif
return
0
;
}
board/freescale/ls1046ardb/eth.c
浏览文件 @
8e5f0497
...
...
@@ -75,3 +75,54 @@ int board_eth_init(bd_t *bis)
return
pci_eth_init
(
bis
);
}
#ifdef CONFIG_FMAN_ENET
int
fdt_update_ethernet_dt
(
void
*
blob
)
{
u32
srds_s1
;
int
i
,
prop
;
int
offset
,
nodeoff
;
const
char
*
path
;
struct
ccsr_gur
*
gur
=
(
void
*
)(
CONFIG_SYS_FSL_GUTS_ADDR
);
srds_s1
=
in_be32
(
&
gur
->
rcwsr
[
4
])
&
FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK
;
srds_s1
>>=
FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT
;
/* Cycle through all aliases */
for
(
prop
=
0
;
;
prop
++
)
{
const
char
*
name
;
/* FDT might have been edited, recompute the offset */
offset
=
fdt_first_property_offset
(
blob
,
fdt_path_offset
(
blob
,
"/aliases"
)
);
/* Select property number 'prop' */
for
(
i
=
0
;
i
<
prop
;
i
++
)
offset
=
fdt_next_property_offset
(
blob
,
offset
);
if
(
offset
<
0
)
break
;
path
=
fdt_getprop_by_offset
(
blob
,
offset
,
&
name
,
NULL
);
nodeoff
=
fdt_path_offset
(
blob
,
path
);
switch
(
srds_s1
)
{
case
0x1133
:
if
(
!
strcmp
(
name
,
"ethernet0"
))
fdt_status_disabled
(
blob
,
nodeoff
);
if
(
!
strcmp
(
name
,
"ethernet1"
))
fdt_status_disabled
(
blob
,
nodeoff
);
break
;
default:
printf
(
"%s: Invalid SerDes prtcl 0x%x for LS1046ARDB
\n
"
,
__func__
,
srds_s1
);
break
;
}
}
return
0
;
}
#endif
common/fdt_support.c
浏览文件 @
8e5f0497
...
...
@@ -508,12 +508,16 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
void
fdt_fixup_ethernet
(
void
*
fdt
)
{
int
i
,
j
,
prop
;
int
i
=
0
,
j
,
prop
;
char
*
tmp
,
*
end
;
char
mac
[
16
];
const
char
*
path
;
unsigned
char
mac_addr
[
ARP_HLEN
];
int
offset
;
#ifdef FDT_SEQ_MACADDR_FROM_ENV
int
nodeoff
;
const
struct
fdt_property
*
fdt_prop
;
#endif
if
(
fdt_path_offset
(
fdt
,
"/aliases"
)
<
0
)
return
;
...
...
@@ -526,7 +530,7 @@ void fdt_fixup_ethernet(void *fdt)
offset
=
fdt_first_property_offset
(
fdt
,
fdt_path_offset
(
fdt
,
"/aliases"
));
/* Select property number 'prop' */
for
(
i
=
0
;
i
<
prop
;
i
++
)
for
(
j
=
0
;
j
<
prop
;
j
++
)
offset
=
fdt_next_property_offset
(
fdt
,
offset
);
if
(
offset
<
0
)
...
...
@@ -535,11 +539,16 @@ void fdt_fixup_ethernet(void *fdt)
path
=
fdt_getprop_by_offset
(
fdt
,
offset
,
&
name
,
NULL
);
if
(
!
strncmp
(
name
,
"ethernet"
,
8
))
{
/* Treat plain "ethernet" same as "ethernet0". */
if
(
!
strcmp
(
name
,
"ethernet"
))
if
(
!
strcmp
(
name
,
"ethernet"
)
#ifdef FDT_SEQ_MACADDR_FROM_ENV
||
!
strcmp
(
name
,
"ethernet0"
)
#endif
)
i
=
0
;
#ifndef FDT_SEQ_MACADDR_FROM_ENV
else
i
=
trailing_strtol
(
name
);
#endif
if
(
i
!=
-
1
)
{
if
(
i
==
0
)
strcpy
(
mac
,
"ethaddr"
);
...
...
@@ -548,6 +557,14 @@ void fdt_fixup_ethernet(void *fdt)
}
else
{
continue
;
}
#ifdef FDT_SEQ_MACADDR_FROM_ENV
nodeoff
=
fdt_path_offset
(
fdt
,
path
);
fdt_prop
=
fdt_get_property
(
fdt
,
nodeoff
,
"status"
,
NULL
);
if
(
fdt_prop
&&
!
strcmp
(
fdt_prop
->
data
,
"disabled"
))
continue
;
i
++
;
#endif
tmp
=
env_get
(
mac
);
if
(
!
tmp
)
continue
;
...
...
include/configs/ls1046ardb.h
浏览文件 @
8e5f0497
...
...
@@ -195,6 +195,8 @@
#define FM1_10GEC1_PHY_ADDR 0x0
#define FDT_SEQ_MACADDR_FROM_ENV
#define CONFIG_ETHPRIME "FM1@DTSEC3"
#endif
...
...
include/fdt_support.h
浏览文件 @
8e5f0497
...
...
@@ -290,4 +290,7 @@ int fdt_overlay_apply_verbose(void *fdt, void *fdto);
int
fdtdec_get_int
(
const
void
*
blob
,
int
node
,
const
char
*
prop_name
,
int
default_val
);
#endif
#ifdef CONFIG_FMAN_ENET
int
fdt_update_ethernet_dt
(
void
*
blob
);
#endif
#endif
/* ifndef __FDT_SUPPORT_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录