Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rk3576 Downstream U-Boot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Frattaroli
Rk3576 Downstream U-Boot
Commits
a3ed3996
Commit
a3ed3996
authored
21 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
* Patch by Vladimir Gurevich, 04 Jun 2003:
make ppc405 ethernet driver compatible with CONFIG_NET_MULTI option
parent
73a8b27c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+3
-0
3 additions, 0 deletions
CHANGELOG
cpu/ppc4xx/405gp_enet.c
+54
-13
54 additions, 13 deletions
cpu/ppc4xx/405gp_enet.c
include/405gp_enet.h
+0
-2
0 additions, 2 deletions
include/405gp_enet.h
net/eth.c
+4
-0
4 additions, 0 deletions
net/eth.c
with
61 additions
and
15 deletions
CHANGELOG
+
3
−
0
View file @
a3ed3996
...
...
@@ -2,6 +2,9 @@
Changes since U-Boot 0.3.1:
======================================================================
* Patch by Vladimir Gurevich, 04 Jun 2003:
make ppc405 ethernet driver compatible with CONFIG_NET_MULTI option
* Patch by Stefan Roese, 05 Jun 2003:
- PPC4xx: Fix bug for initial stack in data cache as pointed out by
Thomas Schaefer (tschaefer@giga-stream.de). Now inital stack in
...
...
This diff is collapsed.
Click to expand it.
cpu/ppc4xx/405gp_enet.c
+
54
−
13
View file @
a3ed3996
...
...
@@ -173,17 +173,16 @@ static bd_t *bis_save = NULL; /* for eth_init upon mal error */
static
int
is_receiving
=
0
;
/* sync with eth interrupt */
static
int
print_speed
=
1
;
/* print speed message upon start */
static
void
enet_rcv
(
unsigned
long
malisr
);
/*-----------------------------------------------------------------------------+
* Prototypes and externals.
*-----------------------------------------------------------------------------*/
void
mal_err
(
unsigned
long
isr
,
unsigned
long
uic
,
unsigned
long
mal_def
,
static
void
enet_rcv
(
unsigned
long
malisr
);
static
int
enetInt
(
void
);
static
void
mal_err
(
unsigned
long
isr
,
unsigned
long
uic
,
unsigned
long
mal_def
,
unsigned
long
mal_errr
);
void
emac_err
(
unsigned
long
isr
);
static
void
emac_err
(
unsigned
long
isr
);
void
eth_halt
(
void
)
static
void
ppc_4xx_eth_halt
(
struct
eth_device
*
dev
)
{
mtdcr
(
malier
,
0x00000000
);
/* disable mal interrupts */
out32
(
EMAC_IER
,
0x00000000
);
/* disable emac interrupts */
...
...
@@ -202,7 +201,7 @@ void eth_halt (void)
}
int
eth_init
(
bd_t
*
bis
)
static
int
ppc_4xx_eth_init
(
struct
eth_device
*
dev
,
bd_t
*
bis
)
{
int
i
;
unsigned
long
reg
;
...
...
@@ -478,11 +477,11 @@ int eth_init (bd_t * bis)
bis_save
=
bis
;
first_init
=
1
;
return
(
0
);
return
(
1
);
}
int
eth_send
(
volatile
void
*
ptr
,
int
len
)
static
int
ppc_4xx_eth_send
(
struct
eth_device
*
dev
,
volatile
void
*
ptr
,
int
len
)
{
struct
enet_frame
*
ef_ptr
;
ulong
time_start
,
time_now
;
...
...
@@ -539,7 +538,7 @@ int eth_send (volatile void *ptr, int len)
return
(
-
1
);
}
}
else
{
return
(
0
);
return
(
len
);
}
}
}
...
...
@@ -696,7 +695,7 @@ int enetInt ()
/*-----------------------------------------------------------------------------+
* MAL Error Routine
*-----------------------------------------------------------------------------*/
void
mal_err
(
unsigned
long
isr
,
unsigned
long
uic
,
unsigned
long
maldef
,
static
void
mal_err
(
unsigned
long
isr
,
unsigned
long
uic
,
unsigned
long
maldef
,
unsigned
long
mal_errr
)
{
mtdcr
(
malesr
,
isr
);
/* clear interrupt */
...
...
@@ -724,7 +723,7 @@ void mal_err (unsigned long isr, unsigned long uic, unsigned long maldef,
/*-----------------------------------------------------------------------------+
* EMAC Error Routine
*-----------------------------------------------------------------------------*/
void
emac_err
(
unsigned
long
isr
)
static
void
emac_err
(
unsigned
long
isr
)
{
printf
(
"EMAC error occured.... ISR = %lx
\n
"
,
isr
);
out32
(
EMAC_ISR
,
isr
);
...
...
@@ -816,7 +815,7 @@ static void enet_rcv (unsigned long malisr)
}
int
eth_rx
(
void
)
static
int
ppc_4xx_eth_rx
(
struct
eth_device
*
dev
)
{
int
length
;
int
user_index
;
...
...
@@ -864,4 +863,46 @@ int eth_rx (void)
return
length
;
}
#if defined(CONFIG_NET_MULTI)
int
ppc_4xx_eth_initialize
(
bd_t
*
bis
)
{
struct
eth_device
*
dev
;
int
eth_num
=
0
;
dev
=
malloc
(
sizeof
*
dev
);
if
(
dev
==
NULL
)
{
printf
(
__FUNCTION__
": Cannot allocate eth_device
\n
"
);
return
(
-
1
);
}
sprintf
(
dev
->
name
,
"ppc_4xx_eth%d"
,
eth_num
);
dev
->
priv
=
(
void
*
)
eth_num
;
dev
->
init
=
ppc_4xx_eth_init
;
dev
->
halt
=
ppc_4xx_eth_halt
;
dev
->
send
=
ppc_4xx_eth_send
;
dev
->
recv
=
ppc_4xx_eth_rx
;
eth_register
(
dev
);
}
#else
/* !defined(CONFIG_NET_MULTI) */
void
eth_halt
(
void
)
{
ppc_4xx_eth_halt
(
NULL
);
}
int
eth_init
(
bd_t
*
bis
)
{
return
(
ppc_4xx_eth_init
(
NULL
,
bis
));
}
int
eth_send
(
volatile
void
*
packet
,
int
length
)
{
return
(
ppc_4xx_eth_send
(
NULL
,
packet
,
length
));
}
int
eth_rx
(
void
)
{
return
(
ppc_4xx_eth_rx
(
NULL
));
}
#endif
/* !defined(CONFIG_NET_MULTI) */
#endif
/* CONFIG_405GP */
This diff is collapsed.
Click to expand it.
include/405gp_enet.h
+
0
−
2
View file @
a3ed3996
...
...
@@ -241,6 +241,4 @@ struct arp_entry {
/*-----------------------------------------------------------------------------+
| Function prototypes for device table.
+-----------------------------------------------------------------------------*/
int
enetInt
(
void
);
#endif
/* _enetLib_h_ */
This diff is collapsed.
Click to expand it.
net/eth.c
+
4
−
0
View file @
a3ed3996
...
...
@@ -41,6 +41,7 @@ extern int pcnet_initialize(bd_t*);
extern
int
fec_initialize
(
bd_t
*
);
extern
int
scc_initialize
(
bd_t
*
);
extern
int
inca_switch_initialize
(
bd_t
*
);
extern
int
ppc_4xx_eth_initialize
(
bd_t
*
);
extern
int
plb2800_eth_initialize
(
bd_t
*
);
static
struct
eth_device
*
eth_devices
,
*
eth_current
;
...
...
@@ -98,6 +99,9 @@ int eth_initialize(bd_t *bis)
eth_devices
=
NULL
;
eth_current
=
NULL
;
#if (defined(CONFIG_405GP) || defined(CONFIG_440)|| defined(CONFIG_405EP)
ppc_4xx_eth_initialize
(
bis
);
#endif
#ifdef CONFIG_INCA_IP_SWITCH
inca_switch_initialize
(
bis
);
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment