vivido 2014.4
Caso especial: La memoria DDR total es superior a 512 MB y CPU0 ya ha ocupado más de 512 MB. En este momento, siga los pasos a continuación para iniciar CPU1.
Motivo: inicie la restricción de la dirección de entrada. El método de modificación es el siguiente:
abra cpu1_bsp \ ps7_cortexa9_1 \ libsrc \ standalone_v4_2 \ src \ boot.S, y comente como el siguiente efecto
#if USE_AMP==1
// ldr r3, =0x1ff /* 512 entries to cover 512MB DDR */
// ldr r0, =TblBase /* MMU Table address in memory */
// add r0, r0, #0x800 /* Address of entry in MMU table, for 0x20000000 */
// ldr r2, =0x0c02 /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b0 */
//mmu_loop:
// str r2, [r0] /* write the entry to MMU table */
// add r0, r0, #0x4 /* next entry in the table */
// add r2, r2, #0x100000 /* next section */
// subs r3, r3, #1
// bge mmu_loop /* loop till 512MB is covered */
#endif
Parte del código requerido:
#define sev() __asm__("sev")
#define CPU1STARTADR 0xFFFFFFF0 //这个地址是固定的
#define CPU1STARTMEM 0x3D000000 //这个CPU1启动地址是在lscript.ld中设置的
void StartCpu1(void)
{
#if 1
fsbl_printf(DEBUG_GENERAL,"FSBL: Write the address of the application for CPU 1 to 0xFFFFFFF0\n\r");
Xil_Out32(CPU1STARTADR, CPU1STARTMEM);
dmb(); //waits until write has finished
fsbl_printf(DEBUG_GENERAL,"FSBL: Execute the SEV instruction to cause CPU 1 to wake up and jump to the application\n\r");
sev();
#endif
}
-DUSE_AMP=1
#define sev() __asm__("sev")
#define CPU1STARTADR 0xFFFFFFF0
#define CPU1STARTMEM 0x02000000//此处必须与第5步改的cpu1的ddr地址一致
void StartCpu1(void)
{
#if 1
fsbl_printf(DEBUG_GENERAL,"FSBL: Write the address of the application for CPU 1 to 0xFFFFFFF0\n\r");
Xil_Out32(CPU1STARTADR, CPU1STARTMEM);
dmb(); //waits until write has finished
fsbl_printf(DEBUG_GENERAL,"FSBL: Execute the SEV instruction to cause CPU 1 to wake up and jump to the application\n\r");
sev();
#endif
}
//app_cpu0.c为以下代码
#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "sleep.h"
int main()
{
init_platform();
while(1)
{
print("CPU 0 : Hello World\r\n");
sleep(2);
}
cleanup_platform();
return 0;
}
//app_cpu1.c为以下代码
#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "sleep.h"
int main()
{
init_platform();
while(1)
{
print("CPU 1 : New World\r\n");
sleep(3);
}
cleanup_platform();
return 0;
}