Skip to content
Snippets Groups Projects
Commit b519ba8b authored by Lionel Debieve's avatar Lionel Debieve Committed by Sebastien Pasdeloup
Browse files

fix(st-tamp): incorrect tamper event management


Fix some bad register usage and incorrect mask used
to manage the tamper events.

Signed-off-by: default avatarLionel Debieve <lionel.debieve@foss.st.com>
Change-Id: If38436150b80c5d5be95e2d802d9541bd6f5b2e4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/251180


Tested-by: default avatarSebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
Reviewed-by: default avatarSebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
parent 25c607ec
No related branches found
No related tags found
1 merge request!2Integrate changes of v2.4-stm32mp-r2.1 version from ST
......@@ -315,9 +315,9 @@ static int stm32_tamp_set_ext_config(struct stm32_tamp_ext *tamp_ext,
}
if ((tamp_ext->mode & TAMP_ACTIVE) == TAMP_ACTIVE) {
SETBITS(*cr1, _TAMP_ATCR1_ETAMPAM(id));
SETBITS(*atcr1, _TAMP_ATCR1_ETAMPAM(id));
} else {
CLRBITS(*cr1, _TAMP_ATCR1_ETAMPAM(id));
CLRBITS(*atcr1, _TAMP_ATCR1_ETAMPAM(id));
}
if ((tamp_ext->mode & TAMP_NOERASE) == TAMP_NOERASE) {
......@@ -348,7 +348,7 @@ static int stm32_tamp_set_ext_config(struct stm32_tamp_ext *tamp_ext,
* and internally cleared by hardware. The backup registers are not erased.
*/
CLRBITS(*ier, _TAMP_IER_ETAMP(id));
CLRBITS(*cr2, _TAMP_CR2_ETAMPMSK(id));
SETBITS(*cr2, _TAMP_CR2_ETAMPMSK(id));
} else {
/*
* normal ETAMP interrupt:
......@@ -356,11 +356,11 @@ static int stm32_tamp_set_ext_config(struct stm32_tamp_ext *tamp_ext,
* by software to * allow next tamper event detection.
*/
CLRBITS(*cr2, _TAMP_CR2_ETAMPMSK(id));
CLRBITS(*ier, _TAMP_IER_ETAMP(id));
SETBITS(*ier, _TAMP_IER_ETAMP(id));
}
} else {
/* other than 1,2,3 external TAMP, we want its interruption */
CLRBITS(*ier, _TAMP_IER_ETAMP(id));
SETBITS(*ier, _TAMP_IER_ETAMP(id));
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment