Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
dd7d41f0
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,发现更多精彩内容 >>
提交
dd7d41f0
编写于
9月 18, 2002
作者:
W
wdenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial revision
上级
5b88144d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
176 addition
and
0 deletion
+176
-0
board/gen860t/fpga.h
board/gen860t/fpga.h
+45
-0
common/cmd_mii.c
common/cmd_mii.c
+131
-0
未找到文件。
board/gen860t/fpga.h
0 → 100644
浏览文件 @
dd7d41f0
/*
* (C) Copyright 2002
* Rich Ireland, Enterasys Networks, rireland@enterasys.com.
* Keith Outwater, keith_outwater@mvis.com.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*/
/*
* Virtex2 FPGA configuration support for the GEN860T computer
*/
extern
int
gen860t_init_fpga
(
void
);
extern
int
fpga_pgm_fn
(
int
assert_pgm
,
int
flush
,
int
cookie
);
extern
int
fpga_init_fn
(
int
cookie
);
extern
int
fpga_err_fn
(
int
cookie
);
extern
int
fpga_done_fn
(
int
cookie
);
extern
int
fpga_clk_fn
(
int
assert_clk
,
int
flush
,
int
cookie
);
extern
int
fpga_cs_fn
(
int
assert_cs
,
int
flush
,
int
cookie
);
extern
int
fpga_wr_fn
(
int
assert_write
,
int
flush
,
int
cookie
);
extern
int
fpga_read_data_fn
(
unsigned
char
*
data
,
int
cookie
);
extern
int
fpga_write_data_fn
(
unsigned
char
data
,
int
flush
,
int
cookie
);
extern
int
fpga_busy_fn
(
int
cookie
);
extern
int
fpga_abort_fn
(
int
cookie
);
extern
int
fpga_pre_config_fn
(
int
cookie
);
extern
int
fpga_post_config_fn
(
int
cookie
);
/* vim: set ts=4 sw=4 tw=78: */
common/cmd_mii.c
0 → 100644
浏览文件 @
dd7d41f0
/*
* (C) Copyright 2001
* Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/*
* MII Utilities
*/
#include <common.h>
#include <command.h>
#include <cmd_mii.h>
#include <miiphy.h>
#if (CONFIG_COMMANDS & CFG_CMD_MII)
/*
* Display values from last command.
*/
uint
last_op
;
uint
last_addr
;
uint
last_data
;
uint
last_reg
;
/*
* MII read/write
*
* Syntax:
* mii read {addr} {reg}
* mii write {addr} {reg} {data}
*/
int
do_mii
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[])
{
char
op
;
unsigned
char
addr
,
reg
;
unsigned
short
data
;
int
rcode
=
0
;
#ifdef CONFIG_MPC860
mii_init
();
#endif
/*
* We use the last specified parameters, unless new ones are
* entered.
*/
op
=
last_op
;
addr
=
last_addr
;
data
=
last_data
;
reg
=
last_reg
;
if
((
flag
&
CMD_FLAG_REPEAT
)
==
0
)
{
op
=
argv
[
1
][
0
];
if
(
argc
>=
3
)
addr
=
simple_strtoul
(
argv
[
2
],
NULL
,
16
);
if
(
argc
>=
4
)
reg
=
simple_strtoul
(
argv
[
3
],
NULL
,
16
);
if
(
argc
>=
5
)
data
=
simple_strtoul
(
argv
[
4
],
NULL
,
16
);
}
/*
* check info/read/write.
*/
if
(
op
==
'i'
)
{
int
j
;
unsigned
int
oui
;
unsigned
char
model
;
unsigned
char
rev
;
/*
* Look for any and all PHYs. Valid addresses are 0..31.
*/
for
(
j
=
0
;
j
<
32
;
j
++
)
{
if
(
miiphy_info
(
j
,
&
oui
,
&
model
,
&
rev
)
==
0
)
{
printf
(
"PHY 0x%02X: "
"OUI = 0x%04X, "
"Model = 0x%02X, "
"Rev = 0x%02X, "
"%3dbaseT, %s
\n
"
,
j
,
oui
,
model
,
rev
,
miiphy_speed
(
j
)
==
_100BASET
?
100
:
10
,
miiphy_duplex
(
j
)
==
FULL
?
"FDX"
:
"HDX"
);
}
}
}
else
if
(
op
==
'r'
)
{
if
(
miiphy_read
(
addr
,
reg
,
&
data
)
!=
0
)
{
printf
(
"Error reading from the PHY
\n
"
);
rcode
=
1
;
}
printf
(
"%04X
\n
"
,
data
&
0x0000FFFF
);
}
else
if
(
op
==
'w'
)
{
if
(
miiphy_write
(
addr
,
reg
,
data
)
!=
0
)
{
printf
(
"Error writing to the PHY
\n
"
);
rcode
=
1
;
}
}
else
{
printf
(
"Usage:
\n
%s
\n
"
,
cmdtp
->
usage
);
return
1
;
}
/*
* Save the parameters for repeats.
*/
last_op
=
op
;
last_addr
=
addr
;
last_data
=
data
;
return
rcode
;
}
#endif
/* CFG_CMD_MII */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录