Xilinx SDK BSP中对CPU_ID的使用
来源:互联网 发布:mysql in和exists 编辑:程序博客网 时间:2024/05/14 03:53
创建Xilinx SDK BSP时,要指定在哪个core上运行,这个选项对源码的影响如下:
xparameters.h里面的宏定义不同:
/* Definition for CPU ID */
#define XPAR_CPU_ID 1
#define XPAR_CPU_ID 1
xscugic_hw.c里面
int XScuGic_DeviceInitialize(u32 DeviceId){XScuGic_Config *Config;u8 Cpu_Id = XPAR_CPU_ID + 1;Config = &XScuGic_ConfigTable[(u32 )DeviceId];DistInit(Config, Cpu_Id);CPUInit(Config);return XST_SUCCESS;}
xscugic.c里面
int XScuGic_CfgInitialize(XScuGic *InstancePtr,XScuGic_Config *ConfigPtr,u32 EffectiveAddr){u32 Int_Id;u8 Cpu_Id = XPAR_CPU_ID + 1;Xil_AssertNonvoid(InstancePtr != NULL);Xil_AssertNonvoid(ConfigPtr != NULL);/* * Set some default values */InstancePtr->Config->CpuBaseAddress = EffectiveAddr;InstancePtr->IsReady = 0;InstancePtr->Config = ConfigPtr;for (Int_Id = 0; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id++) {/* * Initalize the handler to point to a stub to handle an * interrupt which has not been connected to a handler. Only * initialize it if the handler is 0 which means it was not * initialized statically by the tools/user. Set the callback * reference to this instance so that unhandled interrupts * can be tracked. */if ((InstancePtr->Config->HandlerTable[Int_Id].Handler == 0)) {InstancePtr->Config->HandlerTable[Int_Id].Handler =StubHandler;}InstancePtr->Config->HandlerTable[Int_Id].CallBackRef =InstancePtr;}DistInit(InstancePtr, Cpu_Id);CPUInit(InstancePtr);InstancePtr->IsReady = XIL_COMPONENT_IS_READY;return XST_SUCCESS;}
boot.S里面
/* this initializes the various processor modes */_prestart:_boot:#if XPAR_CPU_ID==0/* only allow cpu0 through */mrcp15,0,r1,c0,c0,5andr1, r1, #0xfcmpr1, #0beqOKToRunEndlessLoop0:wfebEndlessLoop0#elif XPAR_CPU_ID==1/* only allow cpu1 through */mrcp15,0,r1,c0,c0,5andr1, r1, #0xfcmpr1, #1beqOKToRunEndlessLoop1:wfebEndlessLoop1#endifOKToRun:mrc p15, 0, r0, c0, c0, 0/* Get the revision */and r5, r0, #0x00f00000 and r6, r0, #0x0000000forr r6, r6, r5, lsr #20-4从上面的汇编来看,如果实际加测到的CPU_ID和配置的CPU_ID如果不同,BSP将无法启动。
- Xilinx SDK BSP中对CPU_ID的使用
- Xilinx SDK使用教程
- Xilinx SDK使用教程
- xilinx SDK使用教程
- Xilinx 中时钟的使用
- 2.xilinx sdk使用教程
- Xilinx SDK使用心得之一
- xilinx SDK中:找不到include xgpio.h的解决办法
- xilinx SDK中:找不到include xgpio.h的解决办法
- 在xilinx SDK中查询API函数的方法
- Altera OpenCL SDK与Xilinx SDAccel的使用对比
- Xilinx FPGA中使用LCD1602的方法
- Xilinx FPFA中LUT4_L 元件的使用
- 关于xilinx中chipscope对输入引脚数据的抓取
- Xilinx SDK 初学之--PS对PL寄存器的读写控制
- 如何在xilinx SDK中显示行号
- xilinx sdk 中显示代码行号
- 对Xilinx HLS的理解
- JS获取自身所在文件的路径
- Drupal7 truncate/clear all cache
- List和ArrayList的区别
- Android属性动画---Property Animation(二)
- IOS 圆角设置
- Xilinx SDK BSP中对CPU_ID的使用
- linux之cp/scp命令+scp命令详解
- WCF在https类型的网站中,web.config文件的配置方法。
- OSGI简介—HelloWorld
- Socket层实现系列 — bind()的实现(一)
- UVa 484 - The Department of Redundancy Department
- linux 磁盘io技术1------概述
- UVA 10940 Throwing cards away II
- 贪吃蛇