Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openocd_nrf52_patch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Calisch
openocd_nrf52_patch
Commits
cbe201fe
Commit
cbe201fe
authored
14 years ago
by
Rodrigo L. Rosa
Committed by
Øyvind Harboe
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix protection behavior
parent
7b0ead52
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/flash/nor/dsp5680xx_flash.c
+9
-14
9 additions, 14 deletions
src/flash/nor/dsp5680xx_flash.c
with
9 additions
and
14 deletions
src/flash/nor/dsp5680xx_flash.c
+
9
−
14
View file @
cbe201fe
...
@@ -96,18 +96,10 @@ static int dsp5680xx_flash_protect_check(struct flash_bank *bank){
...
@@ -96,18 +96,10 @@ static int dsp5680xx_flash_protect_check(struct flash_bank *bank){
static
int
dsp5680xx_flash_protect
(
struct
flash_bank
*
bank
,
int
set
,
int
first
,
int
last
){
static
int
dsp5680xx_flash_protect
(
struct
flash_bank
*
bank
,
int
set
,
int
first
,
int
last
){
// This applies security to flash module after next reset, it does not actually apply protection (protection refers to undesired access from the core)
// This applies security to flash module after next reset, it does not actually apply protection (protection refers to undesired access from the core)
int
retval
;
int
retval
;
if
(
set
)
{
if
(
set
)
retval
=
dsp5680xx_f_lock
(
bank
->
target
);
retval
=
dsp5680xx_f_lock
(
bank
->
target
);
if
(
retval
==
ERROR_OK
){
else
for
(
int
i
=
first
;
i
<
last
;
i
++
)
bank
->
sectors
[
i
].
is_protected
=
1
;
}
}
else
{
retval
=
dsp5680xx_f_unlock
(
bank
->
target
);
retval
=
dsp5680xx_f_unlock
(
bank
->
target
);
if
(
retval
==
ERROR_OK
)
for
(
int
i
=
first
;
i
<
last
;
i
++
)
bank
->
sectors
[
i
].
is_protected
=
0
;
}
return
retval
;
return
retval
;
}
}
...
@@ -140,10 +132,13 @@ static int dsp5680xx_flash_write(struct flash_bank *bank, uint8_t *buffer, uint3
...
@@ -140,10 +132,13 @@ static int dsp5680xx_flash_write(struct flash_bank *bank, uint8_t *buffer, uint3
return
ERROR_FAIL
;
return
ERROR_FAIL
;
}
}
retval
=
dsp5680xx_f_wr
(
bank
->
target
,
buffer
,
bank
->
base
+
offset
/
2
,
count
);
retval
=
dsp5680xx_f_wr
(
bank
->
target
,
buffer
,
bank
->
base
+
offset
/
2
,
count
);
uint32_t
addr_word
;
for
(
addr_word
=
bank
->
base
+
offset
/
2
;
addr_word
<
count
/
2
;
addr_word
+=
(
HFM_SECTOR_SIZE
/
2
)){
if
(
retval
==
ERROR_OK
)
if
(
retval
==
ERROR_OK
)
bank
->
sectors
[
0
].
is_erased
=
0
;
bank
->
sectors
[
addr_word
/
(
HFM_SECTOR_SIZE
/
2
)
].
is_erased
=
0
;
else
else
bank
->
sectors
[
0
].
is_erased
=
-
1
;
bank
->
sectors
[
addr_word
/
(
HFM_SECTOR_SIZE
/
2
)].
is_erased
=
-
1
;
}
return
retval
;
return
retval
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment