Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9c01f87d
Commit
9c01f87d
authored
May 12, 2006
by
Kyungmin Park
Committed by
Jarkko Lavinen
May 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OneNAND: handle byte access on BufferRAM
Signed-off-by:
Kyungmin Park
<
kyungmin.park@samsung.com
>
parent
628bee65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+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
No files found.
drivers/mtd/onenand/onenand_base.c
View file @
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
View file @
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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment