logo资料库

Zynq启动、AMP加载、uCos、Linux等基本介绍.doc

第1页 / 共60页
第2页 / 共60页
第3页 / 共60页
第4页 / 共60页
第5页 / 共60页
第6页 / 共60页
第7页 / 共60页
第8页 / 共60页
资料共60页,剩余部分请下载后查看
Zynq User Guide
1介绍
2快速上手指南
3多核开发教程
3.1AMP开发说明
3.1.1快速生成amp工程
3.1.1.1创建amp_fsbl工程
3.1.1.2创建cpu0工程
3.1.1.3创建cpu1工程
3.1.2Generating Boot File
3.1.3烧写程序
3.1.4启动
3.1.5调试
3.1.6总结
3.2SMP开发说明
4ZC706启动代码分析
4.1启动代码
4.2Fsbl流程(for AMP)
4.3CPU0启动CPU1流程
5程序在线烧写方案及流程
5.1程序烧写需求
5.2提出该需求的原因
5.3程序烧写方案
5.3.1BOOT.BIN组成
5.3.2BOOT.BIN生成方法
5.4FSBL.bin和APP.bin等的生成
5.5制作*bin及烧写的具体步骤
5.5.1制作*bin流程
5.5.2BOOT.bin制作过程
5.5.3FSBL.bin和APP.bin等的生成过程
5.6烧写BOOT.bin步骤
5.6.1通过SDK工具烧写步骤
5.6.2通过上位机烧写软件的烧写步骤
5.6.3通过串口调试助手烧写步骤
6Zynq Qspi控制器
6.1基本特性
6.2I/O接口
6.3Qspi控制器模式
6.3.1I/O模式
6.3.2线性地址(linear address)模式
6.3.2.1Quad-SPI single SS, 4-bit I/O
6.3.2.2Quad-SPI dual SS, 8-bit parallel I/O
6.3.2.3Quad-SPI dual SS, 4-bit stacked I/O
6.3.3传统(legacy)SPI模式
6.4Qspi 例程
6.5Qspi控制器支持访问32MB方法
6.5.1Bank地址寄存器(Bank address register)
6.5.2扩展地址模式(Extended address mode)
6.5.3使用新写命令(New commands)
6.6QSPI Flash选择
6.7作为BOOT器件考虑
7µC/OS系统启动指南
7.1Introduction
7.1.1Software Requirements
7.1.2Hardware Requirements
7.2Hardware Design
7.2.1Step 1. Invoke the Vivado IDE and Create a project
7.2.2Step 2. Create an IP Integrator Design
7.2.3Step 3. Add and setup the Zynq processor system IP
7.2.4Step 4. Customize the Zynq block for our design
7.2.5Step 5. Add the soft peripherals
7.2.6Step 6. Generate HDL Design Files
7.2.7Step 7. Synthesis, Implement and Generate Bitstrea
7.3Software Design
7.3.1Step 1. Installation of the µC/OS Repository
7.3.2Step 2. Generate the µC/OS BSP
7.3.3Step 3. Build and Debug the Demonstration Project
7.3.4Step 4. Program the AXI Timer 0 with the ucos_axit
7.3.5Step 5. Program the AXI Timer 1 with the Xilinx tm
7.4Conclusion
8Linux系统启动指南
Iris Engineering Requirement Document Zynq User Guide
目 录 Engineering Requirement Document(ERD) 3.1 Zynq User Guide.....................................................................................................1 1 介绍...............................................................................................................4 2 快速上手指南................................................................................................4 3 多核开发教程................................................................................................4 AMP 开发说明 ....................................................................................................... 6 3.1.1 快速生成 amp 工程 ...............................................................................................6 3.1.2 Generating Boot File ...............................................................................................8 3.1.3 烧写程序 ................................................................................................................ 9 3.1.4 启动 ...................................................................................................................... 10 3.1.5 调试 ...................................................................................................................... 10 3.1.6 总结 ...................................................................................................................... 11 SMP 开发说明 ......................................................................................................11 ZC706 启动代码分析 ................................................................................... 11 启动代码 .............................................................................................................. 12 3.2 4 4.1 4.2 FSBL 流程(FOR AMP)...............................................................................................13 4.3 CPU0 启动 CPU1 流程 ..........................................................................................14 5 程序在线烧写方案及流程...........................................................................14 程序烧写需求 ...................................................................................................... 14 5.1 5.2 5.3 5.3.1 5.3.2 5.4 提出该需求的原因 .............................................................................................. 14 程序烧写方案 ...................................................................................................... 14 BOOT.BIN 组成 ..................................................................................................... 14 BOOT.BIN 生成方法 .............................................................................................15 FSBL.BIN 和 APP.BIN 等的生成............................................................................15 5.5 5.6 制作*BIN 及烧写的具体步骤 .............................................................................. 15 5.5.1 制作*bin 流程 ..................................................................................................... 15 BOOT.bin 制作过程 ............................................................................................. 15 5.5.2 FSBL.bin 和 APP.bin 等的生成过程 .................................................................22 5.5.3 烧写 BOOT.BIN 步骤..............................................................................................26 5.6.1 通过 SDK 工具烧写步骤 ......................................................................................26 5.6.2 通过上位机烧写软件的烧写步骤 ......................................................................29 5.6.3 通过串口调试助手烧写步骤 ..............................................................................29 Zynq Qspi 控制器....................................................................................... 30 基本特性 .............................................................................................................. 30 6 6.1 6.2 6.3 I/O 接口............................................................................................................... 31 QSPI 控制器模式...................................................................................................33 封页 2
Engineering Requirement Document(ERD) I/O 模式............................................................................................................... 33 6.3.1 6.3.2 线性地址(linear address)模式..................................................................33 6.3.3 传统(legacy)SPI 模式 ...................................................................................34 QSPI 例程 ..............................................................................................................34 6.4 QSPI 控制器支持访问 32MB 方法 ........................................................................ 35 Bank 地址寄存器(Bank address register)...............................................35 6.5.1 6.5.2 扩展地址模式(Extended address mode)....................................................35 6.5.3 使用新写命令(New commands) ......................................................................35 QSPI FLASH 选择 ...................................................................................................35 6.5 6.6 6.7 7.1 7.2 7.1.1 7.1.2 7.2.1 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7 作为 BOOT 器件考虑 ............................................................................................ 35 µC/OS 系统启动指南 ...................................................................................36 INTRODUCTION ..........................................................................................................36 Software Requirements ........................................................................................36 Hardware Requirements .......................................................................................36 HARDWARE DESIGN................................................................................................... 37 Step 1. Invoke the Vivado IDE and Create a project .............................................37 Step 2. Create an IP Integrator Design................................................................. 39 Step 3. Add and setup the Zynq processor system IP block................................ 39 Step 4. Customize the Zynq block for our design.................................................41 Step 5. Add the soft peripherals...........................................................................45 Step 6. Generate HDL Design Files ....................................................................... 47 Step 7. Synthesis, Implement and Generate Bitstream....................................... 48 SOFTWARE DESIGN.................................................................................................... 49 Step 1. Installation of the µC/OS Repository ........................................................49 Step 2. Generate the µC/OS BSP .......................................................................... 50 Step 3. Build and Debug the Demonstration Project ...........................................54 Step 4. Program the AXI Timer 0 with the ucos_axitimer Driver .........................55 Step 5. Program the AXI Timer 1 with the Xilinx tmrctr Driver ............................58 CONCLUSION.............................................................................................................59 Linux 系统启动指南.................................................................................... 59 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3 7.4 7 8 封页 3
Engineering Requirement Document(ERD) 1 介绍 本文档如不特殊说明,均是基于 Vivado2015 版本的 SDK 为参考。 参考手册: 《ug585-Zynq-7000-TRM.pdf》——技术参考手册 《ug821-zynq-7000-swdev.pdf》——Zynq 软件开发指南 《DDI0406C_C_armv7_arm.pdf》——ARMv7 架构参考手册 《DDI0407I_cortex_a9_mpcore_r4p1_trm.pdf》——Cortex-A9 MPCore 技术参考手册 《zc706-schematic-xtp215-rev1-1.pdf》——Zc706 原理图 应用教程: 《ug873_zynq_ctt14.1.pdf》——Zynq 快速上手教程 《xapp1079-amp-bare-metal-cortex-a9.pdf》——Zynq amp 开发教程指南 2 快速上手指南 参考《ug873_zynq_ctt14.1.pdf》 3 多核开发教程 多核处理器应用首先要考虑使用 Asymmetric multiprocessing (AMP,非对 称多处理器)或者 Symmetric multiprocessing (SMP,对称多处理器)。 Asymmetric multiprocessing (AMP) is a processing model in which each 第 4 页 共 60 页
Engineering Requirement Document(ERD) processor in a multiple-processor system executes a different operating system image while sharing the same physical memory. Each image can be of the same operating system, but more typically, each image is a different operating system, complementing the other OS with different characteristics: •A full-featured operating system, such as Linux, lets you connect to the outside world through networking and user interfaces. •A smaller, light-weight operating system can be more efficient with respect to memory and real-time operations. The division of system devices (such as the UART, timer-counter, and Ethernet) between the processors is a critical element in system design. In general: •Most devices must be dedicated to their assigned processor. •The interrupt controller is designed to be shared with multiple processors. •One processor is designated as the interrupt controller master because it initializes the interrupt controller. Communication between processors is a key element that allows both operating systems to be effective. It can be achieved in many different ways, including inter-processor interrupts, shared memory, and message passing. Symmetric multiprocessing (SMP) is a processing model in which each processor in a multiple-processor system executes a single operating system image. The scheduler of the operating system is responsible for scheduling processes on each processor. This is an efficient processing model when the selected single operating system meets the system requirements. The operating system uses the processing power of multiple processors automatically and is consequently transparent to the end user. Programmers can: •Specify a specific processor to execute a process •Handle interrupts with any available processor •Designate one processor as the master for system initialization and booting other processors 第 5 页 共 60 页
Engineering Requirement Document(ERD) 3.1 AMP 开发说明 本教程参考《xapp1079-amp-bare-metal-cortex-a9.pdf》(简称 xapp1079),并作相应修改 和注释。xapp1079 中介绍生成 amp 工程的方法基于 ISE14.3,因此可以生成 amp_fsbl 工程。 总的步骤如下: 创建工程 ——》 Generating Boot File ——》 烧写程序——》 启动 注:了解原始办法,参考使用 xapp1079 生成 amp 工程;快速创建工程,参考快速生成 amp 工程。 3.1.1 快速生成 amp 工程 本文基于 Vivado 2015 版本,介绍创建 amp_fsbl 工程的办法。 3.1.1.1 创建 amp_fsbl 工程 1. 使用 Core0 创建普通 Zyna_FSBL 工程,取名 amp_fsbl 2. 删除 src 中 ps7_init.c 链接文件(删除时要在工程中 delete,而不是在本地删除,如 下图),复制 macaw_706_hw_platform 中 ps7_init.c 到 src 中。 第 6 页 共 60 页
Engineering Requirement Document(ERD) 3.1.1.2 创建 cpu0 工程 1. 使用 Core0 创建普通工程 2. 修改 main.c(参考 xapp1079-amp-bare-metal-cortex-a9\design\src\apps\app_cpu0 中 app_cpu0.c 的代码设计)。 3. 修改 lscript.ld 文件地址(可选) 3.1.1.3 创建 cpu1 工程 1. 使用 Core1 创建普通工程 2. 修改 main.c(参考 xapp1079-amp-bare-metal-cortex-a9\design\src\apps\app_cpu1 中 app_cpu1.c 的代码设计) 3. 修改 lscript.ld 文件地址(不要和 cpu0 使用地址冲突) 4. 打开 board support package setting 界面,添加 -DUSE_AMP=1 宏 第 7 页 共 60 页
Engineering Requirement Document(ERD) 注意:这是关键,具体请看启动文件 boot.S 和文档 xapp1079 相关介绍。 5. 修改 cpu1_bsp 中的 Boot.s 文件,注释地址映射部分(Vivado 2016 无需此步骤)。 如下图所示: 3.1.2 Generating Boot File 1. 点击 Xilinx tools ->Creat Zynq Boot Image, 分别设置 amp_fsbl.elf、bit 文件、cpu0 的 elf、cpu1 的 elf。(注意:Vivado 2015 SDK 不需要 cpu1_bootvec.bin 文件) 第 8 页 共 60 页
分享到:
收藏