Merge pull request #7331 from TomoYamanaka/improve_bootloader

Improve the process for Cortex-A9 in mbed_application
pull/7411/head
Cruz Monrreal 2018-07-03 07:37:19 -05:00 committed by GitHub
commit 7e0f75e831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -23,11 +23,33 @@
#if defined(__CORTEX_A9)
static void powerdown_gic(void);
void mbed_start_application(uintptr_t address)
{
__disable_irq();
powerdown_gic();
__enable_irq();
((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
static void powerdown_nvic(void);