diff --git a/README.md b/README.md index c5bc735..175620f 100644 Binary files a/README.md and b/README.md differ diff --git a/Vitis/.metadata/.log b/Vitis/.metadata/.log index d5ee139..1e5eb31 100644 --- a/Vitis/.metadata/.log +++ b/Vitis/.metadata/.log @@ -9141,3 +9141,9 @@ java.lang.Error at org.eclipse.tcf.core.AbstractChannel$1$1.run(AbstractChannel.java:371) at org.eclipse.tcf.EventQueue.run(EventQueue.java:98) at java.base/java.lang.Thread.run(Thread.java:829) + +!ENTRY com.xilinx.sdk.utils 0 0 2022-10-11 18:46:18.100 +!MESSAGE XSCT Command: [disconnect tcfchan#5], Thread: Thread-259 + +!ENTRY com.xilinx.sdk.utils 0 0 2022-10-11 18:46:18.181 +!MESSAGE XSCT command with result: [disconnect tcfchan#5], Result: [null, ]. Thread: Thread-259 diff --git a/Vitis/.metadata/.plugins/com.xilinx.sdk.targetmanager/dialog_settings.xml b/Vitis/.metadata/.plugins/com.xilinx.sdk.targetmanager/dialog_settings.xml new file mode 100644 index 0000000..836fa60 --- /dev/null +++ b/Vitis/.metadata/.plugins/com.xilinx.sdk.targetmanager/dialog_settings.xml @@ -0,0 +1,4 @@ + +
+ +
diff --git a/Vitis/.metadata/.plugins/org.eclipse.cdt.core/.log b/Vitis/.metadata/.plugins/org.eclipse.cdt.core/.log index 594d305..9e21ec3 100644 --- a/Vitis/.metadata/.plugins/org.eclipse.cdt.core/.log +++ b/Vitis/.metadata/.plugins/org.eclipse.cdt.core/.log @@ -1,3 +1,4 @@ *** SESSION Oct 01, 2022 17:30:32.37 ------------------------------------------- *** SESSION Oct 01, 2022 18:12:01.54 ------------------------------------------- *** SESSION Oct 03, 2022 21:08:29.07 ------------------------------------------- +*** SESSION Oct 07, 2022 15:02:57.97 ------------------------------------------- diff --git a/Vitis/.metadata/.plugins/org.eclipse.cdt.core/phased_array.1664825649663.pdom b/Vitis/.metadata/.plugins/org.eclipse.cdt.core/phased_array.1664825649663.pdom index fe108ca..7c6c57f 100644 Binary files a/Vitis/.metadata/.plugins/org.eclipse.cdt.core/phased_array.1664825649663.pdom and b/Vitis/.metadata/.plugins/org.eclipse.cdt.core/phased_array.1664825649663.pdom differ diff --git a/Vitis/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml b/Vitis/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml new file mode 100644 index 0000000..8e47957 --- /dev/null +++ b/Vitis/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml @@ -0,0 +1,7 @@ + +
+
+
+
+
+
diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/023252565243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/023252565243001d18b399c1eb9b3628 deleted file mode 100644 index 9794da0..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/023252565243001d18b399c1eb9b3628 +++ /dev/null @@ -1,350 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2002 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xenv_standalone.h -* -* Defines common services specified by xenv.h. -* -* @note -* This file is not intended to be included directly by driver code. -* Instead, the generic xenv.h file is intended to be included by driver -* code. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 1.00a wgr  02/28/07 Added cache handling macros.
-* 1.00a wgr  02/27/07 Simplified code. Deprecated old-style macro names.
-* 1.00a rmm  01/24/06 Implemented XENV_USLEEP. Assume implementation is being
-*                     used under Xilinx standalone BSP.
-* 1.00a xd   11/03/04 Improved support for doxygen.
-* 1.00a rmm  03/21/02 First release
-* 1.00a wgr  03/22/07 Converted to new coding style.
-* 1.00a rpm  06/29/07 Added udelay macro for standalone
-* 1.00a xd   07/19/07 Included xparameters.h as XPAR_ constants are referred
-*                     to in MICROBLAZE section
-* 1.00a ecm  09/19/08 updated for v7.20 of Microblaze, new functionality
-*
-* 
-* -* -******************************************************************************/ - -/** - *@cond nocomments - */ - -#ifndef XENV_STANDALONE_H -#define XENV_STANDALONE_H - -#include "xil_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ -/****************************************************************************** - * - * Get the processor dependent includes - * - ******************************************************************************/ - -#include - -#if defined __MICROBLAZE__ -# include "mb_interface.h" -# include "xparameters.h" /* XPAR constants used below in MB section */ - -#elif defined __PPC__ -# include "sleep.h" -# include "xcache_l.h" /* also include xcache_l.h for caching macros */ -#endif - -/****************************************************************************** - * - * MEMCPY / MEMSET related macros. - * - * The following are straight forward implementations of memset and memcpy. - * - * NOTE: memcpy may not work if source and target memory area are overlapping. - * - ******************************************************************************/ -/*****************************************************************************/ -/** - * - * Copies a non-overlapping block of memory. - * - * @param DestPtr - * Destination address to copy data to. - * - * @param SrcPtr - * Source address to copy data from. - * - * @param Bytes - * Number of bytes to copy. - * - * @return None. - * - * @note - * The use of XENV_MEM_COPY is deprecated. Use memcpy() instead. - * - * @note - * This implementation MAY BREAK work if source and target memory - * area are overlapping. - * - *****************************************************************************/ - -#define XENV_MEM_COPY(DestPtr, SrcPtr, Bytes) \ - memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) - - - -/*****************************************************************************/ -/** - * - * Fills an area of memory with constant data. - * - * @param DestPtr - * Destination address to copy data to. - * - * @param Data - * Value to set. - * - * @param Bytes - * Number of bytes to copy. - * - * @return None. - * - * @note - * The use of XENV_MEM_FILL is deprecated. Use memset() instead. - * - *****************************************************************************/ - -#define XENV_MEM_FILL(DestPtr, Data, Bytes) \ - memset((void *) DestPtr, (s32) Data, (size_t) Bytes) - - - -/****************************************************************************** - * - * TIME related macros - * - ******************************************************************************/ - -/** - * A structure that contains a time stamp used by other time stamp macros - * defined below. This structure is processor dependent. - */ -typedef s32 XENV_TIME_STAMP; - -/*****************************************************************************/ -/** - * - * Time is derived from the 64 bit PPC timebase register - * - * @param StampPtr is the storage for the retrieved time stamp. - * - * @return None. - * - * @note - * - * Signature: void XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr) - *

- * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_GET(StampPtr) - -/*****************************************************************************/ -/** - * - * This macro is not yet implemented and always returns 0. - * - * @param Stamp1Ptr is the first sampled time stamp. - * @param Stamp2Ptr is the second sampled time stamp. - * - * @return 0 - * - * @note - * - * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_DELTA_US(Stamp1Ptr, Stamp2Ptr) (0) - -/*****************************************************************************/ -/** - * - * This macro is not yet implemented and always returns 0. - * - * @param Stamp1Ptr is the first sampled time stamp. - * @param Stamp2Ptr is the second sampled time stamp. - * - * @return 0 - * - * @note - * - * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_DELTA_MS(Stamp1Ptr, Stamp2Ptr) (0) - -/*****************************************************************************/ -/** - * XENV_USLEEP(unsigned delay) - * - * Delay the specified number of microseconds. Not implemented without OS - * support. - * - * @param delay - * Number of microseconds to delay. - * - * @return None. - * - *****************************************************************************/ - -#ifdef __PPC__ -#define XENV_USLEEP(delay) usleep(delay) -#define udelay(delay) usleep(delay) -#else -#define XENV_USLEEP(delay) -#define udelay(delay) -#endif - - -/****************************************************************************** - * - * CACHE handling macros / mappings - * - ******************************************************************************/ -/****************************************************************************** - * - * Processor independent macros - * - ******************************************************************************/ - -#define XCACHE_ENABLE_CACHE() \ - { XCACHE_ENABLE_DCACHE(); XCACHE_ENABLE_ICACHE(); } - -#define XCACHE_DISABLE_CACHE() \ - { XCACHE_DISABLE_DCACHE(); XCACHE_DISABLE_ICACHE(); } - - -/****************************************************************************** - * - * MicroBlaze case - * - * NOTE: Currently the following macros will only work on systems that contain - * only ONE MicroBlaze processor. Also, the macros will only be enabled if the - * system is built using a xparameters.h file. - * - ******************************************************************************/ - -#if defined __MICROBLAZE__ - -/* Check if MicroBlaze data cache was built into the core. - */ -#if (XPAR_MICROBLAZE_USE_DCACHE == 1) -# define XCACHE_ENABLE_DCACHE() microblaze_enable_dcache() -# define XCACHE_DISABLE_DCACHE() microblaze_disable_dcache() -# define XCACHE_INVALIDATE_DCACHE() microblaze_invalidate_dcache() - -# define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) \ - microblaze_invalidate_dcache_range((s32)(Addr), (s32)(Len)) - -#if (XPAR_MICROBLAZE_DCACHE_USE_WRITEBACK == 1) -# define XCACHE_FLUSH_DCACHE() microblaze_flush_dcache() -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - microblaze_flush_dcache_range((s32)(Addr), (s32)(Len)) -#else -# define XCACHE_FLUSH_DCACHE() microblaze_invalidate_dcache() -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - microblaze_invalidate_dcache_range((s32)(Addr), (s32)(Len)) -#endif /*XPAR_MICROBLAZE_DCACHE_USE_WRITEBACK*/ - -#else -# define XCACHE_ENABLE_DCACHE() -# define XCACHE_DISABLE_DCACHE() -# define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) -#endif /*XPAR_MICROBLAZE_USE_DCACHE*/ - - -/* Check if MicroBlaze instruction cache was built into the core. - */ -#if (XPAR_MICROBLAZE_USE_ICACHE == 1) -# define XCACHE_ENABLE_ICACHE() microblaze_enable_icache() -# define XCACHE_DISABLE_ICACHE() microblaze_disable_icache() - -# define XCACHE_INVALIDATE_ICACHE() microblaze_invalidate_icache() - -# define XCACHE_INVALIDATE_ICACHE_RANGE(Addr, Len) \ - microblaze_invalidate_icache_range((s32)(Addr), (s32)(Len)) - -#else -# define XCACHE_ENABLE_ICACHE() -# define XCACHE_DISABLE_ICACHE() -#endif /*XPAR_MICROBLAZE_USE_ICACHE*/ - - -/****************************************************************************** - * - * PowerPC case - * - * Note that the XCACHE_ENABLE_xxx functions are hardcoded to enable a - * specific memory region (0x80000001). Each bit (0-30) in the regions - * bitmask stands for 128MB of memory. Bit 31 stands for the upper 2GB - * range. - * - * regions --> cached address range - * ------------|-------------------------------------------------- - * 0x80000000 | [0, 0x7FFFFFF] - * 0x00000001 | [0xF8000000, 0xFFFFFFFF] - * 0x80000001 | [0, 0x7FFFFFF],[0xF8000000, 0xFFFFFFFF] - * - ******************************************************************************/ - -#elif defined __PPC__ - -#define XCACHE_ENABLE_DCACHE() XCache_EnableDCache(0x80000001) -#define XCACHE_DISABLE_DCACHE() XCache_DisableDCache() -#define XCACHE_ENABLE_ICACHE() XCache_EnableICache(0x80000001) -#define XCACHE_DISABLE_ICACHE() XCache_DisableICache() - -#define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) \ - XCache_InvalidateDCacheRange((u32)(Addr), (u32)(Len)) - -#define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - XCache_FlushDCacheRange((u32)(Addr), (u32)(Len)) - -#define XCACHE_INVALIDATE_ICACHE() XCache_InvalidateICache() - - -/****************************************************************************** - * - * Unknown processor / architecture - * - ******************************************************************************/ - -#else -/* #error "Unknown processor / architecture. Must be MicroBlaze or PowerPC." */ -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef XENV_STANDALONE_H */ - - /** - *@endcond - */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/41b55f585243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/41b55f585243001d18b399c1eb9b3628 deleted file mode 100644 index 973a707..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/41b55f585243001d18b399c1eb9b3628 +++ /dev/null @@ -1,323 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2014 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* @file xparameters_ps.h -* -* This file contains the address definitions for the hard peripherals -* attached to the ARM Cortex A53 core. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who     Date     Changes
-* ----- ------- -------- ---------------------------------------------------
-* 5.00 	pkp  05/29/14 First release
-* 
-* -* @note -* -* None. -* -******************************************************************************/ - -#ifndef _XPARAMETERS_PS_H_ -#define _XPARAMETERS_PS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - *@cond nocomments - */ - -/***************************** Include Files *********************************/ - - -/************************** Constant Definitions *****************************/ - -/* - * This block contains constant declarations for the peripherals - * within the hardblock - */ - -/* Canonical definitions for DDR MEMORY */ -#define XPAR_DDR_MEM_BASEADDR 0x00000000U -#define XPAR_DDR_MEM_HIGHADDR 0x3FFFFFFFU - -/* Canonical definitions for Interrupts */ -#define XPAR_XUARTPS_0_INTR XPS_UART0_INT_ID -#define XPAR_XUARTPS_1_INTR XPS_UART1_INT_ID -#define XPAR_XIICPS_0_INTR XPS_I2C0_INT_ID -#define XPAR_XIICPS_1_INTR XPS_I2C1_INT_ID -#define XPAR_XSPIPS_0_INTR XPS_SPI0_INT_ID -#define XPAR_XSPIPS_1_INTR XPS_SPI1_INT_ID -#define XPAR_XCANPS_0_INTR XPS_CAN0_INT_ID -#define XPAR_XCANPS_1_INTR XPS_CAN1_INT_ID -#define XPAR_XGPIOPS_0_INTR XPS_GPIO_INT_ID -#define XPAR_XEMACPS_0_INTR XPS_GEM0_INT_ID -#define XPAR_XEMACPS_0_WAKE_INTR XPS_GEM0_WAKE_INT_ID -#define XPAR_XEMACPS_1_INTR XPS_GEM1_INT_ID -#define XPAR_XEMACPS_1_WAKE_INTR XPS_GEM1_WAKE_INT_ID -#define XPAR_XEMACPS_2_INTR XPS_GEM2_INT_ID -#define XPAR_XEMACPS_2_WAKE_INTR XPS_GEM2_WAKE_INT_ID -#define XPAR_XEMACPS_3_INTR XPS_GEM3_INT_ID -#define XPAR_XEMACPS_3_WAKE_INTR XPS_GEM3_WAKE_INT_ID -#define XPAR_XSDIOPS_0_INTR XPS_SDIO0_INT_ID -#define XPAR_XQSPIPS_0_INTR XPS_QSPI_INT_ID -#define XPAR_XSDIOPS_1_INTR XPS_SDIO1_INT_ID -#define XPAR_XWDTPS_0_INTR XPS_LPD_SWDT_INT_ID -#define XPAR_XWDTPS_1_INTR XPS_FPD_SWDT_INT_ID -#define XPAR_XDCFG_0_INTR XPS_DVC_INT_ID -#define XPAR_XTTCPS_0_INTR XPS_TTC0_0_INT_ID -#define XPAR_XTTCPS_1_INTR XPS_TTC0_1_INT_ID -#define XPAR_XTTCPS_2_INTR XPS_TTC0_2_INT_ID -#define XPAR_XTTCPS_3_INTR XPS_TTC1_0_INT_ID -#define XPAR_XTTCPS_4_INTR XPS_TTC1_1_INT_ID -#define XPAR_XTTCPS_5_INTR XPS_TTC1_2_INT_ID -#define XPAR_XTTCPS_6_INTR XPS_TTC2_0_INT_ID -#define XPAR_XTTCPS_7_INTR XPS_TTC2_1_INT_ID -#define XPAR_XTTCPS_8_INTR XPS_TTC2_2_INT_ID -#define XPAR_XTTCPS_9_INTR XPS_TTC3_0_INT_ID -#define XPAR_XTTCPS_10_INTR XPS_TTC3_1_INT_ID -#define XPAR_XTTCPS_11_INTR XPS_TTC3_2_INT_ID -#define XPAR_XNANDPS8_0_INTR XPS_NAND_INT_ID -#define XPAR_XADMAPS_0_INTR XPS_ADMA_CH0_INT_ID -#define XPAR_XADMAPS_1_INTR XPS_ADMA_CH1_INT_ID -#define XPAR_XADMAPS_2_INTR XPS_ADMA_CH2_INT_ID -#define XPAR_XADMAPS_3_INTR XPS_ADMA_CH3_INT_ID -#define XPAR_XADMAPS_4_INTR XPS_ADMA_CH4_INT_ID -#define XPAR_XADMAPS_5_INTR XPS_ADMA_CH5_INT_ID -#define XPAR_XADMAPS_6_INTR XPS_ADMA_CH6_INT_ID -#define XPAR_XADMAPS_7_INTR XPS_ADMA_CH7_INT_ID -#define XPAR_XCSUDMA_INTR XPS_CSU_DMA_INT_ID -#define XPAR_PSU_ADMA_0_INTR XPS_ADMA_CH0_INT_ID -#define XPAR_PSU_ADMA_1_INTR XPS_ADMA_CH1_INT_ID -#define XPAR_PSU_ADMA_2_INTR XPS_ADMA_CH2_INT_ID -#define XPAR_PSU_ADMA_3_INTR XPS_ADMA_CH3_INT_ID -#define XPAR_PSU_ADMA_4_INTR XPS_ADMA_CH4_INT_ID -#define XPAR_PSU_ADMA_5_INTR XPS_ADMA_CH5_INT_ID -#define XPAR_PSU_ADMA_6_INTR XPS_ADMA_CH6_INT_ID -#define XPAR_PSU_ADMA_7_INTR XPS_ADMA_CH7_INT_ID -#define XPAR_PSU_CSUDMA_INTR XPS_CSU_DMA_INT_ID -#define XPAR_XMPU_LPD_INTR XPS_XMPU_LPD_INT_ID -#define XPAR_XZDMAPS_0_INTR XPS_ZDMA_CH0_INT_ID -#define XPAR_XZDMAPS_1_INTR XPS_ZDMA_CH1_INT_ID -#define XPAR_XZDMAPS_2_INTR XPS_ZDMA_CH2_INT_ID -#define XPAR_XZDMAPS_3_INTR XPS_ZDMA_CH3_INT_ID -#define XPAR_XZDMAPS_4_INTR XPS_ZDMA_CH4_INT_ID -#define XPAR_XZDMAPS_5_INTR XPS_ZDMA_CH5_INT_ID -#define XPAR_XZDMAPS_6_INTR XPS_ZDMA_CH6_INT_ID -#define XPAR_XZDMAPS_7_INTR XPS_ZDMA_CH7_INT_ID -#define XPAR_PSU_GDMA_0_INTR XPS_ZDMA_CH0_INT_ID -#define XPAR_PSU_GDMA_1_INTR XPS_ZDMA_CH1_INT_ID -#define XPAR_PSU_GDMA_2_INTR XPS_ZDMA_CH2_INT_ID -#define XPAR_PSU_GDMA_3_INTR XPS_ZDMA_CH3_INT_ID -#define XPAR_PSU_GDMA_4_INTR XPS_ZDMA_CH4_INT_ID -#define XPAR_PSU_GDMA_5_INTR XPS_ZDMA_CH5_INT_ID -#define XPAR_PSU_GDMA_6_INTR XPS_ZDMA_CH6_INT_ID -#define XPAR_PSU_GDMA_7_INTR XPS_ZDMA_CH7_INT_ID -#define XPAR_XMPU_FPD_INTR XPS_XMPU_FPD_INT_ID -#define XPAR_XCCI_FPD_INTR XPS_FPD_CCI_INT_ID -#define XPAR_XSMMU_FPD_INTR XPS_FPD_SMMU_INT_ID -#define XPAR_XUSBPS_0_INTR XPS_USB3_0_ENDPT_INT_ID -#define XPAR_XUSBPS_1_INTR XPS_USB3_1_ENDPT_INT_ID -#define XPAR_XUSBPS_0_WAKE_INTR XPS_USB3_0_WAKE_INT_ID -#define XPAR_XUSBPS_1_WAKE_INTR XPS_USB3_1_WAKE_INT_ID -#define XPAR_XRTCPSU_ALARM_INTR XPS_RTC_ALARM_INT_ID -#define XPAR_XRTCPSU_SECONDS_INTR XPS_RTC_SEC_INT_ID -#define XPAR_XAPMPS_0_INTR XPS_APM0_INT_ID -#define XPAR_XAPMPS_1_INTR XPS_APM1_INT_ID -#define XPAR_XAPMPS_2_INTR XPS_APM2_INT_ID -#define XPAR_XAPMPS_5_INTR XPS_APM5_INT_ID -#define XPAR_XSYSMONPSU_INTR XPS_AMS_INT_ID - -/* Canonical definitions for SCU GIC */ -#define XPAR_SCUGIC_NUM_INSTANCES 1U -#define XPAR_SCUGIC_SINGLE_DEVICE_ID 0U -#define XPAR_SCUGIC_CPU_BASEADDR (XPS_SCU_PERIPH_BASE + 0x00001000U) -#define XPAR_SCUGIC_DIST_BASEADDR (XPS_SCU_PERIPH_BASE + 0x00002000U) -#define XPAR_SCUGIC_ACK_BEFORE 0U - -#define XPAR_CPU_CORTEXA53_CORE_CLOCK_FREQ_HZ XPAR_CPU_CORTEXA53_0_CPU_CLK_FREQ_HZ - - -/* - * This block contains constant declarations for the peripherals - * within the hardblock. These have been put for backwards compatibility - */ - - -#define XPS_SYS_CTRL_BASEADDR 0xFF180000U -#define XPS_SCU_PERIPH_BASE 0xF9000000U - - - -/* Shared Peripheral Interrupts (SPI) */ -#define XPS_FPGA0_INT_ID 121U -#define XPS_FPGA1_INT_ID 122U -#define XPS_FPGA2_INT_ID 123U -#define XPS_FPGA3_INT_ID 124U -#define XPS_FPGA4_INT_ID 125U -#define XPS_FPGA5_INT_ID 126U -#define XPS_FPGA6_INT_ID 127U -#define XPS_FPGA7_INT_ID 128U -#define XPS_FPGA8_INT_ID 136U -#define XPS_FPGA9_INT_ID 137U -#define XPS_FPGA10_INT_ID 138U -#define XPS_FPGA11_INT_ID 139U -#define XPS_FPGA12_INT_ID 140U -#define XPS_FPGA13_INT_ID 141U -#define XPS_FPGA14_INT_ID 142U -#define XPS_FPGA15_INT_ID 143U - -/* Updated Interrupt-IDs */ -#define XPS_OCMINTR_INT_ID (10U + 32U) -#define XPS_NAND_INT_ID (14U + 32U) -#define XPS_QSPI_INT_ID (15U + 32U) -#define XPS_GPIO_INT_ID (16U + 32U) -#define XPS_I2C0_INT_ID (17U + 32U) -#define XPS_I2C1_INT_ID (18U + 32U) -#define XPS_SPI0_INT_ID (19U + 32U) -#define XPS_SPI1_INT_ID (20U + 32U) -#define XPS_UART0_INT_ID (21U + 32U) -#define XPS_UART1_INT_ID (22U + 32U) -#define XPS_CAN0_INT_ID (23U + 32U) -#define XPS_CAN1_INT_ID (24U + 32U) -#define XPS_RTC_ALARM_INT_ID (26U + 32U) -#define XPS_RTC_SEC_INT_ID (27U + 32U) -#define XPS_LPD_SWDT_INT_ID (52U + 32U) -#define XPS_FPD_SWDT_INT_ID (113U + 32U) -#define XPS_TTC0_0_INT_ID (36U + 32U) -#define XPS_TTC0_1_INT_ID (37U + 32U) -#define XPS_TTC0_2_INT_ID (38U + 32U) -#define XPS_TTC1_0_INT_ID (39U + 32U) -#define XPS_TTC1_1_INT_ID (40U + 32U) -#define XPS_TTC1_2_INT_ID (41U + 32U) -#define XPS_TTC2_0_INT_ID (42U + 32U) -#define XPS_TTC2_1_INT_ID (43U + 32U) -#define XPS_TTC2_2_INT_ID (44U + 32U) -#define XPS_TTC3_0_INT_ID (45U + 32U) -#define XPS_TTC3_1_INT_ID (46U + 32U) -#define XPS_TTC3_2_INT_ID (47U + 32U) -#define XPS_SDIO0_INT_ID (48U + 32U) -#define XPS_SDIO1_INT_ID (49U + 32U) -#define XPS_AMS_INT_ID (56U + 32U) -#define XPS_GEM0_INT_ID (57U + 32U) -#define XPS_GEM0_WAKE_INT_ID (58U + 32U) -#define XPS_GEM1_INT_ID (59U + 32U) -#define XPS_GEM1_WAKE_INT_ID (60U + 32U) -#define XPS_GEM2_INT_ID (61U + 32U) -#define XPS_GEM2_WAKE_INT_ID (62U + 32U) -#define XPS_GEM3_INT_ID (63U + 32U) -#define XPS_GEM3_WAKE_INT_ID (64U + 32U) -#define XPS_USB3_0_ENDPT_INT_ID (65U + 32U) -#define XPS_USB3_1_ENDPT_INT_ID (70U + 32U) -#define XPS_USB3_0_WAKE_INT_ID (75U + 32U) -#define XPS_USB3_1_WAKE_INT_ID (76U + 32U) -#define XPS_ADMA_CH0_INT_ID (77U + 32U) -#define XPS_ADMA_CH1_INT_ID (78U + 32U) -#define XPS_ADMA_CH2_INT_ID (79U + 32U) -#define XPS_ADMA_CH3_INT_ID (80U + 32U) -#define XPS_ADMA_CH4_INT_ID (81U + 32U) -#define XPS_ADMA_CH5_INT_ID (82U + 32U) -#define XPS_ADMA_CH6_INT_ID (83U + 32U) -#define XPS_ADMA_CH7_INT_ID (84U + 32U) -#define XPS_CSU_DMA_INT_ID (86U + 32U) -#define XPS_XMPU_LPD_INT_ID (88U + 32U) -#define XPS_ZDMA_CH0_INT_ID (124U + 32U) -#define XPS_ZDMA_CH1_INT_ID (125U + 32U) -#define XPS_ZDMA_CH2_INT_ID (126U + 32U) -#define XPS_ZDMA_CH3_INT_ID (127U + 32U) -#define XPS_ZDMA_CH4_INT_ID (128U + 32U) -#define XPS_ZDMA_CH5_INT_ID (129U + 32U) -#define XPS_ZDMA_CH6_INT_ID (130U + 32U) -#define XPS_ZDMA_CH7_INT_ID (131U + 32U) -#define XPS_XMPU_FPD_INT_ID (134U + 32U) -#define XPS_FPD_CCI_INT_ID (154U + 32U) -#define XPS_FPD_SMMU_INT_ID (155U + 32U) -#define XPS_APM0_INT_ID (123U + 32U) -#define XPS_APM1_INT_ID (25U + 32U) -#define XPS_APM2_INT_ID (25U + 32U) -#define XPS_APM5_INT_ID (123U + 32U) - -/* REDEFINES for TEST APP */ -#define XPAR_PSU_UART_0_INTR XPS_UART0_INT_ID -#define XPAR_PSU_UART_1_INTR XPS_UART1_INT_ID -#define XPAR_PSU_USB_0_INTR XPS_USB0_INT_ID -#define XPAR_PSU_USB_1_INTR XPS_USB1_INT_ID -#define XPAR_PSU_I2C_0_INTR XPS_I2C0_INT_ID -#define XPAR_PSU_I2C_1_INTR XPS_I2C1_INT_ID -#define XPAR_PSU_SPI_0_INTR XPS_SPI0_INT_ID -#define XPAR_PSU_SPI_1_INTR XPS_SPI1_INT_ID -#define XPAR_PSU_CAN_0_INTR XPS_CAN0_INT_ID -#define XPAR_PSU_CAN_1_INTR XPS_CAN1_INT_ID -#define XPAR_PSU_GPIO_0_INTR XPS_GPIO_INT_ID -#define XPAR_PSU_ETHERNET_0_INTR XPS_GEM0_INT_ID -#define XPAR_PSU_ETHERNET_0_WAKE_INTR XPS_GEM0_WAKE_INT_ID -#define XPAR_PSU_ETHERNET_1_INTR XPS_GEM1_INT_ID -#define XPAR_PSU_ETHERNET_1_WAKE_INTR XPS_GEM1_WAKE_INT_ID -#define XPAR_PSU_ETHERNET_2_INTR XPS_GEM2_INT_ID -#define XPAR_PSU_ETHERNET_2_WAKE_INTR XPS_GEM2_WAKE_INT_ID -#define XPAR_PSU_ETHERNET_3_INTR XPS_GEM3_INT_ID -#define XPAR_PSU_ETHERNET_3_WAKE_INTR XPS_GEM3_WAKE_INT_ID -#define XPAR_PSU_QSPI_0_INTR XPS_QSPI_INT_ID -#define XPAR_PSU_WDT_0_INTR XPS_LPD_SWDT_INT_ID -#define XPAR_PSU_WDT_1_INTR XPS_FPD_SWDT_INT_ID -#define XPAR_PSU_XADC_0_INTR XPS_SYSMON_INT_ID -#define XPAR_PSU_TTC_0_INTR XPS_TTC0_0_INT_ID -#define XPAR_PSU_TTC_1_INTR XPS_TTC0_1_INT_ID -#define XPAR_PSU_TTC_2_INTR XPS_TTC0_2_INT_ID -#define XPAR_PSU_TTC_3_INTR XPS_TTC1_0_INT_ID -#define XPAR_PSU_TTC_4_INTR XPS_TTC1_1_INT_ID -#define XPAR_PSU_TTC_5_INTR XPS_TTC1_2_INT_ID -#define XPAR_PSU_TTC_6_INTR XPS_TTC2_0_INT_ID -#define XPAR_PSU_TTC_7_INTR XPS_TTC2_1_INT_ID -#define XPAR_PSU_TTC_8_INTR XPS_TTC2_2_INT_ID -#define XPAR_PSU_TTC_9_INTR XPS_TTC3_0_INT_ID -#define XPAR_PSU_TTC_10_INTR XPS_TTC3_1_INT_ID -#define XPAR_PSU_TTC_11_INTR XPS_TTC3_2_INT_ID -#define XPAR_PSU_AMS_INTR XPS_AMS_INT_ID - -#define XPAR_XADCPS_NUM_INSTANCES 1U -#define XPAR_XADCPS_0_DEVICE_ID 0U -#define XPAR_XADCPS_0_BASEADDR (0xF8007000U) -#define XPAR_XADCPS_INT_ID XPS_SYSMON_INT_ID - -/* For backwards compatibility */ -#define XPAR_XUARTPS_0_CLOCK_HZ XPAR_XUARTPS_0_UART_CLK_FREQ_HZ -#define XPAR_XUARTPS_1_CLOCK_HZ XPAR_XUARTPS_1_UART_CLK_FREQ_HZ -#define XPAR_XTTCPS_0_CLOCK_HZ XPAR_XTTCPS_0_TTC_CLK_FREQ_HZ -#define XPAR_XTTCPS_1_CLOCK_HZ XPAR_XTTCPS_1_TTC_CLK_FREQ_HZ -#define XPAR_XTTCPS_2_CLOCK_HZ XPAR_XTTCPS_2_TTC_CLK_FREQ_HZ -#define XPAR_XTTCPS_3_CLOCK_HZ XPAR_XTTCPS_3_TTC_CLK_FREQ_HZ -#define XPAR_XTTCPS_4_CLOCK_HZ XPAR_XTTCPS_4_TTC_CLK_FREQ_HZ -#define XPAR_XTTCPS_5_CLOCK_HZ XPAR_XTTCPS_5_TTC_CLK_FREQ_HZ -#define XPAR_XIICPS_0_CLOCK_HZ XPAR_XIICPS_0_I2C_CLK_FREQ_HZ -#define XPAR_XIICPS_1_CLOCK_HZ XPAR_XIICPS_1_I2C_CLK_FREQ_HZ - -#define XPAR_XQSPIPS_0_CLOCK_HZ XPAR_XQSPIPS_0_QSPI_CLK_FREQ_HZ - -#ifdef XPAR_CPU_CORTEXA53_0_CPU_CLK_FREQ_HZ -#define XPAR_CPU_CORTEXA53_CORE_CLOCK_FREQ_HZ XPAR_CPU_CORTEXA53_0_CPU_CLK_FREQ_HZ -#endif - -#ifdef XPAR_CPU_CORTEXA53_1_CPU_CLK_FREQ_HZ -#define XPAR_CPU_CORTEXA53_CORE_CLOCK_FREQ_HZ XPAR_CPU_CORTEXA53_1_CPU_CLK_FREQ_HZ -#endif - -#define XPAR_SCUWDT_DEVICE_ID 0U - -/** - *@endcond - */ - -#ifdef __cplusplus -} -#endif - -#endif /* protection macro */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/525ad4565243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/525ad4565243001d18b399c1eb9b3628 deleted file mode 100644 index b828612..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/525ad4565243001d18b399c1eb9b3628 +++ /dev/null @@ -1,1534 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2010 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_cache.c -* -* Contains required functions for the ARM cache functionality. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver    Who Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 1.00a  ecm 01/29/10 First release
-* 1.00a  ecm 06/24/10 Moved the L1 and L2 specific function prototypes
-*		      		  to xil_cache_mach.h to give access to sophisticated users
-* 3.02a  sdm 04/07/11 Updated Flush/InvalidateRange APIs to flush/invalidate
-*		      		  L1 and L2 caches in a single loop and used dsb, L2 sync
-*		      		  at the end of the loop.
-* 3.04a  sdm 01/02/12 Remove redundant dsb/dmb instructions in cache maintenance
-*		      		  APIs.
-* 3.07a  asa 07/16/12 Corrected the L1 and L2 cache invalidation order.
-* 3.07a  sgd 09/18/12 Corrected the L2 cache enable and disable sequence.
-* 3.10a  srt 04/18/13 Implemented ARM Erratas. Please refer to file
-*		      		  'xil_errata.h' for errata description
-* 3.10a  asa 05/13/13 Modified cache disable APIs. The L2 cache disable
-*			  		  operation was being done with L1 Data cache disabled. This is
-*			  		  fixed so that L2 cache disable operation happens independent of
-*			  		  L1 cache disable operation. This fixes CR #706464.
-*			  		  Changes are done to do a L2 cache sync (poll reg7_?cache_?sync).
-*			  		  This is done to fix the CR #700542.
-* 3.11a  asa 09/23/13 Modified the Xil_DCacheFlushRange and
-*			 		  Xil_DCacheInvalidateRange to fix potential issues. Fixed other
-*			 		  relevant cache APIs to disable and enable back the interrupts.
-*			 		  This fixes CR #663885.
-* 3.11a  asa 09/28/13 Made changes for L2 cache sync operation. It is found
-*			 		  out that for L2 cache flush/clean/invalidation by cache lines
-*			 		  does not need a cache sync as these are atomic nature. Similarly
-*			 		  figured out that for complete L2 cache flush/invalidation by way
-*			 		  we need to wait for some more time in a loop till the status
-*			 		  shows that the cache operation is completed.
-* 4.00	 pkp 24/01/14 Modified Xil_DCacheInvalidateRange to fix the bug. Few
-*			 		  cache lines were missed to invalidate when unaligned address
-*			 		  invalidation was accommodated. That fixes CR #766768.
-*			 		  Also in Xil_L1DCacheInvalidate, while invalidating all L1D cache
-*			 		  stack memory which contains return address was invalidated. So
-*			 		  stack memory was flushed first and then L1D cache is invalidated.
-*			 		  This is done to fix CR #763829
-* 4.01   asa 05/09/14 Made changes in cortexa9/xil_cache.c to fix CR# 798230.
-* 4.02	 pkp 06/27/14 Added notes to Xil_L1DCacheInvalidateRange function for
-*					  explanation of CR#785243
-* 5.00   kvn 12/15/14 Xil_L2CacheInvalidate was modified to fix CR# 838835. L2 Cache
-*					  has stack memory which has return address. Before invalidating
-*					  cache, stack memory was flushed first and L2 Cache is invalidated.
-* 5.01	 pkp 05/12/15 Xil_DCacheInvalidateRange and Xil_DCacheFlushRange is modified
-*					  to remove unnecessary dsb in the APIs. Instead of using dsb
-*					  for L2 Cache, L2CacheSync has been used for each L2 cache line
-*					  and single dsb has been used for L1 cache. Also L2CacheSync is
-*					  added into Xil_L2CacheInvalidateRange API. Xil_L1DCacheInvalidate
-*					  and Xil_L2CacheInvalidate APIs are modified to flush the complete
-*					  stack instead of just System Stack
-* 5.03	 pkp 10/07/15 L2 Cache functionalities are avoided for the OpenAMP slave
-*					  application(when USE_AMP flag is defined for BSP) as master CPU
-*					  would be utilizing L2 cache for its operation
-* 6.6    mus 12/07/17 Errata 753970 is not applicable for the PL130 cache controller
-*                     version r0p2, which is present in zynq. So,removed the handling
-*                     related to same.It fixes CR#989132.
-* 6.6    asa 16/01/18 Changes made in Xil_L1DCacheInvalidate and Xil_L2CacheInvalidate
-*					  routines to ensure the stack data flushed only when the respective
-*					  caches are enabled. This fixes CR-992023.
-* 7.5    mus 01/19/21 Implement workaround for errata#588369 in Xil_DCacheFlushRange.
-*					  It fixes CR#1086022.
-*
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xil_cache.h" -#include "xil_cache_l.h" -#include "xil_io.h" -#include "xpseudo_asm.h" -#include "xparameters.h" -#include "xreg_cortexa9.h" -#include "xl2cc.h" -#include "xil_errata.h" -#include "xil_exception.h" - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ - -#define IRQ_FIQ_MASK 0xC0U /* Mask IRQ and FIQ interrupts in cpsr */ - -#ifdef __GNUC__ - extern s32 _stack_end; - extern s32 __undef_stack; -#endif - -#ifndef USE_AMP -/**************************************************************************** -* -* Access L2 Debug Control Register. -* -* @param Value, value to be written to Debug Control Register. -* -* @return None. -* -****************************************************************************/ -#ifdef __GNUC__ -static inline void Xil_L2WriteDebugCtrl(u32 Value) -#else -static void Xil_L2WriteDebugCtrl(u32 Value) -#endif -{ -#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915) - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_DEBUG_CTRL_OFFSET, Value); -#else - (void)(Value); -#endif -} - -/**************************************************************************** -* -* Perform L2 Cache Sync Operation. -* -* @return None. -* -****************************************************************************/ -#ifdef __GNUC__ -static inline void Xil_L2CacheSync(void) -#else -static void Xil_L2CacheSync(void) -#endif -{ - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_SYNC_OFFSET, 0x0U); -} -#endif -/****************************************************************************/ -/** -* @brief Enable the Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheEnable(void) -{ - Xil_L1DCacheEnable(); -#ifndef USE_AMP - Xil_L2CacheEnable(); -#endif -} - -/****************************************************************************/ -/** -* @brief Disable the Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheDisable(void) -{ -#ifndef USE_AMP - Xil_L2CacheDisable(); -#endif - Xil_L1DCacheDisable(); -} - -/****************************************************************************/ -/** -* @brief Invalidate the entire Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheInvalidate(void) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); -#ifndef USE_AMP - Xil_L2CacheInvalidate(); -#endif - Xil_L1DCacheInvalidate(); - - mtcpsr(currmask); -} - -/*****************************************************************************/ -/** -* @brief Invalidate a Data cache line. If the byte specified by the address -* (adr) is cached by the Data cache, the cacheline containing that -* byte is invalidated. If the cacheline is modified (dirty), the -* modified contents are lost and are NOT written to the system memory -* before the line is invalidated. -* -* @param adr: 32bit address of the data to be flushed. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_DCacheInvalidateLine(u32 adr) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); -#ifndef USE_AMP - Xil_L2CacheInvalidateLine(adr); -#endif - Xil_L1DCacheInvalidateLine(adr); - - mtcpsr(currmask); -} - - -/*****************************************************************************/ -/** -* Invalidate the Data cache for the given address range. -* If the bytes specified by the address range are cached by the Data -* cache, the cachelines containing those bytes are invalidated. If -* the cachelines are modified (dirty), the modified contents are lost -* and NOT written to the system memory before the lines are -* invalidated. -* -* In this function, if start address or end address is not aligned to -* cache-line, particular cache-line containing unaligned start or end -* address is flush first and then invalidated the others as -* invalidating the same unaligned cache line may result into loss of -* data. This issue raises few possibilities. -* -* If the address to be invalidated is not cache-line aligned, the -* following choices are available: -* 1. Invalidate the cache line when required and do not bother much -* for the side effects. Though it sounds good, it can result in -* hard-to-debug issues. The problem is, if some other variable are -* allocated in the same cache line and had been recently updated -* (in cache), the invalidation would result in loss of data. -* 2. Flush the cache line first. This will ensure that if any other -* variable present in the same cache line and updated recently are -* flushed out to memory. Then it can safely be invalidated. Again it -* sounds good, but this can result in issues. For example, when the -* invalidation happens in a typical ISR (after a DMA transfer has -* updated the memory), then flushing the cache line means, losing -* data that were updated recently before the ISR got invoked. -* -* Linux prefers the second one. To have uniform implementation -* (across standalone and Linux), the second option is implemented. -* This being the case, following needs to be taken care of: -* 1. Whenever possible, the addresses must be cache line aligned. -* Please nore that, not just start address, even the end address must -* be cache line aligned. If that is taken care of, this will always -* work. -* 2. Avoid situations where invalidation has to be done after the -* data is updated by peripheral/DMA directly into the memory. It is -* not tough to achieve (may be a bit risky). The common use case to -* do invalidation is when a DMA happens. Generally for such use -* cases, buffers can be allocated first and then start the DMA. The -* practice that needs to be followed here is, immediately after -* buffer allocation and before starting the DMA, do the invalidation. -* With this approach, invalidation need not to be done after the DMA -* transfer is over. -* -* This is going to always work if done carefully. -* However, the concern is, there is no guarantee that invalidate has -* not needed to be done after DMA is complete. For example, because -* of some reasons if the first cache line or last cache line -* (assuming the buffer in question comprises of multiple cache lines) -* are brought into cache (between the time it is invalidated and DMA -* completes) because of some speculative prefetching or reading data -* for a variable present in the same cache line, then we will have to -* invalidate the cache after DMA is complete. -* -* -* @param adr: 32bit start address of the range to be invalidated. -* @param len: Length of the range to be invalidated in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheInvalidateRange(INTPTR adr, u32 len) -{ - const u32 cacheline = 32U; - u32 end; - u32 tempadr = adr; - u32 tempend; - u32 currmask; - volatile u32 *L2CCOffset = (volatile u32 *)(XPS_L2CC_BASEADDR + - XPS_L2CC_CACHE_INVLD_PA_OFFSET); - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - end = tempadr + len; - tempend = end; - /* Select L1 Data cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - - if ((tempadr & (cacheline-1U)) != 0U) { - tempadr &= (~(cacheline - 1U)); - - Xil_L1DCacheFlushLine(tempadr); -#ifndef USE_AMP - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - Xil_L2CacheFlushLine(tempadr); - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - Xil_L2CacheSync(); -#endif - tempadr += cacheline; - } - if ((tempend & (cacheline-1U)) != 0U) { - tempend &= (~(cacheline - 1U)); - - Xil_L1DCacheFlushLine(tempend); -#ifndef USE_AMP - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - Xil_L2CacheFlushLine(tempend); - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - Xil_L2CacheSync(); -#endif - } - - while (tempadr < tempend) { -#ifndef USE_AMP - /* Invalidate L2 cache line */ - *L2CCOffset = tempadr; - Xil_L2CacheSync(); -#endif - - /* Invalidate L1 Data cache line */ -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_inval_dc_line_mva_poc(tempadr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_INVAL_DC_LINE_MVA_POC); - Reg = tempadr; } -#endif - tempadr += cacheline; - } - } - - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Flush the entire Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheFlush(void) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - Xil_L1DCacheFlush(); -#ifndef USE_AMP - Xil_L2CacheFlush(); -#endif - mtcpsr(currmask); -} - - -/****************************************************************************/ -/** -* @brief Flush a Data cache line. If the byte specified by the address (adr) -* is cached by the Data cache, the cacheline containing that byte is -* invalidated. If the cacheline is modified (dirty), the entire -* contents of the cacheline are written to system memory before the -* line is invalidated. -* -* @param adr: 32bit address of the data to be flushed. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_DCacheFlushLine(u32 adr) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - Xil_L1DCacheFlushLine(adr); -#ifndef USE_AMP - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - - Xil_L2CacheFlushLine(adr); - - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - Xil_L2CacheSync(); -#endif - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Flush the Data cache for the given address range. -* If the bytes specified by the address range are cached by the -* data cache, the cachelines containing those bytes are invalidated. -* If the cachelines are modified (dirty), they are written to the -* system memory before the lines are invalidated. -* -* @param adr: 32bit start address of the range to be flushed. -* @param len: Length of the range to be flushed in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_DCacheFlushRange(INTPTR adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - u32 currmask; - volatile u32 *L2CCOffset = (volatile u32 *)(XPS_L2CC_BASEADDR + - XPS_L2CC_CACHE_INV_CLN_PA_OFFSET); - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr &= ~(cacheline - 1U); -#ifndef USE_AMP - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); -#endif - while (LocalAddr < end) { - - /* Flush L1 Data cache line */ -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_clean_inval_dc_line_mva_poc(LocalAddr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_CLEAN_INVAL_DC_LINE_MVA_POC); - Reg = LocalAddr; } -#endif -#ifndef USE_AMP - /* Flush L2 cache line */ - *L2CCOffset = LocalAddr; - Xil_L2CacheSync(); -#endif - LocalAddr += cacheline; - } -#ifndef USE_AMP - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); -#endif - } - dsb(); - mtcpsr(currmask); -} -/****************************************************************************/ -/** -* @brief Store a Data cache line. If the byte specified by the address (adr) -* is cached by the Data cache and the cacheline is modified (dirty), -* the entire contents of the cacheline are written to system memory. -* After the store completes, the cacheline is marked as unmodified -* (not dirty). -* -* @param adr: 32bit address of the data to be stored. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_DCacheStoreLine(u32 adr) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - Xil_L1DCacheStoreLine(adr); -#ifndef USE_AMP - Xil_L2CacheStoreLine(adr); -#endif - mtcpsr(currmask); -} - -/***************************************************************************/ -/** -* @brief Enable the instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_ICacheEnable(void) -{ - Xil_L1ICacheEnable(); -#ifndef USE_AMP - Xil_L2CacheEnable(); -#endif -} - -/***************************************************************************/ -/** -* @brief Disable the instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_ICacheDisable(void) -{ -#ifndef USE_AMP - Xil_L2CacheDisable(); -#endif - Xil_L1ICacheDisable(); -} - - -/****************************************************************************/ -/** -* @brief Invalidate the entire instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_ICacheInvalidate(void) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); -#ifndef USE_AMP - Xil_L2CacheInvalidate(); -#endif - Xil_L1ICacheInvalidate(); - - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Invalidate an instruction cache line. If the instruction specified -* by the address is cached by the instruction cache, the cacheline -* containing that instruction is invalidated. -* -* @param adr: 32bit address of the instruction to be invalidated. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_ICacheInvalidateLine(u32 adr) -{ - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); -#ifndef USE_AMP - Xil_L2CacheInvalidateLine(adr); -#endif - Xil_L1ICacheInvalidateLine(adr); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Invalidate the instruction cache for the given address range. -* If the instructions specified by the address range are cached by -* the instrunction cache, the cachelines containing those -* instructions are invalidated. -* -* @param adr: 32bit start address of the range to be invalidated. -* @param len: Length of the range to be invalidated in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_ICacheInvalidateRange(INTPTR adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - volatile u32 *L2CCOffset = (volatile u32 *)(XPS_L2CC_BASEADDR + - XPS_L2CC_CACHE_INVLD_PA_OFFSET); - - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Select cache L0 I-cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 1U); - - while (LocalAddr < end) { -#ifndef USE_AMP - /* Invalidate L2 cache line */ - *L2CCOffset = LocalAddr; - dsb(); -#endif - - /* Invalidate L1 I-cache line */ -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_inval_ic_line_mva_pou(LocalAddr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_INVAL_IC_LINE_MVA_POU); - Reg = LocalAddr; } -#endif - - LocalAddr += cacheline; - } - } - - /* Wait for L1 and L2 invalidate to complete */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Enable the level 1 Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L1DCacheEnable(void) -{ - register u32 CtrlReg; - - /* enable caches only if they are disabled */ -#ifdef __GNUC__ - CtrlReg = mfcp(XREG_CP15_SYS_CONTROL); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_SYS_CONTROL, CtrlReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_SYS_CONTROL); - CtrlReg = Reg; } -#endif - if ((CtrlReg & (XREG_CP15_CONTROL_C_BIT)) != 0U) { - return; - } - - /* clean and invalidate the Data cache */ - Xil_L1DCacheInvalidate(); - - /* enable the Data cache */ - CtrlReg |= (XREG_CP15_CONTROL_C_BIT); - - mtcp(XREG_CP15_SYS_CONTROL, CtrlReg); -} - -/***************************************************************************/ -/** -* @brief Disable the level 1 Data cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L1DCacheDisable(void) -{ - register u32 CtrlReg; - - /* clean and invalidate the Data cache */ - Xil_L1DCacheFlush(); - -#ifdef __GNUC__ - /* disable the Data cache */ - CtrlReg = mfcp(XREG_CP15_SYS_CONTROL); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_SYS_CONTROL, CtrlReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_SYS_CONTROL); - CtrlReg = Reg; } -#endif - - CtrlReg &= ~(XREG_CP15_CONTROL_C_BIT); - - mtcp(XREG_CP15_SYS_CONTROL, CtrlReg); -} - -/****************************************************************************/ -/** -* @brief Invalidate the level 1 Data cache. -* -* @return None. -* -* @note In Cortex A9, there is no cp instruction for invalidating -* the whole D-cache. This function invalidates each line by -* set/way. -* -****************************************************************************/ -void Xil_L1DCacheInvalidate(void) -{ - register u32 CsidReg, C7Reg; - u32 CacheSize, LineSize, NumWays; - u32 Way, WayIndex, Set, SetIndex, NumSet; - u32 currmask; - -#ifdef __GNUC__ - u32 stack_start,stack_end,stack_size; - register u32 CtrlReg; -#endif - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - -#ifdef __GNUC__ - stack_end = (u32)&_stack_end; - stack_start = (u32)&__undef_stack; - stack_size=stack_start-stack_end; - - /* Check for the cache status. If cache is enabled, then only - * flush stack memory to save return address. If cache is disabled, - * don't flush anything as it might result in flushing stale date into - * memory which is undesirable. - * */ - CtrlReg = mfcp(XREG_CP15_SYS_CONTROL); - if ((CtrlReg & (XREG_CP15_CONTROL_C_BIT)) != 0U) { - Xil_DCacheFlushRange(stack_end, stack_size); - } -#endif - - /* Select cache level 0 and D cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - -#ifdef __GNUC__ - CsidReg = mfcp(XREG_CP15_CACHE_SIZE_ID); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_CACHE_SIZE_ID, CsidReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_CACHE_SIZE_ID); - CsidReg = Reg; } -#endif - /* Determine Cache Size */ - CacheSize = (CsidReg >> 13U) & 0x1FFU; - CacheSize +=1U; - CacheSize *=128U; /* to get number of bytes */ - - /* Number of Ways */ - NumWays = (CsidReg & 0x3ffU) >> 3U; - NumWays += 1U; - - /* Get the cacheline size, way size, index size from csidr */ - LineSize = (CsidReg & 0x07U) + 4U; - - NumSet = CacheSize/NumWays; - NumSet /= (0x00000001U << LineSize); - - Way = 0U; - Set = 0U; - - /* Invalidate all the cachelines */ - for (WayIndex =0U; WayIndex < NumWays; WayIndex++) { - for (SetIndex =0U; SetIndex < NumSet; SetIndex++) { - C7Reg = Way | Set; - - /* Invalidate by Set/Way */ -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_inval_dc_line_sw(C7Reg); -#else - /*mtcp(XREG_CP15_INVAL_DC_LINE_SW, C7Reg), */ - { volatile register u32 Reg - __asm(XREG_CP15_INVAL_DC_LINE_SW); - Reg = C7Reg; } -#endif - Set += (0x00000001U << LineSize); - } - Set=0U; - Way += 0x40000000U; - } - - /* Wait for L1 invalidate to complete */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Invalidate a level 1 Data cache line. If the byte specified by the -* address (Addr) is cached by the Data cache, the cacheline -* containing that byte is invalidated. If the cacheline is modified -* (dirty), the modified contents are lost and are NOT written to -* system memory before the line is invalidated. -* -* @param adr: 32bit address of the data to be invalidated. -* -* @return None. -* -* @note The bottom 5 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L1DCacheInvalidateLine(u32 adr) -{ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - mtcp(XREG_CP15_INVAL_DC_LINE_MVA_POC, (adr & (~0x1FU))); - - /* Wait for L1 invalidate to complete */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Invalidate the level 1 Data cache for the given address range. -* If the bytes specified by the address range are cached by the Data -* cache, the cachelines containing those bytes are invalidated. If the -* cachelines are modified (dirty), the modified contents are lost and -* NOT written to the system memory before the lines are invalidated. -* -* @param adr: 32bit start address of the range to be invalidated. -* @param len: Length of the range to be invalidated in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_L1DCacheInvalidateRange(u32 adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Select cache L0 D-cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0); - - while (LocalAddr < end) { - -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_inval_dc_line_mva_poc(LocalAddr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_INVAL_DC_LINE_MVA_POC); - Reg = LocalAddr; } -#endif - LocalAddr += cacheline; - } - } - - /* Wait for L1 invalidate to complete */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Flush the level 1 Data cache. -* -* @return None. -* -* @note In Cortex A9, there is no cp instruction for flushing -* the whole D-cache. Need to flush each line. -* -****************************************************************************/ -void Xil_L1DCacheFlush(void) -{ - register u32 CsidReg, C7Reg; - u32 CacheSize, LineSize, NumWays; - u32 Way; - u32 WayIndex, Set, SetIndex, NumSet; - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - /* Select cache level 0 and D cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0); - -#ifdef __GNUC__ - CsidReg = mfcp(XREG_CP15_CACHE_SIZE_ID); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_CACHE_SIZE_ID, CsidReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_CACHE_SIZE_ID); - CsidReg = Reg; } -#endif - - /* Determine Cache Size */ - - CacheSize = (CsidReg >> 13U) & 0x1FFU; - CacheSize +=1U; - CacheSize *=128U; /* to get number of bytes */ - - /* Number of Ways */ - NumWays = (CsidReg & 0x3ffU) >> 3U; - NumWays += 1U; - - /* Get the cacheline size, way size, index size from csidr */ - LineSize = (CsidReg & 0x07U) + 4U; - - NumSet = CacheSize/NumWays; - NumSet /= (0x00000001U << LineSize); - - Way = 0U; - Set = 0U; - - /* Invalidate all the cachelines */ - for (WayIndex =0U; WayIndex < NumWays; WayIndex++) { - for (SetIndex =0U; SetIndex < NumSet; SetIndex++) { - C7Reg = Way | Set; - /* Flush by Set/Way */ - -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_clean_inval_dc_line_sw(C7Reg); -#else - { volatile register u32 Reg - __asm(XREG_CP15_CLEAN_INVAL_DC_LINE_SW); - Reg = C7Reg; } -#endif - Set += (0x00000001U << LineSize); - } - Set = 0U; - Way += 0x40000000U; - } - - /* Wait for L1 flush to complete */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Flush a level 1 Data cache line. If the byte specified by the -* address (adr) is cached by the Data cache, the cacheline containing -* that byte is invalidated. If the cacheline is modified (dirty), the -* entire contents of the cacheline are written to system memory -* before the line is invalidated. -* -* @param adr: 32bit address of the data to be flushed. -* -* @return None. -* -* @note The bottom 5 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L1DCacheFlushLine(u32 adr) -{ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - mtcp(XREG_CP15_CLEAN_INVAL_DC_LINE_MVA_POC, (adr & (~0x1FU))); - - /* Wait for L1 flush to complete */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Flush the level 1 Data cache for the given address range. -* If the bytes specified by the address range are cached by the Data -* cache, the cacheline containing those bytes are invalidated. If the -* cachelines are modified (dirty), they are written to system memory -* before the lines are invalidated. -* -* @param adr: 32bit start address of the range to be flushed. -* @param len: Length of the range to be flushed in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_L1DCacheFlushRange(u32 adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Select cache L0 D-cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - - while (LocalAddr < end) { - -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_clean_inval_dc_line_mva_poc(LocalAddr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_CLEAN_INVAL_DC_LINE_MVA_POC); - Reg = LocalAddr; } -#endif - LocalAddr += cacheline; - } - } - - /* Wait for L1 flush to complete */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Store a level 1 Data cache line. If the byte specified by the -* address (adr) is cached by the Data cache and the cacheline is -* modified (dirty), the entire contents of the cacheline are written -* to system memory. After the store completes, the cacheline is -* marked as unmodified (not dirty). -* -* @param adr: Address to be stored. -* -* @return None. -* -* @note The bottom 5 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L1DCacheStoreLine(u32 adr) -{ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 0U); - mtcp(XREG_CP15_CLEAN_DC_LINE_MVA_POC, (adr & (~0x1FU))); - - /* Wait for L1 store to complete */ - dsb(); -} - - -/****************************************************************************/ -/** -* @brief Enable the level 1 instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L1ICacheEnable(void) -{ - register u32 CtrlReg; - - /* enable caches only if they are disabled */ -#ifdef __GNUC__ - CtrlReg = mfcp(XREG_CP15_SYS_CONTROL); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_SYS_CONTROL, CtrlReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_SYS_CONTROL); - CtrlReg = Reg; } -#endif - if ((CtrlReg & (XREG_CP15_CONTROL_I_BIT)) != 0U) { - return; - } - - /* invalidate the instruction cache */ - mtcp(XREG_CP15_INVAL_IC_POU, 0U); - - /* enable the instruction cache */ - CtrlReg |= (XREG_CP15_CONTROL_I_BIT); - - mtcp(XREG_CP15_SYS_CONTROL, CtrlReg); -} - -/****************************************************************************/ -/** -* @brief Disable level 1 the instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L1ICacheDisable(void) -{ - register u32 CtrlReg; - - dsb(); - - /* invalidate the instruction cache */ - mtcp(XREG_CP15_INVAL_IC_POU, 0U); - - /* disable the instruction cache */ -#ifdef __GNUC__ - CtrlReg = mfcp(XREG_CP15_SYS_CONTROL); -#elif defined (__ICCARM__) - mfcp(XREG_CP15_SYS_CONTROL, CtrlReg); -#else - { volatile register u32 Reg __asm(XREG_CP15_SYS_CONTROL); - CtrlReg = Reg; } -#endif - CtrlReg &= ~(XREG_CP15_CONTROL_I_BIT); - - mtcp(XREG_CP15_SYS_CONTROL, CtrlReg); -} - -/****************************************************************************/ -/** -* @brief Invalidate the entire level 1 instruction cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L1ICacheInvalidate(void) -{ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 1U); - /* invalidate the instruction cache */ - mtcp(XREG_CP15_INVAL_IC_POU, 0U); - - /* Wait for L1 invalidate to complete */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Invalidate a level 1 instruction cache line. If the instruction -* specified by the address is cached by the instruction cache, the -* cacheline containing that instruction is invalidated. -* -* @param adr: 32bit address of the instruction to be invalidated. -* -* @return None. -* -* @note The bottom 5 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L1ICacheInvalidateLine(u32 adr) -{ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 1U); - mtcp(XREG_CP15_INVAL_IC_LINE_MVA_POU, (adr & (~0x1FU))); - - /* Wait for L1 invalidate to complete */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Invalidate the level 1 instruction cache for the given address -* range. If the instrucions specified by the address range are cached -* by the instruction cache, the cacheline containing those bytes are -* invalidated. -* -* @param adr: 32bit start address of the range to be invalidated. -* @param len: Length of the range to be invalidated in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_L1ICacheInvalidateRange(u32 adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Select cache L0 I-cache in CSSR */ - mtcp(XREG_CP15_CACHE_SIZE_SEL, 1U); - - while (LocalAddr < end) { - -#if defined (__GNUC__) || defined (__ICCARM__) - asm_cp15_inval_ic_line_mva_pou(LocalAddr); -#else - { volatile register u32 Reg - __asm(XREG_CP15_INVAL_IC_LINE_MVA_POU); - Reg = LocalAddr; } -#endif - LocalAddr += cacheline; - } - } - - /* Wait for L1 invalidate to complete */ - dsb(); - mtcpsr(currmask); -} - -#ifndef USE_AMP -/****************************************************************************/ -/** -* @brief Enable the L2 cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheEnable(void) -{ - register u32 L2CCReg; - - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET); - - /* only enable if L2CC is currently disabled */ - if ((L2CCReg & 0x01U) == 0U) { - /* set up the way size and latencies */ - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + - XPS_L2CC_AUX_CNTRL_OFFSET); - L2CCReg &= XPS_L2CC_AUX_REG_ZERO_MASK; - L2CCReg |= XPS_L2CC_AUX_REG_DEFAULT_MASK; - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_AUX_CNTRL_OFFSET, - L2CCReg); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_TAG_RAM_CNTRL_OFFSET, - XPS_L2CC_TAG_RAM_DEFAULT_MASK); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_DATA_RAM_CNTRL_OFFSET, - XPS_L2CC_DATA_RAM_DEFAULT_MASK); - - /* Clear the pending interrupts */ - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + - XPS_L2CC_ISR_OFFSET); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_IAR_OFFSET, L2CCReg); - - Xil_L2CacheInvalidate(); - /* Enable the L2CC */ - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + - XPS_L2CC_CNTRL_OFFSET); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET, - (L2CCReg | (0x01U))); - - Xil_L2CacheSync(); - /* synchronize the processor */ - dsb(); - - } -} - -/****************************************************************************/ -/** -* @brief Disable the L2 cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheDisable(void) -{ - register u32 L2CCReg; - - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET); - - if((L2CCReg & 0x1U) != 0U) { - - /* Clean and Invalidate L2 Cache */ - Xil_L2CacheFlush(); - - /* Disable the L2CC */ - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET, - (L2CCReg & (~0x01U))); - /* Wait for the cache operations to complete */ - - dsb(); - } -} - -/*****************************************************************************/ -/** -* @brief Invalidate the entire level 2 cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheInvalidate(void) -{ - #ifdef __GNUC__ - u32 stack_start,stack_end,stack_size; - register u32 L2CCReg; - stack_end = (u32)&_stack_end; - stack_start = (u32)&__undef_stack; - stack_size=stack_start-stack_end; - - /* Check for the cache status. If cache is enabled, then only - * flush stack memory to save return address. If cache is disabled, - * don't flush anything as it might result in flushing stale date into - * memory which is undesirable. - */ - L2CCReg = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CNTRL_OFFSET); - if ((L2CCReg & 0x01U) != 0U) { - /*Flush stack memory to save return address*/ - Xil_DCacheFlushRange(stack_end, stack_size); - } - - #endif - u32 ResultDCache; - /* Invalidate the caches */ - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INVLD_WAY_OFFSET, - 0x0000FFFFU); - ResultDCache = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INVLD_WAY_OFFSET) - & 0x0000FFFFU; - while(ResultDCache != (u32)0U) { - ResultDCache = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INVLD_WAY_OFFSET) - & 0x0000FFFFU; - } - - /* Wait for the invalidate to complete */ - Xil_L2CacheSync(); - - /* synchronize the processor */ - dsb(); -} - -/*****************************************************************************/ -/** -* @brief Invalidate a level 2 cache line. If the byte specified by the -* address (adr) is cached by the Data cache, the cacheline containing -* that byte is invalidated. If the cacheline is modified (dirty), -* the modified contents are lost and are NOT written to system memory -* before the line is invalidated. -* -* @param adr: 32bit address of the data/instruction to be invalidated. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L2CacheInvalidateLine(u32 adr) -{ - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INVLD_PA_OFFSET, (u32)adr); - /* synchronize the processor */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Invalidate the level 2 cache for the given address range. -* If the bytes specified by the address range are cached by the L2 -* cache, the cacheline containing those bytes are invalidated. If the -* cachelines are modified (dirty), the modified contents are lost and -* are NOT written to system memory before the lines are invalidated. -* -* @param adr: 32bit start address of the range to be invalidated. -* @param len: Length of the range to be invalidated in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheInvalidateRange(u32 adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - volatile u32 *L2CCOffset = (volatile u32 *)(XPS_L2CC_BASEADDR + - XPS_L2CC_CACHE_INVLD_PA_OFFSET); - - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - - while (LocalAddr < end) { - *L2CCOffset = LocalAddr; - Xil_L2CacheSync(); - LocalAddr += cacheline; - } - - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - } - - /* synchronize the processor */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Flush the entire level 2 cache. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheFlush(void) -{ - u32 ResultL2Cache; - - /* Flush the caches */ - - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INV_CLN_WAY_OFFSET, - 0x0000FFFFU); - ResultL2Cache = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INV_CLN_WAY_OFFSET) - & 0x0000FFFFU; - - while(ResultL2Cache != (u32)0U) { - ResultL2Cache = Xil_In32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INV_CLN_WAY_OFFSET) - & 0x0000FFFFU; - } - - Xil_L2CacheSync(); - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - - /* synchronize the processor */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Flush a level 2 cache line. If the byte specified by the address -* (adr) is cached by the L2 cache, the cacheline containing that -* byte is invalidated. If the cacheline is modified (dirty), the -* entire contents of the cacheline are written to system memory -* before the line is invalidated. -* -* @param adr: 32bit address of the data/instruction to be flushed. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L2CacheFlushLine(u32 adr) -{ -#ifdef CONFIG_PL310_ERRATA_588369 - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_CLEAN_PA_OFFSET, adr); - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INVLD_PA_OFFSET, adr); -#else - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_INV_CLN_PA_OFFSET, adr); -#endif - /* synchronize the processor */ - dsb(); -} - -/****************************************************************************/ -/** -* @brief Flush the level 2 cache for the given address range. -* If the bytes specified by the address range are cached by the L2 -* cache, the cacheline containing those bytes are invalidated. If the -* cachelines are modified (dirty), they are written to the system -* memory before the lines are invalidated. -* -* @param adr: 32bit start address of the range to be flushed. -* @param len: Length of the range to be flushed in bytes. -* -* @return None. -* -****************************************************************************/ -void Xil_L2CacheFlushRange(u32 adr, u32 len) -{ - u32 LocalAddr = adr; - const u32 cacheline = 32U; - u32 end; - volatile u32 *L2CCOffset = (volatile u32 *)(XPS_L2CC_BASEADDR + - XPS_L2CC_CACHE_INV_CLN_PA_OFFSET); - - u32 currmask; - - currmask = mfcpsr(); - mtcpsr(currmask | IRQ_FIQ_MASK); - if (len != 0U) { - /* Back the starting address up to the start of a cache line - * perform cache operations until adr+len - */ - end = LocalAddr + len; - LocalAddr = LocalAddr & ~(cacheline - 1U); - - /* Disable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x3U); - - while (LocalAddr < end) { - *L2CCOffset = LocalAddr; - Xil_L2CacheSync(); - LocalAddr += cacheline; - } - - /* Enable Write-back and line fills */ - Xil_L2WriteDebugCtrl(0x0U); - } - /* synchronize the processor */ - dsb(); - mtcpsr(currmask); -} - -/****************************************************************************/ -/** -* @brief Store a level 2 cache line. If the byte specified by the address -* (adr) is cached by the L2 cache and the cacheline is modified -* (dirty), the entire contents of the cacheline are written to -* system memory. After the store completes, the cacheline is marked -* as unmodified (not dirty). -* -* @param adr: 32bit address of the data/instruction to be stored. -* -* @return None. -* -* @note The bottom 4 bits are set to 0, forced by architecture. -* -****************************************************************************/ -void Xil_L2CacheStoreLine(u32 adr) -{ - Xil_Out32(XPS_L2CC_BASEADDR + XPS_L2CC_CACHE_CLEAN_PA_OFFSET, adr); - /* synchronize the processor */ - dsb(); -} -#endif diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/60f7de585243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/60f7de585243001d18b399c1eb9b3628 deleted file mode 100644 index 684c01f..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/60f7de585243001d18b399c1eb9b3628 +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xpseudo_asm_rvct.h -* -* This header file contains macros for using __inline assembler code. It is -* written specifically for RVCT. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 1.00a sdm  11/18/09 First Release
-* 7.2   asa  04/03/20 Renamed the str macro to strw.
-* 
-* -******************************************************************************/ -/** - *@cond nocomments - */ - -#ifndef XPSEUDO_ASM_RVCT_H /* prevent circular inclusions */ -#define XPSEUDO_ASM_RVCT_H /* by using protection macros */ - -/***************************** Include Files ********************************/ -#include "xil_types.h" -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/************************** Constant Definitions ****************************/ - -/**************************** Type Definitions ******************************/ - -/***************** Macros (Inline Functions) Definitions ********************/ - -/* necessary for pre-processor */ -#define stringify(s) tostring(s) -#define tostring(s) #s - - -#define mtcpsr(v) { volatile register u32 Reg __asm("cpsr");\ - Reg = v; } - -/* general purpose register read/write */ -/*#define mfgpr(rn) ({ unsigned int val; \ - register unsigned int Reg __asm("r" stringify(rn));\ - val = Reg; \ - val;})*/ - -#define mtgpr(rn, v) { volatile register u32 Reg __asm("r" stringify(rn));\ - Reg = v; } - -/* CP15 operations */ -/*#define mfcp(rn) ({ unsigned int val; \ - val = register unsigned int Reg __asm(rn); \ - val;})*/ - -#define mtcp(rn, v) { volatile register u32 Reg __asm(rn); \ - Reg = v; } - -/************************** Variable Definitions ****************************/ - -/************************** Function Prototypes *****************************/ - -__asm void cpsiei(void); - -__asm void cpsidi(void); - -__asm void cpsief(void); - -__asm void cpsidf(void); - -/* memory synchronization operations */ - -/* Instruction Synchronization Barrier */ -__asm void isb(void); - -/* Data Synchronization Barrier */ -__asm void dsb(void); - -/* Data Memory Barrier */ -__asm void dmb(void); - -/* Memory Operations */ -__asm u32 ldr(u32 adr); - -__asm u32 ldrb(u32 adr); - -__asm void strw(u32 adr, u32 val); - -__asm void strb(u32 adr, u32 val); - -/* Count leading zeroes (clz) */ -__asm u32 clz(u32 arg); -__asm u32 mfcpsr(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* XPSEUDO_ASM_RVCT_H */ - -/** - *@endcond - */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/719134595243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/719134595243001d18b399c1eb9b3628 deleted file mode 100644 index 77e1f3d..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/719134595243001d18b399c1eb9b3628 +++ /dev/null @@ -1,74 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_cache_vxworks.h -* -* Contains the cache related functions for VxWorks that is wrapped by -* xil_cache. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date	 Changes
-* ----- ---- -------- -------------------------------------------------------
-* 1.00a hbm  12/11/09 Initial release
-*
-* 
-* -* @note -* -******************************************************************************/ - -/** - *@cond nocomments - */ - -#ifndef XIL_CACHE_VXWORKS_H -#define XIL_CACHE_VXWORKS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vxWorks.h" -#include "vxLib.h" -#include "sysLibExtra.h" -#include "cacheLib.h" - -#if (CPU_FAMILY==PPC) - -#define Xil_DCacheEnable() cacheEnable(DATA_CACHE) - -#define Xil_DCacheDisable() cacheDisable(DATA_CACHE) - -#define Xil_DCacheInvalidateRange(Addr, Len) \ - cacheInvalidate(DATA_CACHE, (void *)(Addr), (Len)) - -#define Xil_DCacheFlushRange(Addr, Len) \ - cacheFlush(DATA_CACHE, (void *)(Addr), (Len)) - -#define Xil_ICacheEnable() cacheEnable(INSTRUCTION_CACHE) - -#define Xil_ICacheDisable() cacheDisable(INSTRUCTION_CACHE) - -#define Xil_ICacheInvalidateRange(Addr, Len) \ - cacheInvalidate(INSTRUCTION_CACHE, (void *)(Addr), (Len)) - - -#else -#error "Unknown processor / architecture. Must be PPC for VxWorks." -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/** - *@endcond - */ \ No newline at end of file diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/802864555243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/802864555243001d18b399c1eb9b3628 deleted file mode 100644 index cb26e19..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/802864555243001d18b399c1eb9b3628 +++ /dev/null @@ -1,175 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2018 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -*******************************************************************************/ - - -#ifndef __XPMC_XIOU_SECURE_SLCR_H__ -#define __XPMC_XIOU_SECURE_SLCR_H__ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - *@cond nocomments - */ - -/** - * XpmcXiouSecureSlcr Base Address - */ -#define XPMC_XIOU_SECURE_SLCR_BASEADDR 0xF1070000UL - -/** - * Register: XpmcXiouSecureSlcrAxiWprtcnSd0 - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0 ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000000UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0_AWPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0_AWPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0_AWPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD0_AWPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrAxiRprtcnSd0 - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0 ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000004UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0_ARPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0_ARPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0_ARPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD0_ARPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrAxiWprtcnSd1 - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1 ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000010UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1_AWPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1_AWPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1_AWPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_SD1_AWPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrAxiRprtcnSd1 - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1 ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000014UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1_ARPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1_ARPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1_ARPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_RPRTCN_SD1_ARPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrAxiWprtcnQspi - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000020UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI_XQSPIPSAXI_AWPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI_XQSPIPSAXI_AWPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI_XQSPIPSAXI_AWPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_QSPI_XQSPIPSAXI_AWPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrAxiWprtcnOspi - */ -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000030UL ) -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI_AWPROT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI_AWPROT_WIDTH 3UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI_AWPROT_MASK 0x00000007UL -#define XPMC_XIOU_SECURE_SLCR_AXI_WPRTCN_OSPI_AWPROT_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrCtrl - */ -#define XPMC_XIOU_SECURE_SLCR_CTRL ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000040UL ) -#define XPMC_XIOU_SECURE_SLCR_CTRL_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_CTRL_SLVERR_EN_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_CTRL_SLVERR_EN_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_CTRL_SLVERR_EN_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_CTRL_SLVERR_EN_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrIsr - */ -#define XPMC_XIOU_SECURE_SLCR_ISR ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000044UL ) -#define XPMC_XIOU_SECURE_SLCR_ISR_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_ISR_ADDR_DECODE_ERR_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_ISR_ADDR_DECODE_ERR_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_ISR_ADDR_DECODE_ERR_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_ISR_ADDR_DECODE_ERR_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrImr - */ -#define XPMC_XIOU_SECURE_SLCR_IMR ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000048UL ) -#define XPMC_XIOU_SECURE_SLCR_IMR_RSTVAL 0x00000001UL - -#define XPMC_XIOU_SECURE_SLCR_IMR_ADDR_DECODE_ERR_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_IMR_ADDR_DECODE_ERR_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_IMR_ADDR_DECODE_ERR_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_IMR_ADDR_DECODE_ERR_DEFVAL 0x1UL - -/** - * Register: XpmcXiouSecureSlcrIer - */ -#define XPMC_XIOU_SECURE_SLCR_IER ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x0000004CUL ) -#define XPMC_XIOU_SECURE_SLCR_IER_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_IER_ADDR_DECODE_ERR_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_IER_ADDR_DECODE_ERR_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_IER_ADDR_DECODE_ERR_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_IER_ADDR_DECODE_ERR_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrIdr - */ -#define XPMC_XIOU_SECURE_SLCR_IDR ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000050UL ) -#define XPMC_XIOU_SECURE_SLCR_IDR_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_IDR_ADDR_DECODE_ERR_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_IDR_ADDR_DECODE_ERR_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_IDR_ADDR_DECODE_ERR_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_IDR_ADDR_DECODE_ERR_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrItr - */ -#define XPMC_XIOU_SECURE_SLCR_ITR ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x00000054UL ) -#define XPMC_XIOU_SECURE_SLCR_ITR_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_ITR_ADDR_DECODE_ERR_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_ITR_ADDR_DECODE_ERR_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_ITR_ADDR_DECODE_ERR_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_ITR_ADDR_DECODE_ERR_DEFVAL 0x0UL - -/** - * Register: XpmcXiouSecureSlcrTzprot - */ -#define XPMC_XIOU_SECURE_SLCR_TZPROT ( ( XPMC_XIOU_SECURE_SLCR_BASEADDR ) + 0x0000006CUL ) -#define XPMC_XIOU_SECURE_SLCR_TZPROT_RSTVAL 0x00000000UL - -#define XPMC_XIOU_SECURE_SLCR_TZPROT_ACT_SHIFT 0UL -#define XPMC_XIOU_SECURE_SLCR_TZPROT_ACT_WIDTH 1UL -#define XPMC_XIOU_SECURE_SLCR_TZPROT_ACT_MASK 0x00000001UL -#define XPMC_XIOU_SECURE_SLCR_TZPROT_ACT_DEFVAL 0x0UL - -/** - *@endcond - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __XPMC_XIOU_SECURE_SLCR_H__ */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/82fd67595243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/82fd67595243001d18b399c1eb9b3628 deleted file mode 100644 index 6f419fb..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/82fd67595243001d18b399c1eb9b3628 +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2008 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ -/****************************************************************************** -* -* microblaze_invalidate_dcache() -* -* Invalidate the entire L1 DCache -* -* -*******************************************************************************/ - -#include "xparameters.h" -#include "microblaze_instructions.h" - -#define MICROBLAZE_MSR_DCACHE_ENABLE 0x00000080 -#define MICROBLAZE_MSR_INTR_ENABLE 0x00000002 - -#ifndef XPAR_MICROBLAZE_DCACHE_LINE_LEN -#define XPAR_MICROBLAZE_DCACHE_LINE_LEN 1 -#endif - -#ifndef XPAR_MICROBLAZE_DCACHE_USE_WRITEBACK -#define MB_VERSION_LT_v720 -#endif - - .text - .globl microblaze_invalidate_dcache - .ent microblaze_invalidate_dcache - .align 2 - -microblaze_invalidate_dcache: -#if (XPAR_MICROBLAZE_USE_DCACHE==1) && (XPAR_MICROBLAZE_ALLOW_DCACHE_WR==1) - -#ifdef MB_VERSION_LT_v720 /* Disable Dcache and interrupts before invalidating */ - mfs r9, rmsr - andi r10, r9, ~(MICROBLAZE_MSR_DCACHE_ENABLE | MICROBLAZE_MSR_INTR_ENABLE) - mts rmsr, r10 -#endif - ADDIK r5, r0, XPAR_MICROBLAZE_DCACHE_BASEADDR & (-(4 * XPAR_MICROBLAZE_DCACHE_LINE_LEN)) - ADDIK r6, r5, XPAR_MICROBLAZE_DCACHE_BYTE_SIZE & (-(4 * XPAR_MICROBLAZE_DCACHE_LINE_LEN)) /* Compute end */ - -L_start: - wdc r5, r0 /* Invalidate the Cache */ - - CMPU r18, r5, r6 /* Are we at the end? */ - BLEI r18, L_done - -#if defined (__arch64__ ) - addlik r5, r5, (XPAR_MICROBLAZE_DCACHE_LINE_LEN * 4) /* Increment the address by 4 */ - breai L_start -#else - brid L_start /* Branch to the beginning of the loop */ - addik r5, r5, (XPAR_MICROBLAZE_DCACHE_LINE_LEN * 4) /* Increment the address by 4 (delay slot) */ -#endif -L_done: - rtsd r15, 8 /* Return */ -#ifdef MB_VERSION_LT_v720 /* restore MSR only for MB version < v7.20 */ - mts rmsr, r9 -#else - nop -#endif - -#else - rtsd r15, 8 /* Return */ - nop -#endif - .end microblaze_invalidate_dcache diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/9236e2595243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/9236e2595243001d18b399c1eb9b3628 deleted file mode 100644 index e06988a..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/9236e2595243001d18b399c1eb9b3628 +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2011 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xadcps_sinit.c -* @addtogroup xadcps_v2_6 -* @{ -* -* This file contains the implementation of the XAdcPs driver's static -* initialization functionality. -* -* @note None. -* -*
-*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date     Changes
-* ----- -----  -------- -----------------------------------------------------
-* 1.00a ssb    12/22/11 First release based on the XPS/AXI XADC driver
-* 2.6   aad    11/02/20 Fix MISRAC Mandatory and Advisory errors.
-*
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xparameters.h" -#include "xadcps.h" - -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ -extern XAdcPs_Config XAdcPs_ConfigTable[]; - -/*****************************************************************************/ -/** -* -* This function looks up the device configuration based on the unique device ID. -* The table XAdcPs_ConfigTable contains the configuration info for each device -* in the system. -* -* @param DeviceId contains the ID of the device for which the -* device configuration pointer is to be returned. -* -* @return -* - A pointer to the configuration found. -* - NULL if the specified device ID was not found. -* -* @note None. -* -******************************************************************************/ -XAdcPs_Config *XAdcPs_LookupConfig(u16 DeviceId) -{ - XAdcPs_Config *CfgPtr = NULL; - u32 Index; - - for (Index = 0U; Index < 1U; Index++) { - if (XAdcPs_ConfigTable[Index].DeviceId == DeviceId) { - CfgPtr = &XAdcPs_ConfigTable[Index]; - break; - } - } - - return CfgPtr; -} -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/b0c8d1535243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/b0c8d1535243001d18b399c1eb9b3628 deleted file mode 100644 index e79ba0d..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/b0c8d1535243001d18b399c1eb9b3628 +++ /dev/null @@ -1,788 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xqspips.h -* @addtogroup qspips_v3_9 -* @{ -* @details -* -* This file contains the implementation of the XQspiPs driver. It supports only -* master mode. User documentation for the driver functions is contained in this -* file in the form of comment blocks at the front of each function. -* -* A QSPI device connects to an QSPI bus through a 4-wire serial interface. -* The QSPI bus is a full-duplex, synchronous bus that facilitates communication -* between one master and one slave. The device is always full-duplex, -* which means that for every byte sent, one is received, and vice-versa. -* The master controls the clock, so it can regulate when it wants to -* send or receive data. The slave is under control of the master, it must -* respond quickly since it has no control of the clock and must send/receive -* data as fast or as slow as the master does. -* -* Linear Mode -* The Linear Quad-SPI Controller extends the existing Quad-SPI Controller�s -* functionality by adding a linear addressing scheme that allows the SPI flash -* memory subsystem to behave like a typical ROM device. The new feature hides -* the normal SPI protocol from a master reading from the SPI flash memory. The -* feature improves both the user friendliness and the overall read memory -* throughput over that of the current Quad-SPI Controller by lessening the -* amount of software overheads required and by the use of the faster AXI -* interface. -* -* Initialization & Configuration -* -* The XQspiPs_Config structure is used by the driver to configure itself. This -* configuration structure is typically created by the tool-chain based on HW -* build properties. -* -* To support multiple runtime loading and initialization strategies employed by -* various operating systems, the driver instance can be initialized in the -* following way: -* - XQspiPs_LookupConfig(DeviceId) - Use the device identifier to find -* static configuration structure defined in xqspips_g.c. This is setup -* by the tools. For some operating systems the config structure will be -* initialized by the software and this call is not needed. -* - XQspiPs_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a -* configuration structure provided by the caller. If running in a system -* with address translation, the provided virtual memory base address -* replaces the physical address present in the configuration structure. -* -* Multiple Masters -* -* More than one master can exist, but arbitration is the responsibility of -* the higher layer software. The device driver does not perform any type of -* arbitration. -* -* Modes of Operation -* -* There are four modes to perform a data transfer and the selection of a mode -* is based on Chip Select(CS) and Start. These two options individually, can -* be controlled either by software(Manual) or hardware(Auto). -* - Auto CS: Chip select is automatically asserted as soon as the first word -* is written into the TXFIFO and de asserted when the TXFIFO becomes -* empty -* - Manual CS: Software must assert and de assert CS. -* - Auto Start: Data transmission starts as soon as there is data in the -* TXFIFO and stalls when the TXFIFO is empty -* - Manual Start: Software must start data transmission at the beginning of -* the transaction or whenever the TXFIFO has become empty -* -* The preferred combination is Manual CS and Auto Start. -* In this combination, the software asserts CS before loading any data into -* TXFIFO. In Auto Start mode, whenever data is in TXFIFO, controller sends it -* out until TXFIFO becomes empty. The software reads the RXFIFO whenever the -* data is available. If no further data, software disables CS. -* -* Risks/challenges of other combinations: -* - Manual CS and Manual Start: Manual Start bit should be set after each -* TXFIFO write otherwise there could be a race condition where the TXFIFO -* becomes empty before the new word is written. In that case the -* transmission stops. -* - Auto CS with Manual or Auto Start: It is very difficult for software to -* keep the TXFIFO filled. Whenever the TXFIFO runs empty, CS is de asserted. -* This results in a single transaction to be split into multiple pieces each -* with its own chip select. This will result in garbage data to be sent. -* -* Interrupts -* -* The user must connect the interrupt handler of the driver, -* XQspiPs_InterruptHandler, to an interrupt system such that it will be -* called when an interrupt occurs. This function does not save and restore -* the processor context such that the user must provide this processing. -* -* The driver handles the following interrupts: -* - Data Transmit Register/FIFO Underflow -* - Data Receive Register/FIFO Not Empty -* - Data Transmit Register/FIFO Overwater -* - Data Receive Register/FIFO Overrun -* -* The Data Transmit Register/FIFO Overwater interrupt -- indicates that the -* QSPI device has transmitted the data available to transmit, and now its data -* register and FIFO is ready to accept more data. The driver uses this -* interrupt to indicate progress while sending data. The driver may have -* more data to send, in which case the data transmit register and FIFO is -* filled for subsequent transmission. When this interrupt arrives and all -* the data has been sent, the driver invokes the status callback with a -* value of XST_SPI_TRANSFER_DONE to inform the upper layer software that -* all data has been sent. -* -* The Data Transmit Register/FIFO Underflow interrupt -- indicates that, -* as slave, the QSPI device was required to transmit but there was no data -* available to transmit in the transmit register (or FIFO). This may not -* be an error if the master is not expecting data. But in the case where -* the master is expecting data, this serves as a notification of such a -* condition. The driver reports this condition to the upper layer -* software through the status handler. -* -* The Data Receive Register/FIFO Overrun interrupt -- indicates that the QSPI -* device received data and subsequently dropped the data because the data -* receive register and FIFO was full. The driver reports this condition to the -* upper layer software through the status handler. This likely indicates a -* problem with the higher layer protocol, or a problem with the slave -* performance. -* -* -* Polled Operation -* -* Transfer in polled mode is supported through a separate interface function -* XQspiPs_PolledTransfer(). Unlike the transfer function in the interrupt mode, -* this function blocks until all data has been sent/received. -* -* Device Busy -* -* Some operations are disallowed when the device is busy. The driver tracks -* whether a device is busy. The device is considered busy when a data transfer -* request is outstanding, and is considered not busy only when that transfer -* completes (or is aborted with a mode fault error). -* -* Device Configuration -* -* The device can be configured in various ways during the FPGA implementation -* process. Configuration parameters are stored in the xqspips_g.c file or -* passed in via XQspiPs_CfgInitialize(). A table is defined where each entry -* contains configuration information for an QSPI device, including the base -* address for the device. -* -* RTOS Independence -* -* This driver is intended to be RTOS and processor independent. It works with -* physical addresses only. Any needs for dynamic memory management, threads or -* thread mutual exclusion, virtual memory, or cache control must be satisfied -* by the layer above this driver. -* -* NOTE: This driver was always tested with endianness set to little-endian. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- -----------------------------------------------
-* 1.00a sdm 11/25/10 First release, based on the PS SPI driver...
-* 1.01a sdm 11/22/11 Added TCL file for generating QSPI parameters
-*		     in xparameters.h
-* 2.00a kka 07/25/12 Added a few register defines for CR 670297
-* 		     Removed code related to mode fault for CR 671468
-*		     The XQspiPs_SetSlaveSelect has been modified to remove
-*		     the argument of the slave select as the QSPI controller
-*		     only supports one slave.
-* 		     XQspiPs_GetSlaveSelect API has been removed
-* 		     Added a flag ShiftReadData to the instance structure
-*.		     and is used in the XQspiPs_GetReadData API.
-*		     The ShiftReadData Flag indicates whether the data
-*		     read from the Rx FIFO needs to be shifted
-*		     in cases where the data is less than 4  bytes
-* 		     Removed the selection for the following options:
-*		     Master mode (XQSPIPS_MASTER_OPTION) and
-*		     Flash interface mode (XQSPIPS_FLASH_MODE_OPTION) option
-*		     as the QSPI driver supports the Master mode
-*		     and Flash Interface mode and doesnot support
-*		     Slave mode or the legacy mode.
-*		     Modified the XQspiPs_PolledTransfer and XQspiPs_Transfer
-*		     APIs so that the last argument (IsInst) specifying whether
-*		     it is instruction or data has been removed. The first byte
-*		     in the SendBufPtr argument of these APIs specify the
-*		     instruction to be sent to the Flash Device.
-*		     This version of the driver fixes CRs 670197/663787/
-*		     670297/671468.
-* 		     Added the option for setting the Holdb_dr bit in the
-*		     configuration options, XQSPIPS_HOLD_B_DRIVE_OPTION
-*		     is the option to be used for setting this bit in the
-*		     configuration register.
-*		     The XQspiPs_PolledTransfer function has been updated
-*		     to fill the data to fifo depth.
-* 2.01a sg  02/03/13 Added flash opcodes for DUAL_IO_READ,QUAD_IO_READ.
-*		     Added macros for Set/Get Rx Watermark. Changed QSPI
-*		     Enable/Disable macro argument from BaseAddress to
-*		     Instance Pointer. Added DelayNss argument to SetDelays
-*		     and GetDelays API's.
-*		     Created macros XQspiPs_IsManualStart and
-*		     XQspiPs_IsManualChipSelect.
-*		     Changed QSPI transfer logic for polled and interrupt
-*		     modes to be based on filled tx fifo count and receive
-*		     based on it. RXNEMPTY interrupt is not used.
-*		     Added assertions to XQspiPs_LqspiRead function.
-*		     SetDelays and GetDelays API's include DelayNss parameter.
-*		     Added defines for DelayNss,Rx Watermark,Interrupts
-*		     which need write to clear. Removed Read zeros mask from
-*		     LQSPI Config register. Renamed Fixed burst error to
-*		     data FSM error in  LQSPI Status register.
-*
-* 2.02a hk  05/07/13 Added ConnectionMode to config structure.
-*			 Corresponds to C_QSPI_MODE - 0:Single, 1:Stacked, 2:Parallel
-*			 Added enable and disable to the XQspiPs_LqspiRead() function
-*			 Removed XQspi_Reset() in Set_Options() function when
-*			 LQSPI_MODE_OPTION is set.
-*            Added instructions for bank selection, die erase and
-*            flag status register to the flash instruction table
-*            Handling for instructions not in flash instruction
-*			 table added. Checking for Tx FIFO empty when switching from
-*			 TXD1/2/3 to TXD0 added. If WRSR instruction is sent with
-*            byte count 3 (spansion), instruction size and TXD register
-*			 changed accordingly. CR# 712502 and 703869.
-*            Added prefix to constant definitions for ConnectionMode
-*            Added (\#ifdef linear base address) in the Linear read function.
-*            Changed  XPAR_XQSPIPS_0_LINEAR_BASEADDR to
-*            XPAR_PS7_QSPI_LINEAR_0_S_AXI_BASEADDR in
-*            XQspiPs_LqspiRead function. Fix for CR#718141.
-*
-* 2.03a hk  09/17/13 Modified polled and interrupt transfers to make use of
-*                    thresholds. This is to improve performance.
-*                    Added API's for QSPI reset and
-*                    linear mode initialization for boot.
-*                    Added RX and TX threshold reset to one in XQspiPs_Abort.
-*                    Added RX threshold reset(1) after transfer in polled and
-*                    interrupt transfers. Made changes to make sure threshold
-*                    change is done only when no transfer is in progress.
-*                    Updated linear init API for parallel and stacked modes.
-*                    CR#737760.
-* 3.1   hk  08/13/14 When writing to the configuration register, set/reset
-*                    required bits leaving reserved bits untouched. CR# 796813.
-* 3.2	sk	02/05/15 Add SLCR reset in abort function as a workaround because
-* 					 controller does not update FIFO status flags as expected
-* 					 when thresholds are used.
-* 3.3   sk  11/07/15 Modified the API prototypes according to MISRAC standards
-*                    to remove compilation warnings. CR# 868893.
-*       ms  03/17/17 Added readme.txt file in examples folder for doxygen
-*                    generation.
-*       ms  04/05/17 Modified Comment lines in functions of qspips
-*                    examples to recognize it as documentation block
-*                    and modified filename tag in
-*                    xqspips_dual_flash_stack_lqspi_example.c to include it in
-*                    doxygen examples.
-* 3.4   nsk 31/07/17 Added QSPI_BUS_WIDTH parameter in xparameters.h file
-* 3.5	tjs 08/21/18 Fixed compilation warnings for the ARMCC.
-* 3.5	tjs 07/16/18 Added support for low density ISSI flash parts.
-* 3.6   akm 03/28/19 Fixed memory leak issue while reading from qspi.(CR#1016357)
-* 3.6   akm 04/15/19 Modified FlashQuadEnable, FlashWrie and FlashErase APIs,
-*                    to wait for the on going operation to complete before
-*                    performing the next operation.
-* 3.6   akm 04/15/19 Modified the mask in XQspiPs_GetReadData() API to retrieve
-*                    configuration register values of both the Flashes in dual
-*                    parellel connection.
-* 3.7	akm 11/19/19 Fixed Coverity unused value warning in XQspiPs_PolledTransfer()
-* 			and XQspiPs_Transfer() APIs.
-* 3.7	akm 03/19/20 Modified XQspiPs_PolledTransfer(), XQspiPs_Transfer() and
-*			XQspiPs_InterruptHandler() APIs to fill TX FIFO with valid
-*			data when RX buffer is not NULL.
-* 3.8	akm 09/02/20 Updated the Makefile to support parallel make execution.
-*
-* 
-* -******************************************************************************/ -#ifndef XQSPIPS_H /* prevent circular inclusions */ -#define XQSPIPS_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xstatus.h" -#include "xqspips_hw.h" -#include - -/************************** Constant Definitions *****************************/ - -/** @name Configuration options - * - * The following options are supported to enable/disable certain features of - * an QSPI device. Each of the options is a bit mask, so more than one may be - * specified. - * - * - * The Active Low Clock option configures the device's clock polarity. - * Setting this option means the clock is active low and the SCK signal idles - * high. By default, the clock is active high and SCK idles low. - * - * The Clock Phase option configures the QSPI device for one of two - * transfer formats. A clock phase of 0, the default, means data is valid on - * the first SCK edge (rising or falling) after the slave select (SS) signal - * has been asserted. A clock phase of 1 means data is valid on the second SCK - * edge (rising or falling) after SS has been asserted. - * - * - * The QSPI Force Slave Select option is used to enable manual control of - * the slave select signal. - * 0: The SPI_SS signal is controlled by the QSPI controller during - * transfers. (Default) - * 1: The SPI_SS signal is forced active (driven low) regardless of any - * transfers in progress. - * - * NOTE: The driver will handle setting and clearing the Slave Select when - * the user sets the "FORCE_SSELECT_OPTION". Using this option will allow the - * QSPI clock to be set to a faster speed. If the QSPI clock is too fast, the - * processor cannot empty and refill the FIFOs before the TX FIFO is empty - * When the QSPI hardware is controlling the Slave Select signals, this - * will cause slave to be de-selected and terminate the transfer. - * - * The Manual Start option is used to enable manual control of - * the Start command to perform data transfer. - * 0: The Start command is controlled by the QSPI controller during - * transfers(Default). Data transmission starts as soon as there is data in - * the TXFIFO and stalls when the TXFIFO is empty - * 1: The Start command must be issued by software to perform data transfer. - * Bit 15 of Configuration register is used to issue Start command. This bit - * must be set whenever TXFIFO is filled with new data. - * - * NOTE: The driver will set the Manual Start Enable bit in Configuration - * Register, if Manual Start option is selected. Software will issue - * Manual Start command whenever TXFIFO is filled with data. When there is - * no further data, driver will clear the Manual Start Enable bit. - * - * @{ - */ -#define XQSPIPS_CLK_ACTIVE_LOW_OPTION 0x2 /**< Active Low Clock option */ -#define XQSPIPS_CLK_PHASE_1_OPTION 0x4 /**< Clock Phase one option */ -#define XQSPIPS_FORCE_SSELECT_OPTION 0x10 /**< Force Slave Select */ -#define XQSPIPS_MANUAL_START_OPTION 0x20 /**< Manual Start enable */ -#define XQSPIPS_LQSPI_MODE_OPTION 0x80 /**< Linear QPSI mode */ -#define XQSPIPS_HOLD_B_DRIVE_OPTION 0x100 /**< Drive HOLD_B Pin */ -/*@}*/ - - -/** @name QSPI Clock Prescaler options - * The QSPI Clock Prescaler Configuration bits are used to program master mode - * bit rate. The bit rate can be programmed in divide-by-two decrements from - * pclk/2 to pclk/256. - * - * @{ - */ -#define XQSPIPS_CLK_PRESCALE_2 0x00 /**< PCLK/2 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_4 0x01 /**< PCLK/4 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_8 0x02 /**< PCLK/8 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_16 0x03 /**< PCLK/16 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_32 0x04 /**< PCLK/32 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_64 0x05 /**< PCLK/64 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_128 0x06 /**< PCLK/128 Prescaler */ -#define XQSPIPS_CLK_PRESCALE_256 0x07 /**< PCLK/256 Prescaler */ - -/*@}*/ - - -/** @name Callback events - * - * These constants specify the handler events that are passed to - * a handler from the driver. These constants are not bit masks such that - * only one will be passed at a time to the handler. - * - * @{ - */ -#define XQSPIPS_EVENT_TRANSFER_DONE 2 /**< Transfer done */ -#define XQSPIPS_EVENT_TRANSMIT_UNDERRUN 3 /**< TX FIFO empty */ -#define XQSPIPS_EVENT_RECEIVE_OVERRUN 4 /**< Receive data loss because - * RX FIFO full - */ -/*@}*/ - -/** @name Flash commands - * - * The following constants define most of the commands supported by flash - * devices. Users can add more commands supported by the flash devices - * - * @{ - */ -#define XQSPIPS_FLASH_OPCODE_WRSR 0x01 /* Write status register */ -#define XQSPIPS_FLASH_OPCODE_PP 0x02 /* Page program */ -#define XQSPIPS_FLASH_OPCODE_NORM_READ 0x03 /* Normal read data bytes */ -#define XQSPIPS_FLASH_OPCODE_WRDS 0x04 /* Write disable */ -#define XQSPIPS_FLASH_OPCODE_RDSR1 0x05 /* Read status register 1 */ -#define XQSPIPS_FLASH_OPCODE_WREN 0x06 /* Write enable */ -#define XQSPIPS_FLASH_OPCODE_FAST_READ 0x0B /* Fast read data bytes */ -#define XQSPIPS_FLASH_OPCODE_BE_4K 0x20 /* Erase 4KiB block */ -#define XQSPIPS_FLASH_OPCODE_RDSR2 0x35 /* Read status register 2 */ -#define XQSPIPS_FLASH_OPCODE_DUAL_READ 0x3B /* Dual read data bytes */ -#define XQSPIPS_FLASH_OPCODE_BE_32K 0x52 /* Erase 32KiB block */ -#define XQSPIPS_FLASH_OPCODE_QUAD_READ 0x6B /* Quad read data bytes */ -#define XQSPIPS_FLASH_OPCODE_ERASE_SUS 0x75 /* Erase suspend */ -#define XQSPIPS_FLASH_OPCODE_ERASE_RES 0x7A /* Erase resume */ -#define XQSPIPS_FLASH_OPCODE_RDID 0x9F /* Read JEDEC ID */ -#define XQSPIPS_FLASH_OPCODE_BE 0xC7 /* Erase whole flash block */ -#define XQSPIPS_FLASH_OPCODE_SE 0xD8 /* Sector erase (usually 64KB)*/ -#define XQSPIPS_FLASH_OPCODE_DUAL_IO_READ 0xBB /* Read data using Dual I/O */ -#define XQSPIPS_FLASH_OPCODE_QUAD_IO_READ 0xEB /* Read data using Quad I/O */ -#define XQSPIPS_FLASH_OPCODE_BRWR 0x17 /* Bank Register Write */ -#define XQSPIPS_FLASH_OPCODE_BRRD 0x16 /* Bank Register Read */ -/* Extende Address Register Write - Micron's equivalent of Bank Register */ -#define XQSPIPS_FLASH_OPCODE_EARWR 0xC5 -/* Extende Address Register Read - Micron's equivalent of Bank Register */ -#define XQSPIPS_FLASH_OPCODE_EARRD 0xC8 -#define XQSPIPS_FLASH_OPCODE_DIE_ERASE 0xC4 -#define XQSPIPS_FLASH_OPCODE_READ_FLAG_SR 0x70 -#define XQSPIPS_FLASH_OPCODE_CLEAR_FLAG_SR 0x50 -#define XQSPIPS_FLASH_OPCODE_READ_LOCK_REG 0xE8 /* Lock Reg Read */ -#define XQSPIPS_FLASH_OPCODE_WRITE_LOCK_REG 0xE5 /* Lock Reg Write */ - -/*@}*/ - -/** @name Instruction size - * - * The following constants define numbers 1 to 4. - * Used to identify whether TXD0,1,2 or 3 is to be used. - * - * @{ - */ -#define XQSPIPS_SIZE_ONE 1 -#define XQSPIPS_SIZE_TWO 2 -#define XQSPIPS_SIZE_THREE 3 -#define XQSPIPS_SIZE_FOUR 4 - -/*@}*/ - -/** @name ConnectionMode - * - * The following constants are the possible values of ConnectionMode in - * Config structure. - * - * @{ - */ -#define XQSPIPS_CONNECTION_MODE_SINGLE 0 -#define XQSPIPS_CONNECTION_MODE_STACKED 1 -#define XQSPIPS_CONNECTION_MODE_PARALLEL 2 - -/*@}*/ - -/** @name FIFO threshold value - * - * This is the Rx FIFO threshold (in words) that was found to be most - * optimal in terms of performance - * - * @{ - */ -#define XQSPIPS_RXFIFO_THRESHOLD_OPT 32 - -/*@}*/ - -/**************************** Type Definitions *******************************/ -/** - * The handler data type allows the user to define a callback function to - * handle the asynchronous processing for the QSPI device. The application - * using this driver is expected to define a handler of this type to support - * interrupt driven mode. The handler executes in an interrupt context, so - * only minimal processing should be performed. - * - * @param CallBackRef is the callback reference passed in by the upper - * layer when setting the callback functions, and passed back to - * the upper layer when the callback is invoked. Its type is - * not important to the driver, so it is a void pointer. - * @param StatusEvent holds one or more status events that have occurred. - * See the XQspiPs_SetStatusHandler() for details on the status - * events that can be passed in the callback. - * @param ByteCount indicates how many bytes of data were successfully - * transferred. This may be less than the number of bytes - * requested if the status event indicates an error. - */ -typedef void (*XQspiPs_StatusHandler) (void *CallBackRef, u32 StatusEvent, - unsigned ByteCount); - -/** - * This typedef contains configuration information for the device. - */ -typedef struct { - u16 DeviceId; /**< Unique ID of device */ - u32 BaseAddress; /**< Base address of the device */ - u32 InputClockHz; /**< Input clock frequency */ - u8 ConnectionMode; /**< Single, Stacked and Parallel mode */ -} XQspiPs_Config; - -/** - * The XQspiPs driver instance data. The user is required to allocate a - * variable of this type for every QSPI device in the system. A pointer - * to a variable of this type is then passed to the driver API functions. - */ -typedef struct { - XQspiPs_Config Config; /**< Configuration structure */ - u32 IsReady; /**< Device is initialized and ready */ - - u8 *SendBufferPtr; /**< Buffer to send (state) */ - u8 *RecvBufferPtr; /**< Buffer to receive (state) */ - int RequestedBytes; /**< Number of bytes to transfer (state) */ - int RemainingBytes; /**< Number of bytes left to transfer(state) */ - u32 IsBusy; /**< A transfer is in progress (state) */ - XQspiPs_StatusHandler StatusHandler; - void *StatusRef; /**< Callback reference for status handler */ - u32 ShiftReadData; /**< Flag to indicate whether the data - * read from the Rx FIFO needs to be shifted - * in cases where the data is less than 4 - * bytes - */ -} XQspiPs; - -/***************** Macros (Inline Functions) Definitions *********************/ - -/****************************************************************************/ -/* -* -* Check in OptionsTable if Manual Start Option is enabled or disabled. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return -* - TRUE if option is set -* - FALSE if option is not set -* -* @note C-Style signature: -* u8 XQspiPs_IsManualStart(XQspiPs *InstancePtr); -* -*****************************************************************************/ -#define XQspiPs_IsManualStart(InstancePtr) \ - ((XQspiPs_GetOptions(InstancePtr) & \ - XQSPIPS_MANUAL_START_OPTION) ? TRUE : FALSE) - -/****************************************************************************/ -/* -* -* Check in OptionsTable if Manual Chip Select Option is enabled or disabled. -* -* @param InstancePtr is a pointer to the XSpiPs instance. -* -* @return -* - TRUE if option is set -* - FALSE if option is not set -* -* @note C-Style signature: -* u8 XQspiPs_IsManualChipSelect(XQspiPs *InstancePtr); -* -*****************************************************************************/ -#define XQspiPs_IsManualChipSelect(InstancePtr) \ - ((XQspiPs_GetOptions(InstancePtr) & \ - XQSPIPS_FORCE_SSELECT_OPTION) ? TRUE : FALSE) - -/****************************************************************************/ -/** -* -* Set the contents of the slave idle count register. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param RegisterValue is the value to be written, valid values are -* 0-255. -* -* @return None -* -* @note C-Style signature: -* void XQspiPs_SetSlaveIdle(XQspiPs *InstancePtr, -* u32 RegisterValue) -* -*****************************************************************************/ -#define XQspiPs_SetSlaveIdle(InstancePtr, RegisterValue) \ - XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + \ - XQSPIPS_SICR_OFFSET, (RegisterValue)) - -/****************************************************************************/ -/** -* -* Get the contents of the slave idle count register. Use the XQSPIPS_SICR_* -* constants defined in xqspips_hw.h to interpret the bit-mask returned. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return An 8-bit value representing Slave Idle Count. -* -* @note C-Style signature: -* u32 XQspiPs_GetSlaveIdle(XQspiPs *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_GetSlaveIdle(InstancePtr) \ - XQspiPs_In32(((InstancePtr)->Config.BaseAddress) + \ - XQSPIPS_SICR_OFFSET) - -/****************************************************************************/ -/** -* -* Set the contents of the transmit FIFO watermark register. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param RegisterValue is the value to be written, valid values are 1-63. -* -* @return None. -* -* @note C-Style signature: -* void XQspiPs_SetTXWatermark(XQspiPs *InstancePtr, -* u32 RegisterValue) -* -*****************************************************************************/ -#define XQspiPs_SetTXWatermark(InstancePtr, RegisterValue) \ - XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + \ - XQSPIPS_TXWR_OFFSET, (RegisterValue)) - -/****************************************************************************/ -/** -* -* Get the contents of the transmit FIFO watermark register. -* Valid values are in the range 1-63. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return A 6-bit value representing Tx Watermark level. -* -* @note C-Style signature: -* u32 XQspiPs_GetTXWatermark(XQspiPs *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_GetTXWatermark(InstancePtr) \ - XQspiPs_In32((InstancePtr->Config.BaseAddress) + XQSPIPS_TXWR_OFFSET) - -/****************************************************************************/ -/** -* -* Set the contents of the receive FIFO watermark register. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param RegisterValue is the value to be written, valid values are 1-63. -* -* @return None. -* -* @note C-Style signature: -* void XQspiPs_SetRXWatermark(XQspiPs *InstancePtr, -* u32 RegisterValue) -* -*****************************************************************************/ -#define XQspiPs_SetRXWatermark(InstancePtr, RegisterValue) \ - XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + \ - XQSPIPS_RXWR_OFFSET, (RegisterValue)) - -/****************************************************************************/ -/** -* -* Get the contents of the receive FIFO watermark register. -* Valid values are in the range 1-63. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return A 6-bit value representing Rx Watermark level. -* -* @note C-Style signature: -* u32 XQspiPs_GetRXWatermark(XQspiPs *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_GetRXWatermark(InstancePtr) \ - XQspiPs_In32((InstancePtr->Config.BaseAddress) + XQSPIPS_RXWR_OFFSET) - -/****************************************************************************/ -/** -* -* Enable the device and uninhibit master transactions. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return None. -* -* @note C-Style signature: -* void XQspiPs_Enable(XQspiPs *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_Enable(InstancePtr) \ - XQspiPs_Out32((InstancePtr->Config.BaseAddress) + XQSPIPS_ER_OFFSET, \ - XQSPIPS_ER_ENABLE_MASK) - -/****************************************************************************/ -/** -* -* Disable the device. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return None. -* -* @note C-Style signature: -* void XQspiPs_Disable(XQspiPs *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_Disable(InstancePtr) \ - XQspiPs_Out32((InstancePtr->Config.BaseAddress) + XQSPIPS_ER_OFFSET, 0) - -/****************************************************************************/ -/** -* -* Set the contents of the Linear QSPI Configuration register. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param RegisterValue is the value to be written to the Linear QSPI -* configuration register. -* -* @return None. -* -* @note C-Style signature: -* void XQspiPs_SetLqspiConfigReg(XQspiPs *InstancePtr, -* u32 RegisterValue) -* -*****************************************************************************/ -#define XQspiPs_SetLqspiConfigReg(InstancePtr, RegisterValue) \ - XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + \ - XQSPIPS_LQSPI_CR_OFFSET, (RegisterValue)) - -/****************************************************************************/ -/** -* -* Get the contents of the Linear QSPI Configuration register. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return A 32-bit value representing the contents of the LQSPI Config -* register. -* -* @note C-Style signature: -* u32 XQspiPs_GetLqspiConfigReg(u32 *InstancePtr) -* -*****************************************************************************/ -#define XQspiPs_GetLqspiConfigReg(InstancePtr) \ - XQspiPs_In32((InstancePtr->Config.BaseAddress) + \ - XQSPIPS_LQSPI_CR_OFFSET) - -/************************** Function Prototypes ******************************/ - -/* - * Initialization function, implemented in xqspips_sinit.c - */ -XQspiPs_Config *XQspiPs_LookupConfig(u16 DeviceId); - -/* - * Functions implemented in xqspips.c - */ -int XQspiPs_CfgInitialize(XQspiPs *InstancePtr, XQspiPs_Config *Config, - u32 EffectiveAddr); -void XQspiPs_Reset(XQspiPs *InstancePtr); -void XQspiPs_Abort(XQspiPs *InstancePtr); - -s32 XQspiPs_Transfer(XQspiPs *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, - u32 ByteCount); -s32 XQspiPs_PolledTransfer(XQspiPs *InstancePtr, u8 *SendBufPtr, - u8 *RecvBufPtr, u32 ByteCount); -int XQspiPs_LqspiRead(XQspiPs *InstancePtr, u8 *RecvBufPtr, - u32 Address, unsigned ByteCount); - -int XQspiPs_SetSlaveSelect(XQspiPs *InstancePtr); - -void XQspiPs_SetStatusHandler(XQspiPs *InstancePtr, void *CallBackRef, - XQspiPs_StatusHandler FuncPtr); -void XQspiPs_InterruptHandler(void *InstancePtr); - -/* - * Functions for selftest, in xqspips_selftest.c - */ -int XQspiPs_SelfTest(XQspiPs *InstancePtr); - -/* - * Functions for options, in xqspips_options.c - */ -s32 XQspiPs_SetOptions(XQspiPs *InstancePtr, u32 Options); -u32 XQspiPs_GetOptions(XQspiPs *InstancePtr); - -s32 XQspiPs_SetClkPrescaler(XQspiPs *InstancePtr, u8 Prescaler); -u8 XQspiPs_GetClkPrescaler(XQspiPs *InstancePtr); - -int XQspiPs_SetDelays(XQspiPs *InstancePtr, u8 DelayNss, u8 DelayBtwn, - u8 DelayAfter, u8 DelayInit); -void XQspiPs_GetDelays(XQspiPs *InstancePtr, u8 *DelayNss, u8 *DelayBtwn, - u8 *DelayAfter, u8 *DelayInit); -#ifdef __cplusplus -} -#endif - -#endif /* end of protection macro */ -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/d04f84545243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/d04f84545243001d18b399c1eb9b3628 deleted file mode 100644 index 1feacd9..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/0/d04f84545243001d18b399c1eb9b3628 +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* -* @file xdevcfg_hw.c -* @addtogroup devcfg_v3_7 -* @{ -* -* This file contains the implementation of the interface reset functionality -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- ---------------------------------------------
-* 2.04a kpc 10/07/13 First release
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xdevcfg_hw.h" - -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ - -/*****************************************************************************/ -/** -* This function perform the reset sequence to the given devcfg interface by -* configuring the appropriate control bits in the devcfg specifc registers -* the devcfg reset squence involves the following steps -* Disable all the interuupts -* Clear the status -* Update relevant config registers with reset values -* Disbale the looopback mode and pcap rate enable -* -* @param BaseAddress of the interface -* -* @return N/A -* -* @note -* This function will not modify the slcr registers that are relavant for -* devcfg controller -******************************************************************************/ -void XDcfg_ResetHw(u32 BaseAddr) -{ - u32 Regval = 0; - - /* Mask the interrupts */ - XDcfg_WriteReg(BaseAddr, XDCFG_INT_MASK_OFFSET, - XDCFG_IXR_ALL_MASK); - /* Clear the interuupt status */ - Regval = XDcfg_ReadReg(BaseAddr, XDCFG_INT_STS_OFFSET); - XDcfg_WriteReg(BaseAddr, XDCFG_INT_STS_OFFSET, Regval); - /* Clear the source address register */ - XDcfg_WriteReg(BaseAddr, XDCFG_DMA_SRC_ADDR_OFFSET, 0x0); - /* Clear the destination address register */ - XDcfg_WriteReg(BaseAddr, XDCFG_DMA_DEST_ADDR_OFFSET, 0x0); - /* Clear the source length register */ - XDcfg_WriteReg(BaseAddr, XDCFG_DMA_SRC_LEN_OFFSET, 0x0); - /* Clear the destination length register */ - XDcfg_WriteReg(BaseAddr, XDCFG_DMA_DEST_LEN_OFFSET, 0x0); - /* Clear the loopback enable bit */ - Regval = XDcfg_ReadReg(BaseAddr, XDCFG_MCTRL_OFFSET); - Regval = Regval & ~XDCFG_MCTRL_PCAP_LPBK_MASK; - XDcfg_WriteReg(BaseAddr, XDCFG_MCTRL_OFFSET, Regval); - /*Reset the configuration register to reset value */ - XDcfg_WriteReg(BaseAddr, XDCFG_CFG_OFFSET, - XDCFG_CONFIG_RESET_VALUE); - /*Disable the PCAP rate enable bit */ - Regval = XDcfg_ReadReg(BaseAddr, XDCFG_CTRL_OFFSET); - Regval = Regval & ~XDCFG_CTRL_PCAP_RATE_EN_MASK; - XDcfg_WriteReg(BaseAddr, XDCFG_CTRL_OFFSET, Regval); - -} -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/00513e555243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/00513e555243001d18b399c1eb9b3628 deleted file mode 100644 index 97070df..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/00513e555243001d18b399c1eb9b3628 +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2017 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_errata.h -* -* @addtogroup a53_errata Cortex A53 64 bit Processor Errata Support -* @{ -* Various ARM errata are handled in the standalone BSP. The implementation for -* errata handling follows ARM guidelines and is based on the open source Linux -* support for these errata. -* -* @note -* The errata handling is enabled by default. To disable handling of all the -* errata globally, un-define the macro ENABLE_ARM_ERRATA in xil_errata.h. To -* disable errata on a per-erratum basis, un-define relevant macros in -* xil_errata.h. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 6.4   mus  08/11/17 First release
-* 
-* -******************************************************************************/ -#ifndef XIL_ERRATA_H -#define XIL_ERRATA_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name errata_definitions - * - * The errata conditions handled in the standalone BSP are listed below - * @{ - */ - -#define ENABLE_ARM_ERRATA 1 - -#ifdef ENABLE_ARM_ERRATA - -/** - * Errata No: 855873 - * Description: An eviction might overtake a cache clean operation - */ -#define CONFIG_ARM_ERRATA_855873 1 - - -/*@}*/ -#endif /* ENABLE_ARM_ERRATA */ - -#ifdef __cplusplus -} -#endif - -#endif /* XIL_ERRATA_H */ -/** -* @} End of "addtogroup a53_errata". -*/ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/13a13a585243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/13a13a585243001d18b399c1eb9b3628 deleted file mode 100644 index 4c9faef..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/13a13a585243001d18b399c1eb9b3628 +++ /dev/null @@ -1,16 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2009 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - - -#include -#include - -/* - * abort -- go out via exit... - */ -__attribute__((weak)) void abort(void) -{ - _exit(1); -} diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fa20545243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fa20545243001d18b399c1eb9b3628 deleted file mode 100644 index 6f40407..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/20fa20545243001d18b399c1eb9b3628 +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2015 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xcoresightpsdcc.h -* @addtogroup coresightps_dcc_v1_8 -* @{ -* @details -* -* CoreSight driver component. -* -* The coresight is a part of debug communication channel (DCC) group. Jtag UART -* for ARM uses DCC. Each ARM core has its own DCC, so one need to select an -* ARM target in XSDB console before running the jtag terminal command. Using the -* coresight driver component, the output stream can be directed to a log file. -* -* @note None. -* -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date		Changes
-* ----- -----  -------- -----------------------------------------------
-* 1.00  kvn    02/14/15 First release
-* 1.1   kvn    06/12/15 Add support for Zynq Ultrascale+ MP.
-*       kvn    08/18/15 Modified Makefile according to compiler changes.
-* 1.3   asa    07/01/16 Made changes to ensure that the file does not compile
-*                       for MB BSPs. Instead it throws up a warning. This
-*                       fixes the CR#953056.
-* 1.5   sne    01/19/19 Fixed MISRA-C Violations CR#1025101.
-*
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ -#ifndef XCORESIGHTPSDCC_H /* prevent circular inclusions */ -#define XCORESIGHTPSDCC_H /* by using protection macros */ -#ifndef __MICROBLAZE__ -#include - -void XCoresightPs_DccSendByte(u32 BaseAddress, u8 Data); - -u8 XCoresightPs_DccRecvByte(u32 BaseAddress); -#endif -#endif -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/30eed8565243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/30eed8565243001d18b399c1eb9b3628 deleted file mode 100644 index 50df3c5..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/30eed8565243001d18b399c1eb9b3628 +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_clocking.c -* -* The xil_clocking.c file contains clocking related functions and macros. -* -* @{ -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date   Changes
-* ----- ---- -------- -------------------------------------------------------
-* 7.2 sd  02/06/20 First release of clocking
-* 7.2 sd  03/20/20 Added checking for isolation case
-* 
-* -******************************************************************************/ - -#include "xil_clocking.h" -/************************** Variable Definitions *****************************/ - -#if defined (XPAR_XCRPSU_0_DEVICE_ID) && defined (XCLOCKING) - -XClock ClockInstance; /* Instance of clock Controller */ -XClockPs_Config *ConfigPtr; - - -XStatus Xil_ClockInit(void) -{ - XStatus Status = XST_FAILURE; - - /* Lookup clock configurations */ - ConfigPtr = XClock_LookupConfig(XPAR_XCLOCKPS_DEVICE_ID); - - /* Initialize the Clock controller driver */ - Status = XClock_CfgInitialize(&ClockInstance, ConfigPtr); - return Status; -} - -XStatus Xil_ClockEnable(XClock_OutputClks ClockId) -{ - - XStatus Status = XST_FAILURE; - - Status = XClock_EnableClock(ClockId); - return Status; -} - -XStatus Xil_ClockDisable(XClock_OutputClks ClockId) -{ - XStatus Status = XST_FAILURE; - - Status = XClock_DisableClock(ClockId); - return Status; -} - -XStatus Xil_ClockGetRate(XClock_OutputClks ClockId, XClockRate *Rate) -{ - XStatus Status = XST_FAILURE; - - Xil_AssertNonvoid(Rate != NULL); - - Status = XClock_GetRate(ClockId, Rate); - if (XST_SUCCESS == Status) { - xdbg_printf(XDBG_DEBUG_GENERAL, "Operating rate = %lx\n",*Rate); - } else { - xdbg_printf(XDBG_DEBUG_ERROR, "Failed: Fetching rate\r\n"); - } - return Status; -} - -XStatus Xil_ClockSetRate(XClock_OutputClks ClockId, XClockRate Rate, - XClockRate *SetRate) -{ - XStatus Status = XST_FAILURE; - - Xil_AssertNonvoid(SetRate != NULL); - - if (Rate == 0) { - return XST_FAILURE; - } - Status = XClock_SetRate(ClockId, Rate, SetRate); - if (XST_SUCCESS != Status) { - xdbg_printf(XDBG_DEBUG_ERROR, "Failed Setting rate\n"); - } - return Status; -} - -#else -XStatus Xil_ClockGetRate(XClock_OutputClks ClockId, XClockRate *Rate) -{ - (void) ClockId; - (void) Rate; - return XST_FAILURE; -} - -XStatus Xil_ClockSetRate(XClock_OutputClks ClockId, XClockRate Rate, - XClockRate *SetRate) { - (void) ClockId; - (void) Rate; - (void) SetRate; - return XST_FAILURE; -} - -XStatus Xil_ClockInit(void) -{ - return XST_SUCCESS; -} - -XStatus Xil_ClockEnable(XClock_OutputClks ClockId) -{ - (void) ClockId; - return XST_SUCCESS; -} - -XStatus Xil_ClockDisable(XClock_OutputClks ClockId) -{ - (void) ClockId; - return XST_SUCCESS; -} - -#endif /* XCLOCKING */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/817c3e595243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/817c3e595243001d18b399c1eb9b3628 deleted file mode 100644 index 9681975..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/817c3e595243001d18b399c1eb9b3628 +++ /dev/null @@ -1,273 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_testio.c -* @addtogroup common_test_utils -* -* -*
-* MODIFICATION HISTORY:
-*
-* Ver    Who    Date    Changes
-* ----- ---- -------- -----------------------------------------------
-* 1.00a hbm  08/25/09 First release
-* 
-* -*****************************************************************************/ - -/***************************** Include Files ********************************/ -#include "xil_testio.h" -#include "xil_assert.h" -#include "xil_io.h" - -/************************** Constant Definitions ****************************/ -/************************** Function Prototypes *****************************/ - - - -/** - * - * Endian swap a 16-bit word. - * @param Data is the 16-bit word to be swapped. - * @return The endian swapped value. - * - */ -static u16 Swap16(u16 Data) -{ - return ((Data >> 8U) & 0x00FFU) | ((Data << 8U) & 0xFF00U); -} - -/** - * - * Endian swap a 32-bit word. - * @param Data is the 32-bit word to be swapped. - * @return The endian swapped value. - * - */ -static u32 Swap32(u32 Data) -{ - u16 Lo16; - u16 Hi16; - - u16 Swap16Lo; - u16 Swap16Hi; - - Hi16 = (u16)((Data >> 16U) & 0x0000FFFFU); - Lo16 = (u16)(Data & 0x0000FFFFU); - - Swap16Lo = Swap16(Lo16); - Swap16Hi = Swap16(Hi16); - - return (((u32)(Swap16Lo)) << 16U) | ((u32)Swap16Hi); -} - -/*****************************************************************************/ -/** -* -* @brief Perform a destructive 8-bit wide register IO test where the -* register is accessed using Xil_Out8 and Xil_In8, and comparing -* the written values by reading them back. -* -* @param Addr: a pointer to the region of memory to be tested. -* @param Length: Length of the block. -* @param Value: constant used for writing the memory. -* -* @return -* - -1 is returned for a failure -* - 0 is returned for a pass -* -*****************************************************************************/ - -s32 Xil_TestIO8(u8 *Addr, s32 Length, u8 Value) -{ - u8 ValueIn; - s32 Index; - s32 Status = 0; - - for (Index = 0; Index < Length; Index++) { - Xil_Out8((INTPTR)Addr, Value); - - ValueIn = Xil_In8((INTPTR)Addr); - - if ((Value != ValueIn) && (Status == 0)) { - Status = -1; - break; - } - } - return Status; - -} - -/*****************************************************************************/ -/** -* -* @brief Perform a destructive 16-bit wide register IO test. Each location -* is tested by sequentially writing a 16-bit wide register, reading -* the register, and comparing value. This function tests three kinds -* of register IO functions, normal register IO, little-endian register -* IO, and big-endian register IO. When testing little/big-endian IO, -* the function performs the following sequence, Xil_Out16LE/Xil_Out16BE, -* Xil_In16, Compare In-Out values, Xil_Out16, Xil_In16LE/Xil_In16BE, -* Compare In-Out values. Whether to swap the read-in value before -* comparing is controlled by the 5th argument. -* -* @param Addr: a pointer to the region of memory to be tested. -* @param Length: Length of the block. -* @param Value: constant used for writing the memory. -* @param Kind: Type of test. Acceptable values are: -* XIL_TESTIO_DEFAULT, XIL_TESTIO_LE, XIL_TESTIO_BE. -* @param Swap: indicates whether to byte swap the read-in value. -* -* @return -* - -1 is returned for a failure -* - 0 is returned for a pass -* -*****************************************************************************/ - -s32 Xil_TestIO16(u16 *Addr, s32 Length, u16 Value, s32 Kind, s32 Swap) -{ - u16 *TempAddr16; - u16 ValueIn = 0U; - s32 Index; - TempAddr16 = Addr; - Xil_AssertNonvoid(TempAddr16 != NULL); - - for (Index = 0; Index < Length; Index++) { - switch (Kind) { - case XIL_TESTIO_LE: - Xil_Out16LE((INTPTR)TempAddr16, Value); - break; - case XIL_TESTIO_BE: - Xil_Out16BE((INTPTR)TempAddr16, Value); - break; - default: - Xil_Out16((INTPTR)TempAddr16, Value); - break; - } - - ValueIn = Xil_In16((INTPTR)TempAddr16); - - if ((Kind != 0) && (Swap != 0)) { - ValueIn = Swap16(ValueIn); - } - - if (Value != ValueIn) { - return -1; - } - - /* second round */ - Xil_Out16((INTPTR)TempAddr16, Value); - - switch (Kind) { - case XIL_TESTIO_LE: - ValueIn = Xil_In16LE((INTPTR)TempAddr16); - break; - case XIL_TESTIO_BE: - ValueIn = Xil_In16BE((INTPTR)TempAddr16); - break; - default: - ValueIn = Xil_In16((INTPTR)TempAddr16); - break; - } - - - if ((Kind != 0) && (Swap != 0)) { - ValueIn = Swap16(ValueIn); - } - - if (Value != ValueIn) { - return -1; - } - TempAddr16 += sizeof(u16); - } - return 0; -} - - -/*****************************************************************************/ -/** -* -* @brief Perform a destructive 32-bit wide register IO test. Each location -* is tested by sequentially writing a 32-bit wide register, reading -* the register, and comparing value. This function tests three kinds -* of register IO functions, normal register IO, little-endian register IO, -* and big-endian register IO. When testing little/big-endian IO, -* the function perform the following sequence, Xil_Out32LE/ -* Xil_Out32BE, Xil_In32, Compare, Xil_Out32, Xil_In32LE/Xil_In32BE, Compare. -* Whether to swap the read-in value *before comparing is controlled -* by the 5th argument. -* @param Addr: a pointer to the region of memory to be tested. -* @param Length: Length of the block. -* @param Value: constant used for writing the memory. -* @param Kind: type of test. Acceptable values are: -* XIL_TESTIO_DEFAULT, XIL_TESTIO_LE, XIL_TESTIO_BE. -* @param Swap: indicates whether to byte swap the read-in value. -* -* @return -* - -1 is returned for a failure -* - 0 is returned for a pass -* -*****************************************************************************/ -s32 Xil_TestIO32(u32 *Addr, s32 Length, u32 Value, s32 Kind, s32 Swap) -{ - u32 *TempAddr; - u32 ValueIn = 0U; - s32 Index; - TempAddr = Addr; - Xil_AssertNonvoid(TempAddr != NULL); - - for (Index = 0; Index < Length; Index++) { - switch (Kind) { - case XIL_TESTIO_LE: - Xil_Out32LE((INTPTR)TempAddr, Value); - break; - case XIL_TESTIO_BE: - Xil_Out32BE((INTPTR)TempAddr, Value); - break; - default: - Xil_Out32((INTPTR)TempAddr, Value); - break; - } - - ValueIn = Xil_In32((INTPTR)TempAddr); - - if ((Kind != 0) && (Swap != 0)) { - ValueIn = Swap32(ValueIn); - } - - if (Value != ValueIn) { - return -1; - } - - /* second round */ - Xil_Out32((INTPTR)TempAddr, Value); - - - switch (Kind) { - case XIL_TESTIO_LE: - ValueIn = Xil_In32LE((INTPTR)TempAddr); - break; - case XIL_TESTIO_BE: - ValueIn = Xil_In32BE((INTPTR)TempAddr); - break; - default: - ValueIn = Xil_In32((INTPTR)TempAddr); - break; - } - - if ((Kind != 0) && (Swap != 0)) { - ValueIn = Swap32(ValueIn); - } - - if (Value != ValueIn) { - return -1; - } - TempAddr += sizeof(u32); - } - return 0; -} diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/c27dde545243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/c27dde545243001d18b399c1eb9b3628 deleted file mode 100644 index ddfa24c..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/1/c27dde545243001d18b399c1eb9b3628 +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* -* @file xscutimer_selftest.c -* @addtogroup scutimer_v2_3 -* @{ -* -* Contains diagnostic self-test functions for the XScuTimer driver. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- ---------------------------------------------
-* 1.00a nm  03/10/10 First release
-* 2.1 	sk  02/26/15 Modified the code for MISRA-C:2012 compliance.
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xscutimer.h" - -/************************** Constant Definitions *****************************/ - -#define XSCUTIMER_SELFTEST_VALUE 0xA55AF00FU - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ - -/****************************************************************************/ -/** -* -* Run a self-test on the timer. This test clears the timer enable bit in -* the control register, writes to the timer load register and verifies the -* value read back matches the value written and restores the control register -* and the timer load register. -* -* @param InstancePtr is a pointer to the XScuTimer instance. -* -* @return -* - XST_SUCCESS if self-test was successful. -* - XST_FAILURE if self test was not successful. -* -* @note None. -* -******************************************************************************/ -s32 XScuTimer_SelfTest(XScuTimer *InstancePtr) -{ - u32 Register; - u32 CtrlOrig; - u32 LoadOrig; - s32 Status; - - /* - * Assert to ensure the inputs are valid and the instance has been - * initialized. - */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Save the contents of the Control Register and stop the timer. - */ - CtrlOrig = XScuTimer_ReadReg(InstancePtr->Config.BaseAddr, - XSCUTIMER_CONTROL_OFFSET); - Register = CtrlOrig & (u32)(~XSCUTIMER_CONTROL_ENABLE_MASK); - XScuTimer_WriteReg(InstancePtr->Config.BaseAddr, - XSCUTIMER_CONTROL_OFFSET, Register); - - /* - * Save the contents of the Load Register. - * Load a new test value in the Load Register, read it back and - * compare it with the written value. - */ - LoadOrig = XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, - XSCUTIMER_LOAD_OFFSET); - XScuTimer_LoadTimer(InstancePtr, XSCUTIMER_SELFTEST_VALUE); - Register = XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, - XSCUTIMER_LOAD_OFFSET); - - /* - * Restore the contents of the Load Register and Control Register. - */ - XScuTimer_LoadTimer(InstancePtr, LoadOrig); - XScuTimer_WriteReg(InstancePtr->Config.BaseAddr, - XSCUTIMER_CONTROL_OFFSET, CtrlOrig); - - /* - * Return a Failure if the contents of the Load Register do not - * match with the value written to it. - */ - if (Register != XSCUTIMER_SELFTEST_VALUE) { - Status = (s32)XST_FAILURE; - } - else { - Status = (s32)XST_SUCCESS; - } - - return Status; -} -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/306a6b575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/306a6b575243001d18b399c1eb9b3628 deleted file mode 100644 index 1b7d881..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/306a6b575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,369 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* -* @file xdevcfg_hw.h -* @addtogroup devcfg_v3_7 -* @{ -* -* This file contains the hardware interface to the Device Config Interface. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- ---------------------------------------------
-* 1.00a hvm 02/07/11 First release
-* 2.01a nm  08/01/12 Added defines for the PS Version bits,
-*	             removed the FIFO Flush bits from the
-*		     Miscellaneous Control Reg
-* 2.03a nm  04/19/13 Fixed CR# 703728.
-*		     Updated the register definitions as per the latest TRM
-*		     version UG585 (v1.4) November 16, 2012.
-* 2.04a	kpc	10/07/13 Added function prototype.
-* 3.00a	kpc	25/02/14 Corrected the XDCFG_BASE_ADDRESS macro value.
-* 
-* -******************************************************************************/ -#ifndef XDCFG_HW_H /* prevent circular inclusions */ -#define XDCFG_HW_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_types.h" -#include "xil_io.h" - -/************************** Constant Definitions *****************************/ - -/** @name Register Map - * Offsets of registers from the start of the device - * @{ - */ - -#define XDCFG_CTRL_OFFSET 0x00 /**< Control Register */ -#define XDCFG_LOCK_OFFSET 0x04 /**< Lock Register */ -#define XDCFG_CFG_OFFSET 0x08 /**< Configuration Register */ -#define XDCFG_INT_STS_OFFSET 0x0C /**< Interrupt Status Register */ -#define XDCFG_INT_MASK_OFFSET 0x10 /**< Interrupt Mask Register */ -#define XDCFG_STATUS_OFFSET 0x14 /**< Status Register */ -#define XDCFG_DMA_SRC_ADDR_OFFSET 0x18 /**< DMA Source Address Register */ -#define XDCFG_DMA_DEST_ADDR_OFFSET 0x1C /**< DMA Destination Address Reg */ -#define XDCFG_DMA_SRC_LEN_OFFSET 0x20 /**< DMA Source Transfer Length */ -#define XDCFG_DMA_DEST_LEN_OFFSET 0x24 /**< DMA Destination Transfer */ -#define XDCFG_ROM_SHADOW_OFFSET 0x28 /**< DMA ROM Shadow Register */ -#define XDCFG_MULTIBOOT_ADDR_OFFSET 0x2C /**< Multi BootAddress Pointer */ -#define XDCFG_SW_ID_OFFSET 0x30 /**< Software ID Register */ -#define XDCFG_UNLOCK_OFFSET 0x34 /**< Unlock Register */ -#define XDCFG_MCTRL_OFFSET 0x80 /**< Miscellaneous Control Reg */ - -/* @} */ - -/** @name Control Register Bit definitions - * @{ - */ - -#define XDCFG_CTRL_FORCE_RST_MASK 0x80000000 /**< Force into - * Secure Reset - */ -#define XDCFG_CTRL_PCFG_PROG_B_MASK 0x40000000 /**< Program signal to - * Reset FPGA - */ -#define XDCFG_CTRL_PCFG_POR_CNT_4K_MASK 0x20000000 /**< Control PL POR timer */ -#define XDCFG_CTRL_PCAP_PR_MASK 0x08000000 /**< Enable PCAP for PR */ -#define XDCFG_CTRL_PCAP_MODE_MASK 0x04000000 /**< Enable PCAP */ -#define XDCFG_CTRL_PCAP_RATE_EN_MASK 0x02000000 /**< Enable PCAP send data - * to FPGA every 4 PCAP - * cycles - */ -#define XDCFG_CTRL_MULTIBOOT_EN_MASK 0x01000000 /**< Multiboot Enable */ -#define XDCFG_CTRL_JTAG_CHAIN_DIS_MASK 0x00800000 /**< JTAG Chain Disable */ -#define XDCFG_CTRL_USER_MODE_MASK 0x00008000 /**< User Mode Mask */ -#define XDCFG_CTRL_PCFG_AES_FUSE_MASK 0x00001000 /**< AES key source */ -#define XDCFG_CTRL_PCFG_AES_EN_MASK 0x00000E00 /**< AES Enable Mask */ -#define XDCFG_CTRL_SEU_EN_MASK 0x00000100 /**< SEU Enable Mask */ -#define XDCFG_CTRL_SEC_EN_MASK 0x00000080 /**< Secure/Non Secure - * Status mask - */ -#define XDCFG_CTRL_SPNIDEN_MASK 0x00000040 /**< Secure Non Invasive - * Debug Enable - */ -#define XDCFG_CTRL_SPIDEN_MASK 0x00000020 /**< Secure Invasive - * Debug Enable - */ -#define XDCFG_CTRL_NIDEN_MASK 0x00000010 /**< Non-Invasive Debug - * Enable - */ -#define XDCFG_CTRL_DBGEN_MASK 0x00000008 /**< Invasive Debug - * Enable - */ -#define XDCFG_CTRL_DAP_EN_MASK 0x00000007 /**< DAP Enable Mask */ - -/* @} */ - -/** @name Lock register bit definitions - * @{ - */ - -#define XDCFG_LOCK_AES_EFUSE_MASK 0x00000010 /**< Lock AES Efuse bit */ -#define XDCFG_LOCK_AES_EN_MASK 0x00000008 /**< Lock AES_EN update */ -#define XDCFG_LOCK_SEU_MASK 0x00000004 /**< Lock SEU_En update */ -#define XDCFG_LOCK_SEC_MASK 0x00000002 /**< Lock SEC_EN and - * USER_MODE - */ -#define XDCFG_LOCK_DBG_MASK 0x00000001 /**< This bit locks - * security config - * including: DAP_En, - * DBGEN,, - * NIDEN, SPNIEN - */ -/*@}*/ - - - -/** @name Config Register Bit definitions - * @{ - */ -#define XDCFG_CFG_RFIFO_TH_MASK 0x00000C00 /**< Read FIFO - * Threshold Mask - */ -#define XDCFG_CFG_WFIFO_TH_MASK 0x00000300 /**< Write FIFO Threshold - * Mask - */ -#define XDCFG_CFG_RCLK_EDGE_MASK 0x00000080 /**< Read data active - * clock edge - */ -#define XDCFG_CFG_WCLK_EDGE_MASK 0x00000040 /**< Write data active - * clock edge - */ -#define XDCFG_CFG_DISABLE_SRC_INC_MASK 0x00000020 /**< Disable Source address - * increment mask - */ -#define XDCFG_CFG_DISABLE_DST_INC_MASK 0x00000010 /**< Disable Destination - * address increment - * mask - */ -/* @} */ - - -/** @name Interrupt Status/Mask Register Bit definitions - * @{ - */ -#define XDCFG_IXR_PSS_GTS_USR_B_MASK 0x80000000 /**< Tri-state IO during - * HIZ - */ -#define XDCFG_IXR_PSS_FST_CFG_B_MASK 0x40000000 /**< First configuration - * done - */ -#define XDCFG_IXR_PSS_GPWRDWN_B_MASK 0x20000000 /**< Global power down */ -#define XDCFG_IXR_PSS_GTS_CFG_B_MASK 0x10000000 /**< Tri-state IO during - * configuration - */ -#define XDCFG_IXR_PSS_CFG_RESET_B_MASK 0x08000000 /**< PL configuration - * reset - */ -#define XDCFG_IXR_AXI_WTO_MASK 0x00800000 /**< AXI Write Address - * or Data or response - * timeout - */ -#define XDCFG_IXR_AXI_WERR_MASK 0x00400000 /**< AXI Write response - * error - */ -#define XDCFG_IXR_AXI_RTO_MASK 0x00200000 /**< AXI Read Address or - * response timeout - */ -#define XDCFG_IXR_AXI_RERR_MASK 0x00100000 /**< AXI Read response - * error - */ -#define XDCFG_IXR_RX_FIFO_OV_MASK 0x00040000 /**< Rx FIFO Overflow */ -#define XDCFG_IXR_WR_FIFO_LVL_MASK 0x00020000 /**< Tx FIFO less than - * threshold */ -#define XDCFG_IXR_RD_FIFO_LVL_MASK 0x00010000 /**< Rx FIFO greater than - * threshold */ -#define XDCFG_IXR_DMA_CMD_ERR_MASK 0x00008000 /**< Illegal DMA command */ -#define XDCFG_IXR_DMA_Q_OV_MASK 0x00004000 /**< DMA command queue - * overflow - */ -#define XDCFG_IXR_DMA_DONE_MASK 0x00002000 /**< DMA Command Done */ -#define XDCFG_IXR_D_P_DONE_MASK 0x00001000 /**< DMA and PCAP - * transfers Done - */ -#define XDCFG_IXR_P2D_LEN_ERR_MASK 0x00000800 /**< PCAP to DMA transfer - * length error - */ -#define XDCFG_IXR_PCFG_HMAC_ERR_MASK 0x00000040 /**< HMAC error mask */ -#define XDCFG_IXR_PCFG_SEU_ERR_MASK 0x00000020 /**< SEU Error mask */ -#define XDCFG_IXR_PCFG_POR_B_MASK 0x00000010 /**< FPGA POR mask */ -#define XDCFG_IXR_PCFG_CFG_RST_MASK 0x00000008 /**< FPGA Reset mask */ -#define XDCFG_IXR_PCFG_DONE_MASK 0x00000004 /**< Done Signal Mask */ -#define XDCFG_IXR_PCFG_INIT_PE_MASK 0x00000002 /**< Detect Positive edge - * of Init Signal - */ -#define XDCFG_IXR_PCFG_INIT_NE_MASK 0x00000001 /**< Detect Negative edge - * of Init Signal - */ -#define XDCFG_IXR_ERROR_FLAGS_MASK (XDCFG_IXR_AXI_WTO_MASK | \ - XDCFG_IXR_AXI_WERR_MASK | \ - XDCFG_IXR_AXI_RTO_MASK | \ - XDCFG_IXR_AXI_RERR_MASK | \ - XDCFG_IXR_RX_FIFO_OV_MASK | \ - XDCFG_IXR_DMA_CMD_ERR_MASK |\ - XDCFG_IXR_DMA_Q_OV_MASK | \ - XDCFG_IXR_P2D_LEN_ERR_MASK |\ - XDCFG_IXR_PCFG_HMAC_ERR_MASK) - - -#define XDCFG_IXR_ALL_MASK 0x00F7F8EF - - - -/* @} */ - - -/** @name Status Register Bit definitions - * @{ - */ -#define XDCFG_STATUS_DMA_CMD_Q_F_MASK 0x80000000 /**< DMA command - * Queue full - */ -#define XDCFG_STATUS_DMA_CMD_Q_E_MASK 0x40000000 /**< DMA command - * Queue empty - */ -#define XDCFG_STATUS_DMA_DONE_CNT_MASK 0x30000000 /**< Number of - * completed DMA - * transfers - */ -#define XDCFG_STATUS_RX_FIFO_LVL_MASK 0x01F000000 /**< Rx FIFO level */ -#define XDCFG_STATUS_TX_FIFO_LVL_MASK 0x0007F000 /**< Tx FIFO level */ - -#define XDCFG_STATUS_PSS_GTS_USR_B 0x00000800 /**< Tri-state IO - * during HIZ - */ -#define XDCFG_STATUS_PSS_FST_CFG_B 0x00000400 /**< First PL config - * done - */ -#define XDCFG_STATUS_PSS_GPWRDWN_B 0x00000200 /**< Global power down */ -#define XDCFG_STATUS_PSS_GTS_CFG_B 0x00000100 /**< Tri-state IO during - * config - */ -#define XDCFG_STATUS_SECURE_RST_MASK 0x00000080 /**< Secure Reset - * POR Status - */ -#define XDCFG_STATUS_ILLEGAL_APB_ACCESS_MASK 0x00000040 /**< Illegal APB - * access - */ -#define XDCFG_STATUS_PSS_CFG_RESET_B 0x00000020 /**< PL config - * reset status - */ -#define XDCFG_STATUS_PCFG_INIT_MASK 0x00000010 /**< FPGA Init - * Status - */ -#define XDCFG_STATUS_EFUSE_BBRAM_KEY_DISABLE_MASK 0x00000008 - /**< BBRAM key - * disable - */ -#define XDCFG_STATUS_EFUSE_SEC_EN_MASK 0x00000004 /**< Efuse Security - * Enable Status - */ -#define XDCFG_STATUS_EFUSE_JTAG_DIS_MASK 0x00000002 /**< EFuse JTAG - * Disable - * status - */ -/* @} */ - - -/** @name DMA Source/Destination Transfer Length Register Bit definitions - * @{ - */ -#define XDCFG_DMA_LEN_MASK 0x7FFFFFF /**< Length Mask */ -/*@}*/ - - - - -/** @name Miscellaneous Control Register Bit definitions - * @{ - */ -#define XDCFG_MCTRL_PCAP_PS_VERSION_MASK 0xF0000000 /**< PS Version Mask */ -#define XDCFG_MCTRL_PCAP_PS_VERSION_SHIFT 28 /**< PS Version Shift */ -#define XDCFG_MCTRL_PCAP_LPBK_MASK 0x00000010 /**< PCAP loopback mask */ -/* @} */ - -/** @name FIFO Threshold Bit definitions - * @{ - */ - -#define XDCFG_CFG_FIFO_QUARTER 0x0 /**< Quarter empty */ -#define XDCFG_CFG_FIFO_HALF 0x1 /**< Half empty */ -#define XDCFG_CFG_FIFO_3QUARTER 0x2 /**< 3/4 empty */ -#define XDCFG_CFG_FIFO_EMPTY 0x4 /**< Empty */ -/* @}*/ - - -/* Miscellaneous constant values */ -#define XDCFG_DMA_INVALID_ADDRESS 0xFFFFFFFF /**< Invalid DMA address */ -#define XDCFG_UNLOCK_DATA 0x757BDF0D /**< First APB access data*/ -#define XDCFG_BASE_ADDRESS 0xF8007000 /**< Device Config base - * address - */ -#define XDCFG_CONFIG_RESET_VALUE 0x508 /**< Config reg reset value */ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/****************************************************************************/ -/** -* -* Read the given register. -* -* @param BaseAddr is the base address of the device -* @param RegOffset is the register offset to be read -* -* @return The 32-bit value of the register -* -* @note C-style signature: -* u32 XDcfg_ReadReg(u32 BaseAddr, u32 RegOffset) -* -*****************************************************************************/ -#define XDcfg_ReadReg(BaseAddr, RegOffset) \ - Xil_In32((BaseAddr) + (RegOffset)) - -/****************************************************************************/ -/** -* -* Write to the given register. -* -* @param BaseAddr is the base address of the device -* @param RegOffset is the register offset to be written -* @param Data is the 32-bit value to write to the register -* -* @return None. -* -* @note C-style signature: -* void XDcfg_WriteReg(u32 BaseAddr, u32 RegOffset, u32 Data) -* -*****************************************************************************/ -#define XDcfg_WriteReg(BaseAddr, RegOffset, Data) \ - Xil_Out32((BaseAddr) + (RegOffset), (Data)) - -/************************** Function Prototypes ******************************/ -/* - * Perform reset operation to the devcfg interface - */ -void XDcfg_ResetHw(u32 BaseAddr); -/************************** Variable Definitions *****************************/ - -#ifdef __cplusplus -} -#endif - -#endif /* end of protection macro */ -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/41b148555243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/41b148555243001d18b399c1eb9b3628 deleted file mode 100644 index fd281c5..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/41b148555243001d18b399c1eb9b3628 +++ /dev/null @@ -1,131 +0,0 @@ -/****************************************************************************** - * xen.h - * - * Guest OS interface to Xen. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Copyright (c) 2004, K A Fraser - */ -/* -Copyright DornerWorks 2016 - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the -following disclaimer. - -THIS SOFTWARE IS PROVIDED BY DORNERWORKS FOR USE ON THE CONTRACTED PROJECT, AND ANY EXPRESS OR IMPLIED WARRANTY -IS LIMITED TO THIS USE. FOR ALL OTHER USES THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DORNERWORKS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef __XEN_H_ -#define __XEN_H_ - -/* - * HYPERCALLS - */ - -/* `incontents 100 hcalls List of hypercalls - * ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() - */ - -#define __HYPERVISOR_set_trap_table 0 -#define __HYPERVISOR_mmu_update 1 -#define __HYPERVISOR_set_gdt 2 -#define __HYPERVISOR_stack_switch 3 -#define __HYPERVISOR_set_callbacks 4 -#define __HYPERVISOR_fpu_taskswitch 5 -#define __HYPERVISOR_sched_op_compat 6 /* compat since 0x00030101 */ -#define __HYPERVISOR_platform_op 7 -#define __HYPERVISOR_set_debugreg 8 -#define __HYPERVISOR_get_debugreg 9 -#define __HYPERVISOR_update_descriptor 10 -#define __HYPERVISOR_memory_op 12 -#define __HYPERVISOR_multicall 13 -#define __HYPERVISOR_update_va_mapping 14 -#define __HYPERVISOR_set_timer_op 15 -#define __HYPERVISOR_event_channel_op_compat 16 /* compat since 0x00030202 */ -#define __HYPERVISOR_xen_version 17 -#define __HYPERVISOR_console_io 18 -#define __HYPERVISOR_physdev_op_compat 19 /* compat since 0x00030202 */ -#define __HYPERVISOR_grant_table_op 20 -#define __HYPERVISOR_vm_assist 21 -#define __HYPERVISOR_update_va_mapping_otherdomain 22 -#define __HYPERVISOR_iret 23 /* x86 only */ -#define __HYPERVISOR_vcpu_op 24 -#define __HYPERVISOR_set_segment_base 25 /* x86/64 only */ -#define __HYPERVISOR_mmuext_op 26 -#define __HYPERVISOR_xsm_op 27 -#define __HYPERVISOR_nmi_op 28 -#define __HYPERVISOR_sched_op 29 -#define __HYPERVISOR_callback_op 30 -#define __HYPERVISOR_xenoprof_op 31 -#define __HYPERVISOR_event_channel_op 32 -#define __HYPERVISOR_physdev_op 33 -#define __HYPERVISOR_hvm_op 34 -#define __HYPERVISOR_sysctl 35 -#define __HYPERVISOR_domctl 36 -#define __HYPERVISOR_kexec_op 37 -#define __HYPERVISOR_tmem_op 38 -#define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */ - -/* Architecture-specific hypercall definitions. */ -#define __HYPERVISOR_arch_0 48 -#define __HYPERVISOR_arch_1 49 -#define __HYPERVISOR_arch_2 50 -#define __HYPERVISOR_arch_3 51 -#define __HYPERVISOR_arch_4 52 -#define __HYPERVISOR_arch_5 53 -#define __HYPERVISOR_arch_6 54 -#define __HYPERVISOR_arch_7 55 - -/* ` } */ - -/* - * Commands to HYPERVISOR_console_io(). - */ -#define CONSOLEIO_write 0 -#define CONSOLEIO_read 1 - -/* - * Commands to HYPERVISOR_hvm_op - */ -#define HVMOP_set_param 0 -#define HVMOP_get_param 1 - -/* DOMID_SELF is used in certain contexts to refer to oneself. */ -#define DOMID_SELF (0x7FF0U) - - -#define XENMEM_add_to_physmap 7 - - -/* Console debug shared memory ring and event channel */ -#define HVM_PARAM_CONSOLE_PFN 17 -#define HVM_PARAM_CONSOLE_EVTCHN 18 - - -#endif /* __XEN_PUBLIC_XEN_H__ */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/70fbf9515243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/70fbf9515243001d18b399c1eb9b3628 deleted file mode 100644 index 2c88e06..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/70fbf9515243001d18b399c1eb9b3628 +++ /dev/null @@ -1,26 +0,0 @@ - - - phased_array - Created by Vitis v2021.2 - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.xilinx.sdx.sdk.core.SdkProjectNature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1c09f575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1c09f575243001d18b399c1eb9b3628 deleted file mode 100644 index 4b6d75a..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1c09f575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,261 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* -* @file xscutimer_hw.h -* @addtogroup scutimer_v2_3 -* @{ -* -* This file contains the hardware interface to the Timer. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- ---------------------------------------------
-* 1.00a nm  03/10/10 First release
-* 1.01a sdm 02/02/12 Added low level macros to read/write load, counter, control
-*		     and interrupt registers
-* 1.02a  sg 07/17/12 Included xil_assert.h for CR 667947. This is an issue
-*		     when the xstatus.h in the common driver overwrites
-*		     the xstatus.h of the standalone BSP during the
-*		     libgen.
-* 2.1 	sk  02/26/15 Modified the code for MISRA-C:2012 compliance.
-* 
-* -******************************************************************************/ -#ifndef XSCUTIMER_HW_H /* prevent circular inclusions */ -#define XSCUTIMER_HW_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ -#include "xil_types.h" -#include "xil_io.h" -#include "xil_assert.h" -/************************** Constant Definitions *****************************/ - -/** @name Register Map - * Offsets of registers from the start of the device - * @{ - */ - -#define XSCUTIMER_LOAD_OFFSET 0x00U /**< Timer Load Register */ -#define XSCUTIMER_COUNTER_OFFSET 0x04U /**< Timer Counter Register */ -#define XSCUTIMER_CONTROL_OFFSET 0x08U /**< Timer Control Register */ -#define XSCUTIMER_ISR_OFFSET 0x0CU /**< Timer Interrupt - Status Register */ -/* @} */ - -/** @name Timer Control register - * This register bits control the prescaler, Intr enable, - * auto-reload and timer enable. - * @{ - */ - -#define XSCUTIMER_CONTROL_PRESCALER_MASK 0x0000FF00U /**< Prescaler */ -#define XSCUTIMER_CONTROL_PRESCALER_SHIFT 8U -#define XSCUTIMER_CONTROL_IRQ_ENABLE_MASK 0x00000004U /**< Intr enable */ -#define XSCUTIMER_CONTROL_AUTO_RELOAD_MASK 0x00000002U /**< Auto-reload */ -#define XSCUTIMER_CONTROL_ENABLE_MASK 0x00000001U /**< Timer enable */ -/* @} */ - -/** @name Interrupt Status register - * This register indicates the Timer counter register has reached zero. - * @{ - */ - -#define XSCUTIMER_ISR_EVENT_FLAG_MASK 0x00000001U /**< Event flag */ -/*@}*/ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/****************************************************************************/ -/** -* -* Write to the timer load register. This will also update the -* timer counter register with the new value. This macro can be used to -* change the time-out value. -* -* @param BaseAddr is the base address of the scu timer. -* @param Value is the count to be loaded in to the load register. -* -* @return None. -* -* @note C-style signature: -* void XScuTimer_SetLoadReg(u32 BaseAddr, u32 Value) -* -******************************************************************************/ -#define XScuTimer_SetLoadReg(BaseAddr, Value) \ - XScuTimer_WriteReg(BaseAddr, XSCUTIMER_LOAD_OFFSET, (Value)) - -/****************************************************************************/ -/** -* -* Returns the current timer load register value. -* -* @param BaseAddr is the base address of the scu timer. -* -* @return Contents of the timer load register. -* -* @note C-style signature: -* u32 XScuTimer_GetLoadReg(u32 BaseAddr) -* -******************************************************************************/ -#define XScuTimer_GetLoadReg(BaseAddr) \ - XScuTimer_ReadReg(BaseAddr, XSCUTIMER_LOAD_OFFSET) - -/****************************************************************************/ -/** -* -* Write to the timer counter register. -* -* @param BaseAddr is the base address of the scu timer. -* @param Value is the count to be loaded in to the counter register. -* -* @return None. -* -* @note C-style signature: -* void XScuTimer_SetCounterReg(u32 BaseAddr, u32 Value) -* -******************************************************************************/ -#define XScuTimer_SetCounterReg(BaseAddr, Value) \ - XScuTimer_WriteReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET, (Value)) - -/****************************************************************************/ -/** -* -* Returns the current timer counter register value. -* -* @param BaseAddr is the base address of the scu timer. -* -* @return Contents of the timer counter register. -* -* @note C-style signature: - u32 XScuTimer_GetCounterReg(u32 BaseAddr) -* -******************************************************************************/ -#define XScuTimer_GetCounterReg(BaseAddr) \ - XScuTimer_ReadReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET) - -/****************************************************************************/ -/** -* -* Write to the timer load register. This will also update the -* timer counter register with the new value. This macro can be used to -* change the time-out value. -* -* @param BaseAddr is the base address of the scu timer. -* @param Value is the count to be loaded in to the load register. -* -* @return None. -* -* @note C-style signature: -* void XScuTimer_SetControlReg(u32 BaseAddr, u32 Value) -* -******************************************************************************/ -#define XScuTimer_SetControlReg(BaseAddr, Value) \ - XScuTimer_WriteReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET, (Value)) - -/****************************************************************************/ -/** -* -* Returns the current timer load register value. -* -* @param BaseAddr is the base address of the scu timer. -* -* @return Contents of the timer load register. -* -* @note C-style signature: - u32 XScuTimer_GetControlReg(u32 BaseAddr) -* -******************************************************************************/ -#define XScuTimer_GetControlReg(BaseAddr) \ - XScuTimer_ReadReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET) - -/****************************************************************************/ -/** -* -* Write to the timer counter register. -* -* @param BaseAddr is the base address of the scu timer. -* @param Value is the count to be loaded in to the counter register. -* -* @return None. -* -* @note C-style signature: -* void XScuTimer_SetIntrReg(u32 BaseAddr, u32 Value) -* -******************************************************************************/ -#define XScuTimer_SetIntrReg(BaseAddr, Value) \ - XScuTimer_WriteReg(BaseAddr, XSCUTIMER_ISR_OFFSET, (Value)) - -/****************************************************************************/ -/** -* -* Returns the current timer counter register value. -* -* @param BaseAddr is the base address of the scu timer. -* -* @return Contents of the timer counter register. -* -* @note C-style signature: - u32 XScuTimer_GetIntrReg(u32 BaseAddr) -* -******************************************************************************/ -#define XScuTimer_GetIntrReg(BaseAddr) \ - XScuTimer_ReadReg(BaseAddr, XSCUTIMER_ISR_OFFSET) - -/****************************************************************************/ -/** -* -* Read from the given Timer register. -* -* @param BaseAddr is the base address of the device -* @param RegOffset is the register offset to be read -* -* @return The 32-bit value of the register -* -* @note C-style signature: -* u32 XScuTimer_ReadReg(u32 BaseAddr, u32 RegOffset) -* -*****************************************************************************/ -#define XScuTimer_ReadReg(BaseAddr, RegOffset) \ - Xil_In32((BaseAddr) + (RegOffset)) - -/****************************************************************************/ -/** -* -* Write to the given Timer register. -* -* @param BaseAddr is the base address of the device -* @param RegOffset is the register offset to be written -* @param Data is the 32-bit value to write to the register -* -* @return None. -* -* @note C-style signature: -* void XScuTimer_WriteReg(u32 BaseAddr, u32 RegOffset, u32 Data) -* -*****************************************************************************/ -#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data) \ - Xil_Out32((BaseAddr) + (RegOffset), (Data)) - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ - -#ifdef __cplusplus -} -#endif - -#endif /* end of protection macro */ -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a2ac43595243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a2ac43595243001d18b399c1eb9b3628 deleted file mode 100644 index e22e04d..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/10/a2ac43595243001d18b399c1eb9b3628 +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************/ -/** -* Copyright (c) 2019 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* @file xil_util.h -* @addtogroup common_utilities Common Utility APIs -* @{ -* @details -* -* This file contains xil utility functions declaration -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who      Date     Changes
-* ----- -------- -------- -----------------------------------------------
-* 6.4   mmd      04/21/19 First release.
-* 6.5   kal      02/29/20 Added Xil_ConvertStringToHexBE API
-* 7.3   kal      06/30/20 Converted Xil_Ceil macro to API
-*       rpo      08/19/20 Added function for read, modify and write
-*       bsv      08/21/20 Added XSECURE_TEMPORAL_CHECK macro to add
-*                         redundancy in security critical functions, to avoid
-*                         glitches from altering the return values of security
-*                         critical functions. The macro requires a label to be
-*                         passed to "go to" in case of error.
-*      kpt       09/03/20 Added XSECURE_TEMPORAL_IMPL macro for redundancy
-*      kal       09/22/20 Changed the param type from const char to const char*
-*                         to avoid copying key onto stack
-*      td        10/16/20 Added Xil_Strcpy, Xil_Strcat, Xil_SecureMemCpy and
-*                         Xil_MemCmp functions
-*      am        10/13/20 Resolved Coverity warning
-*      td        11/19/20 Updated XSECURE_TEMPORAL_CHECK and
-*                         XSECURE_TEMPORAL_IMPL to fix MISRA C Rule 15.3
-* 7.4  am        11/26/20 Added Xil_StrCpyRange function
-* 7.6  kpt       07/15/21 Added Xil_SecureZeroize function
-*
-* 
-* -*****************************************************************************/ - -#ifndef XIL_UTIL_H_ -#define XIL_UTIL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "xil_types.h" -#include "xil_io.h" -#include "xstatus.h" - -/*************************** Constant Definitions *****************************/ -#define XIL_SIZE_OF_NIBBLE_IN_BITS 4U -#define XIL_SIZE_OF_BYTE_IN_BITS 8U - -/* Maximum string length handled by Xil_ValidateHexStr function */ -#define XIL_MAX_HEX_STR_LEN 512U - - -/****************** Macros (Inline Functions) Definitions *********************/ -#ifdef __GNUC__ -/******************************************************************************/ -/** - * - * Updates the return value of the called function into Var and VarTmp variables - * for redundancy. This is to avoid glitches from altering the return values of - * security critical functions. - * - * @param Var is the variable which holds the return value of function - * executed - * @param VarTmp is the variable which holds the value stored in Var - * @param Function is the function to be executed - * @param Other params are arguments to the called function - * - * @return None - * - ******************************************************************************/ -#define XSECURE_TEMPORAL_IMPL(Var, VarTmp, Function, ...) \ - { \ - Var = XST_FAILURE; \ - VarTmp = XST_FAILURE; \ - Var = Function(__VA_ARGS__); \ - VarTmp = Var; \ - } - -/******************************************************************************/ -/** - * - * Adds redundancy while checking the status of the called function. - * This is to avoid glitches from altering the return values of security - * critical functions. The macro requires a label to be passed to "go to" - * in case of error. - * - * @param Label is the label defined in function and the control - * will jump to the label in case of XST_FAILURE - * @param Status is the variable which holds the return value of - * function executed - * @param Function is the function to be executed - * @param Other params are arguments to the called function - * - * @return None - * - ******************************************************************************/ -#define XSECURE_TEMPORAL_CHECK(Label, Status, Function, ...) \ - { \ - volatile int StatusTmp = XST_FAILURE; \ - XSECURE_TEMPORAL_IMPL(Status, StatusTmp, Function, __VA_ARGS__); \ - if ((Status != XST_SUCCESS) || \ - (StatusTmp != XST_SUCCESS)) { \ - Status |= StatusTmp;\ - goto Label; \ - } \ - } -#endif - -/*************************** Function Prototypes ******************************/ -/* Ceils the provided float value */ -int Xil_Ceil(float Value); - -/* Converts input character to nibble */ -u32 Xil_ConvertCharToNibble(u8 InChar, u8 *Num); - -/* Convert input hex string to array of 32-bits integers */ -u32 Xil_ConvertStringToHex(const char *Str, u32 *buf, u8 Len); - -/* Waits for specified event */ -u32 Xil_WaitForEvent(u32 RegAddr, u32 EventMask, u32 Event, u32 Timeout); - -/* Waits for specified events */ -u32 Xil_WaitForEvents(u32 EventsRegAddr, u32 EventsMask, u32 WaitEvents, - u32 Timeout, u32* Events); - -/* Validate input hex character */ -u32 Xil_IsValidHexChar(const char *Ch); - -/* Validate the input string contains only hexadecimal characters */ -u32 Xil_ValidateHexStr(const char *HexStr); - -/* Convert string to hex numbers in little enidian format */ -u32 Xil_ConvertStringToHexLE(const char *Str, u8 *Buf, u32 Len); - -/* Returns length of the input string */ -u32 Xil_Strnlen(const char *Str, u32 MaxLen); - -/* Convert string to hex numbers in big endian format */ -u32 Xil_ConvertStringToHexBE(const char * Str, u8 * Buf, u32 Len); - -/*Read, Modify and Write to an address*/ -void Xil_UtilRMW32(u32 Addr, u32 Mask, u32 Value); - -/* Copies source string to destination string */ -int Xil_Strcpy(char *DestPtr, const char *SrcPtr, const u32 Size); - -/* Copies specified range from source string to destination string */ -int Xil_StrCpyRange(const u8 *Src, u8 *Dst, u32 From, u32 To, u32 MaxSrcLen, - u32 MaxDstLen); - -/* Appends string2 to string1 */ -int Xil_Strcat(char* Str1Ptr, const char* Str2Ptr, const u32 Size); - -/* Copies Len bytes from source memory to destination memory */ -int Xil_SecureMemCpy(void * DestPtr, u32 DestPtrLen, const void * SrcPtr, u32 Len); - -/* Compares Len bytes from memory1 and memory2 */ -int Xil_MemCmp(const void * Buf1Ptr, const void * Buf2Ptr, u32 Len); - -/* Zeroizes the memory of given length */ -int Xil_SecureZeroize(u8 *DataPtr, const u32 Length); - -#ifdef __cplusplus -} -#endif - -#endif /* XIL_UTIL_H_ */ -/** -* @} End of "addtogroup common_utilities". -*/ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/30e9d0545243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/30e9d0545243001d18b399c1eb9b3628 deleted file mode 100644 index 229012b..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/30e9d0545243001d18b399c1eb9b3628 +++ /dev/null @@ -1,33 +0,0 @@ - -/******************************************************************* -* -* CAUTION: This file is automatically generated by HSI. -* Version: 2021.2 -* DO NOT EDIT. -* -* Copyright (C) 2010-2022 Xilinx, Inc. All Rights Reserved. -* SPDX-License-Identifier: MIT - -* -* Description: Driver configuration -* -*******************************************************************/ - -#include "xparameters.h" -#include "xscugic.h" - -/* -* The configuration table for devices -*/ - -XScuGic_Config XScuGic_ConfigTable[XPAR_XSCUGIC_NUM_INSTANCES] = -{ - { - XPAR_PS7_SCUGIC_0_DEVICE_ID, - XPAR_PS7_SCUGIC_0_BASEADDR, - XPAR_PS7_SCUGIC_0_DIST_BASEADDR, - {{0}} /**< Initialize the HandlerTable to 0 */ - } -}; - - diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/50c38a555243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/50c38a555243001d18b399c1eb9b3628 deleted file mode 100644 index 146017b..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/50c38a555243001d18b399c1eb9b3628 +++ /dev/null @@ -1,17 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2020 Xilinx, Inc. All rights reserved. -* -* SPDX-License-Identifier: MIT -* -******************************************************************************/ -#include "xil_types.h" - -/* Stub for iserror() function */ -__attribute__((weak)) s32 _sys_iserror(s32 status) -{ - if (status < 0) { - return 1; - } - - return 0; -} diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a0d0c6575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a0d0c6575243001d18b399c1eb9b3628 deleted file mode 100644 index 9e7a741..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a0d0c6575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,284 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/****************************************************************************/ -/** -* -* @file xdevcfg_intr.c -* @addtogroup devcfg_v3_7 -* @{ -* -* Contains the implementation of interrupt related functions of the XDcfg -* driver. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- ---------------------------------------------
-* 1.00a hvm 02/07/11 First release
-* 2.01a nm  07/07/12 Updated the XDcfg_IntrClear function to directly
-*		     set the mask instead of oring it with the
-*		     value read from the interrupt status register
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xdevcfg.h" - -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -/************************** Function Prototypes ******************************/ - -/************************** Variable Definitions *****************************/ - -/****************************************************************************/ -/** -* -* This function enables the specified interrupts in the device. -* -* @param InstancePtr is a pointer to the XDcfg instance. -* @param Mask is the bit-mask of the interrupts to be enabled. -* Bit positions of 1 will be enabled. Bit positions of 0 will -* keep the previous setting. This mask is formed by OR'ing -* XDCFG_INT_* bits defined in xdevcfg_hw.h. -* -* @return None. -* -* @note None. -* -*****************************************************************************/ -void XDcfg_IntrEnable(XDcfg *InstancePtr, u32 Mask) -{ - u32 RegValue; - - /* - * Assert the arguments. - */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Enable the specified interrupts in the Interrupt Mask Register. - */ - RegValue = XDcfg_ReadReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_MASK_OFFSET); - RegValue &= ~(Mask & XDCFG_IXR_ALL_MASK); - XDcfg_WriteReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_MASK_OFFSET, - RegValue); -} - - -/****************************************************************************/ -/** -* -* This function disables the specified interrupts in the device. -* -* @param InstancePtr is a pointer to the XDcfg instance. -* @param Mask is the bit-mask of the interrupts to be disabled. -* Bit positions of 1 will be disabled. Bit positions of 0 will -* keep the previous setting. This mask is formed by OR'ing -* XDCFG_INT_* bits defined in xdevcfg_hw.h. -* -* @return None. -* -* @note None. -* -*****************************************************************************/ -void XDcfg_IntrDisable(XDcfg *InstancePtr, u32 Mask) -{ - u32 RegValue; - - /* - * Assert the arguments. - */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Disable the specified interrupts in the Interrupt Mask Register. - */ - RegValue = XDcfg_ReadReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_MASK_OFFSET); - RegValue |= (Mask & XDCFG_IXR_ALL_MASK); - XDcfg_WriteReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_MASK_OFFSET, - RegValue); -} -/****************************************************************************/ -/** -* -* This function returns the enabled interrupts read from the Interrupt Mask -* Register. Use the XDCFG_INT_* constants defined in xdevcfg_hw.h -* to interpret the returned value. -* -* @param InstancePtr is a pointer to the XDcfg instance. -* -* @return A 32-bit value representing the contents of the IMR. -* -* @note None. -* -*****************************************************************************/ -u32 XDcfg_IntrGetEnabled(XDcfg *InstancePtr) -{ - /* - * Assert the arguments. - */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Return the value read from the Interrupt Mask Register. - */ - return (~ XDcfg_ReadReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_MASK_OFFSET)); -} - -/****************************************************************************/ -/** -* -* This function returns the interrupt status read from Interrupt Status -* Register. Use the XDCFG_INT_* constants defined in xdevcfg_hw.h -* to interpret the returned value. -* -* @param InstancePtr is a pointer to the XDcfg instance. -* -* @return A 32-bit value representing the contents of the Interrupt -* Status register. -* -* @note None. -* -*****************************************************************************/ -u32 XDcfg_IntrGetStatus(XDcfg *InstancePtr) -{ - /* - * Assert the arguments. - */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Return the value read from the Interrupt Status register. - */ - return XDcfg_ReadReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_STS_OFFSET); -} - -/****************************************************************************/ -/** -* -* This function clears the specified interrupts in the Interrupt Status -* Register. -* -* @param InstancePtr is a pointer to the XDcfg instance. -* @param Mask is the bit-mask of the interrupts to be cleared. -* Bit positions of 1 will be cleared. Bit positions of 0 will not -* change the previous interrupt status. This mask is formed by -* OR'ing XDCFG_INT_* bits which are defined in xdevcfg_hw.h. -* -* @return None. -* -* @note None. -* -*****************************************************************************/ -void XDcfg_IntrClear(XDcfg *InstancePtr, u32 Mask) -{ - /* - * Assert the arguments. - */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - XDcfg_WriteReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_STS_OFFSET, - Mask); - -} - -/*****************************************************************************/ -/** -* The interrupt handler for the Device Config Interface. -* -* Events are signaled to upper layer for proper handling. -* -* -* @param InstancePtr is a pointer to the XDcfg instance. -* -* @return None. -* -* @note None. -* -****************************************************************************/ -void XDcfg_InterruptHandler(XDcfg *InstancePtr) -{ - u32 IntrStatusReg; - - /* - * Assert validates the input arguments. - */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Read the Interrupt status register. - */ - IntrStatusReg = XDcfg_ReadReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_STS_OFFSET); - - /* - * Write the status back to clear the interrupts so that no - * subsequent interrupts are missed while processing this interrupt. - * This also does the DMA acknowledgment automatically. - */ - XDcfg_WriteReg(InstancePtr->Config.BaseAddr, - XDCFG_INT_STS_OFFSET, IntrStatusReg); - - /* - * Signal application that there are events to handle. - */ - InstancePtr->StatusHandler(InstancePtr->CallBackRef, - IntrStatusReg); - -} - -/****************************************************************************/ -/** -* -* This function sets the handler that will be called when an event (interrupt) -* occurs that needs application's attention. -* -* @param InstancePtr is a pointer to the XDcfg instance -* @param CallBackFunc is the address of the callback function. -* @param CallBackRef is a user data item that will be passed to the -* callback function when it is invoked. -* -* @return None. -* -* @note None. -* -* -*****************************************************************************/ -void XDcfg_SetHandler(XDcfg *InstancePtr, void *CallBackFunc, - void *CallBackRef) -{ - /* - * Asserts validate the input arguments - * CallBackRef not checked, no way to know what is valid - */ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(CallBackFunc != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - InstancePtr->StatusHandler = (XDcfg_IntrHandler) CallBackFunc; - InstancePtr->CallBackRef = CallBackRef; -} -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a17482575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a17482575243001d18b399c1eb9b3628 deleted file mode 100644 index 878d575..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/11/a17482575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,261 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2013 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* @file xil_misc_psreset_api.h -* -* This file contains the various register definitions and function prototypes for -* implementing the reset functionality of zynq ps devices -* -* MODIFICATION HISTORY: -* -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 1.00b kpc 03/07/13 First release. -* -* -******************************************************************************/ - -#ifndef XIL_MISC_RESET_H /* prevent circular inclusions */ -#define XIL_MISC_RESET_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/***************************** Include Files *********************************/ -#include "xil_types.h" -#include "xil_io.h" - -/************************** Constant Definitions *****************************/ - -/** - *@cond nocomments - */ - -#define XDDRC_CTRL_BASEADDR 0xF8006000U -#define XSLCR_BASEADDR 0xF8000000U -/**< OCM configuration register */ -#define XSLCR_OCM_CFG_ADDR (XSLCR_BASEADDR + 0x00000910U) -/**< SLCR unlock register */ -#define XSLCR_UNLOCK_ADDR (XSLCR_BASEADDR + 0x00000008U) -/**< SLCR GEM0 rx clock control register */ -#define XSLCR_GEM0_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000138U) -/**< SLCR GEM1 rx clock control register */ -#define XSLCR_GEM1_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x0000013CU) -/**< SLCR GEM0 clock control register */ -#define XSLCR_GEM0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000140U) -/**< SLCR GEM1 clock control register */ -#define XSLCR_GEM1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000144U) -/**< SLCR SMC clock control register */ -#define XSLCR_SMC_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000148U) -/**< SLCR GEM reset control register */ -#define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000214U) -/**< SLCR USB0 clock control register */ -#define XSLCR_USB0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000130U) -/**< SLCR USB1 clock control register */ -#define XSLCR_USB1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000134U) -/**< SLCR USB1 reset control register */ -#define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000210U) -/**< SLCR SMC reset control register */ -#define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000234U) -/**< SLCR Level shifter enable register */ -#define XSLCR_LVL_SHFTR_EN_ADDR (XSLCR_BASEADDR + 0x00000900U) -/**< SLCR ARM pll control register */ -#define XSLCR_ARM_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x00000100U) -/**< SLCR DDR pll control register */ -#define XSLCR_DDR_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x00000104U) -/**< SLCR IO pll control register */ -#define XSLCR_IO_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x00000108U) -/**< SLCR ARM pll configuration register */ -#define XSLCR_ARM_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x00000110U) -/**< SLCR DDR pll configuration register */ -#define XSLCR_DDR_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x00000114U) -/**< SLCR IO pll configuration register */ -#define XSLCR_IO_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x00000118U) -/**< SLCR ARM clock control register */ -#define XSLCR_ARM_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000120U) -/**< SLCR DDR clock control register */ -#define XSLCR_DDR_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x00000124U) -/**< SLCR MIO pin address register */ -#define XSLCR_MIO_PIN_00_ADDR (XSLCR_BASEADDR + 0x00000700U) -/**< SLCR DMAC reset control address register */ -#define XSLCR_DMAC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x0000020CU) -/**< SLCR USB reset control address register */ -/*#define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000210U)*/ -/**< SLCR GEM reset control address register */ -/*#define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000214U)*/ -/**< SLCR SDIO reset control address register */ -#define XSLCR_SDIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000218U) -/**< SLCR SPI reset control address register */ -#define XSLCR_SPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x0000021CU) -/**< SLCR CAN reset control address register */ -#define XSLCR_CAN_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000220U) -/**< SLCR I2C reset control address register */ -#define XSLCR_I2C_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000224U) -/**< SLCR UART reset control address register */ -#define XSLCR_UART_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000228U) -/**< SLCR GPIO reset control address register */ -#define XSLCR_GPIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x0000022CU) -/**< SLCR LQSPI reset control address register */ -#define XSLCR_LQSPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000230U) -/**< SLCR SMC reset control address register */ -/*#define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000234U)*/ -/**< SLCR OCM reset control address register */ -#define XSLCR_OCM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x00000238U) - -/**< SMC mem controller clear config register */ -#define XSMC_MEMC_CLR_CONFIG_OFFSET 0x0000000CU -/**< SMC idlecount configuration register */ -#define XSMC_REFRESH_PERIOD_0_OFFSET 0x00000020U -#define XSMC_REFRESH_PERIOD_1_OFFSET 0x00000024U -/**< SMC ECC configuration register */ -#define XSMC_ECC_MEMCFG1_OFFSET 0x00000404U -/**< SMC ECC command 1 register */ -#define XSMC_ECC_MEMCMD1_OFFSET 0x00000404U -/**< SMC ECC command 2 register */ -#define XSMC_ECC_MEMCMD2_OFFSET 0x00000404U - -/**< SLCR unlock code */ -#define XSLCR_UNLOCK_CODE 0x0000DF0DU - -/**< SMC mem clear configuration mask */ -#define XSMC_MEMC_CLR_CONFIG_MASK 0x000005FU -/**< SMC ECC memconfig 1 reset value */ -#define XSMC_ECC_MEMCFG1_RESET_VAL 0x0000043U -/**< SMC ECC memcommand 1 reset value */ -#define XSMC_ECC_MEMCMD1_RESET_VAL 0x01300080U -/**< SMC ECC memcommand 2 reset value */ -#define XSMC_ECC_MEMCMD2_RESET_VAL 0x01E00585U - -/**< DDR controller reset bit mask */ -#define XDDRPS_CTRL_RESET_MASK 0x00000001U -/**< SLCR OCM configuration reset value*/ -#define XSLCR_OCM_CFG_RESETVAL 0x00000008U -/**< SLCR OCM bank selection mask*/ -#define XSLCR_OCM_CFG_HIADDR_MASK 0x0000000FU -/**< SLCR level shifter enable mask*/ -#define XSLCR_LVL_SHFTR_EN_MASK 0x0000000FU - -/**< SLCR PLL register reset values */ -#define XSLCR_ARM_PLL_CTRL_RESET_VAL 0x0001A008U -#define XSLCR_DDR_PLL_CTRL_RESET_VAL 0x0001A008U -#define XSLCR_IO_PLL_CTRL_RESET_VAL 0x0001A008U -#define XSLCR_ARM_PLL_CFG_RESET_VAL 0x00177EA0U -#define XSLCR_DDR_PLL_CFG_RESET_VAL 0x00177EA0U -#define XSLCR_IO_PLL_CFG_RESET_VAL 0x00177EA0U -#define XSLCR_ARM_CLK_CTRL_RESET_VAL 0x1F000400U -#define XSLCR_DDR_CLK_CTRL_RESET_VAL 0x18400003U - -/**< SLCR MIO register default values */ -#define XSLCR_MIO_PIN_00_RESET_VAL 0x00001601U -#define XSLCR_MIO_PIN_02_RESET_VAL 0x00000601U - -/**< SLCR Reset control registers default values */ -#define XSLCR_DMAC_RST_CTRL_VAL 0x00000001U -#define XSLCR_GEM_RST_CTRL_VAL 0x000000F3U -#define XSLCR_USB_RST_CTRL_VAL 0x00000003U -#define XSLCR_I2C_RST_CTRL_VAL 0x00000003U -#define XSLCR_SPI_RST_CTRL_VAL 0x0000000FU -#define XSLCR_UART_RST_CTRL_VAL 0x0000000FU -#define XSLCR_QSPI_RST_CTRL_VAL 0x00000003U -#define XSLCR_GPIO_RST_CTRL_VAL 0x00000001U -#define XSLCR_SMC_RST_CTRL_VAL 0x00000003U -#define XSLCR_OCM_RST_CTRL_VAL 0x00000001U -#define XSLCR_SDIO_RST_CTRL_VAL 0x00000033U -#define XSLCR_CAN_RST_CTRL_VAL 0x00000003U - -/** - *@endcond - */ - -/**************************** Type Definitions *******************************/ - -/* the following data type is used to hold a null terminated version string - * consisting of the following format, "X.YYX" - */ - - -/***************** Macros (Inline Functions) Definitions *********************/ - - -/************************** Function Prototypes ******************************/ -/* - * Performs reset operation to the ddr interface - */ -void XDdr_ResetHw(void); -/* - * Map the ocm region to post bootrom state - */ -void XOcm_Remap(void); -/* - * Performs the smc interface reset - */ -void XSmc_ResetHw(u32 BaseAddress); -/* - * updates the MIO registers with reset values - */ -void XSlcr_MioWriteResetValues(void); -/* - * updates the PLL and clock registers with reset values - */ -void XSlcr_PllWriteResetValues(void); -/* - * Disables the level shifters - */ -void XSlcr_DisableLevelShifters(void); -/* - * provides softreset to the GPIO interface - */ -void XSlcr_GpioPsReset(void); -/* - * provides softreset to the DMA interface - */ -void XSlcr_DmaPsReset(void); -/* - * provides softreset to the SMC interface - */ -void XSlcr_SmcPsReset(void); -/* - * provides softreset to the CAN interface - */ -void XSlcr_CanPsReset(void); -/* - * provides softreset to the Uart interface - */ -void XSlcr_UartPsReset(void); -/* - * provides softreset to the I2C interface - */ -void XSlcr_I2cPsReset(void); -/* - * provides softreset to the SPI interface - */ -void XSlcr_SpiPsReset(void); -/* - * provides softreset to the QSPI interface - */ -void XSlcr_QspiPsReset(void); -/* - * provides softreset to the USB interface - */ -void XSlcr_UsbPsReset(void); -/* - * provides softreset to the GEM interface - */ -void XSlcr_EmacPsReset(void); -/* - * provides softreset to the OCM interface - */ -void XSlcr_OcmReset(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* XIL_MISC_RESET_H */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/10fd0d565243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/10fd0d565243001d18b399c1eb9b3628 deleted file mode 100644 index e9a9ace..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/10fd0d565243001d18b399c1eb9b3628 +++ /dev/null @@ -1,124 +0,0 @@ -;/****************************************************************************** -;* Copyright (c) 2020 - 2021 Xilinx, Inc. All rights reserved. -;* -;* SPDX-License-Identifier: MIT -;* -;******************************************************************************/ -;/*****************************************************************************/ -;/** -;* @file asm_vectors.S -;* -;* This file contains the initial vector table for the Cortex R5 processor -;* as per armclang compiler -;* -;*
-;* MODIFICATION HISTORY:
-;*
-;* Ver   Who     Date     Changes
-;* ----- ------- -------- ---------------------------------------------------
-;* 7.3  dp  06/25/20   Initial version for armclang
-;* 
-;* -;* @note -;* -;* None. -;* -;******************************************************************************/ - - EXPORT _vector_table - - IMPORT _boot - IMPORT FIQInterrupt - IMPORT IRQInterrupt - IMPORT SWInterrupt - IMPORT DataAbortInterrupt - IMPORT PrefetchAbortInterrupt - IMPORT UndefinedExceptionAddr - IMPORT UndefinedException - IMPORT DataAbortAddr - IMPORT PrefetchAbortAddr - - EXPORT IRQHandler - - AREA |vectors|, CODE - REQUIRE8 {TRUE} - PRESERVE8 {TRUE} - ENTRY ; Define this an entry point - -_vector_table - ldr pc, =_boot - ldr pc, =Undefined - ldr pc, =SVCHandler - ldr pc, =PrefetchAbortHandler - ldr pc, =DataAbortHandler - NOP ;Placeholder for address exception vector - ldr pc, =IRQHandler - ldr pc, =FIQHandler - -IRQHandler ;IRQ vector handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code -#ifndef __SOFTFP__ - - vpush {d0-d7} ;Store floating point registers/ - vmrs r1, FPSCR - push {r1} - vmrs r1, FPEXC - push {r1} -#endif - bl IRQInterrupt ;IRQ vector -#ifndef __SOFTFP__ - - pop {r1} ;Restore floating point registers - vmsr FPEXC, r1 - pop {r1} - vmsr FPSCR, r1 - vpop {d0-d7} -#endif - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - subs pc, lr, #4 ;adjust return -FIQHandler ;FIQ vector handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code -FIQLoop - bl FIQInterrupt ;FIQ vector - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - subs pc, lr, #4 ;adjust return - -Undefined ;Undefined handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code - ldr r0, =UndefinedExceptionAddr - sub r1, lr, #4 - str r1, [r0] ;Store address of instruction causing undefined exception - - bl UndefinedException ;UndefinedException: call C function here - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - movs pc, lr - -SVCHandler ;SWI handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code - tst r0, #0x20 ;check the T bit - ldrneh r0, [lr,#-2] ;Thumb mode - bicne r0, r0, #0xff00 ;Thumb mode - ldreq r0, [lr,#-4] ;ARM mode - biceq r0, r0, #0xff000000 ;ARM mode - bl SWInterrupt ;SWInterrupt: call C function here - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - movs pc, lr ;adjust return - -DataAbortHandler ;Data Abort handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code - ldr r0, =DataAbortAddr - sub r1, lr, #8 - str r1, [r0] ;Stores instruction causing data abort - bl DataAbortInterrupt ;ataAbortInterrupt :call C function here - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - subs pc, lr, #8 ;adjust return - -PrefetchAbortHandler ;Prefetch Abort handler - stmdb sp!,{r0-r3,r12,lr} ;state save from compiled code - ldr r0, =PrefetchAbortAddr - sub r1, lr, #4 - str r1, [r0] ;Stores instruction causing prefetch abort - bl PrefetchAbortInterrupt ;PrefetchAbortInterrupt: call C function here - ldmia sp!,{r0-r3,r12,lr} ;state restore from compiled code - subs pc, lr, #4 ;adjust return - END diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/204efb575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/204efb575243001d18b399c1eb9b3628 deleted file mode 100644 index 171e00b..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/204efb575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,1603 +0,0 @@ -/****************************************************************************** -* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xqspips.c -* @addtogroup qspips_v3_9 -* @{ -* -* Contains implements the interface functions of the XQspiPs driver. -* See xqspips.h for a detailed description of the device and driver. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who Date     Changes
-* ----- --- -------- -----------------------------------------------
-* 1.00  sdm 11/25/10 First release
-* 2.00a kka 07/25/12 Removed XQspiPs_GetWriteData API.
-*		     The XQspiPs_SetSlaveSelect has been modified to remove
-*		     the argument of the slave select as the QSPI controller
-*		     only supports one slave.
-* 		     XQspiPs_GetSlaveSelect API has been removed
-* 		     Added logic to XQspiPs_GetReadData to handle data
-*		     shift for normal data reads and instruction/status
-*		     reads differently based on the ShiftReadData flag.
-* 		     Removed the selection for the following options:
-*		     Master mode (XQSPIPS_MASTER_OPTION) and
-*		     Flash interface mode (XQSPIPS_FLASH_MODE_OPTION) option
-*		     as the QSPI driver supports the Master mode
-*		     and Flash Interface mode and doesnot support
-*		     Slave mode or the legacy mode.
-*		     Modified the XQspiPs_PolledTransfer and XQspiPs_Transfer
-*		     APIs so that the last argument (IsInst) specifying whether
-*		     it is instruction or data has been removed. The first byte
-*		     in the SendBufPtr argument of these APIs specify the
-*		     instruction to be sent to the Flash Device.
-*		     The XQspiPs_PolledTransfer function has been updated
-*		     to fill the data to fifo depth.
-*		     This version of the driver fixes CRs 670197/663787.
-* 2.01a sg  02/03/13 Added flash opcodes for DUAL_IO_READ,QUAD_IO_READ.
-*		     Created macros XQspiPs_IsManualStart and
-*		     XQspiPs_IsManualChipSelect.
-*		     Changed QSPI transfer logic for polled and interrupt
-*		     modes to be based on filled tx fifo count and receive
-*		     based on it. RXNEMPTY interrupt is not used.
-*		     Added assertions to XQspiPs_LqspiRead function.
-*
-* 2.02a hk  05/14/13 Added enable and disable to the XQspiPs_LqspiRead()
-*			 function
-*            Added instructions for bank selection, die erase and
-*            flag status register to the flash instruction table
-*            Handling for instructions not in flash instruction
-*			 table added. Checking for Tx FIFO empty when switching from
-*			 TXD1/2/3 to TXD0 added. If WRSR instruction is sent with
-*            byte count 3 (spansion), instruction size and TXD register
-*			 changed accordingly. CR# 712502 and 703869.
-*            Added (#ifdef linear base address) in the Linear read function.
-*            Changed  XPAR_XQSPIPS_0_LINEAR_BASEADDR to
-*            XPAR_PS7_QSPI_LINEAR_0_S_AXI_BASEADDR in
-*            XQspiPs_LqspiRead function. Fix for CR#718141
-*
-* 2.03a hk  09/05/13 Modified polled and interrupt transfers to make use of
-*                    thresholds. This is to improve performance.
-*                    Added RX and TX threshold reset to one in XQspiPs_Abort.
-*                    Added RX threshold reset(1) after transfer in polled and
-*                    interrupt transfers. Made changes to make sure threshold
-*                    change is done only when no transfer is in progress.
-* 3.1   hk  08/13/14 When writing to the configuration register, set/reset
-*                    required bits leaving reserved bits untouched. CR# 796813.
-* 3.2	sk	02/05/15 Add SLCR reset in abort function as a workaround because
-* 					 controller does not update FIFO status flags as expected
-* 					 when thresholds are used.
-* 3.3   sk  11/07/15 Modified the API prototypes according to MISRAC standards
-*                    to remove compilation warnings. CR# 868893.
-* 3.5	tjs 13/08/18 Fixed compilation warnings for ARMCC.
-* 3.6	akm 03/28/19 Fixed memory leak issue while reading from qspi.(CR#1016357)
-* 3.6 	akm 04/15/19 Modified the mask in XQspiPs_GetReadData() API to retrieve
-*		     configuration register values of both the Flashes in dual
-*		     parellel connection.
-* 3.7	akm 11/19/19 Fixed Coverity unused value warning in XQspiPs_PolledTransfer()
-* 			and XQspiPs_Transfer() APIs.
-* 3.7	akm 03/19/20 Modified XQspiPs_PolledTransfer(), XQspiPs_Transfer() and
-*			XQspiPs_InterruptHandler() APIs to fill TX FIFO with valid
-*			data when RX buffer is not NULL.
-*
-* 
-* -******************************************************************************/ - -/***************************** Include Files *********************************/ - -#include "xqspips.h" - -/************************** Constant Definitions *****************************/ - - -/**************************** Type Definitions *******************************/ - -/** - * This typedef defines qspi flash instruction format - */ -typedef struct { - u8 OpCode; /**< Operational code of the instruction */ - u8 InstSize; /**< Size of the instruction including address bytes */ - u8 TxOffset; /**< Register address where instruction has to be - written */ -} XQspiPsInstFormat; - -/***************** Macros (Inline Functions) Definitions *********************/ - -#define ARRAY_SIZE(Array) (sizeof(Array) / sizeof((Array)[0])) - -/************************** Function Prototypes ******************************/ -static void XQspiPs_GetReadData(XQspiPs *InstancePtr, u32 Data, u8 Size); -static void StubStatusHandler(void *CallBackRef, u32 StatusEvent, - unsigned ByteCount); - -/************************** Variable Definitions *****************************/ - -/* - * List of all the QSPI instructions and its format - */ -static XQspiPsInstFormat FlashInst[] = { - { XQSPIPS_FLASH_OPCODE_WREN, 1, XQSPIPS_TXD_01_OFFSET }, - { XQSPIPS_FLASH_OPCODE_WRDS, 1, XQSPIPS_TXD_01_OFFSET }, - { XQSPIPS_FLASH_OPCODE_RDSR1, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_RDSR2, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_WRSR, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_PP, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_SE, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_BE_32K, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_BE_4K, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_BE, 1, XQSPIPS_TXD_01_OFFSET }, - { XQSPIPS_FLASH_OPCODE_ERASE_SUS, 1, XQSPIPS_TXD_01_OFFSET }, - { XQSPIPS_FLASH_OPCODE_ERASE_RES, 1, XQSPIPS_TXD_01_OFFSET }, - { XQSPIPS_FLASH_OPCODE_RDID, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_NORM_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_FAST_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_DUAL_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_QUAD_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_DUAL_IO_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_QUAD_IO_READ, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_BRWR, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_BRRD, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_EARWR, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_EARRD, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_DIE_ERASE, 4, XQSPIPS_TXD_00_OFFSET }, - { XQSPIPS_FLASH_OPCODE_READ_FLAG_SR, 2, XQSPIPS_TXD_10_OFFSET }, - { XQSPIPS_FLASH_OPCODE_CLEAR_FLAG_SR, 1, XQSPIPS_TXD_01_OFFSET }, - /* Add all the instructions supported by the flash device */ -}; - -/*****************************************************************************/ -/** -* -* Initializes a specific XQspiPs instance such that the driver is ready to use. -* -* The state of the device after initialization is: -* - Master mode -* - Active high clock polarity -* - Clock phase 0 -* - Baud rate divisor 2 -* - Transfer width 32 -* - Master reference clock = pclk -* - No chip select active -* - Manual CS and Manual Start disabled -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param ConfigPtr is a reference to a structure containing information -* about a specific QSPI device. This function initializes an -* InstancePtr object for a specific device specified by the -* contents of Config. -* @param EffectiveAddr is the device base address in the virtual memory -* address space. The caller is responsible for keeping the address -* mapping from EffectiveAddr to the device physical base address -* unchanged once this function is invoked. Unexpected errors may -* occur if the address mapping changes after this function is -* called. If address translation is not used, use -* ConfigPtr->Config.BaseAddress for this device. -* -* @return -* - XST_SUCCESS if successful. -* - XST_DEVICE_IS_STARTED if the device is already started. -* It must be stopped to re-initialize. -* -* @note None. -* -******************************************************************************/ -int XQspiPs_CfgInitialize(XQspiPs *InstancePtr, XQspiPs_Config *ConfigPtr, - u32 EffectiveAddr) -{ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(ConfigPtr != NULL); - - /* - * If the device is busy, disallow the initialize and return a status - * indicating it is already started. This allows the user to stop the - * device and re-initialize, but prevents a user from inadvertently - * initializing. This assumes the busy flag is cleared at startup. - */ - if (InstancePtr->IsBusy == TRUE) { - return XST_DEVICE_IS_STARTED; - } - - /* - * Set some default values. - */ - InstancePtr->IsBusy = FALSE; - - InstancePtr->Config.BaseAddress = EffectiveAddr; - InstancePtr->StatusHandler = StubStatusHandler; - - InstancePtr->SendBufferPtr = NULL; - InstancePtr->RecvBufferPtr = NULL; - InstancePtr->RequestedBytes = 0; - InstancePtr->RemainingBytes = 0; - InstancePtr->IsReady = XIL_COMPONENT_IS_READY; - - InstancePtr->Config.ConnectionMode = ConfigPtr->ConnectionMode; - - /* - * Reset the QSPI device to get it into its initial state. It is - * expected that device configuration will take place after this - * initialization is done, but before the device is started. - */ - XQspiPs_Reset(InstancePtr); - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* -* Resets the QSPI device. Reset must only be called after the driver has been -* initialized. Any data transfer that is in progress is aborted. -* -* The upper layer software is responsible for re-configuring (if necessary) -* and restarting the QSPI device after the reset. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -void XQspiPs_Reset(XQspiPs *InstancePtr) -{ - u32 ConfigReg; - - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Abort any transfer that is in progress - */ - XQspiPs_Abort(InstancePtr); - - /* - * Write default value to configuration register. - * Do not modify reserved bits. - */ - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_RESET_MASK_SET; - ConfigReg &= ~XQSPIPS_CR_RESET_MASK_CLR; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, XQSPIPS_CR_OFFSET, - ConfigReg); -} - -/*****************************************************************************/ -/** -* -* Aborts a transfer in progress by disabling the device and flush the RxFIFO. -* The byte counts are cleared, the busy flag is cleared. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return None. -* -* @note -* -* This function does a read/modify/write of the config register. The user of -* this function needs to take care of critical sections. -* -******************************************************************************/ -void XQspiPs_Abort(XQspiPs *InstancePtr) -{ - u32 ConfigReg; - u32 IsLock; - - XQspiPs_Disable(InstancePtr); - - /* - * De-assert slave select lines. - */ - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= (XQSPIPS_CR_SSCTRL_MASK | XQSPIPS_CR_SSFORCE_MASK); - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - - /* - * QSPI Software Reset - */ - IsLock = XQspiPs_ReadReg(XPAR_XSLCR_0_BASEADDR, SLCR_LOCKSTA); - if (IsLock) { - XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_UNLOCK, - SLCR_UNLOCK_MASK); - } - XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, LQSPI_RST_CTRL, - LQSPI_RST_CTRL_MASK); - XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, LQSPI_RST_CTRL, 0x0); - if (IsLock) { - XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_LOCK, - SLCR_LOCK_MASK); - } - - /* - * Set the RX and TX FIFO threshold to reset value (one) - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXWR_RESET_VALUE); - - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXWR_OFFSET, XQSPIPS_TXWR_RESET_VALUE); - - InstancePtr->RemainingBytes = 0; - InstancePtr->RequestedBytes = 0; - InstancePtr->IsBusy = FALSE; -} - -/*****************************************************************************/ -/** -* -* Transfers specified data on the QSPI bus. Initiates bus communication and -* sends/receives data to/from the selected QSPI slave. For every byte sent, -* a byte is received. -* -* The caller has the option of providing two different buffers for send and -* receive, or one buffer for both send and receive, or no buffer for receive. -* The receive buffer must be at least as big as the send buffer to prevent -* unwanted memory writes. This implies that the byte count passed in as an -* argument must be the smaller of the two buffers if they differ in size. -* Here are some sample usages: -*
-*   XQspiPs_Transfer(InstancePtr, SendBuf, RecvBuf, ByteCount)
-*	The caller wishes to send and receive, and provides two different
-*	buffers for send and receive.
-*
-*   XQspiPs_Transfer(InstancePtr, SendBuf, NULL, ByteCount)
-*	The caller wishes only to send and does not care about the received
-*	data. The driver ignores the received data in this case.
-*
-*   XQspiPs_Transfer(InstancePtr, SendBuf, SendBuf, ByteCount)
-*	The caller wishes to send and receive, but provides the same buffer
-*	for doing both. The driver sends the data and overwrites the send
-*	buffer with received data as it transfers the data.
-*
-*   XQspiPs_Transfer(InstancePtr, RecvBuf, RecvBuf, ByteCount)
-*	The caller wishes to only receive and does not care about sending
-*	data.  In this case, the caller must still provide a send buffer, but
-*	it can be the same as the receive buffer if the caller does not care
-*	what it sends.  The device must send N bytes of data if it wishes to
-*	receive N bytes of data.
-* 
-* Although this function takes entire buffers as arguments, the driver can only -* transfer a limited number of bytes at a time, limited by the size of the -* FIFO. A call to this function only starts the transfer, then subsequent -* transfers of the data is performed by the interrupt service routine until -* the entire buffer has been transferred. The status callback function is -* called when the entire buffer has been sent/received. -* -* This function is non-blocking. The SetSlaveSelect function must be called -* prior to this function. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param SendBufPtr is a pointer to a data buffer that needs to be -* transmitted. This buffer must not be NULL. -* @param RecvBufPtr is a pointer to a buffer for received data. -* This argument can be NULL if do not care about receiving. -* @param ByteCount contains the number of bytes to send/receive. -* The number of bytes received always equals the number of bytes -* sent. -* -* @return -* - XST_SUCCESS if the buffers are successfully handed off to the -* device for transfer. -* - XST_DEVICE_BUSY indicates that a data transfer is already in -* progress. This is determined by the driver. -* -* @note -* -* This function is not thread-safe. The higher layer software must ensure that -* no two threads are transferring data on the QSPI bus at the same time. -* -******************************************************************************/ -s32 XQspiPs_Transfer(XQspiPs *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, - u32 ByteCount) -{ - u32 StatusReg; - u32 ConfigReg; - u8 Instruction; - u32 Data; - unsigned int Index; - u8 TransCount = 0; - XQspiPsInstFormat *CurrInst; - XQspiPsInstFormat NewInst[2]; - u8 SwitchFlag = 0; - - CurrInst = &NewInst[0]; - - /* - * The RecvBufPtr argument can be null - */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(SendBufPtr != NULL); - Xil_AssertNonvoid(ByteCount > 0); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Check whether there is another transfer in progress. Not thread-safe. - */ - if (InstancePtr->IsBusy) { - return XST_DEVICE_BUSY; - } - - /* - * Set the busy flag, which will be cleared in the ISR when the - * transfer is entirely done. - */ - InstancePtr->IsBusy = TRUE; - - /* - * Set up buffer pointers. - */ - InstancePtr->SendBufferPtr = SendBufPtr; - InstancePtr->RecvBufferPtr = RecvBufPtr; - - InstancePtr->RequestedBytes = ByteCount; - InstancePtr->RemainingBytes = ByteCount; - - /* - * The first byte with every chip-select assertion is always - * expected to be an instruction for flash interface mode - */ - Instruction = *InstancePtr->SendBufferPtr; - - for (Index = 0 ; Index < ARRAY_SIZE(FlashInst); Index++) { - if (Instruction == FlashInst[Index].OpCode) { - break; - } - } - - /* - * Set the RX FIFO threshold - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXFIFO_THRESHOLD_OPT); - - /* - * If the slave select is "Forced" or under manual control, - * set the slave select now, before beginning the transfer. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg &= ~XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, - ConfigReg); - } - - /* - * Enable the device. - */ - XQspiPs_Enable(InstancePtr); - - /* - * Clear all the interrupts. - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, XQSPIPS_SR_OFFSET, - XQSPIPS_IXR_WR_TO_CLR_MASK); - - if (Index < ARRAY_SIZE(FlashInst)) { - CurrInst = &FlashInst[Index]; - /* - * Check for WRSR instruction which has different size for - * Spansion (3 bytes) and Micron (2 bytes) - */ - if ((CurrInst->OpCode == XQSPIPS_FLASH_OPCODE_WRSR) && - (ByteCount == 3)) { - CurrInst->InstSize = 3; - CurrInst->TxOffset = XQSPIPS_TXD_11_OFFSET; - } - } - - /* - * If instruction not present in table - */ - if (Index == ARRAY_SIZE(FlashInst)) { - /* - * Assign current instruction, size and TXD register to be used - * The InstSize mentioned in case of instructions greater than - * 4 bytes is not the actual size, but is indicative of - * the TXD register used. - * The remaining bytes of the instruction will be transmitted - * through TXD0 below. - */ - switch (ByteCount%4) { - case XQSPIPS_SIZE_ONE: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_ONE; - CurrInst->TxOffset = XQSPIPS_TXD_01_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - case XQSPIPS_SIZE_TWO: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_TWO; - CurrInst->TxOffset = XQSPIPS_TXD_10_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - case XQSPIPS_SIZE_THREE: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_THREE; - CurrInst->TxOffset = XQSPIPS_TXD_11_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - default: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_FOUR; - CurrInst->TxOffset = XQSPIPS_TXD_00_OFFSET; - break; - } - } - - /* - * If the instruction size in not 4 bytes then the data received needs - * to be shifted - */ - if (CurrInst->InstSize != 4) { - InstancePtr->ShiftReadData = 1; - } else { - InstancePtr->ShiftReadData = 0; - } - - /* Get the complete command (flash inst + address/data) */ - Data = *((u32 *)InstancePtr->SendBufferPtr); - InstancePtr->SendBufferPtr += CurrInst->InstSize; - InstancePtr->RemainingBytes -= CurrInst->InstSize; - if (InstancePtr->RemainingBytes < 0) { - InstancePtr->RemainingBytes = 0; - } - - /* Write the command to the FIFO */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - CurrInst->TxOffset, Data); - TransCount++; - - /* - * If switching from TXD1/2/3 to TXD0, then start transfer and - * check for FIFO empty - */ - if (SwitchFlag == 1) { - /* - * If, in Manual Start mode, start the transfer. - */ - if (XQspiPs_IsManualStart(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_MANSTRT_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - /* - * Wait for the transfer to finish by polling Tx fifo status. - */ - do { - StatusReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_SR_OFFSET); - } while ((StatusReg & XQSPIPS_IXR_TXOW_MASK) == 0); - - } - - /* - * Fill the Tx FIFO with as many bytes as it takes (or as many as - * we have to send). - */ - while ((InstancePtr->RemainingBytes > 0) && - (TransCount < XQSPIPS_FIFO_DEPTH)) { - /* - * In case of Write fill the Tx FIFO with data to be transmitted. - * In case of Read fill the TX FIFO with first 4bytes(1Byte Command + 3Byte Address) - * of data from TX Buffer and the remaining bytes(i.e., RequestedBytes - 4) - * with DUMMY. - */ - if(InstancePtr->RecvBufferPtr && - ((InstancePtr->RequestedBytes - InstancePtr->RemainingBytes) > 4)) { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, XQSPIPS_DUMMY_TX_DATA); - } else { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, - *((u32 *)InstancePtr->SendBufferPtr)); - - InstancePtr->SendBufferPtr += 4; - } - InstancePtr->RemainingBytes -= 4; - if (InstancePtr->RemainingBytes < 0) { - InstancePtr->RemainingBytes = 0; - } - TransCount++; - } - - /* - * Enable QSPI interrupts (connecting to the interrupt controller and - * enabling interrupts should have been done by the caller). - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_IER_OFFSET, XQSPIPS_IXR_RXNEMPTY_MASK | - XQSPIPS_IXR_TXOW_MASK | XQSPIPS_IXR_RXOVR_MASK | - XQSPIPS_IXR_TXUF_MASK); - - /* - * If, in Manual Start mode, Start the transfer. - */ - if (XQspiPs_IsManualStart(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_MANSTRT_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* Transfers specified data on the QSPI bus in polled mode. -* -* The caller has the option of providing two different buffers for send and -* receive, or one buffer for both send and receive, or no buffer for receive. -* The receive buffer must be at least as big as the send buffer to prevent -* unwanted memory writes. This implies that the byte count passed in as an -* argument must be the smaller of the two buffers if they differ in size. -* Here are some sample usages: -*
-*   XQspiPs_PolledTransfer(InstancePtr, SendBuf, RecvBuf, ByteCount)
-*	The caller wishes to send and receive, and provides two different
-*	buffers for send and receive.
-*
-*   XQspiPs_PolledTransfer(InstancePtr, SendBuf, NULL, ByteCount)
-*	The caller wishes only to send and does not care about the received
-*	data. The driver ignores the received data in this case.
-*
-*   XQspiPs_PolledTransfer(InstancePtr, SendBuf, SendBuf, ByteCount)
-*	The caller wishes to send and receive, but provides the same buffer
-*	for doing both. The driver sends the data and overwrites the send
-*	buffer with received data as it transfers the data.
-*
-*   XQspiPs_PolledTransfer(InstancePtr, RecvBuf, RecvBuf, ByteCount)
-*	The caller wishes to only receive and does not care about sending
-*	data.  In this case, the caller must still provide a send buffer, but
-*	it can be the same as the receive buffer if the caller does not care
-*	what it sends.  The device must send N bytes of data if it wishes to
-*	receive N bytes of data.
-*
-* 
-* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param SendBufPtr is a pointer to a data buffer that needs to be -* transmitted. This buffer must not be NULL. -* @param RecvBufPtr is a pointer to a buffer for received data. -* This argument can be NULL if do not care about receiving. -* @param ByteCount contains the number of bytes to send/receive. -* The number of bytes received always equals the number of bytes -* sent. -* @return -* - XST_SUCCESS if the buffers are successfully handed off to the -* device for transfer. -* - XST_DEVICE_BUSY indicates that a data transfer is already in -* progress. This is determined by the driver. -* -* @note -* -* This function is not thread-safe. The higher layer software must ensure that -* no two threads are transferring data on the QSPI bus at the same time. -* -******************************************************************************/ -s32 XQspiPs_PolledTransfer(XQspiPs *InstancePtr, u8 *SendBufPtr, - u8 *RecvBufPtr, u32 ByteCount) -{ - u32 StatusReg; - u32 ConfigReg; - u8 Instruction; - u32 Data; - u8 TransCount; - unsigned int Index; - XQspiPsInstFormat *CurrInst; - XQspiPsInstFormat NewInst[2]; - u8 SwitchFlag = 0; - u8 IsManualStart = FALSE; - u32 RxCount = 0; - - CurrInst = &NewInst[0]; - /* - * The RecvBufPtr argument can be NULL. - */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(SendBufPtr != NULL); - Xil_AssertNonvoid(ByteCount > 0); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Check whether there is another transfer in progress. Not thread-safe. - */ - if (InstancePtr->IsBusy) { - return XST_DEVICE_BUSY; - } - - /* - * Set the busy flag, which will be cleared when the transfer is - * entirely done. - */ - InstancePtr->IsBusy = TRUE; - - /* - * Set up buffer pointers. - */ - InstancePtr->SendBufferPtr = SendBufPtr; - InstancePtr->RecvBufferPtr = RecvBufPtr; - - InstancePtr->RequestedBytes = ByteCount; - InstancePtr->RemainingBytes = ByteCount; - - /* - * The first byte with every chip-select assertion is always - * expected to be an instruction for flash interface mode - */ - Instruction = *InstancePtr->SendBufferPtr; - - for (Index = 0 ; Index < ARRAY_SIZE(FlashInst); Index++) { - if (Instruction == FlashInst[Index].OpCode) { - break; - } - } - - /* - * Set the RX FIFO threshold - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXFIFO_THRESHOLD_OPT); - - /* - * If the slave select is "Forced" or under manual control, - * set the slave select now, before beginning the transfer. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg &= ~XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, - ConfigReg); - } - - /* - * Enable the device. - */ - XQspiPs_Enable(InstancePtr); - - if (Index < ARRAY_SIZE(FlashInst)) { - - CurrInst = &FlashInst[Index]; - /* - * Check for WRSR instruction which has different size for - * Spansion (3 bytes) and Micron (2 bytes) - */ - if ((CurrInst->OpCode == XQSPIPS_FLASH_OPCODE_WRSR) && - (ByteCount == 3)) { - CurrInst->InstSize = 3; - CurrInst->TxOffset = XQSPIPS_TXD_11_OFFSET; - } - } - - /* - * If instruction not present in table - */ - if (Index == ARRAY_SIZE(FlashInst)) { - /* - * Assign current instruction, size and TXD register to be used. - * The InstSize mentioned in case of instructions greater than 4 bytes - * is not the actual size, but is indicative of the TXD register used. - * The remaining bytes of the instruction will be transmitted - * through TXD0 below. - */ - switch (ByteCount % 4) { - case XQSPIPS_SIZE_ONE: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_ONE; - CurrInst->TxOffset = XQSPIPS_TXD_01_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - case XQSPIPS_SIZE_TWO: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_TWO; - CurrInst->TxOffset = XQSPIPS_TXD_10_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - case XQSPIPS_SIZE_THREE: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_THREE; - CurrInst->TxOffset = XQSPIPS_TXD_11_OFFSET; - if (ByteCount > 4) { - SwitchFlag = 1; - } - break; - default: - CurrInst->OpCode = Instruction; - CurrInst->InstSize = XQSPIPS_SIZE_FOUR; - CurrInst->TxOffset = XQSPIPS_TXD_00_OFFSET; - break; - } - } - - /* - * If the instruction size in not 4 bytes then the data received needs - * to be shifted - */ - if (CurrInst->InstSize != 4) { - InstancePtr->ShiftReadData = 1; - } else { - InstancePtr->ShiftReadData = 0; - } - TransCount = 0; - /* Get the complete command (flash inst + address/data) */ - Data = *((u32 *)InstancePtr->SendBufferPtr); - InstancePtr->SendBufferPtr += CurrInst->InstSize; - InstancePtr->RemainingBytes -= CurrInst->InstSize; - if (InstancePtr->RemainingBytes < 0) { - InstancePtr->RemainingBytes = 0; - } - - /* Write the command to the FIFO */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - CurrInst->TxOffset, Data); - ++TransCount; - - /* - * If switching from TXD1/2/3 to TXD0, then start transfer and - * check for FIFO empty - */ - if (SwitchFlag == 1) { - /* - * If, in Manual Start mode, start the transfer. - */ - if (XQspiPs_IsManualStart(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_MANSTRT_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - /* - * Wait for the transfer to finish by polling Tx fifo status. - */ - do { - StatusReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_SR_OFFSET); - } while ((StatusReg & XQSPIPS_IXR_TXOW_MASK) == 0); - - } - - /* - * Check if manual start is selected and store it in a - * local variable for reference. This is to avoid reading - * the config register every time. - */ - IsManualStart = XQspiPs_IsManualStart(InstancePtr); - /* - * Fill the DTR/FIFO with as many bytes as it will take (or as - * many as we have to send). - */ - while ((InstancePtr->RemainingBytes > 0) && - (TransCount < XQSPIPS_FIFO_DEPTH)) { - /* - * In case of Write fill the Tx FIFO with data to be transmitted. - * In case of Read fill the TX FIFO with first 4bytes(1Byte Command + 3Byte Address) - * of data from TX Buffer and the remaining bytes(i.e., RequestedBytes - 4) - * with DUMMY. - */ - if(InstancePtr->RecvBufferPtr && - ((InstancePtr->RequestedBytes - InstancePtr->RemainingBytes) > 4)) { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, XQSPIPS_DUMMY_TX_DATA); - } else { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, - *((u32 *)InstancePtr->SendBufferPtr)); - - InstancePtr->SendBufferPtr += 4; - } - InstancePtr->RemainingBytes -= 4; - if (InstancePtr->RemainingBytes < 0) { - InstancePtr->RemainingBytes = 0; - } - ++TransCount; - } - - while ((InstancePtr->RemainingBytes > 0) || - (InstancePtr->RequestedBytes > 0)) { - - /* - * Fill the TX FIFO with RX threshold no. of entries (or as - * many as we have to send, in case that's less). - */ - while ((InstancePtr->RemainingBytes > 0) && - (TransCount < XQSPIPS_RXFIFO_THRESHOLD_OPT)) { - /* - * In case of Write fill the Tx FIFO with data to be transmitted. - * In case of Read fill the TX FIFO with first 4bytes(1Byte Command + 3Byte Address) - * of data from TX Buffer and the remaining bytes(i.e., RequestedBytes - 4) - * with DUMMY. - */ - if(InstancePtr->RecvBufferPtr && - ((InstancePtr->RequestedBytes - InstancePtr->RemainingBytes) > 4)) { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, XQSPIPS_DUMMY_TX_DATA); - } else { - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, - *((u32 *)InstancePtr->SendBufferPtr)); - - InstancePtr->SendBufferPtr += 4; - } - InstancePtr->RemainingBytes -= 4; - if (InstancePtr->RemainingBytes < 0) { - InstancePtr->RemainingBytes = 0; - } - ++TransCount; - } - - /* - * If, in Manual Start mode, start the transfer. - */ - if (IsManualStart == TRUE) { - ConfigReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_MANSTRT_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - - /* - * Reset TransCount - this is only used to fill TX FIFO - * in the above loop; - * RxCount is used to keep track of data received - */ - TransCount = 0; - - /* - * Wait for RX FIFO to reach threshold (or) - * TX FIFO to become empty. - * The latter check is required for - * small transfers (<32 words) and - * when the last chunk in a large data transfer is < 32 words. - */ - - do { - StatusReg = XQspiPs_ReadReg( - InstancePtr->Config.BaseAddress, - XQSPIPS_SR_OFFSET); - } while (((StatusReg & XQSPIPS_IXR_TXOW_MASK) == 0) && - ((StatusReg & XQSPIPS_IXR_RXNEMPTY_MASK) == 0)); - - /* - * A transmit has just completed. Process received data - * and check for more data to transmit. - * First get the data received as a result of the - * transmit that just completed. Receive data based on the - * count obtained while filling tx fifo. Always get - * the received data, but only fill the receive - * buffer if it points to something (the upper layer - * software may not care to receive data). - */ - while ((InstancePtr->RequestedBytes > 0) && - (RxCount < XQSPIPS_RXFIFO_THRESHOLD_OPT)) { - u32 Data; - - RxCount++; - - if (InstancePtr->RecvBufferPtr != NULL) { - if (InstancePtr->RequestedBytes < 4) { - Data = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - XQspiPs_GetReadData(InstancePtr, Data, - InstancePtr->RequestedBytes); - } else { - (*(u32 *)InstancePtr->RecvBufferPtr) = - XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - InstancePtr->RecvBufferPtr += 4; - InstancePtr->RequestedBytes -= 4; - if (InstancePtr->RequestedBytes < 0) { - InstancePtr->RequestedBytes = 0; - } - } - } else { - Data = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - InstancePtr->RequestedBytes -= 4; - } - } - RxCount = 0; - } - - /* - * If the Slave select lines are being manually controlled, disable - * them because the transfer is complete. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - - /* - * Clear the busy flag. - */ - InstancePtr->IsBusy = FALSE; - - /* - * Disable the device. - */ - XQspiPs_Disable(InstancePtr); - - /* - * Reset the RX FIFO threshold to one - */ - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXWR_RESET_VALUE); - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* -* Read the flash in Linear QSPI mode. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param RecvBufPtr is a pointer to a buffer for received data. -* @param Address is the starting address within the flash from -* from where data needs to be read. -* @param ByteCount contains the number of bytes to receive. -* -* @return -* - XST_SUCCESS if read is performed -* - XST_FAILURE if Linear mode is not set -* -* @note None. -* -* -******************************************************************************/ -int XQspiPs_LqspiRead(XQspiPs *InstancePtr, u8 *RecvBufPtr, - u32 Address, unsigned ByteCount) -{ - int Status = (int)XST_SUCCESS; - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(RecvBufPtr != NULL); - Xil_AssertNonvoid(ByteCount > 0); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - -#ifndef XPAR_PS7_QSPI_LINEAR_0_S_AXI_BASEADDR -#define XPAR_PS7_QSPI_LINEAR_0_S_AXI_BASEADDR 0xFC000000 -#endif - /* - * Enable the controller - */ - XQspiPs_Enable(InstancePtr); - - if (XQspiPs_GetLqspiConfigReg(InstancePtr) & - XQSPIPS_LQSPI_CR_LINEAR_MASK) { - memcpy((void *)RecvBufPtr, - (const void *)(XPAR_PS7_QSPI_LINEAR_0_S_AXI_BASEADDR + - Address), - (size_t)ByteCount); - Status = (int)XST_SUCCESS; - } else { - Status = (int)XST_FAILURE; - } - - /* - * Disable the controller - */ - XQspiPs_Disable(InstancePtr); - - return Status; -} - -/*****************************************************************************/ -/** -* -* Selects the slave with which the master communicates. -* -* The user is not allowed to select the slave while a transfer is in progress. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return -* - XST_SUCCESS if the slave is selected or deselected -* successfully. -* - XST_DEVICE_BUSY if a transfer is in progress, slave cannot be -* changed. -* -* @note -* -* This function only sets the slave which will be selected when a transfer -* occurs. The slave is not selected when the QSPI is idle. -* -******************************************************************************/ -int XQspiPs_SetSlaveSelect(XQspiPs *InstancePtr) -{ - u32 ConfigReg; - - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Do not allow the slave select to change while a transfer is in - * progress. Not thread-safe. - */ - if (InstancePtr->IsBusy) { - return XST_DEVICE_BUSY; - } - - /* - * Select the slave - */ - ConfigReg = XQspiPs_ReadReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg &= ~XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(InstancePtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - - return XST_SUCCESS; -} - -/*****************************************************************************/ -/** -* -* Sets the status callback function, the status handler, which the driver -* calls when it encounters conditions that should be reported to upper -* layer software. The handler executes in an interrupt context, so it must -* minimize the amount of processing performed. One of the following status -* events is passed to the status handler. -* -*
-*
-* XST_SPI_TRANSFER_DONE		The requested data transfer is done
-*
-* XST_SPI_TRANSMIT_UNDERRUN	As a slave device, the master clocked data
-*				but there were none available in the transmit
-*				register/FIFO. This typically means the slave
-*				application did not issue a transfer request
-*				fast enough, or the processor/driver could not
-*				fill the transmit register/FIFO fast enough.
-*
-* XST_SPI_RECEIVE_OVERRUN	The QSPI device lost data. Data was received
-*				but the receive data register/FIFO was full.
-*
-* 
-* @param InstancePtr is a pointer to the XQspiPs instance. -* @param CallBackRef is the upper layer callback reference passed back -* when the callback function is invoked. -* @param FuncPtr is the pointer to the callback function. -* -* @return None. -* -* @note -* -* The handler is called within interrupt context, so it should do its work -* quickly and queue potentially time-consuming work to a task-level thread. -* -******************************************************************************/ -void XQspiPs_SetStatusHandler(XQspiPs *InstancePtr, void *CallBackRef, - XQspiPs_StatusHandler FuncPtr) -{ - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(FuncPtr != NULL); - Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - - InstancePtr->StatusHandler = FuncPtr; - InstancePtr->StatusRef = CallBackRef; -} - -/*****************************************************************************/ -/** -* -* This is a stub for the status callback. The stub is here in case the upper -* layers forget to set the handler. -* -* @param CallBackRef is a pointer to the upper layer callback reference -* @param StatusEvent is the event that just occurred. -* @param ByteCount is the number of bytes transferred up until the event -* occurred. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -static void StubStatusHandler(void *CallBackRef, u32 StatusEvent, - unsigned ByteCount) -{ - (void) CallBackRef; - (void) StatusEvent; - (void) ByteCount; - - Xil_AssertVoidAlways(); -} - -/*****************************************************************************/ -/** -* -* The interrupt handler for QSPI interrupts. This function must be connected -* by the user to an interrupt controller. -* -* The interrupts that are handled are: -* -* -* - Data Transmit Register (FIFO) Empty. This interrupt is generated when the -* transmit register or FIFO is empty. The driver uses this interrupt during a -* transmission to continually send/receive data until the transfer is done. -* -* - Data Transmit Register (FIFO) Underflow. This interrupt is generated when -* the QSPI device, when configured as a slave, attempts to read an empty -* DTR/FIFO. An empty DTR/FIFO usually means that software is not giving the -* device data in a timely manner. No action is taken by the driver other than -* to inform the upper layer software of the error. -* -* - Data Receive Register (FIFO) Overflow. This interrupt is generated when the -* QSPI device attempts to write a received byte to an already full DRR/FIFO. -* A full DRR/FIFO usually means software is not emptying the data in a timely -* manner. No action is taken by the driver other than to inform the upper -* layer software of the error. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* -* @return None. -* -* @note -* -* The slave select register is being set to deselect the slave when a transfer -* is complete. -* -******************************************************************************/ -void XQspiPs_InterruptHandler(void *InstancePtr) -{ - XQspiPs *QspiPtr = (XQspiPs *)InstancePtr; - u32 IntrStatus; - u32 ConfigReg; - u32 Data; - u32 TransCount; - u32 Count = 0; - unsigned BytesDone; /* Number of bytes done so far. */ - - Xil_AssertVoid(InstancePtr != NULL); - Xil_AssertVoid(QspiPtr->IsReady == XIL_COMPONENT_IS_READY); - - /* - * Immediately clear the interrupts in case the ISR causes another - * interrupt to be generated. If we clear at the end of the ISR, - * we may miss newly generated interrupts. This occurs because we - * transmit from within the ISR, which could potentially cause another - * TX_EMPTY interrupt. - */ - IntrStatus = XQspiPs_ReadReg(QspiPtr->Config.BaseAddress, - XQSPIPS_SR_OFFSET); - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, XQSPIPS_SR_OFFSET, - (IntrStatus & XQSPIPS_IXR_WR_TO_CLR_MASK)); - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, XQSPIPS_IDR_OFFSET, - XQSPIPS_IXR_TXOW_MASK | XQSPIPS_IXR_RXNEMPTY_MASK | - XQSPIPS_IXR_RXOVR_MASK | XQSPIPS_IXR_TXUF_MASK); - - if ((IntrStatus & XQSPIPS_IXR_TXOW_MASK) || - (IntrStatus & XQSPIPS_IXR_RXNEMPTY_MASK)) { - - /* - * Rx FIFO has just reached threshold no. of entries. - * Read threshold no. of entries from RX FIFO - * Another possibility of entering this loop is when - * the last byte has been transmitted and TX FIFO is empty, - * in which case, read all the data from RX FIFO. - * Always get the received data, but only fill the - * receive buffer if it is not null (it can be null when - * the device does not care to receive data). - */ - TransCount = QspiPtr->RequestedBytes - QspiPtr->RemainingBytes; - if (TransCount % 4) { - TransCount = TransCount/4 + 1; - } else { - TransCount = TransCount/4; - } - - while ((Count < TransCount) && - (Count < XQSPIPS_RXFIFO_THRESHOLD_OPT)) { - - if (QspiPtr->RecvBufferPtr != NULL) { - if (QspiPtr->RequestedBytes < 4) { - Data = XQspiPs_ReadReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - XQspiPs_GetReadData(QspiPtr, Data, - QspiPtr->RequestedBytes); - } else { - (*(u32 *)QspiPtr->RecvBufferPtr) = - XQspiPs_ReadReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - QspiPtr->RecvBufferPtr += 4; - QspiPtr->RequestedBytes -= 4; - if (QspiPtr->RequestedBytes < 0) { - QspiPtr->RequestedBytes = 0; - } - } - } else { - XQspiPs_ReadReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXD_OFFSET); - QspiPtr->RequestedBytes -= 4; - if (QspiPtr->RequestedBytes < 0) { - QspiPtr->RequestedBytes = 0; - } - - } - Count++; - } - Count = 0; - /* - * Interrupt asserted as TX_OW got asserted - * See if there is more data to send. - * Fill TX FIFO with RX threshold no. of entries or - * remaining entries (in case that is less than threshold) - */ - while ((QspiPtr->RemainingBytes > 0) && - (Count < XQSPIPS_RXFIFO_THRESHOLD_OPT)) { - /* - * Send more data. - * In case of Write fill the Tx FIFO with data to be transmitted. - * In case of Read fill the TX FIFO with first 4bytes(1Byte Command + 3Byte Address) - * of data from TX Buffer and the remaining bytes(i.e., RequestedBytes - 4) - * with DUMMY. - */ - if(QspiPtr->RecvBufferPtr && - ((QspiPtr->RequestedBytes - QspiPtr->RemainingBytes) > 4)) { - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, XQSPIPS_DUMMY_TX_DATA); - } else { - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_TXD_00_OFFSET, - *((u32 *)QspiPtr->SendBufferPtr)); - - QspiPtr->SendBufferPtr += 4; - } - QspiPtr->RemainingBytes -= 4; - if (QspiPtr->RemainingBytes < 0) { - QspiPtr->RemainingBytes = 0; - } - - Count++; - } - - if ((QspiPtr->RemainingBytes == 0) && - (QspiPtr->RequestedBytes == 0)) { - /* - * No more data to send. Disable the interrupt - * and inform the upper layer software that the - * transfer is done. The interrupt will be re-enabled - * when another transfer is initiated. - */ - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_IDR_OFFSET, - XQSPIPS_IXR_RXNEMPTY_MASK | - XQSPIPS_IXR_TXOW_MASK | - XQSPIPS_IXR_RXOVR_MASK | - XQSPIPS_IXR_TXUF_MASK); - - /* - * If the Slave select is being manually controlled, - * disable it because the transfer is complete. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg( - QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, - ConfigReg); - } - - /* - * Clear the busy flag. - */ - QspiPtr->IsBusy = FALSE; - - /* - * Disable the device. - */ - XQspiPs_Disable(QspiPtr); - - /* - * Reset the RX FIFO threshold to one - */ - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXWR_RESET_VALUE); - - QspiPtr->StatusHandler(QspiPtr->StatusRef, - XST_SPI_TRANSFER_DONE, - QspiPtr->RequestedBytes); - } else { - /* - * Enable the TXOW interrupt. - */ - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_IER_OFFSET, - XQSPIPS_IXR_RXNEMPTY_MASK | - XQSPIPS_IXR_TXOW_MASK | - XQSPIPS_IXR_RXOVR_MASK | - XQSPIPS_IXR_TXUF_MASK); - /* - * If, in Manual Start mode, start the transfer. - */ - if (XQspiPs_IsManualStart(QspiPtr)) { - ConfigReg = XQspiPs_ReadReg( - QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_MANSTRT_MASK; - XQspiPs_WriteReg( - QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - } - } - - /* - * Check for overflow and underflow errors. - */ - if (IntrStatus & XQSPIPS_IXR_RXOVR_MASK) { - BytesDone = QspiPtr->RequestedBytes - QspiPtr->RemainingBytes; - QspiPtr->IsBusy = FALSE; - - /* - * If the Slave select lines is being manually controlled, - * disable it because the transfer is complete. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg( - QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - - /* - * Disable the device. - */ - XQspiPs_Disable(QspiPtr); - - /* - * Reset the RX FIFO threshold to one - */ - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXWR_RESET_VALUE); - - QspiPtr->StatusHandler(QspiPtr->StatusRef, - XST_SPI_RECEIVE_OVERRUN, BytesDone); - } - - if (IntrStatus & XQSPIPS_IXR_TXUF_MASK) { - BytesDone = QspiPtr->RequestedBytes - QspiPtr->RemainingBytes; - - QspiPtr->IsBusy = FALSE; - /* - * If the Slave select lines is being manually controlled, - * disable it because the transfer is complete. - */ - if (XQspiPs_IsManualChipSelect(InstancePtr)) { - ConfigReg = XQspiPs_ReadReg( - QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET); - ConfigReg |= XQSPIPS_CR_SSCTRL_MASK; - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_CR_OFFSET, ConfigReg); - } - - /* - * Disable the device. - */ - XQspiPs_Disable(QspiPtr); - - /* - * Reset the RX FIFO threshold to one - */ - XQspiPs_WriteReg(QspiPtr->Config.BaseAddress, - XQSPIPS_RXWR_OFFSET, XQSPIPS_RXWR_RESET_VALUE); - - QspiPtr->StatusHandler(QspiPtr->StatusRef, - XST_SPI_TRANSMIT_UNDERRUN, BytesDone); - } -} - - -/*****************************************************************************/ -/** -* -* Copies data from Data to the Receive buffer. -* -* @param InstancePtr is a pointer to the XQspiPs instance. -* @param Data is the data which needs to be copied to the Rx buffer. -* @param Size is the number of bytes to be copied to the Receive buffer. -* -* @return None. -* -* @note None. -* -******************************************************************************/ -static void XQspiPs_GetReadData(XQspiPs *InstancePtr, u32 Data, u8 Size) -{ - u8 DataByte3; - - if (InstancePtr->RecvBufferPtr) { - switch (Size) { - case 1: - if (InstancePtr->ShiftReadData == 1) { - *((u8 *)InstancePtr->RecvBufferPtr) = - ((Data & 0xFF000000) >> 24); - } else { - *((u8 *)InstancePtr->RecvBufferPtr) = - (Data & 0xFF); - } - InstancePtr->RecvBufferPtr += 1; - break; - case 2: - if (InstancePtr->ShiftReadData == 1) { - *((u16 *)InstancePtr->RecvBufferPtr) = - ((Data >> 16) & 0xFF00) | - ((Data >> 8) & 0xFF); - } else { - *((u16 *)InstancePtr->RecvBufferPtr) = - (Data & 0xFFFF); - } - InstancePtr->RecvBufferPtr += 2; - break; - case 3: - if (InstancePtr->ShiftReadData == 1) { - *((u16 *)InstancePtr->RecvBufferPtr) = - ((Data & 0x00FFFF00) >> 8); - InstancePtr->RecvBufferPtr += 2; - DataByte3 = ((Data & 0xFF000000) >> 24); - *((u8 *)InstancePtr->RecvBufferPtr) = DataByte3; - } else { - *((u16 *)InstancePtr->RecvBufferPtr) = - (Data & 0xFFFF); - InstancePtr->RecvBufferPtr += 2; - DataByte3 = ((Data & 0x00FF0000) >> 16); - *((u8 *)InstancePtr->RecvBufferPtr) = DataByte3; - } - InstancePtr->RecvBufferPtr += 1; - break; - default: - /* This will never execute */ - break; - } - } - InstancePtr->ShiftReadData = 0; - InstancePtr->RequestedBytes -= Size; - if (InstancePtr->RequestedBytes < 0) { - InstancePtr->RequestedBytes = 0; - } -} -/** @} */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/312e75575243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/312e75575243001d18b399c1eb9b3628 deleted file mode 100644 index 9794da0..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/312e75575243001d18b399c1eb9b3628 +++ /dev/null @@ -1,350 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2002 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xenv_standalone.h -* -* Defines common services specified by xenv.h. -* -* @note -* This file is not intended to be included directly by driver code. -* Instead, the generic xenv.h file is intended to be included by driver -* code. -* -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who  Date     Changes
-* ----- ---- -------- -----------------------------------------------
-* 1.00a wgr  02/28/07 Added cache handling macros.
-* 1.00a wgr  02/27/07 Simplified code. Deprecated old-style macro names.
-* 1.00a rmm  01/24/06 Implemented XENV_USLEEP. Assume implementation is being
-*                     used under Xilinx standalone BSP.
-* 1.00a xd   11/03/04 Improved support for doxygen.
-* 1.00a rmm  03/21/02 First release
-* 1.00a wgr  03/22/07 Converted to new coding style.
-* 1.00a rpm  06/29/07 Added udelay macro for standalone
-* 1.00a xd   07/19/07 Included xparameters.h as XPAR_ constants are referred
-*                     to in MICROBLAZE section
-* 1.00a ecm  09/19/08 updated for v7.20 of Microblaze, new functionality
-*
-* 
-* -* -******************************************************************************/ - -/** - *@cond nocomments - */ - -#ifndef XENV_STANDALONE_H -#define XENV_STANDALONE_H - -#include "xil_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ -/****************************************************************************** - * - * Get the processor dependent includes - * - ******************************************************************************/ - -#include - -#if defined __MICROBLAZE__ -# include "mb_interface.h" -# include "xparameters.h" /* XPAR constants used below in MB section */ - -#elif defined __PPC__ -# include "sleep.h" -# include "xcache_l.h" /* also include xcache_l.h for caching macros */ -#endif - -/****************************************************************************** - * - * MEMCPY / MEMSET related macros. - * - * The following are straight forward implementations of memset and memcpy. - * - * NOTE: memcpy may not work if source and target memory area are overlapping. - * - ******************************************************************************/ -/*****************************************************************************/ -/** - * - * Copies a non-overlapping block of memory. - * - * @param DestPtr - * Destination address to copy data to. - * - * @param SrcPtr - * Source address to copy data from. - * - * @param Bytes - * Number of bytes to copy. - * - * @return None. - * - * @note - * The use of XENV_MEM_COPY is deprecated. Use memcpy() instead. - * - * @note - * This implementation MAY BREAK work if source and target memory - * area are overlapping. - * - *****************************************************************************/ - -#define XENV_MEM_COPY(DestPtr, SrcPtr, Bytes) \ - memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) - - - -/*****************************************************************************/ -/** - * - * Fills an area of memory with constant data. - * - * @param DestPtr - * Destination address to copy data to. - * - * @param Data - * Value to set. - * - * @param Bytes - * Number of bytes to copy. - * - * @return None. - * - * @note - * The use of XENV_MEM_FILL is deprecated. Use memset() instead. - * - *****************************************************************************/ - -#define XENV_MEM_FILL(DestPtr, Data, Bytes) \ - memset((void *) DestPtr, (s32) Data, (size_t) Bytes) - - - -/****************************************************************************** - * - * TIME related macros - * - ******************************************************************************/ - -/** - * A structure that contains a time stamp used by other time stamp macros - * defined below. This structure is processor dependent. - */ -typedef s32 XENV_TIME_STAMP; - -/*****************************************************************************/ -/** - * - * Time is derived from the 64 bit PPC timebase register - * - * @param StampPtr is the storage for the retrieved time stamp. - * - * @return None. - * - * @note - * - * Signature: void XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr) - *

- * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_GET(StampPtr) - -/*****************************************************************************/ -/** - * - * This macro is not yet implemented and always returns 0. - * - * @param Stamp1Ptr is the first sampled time stamp. - * @param Stamp2Ptr is the second sampled time stamp. - * - * @return 0 - * - * @note - * - * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_DELTA_US(Stamp1Ptr, Stamp2Ptr) (0) - -/*****************************************************************************/ -/** - * - * This macro is not yet implemented and always returns 0. - * - * @param Stamp1Ptr is the first sampled time stamp. - * @param Stamp2Ptr is the second sampled time stamp. - * - * @return 0 - * - * @note - * - * This macro must be implemented by the user. - * - *****************************************************************************/ -#define XENV_TIME_STAMP_DELTA_MS(Stamp1Ptr, Stamp2Ptr) (0) - -/*****************************************************************************/ -/** - * XENV_USLEEP(unsigned delay) - * - * Delay the specified number of microseconds. Not implemented without OS - * support. - * - * @param delay - * Number of microseconds to delay. - * - * @return None. - * - *****************************************************************************/ - -#ifdef __PPC__ -#define XENV_USLEEP(delay) usleep(delay) -#define udelay(delay) usleep(delay) -#else -#define XENV_USLEEP(delay) -#define udelay(delay) -#endif - - -/****************************************************************************** - * - * CACHE handling macros / mappings - * - ******************************************************************************/ -/****************************************************************************** - * - * Processor independent macros - * - ******************************************************************************/ - -#define XCACHE_ENABLE_CACHE() \ - { XCACHE_ENABLE_DCACHE(); XCACHE_ENABLE_ICACHE(); } - -#define XCACHE_DISABLE_CACHE() \ - { XCACHE_DISABLE_DCACHE(); XCACHE_DISABLE_ICACHE(); } - - -/****************************************************************************** - * - * MicroBlaze case - * - * NOTE: Currently the following macros will only work on systems that contain - * only ONE MicroBlaze processor. Also, the macros will only be enabled if the - * system is built using a xparameters.h file. - * - ******************************************************************************/ - -#if defined __MICROBLAZE__ - -/* Check if MicroBlaze data cache was built into the core. - */ -#if (XPAR_MICROBLAZE_USE_DCACHE == 1) -# define XCACHE_ENABLE_DCACHE() microblaze_enable_dcache() -# define XCACHE_DISABLE_DCACHE() microblaze_disable_dcache() -# define XCACHE_INVALIDATE_DCACHE() microblaze_invalidate_dcache() - -# define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) \ - microblaze_invalidate_dcache_range((s32)(Addr), (s32)(Len)) - -#if (XPAR_MICROBLAZE_DCACHE_USE_WRITEBACK == 1) -# define XCACHE_FLUSH_DCACHE() microblaze_flush_dcache() -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - microblaze_flush_dcache_range((s32)(Addr), (s32)(Len)) -#else -# define XCACHE_FLUSH_DCACHE() microblaze_invalidate_dcache() -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - microblaze_invalidate_dcache_range((s32)(Addr), (s32)(Len)) -#endif /*XPAR_MICROBLAZE_DCACHE_USE_WRITEBACK*/ - -#else -# define XCACHE_ENABLE_DCACHE() -# define XCACHE_DISABLE_DCACHE() -# define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) -# define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) -#endif /*XPAR_MICROBLAZE_USE_DCACHE*/ - - -/* Check if MicroBlaze instruction cache was built into the core. - */ -#if (XPAR_MICROBLAZE_USE_ICACHE == 1) -# define XCACHE_ENABLE_ICACHE() microblaze_enable_icache() -# define XCACHE_DISABLE_ICACHE() microblaze_disable_icache() - -# define XCACHE_INVALIDATE_ICACHE() microblaze_invalidate_icache() - -# define XCACHE_INVALIDATE_ICACHE_RANGE(Addr, Len) \ - microblaze_invalidate_icache_range((s32)(Addr), (s32)(Len)) - -#else -# define XCACHE_ENABLE_ICACHE() -# define XCACHE_DISABLE_ICACHE() -#endif /*XPAR_MICROBLAZE_USE_ICACHE*/ - - -/****************************************************************************** - * - * PowerPC case - * - * Note that the XCACHE_ENABLE_xxx functions are hardcoded to enable a - * specific memory region (0x80000001). Each bit (0-30) in the regions - * bitmask stands for 128MB of memory. Bit 31 stands for the upper 2GB - * range. - * - * regions --> cached address range - * ------------|-------------------------------------------------- - * 0x80000000 | [0, 0x7FFFFFF] - * 0x00000001 | [0xF8000000, 0xFFFFFFFF] - * 0x80000001 | [0, 0x7FFFFFF],[0xF8000000, 0xFFFFFFFF] - * - ******************************************************************************/ - -#elif defined __PPC__ - -#define XCACHE_ENABLE_DCACHE() XCache_EnableDCache(0x80000001) -#define XCACHE_DISABLE_DCACHE() XCache_DisableDCache() -#define XCACHE_ENABLE_ICACHE() XCache_EnableICache(0x80000001) -#define XCACHE_DISABLE_ICACHE() XCache_DisableICache() - -#define XCACHE_INVALIDATE_DCACHE_RANGE(Addr, Len) \ - XCache_InvalidateDCacheRange((u32)(Addr), (u32)(Len)) - -#define XCACHE_FLUSH_DCACHE_RANGE(Addr, Len) \ - XCache_FlushDCacheRange((u32)(Addr), (u32)(Len)) - -#define XCACHE_INVALIDATE_ICACHE() XCache_InvalidateICache() - - -/****************************************************************************** - * - * Unknown processor / architecture - * - ******************************************************************************/ - -#else -/* #error "Unknown processor / architecture. Must be MicroBlaze or PowerPC." */ -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef XENV_STANDALONE_H */ - - /** - *@endcond - */ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/50bb3e545243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/50bb3e545243001d18b399c1eb9b3628 deleted file mode 100644 index 853ef6b..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/50bb3e545243001d18b399c1eb9b3628 +++ /dev/null @@ -1,412 +0,0 @@ -/****************************************************************************** -* Copyright (c) 2014 - 2021 Xilinx, Inc. All rights reserved. -* SPDX-License-Identifier: MIT -******************************************************************************/ - -/*****************************************************************************/ -/** -* -* @file xil_io.h -* -* @addtogroup common_io_interfacing_apis Register IO interfacing APIs -* -* The xil_io.h file contains the interface for the general I/O component, which -* encapsulates the Input/Output functions for the processors that do not -* require any special I/O handling. -* -* @{ -*
-* MODIFICATION HISTORY:
-*
-* Ver   Who      Date     Changes
-* ----- -------- -------- -----------------------------------------------
-* 5.00 	pkp  	 05/29/14 First release
-* 6.00  mus      08/19/16 Remove checking of __LITTLE_ENDIAN__ flag for
-*                         ARM processors
-* 7.20  har      01/03/20 Added Xil_SecureOut32 for avoiding blindwrite for
-*                         CR-1049218
-* 7.30  kpt      09/21/20 Moved Xil_EndianSwap16 and Xil_EndianSwap32 to
-*                         xil_io.h and made them as static inline
-*       am       10/13/20 Changed the return type of Xil_SecureOut32 function
-*                         from u32 to int
-* 7.50  dp       02/12/21 Fix compilation error in Xil_EndianSwap32() that occur
-*                         when -Werror=conversion compiler flag is enabled
-* 7.5   mus      05/17/21 Update the functions with comments. It fixes CR#1067739.
-*
-* 
-******************************************************************************/ - -#ifndef XIL_IO_H /* prevent circular inclusions */ -#define XIL_IO_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_types.h" -#include "xil_printf.h" -#include "xstatus.h" - -#if defined (__MICROBLAZE__) -#include "mb_interface.h" -#else -#include "xpseudo_asm.h" -#endif - -/************************** Function Prototypes ******************************/ -#ifdef ENABLE_SAFETY -extern u32 XStl_RegUpdate(u32 RegAddr, u32 RegVal); -#endif - -/***************** Macros (Inline Functions) Definitions *********************/ -#if defined __GNUC__ -#if defined (__MICROBLAZE__) -# define INST_SYNC mbar(0) -# define DATA_SYNC mbar(1) -# else -# define SYNCHRONIZE_IO dmb() -# define INST_SYNC isb() -# define DATA_SYNC dsb() -# endif -#else -# define SYNCHRONIZE_IO -# define INST_SYNC -# define DATA_SYNC -# define INST_SYNC -# define DATA_SYNC -#endif - -#if defined (__GNUC__) || defined (__ICCARM__) || defined (__MICROBLAZE__) -#define INLINE inline -#else -#define INLINE __inline -#endif - -/*****************************************************************************/ -/** -* -* @brief Performs an input operation for a memory location by reading -* from the specified address and returning the 8 bit Value read from -* that address. -* -* @param Addr: contains the address to perform the input operation -* -* @return The 8 bit Value read from the specified input address. - -* -******************************************************************************/ -static INLINE u8 Xil_In8(UINTPTR Addr) -{ - return *(volatile u8 *) Addr; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an input operation for a memory location by reading from -* the specified address and returning the 16 bit Value read from that -* address. -* -* @param Addr: contains the address to perform the input operation -* -* @return The 16 bit Value read from the specified input address. -* -******************************************************************************/ -static INLINE u16 Xil_In16(UINTPTR Addr) -{ - return *(volatile u16 *) Addr; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an input operation for a memory location by -* reading from the specified address and returning the 32 bit Value -* read from that address. -* -* @param Addr: contains the address to perform the input operation -* -* @return The 32 bit Value read from the specified input address. -* -******************************************************************************/ -static INLINE u32 Xil_In32(UINTPTR Addr) -{ - return *(volatile u32 *) Addr; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an input operation for a memory location by reading the -* 64 bit Value read from that address. -* -* -* @param Addr: contains the address to perform the input operation -* -* @return The 64 bit Value read from the specified input address. -* -******************************************************************************/ -static INLINE u64 Xil_In64(UINTPTR Addr) -{ - return *(volatile u64 *) Addr; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an output operation for an memory location by -* writing the 8 bit Value to the the specified address. -* -* @param Addr: contains the address to perform the output operation -* @param Value: contains the 8 bit Value to be written at the specified -* address. -* -* @return None. -* -******************************************************************************/ -static INLINE void Xil_Out8(UINTPTR Addr, u8 Value) -{ - /* write 8 bit value to specified address */ - volatile u8 *LocalAddr = (volatile u8 *)Addr; - *LocalAddr = Value; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an output operation for a memory location by writing the -* 16 bit Value to the the specified address. -* -* @param Addr contains the address to perform the output operation -* @param Value contains the Value to be written at the specified address. -* -* @return None. -* -******************************************************************************/ -static INLINE void Xil_Out16(UINTPTR Addr, u16 Value) -{ - /* write 16 bit value to specified address */ - volatile u16 *LocalAddr = (volatile u16 *)Addr; - *LocalAddr = Value; -} - -/*****************************************************************************/ -/** -* -* @brief Performs an output operation for a memory location by writing the -* 32 bit Value to the the specified address. -* -* @param Addr contains the address to perform the output operation -* @param Value contains the 32 bit Value to be written at the specified -* address. -* -* @return None. -* -******************************************************************************/ -static INLINE void Xil_Out32(UINTPTR Addr, u32 Value) -{ - /* write 32 bit value to specified address */ -#ifndef ENABLE_SAFETY - volatile u32 *LocalAddr = (volatile u32 *)Addr; - *LocalAddr = Value; -#else - XStl_RegUpdate(Addr, Value); -#endif -} - -/*****************************************************************************/ -/** -* -* @brief Performs an output operation for a memory location by writing the -* 64 bit Value to the the specified address. -* -* @param Addr contains the address to perform the output operation -* @param Value contains 64 bit Value to be written at the specified address. -* -* @return None. -* -******************************************************************************/ -static INLINE void Xil_Out64(UINTPTR Addr, u64 Value) -{ - /* write 64 bit value to specified address */ - volatile u64 *LocalAddr = (volatile u64 *)Addr; - *LocalAddr = Value; -} - -/*****************************************************************************/ -/** - * - * @brief Performs an output operation for a memory location by writing the - * 32 bit Value to the the specified address and then reading it - * back to verify the value written in the register. - * - * @param Addr contains the address to perform the output operation - * @param Value contains 32 bit Value to be written at the specified address - * - * @return Returns Status - * - XST_SUCCESS on success - * - XST_FAILURE on failure - * - *****************************************************************************/ -static INLINE int Xil_SecureOut32(UINTPTR Addr, u32 Value) -{ - int Status = XST_FAILURE; - u32 ReadReg; - u32 ReadRegTemp; - - /* writing 32 bit value to specified address */ - Xil_Out32(Addr, Value); - - /* verify value written to specified address with multiple reads */ - ReadReg = Xil_In32(Addr); - ReadRegTemp = Xil_In32(Addr); - - if( (ReadReg == Value) && (ReadRegTemp == Value) ) { - Status = XST_SUCCESS; - } - - return Status; -} - -/*****************************************************************************/ -/** -* -* @brief Perform a 16-bit endian conversion. -* -* @param Data: 16 bit value to be converted -* -* @return 16 bit Data with converted endianness -* -******************************************************************************/ -static INLINE __attribute__((always_inline)) u16 Xil_EndianSwap16(u16 Data) -{ - return (u16) (((Data & 0xFF00U) >> 8U) | ((Data & 0x00FFU) << 8U)); -} - -/*****************************************************************************/ -/** -* -* @brief Perform a 32-bit endian conversion. -* -* @param Data: 32 bit value to be converted -* -* @return 32 bit data with converted endianness -* -******************************************************************************/ -static INLINE __attribute__((always_inline)) u32 Xil_EndianSwap32(u32 Data) -{ - u16 LoWord; - u16 HiWord; - - /* get each of the half words from the 32 bit word */ - - LoWord = (u16) (Data & 0x0000FFFFU); - HiWord = (u16) ((Data & 0xFFFF0000U) >> 16U); - - /* byte swap each of the 16 bit half words */ - - LoWord = (u16)(((LoWord & 0xFF00U) >> 8U) | ((LoWord & 0x00FFU) << 8U)); - HiWord = (u16)(((HiWord & 0xFF00U) >> 8U) | ((HiWord & 0x00FFU) << 8U)); - - /* swap the half words before returning the value */ - - return ((((u32)LoWord) << (u32)16U) | (u32)HiWord); -} - -#if defined (__MICROBLAZE__) -#ifdef __LITTLE_ENDIAN__ -# define Xil_In16LE Xil_In16 -# define Xil_In32LE Xil_In32 -# define Xil_Out16LE Xil_Out16 -# define Xil_Out32LE Xil_Out32 -# define Xil_Htons Xil_EndianSwap16 -# define Xil_Htonl Xil_EndianSwap32 -# define Xil_Ntohs Xil_EndianSwap16 -# define Xil_Ntohl Xil_EndianSwap32 -# else -# define Xil_In16BE Xil_In16 -# define Xil_In32BE Xil_In32 -# define Xil_Out16BE Xil_Out16 -# define Xil_Out32BE Xil_Out32 -# define Xil_Htons(Data) (Data) -# define Xil_Htonl(Data) (Data) -# define Xil_Ntohs(Data) (Data) -# define Xil_Ntohl(Data) (Data) -#endif -#else -# define Xil_In16LE Xil_In16 -# define Xil_In32LE Xil_In32 -# define Xil_Out16LE Xil_Out16 -# define Xil_Out32LE Xil_Out32 -# define Xil_Htons Xil_EndianSwap16 -# define Xil_Htonl Xil_EndianSwap32 -# define Xil_Ntohs Xil_EndianSwap16 -# define Xil_Ntohl Xil_EndianSwap32 -#endif - -#if defined (__MICROBLAZE__) -#ifdef __LITTLE_ENDIAN__ -static INLINE u16 Xil_In16BE(UINTPTR Addr) -#else -static INLINE u16 Xil_In16LE(UINTPTR Addr) -#endif -#else -static INLINE u16 Xil_In16BE(UINTPTR Addr) -#endif -{ - u16 value = Xil_In16(Addr); - return Xil_EndianSwap16(value); -} - -#if defined (__MICROBLAZE__) -#ifdef __LITTLE_ENDIAN__ -static INLINE u32 Xil_In32BE(UINTPTR Addr) -#else -static INLINE u32 Xil_In32LE(UINTPTR Addr) -#endif -#else -static INLINE u32 Xil_In32BE(UINTPTR Addr) -#endif -{ - u32 value = Xil_In32(Addr); - return Xil_EndianSwap32(value); -} - -#if defined (__MICROBLAZE__) -#ifdef __LITTLE_ENDIAN__ -static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value) -#else -static INLINE void Xil_Out16LE(UINTPTR Addr, u16 Value) -#endif -#else -static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value) -#endif -{ - Value = Xil_EndianSwap16(Value); - Xil_Out16(Addr, Value); -} - -#if defined (__MICROBLAZE__) -#ifdef __LITTLE_ENDIAN__ -static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value) -#else -static INLINE void Xil_Out32LE(UINTPTR Addr, u32 Value) -#endif -#else -static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value) -#endif -{ - Value = Xil_EndianSwap32(Value); - Xil_Out32(Addr, Value); -} - -#ifdef __cplusplus -} -#endif - -#endif /* end of protection macro */ -/** -* @} End of "addtogroup common_io_interfacing_apis". -*/ diff --git a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/70de79b75243001d18b399c1eb9b3628 b/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/70de79b75243001d18b399c1eb9b3628 deleted file mode 100644 index c63db8f..0000000 --- a/Vitis/.metadata/.plugins/org.eclipse.core.resources/.history/12/70de79b75243001d18b399c1eb9b3628 +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - -