Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
e334e05b
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e334e05b
编写于
3月 23, 2008
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://www.denx.de/git/u-boot-cfi-flash
上级
161efeb0
f0105727
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
1 deletion
+44
-1
README
README
+5
-0
drivers/mtd/cfi_flash.c
drivers/mtd/cfi_flash.c
+39
-1
未找到文件。
README
浏览文件 @
e334e05b
...
...
@@ -1946,6 +1946,11 @@ Configuration Settings:
is useful, if some of the configured banks are only
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:
Defines the number of ethernet receive buffers. On some
ethernet controllers it is recommended to set this value
...
...
drivers/mtd/cfi_flash.c
浏览文件 @
e334e05b
...
...
@@ -1179,6 +1179,27 @@ void flash_print_info (flash_info_t * info)
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.
*/
#ifdef CONFIG_FLASH_SHOW_PROGRESS
#define FLASH_SHOW_PROGRESS(scale, dots, digit, dots_sub) \
dots -= dots_sub; \
if ((scale > 0) && (dots <= 0)) { \
if ((digit % 5) == 0) \
printf ("%d", digit / 5); \
else \
putc ('.'); \
digit--; \
dots += scale; \
}
#else
#define FLASH_SHOW_PROGRESS(scale, dots, digit, dots_sub)
#endif
/*-----------------------------------------------------------------------
* Copy memory to flash, returns:
* 0 - OK
...
...
@@ -1192,10 +1213,23 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
int
aln
;
cfiword_t
cword
;
int
i
,
rc
;
#ifdef CFG_FLASH_USE_BUFFER_WRITE
int
buffered_size
;
#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 */
wp
=
(
addr
&
~
(
info
->
portwidth
-
1
));
...
...
@@ -1219,6 +1253,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
return
rc
;
wp
+=
i
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
,
i
);
}
/* handle the aligned part */
...
...
@@ -1248,6 +1283,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
wp
+=
i
;
src
+=
i
;
cnt
-=
i
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
,
i
);
}
#else
while
(
cnt
>=
info
->
portwidth
)
{
...
...
@@ -1259,8 +1295,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
return
rc
;
wp
+=
info
->
portwidth
;
cnt
-=
info
->
portwidth
;
FLASH_SHOW_PROGRESS
(
scale
,
dots
,
digit
,
info
->
portwidth
);
}
#endif
/* CFG_FLASH_USE_BUFFER_WRITE */
if
(
cnt
==
0
)
{
return
(
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录