前言
**环境准备
petalinux2019.1 viavdo2019.1
开始
CPU0:
Linux + uart0
正常建目录,然后划分空间,memory setting修改一下支持
启动参数修改
修改设备树
/include/ "system-conf.dtsi"
/ {
amba {
remoteproc0: remoteproc@0 {
compatible = "xlnx,zynq_remoteproc";
reg = < 0x10000000 0x0f000000 >;
firmware = "firmware";
vring0 = <15>;
vring1 = <14>;
};
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
reserved: buffer@0x1f000000 {
no-map;
reg = <0x1f000000 0x01000000>;
};
};
reserved-driver@0 {
compatible = "xlnx,reserved-memory";
memory-region = <&reserved>;
};
};
&i2c0 {
ssd1306:ssd1306@3c {
compatible = "solomon,ssd1306fb-i2c";
reg = <0x3c>;
solomon,width = <128>;
solomon,height = <64>;
solomon,page-offset= <0>;
};
};
&uart1 {
status = "disabled";
};
第二个核的程序
CPU1:
修改fsbl增加
#define sev() __asm__("sev")
#define CPU1STARTADR 0xfffffff0
void LoadCpu1(void)
{
fsbl_printf(DEBUG_GENERAL,"FSBL: writing startaddress for cpu1\n\r");
Xil_Out32(CPU1STARTADR, 0x1f000000);
dmb(); //waits until write has finished
fsbl_printf(DEBUG_GENERAL,"FSBL: sending the SEV to wake up CPU1\n\r");
sev();
}
然后再main里面直接调用
HandoffAddress = LoadBootImage();
fsbl_printf(DEBUG_INFO,"Handoff Address: 0x%08lx\r\n",HandoffAddress);
LoadCpu1();
app程序
修改ddr起始地址
修改编译宏
增加-g -DUSE_AMP=1
修改uart
整合
启动
cpu1跑 rtos
cpu0 跑linux
linux查看一下cpuinfo:
查看iomem
END
下一步双核通信