Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
ce959ae5
Commit
ce959ae5
authored
Jul 23, 2019
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lost __nand_unlock
parent
3dc5d43f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
nand_base.c
src/drivers/mtd/nand/nand_base.c
+40
-0
No files found.
src/drivers/mtd/nand/nand_base.c
View file @
ce959ae5
...
...
@@ -1387,6 +1387,46 @@ int nand_check_erased_ecc_chunk(void *data, int datalen,
}
EXPORT_SYMBOL
(
nand_check_erased_ecc_chunk
);
/**
* __nand_unlock - [REPLACEABLE] unlocks specified locked blocks
* @mtd: mtd info
* @ofs: offset to start unlock from
* @len: length to unlock
* @invert: when = 0, unlock the range of blocks within the lower and
* upper boundary address
* when = 1, unlock the range of blocks outside the boundaries
* of the lower and upper boundary address
*
* Returs unlock status.
*/
static
int
__nand_unlock
(
struct
mtd_info
*
mtd
,
loff_t
ofs
,
uint64_t
len
,
int
invert
)
{
int
ret
=
0
;
int
status
,
page
;
struct
nand_chip
*
chip
=
mtd
->
priv
;
/* Submit address of first page to unlock */
page
=
ofs
>>
chip
->
page_shift
;
chip
->
cmdfunc
(
mtd
,
NAND_CMD_UNLOCK1
,
-
1
,
page
&
chip
->
pagemask
);
/* Submit address of last page to unlock */
page
=
(
ofs
+
len
)
>>
chip
->
page_shift
;
chip
->
cmdfunc
(
mtd
,
NAND_CMD_UNLOCK2
,
-
1
,
(
page
|
invert
)
&
chip
->
pagemask
);
/* Call wait ready function */
status
=
chip
->
waitfunc
(
mtd
,
chip
);
/* See if device thinks it succeeded */
if
(
status
&
NAND_STATUS_FAIL
)
{
pr_debug
(
"%s: error status = 0x%08x
\n
"
,
__func__
,
status
);
ret
=
-
EIO
;
}
return
ret
;
}
/**
* nand_unlock - [REPLACEABLE] unlocks specified locked blocks
* @mtd: mtd info
...
...
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