// --------------------------------------------------------------------------- // Load image on slave core int IPC_Load(uint32_t image_addr) { // Make sure the alignment is OK if (image_addr & 0xFFF) { return -1; } #if 0 // Check the validity of images if (CheckImages(image_addr, &__M4Signature) != 0) { return -1; } // Make sure the M0 core is being held in reset via the RGU Chip_RGU_TriggerReset(RGU_M0APP_RST); Chip_Clock_Enable(CLK_M4_M0APP); // Keep in mind the M0 image must be aligned on a 4K boundary Chip_CREG_SetM0AppMemMap(image_addr); Chip_RGU_ClearReset(RGU_M0APP_RST); #endif return 0; }
/* M0 Boot loader */ int M0Image_Boot(uint32_t m0_image_addr) { /* Make sure the alignment is OK */ if (m0_image_addr & 0xFFF) { return -1; } /* Check the validity of images */ if (CheckImages(m0_image_addr, &__M4Signature) != 0) { return -1; } /* Make sure the M0 core is being held in reset via the RGU */ Chip_RGU_TriggerReset(RGU_M0APP_RST); Chip_Clock_Enable(CLK_M4_M0APP); /* Keep in mind the M0 image must be aligned on a 4K boundary */ Chip_CREG_SetM0AppMemMap(m0_image_addr); Chip_RGU_ClearReset(RGU_M0APP_RST); return 0; }