Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
06ecb04a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
06ecb04a
编写于
6月 02, 2009
作者:
S
Sascha Hauer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mxc_nand: merge send_read_page and send_prog_page
Signed-off-by:
N
Sascha Hauer
<
s.hauer@pengutronix.de
>
上级
13e1add1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
41 deletion
+13
-41
drivers/mtd/nand/mxc_nand.c
drivers/mtd/nand/mxc_nand.c
+13
-41
未找到文件。
drivers/mtd/nand/mxc_nand.c
浏览文件 @
06ecb04a
...
...
@@ -226,12 +226,10 @@ static void send_addr(struct mxc_nand_host *host, uint16_t addr, int islast)
wait_op_done
(
host
,
TROP_US_DELAY
,
addr
,
islast
);
}
/* This function requests the NANDFC to initate the transfer
* of data currently in the NANDFC RAM buffer to the NAND device. */
static
void
send_prog_page
(
struct
mxc_nand_host
*
host
,
uint8_t
buf_id
,
int
spare_only
)
static
void
send_page
(
struct
mxc_nand_host
*
host
,
uint8_t
buf_id
,
int
spare_only
,
unsigned
int
ops
)
{
DEBUG
(
MTD_DEBUG_LEVEL3
,
"send_p
rog_p
age (%d)
\n
"
,
spare_only
);
DEBUG
(
MTD_DEBUG_LEVEL3
,
"send_page (%d)
\n
"
,
spare_only
);
/* NANDFC buffer 0 is used for page read/write */
writew
(
buf_id
,
host
->
regs
+
NFC_BUF_ADDR
);
...
...
@@ -246,33 +244,7 @@ static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id,
writew
(
config1
,
host
->
regs
+
NFC_CONFIG1
);
}
writew
(
NFC_INPUT
,
host
->
regs
+
NFC_CONFIG2
);
/* Wait for operation to complete */
wait_op_done
(
host
,
TROP_US_DELAY
,
spare_only
,
true
);
}
/* Requests NANDFC to initated the transfer of data from the
* NAND device into in the NANDFC ram buffer. */
static
void
send_read_page
(
struct
mxc_nand_host
*
host
,
uint8_t
buf_id
,
int
spare_only
)
{
DEBUG
(
MTD_DEBUG_LEVEL3
,
"send_read_page (%d)
\n
"
,
spare_only
);
/* NANDFC buffer 0 is used for page read/write */
writew
(
buf_id
,
host
->
regs
+
NFC_BUF_ADDR
);
/* Configure spare or page+spare access */
if
(
!
host
->
pagesize_2k
)
{
uint32_t
config1
=
readw
(
host
->
regs
+
NFC_CONFIG1
);
if
(
spare_only
)
config1
|=
NFC_SP_EN
;
else
config1
&=
~
NFC_SP_EN
;
writew
(
config1
,
host
->
regs
+
NFC_CONFIG1
);
}
writew
(
NFC_OUTPUT
,
host
->
regs
+
NFC_CONFIG2
);
writew
(
ops
,
host
->
regs
+
NFC_CONFIG2
);
/* Wait for operation to complete */
wait_op_done
(
host
,
TROP_US_DELAY
,
spare_only
,
true
);
...
...
@@ -756,13 +728,13 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
break
;
case
NAND_CMD_PAGEPROG
:
send_p
rog_page
(
host
,
0
,
host
->
spare_only
);
send_p
age
(
host
,
0
,
host
->
spare_only
,
NFC_INPUT
);
if
(
host
->
pagesize_2k
)
{
/* data in 4 areas datas */
send_p
rog_page
(
host
,
1
,
host
->
spare_only
);
send_p
rog_page
(
host
,
2
,
host
->
spare_only
);
send_p
rog_page
(
host
,
3
,
host
->
spare_only
);
send_p
age
(
host
,
1
,
host
->
spare_only
,
NFC_INPUT
);
send_p
age
(
host
,
2
,
host
->
spare_only
,
NFC_INPUT
);
send_p
age
(
host
,
3
,
host
->
spare_only
,
NFC_INPUT
);
}
break
;
...
...
@@ -827,12 +799,12 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
/* send read confirm command */
send_cmd
(
host
,
NAND_CMD_READSTART
,
true
);
/* read for each AREA */
send_
read_page
(
host
,
0
,
host
->
spare_only
);
send_
read_page
(
host
,
1
,
host
->
spare_only
);
send_
read_page
(
host
,
2
,
host
->
spare_only
);
send_
read_page
(
host
,
3
,
host
->
spare_only
);
send_
page
(
host
,
0
,
host
->
spare_only
,
NFC_OUTPUT
);
send_
page
(
host
,
1
,
host
->
spare_only
,
NFC_OUTPUT
);
send_
page
(
host
,
2
,
host
->
spare_only
,
NFC_OUTPUT
);
send_
page
(
host
,
3
,
host
->
spare_only
,
NFC_OUTPUT
);
}
else
send_
read_page
(
host
,
0
,
host
->
spare_only
);
send_
page
(
host
,
0
,
host
->
spare_only
,
NFC_OUTPUT
);
break
;
case
NAND_CMD_READID
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录