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
0c00a36d
Commit
0c00a36d
authored
Sep 30, 2015
by
Brian Norris
Browse files
Options
Browse Files
Download
Plain Diff
Merge MTD 4.3-rc updates into -next
parents
039353c8
e5a5d92d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
drivers/mtd/nand/mxc_nand.c
drivers/mtd/nand/mxc_nand.c
+1
-1
drivers/mtd/nand/sunxi_nand.c
drivers/mtd/nand/sunxi_nand.c
+10
-17
No files found.
drivers/mtd/nand/mxc_nand.c
View file @
0c00a36d
...
...
@@ -879,7 +879,7 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom)
oob_chunk_size
);
/* the last chunk */
memcpy16_toio
(
&
s
[
oob_chunk_size
*
sparebuf_size
],
memcpy16_toio
(
&
s
[
i
*
sparebuf_size
],
&
d
[
i
*
oob_chunk_size
],
host
->
used_oobsize
-
i
*
oob_chunk_size
);
}
...
...
drivers/mtd/nand/sunxi_nand.c
View file @
0c00a36d
...
...
@@ -147,6 +147,10 @@
#define NFC_ECC_MODE GENMASK(15, 12)
#define NFC_RANDOM_SEED GENMASK(30, 16)
/* NFC_USER_DATA helper macros */
#define NFC_BUF_TO_USER_DATA(buf) ((buf)[0] | ((buf)[1] << 8) | \
((buf)[2] << 16) | ((buf)[3] << 24))
#define NFC_DEFAULT_TIMEOUT_MS 1000
#define NFC_SRAM_SIZE 1024
...
...
@@ -646,15 +650,9 @@ static int sunxi_nfc_hw_ecc_write_page(struct mtd_info *mtd,
offset
=
layout
->
eccpos
[
i
*
ecc
->
bytes
]
-
4
+
mtd
->
writesize
;
/* Fill OOB data in */
if
(
oob_required
)
{
tmp
=
0xffffffff
;
memcpy_toio
(
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
,
&
tmp
,
4
);
}
else
{
memcpy_toio
(
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
,
chip
->
oob_poi
+
offset
-
mtd
->
writesize
,
4
);
}
writel
(
NFC_BUF_TO_USER_DATA
(
chip
->
oob_poi
+
layout
->
oobfree
[
i
].
offset
),
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
);
chip
->
cmdfunc
(
mtd
,
NAND_CMD_RNDIN
,
offset
,
-
1
);
...
...
@@ -784,14 +782,8 @@ static int sunxi_nfc_hw_syndrome_ecc_write_page(struct mtd_info *mtd,
offset
+=
ecc
->
size
;
/* Fill OOB data in */
if
(
oob_required
)
{
tmp
=
0xffffffff
;
memcpy_toio
(
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
,
&
tmp
,
4
);
}
else
{
memcpy_toio
(
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
,
oob
,
4
);
}
writel
(
NFC_BUF_TO_USER_DATA
(
oob
),
nfc
->
regs
+
NFC_REG_USER_DATA_BASE
);
tmp
=
NFC_DATA_TRANS
|
NFC_DATA_SWAP_METHOD
|
NFC_ACCESS_DIR
|
(
1
<<
30
);
...
...
@@ -1388,6 +1380,7 @@ static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
node
);
nand_release
(
&
chip
->
mtd
);
sunxi_nand_ecc_cleanup
(
&
chip
->
nand
.
ecc
);
list_del
(
&
chip
->
node
);
}
}
...
...
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