Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
4f127980
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,发现更多精彩内容 >>
提交
4f127980
编写于
11月 11, 2009
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-net
上级
a9e9d69d
651ef90f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
44 addition
and
36 deletion
+44
-36
doc/README.drivers.eth
doc/README.drivers.eth
+8
-5
drivers/net/cs8900.c
drivers/net/cs8900.c
+5
-4
drivers/net/dm9000x.c
drivers/net/dm9000x.c
+14
-12
drivers/net/fec_mxc.c
drivers/net/fec_mxc.c
+12
-8
drivers/net/smc91111.h
drivers/net/smc91111.h
+4
-4
include/configs/lpd7a400-10.h
include/configs/lpd7a400-10.h
+0
-1
include/configs/lpd7a404-10.h
include/configs/lpd7a404-10.h
+0
-1
include/configs/lpd7a404.h
include/configs/lpd7a404.h
+1
-1
未找到文件。
doc/README.drivers.eth
浏览文件 @
4f127980
...
...
@@ -122,10 +122,12 @@ function can be called multiple times in a row.
The recv function should process packets as long as the hardware has them
readily available before returning. i.e. you should drain the hardware fifo.
The common code sets up packet buffers for you already (NetRxPackets), so there
is no need to allocate your own. For each packet you receive, you should call
the NetReceive() function on it with the packet length. So the pseudo code
here would look something like:
For each packet you receive, you should call the NetReceive() function on it
along with the packet length. The common code sets up packet buffers for you
already in the .bss (NetRxPackets), so there should be no need to allocate your
own. This doesn't mean you must use the NetRxPackets array however; you're
free to call the NetReceive() function with any buffer you wish. So the pseudo
code here would look something like:
int ape_recv(struct eth_device *dev)
{
int length, i = 0;
...
...
@@ -145,7 +147,8 @@ int ape_recv(struct eth_device *dev)
}
The halt function should turn off / disable the hardware and place it back in
its reset state.
its reset state. It can be called at any time (before any call to the related
init function), so make sure it can handle this sort of thing.
So the call graph at this stage would look something like:
some net operation (ping / tftp / whatever...)
...
...
drivers/net/cs8900.c
浏览文件 @
4f127980
...
...
@@ -56,7 +56,7 @@
#define REG_READ(a) readl((a))
/* we don't need 16 bit initialisation on 32 bit bus */
#define get_reg_init_bus(
x) get_reg((x
))
#define get_reg_init_bus(
r,d) get_reg((r),(d
))
#else
...
...
@@ -321,15 +321,16 @@ int cs8900_initialize(u8 dev_num, int base_addr)
memset
(
priv
,
0
,
sizeof
(
*
priv
));
priv
->
regs
=
(
struct
cs8900_regs
*
)
base_addr
;
/* Load MAC address from EEPROM */
cs8900_get_enetaddr
(
dev
);
dev
->
iobase
=
base_addr
;
dev
->
priv
=
priv
;
dev
->
init
=
cs8900_init
;
dev
->
halt
=
cs8900_halt
;
dev
->
send
=
cs8900_send
;
dev
->
recv
=
cs8900_recv
;
/* Load MAC address from EEPROM */
cs8900_get_enetaddr
(
dev
);
sprintf
(
dev
->
name
,
"%s-%hu"
,
CS8900_DRIVERNAME
,
dev_num
);
eth_register
(
dev
);
...
...
drivers/net/dm9000x.c
浏览文件 @
4f127980
...
...
@@ -284,7 +284,6 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
int
i
,
oft
,
lnk
;
u8
io_mode
;
struct
board_info
*
db
=
&
dm9000_info
;
uchar
enetaddr
[
6
];
DM9000_DBG
(
"%s
\n
"
,
__func__
);
...
...
@@ -342,20 +341,11 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
/* Clear interrupt status */
DM9000_iow
(
DM9000_ISR
,
ISR_ROOS
|
ISR_ROS
|
ISR_PTS
|
ISR_PRS
);
/* Set Node address */
if
(
!
eth_getenv_enetaddr
(
"ethaddr"
,
enetaddr
))
{
#if !defined(CONFIG_DM9000_NO_SROM)
for
(
i
=
0
;
i
<
3
;
i
++
)
dm9000_read_srom_word
(
i
,
enetaddr
+
2
*
i
);
eth_setenv_enetaddr
(
"ethaddr"
,
enetaddr
);
#endif
}
printf
(
"MAC: %pM
\n
"
,
enetaddr
);
printf
(
"MAC: %pM
\n
"
,
dev
->
enetaddr
);
/* fill device MAC address registers */
for
(
i
=
0
,
oft
=
DM9000_PAR
;
i
<
6
;
i
++
,
oft
++
)
DM9000_iow
(
oft
,
enetaddr
[
i
]);
DM9000_iow
(
oft
,
dev
->
enetaddr
[
i
]);
for
(
i
=
0
,
oft
=
0x16
;
i
<
8
;
i
++
,
oft
++
)
DM9000_iow
(
oft
,
0xff
);
...
...
@@ -558,6 +548,15 @@ void dm9000_write_srom_word(int offset, u16 val)
}
#endif
static
void
dm9000_get_enetaddr
(
struct
eth_device
*
dev
)
{
#if !defined(CONFIG_DM9000_NO_SROM)
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
dm9000_read_srom_word
(
i
,
dev
->
enetaddr
+
(
2
*
i
));
#endif
}
/*
Read a byte from I/O port
*/
...
...
@@ -621,6 +620,9 @@ int dm9000_initialize(bd_t *bis)
{
struct
eth_device
*
dev
=
&
(
dm9000_info
.
netdev
);
/* Load MAC address from EEPROM */
dm9000_get_enetaddr
(
dev
);
dev
->
init
=
dm9000_init
;
dev
->
halt
=
dm9000_halt
;
dev
->
send
=
dm9000_send
;
...
...
drivers/net/fec_mxc.c
浏览文件 @
4f127980
...
...
@@ -55,6 +55,8 @@ struct fec_priv gfec = {
.
tbd_base
=
NULL
,
.
tbd_index
=
0
,
.
bd
=
NULL
,
.
rdb_ptr
=
NULL
,
.
base_ptr
=
NULL
,
};
/*
...
...
@@ -157,7 +159,9 @@ static int miiphy_restart_aneg(struct eth_device *dev)
/*
* Set the auto-negotiation advertisement register bits
*/
miiphy_write
(
dev
->
name
,
CONFIG_FEC_MXC_PHYADDR
,
PHY_ANAR
,
0x1e0
);
miiphy_write
(
dev
->
name
,
CONFIG_FEC_MXC_PHYADDR
,
PHY_ANAR
,
PHY_ANLPAR_TXFD
|
PHY_ANLPAR_TX
|
PHY_ANLPAR_10FD
|
PHY_ANLPAR_10
|
PHY_ANLPAR_PSB_802_3
);
miiphy_write
(
dev
->
name
,
CONFIG_FEC_MXC_PHYADDR
,
PHY_BMCR
,
PHY_BMCR_AUTON
|
PHY_BMCR_RST_NEG
);
...
...
@@ -228,7 +232,8 @@ static int fec_rbd_init(struct fec_priv *fec, int count, int size)
uint32_t
p
=
0
;
/* reserve data memory and consider alignment */
fec
->
rdb_ptr
=
malloc
(
size
*
count
+
DB_DATA_ALIGNMENT
);
if
(
fec
->
rdb_ptr
==
NULL
)
fec
->
rdb_ptr
=
malloc
(
size
*
count
+
DB_DATA_ALIGNMENT
);
p
=
(
uint32_t
)
fec
->
rdb_ptr
;
if
(
!
p
)
{
puts
(
"fec_imx27: not enough malloc memory!
\n
"
);
...
...
@@ -341,8 +346,8 @@ static int fec_open(struct eth_device *edev)
writel
(
FEC_ECNTRL_ETHER_EN
,
&
fec
->
eth
->
ecntrl
);
miiphy_wait_aneg
(
edev
);
miiphy_speed
(
edev
->
name
,
0
);
miiphy_duplex
(
edev
->
name
,
0
);
miiphy_speed
(
edev
->
name
,
CONFIG_FEC_MXC_PHYADDR
);
miiphy_duplex
(
edev
->
name
,
CONFIG_FEC_MXC_PHYADDR
);
/*
* Enable SmartDMA receive task
...
...
@@ -363,8 +368,9 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
* Datasheet forces the startaddress of each chain is 16 byte
* aligned
*/
fec
->
base_ptr
=
malloc
((
2
+
FEC_RBD_NUM
)
*
sizeof
(
struct
fec_bd
)
+
DB_ALIGNMENT
);
if
(
fec
->
base_ptr
==
NULL
)
fec
->
base_ptr
=
malloc
((
2
+
FEC_RBD_NUM
)
*
sizeof
(
struct
fec_bd
)
+
DB_ALIGNMENT
);
base
=
(
uint32_t
)
fec
->
base_ptr
;
if
(
!
base
)
{
puts
(
"fec_imx27: not enough malloc memory!
\n
"
);
...
...
@@ -491,8 +497,6 @@ static void fec_halt(struct eth_device *dev)
writel
(
0
,
&
fec
->
eth
->
ecntrl
);
fec
->
rbd_index
=
0
;
fec
->
tbd_index
=
0
;
free
(
fec
->
rdb_ptr
);
free
(
fec
->
base_ptr
);
debug
(
"eth_halt: done
\n
"
);
}
...
...
drivers/net/smc91111.h
浏览文件 @
4f127980
...
...
@@ -81,10 +81,10 @@ struct smc91111_priv{
#ifdef CONFIG_PXA250
#ifdef CONFIG_XSENGINE
#define SMC_inl(a,r) (*((volatile dword *)((a)->iobase+(
r
<<1))))
#define SMC_inw(a,r) (*((volatile word *)((a)->iobase+(
r
<<1))))
#define SMC_inl(a,r) (*((volatile dword *)((a)->iobase+(
(r)
<<1))))
#define SMC_inw(a,r) (*((volatile word *)((a)->iobase+(
(r)
<<1))))
#define SMC_inb(a,p) ({ \
unsigned int __p = (unsigned int)((a)->iobase + (
p
<<1)); \
unsigned int __p = (unsigned int)((a)->iobase + (
(p)
<<1)); \
unsigned int __v = *(volatile unsigned short *)((__p) & ~2); \
if (__p & 2) __v >>= 8; \
else __v &= 0xff; \
...
...
@@ -99,7 +99,7 @@ struct smc91111_priv{
__v; })
#define SMC_inb(a,p) ({ \
unsigned int ___v = SMC_inw((a),(p) & ~1); \
if (
p
& 1) ___v >>= 8; \
if (
(p)
& 1) ___v >>= 8; \
else ___v &= 0xff; \
___v; })
#else
...
...
include/configs/lpd7a400-10.h
浏览文件 @
4f127980
...
...
@@ -76,6 +76,5 @@
#define CONFIG_SMC91111
#define CONFIG_SMC91111_BASE (0x70000000)
#undef CONFIG_SMC_USE_32_BIT
#define CONFIG_SMC_USE_IOFUNCS
#endif
/* __LPD7A400_10_H */
include/configs/lpd7a404-10.h
浏览文件 @
4f127980
...
...
@@ -76,6 +76,5 @@
#define CONFIG_SMC91111
#define CONFIG_SMC91111_BASE (0x70000000)
#undef CONFIG_SMC_USE_32_BIT
#define CONFIG_SMC_USE_IOFUNCS
#endif
/* __LPD7A404_10_H */
include/configs/lpd7a404.h
浏览文件 @
4f127980
...
...
@@ -72,7 +72,7 @@
#include <config_cmd_default.h>
#ifndef USE_920T_MMU
#define CONFIG_CMD_PING
)
#define CONFIG_CMD_PING
#undef CONFIG_CMD_CACHE
#else
#define CONFIG_CMD_DATE
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录