Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Jack Humbert
reform-boundary-uboot
Commits
cd5b7d4a
Commit
cd5b7d4a
authored
16 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git://git.denx.de/u-boot-net
parents
fe749f0c
d9d78ee4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/qe/uec.c
+50
-0
50 additions, 0 deletions
drivers/qe/uec.c
with
50 additions
and
0 deletions
drivers/qe/uec.c
+
50
−
0
View file @
cd5b7d4a
...
...
@@ -29,6 +29,7 @@
#include
"uccf.h"
#include
"uec.h"
#include
"uec_phy.h"
#include
"miiphy.h"
#if defined(CONFIG_QE)
...
...
@@ -125,6 +126,13 @@ static uec_info_t eth4_uec_info = {
};
#endif
#define MAXCONTROLLERS (4)
static
struct
eth_device
*
devlist
[
MAXCONTROLLERS
];
u16
phy_read
(
struct
uec_mii_info
*
mii_info
,
u16
regnum
);
void
phy_write
(
struct
uec_mii_info
*
mii_info
,
u16
regnum
,
u16
val
);
static
int
uec_mac_enable
(
uec_private_t
*
uec
,
comm_dir_e
mode
)
{
uec_t
*
uec_regs
;
...
...
@@ -629,6 +637,39 @@ static void phy_change(struct eth_device *dev)
adjust_link
(
dev
);
}
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
&& !defined(BITBANGMII)
/*
* Read a MII PHY register.
*
* Returns:
* 0 on success
*/
static
int
uec_miiphy_read
(
char
*
devname
,
unsigned
char
addr
,
unsigned
char
reg
,
unsigned
short
*
value
)
{
*
value
=
uec_read_phy_reg
(
devlist
[
0
],
addr
,
reg
);
return
0
;
}
/*
* Write a MII PHY register.
*
* Returns:
* 0 on success
*/
static
int
uec_miiphy_write
(
char
*
devname
,
unsigned
char
addr
,
unsigned
char
reg
,
unsigned
short
value
)
{
uec_write_phy_reg
(
devlist
[
0
],
addr
,
reg
,
value
);
return
0
;
}
#endif
static
int
uec_set_mac_address
(
uec_private_t
*
uec
,
u8
*
mac_addr
)
{
uec_t
*
uec_regs
;
...
...
@@ -1334,6 +1375,8 @@ int uec_initialize(int index)
return
-
EINVAL
;
}
devlist
[
index
]
=
dev
;
uec
->
uec_info
=
uec_info
;
sprintf
(
dev
->
name
,
"FSL UEC%d"
,
index
);
...
...
@@ -1356,6 +1399,13 @@ int uec_initialize(int index)
return
err
;
}
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
&& !defined(BITBANGMII)
miiphy_register
(
dev
->
name
,
uec_miiphy_read
,
uec_miiphy_write
);
#endif
return
1
;
}
#endif
/* CONFIG_QE */
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