Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
8e6ec690
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8e6ec690
编写于
5月 12, 2006
作者:
K
Kyungmin Park
提交者:
Jarkko Lavinen
5月 12, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OneNAND: Add write_oob verify function
Signed-off-by:
N
Jarkko Lavinen
<
jarkko.lavinen@nokia.com
>
上级
d9777f1c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
4 deletion
+43
-4
drivers/mtd/onenand/onenand_base.c
drivers/mtd/onenand/onenand_base.c
+43
-4
未找到文件。
drivers/mtd/onenand/onenand_base.c
浏览文件 @
8e6ec690
...
...
@@ -758,6 +758,36 @@ static int onenand_read_oob(struct mtd_info *mtd, loff_t from, size_t len,
}
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
/**
* onenand_verify_oob - [GENERIC] verify the oob contents after a write
* @param mtd MTD device structure
* @param buf the databuffer to verify
* @param to offset to read from
* @param len number of bytes to read and compare
*
*/
static
int
onenand_verify_oob
(
struct
mtd_info
*
mtd
,
const
u_char
*
buf
,
loff_t
to
,
int
len
)
{
struct
onenand_chip
*
this
=
mtd
->
priv
;
char
*
readp
=
this
->
page_buf
;
int
column
=
to
&
(
mtd
->
oobsize
-
1
);
int
status
,
i
;
this
->
command
(
mtd
,
ONENAND_CMD_READOOB
,
to
,
mtd
->
oobsize
);
onenand_update_bufferram
(
mtd
,
to
,
0
);
status
=
this
->
wait
(
mtd
,
FL_READING
);
if
(
status
)
return
status
;
this
->
read_bufferram
(
mtd
,
ONENAND_SPARERAM
,
readp
,
column
,
len
);
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
buf
[
i
]
!=
0xFF
&&
buf
[
i
]
!=
readp
[
i
])
return
-
EBADMSG
;
return
0
;
}
/**
* onenand_verify_page - [GENERIC] verify the chip contents after a write
* @param mtd MTD device structure
...
...
@@ -790,6 +820,7 @@ static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, loff_t addr)
}
#else
#define onenand_verify_page(...) (0)
#define onenand_verify_oob(...) (0)
#endif
#define NOTALIGNED(x) ((x & (mtd->oobblock - 1)) != 0)
...
...
@@ -909,7 +940,7 @@ static int onenand_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
size_t
*
retlen
,
const
u_char
*
buf
)
{
struct
onenand_chip
*
this
=
mtd
->
priv
;
int
column
,
status
;
int
column
,
ret
=
0
;
int
written
=
0
;
DEBUG
(
MTD_DEBUG_LEVEL3
,
"onenand_write_oob: to = 0x%08x, len = %i
\n
"
,
(
unsigned
int
)
to
,
(
int
)
len
);
...
...
@@ -941,9 +972,17 @@ static int onenand_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
onenand_update_bufferram
(
mtd
,
to
,
0
);
status
=
this
->
wait
(
mtd
,
FL_WRITING
);
if
(
status
)
ret
=
this
->
wait
(
mtd
,
FL_WRITING
);
if
(
ret
)
{
DEBUG
(
MTD_DEBUG_LEVEL0
,
"onenand_write_oob: write filaed %d
\n
"
,
ret
);
goto
out
;
}
ret
=
onenand_verify_oob
(
mtd
,
buf
,
to
,
thislen
);
if
(
ret
)
{
DEBUG
(
MTD_DEBUG_LEVEL0
,
"onenand_write_oob: verify failed %d
\n
"
,
ret
);
goto
out
;
}
written
+=
thislen
;
...
...
@@ -960,7 +999,7 @@ static int onenand_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
*
retlen
=
written
;
return
0
;
return
ret
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录