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
9a042e9c
Commit
9a042e9c
authored
17 years ago
by
Jerry Van Baren
Committed by
Stefan Roese
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Flash programming progress countdown.
Signed-off-by:
Gerald Van Baren
<
vanbaren@cideas.com
>
parent
23e20aa6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README
+5
-0
5 additions, 0 deletions
README
drivers/mtd/cfi_flash.c
+43
-1
43 additions, 1 deletion
drivers/mtd/cfi_flash.c
with
48 additions
and
1 deletion
README
+
5
−
0
View file @
9a042e9c
...
@@ -1946,6 +1946,11 @@ Configuration Settings:
...
@@ -1946,6 +1946,11 @@ Configuration Settings:
is useful, if some of the configured banks are only
is useful, if some of the configured banks are only
optionally available.
optionally available.
- CONFIG_FLASH_SHOW_PROGRESS
If defined (must be an integer), print out countdown
digits and dots. Recommended value: 45 (9..1) for 80
column displays, 15 (3..1) for 40 column displays.
- CFG_RX_ETH_BUFFER:
- CFG_RX_ETH_BUFFER:
Defines the number of ethernet receive buffers. On some
Defines the number of ethernet receive buffers. On some
ethernet controllers it is recommended to set this value
ethernet controllers it is recommended to set this value
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/cfi_flash.c
+
43
−
1
View file @
9a042e9c
...
@@ -1179,6 +1179,22 @@ void flash_print_info (flash_info_t * info)
...
@@ -1179,6 +1179,22 @@ void flash_print_info (flash_info_t * info)
return
;
return
;
}
}
/*-----------------------------------------------------------------------
* This is used in a few places in write_buf() to show programming
* progress. Making it a function is nasty because it needs to do side
* effect updates to digit and dots. Repeated code is nasty too, so
* we define it once here.
*/
#define FLASH_SHOW_PROGRESS(scale, dots, digit) \
if ((scale > 0) && (dots <= 0)) { \
if ((digit % 5) == 0) \
printf ("%d", digit / 5); \
else \
putc ('.'); \
digit--; \
dots += scale; \
}
/*-----------------------------------------------------------------------
/*-----------------------------------------------------------------------
* Copy memory to flash, returns:
* Copy memory to flash, returns:
* 0 - OK
* 0 - OK
...
@@ -1192,10 +1208,23 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
...
@@ -1192,10 +1208,23 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
int
aln
;
int
aln
;
cfiword_t
cword
;
cfiword_t
cword
;
int
i
,
rc
;
int
i
,
rc
;
#ifdef CFG_FLASH_USE_BUFFER_WRITE
#ifdef CFG_FLASH_USE_BUFFER_WRITE
int
buffered_size
;
int
buffered_size
;
#endif
#endif
#ifdef CONFIG_FLASH_SHOW_PROGRESS
int
digit
=
CONFIG_FLASH_SHOW_PROGRESS
;
int
scale
=
0
;
int
dots
=
0
;
/*
* Suppress if there are fewer than CONFIG_FLASH_SHOW_PROGRESS writes.
*/
if
(
cnt
>=
CONFIG_FLASH_SHOW_PROGRESS
)
{
scale
=
(
int
)((
cnt
+
CONFIG_FLASH_SHOW_PROGRESS
-
1
)
/
CONFIG_FLASH_SHOW_PROGRESS
);
}
#endif
/* get lower aligned address */
/* get lower aligned address */
wp
=
(
addr
&
~
(
info
->
portwidth
-
1
));
wp
=
(
addr
&
~
(
info
->
portwidth
-
1
));
...
@@ -1219,6 +1248,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
...
@@ -1219,6 +1248,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
return
rc
;
return
rc
;
wp
+=
i
;
wp
+=
i
;
#ifdef CONFIG_FLASH_SHOW_PROGRESS
dots
-=
i
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
);
#endif
}
}
/* handle the aligned part */
/* handle the aligned part */
...
@@ -1248,6 +1281,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
...
@@ -1248,6 +1281,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
wp
+=
i
;
wp
+=
i
;
src
+=
i
;
src
+=
i
;
cnt
-=
i
;
cnt
-=
i
;
#ifdef CONFIG_FLASH_SHOW_PROGRESS
dots
-=
i
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
);
#endif
}
}
#else
#else
while
(
cnt
>=
info
->
portwidth
)
{
while
(
cnt
>=
info
->
portwidth
)
{
...
@@ -1259,8 +1296,13 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
...
@@ -1259,8 +1296,13 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
return
rc
;
return
rc
;
wp
+=
info
->
portwidth
;
wp
+=
info
->
portwidth
;
cnt
-=
info
->
portwidth
;
cnt
-=
info
->
portwidth
;
#ifdef CONFIG_FLASH_SHOW_PROGRESS
dots
-=
info
->
portwidth
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
);
#endif
}
}
#endif
/* CFG_FLASH_USE_BUFFER_WRITE */
#endif
/* CFG_FLASH_USE_BUFFER_WRITE */
if
(
cnt
==
0
)
{
if
(
cnt
==
0
)
{
return
(
0
);
return
(
0
);
}
}
...
...
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