Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
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
vesta
u-boot-2015.04
Commits
e2d45e6f
Commit
e2d45e6f
authored
16 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
elppc board: Coding style cleanup.
Signed-off-by:
Wolfgang Denk
<
wd@denx.de
>
parent
82b24a8a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
board/eltec/elppc/eepro100_srom.c
+50
-49
50 additions, 49 deletions
board/eltec/elppc/eepro100_srom.c
with
50 additions
and
49 deletions
board/eltec/elppc/eepro100_srom.c
+
50
−
49
View file @
e2d45e6f
...
...
@@ -31,82 +31,83 @@
#include
<net.h>
#include
"srom.h"
extern
int
eepro100_write_eeprom
(
struct
eth_device
*
dev
,
int
location
,
int
addr_len
,
unsigned
short
data
);
extern
int
eepro100_write_eeprom
(
struct
eth_device
*
dev
,
int
location
,
int
addr_len
,
unsigned
short
data
);
/*----------------------------------------------------------------------------*/
unsigned
short
eepro100_srom_checksum
(
unsigned
short
*
sromdata
)
{
unsigned
short
sum
=
0
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
(
EE_SIZE
-
1
);
i
++
)
{
sum
+=
sromdata
[
i
];
}
return
(
EE_CHECKSUM
-
sum
);
unsigned
short
sum
=
0
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
(
EE_SIZE
-
1
);
i
++
)
{
sum
+=
sromdata
[
i
];
}
return
(
EE_CHECKSUM
-
sum
);
}
/*----------------------------------------------------------------------------*/
int
eepro100_srom_store
(
unsigned
short
*
source
)
{
int
count
;
struct
eth_device
onboard_dev
;
/* get onboard network iobase */
pci_read_config_dword
(
PCI_BDF
(
0
,
0x10
,
0
),
PCI_BASE_ADDRESS_0
,
(
unsigned
int
*
)
&
onboard_dev
.
iobase
);
onboard_dev
.
iobase
&=
~
0xf
;
source
[
63
]
=
eepro100_srom_checksum
(
source
);
for
(
count
=
0
;
count
<
EE_SIZE
;
count
++
)
{
if
(
eepro100_write_eeprom
((
struct
eth_device
*
)
&
onboard_dev
,
count
,
EE_ADDR_BITS
,
SROM_SHORT
(
source
))
==
-
1
)
return
-
1
;
source
++
;
}
return
0
;
int
count
;
struct
eth_device
onboard_dev
;
/* get onboard network iobase */
pci_read_config_dword
(
PCI_BDF
(
0
,
0x10
,
0
),
PCI_BASE_ADDRESS_0
,
(
unsigned
int
*
)
&
onboard_dev
.
iobase
);
onboard_dev
.
iobase
&=
~
0xf
;
source
[
63
]
=
eepro100_srom_checksum
(
source
);
for
(
count
=
0
;
count
<
EE_SIZE
;
count
++
)
{
if
(
eepro100_write_eeprom
((
struct
eth_device
*
)
&
onboard_dev
,
count
,
EE_ADDR_BITS
,
SROM_SHORT
(
source
))
==
-
1
)
{
return
-
1
;
}
source
++
;
}
return
0
;
}
/*----------------------------------------------------------------------------*/
#ifdef EEPRO100_SROM_CHECK
extern
int
read_eeprom
(
struct
eth_device
*
dev
,
int
location
,
int
addr_len
);
extern
int
read_eeprom
(
struct
eth_device
*
dev
,
int
location
,
int
addr_len
);
void
eepro100_srom_load
(
unsigned
short
*
destination
)
{
int
count
;
struct
eth_device
onboard_dev
;
int
count
;
struct
eth_device
onboard_dev
;
#ifdef DEBUG
int
lr
=
0
;
printf
(
"eepro100_srom_download:
\n
"
);
int
lr
=
0
;
printf
(
"eepro100_srom_download:
\n
"
);
#endif
/* get onboard network iobase */
pci_read_config_dword
(
PCI_BDF
(
0
,
0x10
,
0
),
PCI_BASE_ADDRESS_0
,
&
onboard_dev
.
iobase
);
onboard_dev
.
iobase
&=
~
0xf
;
/* get onboard network iobase */
pci_read_config_dword
(
PCI_BDF
(
0
,
0x10
,
0
),
PCI_BASE_ADDRESS_0
,
&
onboard_dev
.
iobase
);
onboard_dev
.
iobase
&=
~
0xf
;
memset
(
destination
,
0x65
,
128
);
memset
(
destination
,
0x65
,
128
);
for
(
count
=
0
;
count
<
0x40
;
count
++
)
{
*
destination
++
=
read_eeprom
((
struct
eth_device
*
)
&
onboard_dev
,
count
,
EE_ADDR_BITS
);
for
(
count
=
0
;
count
<
0x40
;
count
++
)
{
*
destination
++
=
read_eeprom
((
struct
eth_device
*
)
&
onboard_dev
,
count
,
EE_ADDR_BITS
);
#ifdef DEBUG
printf
(
"%04x "
,
*
(
destination
-
1
));
if
(
lr
++
==
7
)
{
printf
(
"
\n
"
);
lr
=
0
;
}
printf
(
"%04x "
,
*
(
destination
-
1
));
if
(
lr
++
==
7
)
{
printf
(
"
\n
"
);
lr
=
0
;
}
#endif
}
}
}
#endif
/* EEPRO100_SROM_CHECK */
...
...
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