⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xscugic_hw.h

📁 自学ZedBoard:使用IP通过ARM PS访问FPGA(源代码)
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************** (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved.** This file contains confidential and proprietary information of Xilinx, Inc.* and is protected under U.S. and international copyright and other* intellectual property laws.** DISCLAIMER* This disclaimer is not a license and does not grant any rights to the* materials distributed herewith. Except as otherwise provided in a valid* license issued to you by Xilinx, and to the maximum extent permitted by* applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL* FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,* IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF* MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;* and (2) Xilinx shall not be liable (whether in contract or tort, including* negligence, or under any other theory of liability) for any loss or damage* of any kind or nature related to, arising under or in connection with these* materials, including for any direct, or any indirect, special, incidental,* or consequential loss or damage (including loss of data, profits, goodwill,* or any type of loss or damage suffered as a result of any action brought by* a third party) even if such damage or loss was reasonably foreseeable or* Xilinx had been advised of the possibility of the same.** CRITICAL APPLICATIONS* Xilinx products are not designed or intended to be fail-safe, or for use in* any application requiring fail-safe performance, such as life-support or* safety devices or systems, Class III medical devices, nuclear facilities,* applications related to the deployment of airbags, or any other applications* that could lead to death, personal injury, or severe property or* environmental damage (individually and collectively, "Critical* Applications"). Customer assumes the sole risk and liability of any use of* Xilinx products in Critical Applications, subject only to applicable laws* and regulations governing limitations on product liability.** THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE* AT ALL TIMES.*******************************************************************************//*****************************************************************************//**** @file xscugic_hw.h** This header file contains identifiers and HW access functions (or* macros) that can be used to access the device.  The user should refer to the* hardware device specification for more details of the device operation.* The driver functions/APIs are defined in xscugic.h.** This GIC device has two parts, a distributor and CPU interface(s). Each part* has separate register definition sections.*** <pre>* MODIFICATION HISTORY:** Ver   Who  Date     Changes* ----- ---- -------- -----------------------------------------------------* 1.00a drg  01/19/10 First release* 1.01a sdm  11/09/11 "xil_exception.h" added as include.*		      Macros XScuGic_EnableIntr and XScuGic_DisableIntr are*		      added to enable or disable interrupts based on*		      Distributor Register base address. Normally users use*		      XScuGic instance and call XScuGic_Enable or*		      XScuGic_Disable to enable/disable interrupts. These*		      new macros are provided when user does not want to*		      use an instance pointer but still wants to enable or*		      disable interrupts.*		      Function prototypes for functions (present in newly*		      added file xscugic_hw.c) are added.** </pre>*******************************************************************************/#ifndef XSCUGIC_HW_H /* prevent circular inclusions */#define XSCUGIC_HW_H /* by using protection macros */#ifdef __cplusplusextern "C" {#endif/***************************** Include Files *********************************/#include "xil_types.h"#include "xil_assert.h"#include "xil_io.h"#include "xil_exception.h"/************************** Constant Definitions *****************************//* * The maximum number of interrupts supported by the hardware. */#define XSCUGIC_MAX_NUM_INTR_INPUTS    95/** @name Distributor Interface Register Map * * Define the offsets from the base address for all Distributor registers of * the interrupt controller, some registers may be reserved in the hardware * device. * @{ */#define XSCUGIC_DIST_EN_OFFSET		0x00000000 /**< Distributor Enable						 	Register */#define XSCUGIC_IC_TYPE_OFFSET		0x00000004 /**< Interrupt Controller						 	Type Register */#define XSCUGIC_DIST_IDENT_OFFSET	0x00000008 /**< Implementor ID							Register */#define XSCUGIC_SECURITY_OFFSET		0x00000080 /**< Interrupt Security						 	Register */#define XSCUGIC_ENABLE_SET_OFFSET	0x00000100 /**< Enable Set							Register */#define XSCUGIC_DISABLE_OFFSET		0x00000180 /**< Enable Clear Register */#define XSCUGIC_PENDING_SET_OFFSET	0x00000200 /**< Pending Set							Register */#define XSCUGIC_PENDING_CLR_OFFSET	0x00000280 /**< Pending Clear							Register */#define XSCUGIC_ACTIVE_OFFSET		0x00000300 /**< Active Status Register */#define XSCUGIC_PRIORITY_OFFSET		0x00000400 /**< Priority Level Register */#define XSCUGIC_SPI_TARGET_OFFSET	0x00000800 /**< SPI Target							Register 0x800-0x8FB */#define XSCUGIC_INT_CFG_OFFSET		0x00000C00 /**< Interrupt Configuration						 	Register 0xC00-0xCFC */#define XSCUGIC_PPI_STAT_OFFSET		0x00000D00 /**< PPI Status Register */#define XSCUGIC_SPI_STAT_OFFSET		0x00000D04 /**< SPI Status Register							0xd04-0xd7C */#define XSCUGIC_AHB_CONFIG_OFFSET	0x00000D80 /**< AHB Configuration							Register */#define XSCUGIC_SFI_TRIG_OFFSET		0x00000F00 /**< Software Triggered							Interrupt Register */#define XSCUGIC_PERPHID_OFFSET		0x00000FD0 /**< Peripheral ID Reg */#define XSCUGIC_PCELLID_OFFSET		0x00000FF0 /**< Pcell ID Register *//* @} *//** @name  Distributor Enable Register * Controls if the distributor response to external interrupt inputs. * @{ */#define XSCUGIC_EN_INT_MASK		0x00000001 /**< Interrupt In Enable *//* @} *//** @name  Interrupt Controller Type Register * @{ */#define XSCUGIC_LSPI_MASK	0x0000F800 /**< Number of Lockable						Shared Peripheral						Interrupts*/#define XSCUGIC_DOMAIN_MASK	0x00000400 /**< Number os Security domains*/#define XSCUGIC_CPU_NUM_MASK	0x000000E0 /**< Number of CPU Interfaces */#define XSCUGIC_NUM_INT_MASK	0x0000001F /**< Number of Interrupt IDs *//* @} *//** @name  Implementor ID Register * Implementor and revision information. * @{ */#define XSCUGIC_REV_MASK	0x00FFF000 /**< Revision Number */#define XSCUGIC_IMPL_MASK	0x00000FFF /**< Implementor *//* @} *//** @name  Interrupt Security Registers * Each bit controls the security level of an interrupt, either secure or non * secure. These registers can only be accessed using secure read and write. * There are registers for each of the CPU interfaces at offset 0x080.  A * register set for the SPI interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x084. * @{ */#define XSCUGIC_INT_NS_MASK	0x00000001 /**< Each bit corresponds to an						INT_ID *//* @} *//** @name  Enable Set Register * Each bit controls the enabling of an interrupt, a 0 is disabled, a 1 is * enabled. Writing a 0 has no effect. Use the ENABLE_CLR register to set a * bit to 0. * There are registers for each of the CPU interfaces at offset 0x100. With up * to 8 registers aliased to the same address. A register set for the SPI * interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x104. * @{ */#define XSCUGIC_INT_EN_MASK	0x00000001 /**< Each bit corresponds to an						INT_ID *//* @} *//** @name  Enable Clear Register * Each bit controls the disabling of an interrupt, a 0 is disabled, a 1 is * enabled. Writing a 0 has no effect. Writing a 1 disables an interrupt and * sets the corresponding bit to 0. * There are registers for each of the CPU interfaces at offset 0x180. With up * to 8 registers aliased to the same address. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x184. * @{ */#define XSCUGIC_INT_CLR_MASK	0x00000001 /**< Each bit corresponds to an						INT_ID *//* @} *//** @name  Pending Set Register * Each bit controls the Pending or Active and Pending state of an interrupt, a * 0 is not pending, a 1 is pending. Writing a 0 has no effect. Writing a 1 sets * an interrupt to the pending state. * There are registers for each of the CPU interfaces at offset 0x200. With up * to 8 registers aliased to the same address. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x204. * @{ */#define XSCUGIC_PEND_SET_MASK	0x00000001 /**< Each bit corresponds to an						INT_ID *//* @} *//** @name  Pending Clear Register * Each bit can clear the Pending or Active and Pending state of an interrupt, a * 0 is not pending, a 1 is pending. Writing a 0 has no effect. Writing a 1 * clears the pending state of an interrupt. * There are registers for each of the CPU interfaces at offset 0x280. With up * to 8 registers aliased to the same address. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x284. * @{ */#define XSCUGIC_PEND_CLR_MASK	0x00000001 /**< Each bit corresponds to an						INT_ID *//* @} *//** @name  Active Status Register * Each bit provides the Active status of an interrupt, a * 0 is not Active, a 1 is Active. This is a read only register. * There are registers for each of the CPU interfaces at offset 0x300. With up * to 8 registers aliased to each address. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 32 of these registers staring at location 0x380. * @{ */#define XSCUGIC_ACTIVE_MASK	0x00000001 /**< Each bit corresponds to an					      INT_ID *//* @} *//** @name  Priority Level Register * Each byte in a Priority Level Register sets the priority level of an * interrupt. Reading the register provides the priority level of an interrupt. * There are registers for each of the CPU interfaces at offset 0x400 through * 0x41C. With up to 8 registers aliased to each address. * 0 is highest priority, 0xFF is lowest. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 255 of these registers staring at location 0x420. * @{ */#define XSCUGIC_PRIORITY_MASK	0x000000FF /**< Each Byte corresponds to an						INT_ID */#define XSCUGIC_PRIORITY_MAX	0x000000FF /**< Highest value of a priority						actually the lowest priority*//* @} *//** @name  SPI Target Register 0x800-0x8FB * Each byte references a separate SPI and programs which of the up to 8 CPU * interfaces are sent a Pending interrupt. * There are registers for each of the CPU interfaces at offset 0x800 through * 0x81C. With up to 8 registers aliased to each address. * A register set for the SPI interrupts is available to all CPU interfaces. * There are up to 255 of these registers staring at location 0x820. * * This driver does not support multiple CPU interfaces. These are included * for complete documentation. * @{ */#define XSCUGIC_SPI_CPU7_MASK	0x00000080 /**< CPU 7 Mask*/#define XSCUGIC_SPI_CPU6_MASK	0x00000040 /**< CPU 6 Mask*/#define XSCUGIC_SPI_CPU5_MASK	0x00000020 /**< CPU 5 Mask*/#define XSCUGIC_SPI_CPU4_MASK	0x00000010 /**< CPU 4 Mask*/#define XSCUGIC_SPI_CPU3_MASK	0x00000008 /**< CPU 3 Mask*/#define XSCUGIC_SPI_CPU2_MASK	0x00000003 /**< CPU 2 Mask*/#define XSCUGIC_SPI_CPU1_MASK	0x00000002 /**< CPU 1 Mask*/#define XSCUGIC_SPI_CPU0_MASK	0x00000001 /**< CPU 0 Mask*//* @} *//** @name  Interrupt Configuration Register 0xC00-0xCFC * The interrupt configuration registers program an SFI to be active HIGH level * sensitive or rising edge sensitive.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -