aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Huang-Sen <r94922102@gmail.com>2018-12-29 00:58:06 +0800
committerJerome Forissier <jerome.forissier@linaro.org>2019-01-07 11:11:16 +0100
commit100a01d5ab7daf2b7bdc1bc064954aa68a434984 (patch)
tree60b978378d29c35f61341b57d91e05e8b93eb293
parent275d9d31f0808778c3b970ae02a40db5d1083bfa (diff)
probe_max_it overwrite the value of GICD_ISENABLER
probe_max_it save the original value of GICD_ISENABLER and write 0xffffffff into GICD_ISENABLER to probe the largest interrupt number. Instead of writing the original GICD_ISENABLER value into GICD_ISENABLER, probe_max_it write the value into GICD_ICENABLER and cause the original GICD_ISENABLER value bit flipping. Signed-off-by: Lin Huang-Sen <r94922102@gmail.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--core/drivers/gic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/drivers/gic.c b/core/drivers/gic.c
index ab335a63..9b4948c4 100644
--- a/core/drivers/gic.c
+++ b/core/drivers/gic.c
@@ -110,7 +110,7 @@ static size_t probe_max_it(vaddr_t gicc_base __maybe_unused, vaddr_t gicd_base)
old_reg = read32(gicd_base + GICD_ISENABLER(i));
write32(0xffffffff, gicd_base + GICD_ISENABLER(i));
reg = read32(gicd_base + GICD_ISENABLER(i));
- write32(old_reg, gicd_base + GICD_ICENABLER(i));
+ write32(~old_reg, gicd_base + GICD_ICENABLER(i));
for (b = NUM_INTS_PER_REG - 1; b >= 0; b--) {
if (BIT32(b) & reg) {
ret = i * NUM_INTS_PER_REG + b;