mirror of https://github.com/ARMmbed/mbed-os.git
Improve the process for Cortex-A9 in mbed_application
I added the powerdown func by GIC in mbed_application because Cortex-A9 use GIC instead of NVIC. This process prevent unexpected interrupt when updating software by using bootloader.pull/7331/head
parent
f3424da060
commit
9c99d7eb17
|
@ -23,11 +23,33 @@
|
||||||
|
|
||||||
#if defined(__CORTEX_A9)
|
#if defined(__CORTEX_A9)
|
||||||
|
|
||||||
|
static void powerdown_gic(void);
|
||||||
|
|
||||||
void mbed_start_application(uintptr_t address)
|
void mbed_start_application(uintptr_t address)
|
||||||
{
|
{
|
||||||
|
__disable_irq();
|
||||||
|
powerdown_gic();
|
||||||
|
__enable_irq();
|
||||||
((void(*)())address)();
|
((void(*)())address)();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void powerdown_gic()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
for (i = 0; i < 32; i++) {
|
||||||
|
GICDistributor->ICENABLER[i] = 0xFFFFFFFF;
|
||||||
|
GICDistributor->ICPENDR[i] = 0xFFFFFFFF;
|
||||||
|
if (i < 4) {
|
||||||
|
GICDistributor->CPENDSGIR[i] = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
GICDistributor->IPRIORITYR[i*8+j] = 0x00000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static void powerdown_nvic(void);
|
static void powerdown_nvic(void);
|
||||||
|
|
Loading…
Reference in New Issue