Skip to content

Commit 7e0f75e

Browse files
author
Cruz Monrreal
authored
Merge pull request #7331 from TomoYamanaka/improve_bootloader
Improve the process for Cortex-A9 in mbed_application
2 parents 9c4c630 + 9c99d7e commit 7e0f75e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

platform/mbed_application.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,33 @@
2323

2424
#if defined(__CORTEX_A9)
2525

26+
static void powerdown_gic(void);
27+
2628
void mbed_start_application(uintptr_t address)
2729
{
30+
__disable_irq();
31+
powerdown_gic();
32+
__enable_irq();
2833
((void(*)())address)();
2934
}
3035

36+
static void powerdown_gic()
37+
{
38+
int i;
39+
int j;
40+
41+
for (i = 0; i < 32; i++) {
42+
GICDistributor->ICENABLER[i] = 0xFFFFFFFF;
43+
GICDistributor->ICPENDR[i] = 0xFFFFFFFF;
44+
if (i < 4) {
45+
GICDistributor->CPENDSGIR[i] = 0xFFFFFFFF;
46+
}
47+
for (j = 0; j < 8; j++) {
48+
GICDistributor->IPRIORITYR[i*8+j] = 0x00000000;
49+
}
50+
}
51+
}
52+
3153
#else
3254

3355
static void powerdown_nvic(void);

0 commit comments

Comments
 (0)