Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Evan Lojewski
ast2050-flashrom
Commits
4572a822
Commit
4572a822
authored
22 years ago
by
Ronald G. Minnich
Browse files
Options
Download
Email Patches
Plain Diff
Clean up at user request
Corresponding to coreboot v1 svn r743.
parent
bb0322f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
flash_rom.c
flash_rom.c
+8
-5
mx29f002.c
mx29f002.c
+1
-1
No files found.
flash_rom.c
View file @
4572a822
...
...
@@ -181,7 +181,7 @@ unsigned long micro = 0;
void
myusec_calibrate_delay
()
{
unsigned
long
count
=
2
*
1024
*
1024
;
unsigned
long
count
=
2
0
*
1024
*
1024
;
volatile
unsigned
long
i
;
unsigned
long
timeusec
;
struct
timeval
start
,
end
;
...
...
@@ -189,7 +189,7 @@ myusec_calibrate_delay()
fprintf
(
stderr
,
"Setting up microsecond timing loop
\n
"
);
while
(
!
ok
)
{
fprintf
(
stderr
,
"Try %d
\n
"
,
count
);
//
fprintf(stderr, "Try %d\n", count);
gettimeofday
(
&
start
,
0
);
for
(
i
=
count
;
i
;
i
--
)
;
...
...
@@ -206,7 +206,7 @@ myusec_calibrate_delay()
// compute one microsecond. That will be count / time
micro
=
count
/
timeusec
;
fprintf
(
stderr
,
"one us is %d count
\n
"
,
micro
);
//
fprintf(stderr, "one us is %d count\n", micro);
}
...
...
@@ -227,8 +227,6 @@ main (int argc, char * argv[])
FILE
*
image
;
struct
flashchip
*
flash
;
myusec_calibrate_delay
();
if
(
argc
>
2
){
printf
(
"usage: %s [romimage]
\n
"
,
argv
[
0
]);
printf
(
" If no romimage is specified, then all that happens
\n
"
);
...
...
@@ -255,6 +253,11 @@ main (int argc, char * argv[])
buf
=
(
char
*
)
calloc
(
size
,
sizeof
(
char
));
fread
(
buf
,
sizeof
(
char
),
size
,
image
);
printf
(
"Calibrating timer since microsleep sucks ... takes a second
\n
"
);
myusec_calibrate_delay
();
printf
(
"OK, calibrated, now do the deed
\n
"
);
flash
->
write
(
flash
,
buf
);
verify_flash
(
flash
,
buf
);
return
0
;
}
This diff is collapsed.
Click to expand it.
mx29f002.c
View file @
4572a822
...
...
@@ -44,7 +44,7 @@ int probe_29f002 (struct flashchip * flash)
myusec_delay
(
10
);
printf
(
__FUNCTION__
"
id1 %d, id2 %d
\n
"
,
id1
,
id2
);
printf
(
"%s:
id1 %d, id2 %d
\n
"
,
__FUNCTION__
,
id1
,
id2
);
if
(
id1
==
flash
->
manufacture_id
&&
id2
==
flash
->
model_id
)
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment