Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9c01f87d
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看板
提交
9c01f87d
编写于
5月 12, 2006
作者:
K
Kyungmin Park
提交者:
Jarkko Lavinen
5月 12, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OneNAND: handle byte access on BufferRAM
Signed-off-by:
N
Kyungmin Park
<
kyungmin.park@samsung.com
>
上级
628bee65
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
0 deletion
+41
-0
drivers/mtd/onenand/onenand_base.c
drivers/mtd/onenand/onenand_base.c
+38
-0
include/linux/mtd/onenand.h
include/linux/mtd/onenand.h
+3
-0
未找到文件。
drivers/mtd/onenand/onenand_base.c
浏览文件 @
9c01f87d
...
...
@@ -373,6 +373,17 @@ static int onenand_read_bufferram(struct mtd_info *mtd, int area,
bufferram
+=
onenand_bufferram_offset
(
mtd
,
area
);
if
(
ONENAND_CHECK_BYTE_ACCESS
(
count
))
{
unsigned
short
word
;
/* Align with word(16-bit) size */
count
--
;
/* Read word and save byte */
word
=
this
->
read_word
(
bufferram
+
offset
+
count
);
buffer
[
count
]
=
(
word
&
0xff
);
}
memcpy
(
buffer
,
bufferram
+
offset
,
count
);
return
0
;
...
...
@@ -400,6 +411,17 @@ static int onenand_sync_read_bufferram(struct mtd_info *mtd, int area,
this
->
mmcontrol
(
mtd
,
ONENAND_SYS_CFG1_SYNC_READ
);
if
(
ONENAND_CHECK_BYTE_ACCESS
(
count
))
{
unsigned
short
word
;
/* Align with word(16-bit) size */
count
--
;
/* Read word and save byte */
word
=
this
->
read_word
(
bufferram
+
offset
+
count
);
buffer
[
count
]
=
(
word
&
0xff
);
}
memcpy
(
buffer
,
bufferram
+
offset
,
count
);
this
->
mmcontrol
(
mtd
,
0
);
...
...
@@ -427,6 +449,22 @@ static int onenand_write_bufferram(struct mtd_info *mtd, int area,
bufferram
+=
onenand_bufferram_offset
(
mtd
,
area
);
if
(
ONENAND_CHECK_BYTE_ACCESS
(
count
))
{
unsigned
short
word
;
int
byte_offset
;
/* Align with word(16-bit) size */
count
--
;
/* Calculate byte access offset */
byte_offset
=
offset
+
count
;
/* Read word and save byte */
word
=
this
->
read_word
(
bufferram
+
byte_offset
);
word
=
(
word
&
~
0xff
)
|
buffer
[
count
];
this
->
write_word
(
word
,
bufferram
+
byte_offset
);
}
memcpy
(
bufferram
+
offset
,
buffer
,
count
);
return
0
;
...
...
include/linux/mtd/onenand.h
浏览文件 @
9c01f87d
...
...
@@ -130,6 +130,9 @@ struct onenand_chip {
#define ONENAND_SET_SYS_CFG1(v, this) \
(this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
/* Check byte access in OneNAND */
#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
/*
* Options bits
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录