forked from ROMEO/obsw
xilinx ps7_cortexa9 code Version xilinx_v2024.1
This commit is contained in:
parent
dd9c39af30
commit
fb4b12c8f9
11
bsp_z7/ps7_cortexa9_0/README.md
Normal file
11
bsp_z7/ps7_cortexa9_0/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
This is based on the bsp of the zynq_fsbl in https://github.com/Xilinx/embeddedsw/tree/xilinx_v2024.1/lib/sw_apps/zynq_fsbl
|
||||
|
||||
It is generated/collected by xilinx's build system when building the fsbl.
|
||||
|
||||
Currently, version xilinx_v2024.1 is used.
|
||||
|
||||
We use our own CMakeLists.txt located in the subfolders of `libsrc` to select which files to include in our bsp.
|
||||
|
||||
Xilinx exports CMakeLists.txt files for some of their folders as well, which we remove to avoid confusion.
|
||||
|
||||
Additionally, drivers from https://github.com/Xilinx/embeddedsw/tree/xilinx_v2024.1/XilinxProcessorIPLib/drivers are added as needed.
|
@ -9,8 +9,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define USE_WRITE 1 /* 1: Enable disk_write function */
|
||||
#define USE_IOCTL 1 /* 1: Enable disk_ioctl function */
|
||||
#define USE_WRITE 1 /**< 1: Enable disk_write function */
|
||||
#define USE_IOCTL 1 /**< 1: Enable disk_ioctl function */
|
||||
|
||||
#include "ff.h"
|
||||
#include "xil_types.h"
|
||||
@ -20,11 +20,11 @@ typedef BYTE DSTATUS;
|
||||
|
||||
/* Results of Disk Functions */
|
||||
typedef enum {
|
||||
RES_OK = 0, /* 0: Successful */
|
||||
RES_ERROR, /* 1: R/W Error */
|
||||
RES_WRPRT, /* 2: Write Protected */
|
||||
RES_NOTRDY, /* 3: Not Ready */
|
||||
RES_PARERR /* 4: Invalid Parameter */
|
||||
RES_OK = 0, /**< 0: Successful */
|
||||
RES_ERROR, /**< 1: R/W Error */
|
||||
RES_WRPRT, /**< 2: Write Protected */
|
||||
RES_NOTRDY, /**< 3: Not Ready */
|
||||
RES_PARERR /**< 4: Invalid Parameter */
|
||||
} DRESULT;
|
||||
|
||||
|
||||
@ -41,40 +41,40 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
|
||||
/* Disk Status Bits (DSTATUS) */
|
||||
|
||||
#define STA_NOINIT 0x01U /* Drive not initialized */
|
||||
#define STA_NODISK 0x02U /* No medium in the drive */
|
||||
#define STA_PROTECT 0x04U /* Write protected */
|
||||
#define STA_NOINIT 0x01U /**< Drive not initialized */
|
||||
#define STA_NODISK 0x02U /**< No medium in the drive */
|
||||
#define STA_PROTECT 0x04U /**< Write protected */
|
||||
|
||||
|
||||
/* Command code for disk_ioctrl fucntion */
|
||||
|
||||
/* Generic command (Used by FatFs) */
|
||||
#define CTRL_SYNC 0U /* Complete pending write process (needed at FF_FS_READONLY == 0) */
|
||||
#define GET_SECTOR_COUNT 1U /* Get media size (needed at FF_USE_MKFS == 1) */
|
||||
#define GET_SECTOR_SIZE 2U /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
|
||||
#define GET_BLOCK_SIZE 3U /* Get erase block size (needed at FF_USE_MKFS == 1) */
|
||||
#define CTRL_TRIM 4U /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
|
||||
#define CTRL_SYNC 0U /**< Complete pending write process (needed at FF_FS_READONLY == 0) */
|
||||
#define GET_SECTOR_COUNT 1U /**< Get media size (needed at FF_USE_MKFS == 1) */
|
||||
#define GET_SECTOR_SIZE 2U /**< Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
|
||||
#define GET_BLOCK_SIZE 3U /**< Get erase block size (needed at FF_USE_MKFS == 1) */
|
||||
#define CTRL_TRIM 4U /**< Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
|
||||
|
||||
/* Generic command (Not used by FatFs) */
|
||||
#define CTRL_POWER 5U /* Get/Set power status */
|
||||
#define CTRL_LOCK 6U /* Lock/Unlock media removal */
|
||||
#define CTRL_EJECT 7U /* Eject media */
|
||||
#define CTRL_FORMAT 8U /* Create physical format on the media */
|
||||
#define CTRL_POWER 5U /**< Get/Set power status */
|
||||
#define CTRL_LOCK 6U /**< Lock/Unlock media removal */
|
||||
#define CTRL_EJECT 7U /**< Eject media */
|
||||
#define CTRL_FORMAT 8U /**< Create physical format on the media */
|
||||
|
||||
/* MMC/SDC specific ioctl command */
|
||||
#define MMC_GET_TYPE 10U /* Get card type */
|
||||
#define MMC_GET_CSD 11U /* Get CSD */
|
||||
#define MMC_GET_CID 12U /* Get CID */
|
||||
#define MMC_GET_OCR 13U /* Get OCR */
|
||||
#define MMC_GET_SDSTAT 14U /* Get SD status */
|
||||
#define ISDIO_READ 55 /* Read data form SD iSDIO register */
|
||||
#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */
|
||||
#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */
|
||||
#define MMC_GET_TYPE 10U /**< Get card type */
|
||||
#define MMC_GET_CSD 11U /**< Get CSD */
|
||||
#define MMC_GET_CID 12U /**< Get CID */
|
||||
#define MMC_GET_OCR 13U /**< Get OCR */
|
||||
#define MMC_GET_SDSTAT 14U /**< Get SD status */
|
||||
#define ISDIO_READ 55 /**< Read data form SD iSDIO register */
|
||||
#define ISDIO_WRITE 56 /**< Write data to SD iSDIO register */
|
||||
#define ISDIO_MRITE 57 /**< Masked write data to SD iSDIO register */
|
||||
|
||||
/* ATA/CF specific ioctl command */
|
||||
#define ATA_GET_REV 20U /* Get F/W revision */
|
||||
#define ATA_GET_MODEL 21U /* Get model name */
|
||||
#define ATA_GET_SN 22U /* Get serial number */
|
||||
#define ATA_GET_REV 20U /**< Get F/W revision */
|
||||
#define ATA_GET_MODEL 21U /**< Get model name */
|
||||
#define ATA_GET_SN 22U /**< Get serial number */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -26,8 +26,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "xil_types.h"
|
||||
#include "ffconf.h" /* FatFs configuration options */
|
||||
#include "xilffs.h"
|
||||
|
||||
#if FF_DEFINED != FFCONF_DEF
|
||||
#error Wrong configuration file (ffconf.h).
|
||||
@ -355,7 +355,7 @@ int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
|
||||
int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
|
||||
TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
|
||||
|
||||
/* Some API fucntions are implemented as macro */
|
||||
/* Some API functions are implemented as macro */
|
||||
|
||||
#define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize))
|
||||
#define f_error(fp) ((fp)->err)
|
||||
|
@ -8,7 +8,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef SDT
|
||||
#include "xilffs_config.h"
|
||||
#else
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ Function Configurations
|
||||
@ -34,7 +38,7 @@ extern "C" {
|
||||
/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
|
||||
/ 3: f_lseek() function is removed in addition to 2. */
|
||||
|
||||
|
||||
#ifdef FILE_SYSTEM_USE_STRFUNC
|
||||
#if FILE_SYSTEM_USE_STRFUNC == 0
|
||||
#define FF_USE_STRFUNC 0 /* 0:Disable */
|
||||
#elif FILE_SYSTEM_USE_STRFUNC == 1
|
||||
@ -42,6 +46,9 @@ extern "C" {
|
||||
#elif FILE_SYSTEM_USE_STRFUNC == 2
|
||||
#define FF_USE_STRFUNC 2 /* 2:Enable */
|
||||
#endif
|
||||
#else
|
||||
#define FF_USE_STRFUNC 0 /* 0:Disable */
|
||||
#endif
|
||||
/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf().
|
||||
/
|
||||
/ 0: Disable string functions.
|
||||
@ -87,7 +94,6 @@ extern "C" {
|
||||
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
|
||||
|
||||
|
||||
#define FF_USE_STRFUNC 0
|
||||
#define FF_PRINT_LLI 1
|
||||
#define FF_PRINT_FLOAT 1
|
||||
#define FF_STRF_ENCODE 3
|
||||
@ -187,7 +193,7 @@ extern "C" {
|
||||
/ the file names to read. The maximum possible length of the read file name depends
|
||||
/ on character encoding. When LFN is not enabled, these options have no effect. */
|
||||
|
||||
|
||||
#ifdef FILE_SYSTEM_SET_FS_RPATH
|
||||
#if FILE_SYSTEM_SET_FS_RPATH == 0
|
||||
#define FF_FS_RPATH 0U
|
||||
#elif FILE_SYSTEM_SET_FS_RPATH == 1
|
||||
@ -195,6 +201,9 @@ extern "C" {
|
||||
#elif FILE_SYSTEM_SET_FS_RPATH == 2
|
||||
#define FF_FS_RPATH 2U
|
||||
#endif
|
||||
#else
|
||||
#define FF_FS_RPATH 0U
|
||||
#endif
|
||||
/* This option configures support for relative path.
|
||||
/
|
||||
/ 0: Disable relative path and remove related functions.
|
||||
|
268
bsp_z7/ps7_cortexa9_0/include/pm_api_version.h
Normal file
268
bsp_z7/ps7_cortexa9_0/include/pm_api_version.h
Normal file
@ -0,0 +1,268 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @file pm_api_version.h
|
||||
*
|
||||
* @addtogroup xpm_versal_apis XilPM APIs
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#ifndef PM_API_VERSION_H_
|
||||
#define PM_API_VERSION_H_
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @section EEMI_API_DETAIL XilPM EEMI API Version Detail
|
||||
*
|
||||
* This section provides details of EEMI API version and it's history for PM APIs of XilPM library.
|
||||
*
|
||||
* | NAME | ID | Platform | Version| Description |
|
||||
* |----------------------------|-------|---------------|:------:|---------------------------------------------------------------------------|
|
||||
* | PM_GET_API_VERSION | 0x1 | Both | 1 | The API is used to request the version number of the API |
|
||||
* | PM_SET_CONFIGURATION | 0x2 | ZynqMP | 1 | The API is used to configure the power management framework |
|
||||
* | ^ | ^ | ^ | ^ | Note: Deprecated in Versal but supported in ZynqMP |
|
||||
* | PM_GET_NODE_STATUS | 0x3 | Both | 1 | The API is used to obtain information about current status of a device |
|
||||
* | PM_GET_OP_CHARACTERISTIC | 0x4 | Both | 2 | V1 - The API is used to get operating characteristics of a device |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of bitmask functionality, user can check the supported\n "type" first before performing the actual functionality |
|
||||
* | PM_REGISTER_NOTIFIER | 0x5 | Both | 2 | V1 - The API is used to register a subsystem to be notified about the\n device event |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of event management functionality |
|
||||
* | ^ | ^ | ^ | ^ | Note: V2 is supported in Versal but ZynqMP supports only V1 |
|
||||
* | PM_REQUEST_SUSPEND | 0x6 | Both | 1 | The API is used to send suspend request to another subsystem |
|
||||
* | PM_SELF_SUSPEND | 0x7 | Both | 3 | V1 - The API is used to suspend a child subsystem |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of cpu idle functionality during force powerdown |
|
||||
* | ^ | ^ | ^ | ^ | V3 - Added support of CPU off state |
|
||||
* | ^ | ^ | ^ | ^ | Note: V3 is supported in Versal and Versal NET but ZynqMP supports only V1|
|
||||
* | PM_FORCE_POWERDOWN | 0x8 | Both | 2 | V1 - The API is used to Powerdown other processor or node |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of cpu idle functionality during force powerdown |
|
||||
* | ^ | ^ | ^ | ^ | Note: V2 is supported in Versal but ZynqMP supports only V1 |
|
||||
* | PM_ABORT_SUSPEND | 0x9 | Both | 1 | The API is used by a subsystem to abort suspend of a child subsystem |
|
||||
* | PM_REQUEST_WAKEUP | 0xA | Both | 1 | The API is used to start-up and wake-up a child subsystem |
|
||||
* | PM_SET_WAKEUP_SOURCE | 0xB | Both | 1 | The API is used to set wakeup source |
|
||||
* | PM_SYSTEM_SHUTDOWN | 0xC | Both | 1 | The API is used to shutdown or restart the system |
|
||||
* | PM_REQUEST_NODE | 0xD | Both | 2 | V1 - The API is used to request the usage of a device |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of security policy handling during request device |
|
||||
* | ^ | ^ | ^ | ^ | Note: V2 is supported in Versal but ZynqMP supports only V1 |
|
||||
* | PM_RELEASE_NODE | 0xE | Both | 2 | V1 - The API is used to release the usage of a device |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of security policy handling during request device |
|
||||
* | ^ | ^ | ^ | ^ | Note: V2 is supported in Versal but ZynqMP supports only V1 |
|
||||
* | PM_SET_REQUIREMENT | 0xF | Both | 1 | The API is used to announce a change in requirement for a specific slave\n node which is currently in use |
|
||||
* | PM_SET_MAX_LATENCY | 0x10 | Both | 1 | The API is used to set maximum allowed latency for the device |
|
||||
* | PM_RESET_ASSERT | 0x11 | Both | 1 | The API is used to reset or de-reset a device |
|
||||
* | PM_RESET_GET_STATUS | 0x12 | Both | 1 | The API is used to read the device reset state |
|
||||
* | PM_MMIO_WRITE | 0x13 | ZynqMP | 1 | The API is used to write a value into a register |
|
||||
* | ^ | ^ | ^ | ^ | Note: Deprecated in Versal but supported in ZynqMP |
|
||||
* | PM_MMIO_READ | 0x14 | ZynqMP | 1 | The API is used to read a value from a register |
|
||||
* | ^ | ^ | ^ | ^ | Note: Deprecated in Versal but supported in ZynqMP |
|
||||
* | PM_INIT_FINALIZE | 0x15 | Both | 1 | The API is used to initialize subsystem and release unused devices |
|
||||
* | PM_GET_CHIPID | 0x18 | Both | 1 | The API is used to request the version and ID code of a chip |
|
||||
* | PM_PINCTRL_REQUEST | 0x1C | Both | 1 | The API is used to request the pin |
|
||||
* | PM_PINCTRL_RELEASE | 0x1D | Both | 1 | The API is used to release the pin |
|
||||
* | PM_PINCTRL_GET_FUNCTION | 0x1E | Both | 1 | The API is used to read the pin function |
|
||||
* | PM_PINCTRL_SET_FUNCTION | 0x1F | Both | 1 | The API is used to set the pin function |
|
||||
* | PM_PINCTRL_CONFIG_PARAM_GET| 0x20 | Both | 1 | The API is used to read the pin parameter value |
|
||||
* | PM_PINCTRL_CONFIG_PARAM_SET| 0x21 | Both | 2 | V1 - The API is used to set the pin parameter value |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of MIO tri-state controlling functionality |
|
||||
* | ^ | ^ | ^ | ^ | Note: V2 is supported in ZynqMP but Versal supports only V1 |
|
||||
* | PM_IOCTL | 0x22 | Both | 3 | V1 - The API is used to perform driver-like IOCTL functions on shared\n system devices |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of bitmask functionality, user can check the supported\n ID first before performing the actual functionality |
|
||||
* | ^ | ^ | ^ | ^ | V3 - Add support of zeroization of AIE data and program memory separately |
|
||||
* | ^ | ^ | ^ | ^ | Note: V3 is supported in Versal but ZynqMP supports only V2 |
|
||||
* | PM_QUERY_DATA | 0x23 | Both | 2 | V1 - The API is used to query information about the platform resources |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of bitmask functionality, user can check the supported\n ID first before performing the actual functionality |
|
||||
* | PM_CLOCK_ENABLE | 0x24 | Both | 1 | The API is used to enable the clock |
|
||||
* | PM_CLOCK_DISABLE | 0x25 | Both | 1 | The API is used to disable the clock |
|
||||
* | PM_CLOCK_GETSTATE | 0x26 | Both | 1 | The API is used to read the clock state |
|
||||
* | PM_CLOCK_SETDIVIDER | 0x27 | Both | 1 | The API is used to set the divider value of the clock |
|
||||
* | PM_CLOCK_GETDIVIDER | 0x28 | Both | 1 | The API is used to read the clock divider |
|
||||
* | PM_CLOCK_SETPARENT | 0x2B | Both | 1 | The API is used to set the parent of the clock |
|
||||
* | PM_CLOCK_GETPARENT | 0x2C | Both | 1 | The API is used to read the clock parent |
|
||||
* | PM_PLL_SET_PARAM | 0x30 | Both | 1 | The API is used to set the parameter of PLL clock |
|
||||
* | PM_PLL_GET_PARAM | 0x31 | Both | 1 | The API is used to read the parameter of PLL clock |
|
||||
* | PM_PLL_SET_MODE | 0x32 | Both | 1 | The API is used to set the mode of PLL clock |
|
||||
* | PM_PLL_GET_MODE | 0x33 | Both | 1 | The API is used to read the mode of PLL clock |
|
||||
* | PM_REGISTER_ACCESS | 0x34 | ZynqMP | 1 | The API is used for register read/write access data |
|
||||
* | ^ | ^ | ^ | ^ | Note: Deprecated in Versal but supported in ZynqMP |
|
||||
* | PM_EFUSE_ACCESS | 0x35 | ZynqMP | 1 | The API is used to provide access to efuse memory |
|
||||
* | ^ | ^ | ^ | ^ | Note: Deprecated in Versal but supported in ZynqMP |
|
||||
* | PM_FEATURE_CHECK | 0x3F | Both | 2 | V1 - The API is used to return supported version of the given API |
|
||||
* | ^ | ^ | ^ | ^ | V2 - Added support of bitmask payload functionality |
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @section IOCTL_ID_DETAIL XilPM IOCTL IDs Detail
|
||||
*
|
||||
* This section provides the details of the IOCTL IDs which are supported across the different platforms and their brief descriptions.
|
||||
*
|
||||
* | Name | ID | Platform | Description |
|
||||
* |------------------------------------|-------|---------------|---------------------------------------|
|
||||
* | IOCTL_GET_RPU_OPER_MODE | 0 | Both | Get RPU mode |
|
||||
* | IOCTL_SET_RPU_OPER_MODE | 1 | Both | Set RPU mode |
|
||||
* | IOCTL_RPU_BOOT_ADDR_CONFIG | 2 | Both | RPU boot address config |
|
||||
* | IOCTL_TCM_COMB_CONFIG | 3 | Both | TCM config |
|
||||
* | IOCTL_SET_TAPDELAY_BYPASS | 4 | Both | TAP delay bypass |
|
||||
* | IOCTL_SD_DLL_RESET | 6 | Both | SD DLL reset |
|
||||
* | IOCTL_SET_SD_TAPDELAY | 7 | Both | SD TAP delay |
|
||||
* | IOCTL_SET_PLL_FRAC_MODE | 8 | Both | Set PLL frac mode |
|
||||
* | IOCTL_GET_PLL_FRAC_MODE | 9 | Both | Get PLL frac mode |
|
||||
* | IOCTL_SET_PLL_FRAC_DATA | 10 | Both | Set PLL frac data |
|
||||
* | IOCTL_GET_PLL_FRAC_DATA | 11 | Both | Get PLL frac data |
|
||||
* | IOCTL_WRITE_GGS | 12 | Both | Write GGS |
|
||||
* | IOCTL_READ_GGS | 13 | Both | Read GGS |
|
||||
* | IOCTL_WRITE_PGGS | 14 | Both | Write PGGS |
|
||||
* | IOCTL_READ_PGGS | 15 | Both | Read PGGS |
|
||||
* | IOCTL_ULPI_RESET | 16 | ZynqMP | ULPI reset |
|
||||
* | IOCTL_SET_BOOT_HEALTH_STATUS | 17 | Both | Set boot status |
|
||||
* | IOCTL_AFI | 18 | ZynqMP | AFI |
|
||||
* | IOCTL_OSPI_MUX_SELECT | 21 | Versal | OSPI mux select |
|
||||
* | IOCTL_USB_SET_STATE | 22 | Versal | USB set state |
|
||||
* | IOCTL_GET_LAST_RESET_REASON | 23 | Versal | Get last reset reason |
|
||||
* | IOCTL_AIE_ISR_CLEAR | 24 | Versal | AIE ISR clear |
|
||||
* | IOCTL_REGISTER_SGI | 25 | None | Register SGI to ATF |
|
||||
* | IOCTL_SET_FEATURE_CONFIG | 26 | ZynqMP | Set runtime feature config |
|
||||
* | IOCTL_GET_FEATURE_CONFIG | 27 | ZynqMP | Get runtime feature config |
|
||||
* | IOCTL_READ_REG | 28 | Versal | Read a 32-bit register |
|
||||
* | IOCTL_MASK_WRITE_REG | 29 | Versal | RMW a 32-bit register |
|
||||
* | IOCTL_SET_SD_CONFIG | 30 | ZynqMP | Set SD config register value |
|
||||
* | IOCTL_SET_GEM_CONFIG | 31 | ZynqMP | Set GEM config register value |
|
||||
* | IOCTL_SET_USB_CONFIG | 32 | ZynqMP | Set USB config register value |
|
||||
* | IOCTL_AIE_OPS | 33 | Versal | AIE1/AIEML Run Time Operations |
|
||||
* | IOCTL_GET_QOS | 34 | Versal | Get Device QoS value |
|
||||
* | IOCTL_GET_APU_OPER_MODE | 35 | Versal | Get APU operation mode |
|
||||
* | IOCTL_SET_APU_OPER_MODE | 36 | Versal | Set APU operation mode |
|
||||
* | IOCTL_PREPARE_DDR_SHUTDOWN | 37 | Versal | Prepare DDR for shut down |
|
||||
* | IOCTL_GET_SSIT_TEMP | 38 | Versal | Get secondary SLR min/max temperature |
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @section QUERY_ID_DETAIL XilPM QUERY IDs Detail
|
||||
*
|
||||
* This section provides the details of the QUERY IDs which are supported across the different platforms and their brief descriptions.
|
||||
*
|
||||
* | Name | ID | Platform | Description |
|
||||
* |--------------------------------------------|-------|---------------|---------------------------------------|
|
||||
* | XPM_QID_INVALID | 0 | Both | Invalid Query ID |
|
||||
* | XPM_QID_CLOCK_GET_NAME | 1 | Both | Get clock name |
|
||||
* | XPM_QID_CLOCK_GET_TOPOLOGY | 2 | Both | Get clock topology |
|
||||
* | XPM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS | 3 | Both | Get clock fixedfactor parameter |
|
||||
* | XPM_QID_CLOCK_GET_MUXSOURCES | 4 | Both | Get clock mux sources |
|
||||
* | XPM_QID_CLOCK_GET_ATTRIBUTES | 5 | Both | Get clock attributes |
|
||||
* | XPM_QID_PINCTRL_GET_NUM_PINS | 6 | Both | Get total pins |
|
||||
* | XPM_QID_PINCTRL_GET_NUM_FUNCTIONS | 7 | Both | Get total pin functions |
|
||||
* | XPM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS | 8 | Both | Get total pin function groups |
|
||||
* | XPM_QID_PINCTRL_GET_FUNCTION_NAME | 9 | Both | Get pin function name |
|
||||
* | XPM_QID_PINCTRL_GET_FUNCTION_GROUPS | 10 | Both | Get pin function groups |
|
||||
* | XPM_QID_PINCTRL_GET_PIN_GROUPS | 11 | Both | Get pin groups |
|
||||
* | XPM_QID_CLOCK_GET_NUM_CLOCKS | 12 | Both | Get number of clocks |
|
||||
* | XPM_QID_CLOCK_GET_MAX_DIVISOR | 13 | Both | Get max clock divisor |
|
||||
* | XPM_QID_PLD_GET_PARENT | 14 | Versal | Get PLD parent |
|
||||
* | XPM_QID_PINCTRL_GET_ATTRIBUTES | 15 | Versal | Get pin attributes |
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @section GET_OP_CHAR_DETAIL XilPM GET_OP_CHAR IDs Detail
|
||||
*
|
||||
* This section provides the details of the GET_OP_CHAR IDs which are supported across the different platforms and their brief descriptions.
|
||||
*
|
||||
* | Name | ID | Platform | Description |
|
||||
* |------------------------------------|-------|---------------|-----------------------------------------------|
|
||||
* | PM_OPCHAR_TYPE_POWER | 1 | ZynqMP | Operating characteristic ID power |
|
||||
* | PM_OPCHAR_TYPE_TEMP | 2 | Versal | Operating characteristic ID temperature |
|
||||
* | PM_OPCHAR_TYPE_LATENCY | 3 | Both | Operating characteristic ID latency |
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* PM API IDs
|
||||
*/
|
||||
typedef enum {
|
||||
PM_API_MIN, /**< 0x0 */
|
||||
PM_GET_API_VERSION, /**< 0x1 */
|
||||
PM_SET_CONFIGURATION, /**< 0x2 */
|
||||
PM_GET_NODE_STATUS, /**< 0x3 */
|
||||
PM_GET_OP_CHARACTERISTIC, /**< 0x4 */
|
||||
PM_REGISTER_NOTIFIER, /**< 0x5 */
|
||||
PM_REQUEST_SUSPEND, /**< 0x6 */
|
||||
PM_SELF_SUSPEND, /**< 0x7 */
|
||||
PM_FORCE_POWERDOWN, /**< 0x8 */
|
||||
PM_ABORT_SUSPEND, /**< 0x9 */
|
||||
PM_REQUEST_WAKEUP, /**< 0xA */
|
||||
PM_SET_WAKEUP_SOURCE, /**< 0xB */
|
||||
PM_SYSTEM_SHUTDOWN, /**< 0xC */
|
||||
PM_REQUEST_NODE, /**< 0xD */
|
||||
PM_RELEASE_NODE, /**< 0xE */
|
||||
PM_SET_REQUIREMENT, /**< 0xF */
|
||||
PM_SET_MAX_LATENCY, /**< 0x10 */
|
||||
PM_RESET_ASSERT, /**< 0x11 */
|
||||
PM_RESET_GET_STATUS, /**< 0x12 */
|
||||
PM_MMIO_WRITE, /**< 0x13 */
|
||||
PM_MMIO_READ, /**< 0x14 */
|
||||
PM_INIT_FINALIZE, /**< 0x15 */
|
||||
PM_FPGA_LOAD, /**< 0x16 */
|
||||
PM_FPGA_GET_STATUS, /**< 0x17 */
|
||||
PM_GET_CHIPID, /**< 0x18 */
|
||||
PM_SECURE_RSA_AES, /**< 0x19 */
|
||||
PM_SECURE_SHA, /**< 0x1A */
|
||||
PM_SECURE_RSA, /**< 0x1B */
|
||||
PM_PINCTRL_REQUEST, /**< 0x1C */
|
||||
PM_PINCTRL_RELEASE, /**< 0x1D */
|
||||
PM_PINCTRL_GET_FUNCTION, /**< 0x1E */
|
||||
PM_PINCTRL_SET_FUNCTION, /**< 0x1F */
|
||||
PM_PINCTRL_CONFIG_PARAM_GET, /**< 0x20 */
|
||||
PM_PINCTRL_CONFIG_PARAM_SET, /**< 0x21 */
|
||||
PM_IOCTL, /**< 0x22 */
|
||||
PM_QUERY_DATA, /**< 0x23 */
|
||||
PM_CLOCK_ENABLE, /**< 0x24 */
|
||||
PM_CLOCK_DISABLE, /**< 0x25 */
|
||||
PM_CLOCK_GETSTATE, /**< 0x26 */
|
||||
PM_CLOCK_SETDIVIDER, /**< 0x27 */
|
||||
PM_CLOCK_GETDIVIDER, /**< 0x28 */
|
||||
PM_CLOCK_SETRATE, /**< 0x29 */
|
||||
/* PM_CLOCK_GETRATE API is deprecated */
|
||||
PM_RESERVE_ID, /**< 0x2A */
|
||||
PM_CLOCK_SETPARENT, /**< 0x2B */
|
||||
PM_CLOCK_GETPARENT, /**< 0x2C */
|
||||
PM_SECURE_IMAGE, /**< 0x2D */
|
||||
PM_FPGA_READ, /**< 0x2E */
|
||||
PM_SECURE_AES, /**< 0x2F */
|
||||
PM_PLL_SET_PARAMETER, /**< 0x30 */
|
||||
PM_PLL_GET_PARAMETER, /**< 0x31 */
|
||||
PM_PLL_SET_MODE, /**< 0x32 */
|
||||
PM_PLL_GET_MODE, /**< 0x33 */
|
||||
PM_REGISTER_ACCESS, /**< 0x34 */
|
||||
PM_EFUSE_ACCESS, /**< 0x35 */
|
||||
PM_ADD_SUBSYSTEM, /**< 0x36 */
|
||||
PM_DESTROY_SUBSYSTEM, /**< 0x37 */
|
||||
PM_DESCRIBE_NODES, /**< 0x38 */
|
||||
PM_ADD_NODE, /**< 0x39 */
|
||||
PM_ADD_NODE_PARENT, /**< 0x3A */
|
||||
PM_ADD_NODE_NAME, /**< 0x3B */
|
||||
PM_ADD_REQUIREMENT, /**< 0x3C */
|
||||
PM_SET_CURRENT_SUBSYSTEM, /**< 0x3D */
|
||||
PM_INIT_NODE, /**< 0x3E */
|
||||
PM_FEATURE_CHECK, /**< 0x3F */
|
||||
PM_ISO_CONTROL, /**< 0x40 */
|
||||
PM_ACTIVATE_SUBSYSTEM, /**< 0x41 */
|
||||
PM_SET_NODE_ACCESS, /**< 0x42 */
|
||||
PM_BISR, /**< 0x43 */
|
||||
PM_APPLY_TRIM, /**< 0x44 */
|
||||
PM_NOC_CLOCK_ENABLE, /**< 0x45 */
|
||||
PM_IF_NOC_CLOCK_ENABLE, /**< 0x46 */
|
||||
PM_FORCE_HOUSECLEAN, /**< 0x47 */
|
||||
PM_FPGA_GET_VERSION, /**< 0x48 */
|
||||
PM_FPGA_GET_FEATURE_LIST, /**< 0x49 */
|
||||
PM_API_MAX /**< 0x4A */
|
||||
} XPm_ApiId;
|
||||
|
||||
#endif /* PM_API_VERSION_H_ */
|
@ -12,19 +12,22 @@
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*
|
||||
*/
|
||||
*****************************************************************************/
|
||||
/***************************** Include Files *********************************/
|
||||
|
||||
/*
|
||||
* print -- do a raw print of a string
|
||||
*/
|
||||
#include "xil_printf.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* print -- do a raw print of a string
|
||||
*
|
||||
******************************************************************************/
|
||||
void print(const char8 *ptr)
|
||||
{
|
||||
#if defined (__aarch64__) && (HYP_GUEST == 1) && (EL1_NONSECURE == 1) && defined (XEN_USE_PV_CONSOLE)
|
||||
XPVXenConsole_Write(ptr);
|
||||
#else
|
||||
#ifdef STDOUT_BASEADDRESS
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(SDT)
|
||||
while (*ptr != (char8)0) {
|
||||
outbyte (*ptr);
|
||||
ptr++;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2014 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2014 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -30,7 +31,8 @@
|
||||
* 8.0 sk 03/17/22 Modify sleep_MB parameter type from unsigned int to
|
||||
* u32 and usleep_MB parameter type from unsigned long to
|
||||
* ULONG to fix misra_c_2012_rule_4_6 violation.
|
||||
*
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* 9.1 mus 10/24/23 Add support for RISC-V.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -87,6 +89,7 @@ extern "C" {
|
||||
(timeout>0) ? 0 : -1; \
|
||||
} )
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
void usleep(ULONG useconds);
|
||||
void sleep(u32 seconds);
|
||||
void usleep_R5(ULONG useconds);
|
||||
@ -97,6 +100,10 @@ int usleep_A53(unsigned long useconds);
|
||||
unsigned sleep_A53(unsigned int seconds);
|
||||
int usleep_A9(unsigned long useconds);
|
||||
unsigned sleep_A9(unsigned int seconds);
|
||||
void sleep_riscv(u32 seconds);
|
||||
void usleep_riscv(ULONG useconds);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2011 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xadcps.h
|
||||
* @addtogroup xadcps_v2_6
|
||||
* @addtogroup Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -157,6 +158,8 @@
|
||||
* 2.6 aad 11/02/20 Fix MISRAC Mandatory and Advisory errors.
|
||||
* aad 12/17/20 Added missing function declarations and removed
|
||||
* functions with no definitions.
|
||||
* 2.7 cog 07/24/23 Added support for SDT flow
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -300,7 +303,11 @@ extern "C" {
|
||||
* device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Device base address */
|
||||
} XAdcPs_Config;
|
||||
|
||||
@ -472,7 +479,11 @@ typedef struct {
|
||||
/**
|
||||
* Functions in xadcps_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XAdcPs_Config *XAdcPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XAdcPs_Config *XAdcPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Functions in xadcps.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2011 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xadcps_hw.h
|
||||
* @addtogroup xadcps_v2_6
|
||||
* @addtogroup Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains identifiers and basic driver functions (or
|
||||
|
18
bsp_z7/ps7_cortexa9_0/include/xcortexa9.h
Normal file
18
bsp_z7/ps7_cortexa9_0/include/xcortexa9.h
Normal file
@ -0,0 +1,18 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2021-2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
#ifndef XIL_XCORTEXA9_H_ /* prevent circular inclusions */
|
||||
#define XIL_XCORTEXA9_H_ /* by using protection macros */
|
||||
|
||||
/***************************** Include Files ********************************/
|
||||
|
||||
#include "xil_types.h"
|
||||
|
||||
/**************************** Type Definitions ******************************/
|
||||
typedef struct {
|
||||
u32 CpuFreq;
|
||||
} XCortexa9_Config;
|
||||
|
||||
#endif /* XIL_XCORTEXA9_H_ */
|
18
bsp_z7/ps7_cortexa9_0/include/xcortexa9_config.h
Normal file
18
bsp_z7/ps7_cortexa9_0/include/xcortexa9_config.h
Normal file
@ -0,0 +1,18 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2021-2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
#ifndef XIL_XCORTEXA9_CONFIG_H_ /* prevent circular inclusions */
|
||||
#define XIL_XCORTEXA9_CONFIG_H_ /* by using protection macros */
|
||||
|
||||
/***************************** Include Files ********************************/
|
||||
|
||||
#include "xcortexa9.h"
|
||||
|
||||
/************************** Variable Definitions ****************************/
|
||||
extern XCortexa9_Config XCortexa9_ConfigTable;
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions ********************/
|
||||
#define XGet_CpuFreq() XCortexa9_ConfigTable.CpuFreq
|
||||
#endif /* XIL_XCORTEXA9_CONFIG_H_ */
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2011 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xcpu_cortexa9.h
|
||||
* @addtogroup cpu_cortexa9_v2_11
|
||||
* @addtogroup cpu_cortexa9 Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2002 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -61,13 +61,13 @@ int printf(const char *format, ...);
|
||||
|
||||
#else /* defined(DEBUG) && !defined(NDEBUG) */
|
||||
|
||||
#define xdbg_stmnt(x)
|
||||
#define xdbg_stmnt(x) /**< Debug statement */
|
||||
|
||||
/* See VxWorks comments above */
|
||||
#if defined(XENV_VXWORKS) && defined(_WRS_GNU_VAR_MACROS)
|
||||
#define xdbg_printf(type, args...)
|
||||
#else /* ANSI Syntax */
|
||||
#define xdbg_printf(...)
|
||||
#define xdbg_printf(...) /**< Debug printf */
|
||||
#endif
|
||||
#endif /* defined(DEBUG) && !defined(NDEBUG) */
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg.h
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -133,6 +134,7 @@
|
||||
* 3.5 ms 04/18/17 Modified tcl file to add suffix U for all macros
|
||||
* definitions of devcfg in xparameters.h
|
||||
* ms 08/07/17 Fixed compilation warnings in xdevcfg_sinit.c
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -178,8 +180,18 @@ typedef void (*XDcfg_IntrHandler) (void *CallBackRef, u32 Status);
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddr; /**< Base address of the device */
|
||||
#ifdef SDT
|
||||
u32 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XDcfg_Config;
|
||||
|
||||
/**
|
||||
@ -298,7 +310,11 @@ typedef struct {
|
||||
/*
|
||||
* Lookup configuration in xdevcfg_sinit.c.
|
||||
*/
|
||||
#ifndef SDT
|
||||
XDcfg_Config *XDcfg_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XDcfg_Config *XDcfg_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Selftest function in xdevcfg_selftest.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_hw.h
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the hardware interface to the Device Config Interface.
|
||||
@ -26,6 +27,7 @@
|
||||
* 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.
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps.h
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -60,6 +61,7 @@
|
||||
* 2.4 adk 13/08/18 Fixed armcc compiler warnings in the driver CR-1008310.
|
||||
* 2.8 sk 05/18/21 Modify all inline functions declarations from extern inline
|
||||
* to static inline to avoid the linkage conflict for IAR compiler.
|
||||
* 2.9 aj 11/07/23 Added support for system device tree
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -88,8 +90,19 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Base address of device (IPIF) */
|
||||
|
||||
#ifdef SDT
|
||||
u32 IntrId[9]; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XDmaPs_Config;
|
||||
|
||||
|
||||
@ -312,7 +325,12 @@ void XDmaPs_FaultISR(XDmaPs *InstPtr);
|
||||
/*
|
||||
* Static loopup function implemented in xdmaps_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(UINTPTR BaseAddress);
|
||||
u32 XDmaPs_GetDrvIndex(XDmaPs *InstancePtr, UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_hw.h
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains the hardware interface of an XDmaPs device.
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -508,12 +509,25 @@ typedef void (*XEmacPs_ErrHandler) (void *CallBackRef, u8 Direction,
|
||||
* This typedef contains configuration information for a device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifdef SDT
|
||||
char *Name; /**< Unique name of the device */
|
||||
#else
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#endif
|
||||
UINTPTR BaseAddress;/**< Physical base address of IPIF registers */
|
||||
u8 IsCacheCoherent; /**< Applicable only to A53 in EL1 mode;
|
||||
* describes whether Cache Coherent or not */
|
||||
#if defined (XCLOCKING)
|
||||
#ifdef SDT
|
||||
u16 IntrId;
|
||||
UINTPTR IntrParent;
|
||||
#endif
|
||||
#if defined (XCLOCKING) || defined (SDT)
|
||||
u32 RefClk; /**< Input clock */
|
||||
#endif
|
||||
#ifdef SDT
|
||||
char *PhyType; /**< PhyType indicates which type of PHY interface is
|
||||
* used (MII, GMII, RGMII, etc.
|
||||
*/
|
||||
#endif
|
||||
u16 S1GDiv0; /**< 1Gbps Clock Divider 0 */
|
||||
u8 S1GDiv1; /**< 1Gbps Clock Divider 1 */
|
||||
@ -797,7 +811,12 @@ void XEmacPs_SetQueuePtr(XEmacPs *InstancePtr, UINTPTR QPtr, u8 QueueNum,
|
||||
/*
|
||||
* Lookup configuration in xemacps_sinit.c
|
||||
*/
|
||||
|
||||
#ifndef SDT
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interrupt-related functions in xemacps_intr.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_bd.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This header provides operations to manage buffer descriptors in support
|
||||
@ -45,6 +46,7 @@
|
||||
* 3.2 hk 11/18/15 Change BD typedef and number of words.
|
||||
* 3.8 hk 08/18/18 Remove duplicate definition of XEmacPs_BdSetLength
|
||||
* 3.8 mus 11/05/18 Support 64 bit DMA addresses for Microblaze-X platform.
|
||||
* 3.9 aj 22/03/24 Add mask for XEmaPs_BdGetBufAddr
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -239,11 +241,11 @@ typedef u32 XEmacPs_Bd[XEMACPS_BD_NUM_WORDS];
|
||||
*****************************************************************************/
|
||||
#if defined(__aarch64__) || defined(__arch64__)
|
||||
#define XEmacPs_BdGetBufAddr(BdPtr) \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) | \
|
||||
((XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK) | \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_HI_OFFSET)) << 32U)
|
||||
#else
|
||||
#define XEmacPs_BdGetBufAddr(BdPtr) \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET))
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_bdring.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* The Xiline EmacPs Buffer Descriptor ring driver. This is part of EmacPs
|
||||
|
@ -8,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_hw.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains identifiers and low-level driver functions (or
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -124,6 +124,11 @@
|
||||
* 3.8 sne 09/17/20 Added description for Versal PS and PMC GPIO pins.
|
||||
* 3.9 sne 03/15/21 Fixed MISRA-C violations.
|
||||
* 3.11 sg 02/23/23 Update bank and pin mapping information.
|
||||
* 3.12 gm 07/11/23 Added SDT support.
|
||||
* 3.13 gm 03/15/24 Remove const of XGpioPs InstancePtr from function proto
|
||||
* type of XGpioPs_IntrEnable, XGpioPs_IntrDisable,
|
||||
* XGpioPs_IntrEnablePin and XGpioPs_IntrDisablePin
|
||||
* to add multi-core interrupt support.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -167,6 +172,7 @@ extern "C" {
|
||||
* Zynq Ultrascale+ MP GPIO device
|
||||
*/
|
||||
#define XGPIOPS_MAX_BANKS 0x04U /**< Max banks in a Zynq GPIO device */
|
||||
#define XGPIOPS_MAX_BANKS_CNT 0x06U /**< Max banks number of all platforms */
|
||||
|
||||
#define XGPIOPS_DEVICE_MAX_PIN_NUM_ZYNQMP (u32)174 /**< Max pins in the
|
||||
* Zynq Ultrascale+ MP GPIO device
|
||||
@ -209,8 +215,18 @@ typedef void (*XGpioPs_Handler) (void *CallBackRef, u32 Bank, u32 Status);
|
||||
* This typedef contains configuration information for a device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
UINTPTR BaseAddr; /**< Register base address */
|
||||
#ifdef SDT
|
||||
u16 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XGpioPs_Config;
|
||||
|
||||
/**
|
||||
@ -227,6 +243,7 @@ typedef struct {
|
||||
u32 MaxPinNum; /**< Max pins in the GPIO device */
|
||||
u8 MaxBanks; /**< Max banks in a GPIO device */
|
||||
u32 PmcGpio; /**< Flag for accessing PS GPIO for versal*/
|
||||
u32 CoreIntrMask[XGPIOPS_MAX_BANKS_CNT]; /**< Interrupt mask per core */
|
||||
} XGpioPs;
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
@ -262,12 +279,12 @@ void XGpioPs_SetOutputEnablePin(const XGpioPs *InstancePtr, u32 Pin, u32 OpEnabl
|
||||
u32 XGpioPs_GetOutputEnablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
/* Diagnostic functions in xgpiops_selftest.c */
|
||||
s32 XGpioPs_SelfTest(const XGpioPs *InstancePtr);
|
||||
s32 XGpioPs_SelfTest(XGpioPs *InstancePtr);
|
||||
|
||||
/* Functions in xgpiops_intr.c */
|
||||
/* Bank APIs in xgpiops_intr.c */
|
||||
void XGpioPs_IntrEnable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrDisable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrEnable(XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrDisable(XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
u32 XGpioPs_IntrGetEnabled(const XGpioPs *InstancePtr, u8 Bank);
|
||||
u32 XGpioPs_IntrGetStatus(const XGpioPs *InstancePtr, u8 Bank);
|
||||
void XGpioPs_IntrClear(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
@ -283,14 +300,18 @@ void XGpioPs_IntrHandler(const XGpioPs *InstancePtr);
|
||||
void XGpioPs_SetIntrTypePin(const XGpioPs *InstancePtr, u32 Pin, u8 IrqType);
|
||||
u8 XGpioPs_GetIntrTypePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
void XGpioPs_IntrEnablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrDisablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrEnablePin(XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrDisablePin(XGpioPs *InstancePtr, u32 Pin);
|
||||
u32 XGpioPs_IntrGetEnabledPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
u32 XGpioPs_IntrGetStatusPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrClearPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
/* Functions in xgpiops_sinit.c */
|
||||
#ifndef SDT
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -26,6 +27,7 @@
|
||||
* 3.04a sdm 01/02/12 Remove redundant dsb/dmb instructions in cache maintenance
|
||||
* APIs.
|
||||
* 6.8 aru 09/06/18 Removed compilation warnings for ARMCC toolchain.
|
||||
* 9.0 ml 03/03/23 Updated function prototypes.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
50
bsp_z7/ps7_cortexa9_0/include/xil_cryptoalginfo.h
Normal file
50
bsp_z7/ps7_cortexa9_0/include/xil_cryptoalginfo.h
Normal file
@ -0,0 +1,50 @@
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* @file xil_cryptoalginfo.h
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* Crypto algotithm information structure declaration.
|
||||
*
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- -------- -------- -----------------------------------------------
|
||||
* 9.0 mmd 07/04/23 First release.
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef XIL_CRYPTOALGINFO_H
|
||||
#define XIL_CRYPTOALGINFO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************** Include Files *********************************/
|
||||
#include "xil_types.h"
|
||||
|
||||
/**************************** Type Definitions *******************************/
|
||||
typedef enum _Xil_CryptoAlgNistStatus {
|
||||
NOT_APPLICABLE = 0x00,
|
||||
NIST_COMPLIANT = 0x11,
|
||||
NIST_NON_COMPLIANT = 0xFE,
|
||||
} Xil_CryptoAlgNistStatus;
|
||||
|
||||
typedef struct _Xil_CryptoAlgInfo {
|
||||
u32 Version;
|
||||
Xil_CryptoAlgNistStatus NistStatus;
|
||||
} Xil_CryptoAlgInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* XIL_CRYPTOALGINFO_H */
|
@ -75,8 +75,10 @@
|
||||
#include "xil_types.h"
|
||||
#include "xpseudo_asm.h"
|
||||
#include "bspconfig.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#include "xdebug.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -228,7 +230,7 @@ extern "C" {
|
||||
/*
|
||||
* XIL_EXCEPTION_ID_INT is defined for all Xilinx processors.
|
||||
*/
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3) || defined(ARMR52)
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3)
|
||||
#define XIL_EXCEPTION_ID_INT XIL_EXCEPTION_ID_FIQ_INT
|
||||
#else
|
||||
#define XIL_EXCEPTION_ID_INT XIL_EXCEPTION_ID_IRQ_INT
|
||||
@ -267,7 +269,7 @@ extern XExc_VectorTableEntry XExc_VectorTable[];
|
||||
* C-Style signature: void Xil_ExceptionEnableMask(Mask)
|
||||
*
|
||||
******************************************************************************/
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3) || defined(ARMR52)
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3)
|
||||
/*
|
||||
* Cortexa72 processor in versal is coupled with GIC-500, and GIC-500 supports
|
||||
* only FIQ at EL3. Hence, tweaking this macro to always enable FIQ
|
||||
@ -295,7 +297,7 @@ extern XExc_VectorTableEntry XExc_VectorTable[];
|
||||
* @note None.
|
||||
*
|
||||
******************************************************************************/
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3) || defined(ARMR52)
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3)
|
||||
#define Xil_ExceptionEnable() \
|
||||
Xil_ExceptionEnableMask(XIL_EXCEPTION_FIQ)
|
||||
#else
|
||||
@ -315,7 +317,7 @@ extern XExc_VectorTableEntry XExc_VectorTable[];
|
||||
* C-Style signature: Xil_ExceptionDisableMask(Mask)
|
||||
*
|
||||
******************************************************************************/
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3) || defined(ARMR52)
|
||||
#if (defined (versal) && !defined(ARMR5) && EL3)
|
||||
/*
|
||||
* Cortexa72 processor in versal is coupled with GIC-500, and GIC-500 supports
|
||||
* only FIQ at EL3. Hence, tweaking this macro to always disable FIQ
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2014 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2014 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -32,12 +33,12 @@
|
||||
* 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.
|
||||
*
|
||||
* 9.0 ml 03/03/23 Add description and remove comments to fix doxygen warnings.
|
||||
* </pre>
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XIL_IO_H /* prevent circular inclusions */
|
||||
#define XIL_IO_H /* by using protection macros */
|
||||
#ifndef XIL_IO_H /**< prevent circular inclusions */
|
||||
#define XIL_IO_H /**< by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -63,25 +64,25 @@ extern u32 XStl_RegUpdate(u32 RegAddr, u32 RegVal);
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
#if defined __GNUC__
|
||||
#if defined (__MICROBLAZE__)
|
||||
# define INST_SYNC mbar(0)
|
||||
# define DATA_SYNC mbar(1)
|
||||
# define INST_SYNC mbar(0) /**< Instruction Synchronization Barrier */
|
||||
# define DATA_SYNC mbar(1) /**< Data Synchronization Barrier */
|
||||
# else
|
||||
# define SYNCHRONIZE_IO dmb()
|
||||
# define INST_SYNC isb()
|
||||
# define DATA_SYNC dsb()
|
||||
# define SYNCHRONIZE_IO dmb() /**< Data Memory Barrier */
|
||||
# define INST_SYNC isb() /**< Instruction Synchronization Barrier */
|
||||
# define DATA_SYNC dsb() /**< Data Synchronization Barrier */
|
||||
# endif
|
||||
#else
|
||||
# define SYNCHRONIZE_IO
|
||||
# define INST_SYNC
|
||||
# define DATA_SYNC
|
||||
# define INST_SYNC
|
||||
# define DATA_SYNC
|
||||
# define SYNCHRONIZE_IO /**< Data Memory Barrier */
|
||||
# define INST_SYNC /**< Instruction Synchronization Barrier */
|
||||
# define DATA_SYNC /**< Data Synchronization Barrier */
|
||||
# define INST_SYNC /**< Instruction Synchronization Barrier */
|
||||
# define DATA_SYNC /**< Data Synchronization Barrier */
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__) || defined (__ICCARM__) || defined (__MICROBLAZE__)
|
||||
#define INLINE inline
|
||||
#define INLINE inline /**< static inline keyword */
|
||||
#else
|
||||
#define INLINE __inline
|
||||
#define INLINE __inline /**<static inline keyword */
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -91,7 +92,7 @@ extern u32 XStl_RegUpdate(u32 RegAddr, u32 RegVal);
|
||||
* from the specified address and returning the 8 bit Value read from
|
||||
* that address.
|
||||
*
|
||||
* @param Addr: contains the address to perform the input operation
|
||||
* @param Addr contains the address to perform the input operation
|
||||
*
|
||||
* @return The 8 bit Value read from the specified input address.
|
||||
|
||||
@ -109,7 +110,7 @@ static INLINE u8 Xil_In8(UINTPTR Addr)
|
||||
* the specified address and returning the 16 bit Value read from that
|
||||
* address.
|
||||
*
|
||||
* @param Addr: contains the address to perform the input operation
|
||||
* @param Addr contains the address to perform the input operation
|
||||
*
|
||||
* @return The 16 bit Value read from the specified input address.
|
||||
*
|
||||
@ -126,7 +127,7 @@ static INLINE u16 Xil_In16(UINTPTR Addr)
|
||||
* 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
|
||||
* @param Addr contains the address to perform the input operation
|
||||
*
|
||||
* @return The 32 bit Value read from the specified input address.
|
||||
*
|
||||
@ -143,7 +144,7 @@ static INLINE u32 Xil_In32(UINTPTR Addr)
|
||||
* 64 bit Value read from that address.
|
||||
*
|
||||
*
|
||||
* @param Addr: contains the address to perform the input operation
|
||||
* @param Addr contains the address to perform the input operation
|
||||
*
|
||||
* @return The 64 bit Value read from the specified input address.
|
||||
*
|
||||
@ -159,8 +160,8 @@ static INLINE u64 Xil_In64(UINTPTR 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
|
||||
* @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.
|
||||
@ -275,7 +276,7 @@ static INLINE int Xil_SecureOut32(UINTPTR Addr, u32 Value)
|
||||
*
|
||||
* @brief Perform a 16-bit endian conversion.
|
||||
*
|
||||
* @param Data: 16 bit value to be converted
|
||||
* @param Data 16 bit value to be converted
|
||||
*
|
||||
* @return 16 bit Data with converted endianness
|
||||
*
|
||||
@ -317,42 +318,47 @@ static INLINE __attribute__((always_inline)) u32 Xil_EndianSwap32(u32 Data)
|
||||
|
||||
#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
|
||||
# define Xil_In16LE Xil_In16 /**< Register Read of 16 Bits in Little Endian */
|
||||
# define Xil_In32LE Xil_In32 /**< Register Read of 32 Bits in Little Endian */
|
||||
# define Xil_Out16LE Xil_Out16 /**< Register Write of 16 Bits in Little Endian */
|
||||
# define Xil_Out32LE Xil_Out32 /**< Register Write of 32 Bits in Little Endian */
|
||||
# define Xil_Htons Xil_EndianSwap16 /**< Endian swap of 16 bits */
|
||||
# define Xil_Htonl Xil_EndianSwap32 /**< Endian swap of 32 bits */
|
||||
# define Xil_Ntohs Xil_EndianSwap16 /**< Endian swap of 16 bits */
|
||||
# define Xil_Ntohl Xil_EndianSwap32 /**< Endian swap of 32 bits */
|
||||
# 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)
|
||||
# define Xil_In16BE Xil_In16 /**< Register Read of 16 Bits in Big Endian */
|
||||
# define Xil_In32BE Xil_In32 /**< Register Read of 32 Bits in Big Endian */
|
||||
# define Xil_Out16BE Xil_Out16 /**< Register Write of 16 Bits in Big Endian */
|
||||
# define Xil_Out32BE Xil_Out32 /**< Register Write of 32 Bits in Big Endian */
|
||||
# define Xil_Htons(Data) (Data) /**< Endian swap of 16 bits */
|
||||
# define Xil_Htonl(Data) (Data) /**< Endian swap of 32 bits */
|
||||
# define Xil_Ntohs(Data) (Data) /**< Endian swap of 16 bits */
|
||||
# define Xil_Ntohl(Data) (Data) /**< Endian swap of 32 bits */
|
||||
#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
|
||||
# define Xil_In16LE Xil_In16 /**< Register Read of 16 Bits in Little Endian */
|
||||
# define Xil_In32LE Xil_In32 /**< Register Read of 32 Bits in Little Endian */
|
||||
# define Xil_Out16LE Xil_Out16 /**< Register Write of 16 Bits in Little Endian */
|
||||
# define Xil_Out32LE Xil_Out32 /**< Register Write of 32 Bits in Little Endian */
|
||||
# define Xil_Htons Xil_EndianSwap16 /**< Endian swap of 16 bits */
|
||||
# define Xil_Htonl Xil_EndianSwap32 /**< Endian swap of 32 bits */
|
||||
# define Xil_Ntohs Xil_EndianSwap16 /**< Endian swap of 16 bits */
|
||||
# define Xil_Ntohl Xil_EndianSwap32 /**< Endian swap of 32 bits */
|
||||
#endif
|
||||
|
||||
#if defined (__MICROBLAZE__)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
static INLINE u16 Xil_In16BE(UINTPTR Addr)
|
||||
static INLINE u16 Xil_In16BE(UINTPTR Addr) /**< Static inline function to Read
|
||||
Register of 16 Bits in Big Endian */
|
||||
#else
|
||||
static INLINE u16 Xil_In16LE(UINTPTR Addr)
|
||||
static INLINE u16 Xil_In16LE(UINTPTR Addr) /**< Static inline function to Read
|
||||
Register of 16 Bits in Little Endian */
|
||||
#endif
|
||||
#else
|
||||
/**
|
||||
* Static inline function to Read Register of 16 Bits in Big Endian.
|
||||
**********************************************************************************/
|
||||
static INLINE u16 Xil_In16BE(UINTPTR Addr)
|
||||
#endif
|
||||
{
|
||||
@ -362,11 +368,16 @@ static INLINE u16 Xil_In16BE(UINTPTR Addr)
|
||||
|
||||
#if defined (__MICROBLAZE__)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
static INLINE u32 Xil_In32BE(UINTPTR Addr)
|
||||
static INLINE u32 Xil_In32BE(UINTPTR Addr) /**< Static inline function to Read
|
||||
Register of 32 Bits in Big Endian */
|
||||
#else
|
||||
static INLINE u32 Xil_In32LE(UINTPTR Addr)
|
||||
static INLINE u32 Xil_In32LE(UINTPTR Addr) /**< Static inline function to Read
|
||||
Register of 32 Bits in Little Endian */
|
||||
#endif
|
||||
#else
|
||||
/**
|
||||
* Static inline function to Read Register of 32 Bits in Big Endian.
|
||||
**********************************************************************************/
|
||||
static INLINE u32 Xil_In32BE(UINTPTR Addr)
|
||||
#endif
|
||||
{
|
||||
@ -376,11 +387,16 @@ static INLINE u32 Xil_In32BE(UINTPTR Addr)
|
||||
|
||||
#if defined (__MICROBLAZE__)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value)
|
||||
static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value) /**< Static inline function to write
|
||||
Register of 16 Bits in Big Endian */
|
||||
#else
|
||||
static INLINE void Xil_Out16LE(UINTPTR Addr, u16 Value)
|
||||
static INLINE void Xil_Out16LE(UINTPTR Addr, u16 Value) /**< Static inline function to write
|
||||
Register of 16 Bits in Little Endian */
|
||||
#endif
|
||||
#else
|
||||
/**
|
||||
* Static inline function to write Register of 16 Bits in Big Endian.
|
||||
**********************************************************************************/
|
||||
static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value)
|
||||
#endif
|
||||
{
|
||||
@ -390,11 +406,16 @@ static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value)
|
||||
|
||||
#if defined (__MICROBLAZE__)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value)
|
||||
static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value) /**< Static inline function to write
|
||||
Register of 32 Bits in Big Endian */
|
||||
#else
|
||||
static INLINE void Xil_Out32LE(UINTPTR Addr, u32 Value)
|
||||
static INLINE void Xil_Out32LE(UINTPTR Addr, u32 Value) /**< Static inline function to write
|
||||
Register of 32 Bits in Little Endian */
|
||||
#endif
|
||||
#else
|
||||
/**
|
||||
* Static inline function to Read Register of 16 Bits in Big Endian.
|
||||
**********************************************************************************/
|
||||
static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value)
|
||||
#endif
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copyright (c) 2015 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2015 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
@ -23,12 +23,12 @@
|
||||
* ----- -------- -------- -----------------------------------------------
|
||||
* 6.1 nsk 11/07/16 First release.
|
||||
* 7.0 mus 01/07/19 Add cpp extern macro
|
||||
*
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef XIL_MEM_H /* prevent circular inclusions */
|
||||
#define XIL_MEM_H /* by using protection macros */
|
||||
#ifndef XIL_MEM_H /**< prevent circular inclusions */
|
||||
#define XIL_MEM_H /**< by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2013 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2013 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -15,12 +16,13 @@
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 1.00b kpc 03/07/13 First release.
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XIL_MISC_RESET_H /* prevent circular inclusions */
|
||||
#define XIL_MISC_RESET_H /* by using protection macros */
|
||||
#ifndef XIL_MISC_RESET_H /**< prevent circular inclusions */
|
||||
#define XIL_MISC_RESET_H /**< by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 1995 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 1995 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*******************************************************************************/
|
||||
/*---------------------------------------------------*/
|
||||
@ -12,24 +13,38 @@
|
||||
#include "xil_printf.h"
|
||||
#include "xil_types.h"
|
||||
#include "xil_assert.h"
|
||||
#include "bspconfig.h"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
static void padding( const s32 l_flag, const struct params_s *par);
|
||||
static void outs(const charptr lp, struct params_s *par);
|
||||
static s32 getnum( charptr *linep);
|
||||
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
typedef struct params_s {
|
||||
s32 len;
|
||||
s32 num1;
|
||||
s32 num2;
|
||||
char8 pad_character;
|
||||
s32 do_padding;
|
||||
s32 left_flag;
|
||||
s32 unsigned_flag;
|
||||
s32 len; /**< length */
|
||||
s32 num1; /**< number 1 */
|
||||
s32 num2; /**< number 2 */
|
||||
char8 pad_character; /**< pad character */
|
||||
s32 do_padding; /**< do padding */
|
||||
s32 left_flag; /**< left flag */
|
||||
s32 unsigned_flag; /**< unsigned flag */
|
||||
} params_t;
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
#if (defined(__MICROBLAZE__)) && (!defined(__arch64__))
|
||||
#define MICROBLAZE32
|
||||
#endif
|
||||
|
||||
#if (!defined(MICROBLAZE32)) && (!defined(ZYNQMP_R5_FSBL_BSP)) && (!defined(DISABLE_64BIT_PRINT))
|
||||
#define SUPPORT_64BIT_PRINT
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* The purpose of this routine is to output data the */
|
||||
@ -40,11 +55,12 @@ typedef struct params_s {
|
||||
/*---------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* */
|
||||
/* This routine puts pad characters into the output */
|
||||
/* buffer. */
|
||||
/* */
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This routine puts pad characters into the output buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void padding( const s32 l_flag, const struct params_s *par)
|
||||
{
|
||||
s32 i;
|
||||
@ -52,18 +68,19 @@ static void padding( const s32 l_flag, const struct params_s *par)
|
||||
if ((par->do_padding != 0) && (l_flag != 0) && (par->len < par->num1)) {
|
||||
i = (par->len);
|
||||
for (; i < (par->num1); i++) {
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( par->pad_character);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* */
|
||||
/* This routine moves a string to the output buffer */
|
||||
/* as directed by the padding and positioning flags. */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This routine moves a string to the output buffer
|
||||
* as directed by the padding and positioning flags.
|
||||
*
|
||||
*******************************************************************************/
|
||||
static void outs(const charptr lp, struct params_s *par)
|
||||
{
|
||||
charptr LocalPtr;
|
||||
@ -75,7 +92,7 @@ static void outs(const charptr lp, struct params_s *par)
|
||||
/* Move string to the buffer */
|
||||
while (((*LocalPtr) != (char8)0) && ((par->num2) != 0)) {
|
||||
(par->num2)--;
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte(*LocalPtr);
|
||||
#endif
|
||||
LocalPtr += 1;
|
||||
@ -87,12 +104,13 @@ static void outs(const charptr lp, struct params_s *par)
|
||||
padding( par->left_flag, par);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* */
|
||||
/* This routine moves a number to the output buffer */
|
||||
/* as directed by the padding and positioning flags. */
|
||||
/* */
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This routine moves a number to the output buffer
|
||||
* as directed by the padding and positioning flags.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void outnum( const s32 n, const s32 base, struct params_s *par)
|
||||
{
|
||||
s32 negative;
|
||||
@ -108,8 +126,7 @@ static void outnum( const s32 n, const s32 base, struct params_s *par)
|
||||
if ((par->unsigned_flag == 0) && (base == 10) && (n < 0L)) {
|
||||
negative = 1;
|
||||
num = (-(n));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
num = n;
|
||||
negative = 0;
|
||||
}
|
||||
@ -135,7 +152,7 @@ static void outnum( const s32 n, const s32 base, struct params_s *par)
|
||||
par->len = (s32)strlen(outbuf);
|
||||
padding( !(par->left_flag), par);
|
||||
while (&outbuf[i] >= outbuf) {
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( outbuf[i] );
|
||||
#endif
|
||||
i--;
|
||||
@ -148,7 +165,7 @@ static void outnum( const s32 n, const s32 base, struct params_s *par)
|
||||
/* buffer as directed by the padding and positioning */
|
||||
/* flags. */
|
||||
/* */
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
static void outnum1( const s64 n, const s32 base, params_t *par)
|
||||
{
|
||||
s32 negative;
|
||||
@ -164,8 +181,7 @@ static void outnum1( const s64 n, const s32 base, params_t *par)
|
||||
if ((par->unsigned_flag == 0) && (base == 10) && (n < 0L)) {
|
||||
negative = 1;
|
||||
num = (-(n));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
num = (n);
|
||||
negative = 0;
|
||||
}
|
||||
@ -197,11 +213,13 @@ static void outnum1( const s64 n, const s32 base, params_t *par)
|
||||
padding( par->left_flag, par);
|
||||
}
|
||||
#endif
|
||||
/*---------------------------------------------------*/
|
||||
/* */
|
||||
/* This routine gets a number from the format */
|
||||
/* string. */
|
||||
/* */
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This routine gets a number from the format string.
|
||||
*
|
||||
******************************************************************************/
|
||||
static s32 getnum(charptr *linep)
|
||||
{
|
||||
s32 n = 0;
|
||||
@ -221,23 +239,24 @@ static s32 getnum(charptr* linep)
|
||||
return (n);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* */
|
||||
/* This routine operates just like a printf/sprintf */
|
||||
/* routine. It outputs a set of data under the */
|
||||
/* control of a formatting string. Not all of the */
|
||||
/* standard C format control are supported. The ones */
|
||||
/* provided are primarily those needed for embedded */
|
||||
/* systems work. Primarily the floating point */
|
||||
/* routines are omitted. Other formats could be */
|
||||
/* added easily by following the examples shown for */
|
||||
/* the supported formats. */
|
||||
/* */
|
||||
|
||||
/* void esp_printf( const func_ptr f_ptr,
|
||||
const charptr ctrl1, ...) */
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This routine operates just like a printf/sprintf
|
||||
* routine. It outputs a set of data under the
|
||||
* control of a formatting string. Not all of the
|
||||
* standard C format control are supported. The ones
|
||||
* provided are primarily those needed for embedded
|
||||
* systems work. Primarily the floating point
|
||||
* routines are omitted. Other formats could be
|
||||
* added easily by following the examples shown for
|
||||
* the supported formats.
|
||||
* void esp_printf( const func_ptr f_ptr,
|
||||
* const charptr ctrl1, ...)
|
||||
*
|
||||
*******************************************************************************/
|
||||
#if defined (__aarch64__) && HYP_GUEST && EL1_NONSECURE && XEN_USE_PV_CONSOLE
|
||||
void xil_printf( const char8 *ctrl1, ...){
|
||||
void xil_printf( const char8 *ctrl1, ...)
|
||||
{
|
||||
XPVXenConsole_Printf(ctrl1);
|
||||
}
|
||||
#else
|
||||
@ -253,26 +272,30 @@ void xil_printf( const char8 *ctrl1, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This routine is equivalent to vprintf routine */
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This routine is equivalent to vprintf routine
|
||||
******************************************************************************/
|
||||
void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
{
|
||||
s32 Check;
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
s32 long_flag;
|
||||
#endif
|
||||
s32 dot_flag;
|
||||
|
||||
u32 width, index;
|
||||
params_t par;
|
||||
|
||||
u8 ch;
|
||||
char8 *ctrl = (char8 *)ctrl1;
|
||||
const char *string;
|
||||
|
||||
while ((ctrl != NULL) && (*ctrl != (char8)0)) {
|
||||
|
||||
/* move format string chars to buffer until a */
|
||||
/* format control is found. */
|
||||
if (*ctrl != '%') {
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte(*ctrl);
|
||||
#endif
|
||||
ctrl += 1;
|
||||
@ -281,7 +304,7 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
|
||||
/* initialize all the flags for this format. */
|
||||
dot_flag = 0;
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
long_flag = 0;
|
||||
#endif
|
||||
par.unsigned_flag = 0;
|
||||
@ -305,8 +328,7 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
if (isdigit(ch) != 0) {
|
||||
if (dot_flag != 0) {
|
||||
par.num2 = getnum(&ctrl);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (ch == (u8)'0') {
|
||||
par.pad_character = '0';
|
||||
}
|
||||
@ -323,7 +345,7 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
|
||||
switch (tolower(ch)) {
|
||||
case '%':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( '%');
|
||||
#endif
|
||||
Check = 1;
|
||||
@ -335,12 +357,21 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
break;
|
||||
|
||||
case '.':
|
||||
if ((*(ctrl + 1) == '*') && (*(ctrl + 2) == 's')) {
|
||||
width = va_arg(argp, u32);
|
||||
string = va_arg(argp, const char *);
|
||||
for (index = 0; index < width && string[index] != '\0' ; index++) {
|
||||
outbyte(string[index]);
|
||||
}
|
||||
ctrl += 2;
|
||||
} else {
|
||||
dot_flag = 1;
|
||||
Check = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
long_flag = 1;
|
||||
#endif
|
||||
Check = 0;
|
||||
@ -351,11 +382,10 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
/* fall through */
|
||||
case 'i':
|
||||
case 'd':
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
if (long_flag != 0) {
|
||||
outnum1((s64)va_arg(argp, s64), 10L, &par);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
outnum( va_arg(argp, s32), 10L, &par);
|
||||
}
|
||||
#else
|
||||
@ -373,11 +403,10 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
case 'X':
|
||||
case 'x':
|
||||
par.unsigned_flag = 1;
|
||||
#if defined (__aarch64__) || defined (__arch64__)
|
||||
#if defined (SUPPORT_64BIT_PRINT)
|
||||
if (long_flag != 0) {
|
||||
outnum1((s64)va_arg(argp, s64), 16L, &par);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
outnum((s32)va_arg(argp, s32), 16L, &par);
|
||||
}
|
||||
#else
|
||||
@ -392,7 +421,7 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( (char8)va_arg( argp, s32));
|
||||
#endif
|
||||
Check = 1;
|
||||
@ -401,28 +430,28 @@ void xil_vprintf(const char8 *ctrl1, va_list argp)
|
||||
case '\\':
|
||||
switch (*ctrl) {
|
||||
case 'a':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( ((char8)0x07));
|
||||
#endif
|
||||
break;
|
||||
case 'h':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( ((char8)0x08));
|
||||
#endif
|
||||
break;
|
||||
case 'r':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( ((char8)0x0D));
|
||||
#endif
|
||||
break;
|
||||
case 'n':
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( ((char8)0x0D));
|
||||
outbyte( ((char8)0x0A));
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM)
|
||||
#if defined(STDOUT_BASEADDRESS) || defined(VERSAL_PLM) || defined(SDT)
|
||||
outbyte( *ctrl);
|
||||
#endif
|
||||
break;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 1995 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 1995 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*******************************************************************************/
|
||||
#ifndef XIL_PRINTF_H
|
||||
@ -13,8 +14,10 @@ extern "C" {
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include "xil_types.h"
|
||||
#include "xparameters.h"
|
||||
#include "bspconfig.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
#if defined (__aarch64__) && HYP_GUEST && EL1_NONSECURE && XEN_USE_PV_CONSOLE
|
||||
#include "xen_console.h"
|
||||
#endif
|
||||
@ -38,13 +41,14 @@ struct params_s;
|
||||
typedef char8* charptr;
|
||||
typedef s32 (*func_ptr)(int c);
|
||||
|
||||
/* */
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
/**< prints the statement */
|
||||
void xil_printf( const char8 *ctrl1, ...);
|
||||
/**< This routine is equivalent to vprintf routine */
|
||||
void xil_vprintf(const char8 *ctrl1, va_list argp);
|
||||
void print( const char8 *ptr);
|
||||
extern void outbyte (uint8_t c);
|
||||
extern char inbyte(void);
|
||||
extern void outbyte (char c); /**< To send byte */
|
||||
extern char inbyte(void); /**< To receive byte */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2017 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -21,6 +22,7 @@
|
||||
* violation.
|
||||
* 8.0 sk 03/02/22 Update usleep argument type to fix misra_c_2012_
|
||||
* directive_4_6 violation.
|
||||
* 9.1 mus 10/24/23 Add support for RISC-V.
|
||||
* </pre>
|
||||
******************************************************************************/
|
||||
|
||||
@ -52,6 +54,8 @@
|
||||
sleep_A53(seconds);
|
||||
#elif defined (__MICROBLAZE__)
|
||||
sleep_MB(seconds);
|
||||
#elif defined (__riscv)
|
||||
sleep_riscv(seconds);
|
||||
#else
|
||||
sleep_A9(seconds);
|
||||
#endif
|
||||
@ -78,6 +82,8 @@
|
||||
usleep_A53(useconds);
|
||||
#elif defined (__MICROBLAZE__)
|
||||
usleep_MB(useconds);
|
||||
#elif defined (__riscv)
|
||||
usleep_riscv(useconds);
|
||||
#else
|
||||
usleep_A9(useconds);
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2017 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2017 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -24,7 +25,7 @@
|
||||
* misra_c_2012_rule_12_1 violation.
|
||||
* 7.7 sk 01/10/22 Add void to XTime_StartTTCTimer function declaration
|
||||
* to fix misra_c_2012_rule_8_2 violation.
|
||||
*
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* </pre>
|
||||
*****************************************************************************/
|
||||
|
||||
@ -103,8 +104,12 @@ extern "C" {
|
||||
*/
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
/**< This is a helper function used by sleep/usleep APIs to
|
||||
* have delay in sec/usec */
|
||||
void Xil_SleepTTCCommon(u32 delay, u64 frequency);
|
||||
void XTime_StartTTCTimer(void);
|
||||
|
||||
void XTime_StartTTCTimer(void); /**< This API starts the Triple
|
||||
* Timer Counter */
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2021 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2021 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -23,12 +24,13 @@
|
||||
* if condition to fix misrac violations.
|
||||
* 7.7 sk 01/10/22 Update XIL_SPINLOCK_ENABLED from signed to unsigned to
|
||||
* fix misra_c_2012_rule_10_4 violation.
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XIL_SPINLOCK_H /* prevent circular inclusions */
|
||||
#define XIL_SPINLOCK_H /* by using protection macros */
|
||||
#ifndef XIL_SPINLOCK_H /**< prevent circular inclusions */
|
||||
#define XIL_SPINLOCK_H /**< by using protection macros */
|
||||
|
||||
/***************************** Include Files ********************************/
|
||||
#include "xil_types.h"
|
||||
@ -61,7 +63,8 @@ u32 Xil_IsSpinLockEnabled(void);
|
||||
if(Xil_IsSpinLockEnabled()!=(u32)0) { \
|
||||
Xil_SpinLock(); }
|
||||
#else
|
||||
#define XIL_SPINLOCK()
|
||||
#define XIL_SPINLOCK() /**< protect multiple applications running at separate
|
||||
* CPUs to write to the same register */
|
||||
#endif /* !(__aarch64__) && (__GNUC__) && !(__clang__)*/
|
||||
|
||||
#if !defined (__aarch64__) && defined(__GNUC__) && !defined(__clang__)
|
||||
@ -69,7 +72,7 @@ u32 Xil_IsSpinLockEnabled(void);
|
||||
if(Xil_IsSpinLockEnabled()!=(u32)0) { \
|
||||
Xil_SpinUnlock(); }
|
||||
#else
|
||||
#define XIL_SPINUNLOCK()
|
||||
#define XIL_SPINUNLOCK() /**< Release the lock previously taken */
|
||||
#endif /* !(__aarch64__) && (__GNUC__) && !(__clang__)*/
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -16,6 +17,7 @@
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -----------------------------------------------
|
||||
* 1.00a hbm 08/25/09 First release
|
||||
* 9.00 ml 04/26/23 Updated code to fix sizeof_mismatch coverity warnings.
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -90,9 +92,9 @@ s32 Xil_TestIO8(u8 *Addr, s32 Length, u8 Value)
|
||||
s32 Status = 0;
|
||||
|
||||
for (Index = 0; Index < Length; Index++) {
|
||||
Xil_Out8((INTPTR)Addr, Value);
|
||||
Xil_Out8((UINTPTR)Addr, Value);
|
||||
|
||||
ValueIn = Xil_In8((INTPTR)Addr);
|
||||
ValueIn = Xil_In8((UINTPTR)Addr);
|
||||
|
||||
if ((Value != ValueIn) && (Status == 0)) {
|
||||
Status = -1;
|
||||
@ -134,23 +136,24 @@ s32 Xil_TestIO16(u16 *Addr, s32 Length, u16 Value, s32 Kind, s32 Swap)
|
||||
u16 *TempAddr16;
|
||||
u16 ValueIn = 0U;
|
||||
s32 Index;
|
||||
u32 Size_16;
|
||||
TempAddr16 = Addr;
|
||||
Xil_AssertNonvoid(TempAddr16 != NULL);
|
||||
|
||||
for (Index = 0; Index < Length; Index++) {
|
||||
switch (Kind) {
|
||||
case XIL_TESTIO_LE:
|
||||
Xil_Out16LE((INTPTR)TempAddr16, Value);
|
||||
Xil_Out16LE((UINTPTR)TempAddr16, Value);
|
||||
break;
|
||||
case XIL_TESTIO_BE:
|
||||
Xil_Out16BE((INTPTR)TempAddr16, Value);
|
||||
Xil_Out16BE((UINTPTR)TempAddr16, Value);
|
||||
break;
|
||||
default:
|
||||
Xil_Out16((INTPTR)TempAddr16, Value);
|
||||
Xil_Out16((UINTPTR)TempAddr16, Value);
|
||||
break;
|
||||
}
|
||||
|
||||
ValueIn = Xil_In16((INTPTR)TempAddr16);
|
||||
ValueIn = Xil_In16((UINTPTR)TempAddr16);
|
||||
|
||||
if ((Kind != 0) && (Swap != 0)) {
|
||||
ValueIn = Swap16(ValueIn);
|
||||
@ -161,17 +164,17 @@ s32 Xil_TestIO16(u16 *Addr, s32 Length, u16 Value, s32 Kind, s32 Swap)
|
||||
}
|
||||
|
||||
/* second round */
|
||||
Xil_Out16((INTPTR)TempAddr16, Value);
|
||||
Xil_Out16((UINTPTR)TempAddr16, Value);
|
||||
|
||||
switch (Kind) {
|
||||
case XIL_TESTIO_LE:
|
||||
ValueIn = Xil_In16LE((INTPTR)TempAddr16);
|
||||
ValueIn = Xil_In16LE((UINTPTR)TempAddr16);
|
||||
break;
|
||||
case XIL_TESTIO_BE:
|
||||
ValueIn = Xil_In16BE((INTPTR)TempAddr16);
|
||||
ValueIn = Xil_In16BE((UINTPTR)TempAddr16);
|
||||
break;
|
||||
default:
|
||||
ValueIn = Xil_In16((INTPTR)TempAddr16);
|
||||
ValueIn = Xil_In16((UINTPTR)TempAddr16);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -183,7 +186,8 @@ s32 Xil_TestIO16(u16 *Addr, s32 Length, u16 Value, s32 Kind, s32 Swap)
|
||||
if (Value != ValueIn) {
|
||||
return -1;
|
||||
}
|
||||
TempAddr16 += sizeof(u16);
|
||||
Size_16 = sizeof(u16);
|
||||
TempAddr16 += Size_16;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -218,23 +222,24 @@ s32 Xil_TestIO32(u32 *Addr, s32 Length, u32 Value, s32 Kind, s32 Swap)
|
||||
u32 *TempAddr;
|
||||
u32 ValueIn = 0U;
|
||||
s32 Index;
|
||||
u32 Size_32;
|
||||
TempAddr = Addr;
|
||||
Xil_AssertNonvoid(TempAddr != NULL);
|
||||
|
||||
for (Index = 0; Index < Length; Index++) {
|
||||
switch (Kind) {
|
||||
case XIL_TESTIO_LE:
|
||||
Xil_Out32LE((INTPTR)TempAddr, Value);
|
||||
Xil_Out32LE((UINTPTR)TempAddr, Value);
|
||||
break;
|
||||
case XIL_TESTIO_BE:
|
||||
Xil_Out32BE((INTPTR)TempAddr, Value);
|
||||
Xil_Out32BE((UINTPTR)TempAddr, Value);
|
||||
break;
|
||||
default:
|
||||
Xil_Out32((INTPTR)TempAddr, Value);
|
||||
Xil_Out32((UINTPTR)TempAddr, Value);
|
||||
break;
|
||||
}
|
||||
|
||||
ValueIn = Xil_In32((INTPTR)TempAddr);
|
||||
ValueIn = Xil_In32((UINTPTR)TempAddr);
|
||||
|
||||
if ((Kind != 0) && (Swap != 0)) {
|
||||
ValueIn = Swap32(ValueIn);
|
||||
@ -245,18 +250,18 @@ s32 Xil_TestIO32(u32 *Addr, s32 Length, u32 Value, s32 Kind, s32 Swap)
|
||||
}
|
||||
|
||||
/* second round */
|
||||
Xil_Out32((INTPTR)TempAddr, Value);
|
||||
Xil_Out32((UINTPTR)TempAddr, Value);
|
||||
|
||||
|
||||
switch (Kind) {
|
||||
case XIL_TESTIO_LE:
|
||||
ValueIn = Xil_In32LE((INTPTR)TempAddr);
|
||||
ValueIn = Xil_In32LE((UINTPTR)TempAddr);
|
||||
break;
|
||||
case XIL_TESTIO_BE:
|
||||
ValueIn = Xil_In32BE((INTPTR)TempAddr);
|
||||
ValueIn = Xil_In32BE((UINTPTR)TempAddr);
|
||||
break;
|
||||
default:
|
||||
ValueIn = Xil_In32((INTPTR)TempAddr);
|
||||
ValueIn = Xil_In32((UINTPTR)TempAddr);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -267,7 +272,8 @@ s32 Xil_TestIO32(u32 *Addr, s32 Length, u32 Value, s32 Kind, s32 Swap)
|
||||
if (Value != ValueIn) {
|
||||
return -1;
|
||||
}
|
||||
TempAddr += sizeof(u32);
|
||||
Size_32 = sizeof(u32);
|
||||
TempAddr += Size_32;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -34,6 +35,10 @@
|
||||
* 21_2 violation.
|
||||
* 7.7 sk 01/10/22 Remove arithematic operations on pointer varaible to fix
|
||||
* misra_c_2012_rule_18_4 violation.
|
||||
* 9.0 ml 08/30/23 Update Memory tests API in BSP, to not to stress test by
|
||||
default.
|
||||
* 9.1 ml 02/02/23 Fix compilation warnings report with
|
||||
* XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -46,7 +51,9 @@
|
||||
/************************** Constant Definitions ****************************/
|
||||
/************************** Function Prototypes *****************************/
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
static u32 RotateLeft(u32 Input, u8 Width);
|
||||
#endif
|
||||
|
||||
/* define ROTATE_RIGHT to give access to this functionality */
|
||||
#ifdef ROTATE_RIGHT
|
||||
@ -86,11 +93,15 @@ static u32 RotateRight(u32 Input, u8 Width);
|
||||
s32 Xil_TestMem8(u32 Addrlow, u32 Addrhigh, u32 Words, u8 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 I;
|
||||
u32 j;
|
||||
u8 Val;
|
||||
u8 WordMem8;
|
||||
s32 Status = 0;
|
||||
u64 Addr = (Addrlow + ((u64)Addrhigh << 32));
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= XIL_TESTMEM_MAXTEST);
|
||||
@ -136,7 +147,7 @@ s32 Xil_TestMem8(u32 Addrlow, u32 Addrhigh, u32 Words, u8 Pattern, u8 Subtest)
|
||||
Val++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial
|
||||
@ -248,8 +259,7 @@ s32 Xil_TestMem8(u32 Addrlow, u32 Addrhigh, u32 Words, u8 Pattern, u8 Subtest)
|
||||
|
||||
if (Pattern == (u8)0) {
|
||||
Val = 0xA5U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
/*
|
||||
@ -274,7 +284,7 @@ s32 Xil_TestMem8(u32 Addrlow, u32 Addrhigh, u32 Words, u8 Pattern, u8 Subtest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -311,11 +321,15 @@ End_Label:
|
||||
s32 Xil_TestMem16(u32 Addrlow, u32 Addrhigh, u32 Words, u16 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 I;
|
||||
u32 j;
|
||||
u16 Val;
|
||||
u16 WordMem16;
|
||||
s32 Status = 0;
|
||||
u64 Addr = (Addrlow + ((u64)Addrhigh << 32));
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= XIL_TESTMEM_MAXTEST);
|
||||
@ -364,7 +378,7 @@ s32 Xil_TestMem16(u32 Addrlow,u32 Addrhigh, u32 Words, u16 Pattern, u8 Subtest)
|
||||
I = I + NUM_OF_BYTES_IN_HW;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial test
|
||||
@ -483,8 +497,7 @@ s32 Xil_TestMem16(u32 Addrlow,u32 Addrhigh, u32 Words, u16 Pattern, u8 Subtest)
|
||||
*/
|
||||
if (Pattern == (u16)0) {
|
||||
Val = 0xDEADU;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
|
||||
@ -514,6 +527,7 @@ s32 Xil_TestMem16(u32 Addrlow,u32 Addrhigh, u32 Words, u16 Pattern, u8 Subtest)
|
||||
I = I + NUM_OF_BYTES_IN_HW;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -549,11 +563,15 @@ End_Label:
|
||||
s32 Xil_TestMem32(u32 Addrlow, u32 Addrhigh, u32 Words, u32 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 I;
|
||||
u32 j;
|
||||
u32 Val;
|
||||
u32 WordMem32;
|
||||
s32 Status = 0;
|
||||
u64 Addr = (Addrlow + ((u64)Addrhigh << 32));
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= (u8)XIL_TESTMEM_MAXTEST);
|
||||
@ -600,7 +618,7 @@ s32 Xil_TestMem32(u32 Addrlow, u32 Addrhigh, u32 Words, u32 Pattern, u8 Subtest)
|
||||
I = I + NUM_OF_BYTES_IN_WORD;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial
|
||||
@ -736,8 +754,7 @@ s32 Xil_TestMem32(u32 Addrlow, u32 Addrhigh, u32 Words, u32 Pattern, u8 Subtest)
|
||||
|
||||
if (Pattern == (u32)0) {
|
||||
Val = 0xDEADBEEFU;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
|
||||
@ -769,7 +786,7 @@ s32 Xil_TestMem32(u32 Addrlow, u32 Addrhigh, u32 Words, u32 Pattern, u8 Subtest)
|
||||
I = I + NUM_OF_BYTES_IN_WORD;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -805,11 +822,15 @@ End_Label:
|
||||
s32 Xil_TestMem32(u32 *Addr, u32 Words, u32 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 i;
|
||||
u32 j;
|
||||
u32 Val;
|
||||
u32 FirtVal;
|
||||
u32 WordMem32;
|
||||
s32 Status = 0;
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= (u8)XIL_TESTMEM_MAXTEST);
|
||||
@ -855,7 +876,7 @@ s32 Xil_TestMem32(u32 *Addr, u32 Words, u32 Pattern, u8 Subtest)
|
||||
Val++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial
|
||||
@ -985,8 +1006,7 @@ s32 Xil_TestMem32(u32 *Addr, u32 Words, u32 Pattern, u8 Subtest)
|
||||
|
||||
if (Pattern == (u32)0) {
|
||||
Val = 0xDEADBEEFU;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
|
||||
@ -1016,7 +1036,7 @@ s32 Xil_TestMem32(u32 *Addr, u32 Words, u32 Pattern, u8 Subtest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -1051,11 +1071,15 @@ End_Label:
|
||||
s32 Xil_TestMem16(u16 *Addr, u32 Words, u16 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 i;
|
||||
u32 j;
|
||||
u16 Val;
|
||||
u16 FirtVal;
|
||||
u16 WordMem16;
|
||||
s32 Status = 0;
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= XIL_TESTMEM_MAXTEST);
|
||||
@ -1102,7 +1126,7 @@ s32 Xil_TestMem16(u16 *Addr, u32 Words, u16 Pattern, u8 Subtest)
|
||||
Val++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial test
|
||||
@ -1217,8 +1241,7 @@ s32 Xil_TestMem16(u16 *Addr, u32 Words, u16 Pattern, u8 Subtest)
|
||||
*/
|
||||
if (Pattern == (u16)0) {
|
||||
Val = 0xDEADU;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
|
||||
@ -1246,7 +1269,7 @@ s32 Xil_TestMem16(u16 *Addr, u32 Words, u16 Pattern, u8 Subtest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -1282,11 +1305,15 @@ End_Label:
|
||||
s32 Xil_TestMem8(u8 *Addr, u32 Words, u8 Pattern, u8 Subtest)
|
||||
{
|
||||
u32 i;
|
||||
u32 j;
|
||||
u8 Val;
|
||||
u8 FirtVal;
|
||||
u8 WordMem8;
|
||||
s32 Status = 0;
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
u32 j;
|
||||
#else
|
||||
(void)Pattern;
|
||||
#endif
|
||||
|
||||
Xil_AssertNonvoid(Words != (u32)0);
|
||||
Xil_AssertNonvoid(Subtest <= XIL_TESTMEM_MAXTEST);
|
||||
@ -1333,7 +1360,7 @@ s32 Xil_TestMem8(u8 *Addr, u32 Words, u8 Pattern, u8 Subtest)
|
||||
Val++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
if ((Subtest == XIL_TESTMEM_ALLMEMTESTS) || (Subtest == XIL_TESTMEM_WALKONES)) {
|
||||
/*
|
||||
* set up to cycle through all possible initial
|
||||
@ -1445,8 +1472,7 @@ s32 Xil_TestMem8(u8 *Addr, u32 Words, u8 Pattern, u8 Subtest)
|
||||
|
||||
if (Pattern == (u8)0) {
|
||||
Val = 0xA5U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Val = Pattern;
|
||||
}
|
||||
/*
|
||||
@ -1471,7 +1497,7 @@ s32 Xil_TestMem8(u8 *Addr, u32 Words, u8 Pattern, u8 Subtest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
End_Label:
|
||||
return Status;
|
||||
}
|
||||
@ -1489,6 +1515,7 @@ End_Label:
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifdef XIL_ENABLE_MEMORY_STRESS_TEST
|
||||
static u32 RotateLeft(u32 Input, u8 Width)
|
||||
{
|
||||
u32 Msb;
|
||||
@ -1524,6 +1551,7 @@ static u32 RotateLeft(u32 Input, u8 Width)
|
||||
return ReturnVal;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ROTATE_RIGHT
|
||||
/*****************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -103,7 +104,10 @@ extern "C" {
|
||||
|
||||
/***************************** Include Files *********************************/
|
||||
#include "xil_types.h"
|
||||
#include "bspconfig.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
* is 64-bit processor
|
||||
* 8.1 dp 12/23/22 Updated UINTPTR and INTPTR to point to 64bit data types
|
||||
* incase of microblaze 32-bit with extended address enabled
|
||||
* 9.0 ml 14/04/23 Add parenthesis on sub-expression to fix misra-c violation.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -45,7 +46,10 @@ extern "C" {
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "bspconfig.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
@ -163,6 +167,10 @@ typedef void (*XInterruptHandler) (void *InstancePtr);
|
||||
*/
|
||||
typedef void (*XExceptionHandler) (void *InstancePtr);
|
||||
|
||||
#if defined (__riscv_xlen) && (__riscv_xlen == 64)
|
||||
#define __arch64__
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Returns 32-63 bits of a number.
|
||||
* @param n : Number being accessed.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copyright (c) 2019 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (C) 2019 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -85,6 +85,12 @@
|
||||
* 8.1 sa 10/20/22 Change the type of first argument passed to Xil_WaitForEvents
|
||||
* API from u32 to UINTPTR for supporting 64 bit addressing.
|
||||
* 8.1 akm 01/02/23 Added Xil_RegisterPlmHandler() & Xil_PlmStubHandler() APIs.
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* 9.0 ml 04/26/23 Updated code to fix DC.STRING BUFFER and VARARGS coverity warnings.
|
||||
* 9.0 ml 09/13/23 Replaced numerical types (int) with proper typedefs(s32) to
|
||||
* fix MISRA-C violations for Rule 4.6
|
||||
* 9.1 kpt 02/21/24 Added Xil_SChangeEndiannessAndCpy function
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -94,7 +100,7 @@
|
||||
#include "sleep.h"
|
||||
|
||||
/************************** Constant Definitions ****************************/
|
||||
#define MAX_NIBBLES 8U
|
||||
#define MAX_NIBBLES 8U /**< maximum nibbles */
|
||||
|
||||
/************************** Function Prototypes *****************************/
|
||||
void (*fptr)(void) = NULL;
|
||||
@ -119,8 +125,7 @@ static size_t strnlen (const char *StartPtr, size_t StrSize)
|
||||
EndPtr = memchr(StartPtr, '\0', StrSize);
|
||||
if (EndPtr == NULL) {
|
||||
StrLen = StrSize;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
StrLen = (size_t) (EndPtr - StartPtr);
|
||||
}
|
||||
|
||||
@ -174,16 +179,13 @@ u32 Xil_ConvertCharToNibble(u8 InChar, u8 *Num)
|
||||
if ((InChar >= (u8)'0') && (InChar <= (u8)'9')) {
|
||||
*Num = InChar - (u8)'0';
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
else if ((InChar >= (u8)'a') && (InChar <= (u8)'f')) {
|
||||
} else if ((InChar >= (u8)'a') && (InChar <= (u8)'f')) {
|
||||
*Num = InChar - (u8)'a' + 10U;
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
else if ((InChar >= (u8)'A') && (InChar <= (u8)'F')) {
|
||||
} else if ((InChar >= (u8)'A') && (InChar <= (u8)'F')) {
|
||||
*Num = InChar - (u8)'A' + 10U;
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = XST_FAILURE;
|
||||
}
|
||||
|
||||
@ -246,7 +248,8 @@ END:
|
||||
* @return None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void Xil_RegisterPlmHandler(void (*PlmAlive) (void)) {
|
||||
void Xil_RegisterPlmHandler(void (*PlmAlive) (void))
|
||||
{
|
||||
fptr = PlmAlive;
|
||||
}
|
||||
|
||||
@ -259,7 +262,8 @@ void Xil_RegisterPlmHandler(void (*PlmAlive) (void)) {
|
||||
* @return None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void Xil_PlmStubHandler(void) {
|
||||
void Xil_PlmStubHandler(void)
|
||||
{
|
||||
if (fptr != NULL) {
|
||||
fptr();
|
||||
}
|
||||
@ -343,8 +347,7 @@ u32 Xil_WaitForEvents(UINTPTR EventsRegAddr, u32 EventsMask, u32 WaitEvents,
|
||||
Xil_PlmStubHandler();
|
||||
#endif
|
||||
usleep(1U);
|
||||
}
|
||||
while(PollCount > 0U);
|
||||
} while (PollCount > 0U);
|
||||
|
||||
return Status;
|
||||
}
|
||||
@ -479,8 +482,7 @@ u32 Xil_ConvertStringToHexBE(const char *Str, u8 *Buf, u32 Len)
|
||||
Buf[ConvertedLen / 2U] =
|
||||
(UpperNibble << XIL_SIZE_OF_NIBBLE_IN_BITS) |
|
||||
LowerNibble;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = (u32)XST_INVALID_PARAM;
|
||||
goto END;
|
||||
}
|
||||
@ -544,8 +546,7 @@ u32 Xil_ConvertStringToHexLE(const char *Str, u8 *Buf, u32 Len)
|
||||
(UpperNibble << XIL_SIZE_OF_NIBBLE_IN_BITS) |
|
||||
LowerNibble;
|
||||
StrIndex = StrIndex - 1U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = XST_INVALID_PARAM;
|
||||
goto END;
|
||||
}
|
||||
@ -625,7 +626,7 @@ void Xil_UtilRMW32(u32 Addr, u32 Mask, u32 Value)
|
||||
* @return XST_SUCCESS on success and error code on failure
|
||||
*
|
||||
******************************************************************************/
|
||||
int Xil_Strcpy(char *DestPtr, const char *SrcPtr, const u32 Size)
|
||||
s32 Xil_Strcpy(char *DestPtr, const char *SrcPtr, const u32 Size)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
u32 Count;
|
||||
@ -665,7 +666,7 @@ END:
|
||||
* @note None
|
||||
*
|
||||
****************************************************************************/
|
||||
int Xil_StrCpyRange(const u8 *Src, u8 *Dest, u32 From, u32 To, u32 MaxSrcLen,
|
||||
s32 Xil_StrCpyRange(const u8 *Src, u8 *Dest, u32 From, u32 To, u32 MaxSrcLen,
|
||||
u32 MaxDstLen)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
@ -716,7 +717,7 @@ END:
|
||||
* @return XST_SUCCESS on success and error code on failure
|
||||
*
|
||||
******************************************************************************/
|
||||
int Xil_Strcat(char* Str1Ptr, const char* Str2Ptr, const u32 Size)
|
||||
s32 Xil_Strcat(char *Str1Ptr, const char *Str2Ptr, const u32 Size)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
u32 Count = 0U;
|
||||
@ -761,7 +762,7 @@ END:
|
||||
* @return XST_SUCCESS on success and error code on failure
|
||||
*
|
||||
******************************************************************************/
|
||||
int Xil_SecureMemCpy(void * DestPtr, u32 DestPtrLen, const void * SrcPtr, u32 Len)
|
||||
s32 Xil_SecureMemCpy(void *DestPtr, u32 DestPtrLen, const void *SrcPtr, u32 Len)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
u8 *Dest = (u8 *)DestPtr;
|
||||
@ -807,7 +808,7 @@ END:
|
||||
* 1 if first non-matching character is greater value in Buf1Ptr
|
||||
*
|
||||
******************************************************************************/
|
||||
int Xil_MemCmp(const void * Buf1Ptr, const void * Buf2Ptr, u32 Len)
|
||||
s32 Xil_MemCmp(const void *Buf1Ptr, const void *Buf2Ptr, u32 Len)
|
||||
{
|
||||
volatile int RetVal = 1;
|
||||
const u8 *Buf1 = Buf1Ptr;
|
||||
@ -854,7 +855,7 @@ END:
|
||||
* - XST_SUCCESS: If Zeroization is successful.
|
||||
* - XST_FAILURE: If Zeroization is not successful.
|
||||
********************************************************************************/
|
||||
int Xil_SecureZeroize(u8 *DataPtr, const u32 Length)
|
||||
s32 Xil_SecureZeroize(u8 *DataPtr, const u32 Length)
|
||||
{
|
||||
u32 Index;
|
||||
int Status = XST_FAILURE;
|
||||
@ -895,18 +896,16 @@ END:
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SMemCmp(const void *Src1, const u32 Src1Size,
|
||||
s32 Xil_SMemCmp(const void *Src1, const u32 Src1Size,
|
||||
const void *Src2, const u32 Src2Size, const u32 CmpLen)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
|
||||
if ((Src1 == NULL) || (Src2 == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((CmpLen == 0U) || (Src1Size < CmpLen) || (Src2Size < CmpLen)) {
|
||||
} else if ((CmpLen == 0U) || (Src1Size < CmpLen) || (Src2Size < CmpLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = memcmp (Src1, Src2, CmpLen);
|
||||
if (Status != 0) {
|
||||
Status = XST_FAILURE;
|
||||
@ -937,7 +936,7 @@ int Xil_SMemCmp(const void *Src1, const u32 Src1Size,
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SMemCmp_CT(const void *Src1, const u32 Src1Size,
|
||||
s32 Xil_SMemCmp_CT(const void *Src1, const u32 Src1Size,
|
||||
const void *Src2, const u32 Src2Size, const u32 CmpLen)
|
||||
{
|
||||
volatile int Status = XST_FAILURE;
|
||||
@ -951,11 +950,9 @@ int Xil_SMemCmp_CT(const void *Src1, const u32 Src1Size,
|
||||
|
||||
if ((Src1 == NULL) || (Src2 == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((CmpLen == 0U) || (Src1Size < CmpLen) || (Src2Size < CmpLen)) {
|
||||
} else if ((CmpLen == 0U) || (Src1Size < CmpLen) || (Src2Size < CmpLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
while (Cnt >= sizeof(u32)) {
|
||||
Data |= (*(const u32 *)Src_1 ^ * (const u32 *)Src_2);
|
||||
DataRedundant &= ~Data;
|
||||
@ -998,7 +995,7 @@ int Xil_SMemCmp_CT(const void *Src1, const u32 Src1Size,
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SMemCpy(void *Dest, const u32 DestSize,
|
||||
s32 Xil_SMemCpy(void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
@ -1009,18 +1006,15 @@ int Xil_SMemCpy(void *Dest, const u32 DestSize,
|
||||
|
||||
if ((Dest == NULL) || (Src == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((CopyLen == 0U) || (DestSize < CopyLen) || (SrcSize < CopyLen)) {
|
||||
} else if ((CopyLen == 0U) || (DestSize < CopyLen) || (SrcSize < CopyLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
/* Return error for overlap string */
|
||||
else if ((Src8 < Dst8) && (&Src8[CopyLen - 1U] >= Dst8)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((Dst8 < Src8) && (&Dst8[CopyLen - 1U] >= Src8)) {
|
||||
} else if ((Dst8 < Src8) && (&Dst8[CopyLen - 1U] >= Src8)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
(void)memcpy(DestTemp, SrcTemp, CopyLen);
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
@ -1045,15 +1039,14 @@ int Xil_SMemCpy(void *Dest, const u32 DestSize,
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SMemSet(void *Dest, const u32 DestSize,
|
||||
s32 Xil_SMemSet(void *Dest, const u32 DestSize,
|
||||
const u8 Data, const u32 Len)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
|
||||
if ((Dest == NULL) || (DestSize < Len) || (Len == 0U)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
(void)memset(Dest, (s32)Data, Len);
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
@ -1077,12 +1070,13 @@ int Xil_SMemSet(void *Dest, const u32 DestSize,
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SStrCat (u8 *DestStr, const u32 DestSize,
|
||||
s32 Xil_SStrCat (u8 *DestStr, const u32 DestSize,
|
||||
const u8 *SrcStr, const u32 SrcSize)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
u32 SrcLen;
|
||||
u32 DstLen;
|
||||
u32 Length;
|
||||
|
||||
if ((DestStr == NULL) || (SrcStr == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
@ -1091,15 +1085,14 @@ int Xil_SStrCat (u8 *DestStr, const u32 DestSize,
|
||||
|
||||
SrcLen = strnlen((const char *)SrcStr, SrcSize);
|
||||
DstLen = strnlen((const char *)DestStr, DestSize);
|
||||
Length = SrcLen + DstLen;
|
||||
|
||||
if ((DestSize <= DstLen) || (SrcSize <= SrcLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if (DestSize <= (SrcLen + DstLen)) {
|
||||
} else if (DestSize <= Length) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
(void)strcat((char*)DestStr, (const char*)SrcStr);
|
||||
} else {
|
||||
(void)strncat((char *)DestStr, (const char *)SrcStr, Length);
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1124,7 +1117,7 @@ END:
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SStrCmp(const u8 *Str1, const u32 Str1Size,
|
||||
s32 Xil_SStrCmp(const u8 *Str1, const u32 Str1Size,
|
||||
const u8 *Str2, const u32 Str2Size)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
@ -1141,11 +1134,9 @@ int Xil_SStrCmp(const u8 *Str1, const u32 Str1Size,
|
||||
|
||||
if ((Str1Size <= Str1Len) || (Str2Size <= Str2Len)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((Str1Len < Str2Len) || (Str1Len > Str2Len)) {
|
||||
} else if ((Str1Len < Str2Len) || (Str1Len > Str2Len)) {
|
||||
Status = XST_FAILURE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = memcmp(Str1, Str2, Str1Len);
|
||||
if (Status != 0) {
|
||||
Status = XST_FAILURE;
|
||||
@ -1177,7 +1168,7 @@ END:
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SStrCmp_CT (const u8 *Str1, const u32 Str1Size,
|
||||
s32 Xil_SStrCmp_CT (const u8 *Str1, const u32 Str1Size,
|
||||
const u8 *Str2, const u32 Str2Size)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
@ -1194,11 +1185,9 @@ int Xil_SStrCmp_CT (const u8 *Str1, const u32 Str1Size,
|
||||
|
||||
if ((Str1Size <= Str1Len) || (Str2Size <= Str2Len)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if (Str1Len != Str2Len) {
|
||||
} else if (Str1Len != Str2Len) {
|
||||
Status = XST_FAILURE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Status = Xil_SMemCmp_CT (Str1, Str1Size, Str2, Str2Size, Str1Len);
|
||||
}
|
||||
|
||||
@ -1222,7 +1211,7 @@ END:
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SStrCpy(u8 *DestStr, const u32 DestSize,
|
||||
s32 Xil_SStrCpy(u8 *DestStr, const u32 DestSize,
|
||||
const u8 *SrcStr, const u32 SrcSize)
|
||||
{
|
||||
int Status = XST_FAILURE;
|
||||
@ -1237,8 +1226,7 @@ int Xil_SStrCpy(u8 *DestStr, const u32 DestSize,
|
||||
|
||||
if ((DestSize <= SrcLen) || (SrcSize <= SrcLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
(void)memcpy(DestStr, SrcStr, SrcLen + 1U);
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
@ -1263,7 +1251,7 @@ END:
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
*
|
||||
*****************************************************************************/
|
||||
int Xil_SMemMove(void *Dest, const u32 DestSize,
|
||||
s32 Xil_SMemMove(void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen)
|
||||
{
|
||||
volatile int Status = XST_FAILURE;
|
||||
@ -1271,11 +1259,9 @@ int Xil_SMemMove(void *Dest, const u32 DestSize,
|
||||
|
||||
if ((Dest == NULL) || (Src == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else if ((CopyLen == 0U) || (DestSize < CopyLen) || (SrcSize < CopyLen)) {
|
||||
} else if ((CopyLen == 0U) || (DestSize < CopyLen) || (SrcSize < CopyLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Output = memmove(Dest, Src, CopyLen);
|
||||
if (Output != NULL) {
|
||||
Status = XST_SUCCESS;
|
||||
@ -1330,13 +1316,13 @@ u32 Xil_WaitForEventSet(u32 Timeout, u32 NumOfEvents, volatile u32 *EventAddr, .
|
||||
EventAddr = va_arg(Event, volatile u32 *);
|
||||
PollCount = Timeout;
|
||||
}
|
||||
va_end(Event);
|
||||
|
||||
END:
|
||||
if (LoopCnt == NumOfEvents) {
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
|
||||
va_end(Event);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1375,3 +1361,52 @@ s32 Xil_SecureRMW32(UINTPTR Addr, u32 Mask, u32 Value)
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief This function changes the endianness of source data and copies it
|
||||
* into destination buffer.
|
||||
*
|
||||
* @param Dest - Pointer to destination memory
|
||||
* @param DestSize - Memory available at destination
|
||||
* @param Src - Pointer to source memory
|
||||
* @param SrcSize - Maximum data that can be copied from source
|
||||
* @param CopyLen - Number of bytes to be copied
|
||||
*
|
||||
* @return
|
||||
* XST_SUCCESS - Copy is successful
|
||||
* XST_INVALID_PARAM - Invalid inputs
|
||||
* XST_FAILURE - On failure
|
||||
*
|
||||
*****************************************************************************/
|
||||
s32 Xil_SChangeEndiannessAndCpy(void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen)
|
||||
{
|
||||
s32 Status = XST_FAILURE;
|
||||
volatile u32 Index;
|
||||
const u8 *Src8 = (const u8 *) Src;
|
||||
const u8 *Dst8 = (u8 *) Dest;
|
||||
u8 *DestTemp = Dest;
|
||||
const u8 *SrcTemp = Src;
|
||||
|
||||
if ((Dest == NULL) || (Src == NULL)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
} else if ((CopyLen == 0U) || (DestSize < CopyLen) || (SrcSize < CopyLen)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
}
|
||||
/* Return error for overlap string */
|
||||
else if ((Src8 < Dst8) && (&Src8[CopyLen - 1U] >= Dst8)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
} else if ((Dst8 < Src8) && (&Dst8[CopyLen - 1U] >= Src8)) {
|
||||
Status = XST_INVALID_PARAM;
|
||||
} else {
|
||||
for (Index = 0U; Index < CopyLen; Index++) {
|
||||
DestTemp[Index] = SrcTemp[CopyLen - Index - 1U];
|
||||
}
|
||||
if (Index == CopyLen) {
|
||||
Status = XST_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copyright (c) 2019 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (C) 2019 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -61,6 +61,12 @@
|
||||
* 8.1 akm 01/02/23 Added Xil_RegisterPlmHandler() & Xil_PlmStubHandler() APIs.
|
||||
* bm 03/14/23 Added XSECURE_REDUNDANT_CALL and XSECURE_REDUNDANT_IMPL macros
|
||||
* sk 03/14/23 Added Status Check Glitch detect Macro
|
||||
* 9.0 ml 03/03/23 Add description to fix doxygen warnings.
|
||||
* mmd 07/09/23 Added macro to build version
|
||||
* ml 09/13/23 Replaced numerical types (int) with proper typedefs(s32) to
|
||||
* fix MISRA-C violations for Rule 4.6
|
||||
* 9.1 kpt 02/21/24 Added Xil_SChangeEndiannessAndCpy function
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -72,19 +78,33 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************* Include Files ********************************/
|
||||
#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
|
||||
#define XIL_SIZE_OF_NIBBLE_IN_BITS 4U /**< size of nibble in bits */
|
||||
#define XIL_SIZE_OF_BYTE_IN_BITS 8U /**< size of byte in bits */
|
||||
|
||||
#define XIL_MAX_HEX_STR_LEN 512U /**< Maximum string length handled by
|
||||
Xil_ValidateHexStr function */
|
||||
|
||||
/****************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Builds version number by concatenates 16-bit Major version and Minor version.
|
||||
*
|
||||
* @param Major is the 16-bit major version number
|
||||
* @param Minor is the 16-bit minor version number
|
||||
*
|
||||
* @return 32-bit version number
|
||||
*
|
||||
******************************************************************************/
|
||||
#define XIL_BUILD_VERSION(Major, Minor) ((((u32)Major) << 16U) | (Minor))
|
||||
|
||||
#ifdef __GNUC__
|
||||
/******************************************************************************/
|
||||
/**
|
||||
@ -204,110 +224,114 @@ extern "C" {
|
||||
|
||||
#endif
|
||||
/*************************** Function Prototypes ******************************/
|
||||
/* Ceils the provided float value */
|
||||
/**< Ceils the provided float value */
|
||||
s32 Xil_Ceil(float Value);
|
||||
|
||||
/* Converts input character to nibble */
|
||||
/**< Converts input character to nibble */
|
||||
u32 Xil_ConvertCharToNibble(u8 InChar, u8 *Num);
|
||||
|
||||
/* Convert input hex string to array of 32-bits integers */
|
||||
/**< Convert input hex string to array of 32-bits integers */
|
||||
u32 Xil_ConvertStringToHex(const char *Str, u32 *buf, u8 Len);
|
||||
|
||||
#ifdef VERSAL_PLM
|
||||
/* Register PLM handler */
|
||||
/**< Register PLM handler */
|
||||
void Xil_RegisterPlmHandler(void (*PlmAlive) (void));
|
||||
|
||||
/* Call PLM handler */
|
||||
/**< Call PLM handler */
|
||||
void Xil_PlmStubHandler(void);
|
||||
#endif
|
||||
|
||||
/* Waits for specified event */
|
||||
/**< Waits for specified event */
|
||||
u32 Xil_WaitForEvent(UINTPTR RegAddr, u32 EventMask, u32 Event, u32 Timeout);
|
||||
|
||||
/* Waits for specified events */
|
||||
/**< Waits for specified events */
|
||||
u32 Xil_WaitForEvents(UINTPTR EventsRegAddr, u32 EventsMask, u32 WaitEvents,
|
||||
u32 Timeout, u32 *Events);
|
||||
|
||||
/* Validate input hex character */
|
||||
/**< Validate input hex character */
|
||||
u32 Xil_IsValidHexChar(const char *Ch);
|
||||
|
||||
/* Validate the input string contains only hexadecimal characters */
|
||||
/**< Validate the input string contains only hexadecimal characters */
|
||||
u32 Xil_ValidateHexStr(const char *HexStr);
|
||||
|
||||
/* Convert string to hex numbers in little enidian format */
|
||||
/**< 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 */
|
||||
/**< Returns length of the input string */
|
||||
u32 Xil_Strnlen(const char *Str, u32 MaxLen);
|
||||
|
||||
/* Convert string to hex numbers in big endian format */
|
||||
/**< 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*/
|
||||
/**< 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 source string to destination string */
|
||||
s32 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 *Dest, u32 From, u32 To, u32 MaxSrcLen,
|
||||
/**< Copies specified range from source string to destination string */
|
||||
s32 Xil_StrCpyRange(const u8 *Src, u8 *Dest, u32 From, u32 To, u32 MaxSrcLen,
|
||||
u32 MaxDstLen);
|
||||
|
||||
/* Appends string2 to string1 */
|
||||
int Xil_Strcat(char* Str1Ptr, const char* Str2Ptr, const u32 Size);
|
||||
/**< Appends string2 to string1 */
|
||||
s32 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);
|
||||
/**< Copies Len bytes from source memory to destination memory */
|
||||
s32 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);
|
||||
/**< Compares Len bytes from memory1 and memory2 */
|
||||
s32 Xil_MemCmp(const void *Buf1Ptr, const void *Buf2Ptr, u32 Len);
|
||||
|
||||
/* Zeroizes the memory of given length */
|
||||
int Xil_SecureZeroize(u8 *DataPtr, const u32 Length);
|
||||
/**< Zeroizes the memory of given length */
|
||||
s32 Xil_SecureZeroize(u8 *DataPtr, const u32 Length);
|
||||
|
||||
/* Copies Len bytes from source memory to destination memory */
|
||||
int Xil_SMemCpy (void *Dest, const u32 DestSize,
|
||||
/**< Copies Len bytes from source memory to destination memory */
|
||||
s32 Xil_SMemCpy (void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen);
|
||||
|
||||
/* Copies Len bytes from source memory to destination memory, allows
|
||||
/**< Copies Len bytes from source memory to destination memory, allows
|
||||
overlapped memory between source and destination */
|
||||
int Xil_SMemMove(void *Dest, const u32 DestSize,
|
||||
s32 Xil_SMemMove(void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen);
|
||||
|
||||
/* Compares Len bytes between source and destination memory */
|
||||
int Xil_SMemCmp (const void *Src1, const u32 Src1Size,
|
||||
/**< Compares Len bytes between source and destination memory */
|
||||
s32 Xil_SMemCmp (const void *Src1, const u32 Src1Size,
|
||||
const void *Src2, const u32 Src2Size, const u32 CmpLen);
|
||||
|
||||
/* Compares Len bytes between source and destination memory with constant time */
|
||||
int Xil_SMemCmp_CT (const void *Src1, const u32 Src1Size,
|
||||
/**< Compares Len bytes between source and destination memory with constant time */
|
||||
s32 Xil_SMemCmp_CT (const void *Src1, const u32 Src1Size,
|
||||
const void *Src2, const u32 Src2Size, const u32 CmpLen);
|
||||
|
||||
/* Sets the destination memory of given length with given data */
|
||||
int Xil_SMemSet (void *Dest, const u32 DestSize,
|
||||
/**< Sets the destination memory of given length with given data */
|
||||
s32 Xil_SMemSet (void *Dest, const u32 DestSize,
|
||||
const u8 Data, const u32 Len);
|
||||
|
||||
/* Copies source string to destination string */
|
||||
int Xil_SStrCpy (u8 *DestStr, const u32 DestSize,
|
||||
/**< Copies source string to destination string */
|
||||
s32 Xil_SStrCpy (u8 *DestStr, const u32 DestSize,
|
||||
const u8 *SrcStr, const u32 SrcSize);
|
||||
|
||||
/* Compares source string with destination string */
|
||||
int Xil_SStrCmp (const u8 *Str1, const u32 Str1Size,
|
||||
/**< Compares source string with destination string */
|
||||
s32 Xil_SStrCmp (const u8 *Str1, const u32 Str1Size,
|
||||
const u8 *Str2, const u32 Str2Size);
|
||||
|
||||
/* Compares source string with destination string with constant time */
|
||||
int Xil_SStrCmp_CT (const u8 *Str1, const u32 Str1Size,
|
||||
/**< Compares source string with destination string with constant time */
|
||||
s32 Xil_SStrCmp_CT (const u8 *Str1, const u32 Str1Size,
|
||||
const u8 *Str2, const u32 Str2Size);
|
||||
|
||||
/* Concatenates source string to destination string */
|
||||
int Xil_SStrCat (u8 *DestStr, const u32 DestSize,
|
||||
/**< Concatenates source string to destination string */
|
||||
s32 Xil_SStrCat (u8 *DestStr, const u32 DestSize,
|
||||
const u8 *SrcStr, const u32 SrcSize);
|
||||
|
||||
/* Waits for event timeout */
|
||||
/**< Waits for event timeout */
|
||||
u32 Xil_WaitForEventSet(u32 Timeout, u32 NumOfEvents, volatile u32 *EventAddr, ...);
|
||||
|
||||
/* Implements Read Modify Writes securely */
|
||||
/**< Implements Read Modify Writes securely */
|
||||
s32 Xil_SecureRMW32(UINTPTR Addr, u32 Mask, u32 Value);
|
||||
|
||||
/**< Changes byte endianness of source buffer and copies it into destination */
|
||||
s32 Xil_SChangeEndiannessAndCpy(void *Dest, const u32 DestSize,
|
||||
const void *Src, const u32 SrcSize, const u32 CopyLen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
67
bsp_z7/ps7_cortexa9_0/include/xilffs.h
Normal file
67
bsp_z7/ps7_cortexa9_0/include/xilffs.h
Normal file
@ -0,0 +1,67 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @file xilffs.h
|
||||
* @addtogroup xilffs Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This file contains declarations specific to AMD's unique requirements and
|
||||
* functionalities for xilffs.
|
||||
*
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 5.2 ht 10/10/23 Added code for versioning of library.
|
||||
*
|
||||
*</pre>
|
||||
*
|
||||
*@note
|
||||
*****************************************************************************/
|
||||
#ifndef XILFFS_H
|
||||
#define XILFFS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************** Include Files *********************************/
|
||||
#include "xil_util.h"
|
||||
#include "xil_io.h"
|
||||
#include "xil_types.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
/* Library version info */
|
||||
#define XILFFS_MAJOR_VERSION 5U
|
||||
#define XILFFS_MINOR_VERSION 2U
|
||||
|
||||
/****************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @brief This function returns the version number of xilffs library.
|
||||
*
|
||||
* @return 32-bit version number
|
||||
*
|
||||
******************************************************************************/
|
||||
static __attribute__((always_inline)) INLINE
|
||||
u32 Xilffs_GetLibVersion(void)
|
||||
{
|
||||
return (XIL_BUILD_VERSION(XILFFS_MAJOR_VERSION, XILFFS_MINOR_VERSION));
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* XILFFS_H */
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2021 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
#ifndef XPARAMETERS_H /* prevent circular inclusions */
|
||||
@ -7,7 +8,6 @@
|
||||
|
||||
/* Definition for CPU ID */
|
||||
#define XPAR_CPU_ID 0U
|
||||
//#define USE_AMP 0U TODO having this to 0 breaks xil_cache
|
||||
|
||||
/* Definitions for peripheral PS7_CORTEXA9_0 */
|
||||
#define XPAR_PS7_CORTEXA9_0_CPU_CLK_FREQ_HZ 666666687
|
||||
@ -23,17 +23,8 @@
|
||||
|
||||
#include "xparameters_ps.h"
|
||||
|
||||
// Default is for Zedboard
|
||||
#ifndef ZYNQ_USE_UART0
|
||||
#define STDIN_BASEADDRESS XPS_UART1_BASEADDR
|
||||
#define STDIN_INT_NR XPAR_XUARTPS_1_INTR
|
||||
#define STDOUT_BASEADDRESS XPS_UART1_BASEADDR
|
||||
#else
|
||||
#define STDIN_BASEADDRESS XPS_UART0_BASEADDR
|
||||
#define STDIN_INT_NR XPAR_XUARTPS_0_INTR
|
||||
#define STDOUT_BASEADDRESS XPS_UART0_BASEADDR
|
||||
#endif
|
||||
|
||||
#define STDIN_BASEADDRESS 0xE0001000
|
||||
#define STDOUT_BASEADDRESS 0xE0001000
|
||||
|
||||
/******************************************************************/
|
||||
|
||||
@ -357,6 +348,7 @@
|
||||
#define XPAR_PS7_SD_0_CLK_50_DDR_OTAP_DLY 0
|
||||
#define XPAR_PS7_SD_0_CLK_100_SDR_OTAP_DLY 0
|
||||
#define XPAR_PS7_SD_0_CLK_200_SDR_OTAP_DLY 0
|
||||
#define XPAR_PS7_SD_0_CLK_200_DDR_OTAP_DLY 0
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
@ -380,6 +372,7 @@
|
||||
#define XPAR_XSDPS_0_CLK_50_DDR_OTAP_DLY 0
|
||||
#define XPAR_XSDPS_0_CLK_100_SDR_OTAP_DLY 0
|
||||
#define XPAR_XSDPS_0_CLK_200_SDR_OTAP_DLY 0
|
||||
#define XPAR_XSDPS_0_CLK_200_DDR_OTAP_DLY 0
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
@ -428,8 +421,8 @@
|
||||
|
||||
/* Definitions for peripheral PS7_UART_1 */
|
||||
#define XPAR_PS7_UART_1_DEVICE_ID 0
|
||||
#define XPAR_PS7_UART_1_BASEADDR 0xE0001000
|
||||
#define XPAR_PS7_UART_1_HIGHADDR 0xE0001FFF
|
||||
#define XPAR_PS7_UART_1_BASEADDR 0xE0000000
|
||||
#define XPAR_PS7_UART_1_HIGHADDR 0xE0000FFF
|
||||
#define XPAR_PS7_UART_1_UART_CLK_FREQ_HZ 50000000
|
||||
#define XPAR_PS7_UART_1_HAS_MODEM 0
|
||||
|
||||
@ -438,8 +431,8 @@
|
||||
|
||||
/* Canonical definitions for peripheral PS7_UART_1 */
|
||||
#define XPAR_XUARTPS_0_DEVICE_ID XPAR_PS7_UART_1_DEVICE_ID
|
||||
#define XPAR_XUARTPS_0_BASEADDR 0xE0001000
|
||||
#define XPAR_XUARTPS_0_HIGHADDR 0xE0001FFF
|
||||
#define XPAR_XUARTPS_0_BASEADDR 0xE0000000
|
||||
#define XPAR_XUARTPS_0_HIGHADDR 0xE0000FFF
|
||||
#define XPAR_XUARTPS_0_UART_CLK_FREQ_HZ 50000000
|
||||
#define XPAR_XUARTPS_0_HAS_MODEM 0
|
||||
|
||||
|
@ -43,6 +43,9 @@
|
||||
* reported with "-Wundef" flag CR#1111453
|
||||
* 8.1 mus 02/13/23 Added new API's XGetCoreId and XGetClusterId. As of now
|
||||
* they are supported only for VERSAL_NET APU and RPU.
|
||||
* 9.0 mus 03/28/23 Added new API XGetBootStatus for VERSAL_NET. It can be
|
||||
* used to identify type of boot (cold/warm).
|
||||
* 9.0 mus 07/27/23 Updated XGetCoreId API to support A9, R5 and A53 processor.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -148,6 +151,53 @@ u32 XGetPSVersion_Info(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ! defined(__microblaze__) && ! defined(__riscv)
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @brief This API is used to provide infomation about core id of the
|
||||
* CPU core from which it is executed.
|
||||
*
|
||||
* @return Core id of the core on which API is executed.
|
||||
*
|
||||
******************************************************************************/
|
||||
u8 XGetCoreId(void)
|
||||
{
|
||||
UINTPTR CoreId;
|
||||
|
||||
#if (defined (__aarch64__) && ! defined (VERSAL_NET))
|
||||
/* CortexA53 and CortexA72 */
|
||||
CoreId = (mfcp(MPIDR_EL1) & XREG_MPIDR_MASK);
|
||||
CoreId = ((CoreId & XREG_MPIDR_AFFINITY0_MASK) >> \
|
||||
XREG_MPIDR_AFFINITY0_SHIFT);
|
||||
#elif (defined (__aarch64__) && defined (VERSAL_NET))
|
||||
/* CortexA78 */
|
||||
CoreId = (mfcp(MPIDR_EL1) & XREG_MPIDR_MASK);
|
||||
CoreId = ((CoreId & XREG_MPIDR_AFFINITY0_MASK) >> \
|
||||
XREG_MPIDR_AFFINITY0_SHIFT);
|
||||
#else
|
||||
/* CortexA9, CortexR5 and CortexR52 */
|
||||
#ifdef __GNUC__
|
||||
CoreId = (mfcp(XREG_CP15_MULTI_PROC_AFFINITY) & XREG_MPIDR_MASK);
|
||||
#elif defined (__ICCARM__)
|
||||
mfcp(XREG_CP15_MULTI_PROC_AFFINITY, CoreId);
|
||||
CoreId &= XREG_MPIDR_MASK;
|
||||
#else
|
||||
{
|
||||
register u32 C15Reg __asm(XREG_CP15_MULTI_PROC_AFFINITY);
|
||||
CoreId = C15Reg;
|
||||
}
|
||||
CoreId &= XREG_MPIDR_MASK;
|
||||
#endif
|
||||
|
||||
CoreId = ((CoreId & XREG_MPIDR_AFFINITY0_MASK) >> \
|
||||
XREG_MPIDR_AFFINITY0_SHIFT);
|
||||
#endif
|
||||
|
||||
return (u8)CoreId;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined (__aarch64__) && defined (VERSAL_NET)) || defined (ARMR52)
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
@ -178,27 +228,38 @@ u8 XGetClusterId(void)
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @brief This API is used to provide infomation about core id of the
|
||||
* CPU core from which it is executed.
|
||||
* @brief This API returns boot status of core from which it is executed.
|
||||
* 0th bit of CORE_X_PWRDWN/RPU_PCIL_X_PWRDWN register indicates boot type.
|
||||
*
|
||||
* @return Core id of the core on which API is executed.
|
||||
* @return - 0 for cold boot
|
||||
* - 1 for warm boot
|
||||
*
|
||||
******************************************************************************/
|
||||
u8 XGetCoreId(void)
|
||||
u8 XGetBootStatus(void)
|
||||
{
|
||||
u64 CoreId;
|
||||
u32 Status;
|
||||
UINTPTR Addr;
|
||||
|
||||
#if defined (ARMR52)
|
||||
CoreId = (mfcp(XREG_CP15_MULTI_PROC_AFFINITY) & XREG_MPIDR_MASK);
|
||||
CoreId = ((CoreId & XREG_MPIDR_AFFINITY0_MASK) >> \
|
||||
XREG_MPIDR_AFFINITY0_SHIFT);
|
||||
#if (__aarch64__)
|
||||
u8 CpuNum;
|
||||
|
||||
CpuNum = XGetClusterId();
|
||||
CpuNum *= XPS_NUM_OF_CORES_PER_CLUSTER;
|
||||
CpuNum += XGetCoreId();
|
||||
|
||||
Addr = XPS_CORE_X_PWRDWN_BASEADDR + (CpuNum * XPS_CORE_X_PWRDWN_OFFSET);
|
||||
Status = Xil_In32(Addr);
|
||||
|
||||
return (Status & XPS_CORE_X_PWRDWN_EN_MASK);
|
||||
#else
|
||||
CoreId = (mfcp(MPIDR_EL1) & XREG_MPIDR_MASK);
|
||||
CoreId = ((CoreId & XREG_MPIDR_AFFINITY1_MASK) >> \
|
||||
XREG_MPIDR_AFFINITY1_SHIFT);
|
||||
Addr = (XPS_RPU_PCIL_CLUSTER_OFFSET * XGetClusterId()) + XPS_RPU_PCIL_A0_PWRDWN;
|
||||
Addr += (XGetCoreId() * XPS_RPU_PCIL_CORE_OFFSET);
|
||||
|
||||
Status = Xil_In32(Addr);
|
||||
|
||||
return (Status & XPS_RPU_PCIL_X_PWRDWN_EN_MASK);
|
||||
#endif
|
||||
|
||||
return (u8)CoreId;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,11 @@
|
||||
* misra_c_2012_rule_10_4 violation.
|
||||
* 8.1 mus 02/13/23 Added new API's XGetCoreId and XGetClusterId. As of now
|
||||
* they are supported only for VERSAL_NET APU and RPU.
|
||||
* 9.0 mus 03/28/23 Added new API XGetBootStatus for VERSAL_NET. It can be
|
||||
* used to identify type of boot (cold/warm).
|
||||
* 9.0 mus 07/27/23 Updated XGetCoreId API to support A9, R5 and A53 processor
|
||||
* 9.0 ml 09/14/23 Added U to numerical to fix MISRA-C violation for Rule
|
||||
* 10.1 and 10.4
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -84,11 +89,37 @@ extern "C" {
|
||||
#define XPS_VERSION_INFO_SHIFT 0x8U
|
||||
#define XPLAT_INFO_SHIFT 0x18U
|
||||
#else
|
||||
#define XPS_VERSION_INFO_MASK (0xF)
|
||||
#define XPS_VERSION_INFO_MASK 0xFU
|
||||
#define XPS_VERSION_INFO_SHIFT 0x0U
|
||||
#define XPLAT_INFO_SHIFT 0xCU
|
||||
#endif
|
||||
|
||||
#if defined (VERSAL_NET)
|
||||
#if defined (ARMR52)
|
||||
#define XPS_NUM_OF_CORES_PER_CLUSTER 2U
|
||||
#define XPS_RPU_PCIL_A0_PWRDWN 0xEB4200C0U
|
||||
/*
|
||||
* Offset between RPU_PCIL_X_PWRDWN registers of consecutive
|
||||
* CPU cores in given cluster
|
||||
*/
|
||||
#define XPS_RPU_PCIL_CORE_OFFSET 0x100U
|
||||
|
||||
/*
|
||||
* Offset between RPU_PCIL_A0_PWRDWN registers of 2 clusters
|
||||
*/
|
||||
#define XPS_RPU_PCIL_CLUSTER_OFFSET 0x1000U
|
||||
#define XPS_RPU_PCIL_X_PWRDWN_EN_MASK 1U
|
||||
#else
|
||||
#define XPS_NUM_OF_CORES_PER_CLUSTER 4U
|
||||
#define XPS_CORE_X_PWRDWN_BASEADDR 0xECB10000U
|
||||
/*
|
||||
* Offset between CORE_X_PWRDWN registers of consecutive
|
||||
* CPU cores
|
||||
*/
|
||||
#define XPS_CORE_X_PWRDWN_OFFSET 48U
|
||||
#define XPS_CORE_X_PWRDWN_EN_MASK 1U
|
||||
#endif
|
||||
#endif
|
||||
/**************************** Type Definitions *******************************/
|
||||
/**
|
||||
*@endcond
|
||||
@ -97,6 +128,9 @@ extern "C" {
|
||||
|
||||
|
||||
u32 XGetPlatform_Info(void);
|
||||
#if ! defined(__microblaze__) && ! defined(__riscv)
|
||||
u8 XGetCoreId(void);
|
||||
#endif
|
||||
|
||||
#if defined (ARMR5) || defined (__aarch64__) || defined (ARMA53_32) || defined (PSU_PMU) || defined (versal)
|
||||
u32 XGetPSVersion_Info(void);
|
||||
@ -109,6 +143,7 @@ u32 XGet_Zynq_UltraMp_Platform_info(void);
|
||||
#if (defined (__aarch64__) && defined (VERSAL_NET)) || defined (ARMR52)
|
||||
u8 XGetClusterId(void);
|
||||
u8 XGetCoreId(void);
|
||||
u8 XGetBootStatus(void);
|
||||
#endif
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
46
bsp_z7/ps7_cortexa9_0/include/xpm_init.h
Normal file
46
bsp_z7/ps7_cortexa9_0/include/xpm_init.h
Normal file
@ -0,0 +1,46 @@
|
||||
/******************************************************************************
|
||||
*Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
*SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* @file xpm_init.h
|
||||
* @addtogroup xpm_init xpm_init APIs
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- -------- -------- -----------------------------------------------
|
||||
* 1.0 gm 14/06/23 Initial release.
|
||||
* </pre>
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XPM_INIT_H
|
||||
#define XPM_INIT_H
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
#if defined (XPM_SUPPORT)
|
||||
#ifdef VERSAL_NET
|
||||
#define MAX_NODE_COUNT 38
|
||||
#elif defined(versal)
|
||||
#define MAX_NODE_COUNT 33
|
||||
#endif
|
||||
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
typedef struct {
|
||||
UINTPTR BaseAddress;
|
||||
UINTPTR NodeId;
|
||||
UINTPTR ResetId;
|
||||
} XpmNodeInfo;
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
UINTPTR XpmGetNodeId(UINTPTR BaseAddress);
|
||||
UINTPTR XpmGetResetId(UINTPTR BaseAddress);
|
||||
|
||||
#endif
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2014 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
* 7.2 dp 04/30/20 Added clobber "cc" to mtcpsr for aarch32 processors
|
||||
* 8.0 mus 02/24/22 Added macro mfcpnotoken and mtcpnotoken.
|
||||
* 8.1 asa 02/13/23 Create macros to read ESR, FAR and ELR registers.
|
||||
* 9.1 ml 11/15/23 Fix compilation errors reported with -std=c2x compiler flag
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -56,7 +57,7 @@ extern "C" {
|
||||
#if defined (__aarch64__)
|
||||
/* pseudo assembler instructions */
|
||||
#define mfcpsr() ({u32 rval = 0U; \
|
||||
asm volatile("mrs %0, DAIF" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, DAIF" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
@ -68,8 +69,6 @@ extern "C" {
|
||||
#define cpsief() //__asm__ __volatile__("cpsie f\n")
|
||||
#define cpsidf() //__asm__ __volatile__("cpsid f\n")
|
||||
|
||||
|
||||
|
||||
#define mtgpr(rn, v) /*__asm__ __volatile__(\
|
||||
"mov r" stringify(rn) ", %0 \n"\
|
||||
: : "r" (v)\
|
||||
@ -94,7 +93,6 @@ extern "C" {
|
||||
/* Data Memory Barrier */
|
||||
#define dmb() __asm__ __volatile__("dmb sy")
|
||||
|
||||
|
||||
/* Memory Operations */
|
||||
#define ldr(adr) ({u64 rval; \
|
||||
__asm__ __volatile__(\
|
||||
@ -106,36 +104,35 @@ extern "C" {
|
||||
|
||||
#if (EL3 == 1)
|
||||
#define mfelrel3() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, ELR_EL3" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, ELR_EL3" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
#define mfesrel3() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, ESR_EL3" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, ESR_EL3" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
#define mffarel3() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, FAR_EL3" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, FAR_EL3" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
#else
|
||||
#define mfelrel1() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, ELR_EL1" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, ELR_EL1" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
#define mfesrel1() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, ESR_EL1" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, ESR_EL1" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
#define mffarel1() ({u64 rval = 0U; \
|
||||
asm volatile("mrs %0, FAR_EL1" : "=r" (rval));\
|
||||
__asm volatile("mrs %0, FAR_EL1" : "=r" (rval));\
|
||||
rval;\
|
||||
})
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define mtelrel3(v) __asm__ __volatile__ ("msr ELR_EL3, %0" : : "r" (v))
|
||||
@ -162,8 +159,6 @@ extern "C" {
|
||||
#define cpsief() __asm__ __volatile__("cpsie f\n")
|
||||
#define cpsidf() __asm__ __volatile__("cpsid f\n")
|
||||
|
||||
|
||||
|
||||
#define mtgpr(rn, v) __asm__ __volatile__(\
|
||||
"mov r" stringify(rn) ", %0 \n"\
|
||||
: : "r" (v)\
|
||||
@ -188,7 +183,6 @@ extern "C" {
|
||||
/* Data Memory Barrier */
|
||||
#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
|
||||
|
||||
|
||||
/* Memory Operations */
|
||||
#define ldr(adr) ({u32 rval; \
|
||||
__asm__ __volatile__(\
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xqspips.h
|
||||
* @addtogroup qspips_v3_10
|
||||
* @addtogroup qspips Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -270,6 +271,8 @@
|
||||
* 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.
|
||||
* 3.11 akm 07/10/23 Update the driver to support for system device-tree flow.
|
||||
* 3.12 sb 02/20/24 Add missing parenthesis for macro expansions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -484,10 +487,20 @@ typedef void (*XQspiPs_StatusHandler) (void *CallBackRef, u32 StatusEvent,
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Base address of the device */
|
||||
u32 InputClockHz; /**< Input clock frequency */
|
||||
u8 ConnectionMode; /**< Single, Stacked and Parallel mode */
|
||||
#ifdef SDT
|
||||
u32 IntrId; /**< Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /**< Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XQspiPs_Config;
|
||||
|
||||
/**
|
||||
@ -625,7 +638,7 @@ typedef struct {
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XQspiPs_GetTXWatermark(InstancePtr) \
|
||||
XQspiPs_In32((InstancePtr->Config.BaseAddress) + XQSPIPS_TXWR_OFFSET)
|
||||
XQspiPs_In32(((InstancePtr)->Config.BaseAddress) + XQSPIPS_TXWR_OFFSET)
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
@ -661,7 +674,7 @@ typedef struct {
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XQspiPs_GetRXWatermark(InstancePtr) \
|
||||
XQspiPs_In32((InstancePtr->Config.BaseAddress) + XQSPIPS_RXWR_OFFSET)
|
||||
XQspiPs_In32(((InstancePtr)->Config.BaseAddress) + XQSPIPS_RXWR_OFFSET)
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
@ -677,7 +690,7 @@ typedef struct {
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XQspiPs_Enable(InstancePtr) \
|
||||
XQspiPs_Out32((InstancePtr->Config.BaseAddress) + XQSPIPS_ER_OFFSET, \
|
||||
XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + XQSPIPS_ER_OFFSET, \
|
||||
XQSPIPS_ER_ENABLE_MASK)
|
||||
|
||||
/****************************************************************************/
|
||||
@ -694,7 +707,7 @@ typedef struct {
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XQspiPs_Disable(InstancePtr) \
|
||||
XQspiPs_Out32((InstancePtr->Config.BaseAddress) + XQSPIPS_ER_OFFSET, 0)
|
||||
XQspiPs_Out32(((InstancePtr)->Config.BaseAddress) + XQSPIPS_ER_OFFSET, 0)
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
@ -731,7 +744,7 @@ typedef struct {
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XQspiPs_GetLqspiConfigReg(InstancePtr) \
|
||||
XQspiPs_In32((InstancePtr->Config.BaseAddress) + \
|
||||
XQspiPs_In32(((InstancePtr)->Config.BaseAddress) + \
|
||||
XQSPIPS_LQSPI_CR_OFFSET)
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
@ -739,7 +752,11 @@ typedef struct {
|
||||
/*
|
||||
* Initialization function, implemented in xqspips_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XQspiPs_Config *XQspiPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XQspiPs_Config *XQspiPs_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions implemented in xqspips.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xqspips_hw.h
|
||||
* @addtogroup qspips_v3_10
|
||||
* @addtogroup qspips Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains the identifiers and basic HW access driver
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (c) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -20,6 +21,7 @@
|
||||
* Ver Who Date Changes
|
||||
* ----- -------- -------- -----------------------------------------------
|
||||
* 1.00a ecm/sdm 10/20/09 First release
|
||||
* 9.0 mus 07/29/23 Added definitions for processor affinity register.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -489,7 +491,10 @@ extern "C" {
|
||||
#define XREG_CP15_MAIN_TLB_ATTR "cp15:5:c15:c7:2"
|
||||
#endif
|
||||
|
||||
|
||||
/* Affinity register bits */
|
||||
#define XREG_MPIDR_MASK 0xFFFFFFFFU
|
||||
#define XREG_MPIDR_AFFINITY0_MASK 0x3U
|
||||
#define XREG_MPIDR_AFFINITY0_SHIFT 0x0U
|
||||
/* MPE register definitions */
|
||||
#define XREG_FPSID c0
|
||||
#define XREG_FPSCR c1
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -8,56 +8,10 @@
|
||||
/**
|
||||
*
|
||||
* @file xscugic.h
|
||||
* @addtogroup scugic Overview
|
||||
* @addtogroup scugic_api SCUGIC APIs
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* The generic interrupt controller driver component.
|
||||
*
|
||||
* The interrupt controller driver uses the idea of priority for the various
|
||||
* handlers. Priority is an integer within the range of 1 and 31 inclusive with
|
||||
* default of 1 being the highest priority interrupt source. The priorities
|
||||
* of the various sources can be dynamically altered as needed through
|
||||
* hardware configuration.
|
||||
*
|
||||
* The generic interrupt controller supports the following
|
||||
* features:
|
||||
*
|
||||
* - specific individual interrupt enabling/disabling
|
||||
* - specific individual interrupt acknowledging
|
||||
* - attaching specific callback function to handle interrupt source
|
||||
* - assigning desired priority to interrupt source if default is not
|
||||
* acceptable.
|
||||
*
|
||||
* Details about connecting the interrupt handler of the driver are contained
|
||||
* in the source file specific to interrupt processing, xscugic_intr.c.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* <b>Interrupt Vector Tables</b>
|
||||
*
|
||||
* The device ID of the interrupt controller device is used by the driver as a
|
||||
* direct index into the configuration data table. The user should populate the
|
||||
* vector table with handlers and callbacks at run-time using the
|
||||
* XScuGic_Connect() and XScuGic_Disconnect() functions.
|
||||
*
|
||||
* Each vector table entry corresponds to a device that can generate an
|
||||
* interrupt. Each entry contains an interrupt handler function and an
|
||||
* argument to be passed to the handler when an interrupt occurs. The
|
||||
* user must use XScuGic_Connect() when the interrupt handler takes an
|
||||
* argument other than the base address.
|
||||
*
|
||||
* <b>Nested Interrupts Processing</b>
|
||||
*
|
||||
* Nested interrupts are not supported by this driver.
|
||||
*
|
||||
* NOTE:
|
||||
* The generic interrupt controller is not a part of the snoop control unit
|
||||
* as indicated by the prefix "scu" in the name of the driver.
|
||||
* It is an independent module in APU.
|
||||
*
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
@ -190,12 +144,14 @@
|
||||
* executed, redistributor address will be stored in newly
|
||||
* added member of XScuGic data structure "RedistBaseAddr".
|
||||
* It fixes CR#1150432.
|
||||
* 5.2 ml 03/02/23 Add description to fix Doxygen warnings.
|
||||
* 5.2 adk 04/14/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XSCUGIC_H /* prevent circular inclusions */
|
||||
#define XSCUGIC_H /* by using protection macros */
|
||||
#ifndef XSCUGIC_H /**< prevent circular inclusions */
|
||||
#define XSCUGIC_H /**< by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -212,13 +168,23 @@ extern "C" {
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
/**
|
||||
* @name EFUSE status Register information
|
||||
* EFUSE Status Register
|
||||
* @{
|
||||
*/
|
||||
#define EFUSE_STATUS_OFFSET 0x10
|
||||
#define EFUSE_STATUS_CPU_MASK 0x80
|
||||
|
||||
#if !defined (ARMR5) && !defined (__aarch64__) && !defined (ARMA53_32)
|
||||
#define ARMA9
|
||||
#define ARMA9 /**< ARMA9 macro to identify cortexA9 */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name GICD_CTLR Register information
|
||||
* GICD_CTLR Status Register
|
||||
* @{
|
||||
*/
|
||||
#define XSCUGIC500_DCTLR_ARE_NS_ENABLE 0x20
|
||||
#define XSCUGIC500_DCTLR_ARE_S_ENABLE 0x10
|
||||
|
||||
@ -245,8 +211,12 @@ extern "C" {
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
Xil_InterruptHandler Handler;
|
||||
void *CallBackRef;
|
||||
Xil_InterruptHandler Handler; /**< Interrupt Handler */
|
||||
void *CallBackRef; /**< CallBackRef is the callback reference passed in
|
||||
by the upper layer when setting the Interrupt
|
||||
handler for specific interrupt ID, and it will
|
||||
passed back to Interrupt handler when it is
|
||||
invoked. */
|
||||
} XScuGic_VectorTableEntry;
|
||||
|
||||
/**
|
||||
@ -254,9 +224,15 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
u32 CpuBaseAddress; /**< CPU Interface Register base address */
|
||||
u32 DistBaseAddress; /**< Distributor Register base address */
|
||||
#else
|
||||
char *Name; /**< Compatible string */
|
||||
u32 DistBaseAddress; /**< Distributor Register base address */
|
||||
u32 CpuBaseAddress; /**< CPU Interface Register base address */
|
||||
#endif
|
||||
XScuGic_VectorTableEntry HandlerTable[XSCUGIC_MAX_NUM_INTR_INPUTS];/**<
|
||||
Vector table of interrupt handlers */
|
||||
} XScuGic_Config;
|
||||
@ -285,16 +261,15 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given CPU Interface register
|
||||
* Writes the given CPU Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be written
|
||||
* @param Data is the 32-bit value to write to the register
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be written.
|
||||
* @param Data 32-bit value to write to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* void XScuGic_CPUWriteReg(XScuGic *InstancePtr, u32 RegOffset, u32 Data)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -305,15 +280,14 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given CPU Interface register
|
||||
* Reads the given CPU Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Rregister offset to be read.
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
* @return 32-bit value of the register
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_CPUReadReg(XScuGic *InstancePtr, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -323,16 +297,15 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given Distributor Interface register
|
||||
* Writes the given Distributor Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be written
|
||||
* @param Data is the 32-bit value to write to the register
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be written.
|
||||
* @param Data 32-bit value to write to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* void XScuGic_DistWriteReg(XScuGic *InstancePtr, u32 RegOffset, u32 Data)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -343,15 +316,14 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given Distributor Interface register
|
||||
* Reads the given Distributor Interface register
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be read.
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
* @return The 32-bit value of the register.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_DistReadReg(XScuGic *InstancePtr, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -362,16 +334,15 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given ReDistributor Interface register
|
||||
* Writes the given ReDistributor Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be written
|
||||
* @param Data is the 32-bit value to write to the register
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be written.
|
||||
* @param Data 32-bit value to write to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* void XScuGic_DistWriteReg(XScuGic *InstancePtr, u32 RegOffset, u32 Data)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -381,15 +352,14 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given ReDistributor Interface register
|
||||
* Reads the given ReDistributor Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be read.
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
* @return 32-bit value of the register.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_DistReadReg(XScuGic *InstancePtr, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -399,16 +369,15 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given ReDistributor SGI PPI Interface register
|
||||
* Writes the given ReDistributor SGI PPI Interface register.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be written
|
||||
* @param Data is the 32-bit value to write to the register
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be written.
|
||||
* @param Data 32-bit value to write to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* void XScuGic_DistWriteReg(XScuGic *InstancePtr, u32 RegOffset, u32 Data)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -419,15 +388,14 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given ReDistributor SGI PPI Interface register
|
||||
* Reads the given ReDistributor SGI PPI Interface register
|
||||
*
|
||||
* @param InstancePtr is a pointer to the instance to be worked on.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param InstancePtr Pointer to the instance to be worked on.
|
||||
* @param RegOffset Register offset to be read.
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_DistReadReg(XScuGic *InstancePtr, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -443,9 +411,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#define XREG_ICC_SGI1R_EL1 "p15, 0, %0, %1, c12"
|
||||
#define XREG_ICC_PMR_EL1 "p15, 0, %0, c4, c6, 0"
|
||||
#define XREG_ICC_IAR0_EL1 "p15, 0, %0, c12, c8, 0"
|
||||
#define XREG_ICC_IAR1_EL1 "p15, 0, %0, c12, c12, 0"
|
||||
#define XREG_ICC_EOIR0_EL1 "p15, 0, %0, c12, c8, 1"
|
||||
#define XREG_ICC_EOIR1_EL1 "p15, 0, %0, c12, c12, 1"
|
||||
#define XREG_IMP_CBAR "p15, 1, %0, c15, c3, 0"
|
||||
#define XREG_ICC_BPR0_EL1 "p15, 0, %0, c12, c8, 3"
|
||||
#define XREG_ICC_BPR1_EL1 "p15, 0, %0, c12, c12, 3"
|
||||
#define XREG_ICC_RPR_EL1 "p15, 0, %0, c12, c11, 3"
|
||||
#else
|
||||
#define XREG_ICC_SRE_EL1 "S3_0_C12_C12_5"
|
||||
@ -463,13 +434,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function enables system register interface for GIC CPU Interface
|
||||
* Enables system register interface for GIC CPU Interface.
|
||||
*
|
||||
* @param value to be written
|
||||
* @param value Value to be written.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined (__aarch64__)
|
||||
@ -480,13 +450,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function enables Grou0 interrupts
|
||||
* Enable Grou0 interrupts.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined(ARMR52)
|
||||
@ -502,7 +471,6 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined (ARMR52)
|
||||
@ -518,13 +486,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function writes to ICC_SGI0R_EL1
|
||||
* Writes to ICC_SGI0R_EL1.
|
||||
*
|
||||
* @param value to be written
|
||||
* @param value Value to be written.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined(ARMR52)
|
||||
@ -535,13 +502,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function writes to ICC_SGI1R_EL1
|
||||
* Writes to ICC_SGI1R_EL1.
|
||||
*
|
||||
* @param value to be written
|
||||
* @param value Value to be written.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined(ARMR52)
|
||||
@ -552,13 +518,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function reads ICC_SGI1R_EL1 register
|
||||
* Reads ICC_SGI1R_EL1 register.
|
||||
*
|
||||
* @param None
|
||||
*
|
||||
* @return Value of ICC_SGI1R_EL1 register
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined (ARMR52)
|
||||
@ -568,13 +533,12 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function sets interrupt priority filter
|
||||
* Sets interrupt priority filter.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined (ARMR52)
|
||||
@ -584,17 +548,16 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function returns interrupt id of highest priority pending interrupt
|
||||
* Returns interrupt ID of highest priority pending interrupt.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined(ARMR52)
|
||||
#define XScuGic_get_IntID() mfcp(XREG_ICC_IAR0_EL1)
|
||||
#define XScuGic_get_IntID() mfcp(XREG_ICC_IAR1_EL1)
|
||||
#elif EL3
|
||||
#define XScuGic_get_IntID() mfcpnotoken(XREG_ICC_IAR0_EL1)
|
||||
#else
|
||||
@ -602,17 +565,16 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
#endif
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* This function acks the interrupt
|
||||
* Acknowledges the interrupt.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#if defined(ARMR52)
|
||||
#define XScuGic_ack_Int(val) mtcp(XREG_ICC_EOIR0_EL1,val)
|
||||
#define XScuGic_ack_Int(val) mtcp(XREG_ICC_EOIR1_EL1,val)
|
||||
#elif EL3
|
||||
#define XScuGic_ack_Int(val) mtcpnotoken(XREG_ICC_EOIR0_EL1,val)
|
||||
#else
|
||||
@ -627,7 +589,6 @@ extern XScuGic_Config XScuGic_ConfigTable[]; /**< Config table */
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XScuGic_Get_Rdist_Int_Trigger_Index(IntrId) ((Int_Id%16) * 2U)
|
||||
@ -660,12 +621,23 @@ void XScuGic_UnmapAllInterruptsFromCpu(XScuGic *InstancePtr, u8 Cpu_Identifier);
|
||||
void XScuGic_Stop(XScuGic *InstancePtr);
|
||||
void XScuGic_SetCpuID(u32 CpuCoreId);
|
||||
u32 XScuGic_GetCpuID(void);
|
||||
#ifndef SDT
|
||||
u8 XScuGic_IsInitialized(u32 DeviceId);
|
||||
#else
|
||||
u8 XScuGic_IsInitialized(u32 BaseAddress);
|
||||
#endif
|
||||
#ifndef SDT
|
||||
/*
|
||||
* Initialization functions in xscugic_sinit.c
|
||||
* Lookup configuration by using DeviceId
|
||||
*/
|
||||
XScuGic_Config *XScuGic_LookupConfig(u16 DeviceId);
|
||||
/*
|
||||
* Lookup configuration by using BaseAddress
|
||||
*/
|
||||
XScuGic_Config *XScuGic_LookupConfigBaseAddr(UINTPTR BaseAddress);
|
||||
#else
|
||||
XScuGic_Config *XScuGic_LookupConfig(UINTPTR BaseAddr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interrupt functions in xscugic_intr.c
|
||||
@ -685,5 +657,6 @@ void XScuGic_MarkCoreAwake(XScuGic *InstancePtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* end of protection macro */
|
||||
#endif
|
||||
/* end of protection macro */
|
||||
/** @} */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
/**
|
||||
*
|
||||
* @file xscugic_hw.h
|
||||
* @addtogroup scugic Overview
|
||||
* @addtogroup scugic_api SCUGIC APIs
|
||||
* @{
|
||||
*
|
||||
* This header file contains identifiers and HW access functions (or
|
||||
* The xscugic_hw.h header file contains identifiers and hardware access functions (or
|
||||
* macros) that can be used to access the device. The user should refer to the
|
||||
* hardware device specification for more details of the device operation.
|
||||
* The driver functions/APIs are defined in xscugic.h.
|
||||
@ -69,13 +69,14 @@
|
||||
* based address for specific CPU core. Also, added new macro
|
||||
* XScuGic_ReadReg64 to read 64 bit value from specific address.
|
||||
* 5.1 mus 02/15/23 Added support for VERSAL_NET APU and RPU GIC.
|
||||
*
|
||||
* 5.2 ml 03/02/23 Add description to fix Doxygen warnings.
|
||||
* 5.2 mus 03/26/23 Fixed calculation for XSCUGIC_RDIST_INT_PRIORITY_OFFSET_CALC.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef XSCUGIC_HW_H /* prevent circular inclusions */
|
||||
#define XSCUGIC_HW_H /* by using protection macros */
|
||||
#ifndef XSCUGIC_HW_H /**< prevent circular inclusions */
|
||||
#define XSCUGIC_HW_H /**< by using protection macros */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -110,24 +111,31 @@ extern "C" {
|
||||
* The maximum number of interrupts supported by the hardware.
|
||||
*/
|
||||
#ifdef PLATFORM_ZYNQ
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 95U /* Maximum number of interrupt defined by Zynq */
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 95U /**< Maximum number of
|
||||
interrupt defined by
|
||||
Zynq */
|
||||
#elif defined (VERSAL_NET)
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 256U /* Maximum number of interrupt sources in VERSAL NET */
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 256U /**< Maximum number of
|
||||
interrupt sources in
|
||||
VERSAL NET */
|
||||
#elif defined (versal)
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 192U
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 192U /**< Maximum number of
|
||||
interrupt sources in
|
||||
VERSAL */
|
||||
#else
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 195U /* Maximum number of interrupt defined by Zynq Ultrascale Mp */
|
||||
#define XSCUGIC_MAX_NUM_INTR_INPUTS 195U /**< Maximum number of
|
||||
interrupt defined by
|
||||
Zynq Ultrascale Mp */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* First Interrupt Id for SPI interrupts.
|
||||
*/
|
||||
#define XSCUGIC_SPI_INT_ID_START 0x20U
|
||||
/*
|
||||
* The maximum priority value that can be used in the GIC.
|
||||
*/
|
||||
#define XSCUGIC_MAX_INTR_PRIO_VAL 248U
|
||||
#define XSCUGIC_INTR_PRIO_MASK 0x000000F8U
|
||||
#define XSCUGIC_SPI_INT_ID_START 0x20U /**< First Interrupt Id for
|
||||
SPI interrupts. */
|
||||
|
||||
#define XSCUGIC_MAX_INTR_PRIO_VAL 248U /**< The maximum priority value
|
||||
that can be used in
|
||||
the GIC. */
|
||||
#define XSCUGIC_INTR_PRIO_MASK 0x000000F8U /**< The Interrupt
|
||||
priority mask value */
|
||||
|
||||
/** @name Distributor Interface Register Map
|
||||
*
|
||||
@ -338,7 +346,7 @@ extern "C" {
|
||||
* There are up to 255 of these registers staring at location 0xC08.
|
||||
* @{
|
||||
*/
|
||||
#define XSCUGIC_INT_CFG_MASK 0x00000003U /**< */
|
||||
#define XSCUGIC_INT_CFG_MASK 0x00000003U /**< Interrupt configuration Mask */
|
||||
/* @} */
|
||||
|
||||
/** @name PPI Status Register
|
||||
@ -523,6 +531,7 @@ extern "C" {
|
||||
#define XSCUGIC_RDIST_ISENABLE_OFFSET 0x100U
|
||||
#define XSCUGIC_RDIST_IPRIORITYR_OFFSET 0x400U
|
||||
#define XSCUGIC_RDIST_IGROUPR_OFFSET 0x80U
|
||||
|
||||
#define XSCUGIC_RDIST_GRPMODR_OFFSET 0xD00U
|
||||
#define XSCUGIC_RDIST_INT_CONFIG_OFFSET 0xC00U
|
||||
#define XSCUGIC_RDIST_TYPER_OFFSET 0x8U
|
||||
@ -535,7 +544,7 @@ extern "C" {
|
||||
/*
|
||||
* GICR_IGROUPR register definitions
|
||||
*/
|
||||
#if (defined(ARMR52) || EL3)
|
||||
#if EL3
|
||||
#define XSCUGIC_DEFAULT_SECURITY 0x0U
|
||||
#else
|
||||
#define XSCUGIC_DEFAULT_SECURITY 0xFFFFFFFFU
|
||||
@ -551,13 +560,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Interrupt Configuration Register offset for an interrupt id.
|
||||
* Reads the Interrupt Configuration Register offset for an interrupt ID.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_INT_CFG_OFFSET_CALC(InterruptID) \
|
||||
@ -566,13 +574,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Interrupt Priority Register offset for an interrupt id.
|
||||
* Reads the Interrupt Priority Register offset for an interrupt ID.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_PRIORITY_OFFSET_CALC(InterruptID) \
|
||||
@ -581,13 +588,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Interrupt Routing Register offset for an interrupt id.
|
||||
* Reads the Interrupt Routing Register offset for an interrupt ID.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_IROUTER_OFFSET_CALC(InterruptID) \
|
||||
@ -596,13 +602,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the SPI Target Register offset for an interrupt id.
|
||||
* Reads the SPI Target Register offset for an interrupt ID.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
* @return The 32-bit value of the offset.
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_SPI_TARGET_OFFSET_CALC(InterruptID) \
|
||||
@ -610,13 +615,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the SPI Target Register offset for an interrupt id.
|
||||
* Reads the SPI Target Register offset for an interrupt ID.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_SECURITY_TARGET_OFFSET_CALC(InterruptID) \
|
||||
@ -625,13 +629,12 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Re-distributor Interrupt configuration register offset
|
||||
* Reads the Re-distributor Interrupt configuration register offset.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_RDIST_INT_CONFIG_OFFSET_CALC(InterruptID) \
|
||||
@ -640,28 +643,26 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Re-distributor Interrupt Priority register offset
|
||||
* Reads the Re-distributor Interrupt Priority register offset.
|
||||
*
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_RDIST_INT_PRIORITY_OFFSET_CALC(InterruptID) \
|
||||
((u32)XSCUGIC_RDIST_IPRIORITYR_OFFSET + (InterruptID * 4))
|
||||
((u32)XSCUGIC_RDIST_IPRIORITYR_OFFSET + ((InterruptID/4) * 4))
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the Interrupt Clear-Enable Register offset for an interrupt ID
|
||||
* Reads the Interrupt Clear-Enable Register offset for an interrupt ID.
|
||||
*
|
||||
* @param Register is the register offset for the clear/enable bank.
|
||||
* @param InterruptID is the interrupt number.
|
||||
* @param Register Register offset for the clear/enable bank.
|
||||
* @param InterruptID Interrupt number.
|
||||
*
|
||||
* @return The 32-bit value of the offset
|
||||
*
|
||||
* @note
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XSCUGIC_EN_DIS_OFFSET_CALC(Register, InterruptID) \
|
||||
@ -670,15 +671,14 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given Intc register.
|
||||
* Reads the given Intc register.
|
||||
*
|
||||
* @param BaseAddress is the base address of the device.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param BaseAddress Base address of the device.
|
||||
* @param RegOffset Register offset to be read.
|
||||
*
|
||||
* @return The 32-bit value of the register
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_ReadReg(u32 BaseAddress, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -688,15 +688,14 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Read the given Intc register.
|
||||
* Reads the given Intc register.
|
||||
*
|
||||
* @param BaseAddress is the base address of the device.
|
||||
* @param RegOffset is the register offset to be read
|
||||
* @param BaseAddress Base address of the device.
|
||||
* @param RegOffset Register offset to be read.
|
||||
*
|
||||
* @return The 64-bit value of the register
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* u32 XScuGic_ReadReg64(UINTPTR BaseAddress, u32 RegOffset)
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -706,16 +705,15 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Write the given Intc register.
|
||||
* Writes the given Intc register.
|
||||
*
|
||||
* @param BaseAddress 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
|
||||
* @param BaseAddress Base address of the device.
|
||||
* @param RegOffset Register offset to be written
|
||||
* @param Data 32-bit value to write to the register
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note
|
||||
* C-style signature:
|
||||
* @note C-style signature:
|
||||
* void XScuGic_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xscutimer.h
|
||||
* @addtogroup scutimer_v2_4
|
||||
* @addtogroup scutimer Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -82,6 +83,7 @@
|
||||
* 2.3 mus 08/31/20 Updated makefile to support parallel make and
|
||||
* incremental builds, it would help to reduce compilation
|
||||
* time.
|
||||
* 2.5 dp 07/11/23 Add support for system device tree flow
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -106,7 +108,11 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddr; /**< Base address of the device */
|
||||
#ifdef XIL_INTERRUPT
|
||||
u32 IntrId;
|
||||
@ -325,7 +331,11 @@ typedef struct {
|
||||
/*
|
||||
* Lookup configuration in xscutimer_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XScuTimer_Config *XScuTimer_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XScuTimer_Config *XScuTimer_LookupConfig(UINTPTR BaseAddr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Selftest function in xscutimer_selftest.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xscutimer_hw.h
|
||||
* @addtogroup scutimer_v2_4
|
||||
* @addtogroup scutimer Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the hardware interface to the Timer.
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xscuwdt.h
|
||||
* @addtogroup scuwdt_v2_4
|
||||
* @addtogroup Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -106,6 +107,8 @@
|
||||
* time.
|
||||
* 2.3 sne 09/16/20 Fixed MISRA-C violations.
|
||||
* 2.4 sne 02/04/21 Fixed Doxygen warnings.
|
||||
* 2.5 asa 07/18/23 Added support for system device tree based workflow
|
||||
* decoupling flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -129,8 +132,18 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
u32 BaseAddr; /**< Base address of the device */
|
||||
#else
|
||||
char *Name; /**< Unique name of the device */
|
||||
#endif
|
||||
UINTPTR BaseAddr; /**< Register base address */
|
||||
#ifdef SDT
|
||||
u32 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XScuWdt_Config;
|
||||
|
||||
/**
|
||||
@ -339,7 +352,11 @@ extern XScuWdt_Config XScuWdt_ConfigTable[];
|
||||
/*
|
||||
* Lookup configuration in xscuwdt_sinit.c.
|
||||
*/
|
||||
#ifndef SDT
|
||||
XScuWdt_Config *XScuWdt_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XScuWdt_Config *XScuWdt_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Selftest function in xscuwdt_selftest.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xscuwdt_hw.h
|
||||
* @addtogroup scuwdt_v2_4
|
||||
* @addtogroup Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the hardware interface to the Xilinx SCU private Watch Dog
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2013 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -8,75 +8,10 @@
|
||||
/**
|
||||
*
|
||||
* @file xsdps.h
|
||||
* @addtogroup sdps Overview
|
||||
* @addtogroup sdps_api SDPS APIs
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This section explains the implementation of the XSdPs driver.
|
||||
* See xsdps.h for a detailed description of the device and driver.
|
||||
*
|
||||
* This driver is used initialize read from and write to the SD card.
|
||||
* Features such as switching bus width to 4-bit and switching to high speed,
|
||||
* changing clock frequency, block size etc. are supported.
|
||||
* SD 2.0 uses 1/4 bus width and speeds of 25/50KHz. Initialization, however
|
||||
* is done using 1-bit bus width and 400KHz clock frequency.
|
||||
* SD commands are classified as broadcast and addressed. Commands can be
|
||||
* those with response only (using only command line) or
|
||||
* response + data (using command and data lines).
|
||||
* Only one command can be sent at a time. During a data transfer however,
|
||||
* when dsta lines are in use, certain commands (which use only the command
|
||||
* line) can be sent, most often to obtain status.
|
||||
* This driver does not support multi card slots at present.
|
||||
*
|
||||
* <b>Initialization & Configuration</b>
|
||||
*
|
||||
* This includes initialization on the host controller side to select
|
||||
* clock frequency, bus power and default transfer related parameters.
|
||||
* The default voltage is 3.3V.
|
||||
* On the SD card side, the initialization and identification state diagram is
|
||||
* implemented. This resets the card, gives it a unique address/ID and
|
||||
* identifies key card related specifications.
|
||||
*
|
||||
* <b>Data transfer</b>
|
||||
*
|
||||
* The SD card is put in transfer state to read from or write to it.
|
||||
* The default block size is 512 bytes and if supported,
|
||||
* default bus width is 4-bit and bus speed is High speed.
|
||||
* The read and write functions are implemented in polled mode using ADMA2.
|
||||
*
|
||||
* At any point, when key parameters such as block size or
|
||||
* clock/speed or bus width are modified, this driver takes care of
|
||||
* maintaining the same selection on host and card.
|
||||
* All error bits in host controller are monitored by the driver and in the
|
||||
* event one of them is set, driver will clear the interrupt status and
|
||||
* communicate failure to the upper layer.
|
||||
*
|
||||
* <b>File system use</b>
|
||||
*
|
||||
* This driver can be used with xilffs library to read and write files to SD.
|
||||
* (Please refer to procedure in diskio.c). The file system read/write example
|
||||
* in polled mode can used for reference.
|
||||
*
|
||||
* There is no example for using SD driver without file system at present.
|
||||
* However, the driver can be used without the file system. The glue layer
|
||||
* in filesystem can be used as reference for the same. The block count
|
||||
* passed to the read/write function in one call is limited by the ADMA2
|
||||
* descriptor table and hence care will have to be taken to call read/write
|
||||
* API's in a loop for large file sizes.
|
||||
*
|
||||
* Interrupt mode is not supported because it offers no improvement when used
|
||||
* with file system.
|
||||
*
|
||||
* <b>eMMC support</b>
|
||||
*
|
||||
* SD driver supports SD and eMMC based on the "enable MMC" parameter in SDK.
|
||||
* The features of eMMC supported by the driver will depend on those supported
|
||||
* by the host controller. The current driver supports read/write on eMMC card
|
||||
* using 4-bit and high speed mode currently.
|
||||
*
|
||||
* Features not supported include - card write protect, password setting,
|
||||
* lock/unlock, interrupts, SDMA mode, programmed I/O mode and
|
||||
* 64-bit addressed ADMA2, erase/pre-erase commands.
|
||||
*
|
||||
* <pre>
|
||||
* MODIFICATION HISTORY:
|
||||
@ -161,6 +96,11 @@
|
||||
* 4.1 sa 01/03/23 Report error if Transfer size is greater than 2MB.
|
||||
* 4.1 sa 12/19/22 Enable eMMC HS400 mode for Versal Net.
|
||||
* sa 01/25/23 Use instance structure to store DMA descriptor tables.
|
||||
* 4.2 ro 06/12/23 Added support for system device-tree flow.
|
||||
* 4.2 ap 08/09/23 Reordered XSdPs_FrameCmd XSdPs_Identify_UhsMode functions
|
||||
* 4.3 ap 10/11/23 Resolved compilation errors with Microblaze RISC-V
|
||||
* 4.3 ap 11/29/23 Add support for Sanitize feature.
|
||||
* 4.3 ap 12/22/23 Add support to read custom HS400 tap delay value from design for eMMC.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -243,8 +183,12 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
u32 BaseAddress; /**< Base address of the device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
UINTPTR BaseAddress; /**< Base address of the device */
|
||||
u32 InputClockHz; /**< Input clock frequency */
|
||||
u32 CardDetect; /**< Card Detect */
|
||||
u32 WriteProtect; /**< Write Protect */
|
||||
@ -253,7 +197,7 @@ typedef struct {
|
||||
u32 HasEMIO; /**< If SD is connected to EMIO */
|
||||
u8 SlotType; /**< Slot type */
|
||||
u8 IsCacheCoherent; /**< If SD is Cache Coherent or not */
|
||||
#if defined (XCLOCKING)
|
||||
#if defined (XCLOCKING) || defined (SDT)
|
||||
u32 RefClk; /**< Input clocks */
|
||||
#endif
|
||||
u32 ITapDly_SDR_Clk50; /**< Input Tap delay for HSD/SDR25 modes */
|
||||
@ -262,6 +206,7 @@ typedef struct {
|
||||
u32 OTapDly_DDR_Clk50; /**< Output Tap delay for DDR50 modes */
|
||||
u32 OTapDly_SDR_Clk100; /**< Input Tap delay for SDR50 modes */
|
||||
u32 OTapDly_SDR_Clk200; /**< Input Tap delay for SDR104/HS200 modes */
|
||||
u32 OTapDly_DDR_Clk200; /**< Input Tap delay for HS400 modes */
|
||||
} XSdPs_Config;
|
||||
|
||||
/**
|
||||
@ -275,7 +220,8 @@ typedef struct {
|
||||
#pragma data_alignment = 32
|
||||
} XSdPs_Adma2Descriptor32;
|
||||
#else
|
||||
} __attribute__((__packed__))XSdPs_Adma2Descriptor32;
|
||||
}
|
||||
__attribute__((__packed__))XSdPs_Adma2Descriptor32;
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -325,11 +271,11 @@ typedef struct {
|
||||
u8 IsTuningDone; /**< Flag to indicate HS200 tuning complete */
|
||||
#ifdef __ICCARM__
|
||||
#pragma data_alignment = 32
|
||||
XSdPs_Adma2Descriptor32 Adma2_DescrTbl32[32];
|
||||
XSdPs_Adma2Descriptor64 Adma2_DescrTbl64[32];
|
||||
XSdPs_Adma2Descriptor32 Adma2_DescrTbl32[32]; /**< ADMA descriptor table 32 Bit */
|
||||
XSdPs_Adma2Descriptor64 Adma2_DescrTbl64[32]; /**< ADMA descriptor table 64 Bit */
|
||||
#else
|
||||
XSdPs_Adma2Descriptor32 Adma2_DescrTbl32[32] __attribute__ ((aligned(32)));
|
||||
XSdPs_Adma2Descriptor64 Adma2_DescrTbl64[32] __attribute__ ((aligned(32)));
|
||||
XSdPs_Adma2Descriptor32 Adma2_DescrTbl32[32] __attribute__ ((aligned(32))); /**< ADMA descriptor table 32 Bit */
|
||||
XSdPs_Adma2Descriptor64 Adma2_DescrTbl64[32] __attribute__ ((aligned(32))); /**< ADMA descriptor table 64 Bit */
|
||||
#endif
|
||||
} XSdPs;
|
||||
|
||||
@ -355,10 +301,24 @@ typedef struct {
|
||||
*/
|
||||
#define ENABLE_HS400_MODE
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
/**
|
||||
* XSdPs Configuration Table
|
||||
*/
|
||||
#ifndef SDT
|
||||
extern XSdPs_Config XSdPs_ConfigTable[XPAR_XSDPS_NUM_INSTANCES];
|
||||
#else
|
||||
extern XSdPs_Config XSdPs_ConfigTable[];
|
||||
#endif
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
#ifndef SDT
|
||||
XSdPs_Config *XSdPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XSdPs_Config *XSdPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
s32 XSdPs_CfgInitialize(XSdPs *InstancePtr, XSdPs_Config *ConfigPtr,
|
||||
u32 EffectiveAddr);
|
||||
UINTPTR EffectiveAddr);
|
||||
s32 XSdPs_CardInitialize(XSdPs *InstancePtr);
|
||||
s32 XSdPs_ReadPolled(XSdPs *InstancePtr, u32 Arg, u32 BlkCnt, u8 *Buff);
|
||||
s32 XSdPs_WritePolled(XSdPs *InstancePtr, u32 Arg, u32 BlkCnt, const u8 *Buff);
|
||||
@ -380,6 +340,7 @@ s32 XSdPs_CheckReadTransfer(XSdPs *InstancePtr);
|
||||
s32 XSdPs_StartWriteTransfer(XSdPs *InstancePtr, u32 Arg, u32 BlkCnt, u8 *Buff);
|
||||
s32 XSdPs_CheckWriteTransfer(XSdPs *InstancePtr);
|
||||
s32 XSdPs_Erase(XSdPs *InstancePtr, u32 StartAddr, u32 EndAddr);
|
||||
s32 XSdPs_Sanitize(XSdPs *InstancePtr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2013 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
/**
|
||||
*
|
||||
* @file xsdps_core.h
|
||||
* @addtogroup sdps Overview
|
||||
* @addtogroup sdps_api SDPS APIs
|
||||
* @{
|
||||
*
|
||||
* The xsdps_core.h header file contains the identifiers and basic HW access driver
|
||||
* The xsdps_core.h header file contains the identifiers and basic hardware access driver
|
||||
* functions (or macros) that can be used to access the device. Other driver
|
||||
* functions are defined in xsdps.h.
|
||||
*
|
||||
@ -27,6 +27,7 @@
|
||||
* mn 11/28/21 Fix MISRA-C violations.
|
||||
* 4.0 sk 02/25/22 Add support for eMMC5.1.
|
||||
* 4.1 sa 01/06/23 Include xil_util.h in this file.
|
||||
* 4.2 ap 08/09/23 Add XSdPs_SetTapDelay APIs.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -110,6 +111,10 @@ void XSdPs_ConfigInterrupt(XSdPs *InstancePtr);
|
||||
s32 XSdPs_SendErase(XSdPs *InstancePtr);
|
||||
s32 XSdPs_SetEndAddr(XSdPs *InstancePtr, u32 EndAddr);
|
||||
s32 XSdPs_SetStartAddr(XSdPs *InstancePtr, u32 StartAddr);
|
||||
void XSdPs_SetTapDelay_SDR104(XSdPs *InstancePtr);
|
||||
void XSdPs_SetTapDelay_SDR50(XSdPs *InstancePtr);
|
||||
void XSdPs_SetTapDelay_DDR50(XSdPs *InstancePtr);
|
||||
void XSdPs_SetTapDelay_SDR25(XSdPs *InstancePtr);
|
||||
#ifdef VERSAL_NET
|
||||
u32 XSdPs_Select_HS400(XSdPs *InstancePtr);
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2013 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xsdps_hw.h
|
||||
* @addtogroup sdps Overview
|
||||
* @addtogroup sdps_api SDPS APIs
|
||||
* @{{
|
||||
*
|
||||
* The xsdps_hw.h header file contains the identifiers and basic HW access driver
|
||||
@ -45,6 +45,9 @@
|
||||
* 4.0 sk 02/25/22 Add support for eMMC5.1.
|
||||
* sk 04/07/22 Fix typo in 'XSDPS_MMC_1_BIT_BUS_ARG' macro definition.
|
||||
* 4.1 sk 11/10/22 Add SD/eMMC Tap delay support for Versal Net.
|
||||
* 4.2 ro 06/12/23 Added support for system device-tree flow.
|
||||
* 4.3 ap 11/29/23 Add support for Sanitize feature.
|
||||
* 4.3 ap 12/22/23 Add support to read custom HS400 tap delay value from design for eMMC.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -63,8 +66,8 @@ extern "C" {
|
||||
#include "xil_types.h"
|
||||
#include "xil_assert.h"
|
||||
#include "xil_io.h"
|
||||
#include "bspconfig.h"
|
||||
#include "xparameters.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
/** @name Register Map
|
||||
@ -929,7 +932,9 @@ extern "C" {
|
||||
#define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2U)
|
||||
#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3U)
|
||||
#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4U)
|
||||
#define EXT_CSD_SANITIZE_START (0x1U)
|
||||
#define EXT_CSD_PART_CONFIG_BYTE (179U)
|
||||
#define EXT_CSD_SANIT_CONFIG_BYTE (165U)
|
||||
#define XSDPS_MMC_PART_CFG_0_ARG (((u32)XSDPS_EXT_CSD_WRITE_BYTE << 24U) \
|
||||
| ((u32)EXT_CSD_PART_CONFIG_BYTE << 16U) \
|
||||
| ((u32)(0U) << 8U))
|
||||
@ -942,6 +947,10 @@ extern "C" {
|
||||
| ((u32)EXT_CSD_PART_CONFIG_BYTE << 16U) \
|
||||
| ((u32)EXT_CSD_PART_CONFIG_ACC_BOOT1 << 8U))
|
||||
|
||||
#define XSDPS_MMC_START_SANITIZE_ARG (((u32)XSDPS_EXT_CSD_WRITE_BYTE << 24U) \
|
||||
| ((u32)EXT_CSD_SANIT_CONFIG_BYTE << 16U) \
|
||||
| ((u32)EXT_CSD_SANITIZE_START << 8U))
|
||||
|
||||
#define EXT_CSD_PART_SUPPORT_PART_EN (0x1U)
|
||||
|
||||
#define EXT_CSD_CMD_SET_NORMAL (1U<<0)
|
||||
@ -1196,6 +1205,8 @@ extern "C" {
|
||||
#define SD_ITAPCHGWIN 0x00000200U
|
||||
#define SD_ITAPDLYENA 0x00000100U
|
||||
#define SD_OTAPDLYENA 0x00000040U
|
||||
#define SD_OTAPDLYSEL_SD104_B0 0x00000002U
|
||||
#define SD_OTAPDLYSEL_SD104_B2 0x00000002U
|
||||
#define SD_OTAPDLYSEL_HS200_B0 0x00000007U
|
||||
#define SD_OTAPDLYSEL_HS200_B2 0x00000007U
|
||||
#define SD_OTAPDLYSEL_HS400 0x00000004U
|
||||
@ -1224,6 +1235,8 @@ extern "C" {
|
||||
#define SD_ITAPCHGWIN 0x00000200U
|
||||
#define SD_ITAPDLYENA 0x00000100U
|
||||
#define SD_OTAPDLYENA 0x00000040U
|
||||
#define SD_OTAPDLYSEL_SD104_B0 0x00000002U
|
||||
#define SD_OTAPDLYSEL_SD104_B2 0x00000002U
|
||||
#define SD_OTAPDLYSEL_HS200_B0 0x00000002U
|
||||
#define SD_OTAPDLYSEL_HS200_B2 0x00000002U
|
||||
#define SD_ITAPDLYSEL_SD50 0x0000000EU
|
||||
@ -1255,6 +1268,8 @@ extern "C" {
|
||||
#define SD1_ITAPCHGWIN 0x02000000U
|
||||
#define SD1_ITAPDLYENA 0x01000000U
|
||||
#define SD1_OTAPDLYENA 0x00400000U
|
||||
#define SD_OTAPDLYSEL_SD104_B0 0x00000003U
|
||||
#define SD_OTAPDLYSEL_SD104_B2 0x00000002U
|
||||
#define SD_OTAPDLYSEL_HS200_B0 0x00000003U
|
||||
#define SD_OTAPDLYSEL_HS200_B2 0x00000002U
|
||||
#define SD_ITAPDLYSEL_SD50 0x00000014U
|
||||
@ -1273,7 +1288,7 @@ extern "C" {
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
#ifdef __MICROBLAZE__
|
||||
#if defined (__MICROBLAZE__) || defined (__riscv)
|
||||
#define XPS_SYS_CTRL_BASEADDR 0xFF180000U /**< System controller Baseaddress */
|
||||
#endif
|
||||
|
||||
@ -1294,10 +1309,10 @@ extern "C" {
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Read a register.
|
||||
* Reads a register.
|
||||
*
|
||||
* @param InstancePtr is the pointer to the sdps instance.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param InstancePtr Pointer to the sdps instance.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to the target register.
|
||||
*
|
||||
* @return The value read from the register.
|
||||
@ -1311,12 +1326,12 @@ extern "C" {
|
||||
|
||||
/***************************************************************************/
|
||||
/**
|
||||
* Write to a register.
|
||||
* Writes to a register.
|
||||
*
|
||||
* @param InstancePtr is the pointer to the sdps instance.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param InstancePtr Pointer to the sdps instance.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to target register.
|
||||
* @param RegisterValue is the value to be written to the register.
|
||||
* @param RegisterValue Value to be written to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
@ -1331,16 +1346,16 @@ extern "C" {
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Read a register.
|
||||
* Reads a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to the target register.
|
||||
*
|
||||
* @return The value read from the register.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* u32 XSdPs_ReadReg(u32 BaseAddress. int RegOffset)
|
||||
* u32 XSdPs_ReadReg(UINTPTR BaseAddress. int RegOffset)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define XSdPs_ReadReg(BaseAddress, RegOffset) \
|
||||
@ -1348,17 +1363,17 @@ extern "C" {
|
||||
|
||||
/***************************************************************************/
|
||||
/**
|
||||
* Write to a register.
|
||||
* Writes to a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to target register.
|
||||
* @param RegisterValue is the value to be written to the register.
|
||||
* @param RegisterValue Value to be written to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* void XSdPs_WriteReg(u32 BaseAddress, int RegOffset,
|
||||
* void XSdPs_WriteReg(UINTPTR BaseAddress, int RegOffset,
|
||||
* u32 RegisterValue)
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -1367,21 +1382,21 @@ extern "C" {
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Read a register.
|
||||
* Reads a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to the target register.
|
||||
*
|
||||
* @return The value read from the register.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* u16 XSdPs_ReadReg(u32 BaseAddress. int RegOffset)
|
||||
* u16 XSdPs_ReadReg(UINTPTR BaseAddress. int RegOffset)
|
||||
*
|
||||
******************************************************************************/
|
||||
static INLINE u16 XSdPs_ReadReg16(u32 BaseAddress, u8 RegOffset)
|
||||
static INLINE u16 XSdPs_ReadReg16(UINTPTR BaseAddress, u8 RegOffset)
|
||||
{
|
||||
#if defined (__MICROBLAZE__)
|
||||
#if defined (__MICROBLAZE__) || defined (__riscv)
|
||||
u32 Reg;
|
||||
BaseAddress += RegOffset & 0xFC;
|
||||
Reg = XSdPs_In32(BaseAddress);
|
||||
@ -1394,24 +1409,24 @@ static INLINE u16 XSdPs_ReadReg16(u32 BaseAddress, u8 RegOffset)
|
||||
|
||||
/***************************************************************************/
|
||||
/**
|
||||
* Write to a register.
|
||||
* Writes to a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to target register.
|
||||
* @param RegisterValue is the value to be written to the register.
|
||||
* @param RegisterValue Value to be written to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* void XSdPs_WriteReg(u32 BaseAddress, int RegOffset,
|
||||
* void XSdPs_WriteReg(UINTPTR BaseAddress, int RegOffset,
|
||||
* u16 RegisterValue)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static INLINE void XSdPs_WriteReg16(u32 BaseAddress, u8 RegOffset, u16 RegisterValue)
|
||||
static INLINE void XSdPs_WriteReg16(UINTPTR BaseAddress, u8 RegOffset, u16 RegisterValue)
|
||||
{
|
||||
#if defined (__MICROBLAZE__)
|
||||
#if defined (__MICROBLAZE__) || defined (__riscv)
|
||||
u32 Reg;
|
||||
BaseAddress += RegOffset & 0xFC;
|
||||
Reg = XSdPs_In32(BaseAddress);
|
||||
@ -1425,21 +1440,21 @@ static INLINE void XSdPs_WriteReg16(u32 BaseAddress, u8 RegOffset, u16 RegisterV
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Read a register.
|
||||
* Reads a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to the target register.
|
||||
*
|
||||
* @return The value read from the register.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* u8 XSdPs_ReadReg(u32 BaseAddress. int RegOffset)
|
||||
* u8 XSdPs_ReadReg(UINTPTR BaseAddress. int RegOffset)
|
||||
*
|
||||
******************************************************************************/
|
||||
static INLINE u8 XSdPs_ReadReg8(u32 BaseAddress, u8 RegOffset)
|
||||
static INLINE u8 XSdPs_ReadReg8(UINTPTR BaseAddress, u8 RegOffset)
|
||||
{
|
||||
#if defined (__MICROBLAZE__)
|
||||
#if defined (__MICROBLAZE__) || defined (__riscv)
|
||||
u32 Reg;
|
||||
BaseAddress += RegOffset & 0xFC;
|
||||
Reg = XSdPs_In32(BaseAddress);
|
||||
@ -1451,23 +1466,23 @@ static INLINE u8 XSdPs_ReadReg8(u32 BaseAddress, u8 RegOffset)
|
||||
}
|
||||
/***************************************************************************/
|
||||
/**
|
||||
* Write to a register.
|
||||
* Writes to a register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param RegOffset contains the offset from the 1st register of the
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
* @param RegOffset Contains the offset from the 1st register of the
|
||||
* device to target register.
|
||||
* @param RegisterValue is the value to be written to the register.
|
||||
* @param RegisterValue Value to be written to the register.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* void XSdPs_WriteReg(u32 BaseAddress, int RegOffset,
|
||||
* void XSdPs_WriteReg(UINTPTR BaseAddress, int RegOffset,
|
||||
* u8 RegisterValue)
|
||||
*
|
||||
******************************************************************************/
|
||||
static INLINE void XSdPs_WriteReg8(u32 BaseAddress, u8 RegOffset, u8 RegisterValue)
|
||||
static INLINE void XSdPs_WriteReg8(UINTPTR BaseAddress, u8 RegOffset, u8 RegisterValue)
|
||||
{
|
||||
#if defined (__MICROBLAZE__)
|
||||
#if defined (__MICROBLAZE__) || defined (__riscv)
|
||||
u32 Reg;
|
||||
BaseAddress += RegOffset & 0xFC;
|
||||
Reg = XSdPs_In32(BaseAddress);
|
||||
@ -1480,14 +1495,14 @@ static INLINE void XSdPs_WriteReg8(u32 BaseAddress, u8 RegOffset, u8 RegisterVal
|
||||
}
|
||||
/***************************************************************************/
|
||||
/**
|
||||
* Macro to get present status register
|
||||
* Macro to get present status register.
|
||||
*
|
||||
* @param BaseAddress contains the base address of the device.
|
||||
* @param BaseAddress Contains the base address of the device.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* void XSdPs_WriteReg(u32 BaseAddress, int RegOffset,
|
||||
* void XSdPs_WriteReg(UINTPTR BaseAddress, int RegOffset,
|
||||
* u8 RegisterValue)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -32,6 +32,7 @@ extern "C" {
|
||||
|
||||
#include "xil_types.h"
|
||||
#include "xil_assert.h"
|
||||
#include "bspconfig.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -149,6 +149,7 @@
|
||||
* It fixes CR#1084697.
|
||||
* 3.16 adk 04/19/22 Fix infinite loop in the examples by adding polled
|
||||
* timeout loop.
|
||||
* 3.18 adk 04/14/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -181,6 +182,7 @@ typedef void (*XTtcPs_StatusHandler) (const void *CallBackRef, u32 StatusEvent);
|
||||
#define XTTCPS_MAX_INTERVAL_COUNT 0xFFFFFFFFU
|
||||
#endif
|
||||
|
||||
#define XTTCPS_NUM_COUNTERS 3U
|
||||
/** @name Configuration options
|
||||
*
|
||||
* Options for the device. Each of the options is bit field, so more than one
|
||||
@ -203,11 +205,18 @@ typedef void (*XTtcPs_StatusHandler) (const void *CallBackRef, u32 StatusEvent);
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID for device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Base address for device */
|
||||
u32 InputClockHz; /**< Input clock frequency */
|
||||
#ifdef XIL_INTERRUPT
|
||||
u16 IntrId;
|
||||
#if !defined(SDT) && defined(XIL_INTERRUPT)
|
||||
u32 IntrId;
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1] Parent base address */
|
||||
#elif defined(SDT)
|
||||
u32 IntrId[XTTCPS_NUM_COUNTERS]; /** Bits[11:0] Interrupt-id Bits[15:12] trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1] Parent base address */
|
||||
#endif
|
||||
} XTtcPs_Config;
|
||||
@ -487,7 +496,11 @@ typedef u32 XMatchRegValue;
|
||||
/*
|
||||
* Initialization functions in xttcps_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XTtcPs_Config *XTtcPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XTtcPs_Config *XTtcPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Required functions, in xttcps.c
|
||||
@ -495,6 +508,7 @@ XTtcPs_Config *XTtcPs_LookupConfig(u16 DeviceId);
|
||||
s32 XTtcPs_CfgInitialize(XTtcPs *InstancePtr,
|
||||
XTtcPs_Config * ConfigPtr, u32 EffectiveAddr);
|
||||
|
||||
u32 XTtcPs_Release(XTtcPs *InstancePtr);
|
||||
void XTtcPs_SetMatchValue(XTtcPs *InstancePtr, u8 MatchIndex, XMatchRegValue Value);
|
||||
XMatchRegValue XTtcPs_GetMatchValue(XTtcPs *InstancePtr, u8 MatchIndex);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -149,6 +149,7 @@
|
||||
* 3.9 rna 12/03/19 Modified the XUARTPS_MAX_RATE macro.
|
||||
* 3.9 sd 02/06/20 Added clock support
|
||||
* 3.12 gm 11/04/22 Added timeout support using Xil_WaitForEvent
|
||||
* 3.13 adk 14/04/23 Added support for system device-tree flow.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -272,14 +273,24 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Base address of device (IPIF) */
|
||||
u32 InputClockHz;/**< Input clock frequency */
|
||||
s32 ModemPinsConnected; /** Specifies whether modem pins are connected
|
||||
* to MIO or FMIO */
|
||||
#if defined (XCLOCKING)
|
||||
#if defined (XCLOCKING) || defined(SDT)
|
||||
u32 RefClk; /**< Input clock frequency */
|
||||
#endif
|
||||
#if defined(SDT)
|
||||
u32 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XUartPs_Config;
|
||||
|
||||
/* Keep track of state information about a data buffer in the interrupt mode. */
|
||||
@ -444,7 +455,11 @@ typedef struct {
|
||||
/************************** Function Prototypes *****************************/
|
||||
|
||||
/* Static lookup function implemented in xuartps_sinit.c */
|
||||
#ifndef SDT
|
||||
XUartPs_Config *XUartPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XUartPs_Config *XUartPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
|
||||
/* Interface functions implemented in xuartps.c */
|
||||
s32 XUartPs_CfgInitialize(XUartPs *InstancePtr,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
* 3.1 kvn 04/10/15 Modified code for latest RTL changes.
|
||||
* 3.6 ms 02/16/18 Updates flow control mode offset value in
|
||||
* modem control register.
|
||||
* 4.0 sd 02/02/24 Added macros for transmission FIFO empty check
|
||||
* and transmission active state check
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -48,6 +50,7 @@ extern "C" {
|
||||
#include "xil_types.h"
|
||||
#include "xil_assert.h"
|
||||
#include "xil_io.h"
|
||||
#include "xstatus.h"
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
@ -408,6 +411,36 @@ extern "C" {
|
||||
((Xil_In32((BaseAddress) + XUARTPS_SR_OFFSET) & \
|
||||
(u32)XUARTPS_SR_TXFULL) == (u32)XUARTPS_SR_TXFULL)
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Check if transmission FIFO is empty
|
||||
*
|
||||
* @return TRUE if the TX FIFO is empty, FALSE if Tx FIFO is not empty
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* u32 XUartPs_IsTransmitEmpty(u32 BaseAddress)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define XUartPs_IsTransmitEmpty(BaseAddress) \
|
||||
((Xil_In32((BaseAddress) + XUARTPS_SR_OFFSET) & \
|
||||
(u32)XUARTPS_SR_TXEMPTY) == (u32)XUARTPS_SR_TXEMPTY)
|
||||
|
||||
/****************************************************************************/
|
||||
/**
|
||||
* Check if transmission state machine is active
|
||||
*
|
||||
* @return TRUE if the TX state machine is active, FALSE if Tx state machine
|
||||
* is In-active
|
||||
*
|
||||
* @note C-Style signature:
|
||||
* u32 XUartPs_IsTransmitActive(u32 BaseAddress)
|
||||
*
|
||||
******************************************************************************/
|
||||
#define XUartPs_IsTransmitActive(BaseAddress) \
|
||||
((Xil_In32((BaseAddress) + XUARTPS_SR_OFFSET) & \
|
||||
(u32)XUARTPS_SR_TACTIVE) == (u32)XUARTPS_SR_TACTIVE)
|
||||
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
void XUartPs_SendByte(u32 BaseAddress, u8 Data);
|
||||
@ -416,6 +449,8 @@ u8 XUartPs_RecvByte(u32 BaseAddress);
|
||||
|
||||
void XUartPs_ResetHw(u32 BaseAddress);
|
||||
|
||||
void XUartPs_WaitTransmitDone(u32 BaseAddress);
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xusbps.h
|
||||
* @addtogroup usbps_v2_7
|
||||
* @addtogroup usbps Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -163,6 +164,7 @@
|
||||
* examples.
|
||||
* 2.5 pm 02/20/20 Added ISO support for usb 2.0 and ch9 common framework
|
||||
* calls.
|
||||
* 2.8 pm 07/07/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -536,8 +538,17 @@ typedef struct {
|
||||
* XUsbPs_ConfigureDevice() function call
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceID; /**< Unique ID of controller. */
|
||||
#else
|
||||
char *Name; /**< Unique Name of controller */
|
||||
#endif
|
||||
u32 BaseAddress; /**< Core register base address. */
|
||||
#ifdef SDT
|
||||
u16 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12] trigger type */
|
||||
/** level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1] */
|
||||
#endif
|
||||
} XUsbPs_Config;
|
||||
|
||||
typedef XUsbPs_Config Usb_Config;
|
||||
@ -1122,7 +1133,11 @@ s32 XUsbPs_EpDataBufferReceive(XUsbPs *InstancePtr, u8 EpNum,
|
||||
* Helper functions for static configuration.
|
||||
* Implemented in xusbps_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XUsbPs_Config *XUsbPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XUsbPs_Config *XUsbPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xusbps_endpoint.h
|
||||
* @addtogroup usbps_v2_7
|
||||
* @addtogroup usbps Overview
|
||||
* @{
|
||||
*
|
||||
* This is an internal file containung the definitions for endpoints. It is
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xusbps_hw.h
|
||||
* @addtogroup usbps_v2_7
|
||||
* @addtogroup usbps Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains identifiers and low-level driver functions (or
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2011 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xcpu_cortexa9.h
|
||||
* @addtogroup cpu_cortexa9_v2_11
|
||||
* @addtogroup cpu_cortexa9 Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the implementation of the interface functions for XDcfg
|
||||
@ -55,7 +56,7 @@
|
||||
* XDCFG_INT_STS_OFFSET) &
|
||||
* XDCFG_IXR_D_P_DONE_MASK) !=
|
||||
* XDCFG_IXR_D_P_DONE_MASK);
|
||||
*
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -124,7 +125,9 @@ int XDcfg_CfgInitialize(XDcfg *InstancePtr,
|
||||
/*
|
||||
* Copy configuration into instance.
|
||||
*/
|
||||
#ifndef SDT
|
||||
InstancePtr->Config.DeviceId = ConfigPtr->DeviceId;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Save the base address pointer such that the registers of the block
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg.h
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -133,6 +134,7 @@
|
||||
* 3.5 ms 04/18/17 Modified tcl file to add suffix U for all macros
|
||||
* definitions of devcfg in xparameters.h
|
||||
* ms 08/07/17 Fixed compilation warnings in xdevcfg_sinit.c
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -178,8 +180,18 @@ typedef void (*XDcfg_IntrHandler) (void *CallBackRef, u32 Status);
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddr; /**< Base address of the device */
|
||||
#ifdef SDT
|
||||
u32 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XDcfg_Config;
|
||||
|
||||
/**
|
||||
@ -298,7 +310,11 @@ typedef struct {
|
||||
/*
|
||||
* Lookup configuration in xdevcfg_sinit.c.
|
||||
*/
|
||||
#ifndef SDT
|
||||
XDcfg_Config *XDcfg_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XDcfg_Config *XDcfg_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Selftest function in xdevcfg_selftest.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_g.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains a table that specifies the configuration of the Device
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_hw.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the implementation of the interface reset functionality
|
||||
@ -17,6 +18,7 @@
|
||||
* Ver Who Date Changes
|
||||
* ----- --- -------- ---------------------------------------------
|
||||
* 2.04a kpc 10/07/13 First release
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_hw.h
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the hardware interface to the Device Config Interface.
|
||||
@ -26,6 +27,7 @@
|
||||
* 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.
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_intr.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* Contains the implementation of interrupt related functions of the XDcfg
|
||||
@ -22,6 +23,7 @@
|
||||
* 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
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_selftest.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* Contains diagnostic self-test functions for the XDcfg driver.
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdevcfg_sinit.c
|
||||
* @addtogroup devcfg_v3_7
|
||||
* @addtogroup devcfg Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains method for static initialization (compile-time) of the
|
||||
@ -20,6 +21,7 @@
|
||||
* ----- --- -------- ---------------------------------------------
|
||||
* 1.00a hvm 02/07/11 First release
|
||||
* 3.5 ms 08/07/17 Fixed compilation warnings.
|
||||
* 3.8 Nava 06/21/23 Added support for system device-tree flow.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -27,7 +29,9 @@
|
||||
/***************************** Include Files *********************************/
|
||||
|
||||
#include "xdevcfg.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
@ -50,6 +54,7 @@
|
||||
* @note None.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef SDT
|
||||
XDcfg_Config *XDcfg_LookupConfig(u16 DeviceId)
|
||||
{
|
||||
extern XDcfg_Config XDcfg_ConfigTable[];
|
||||
@ -65,4 +70,22 @@ XDcfg_Config *XDcfg_LookupConfig(u16 DeviceId)
|
||||
|
||||
return (CfgPtr);
|
||||
}
|
||||
#else
|
||||
XDcfg_Config *XDcfg_LookupConfig(UINTPTR BaseAddress)
|
||||
{
|
||||
extern XDcfg_Config XDcfg_ConfigTable[];
|
||||
XDcfg_Config *CfgPtr = NULL;
|
||||
u32 Index;
|
||||
|
||||
for (Index = (u32)0x0; XDcfg_ConfigTable[Index].Name != NULL; Index++) {
|
||||
if ((XDcfg_ConfigTable[Index].BaseAddr == BaseAddress) ||
|
||||
!BaseAddress) {
|
||||
CfgPtr = &XDcfg_ConfigTable[Index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (CfgPtr);
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps.c
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the implementation of the interface functions for XDmaPs
|
||||
@ -46,6 +47,7 @@
|
||||
* 2.3 kpc 14/10/16 Fixed the compiler error when optimization O0 is used.
|
||||
* 2.5 hk 08/16/19 Add a memory barrier before DMASEV as per specification.
|
||||
* 2.6 hk 02/14/20 Correct boundary check for Channel.
|
||||
* 2.7 aj 12/07/23 Fixed changes to support system device tree flow
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -143,15 +145,26 @@ int XDmaPs_CfgInitialize(XDmaPs *InstPtr,
|
||||
/*
|
||||
* Setup the driver instance using passed in parameters
|
||||
*/
|
||||
#ifndef SDT
|
||||
InstPtr->Config.DeviceId = Config->DeviceId;
|
||||
#endif
|
||||
InstPtr->Config.BaseAddress = EffectiveAddr;
|
||||
|
||||
#ifdef SDT
|
||||
InstPtr->Config.IntrParent = Config->IntrParent;
|
||||
/* Added one fault Inerrupt and eight per-channel Interrupt */
|
||||
for (Channel = 0; Channel < (XDMAPS_CHANNELS_PER_DEV + 1); Channel++) {
|
||||
InstPtr->Config.IntrId[Channel] = Config->IntrId[Channel];
|
||||
}
|
||||
#endif
|
||||
|
||||
CfgReg = XDmaPs_ReadReg(EffectiveAddr, XDMAPS_CR1_OFFSET);
|
||||
CacheLength = CfgReg & XDMAPS_CR1_I_CACHE_LEN_MASK;
|
||||
if (CacheLength < 2 || CacheLength > 5)
|
||||
if (CacheLength < 2 || CacheLength > 5) {
|
||||
CacheLength = 0;
|
||||
else
|
||||
} else {
|
||||
CacheLength = 1 << CacheLength;
|
||||
}
|
||||
|
||||
InstPtr->CacheLength = CacheLength;
|
||||
|
||||
@ -161,7 +174,11 @@ int XDmaPs_CfgInitialize(XDmaPs *InstPtr,
|
||||
for (Channel = 0; Channel < XDMAPS_CHANNELS_PER_DEV; Channel++) {
|
||||
ChanData = InstPtr->Chans + Channel;
|
||||
ChanData->ChanId = Channel;
|
||||
#ifndef SDT
|
||||
ChanData->DevId = Config->DeviceId;
|
||||
#else
|
||||
ChanData->DevId = XDmaPs_GetDrvIndex(InstPtr, EffectiveAddr);
|
||||
#endif
|
||||
}
|
||||
|
||||
InstPtr->IsReady = 1;
|
||||
@ -247,8 +264,11 @@ void XDmaPs_FaultISR(XDmaPs *InstPtr)
|
||||
Fsm = XDmaPs_ReadReg(BaseAddr, XDMAPS_FSM_OFFSET) & 0x01;
|
||||
Fsc = XDmaPs_ReadReg(BaseAddr, XDMAPS_FSC_OFFSET) & 0xFF;
|
||||
|
||||
|
||||
#ifndef SDT
|
||||
DevId = InstPtr->Config.DeviceId;
|
||||
#else
|
||||
DevId = XDmaPs_GetDrvIndex(InstPtr, BaseAddr);
|
||||
#endif
|
||||
|
||||
if (Fsm) {
|
||||
/*
|
||||
@ -340,8 +360,9 @@ int XDmaPs_SetDoneHandler(XDmaPs *InstPtr,
|
||||
|
||||
Xil_AssertNonvoid(InstPtr != NULL);
|
||||
|
||||
if (Channel >= XDMAPS_CHANNELS_PER_DEV)
|
||||
if (Channel >= XDMAPS_CHANNELS_PER_DEV) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
ChanData = InstPtr->Chans + Channel;
|
||||
@ -1125,11 +1146,13 @@ static int XDmaPs_BuildDmaProg(unsigned Channel, XDmaPs_Cmd *Cmd,
|
||||
DstAddr);
|
||||
|
||||
|
||||
if (ChanCtrl->SrcInc)
|
||||
if (ChanCtrl->SrcInc) {
|
||||
SrcUnaligned = SrcAddr % ChanCtrl->SrcBurstSize;
|
||||
}
|
||||
|
||||
if (ChanCtrl->DstInc)
|
||||
if (ChanCtrl->DstInc) {
|
||||
DstUnaligned = DstAddr % ChanCtrl->DstBurstSize;
|
||||
}
|
||||
|
||||
if ((SrcUnaligned && DstInc) || (DstUnaligned && SrcInc)) {
|
||||
ChanCtrl = &Mem2MemByteCC;
|
||||
@ -1322,8 +1345,9 @@ int XDmaPs_GenDmaProg(XDmaPs *InstPtr, unsigned int Channel, XDmaPs_Cmd *Cmd)
|
||||
Xil_AssertNonvoid(Cmd != NULL);
|
||||
|
||||
|
||||
if (Channel > XDMAPS_CHANNELS_PER_DEV)
|
||||
if (Channel > XDMAPS_CHANNELS_PER_DEV) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
ChanData = InstPtr->Chans + Channel;
|
||||
ChanCtrl = &Cmd->ChanCtrl;
|
||||
@ -1396,8 +1420,9 @@ int XDmaPs_FreeDmaProg(XDmaPs *InstPtr, unsigned int Channel, XDmaPs_Cmd *Cmd)
|
||||
Xil_AssertNonvoid(InstPtr != NULL);
|
||||
Xil_AssertNonvoid(Cmd != NULL);
|
||||
|
||||
if (Channel > XDMAPS_CHANNELS_PER_DEV)
|
||||
if (Channel > XDMAPS_CHANNELS_PER_DEV) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
Buf = (void *)Cmd->GeneratedDmaProg;
|
||||
ChanData = InstPtr->Chans + Channel;
|
||||
@ -1450,21 +1475,24 @@ int XDmaPs_Start(XDmaPs *InstPtr, unsigned int Channel,
|
||||
|
||||
Cmd->DmaStatus = XST_FAILURE;
|
||||
|
||||
if (XDmaPs_IsActive(InstPtr, Channel))
|
||||
if (XDmaPs_IsActive(InstPtr, Channel)) {
|
||||
return XST_DEVICE_BUSY;
|
||||
}
|
||||
|
||||
if (!Cmd->UserDmaProg && !Cmd->GeneratedDmaProg) {
|
||||
Status = XDmaPs_GenDmaProg(InstPtr, Channel, Cmd);
|
||||
if (Status)
|
||||
if (Status) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
InstPtr->Chans[Channel].HoldDmaProg = HoldDmaProg;
|
||||
|
||||
if (Cmd->UserDmaProg)
|
||||
if (Cmd->UserDmaProg) {
|
||||
DmaProg = (u32)Cmd->UserDmaProg;
|
||||
else if (Cmd->GeneratedDmaProg)
|
||||
} else if (Cmd->GeneratedDmaProg) {
|
||||
DmaProg = (u32)Cmd->GeneratedDmaProg;
|
||||
}
|
||||
|
||||
if (DmaProg) {
|
||||
/* enable the interrupt */
|
||||
@ -1489,8 +1517,7 @@ int XDmaPs_Start(XDmaPs *InstPtr, unsigned int Channel,
|
||||
|
||||
Status = XDmaPs_Exec_DMAGO(InstPtr->Config.BaseAddress,
|
||||
Channel, DmaProg);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
InstPtr->Chans[Channel].DmaCmdToHw = NULL;
|
||||
Status = XST_FAILURE;
|
||||
}
|
||||
@ -1517,8 +1544,9 @@ int XDmaPs_IsActive(XDmaPs *InstPtr, unsigned int Channel)
|
||||
Xil_AssertNonvoid(InstPtr != NULL);
|
||||
|
||||
/* Need to assert Channel is in range */
|
||||
if (Channel >= XDMAPS_CHANNELS_PER_DEV)
|
||||
if (Channel >= XDMAPS_CHANNELS_PER_DEV) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
return InstPtr->Chans[Channel].DmaCmdToHw != NULL;
|
||||
}
|
||||
@ -1737,8 +1765,9 @@ static int XDmaPs_Exec_DMAKILL(u32 BaseAddr,
|
||||
WaitCount = 0;
|
||||
while ((XDmaPs_ReadReg(BaseAddr, XDMAPS_DBGSTATUS_OFFSET)
|
||||
& XDMAPS_DBGSTATUS_BUSY)
|
||||
&& (WaitCount < XDMAPS_MAX_WAIT))
|
||||
&& (WaitCount < XDMAPS_MAX_WAIT)) {
|
||||
WaitCount++;
|
||||
}
|
||||
|
||||
if (WaitCount >= XDMAPS_MAX_WAIT) {
|
||||
/* wait time out */
|
||||
@ -1925,8 +1954,9 @@ static void XDmaPs_DoneISR_n(XDmaPs *InstPtr, unsigned Channel)
|
||||
static void XDmaPs_Print_DmaProgBuf(char *Buf, int Length)
|
||||
{
|
||||
int Index;
|
||||
for (Index = 0; Index < Length; Index++)
|
||||
for (Index = 0; Index < Length; Index++) {
|
||||
xil_printf("[%x] %x\r\n", Index, Buf[Index]);
|
||||
}
|
||||
|
||||
}
|
||||
/****************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps.h
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -60,6 +61,7 @@
|
||||
* 2.4 adk 13/08/18 Fixed armcc compiler warnings in the driver CR-1008310.
|
||||
* 2.8 sk 05/18/21 Modify all inline functions declarations from extern inline
|
||||
* to static inline to avoid the linkage conflict for IAR compiler.
|
||||
* 2.9 aj 11/07/23 Added support for system device tree
|
||||
* </pre>
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -88,8 +90,19 @@ extern "C" {
|
||||
* This typedef contains configuration information for the device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
u32 BaseAddress; /**< Base address of device (IPIF) */
|
||||
|
||||
#ifdef SDT
|
||||
u32 IntrId[9]; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XDmaPs_Config;
|
||||
|
||||
|
||||
@ -312,7 +325,12 @@ void XDmaPs_FaultISR(XDmaPs *InstPtr);
|
||||
/*
|
||||
* Static loopup function implemented in xdmaps_sinit.c
|
||||
*/
|
||||
#ifndef SDT
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(UINTPTR BaseAddress);
|
||||
u32 XDmaPs_GetDrvIndex(XDmaPs *InstancePtr, UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_g.c
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains a configuration table where each entry is a configuration
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_hw.c
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the implementation of the interface reset functionality
|
||||
@ -70,8 +71,9 @@ void XDmaPs_ResetHw(u32 BaseAddress)
|
||||
for (ChanIndex = 0; ChanIndex < XDMAPS_CHANNELS_PER_DEV; ChanIndex++) {
|
||||
while ((XDmaPs_ReadReg(BaseAddress, XDMAPS_DBGSTATUS_OFFSET)
|
||||
& XDMAPS_DBGSTATUS_BUSY)
|
||||
&& (WaitCount < XDMAPS_MAX_WAIT))
|
||||
&& (WaitCount < XDMAPS_MAX_WAIT)) {
|
||||
WaitCount++;
|
||||
}
|
||||
|
||||
DbgInst = XDmaPs_DBGINST0(0, 0x01, ChanIndex, 1);
|
||||
XDmaPs_WriteReg(BaseAddress, XDMAPS_DBGINST0_OFFSET, DbgInst);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_hw.h
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains the hardware interface of an XDmaPs device.
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_selftest.c
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the self-test functions for the XDmaPs driver.
|
||||
@ -71,14 +72,16 @@ int XDmaPs_SelfTest(XDmaPs *InstPtr)
|
||||
int i;
|
||||
|
||||
if (XDmaPs_ReadReg(BaseAddr, XDMAPS_DBGSTATUS_OFFSET)
|
||||
& XDMAPS_DBGSTATUS_BUSY)
|
||||
& XDMAPS_DBGSTATUS_BUSY) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < XDMAPS_CHANNELS_PER_DEV; i++) {
|
||||
if (XDmaPs_ReadReg(BaseAddr,
|
||||
XDmaPs_CSn_OFFSET(i)))
|
||||
XDmaPs_CSn_OFFSET(i))) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
}
|
||||
return XST_SUCCESS;
|
||||
}
|
||||
/** @} */
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,10 +8,10 @@
|
||||
/**
|
||||
*
|
||||
* @file xdmaps_sinit.c
|
||||
* @addtogroup dmaps_v2_8
|
||||
* @addtogroup dmaps Overview
|
||||
* @{
|
||||
*
|
||||
* The implementation of the XDmaPs driver's static initialzation
|
||||
* The implementation of the XDmaPs driver's static initialization
|
||||
* functionality.
|
||||
*
|
||||
* <pre>
|
||||
@ -26,7 +27,9 @@
|
||||
/***************************** Include Files ********************************/
|
||||
|
||||
#include "xstatus.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
#include "xdmaps.h"
|
||||
|
||||
/************************** Constant Definitions ****************************/
|
||||
@ -60,6 +63,7 @@ extern XDmaPs_Config XDmaPs_ConfigTable[];
|
||||
* None.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef SDT
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(u16 DeviceId)
|
||||
{
|
||||
XDmaPs_Config *CfgPtr = NULL;
|
||||
@ -75,4 +79,34 @@ XDmaPs_Config *XDmaPs_LookupConfig(u16 DeviceId)
|
||||
|
||||
return CfgPtr;
|
||||
}
|
||||
#else
|
||||
XDmaPs_Config *XDmaPs_LookupConfig(UINTPTR BaseAddress)
|
||||
{
|
||||
XDmaPs_Config *CfgPtr = NULL;
|
||||
int i;
|
||||
|
||||
for (i = (u32)0x0; XDmaPs_ConfigTable[i].Name != NULL; i++) {
|
||||
if ((XDmaPs_ConfigTable[i].BaseAddress == BaseAddress) ||
|
||||
!BaseAddress) {
|
||||
CfgPtr = &XDmaPs_ConfigTable[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CfgPtr;
|
||||
}
|
||||
|
||||
u32 XDmaPs_GetDrvIndex(XDmaPs *InstancePtr, UINTPTR BaseAddress)
|
||||
{
|
||||
u32 Index = 0;
|
||||
|
||||
for (Index = (u32)0x0; XDmaPs_ConfigTable[Index].Name != NULL; Index++) {
|
||||
if ((XDmaPs_ConfigTable[Index].BaseAddress == BaseAddress)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Index;
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* The XEmacPs driver. Functions in this file are the minimum required functions
|
||||
@ -85,12 +86,21 @@ LONG XEmacPs_CfgInitialize(XEmacPs *InstancePtr, XEmacPs_Config * CfgPtr,
|
||||
Xil_AssertNonvoid(CfgPtr != NULL);
|
||||
|
||||
/* Set device base address and ID */
|
||||
#ifndef SDT
|
||||
InstancePtr->Config.DeviceId = CfgPtr->DeviceId;
|
||||
#endif
|
||||
InstancePtr->Config.BaseAddress = EffectiveAddress;
|
||||
InstancePtr->Config.IsCacheCoherent = CfgPtr->IsCacheCoherent;
|
||||
#ifdef SDT
|
||||
InstancePtr->Config.IntrId = CfgPtr->IntrId;
|
||||
InstancePtr->Config.IntrParent = CfgPtr->IntrParent;
|
||||
#endif
|
||||
#if defined (XCLOCKING)
|
||||
InstancePtr->Config.RefClk = CfgPtr->RefClk;
|
||||
#endif
|
||||
#ifdef SDT
|
||||
InstancePtr->Config.PhyType = CfgPtr->PhyType;
|
||||
#endif
|
||||
|
||||
InstancePtr->Config.S1GDiv0 = CfgPtr->S1GDiv0;
|
||||
InstancePtr->Config.S1GDiv1 = CfgPtr->S1GDiv1;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
@ -508,12 +509,25 @@ typedef void (*XEmacPs_ErrHandler) (void *CallBackRef, u8 Direction,
|
||||
* This typedef contains configuration information for a device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifdef SDT
|
||||
char *Name; /**< Unique name of the device */
|
||||
#else
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#endif
|
||||
UINTPTR BaseAddress;/**< Physical base address of IPIF registers */
|
||||
u8 IsCacheCoherent; /**< Applicable only to A53 in EL1 mode;
|
||||
* describes whether Cache Coherent or not */
|
||||
#if defined (XCLOCKING)
|
||||
#ifdef SDT
|
||||
u16 IntrId;
|
||||
UINTPTR IntrParent;
|
||||
#endif
|
||||
#if defined (XCLOCKING) || defined (SDT)
|
||||
u32 RefClk; /**< Input clock */
|
||||
#endif
|
||||
#ifdef SDT
|
||||
char *PhyType; /**< PhyType indicates which type of PHY interface is
|
||||
* used (MII, GMII, RGMII, etc.
|
||||
*/
|
||||
#endif
|
||||
u16 S1GDiv0; /**< 1Gbps Clock Divider 0 */
|
||||
u8 S1GDiv1; /**< 1Gbps Clock Divider 1 */
|
||||
@ -797,7 +811,12 @@ void XEmacPs_SetQueuePtr(XEmacPs *InstancePtr, UINTPTR QPtr, u8 QueueNum,
|
||||
/*
|
||||
* Lookup configuration in xemacps_sinit.c
|
||||
*/
|
||||
|
||||
#ifndef SDT
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(UINTPTR BaseAddress);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interrupt-related functions in xemacps_intr.c
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_bd.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This header provides operations to manage buffer descriptors in support
|
||||
@ -45,6 +46,7 @@
|
||||
* 3.2 hk 11/18/15 Change BD typedef and number of words.
|
||||
* 3.8 hk 08/18/18 Remove duplicate definition of XEmacPs_BdSetLength
|
||||
* 3.8 mus 11/05/18 Support 64 bit DMA addresses for Microblaze-X platform.
|
||||
* 3.9 aj 22/03/24 Add mask for XEmaPs_BdGetBufAddr
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -239,11 +241,11 @@ typedef u32 XEmacPs_Bd[XEMACPS_BD_NUM_WORDS];
|
||||
*****************************************************************************/
|
||||
#if defined(__aarch64__) || defined(__arch64__)
|
||||
#define XEmacPs_BdGetBufAddr(BdPtr) \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) | \
|
||||
((XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK) | \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_HI_OFFSET)) << 32U)
|
||||
#else
|
||||
#define XEmacPs_BdGetBufAddr(BdPtr) \
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET))
|
||||
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_bdring.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This file implements buffer descriptor ring related functions.
|
||||
@ -676,12 +677,13 @@ u32 XEmacPs_BdRingFromHwTx(XEmacPs_BdRing * RingPtr, u32 BdLimit,
|
||||
BdPartialCount = 0U;
|
||||
}
|
||||
|
||||
/* Move on to next BD in work group */
|
||||
CurBdPtr = XEmacPs_BdRingNext(RingPtr, CurBdPtr);
|
||||
|
||||
/* Reached the end of the work group */
|
||||
if (CurBdPtr == RingPtr->HwTail) {
|
||||
break;
|
||||
}
|
||||
/* Move on to next BD in work group */
|
||||
CurBdPtr = XEmacPs_BdRingNext(RingPtr, CurBdPtr);
|
||||
}
|
||||
|
||||
/* Subtract off any partial packet BDs found */
|
||||
@ -822,13 +824,13 @@ u32 XEmacPs_BdRingFromHwRx(XEmacPs_BdRing * RingPtr, u32 BdLimit,
|
||||
BdPartialCount++;
|
||||
}
|
||||
|
||||
/* Move on to next BD in work group */
|
||||
CurBdPtr = XEmacPs_BdRingNext(RingPtr, CurBdPtr);
|
||||
|
||||
/* Reached the end of the work group */
|
||||
if (CurBdPtr == RingPtr->HwTail) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Move on to next BD in work group */
|
||||
CurBdPtr = XEmacPs_BdRingNext(RingPtr, CurBdPtr);
|
||||
}
|
||||
|
||||
/* Subtract off any partial packet BDs found */
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_bdring.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* The Xiline EmacPs Buffer Descriptor ring driver. This is part of EmacPs
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2009 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_control.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* Functions in this file implement general purpose command and control related
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_g.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains a configuration table that specifies the configuration of
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_hw.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains the implementation of the ethernet interface reset sequence
|
||||
|
@ -8,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_hw.h
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This header file contains identifiers and low-level driver functions (or
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_intr.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* Functions in this file implement general purpose interrupt processing related
|
||||
@ -228,7 +229,7 @@ void XEmacPs_IntrHandler(void *XEmacPsPtr)
|
||||
|
||||
/* Transmit error conditions interrupt */
|
||||
if (((RegISR & XEMACPS_IXR_TX_ERR_MASK) != 0x00000000U) &&
|
||||
(!(RegISR & XEMACPS_IXR_TXCOMPL_MASK) != 0x00000000U)) {
|
||||
((!(RegISR & XEMACPS_IXR_TXCOMPL_MASK)) != 0x00000000U)) {
|
||||
/* Clear TX status register */
|
||||
RegSR = XEmacPs_ReadReg(InstancePtr->Config.BaseAddress,
|
||||
XEMACPS_TXSR_OFFSET);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2010 - 2022 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
/**
|
||||
*
|
||||
* @file xemacps_sinit.c
|
||||
* @addtogroup emacps_v3_16
|
||||
* @addtogroup emacps Overview
|
||||
* @{
|
||||
*
|
||||
* This file contains lookup method by device ID when success, it returns
|
||||
@ -27,7 +28,9 @@
|
||||
/***************************** Include Files *********************************/
|
||||
|
||||
#include "xemacps.h"
|
||||
#ifndef SDT
|
||||
#include "xparameters.h"
|
||||
#endif
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
|
||||
@ -35,7 +38,11 @@
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
/*************************** Variable Definitions *****************************/
|
||||
#ifdef SDT
|
||||
extern XEmacPs_Config XEmacPs_ConfigTable[];
|
||||
#else
|
||||
extern XEmacPs_Config XEmacPs_ConfigTable[XPAR_XEMACPS_NUM_INSTANCES];
|
||||
#endif
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
|
||||
@ -54,6 +61,22 @@ extern XEmacPs_Config XEmacPs_ConfigTable[XPAR_XEMACPS_NUM_INSTANCES];
|
||||
* device ID, or NULL if no match is found.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifdef SDT
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(UINTPTR BaseAddress)
|
||||
{
|
||||
XEmacPs_Config *CfgPtr = NULL;
|
||||
u32 Index;
|
||||
/* Checks all the instances */
|
||||
for (Index = (u32)0x0; XEmacPs_ConfigTable[Index].Name != NULL; Index++) {
|
||||
if ((XEmacPs_ConfigTable[Index].BaseAddress == BaseAddress) ||
|
||||
!BaseAddress) {
|
||||
CfgPtr = &XEmacPs_ConfigTable[Index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (XEmacPs_Config *)(CfgPtr);
|
||||
}
|
||||
#else
|
||||
XEmacPs_Config *XEmacPs_LookupConfig(u16 DeviceId)
|
||||
{
|
||||
XEmacPs_Config *CfgPtr = NULL;
|
||||
@ -68,4 +91,5 @@ XEmacPs_Config *XEmacPs_LookupConfig(u16 DeviceId)
|
||||
|
||||
return (XEmacPs_Config *)(CfgPtr);
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
* as Pointer to const,Casting operation to a pointer,
|
||||
* Literal value requires a U suffix.
|
||||
* 3.5 sne 03/13/19 Added Versal support.
|
||||
* 3.12 gm 07/11/23 Added SDT support.
|
||||
* 3.13 gm 03/15/24 Added multi-core interrupt support.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -89,7 +92,9 @@ s32 XGpioPs_CfgInitialize(XGpioPs *InstancePtr, const XGpioPs_Config *ConfigPtr,
|
||||
*/
|
||||
InstancePtr->IsReady = 0U;
|
||||
InstancePtr->GpioConfig.BaseAddr = EffectiveAddr;
|
||||
#ifndef SDT
|
||||
InstancePtr->GpioConfig.DeviceId = ConfigPtr->DeviceId;
|
||||
#endif
|
||||
InstancePtr->Handler = (XGpioPs_Handler)StubHandler;
|
||||
InstancePtr->Platform = XGetPlatform_Info();
|
||||
|
||||
@ -176,6 +181,7 @@ s32 XGpioPs_CfgInitialize(XGpioPs *InstancePtr, const XGpioPs_Config *ConfigPtr,
|
||||
((u32)(i) * XGPIOPS_REG_MASK_OFFSET) +
|
||||
XGPIOPS_INTDIS_OFFSET, 0xFFFFFFFFU);
|
||||
}
|
||||
InstancePtr->CoreIntrMask[i] = 0;
|
||||
}
|
||||
|
||||
/* Indicate the component is now ready to use. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -124,6 +124,11 @@
|
||||
* 3.8 sne 09/17/20 Added description for Versal PS and PMC GPIO pins.
|
||||
* 3.9 sne 03/15/21 Fixed MISRA-C violations.
|
||||
* 3.11 sg 02/23/23 Update bank and pin mapping information.
|
||||
* 3.12 gm 07/11/23 Added SDT support.
|
||||
* 3.13 gm 03/15/24 Remove const of XGpioPs InstancePtr from function proto
|
||||
* type of XGpioPs_IntrEnable, XGpioPs_IntrDisable,
|
||||
* XGpioPs_IntrEnablePin and XGpioPs_IntrDisablePin
|
||||
* to add multi-core interrupt support.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -167,6 +172,7 @@ extern "C" {
|
||||
* Zynq Ultrascale+ MP GPIO device
|
||||
*/
|
||||
#define XGPIOPS_MAX_BANKS 0x04U /**< Max banks in a Zynq GPIO device */
|
||||
#define XGPIOPS_MAX_BANKS_CNT 0x06U /**< Max banks number of all platforms */
|
||||
|
||||
#define XGPIOPS_DEVICE_MAX_PIN_NUM_ZYNQMP (u32)174 /**< Max pins in the
|
||||
* Zynq Ultrascale+ MP GPIO device
|
||||
@ -209,8 +215,18 @@ typedef void (*XGpioPs_Handler) (void *CallBackRef, u32 Bank, u32 Status);
|
||||
* This typedef contains configuration information for a device.
|
||||
*/
|
||||
typedef struct {
|
||||
#ifndef SDT
|
||||
u16 DeviceId; /**< Unique ID of device */
|
||||
#else
|
||||
char *Name;
|
||||
#endif
|
||||
UINTPTR BaseAddr; /**< Register base address */
|
||||
#ifdef SDT
|
||||
u16 IntrId; /** Bits[11:0] Interrupt-id Bits[15:12]
|
||||
* trigger type and level flags */
|
||||
UINTPTR IntrParent; /** Bit[0] Interrupt parent type Bit[64/32:1]
|
||||
* Parent base address */
|
||||
#endif
|
||||
} XGpioPs_Config;
|
||||
|
||||
/**
|
||||
@ -227,6 +243,7 @@ typedef struct {
|
||||
u32 MaxPinNum; /**< Max pins in the GPIO device */
|
||||
u8 MaxBanks; /**< Max banks in a GPIO device */
|
||||
u32 PmcGpio; /**< Flag for accessing PS GPIO for versal*/
|
||||
u32 CoreIntrMask[XGPIOPS_MAX_BANKS_CNT]; /**< Interrupt mask per core */
|
||||
} XGpioPs;
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
@ -262,12 +279,12 @@ void XGpioPs_SetOutputEnablePin(const XGpioPs *InstancePtr, u32 Pin, u32 OpEnabl
|
||||
u32 XGpioPs_GetOutputEnablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
/* Diagnostic functions in xgpiops_selftest.c */
|
||||
s32 XGpioPs_SelfTest(const XGpioPs *InstancePtr);
|
||||
s32 XGpioPs_SelfTest(XGpioPs *InstancePtr);
|
||||
|
||||
/* Functions in xgpiops_intr.c */
|
||||
/* Bank APIs in xgpiops_intr.c */
|
||||
void XGpioPs_IntrEnable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrDisable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrEnable(XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
void XGpioPs_IntrDisable(XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
u32 XGpioPs_IntrGetEnabled(const XGpioPs *InstancePtr, u8 Bank);
|
||||
u32 XGpioPs_IntrGetStatus(const XGpioPs *InstancePtr, u8 Bank);
|
||||
void XGpioPs_IntrClear(const XGpioPs *InstancePtr, u8 Bank, u32 Mask);
|
||||
@ -283,14 +300,18 @@ void XGpioPs_IntrHandler(const XGpioPs *InstancePtr);
|
||||
void XGpioPs_SetIntrTypePin(const XGpioPs *InstancePtr, u32 Pin, u8 IrqType);
|
||||
u8 XGpioPs_GetIntrTypePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
void XGpioPs_IntrEnablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrDisablePin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrEnablePin(XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrDisablePin(XGpioPs *InstancePtr, u32 Pin);
|
||||
u32 XGpioPs_IntrGetEnabledPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
u32 XGpioPs_IntrGetStatusPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
void XGpioPs_IntrClearPin(const XGpioPs *InstancePtr, u32 Pin);
|
||||
|
||||
/* Functions in xgpiops_sinit.c */
|
||||
#ifndef SDT
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u16 DeviceId);
|
||||
#else
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u32 BaseAddress);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2013 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
* 3.5 sne 03/20/19 Fixed multiple interrupts problem CR#1024556.
|
||||
* 3.6 sne 06/12/19 Fixed IAR compiler warning.
|
||||
* 3.6 sne 08/14/19 Added interrupt handler support on versal.
|
||||
* 3.13 gm 03/15/24 Added multi-core interrupt support.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
@ -71,7 +72,7 @@
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void XGpioPs_IntrEnable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
void XGpioPs_IntrEnable(XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
{
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
|
||||
@ -87,6 +88,9 @@ void XGpioPs_IntrEnable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
XGpioPs_WriteReg(InstancePtr->GpioConfig.BaseAddr,
|
||||
((u32)(Bank) * XGPIOPS_REG_MASK_OFFSET) +
|
||||
XGPIOPS_INTEN_OFFSET, Mask);
|
||||
|
||||
/* Setup mask for CPU */
|
||||
InstancePtr->CoreIntrMask[Bank] |= Mask;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@ -102,7 +106,7 @@ void XGpioPs_IntrEnable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void XGpioPs_IntrEnablePin(const XGpioPs *InstancePtr, u32 Pin)
|
||||
void XGpioPs_IntrEnablePin(XGpioPs *InstancePtr, u32 Pin)
|
||||
{
|
||||
u8 Bank;
|
||||
u8 PinNumber;
|
||||
@ -123,6 +127,9 @@ void XGpioPs_IntrEnablePin(const XGpioPs *InstancePtr, u32 Pin)
|
||||
XGpioPs_WriteReg(InstancePtr->GpioConfig.BaseAddr,
|
||||
((u32)(Bank) * XGPIOPS_REG_MASK_OFFSET) +
|
||||
XGPIOPS_INTEN_OFFSET, IntrReg);
|
||||
|
||||
/* Setup mask for CPU */
|
||||
InstancePtr->CoreIntrMask[Bank] |= IntrReg;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@ -142,7 +149,7 @@ void XGpioPs_IntrEnablePin(const XGpioPs *InstancePtr, u32 Pin)
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void XGpioPs_IntrDisable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
void XGpioPs_IntrDisable(XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
{
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
|
||||
@ -158,6 +165,9 @@ void XGpioPs_IntrDisable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
XGpioPs_WriteReg(InstancePtr->GpioConfig.BaseAddr,
|
||||
((u32)(Bank) * XGPIOPS_REG_MASK_OFFSET) +
|
||||
XGPIOPS_INTDIS_OFFSET, Mask);
|
||||
|
||||
/* Setup mask for CPU */
|
||||
InstancePtr->CoreIntrMask[Bank] &= ~Mask;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@ -173,7 +183,7 @@ void XGpioPs_IntrDisable(const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
|
||||
* @note None.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void XGpioPs_IntrDisablePin(const XGpioPs *InstancePtr, u32 Pin)
|
||||
void XGpioPs_IntrDisablePin(XGpioPs *InstancePtr, u32 Pin)
|
||||
{
|
||||
u8 Bank;
|
||||
u8 PinNumber;
|
||||
@ -194,6 +204,9 @@ void XGpioPs_IntrDisablePin(const XGpioPs *InstancePtr, u32 Pin)
|
||||
XGpioPs_WriteReg(InstancePtr->GpioConfig.BaseAddr,
|
||||
((u32)(Bank) * XGPIOPS_REG_MASK_OFFSET) +
|
||||
XGPIOPS_INTDIS_OFFSET, IntrReg);
|
||||
|
||||
/* Setup mask for CPU */
|
||||
InstancePtr->CoreIntrMask[Bank] &= ~IntrReg;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@ -735,6 +748,7 @@ void XGpioPs_SetCallbackHandler(XGpioPs *InstancePtr, void *CallBackRef,
|
||||
void XGpioPs_IntrHandler(const XGpioPs *InstancePtr)
|
||||
{
|
||||
u8 Bank;
|
||||
u32 Mask;
|
||||
u32 IntrStatus;
|
||||
u32 IntrEnabled;
|
||||
|
||||
@ -755,12 +769,12 @@ void XGpioPs_IntrHandler(const XGpioPs *InstancePtr)
|
||||
#endif
|
||||
IntrStatus = XGpioPs_IntrGetStatus(InstancePtr, Bank);
|
||||
IntrEnabled = XGpioPs_IntrGetEnabled(InstancePtr,Bank);
|
||||
if ((IntrStatus & IntrEnabled) != (u32)0) {
|
||||
XGpioPs_IntrClear(InstancePtr, Bank,
|
||||
(IntrStatus & IntrEnabled));
|
||||
InstancePtr->Handler(InstancePtr->
|
||||
CallBackRef, Bank,
|
||||
(IntrStatus & IntrEnabled));
|
||||
Mask = IntrStatus & IntrEnabled & InstancePtr->CoreIntrMask[Bank];
|
||||
|
||||
if (Mask != (u32)0)
|
||||
{
|
||||
XGpioPs_IntrClear(InstancePtr, Bank, Mask);
|
||||
InstancePtr->Handler(InstancePtr->CallBackRef, Bank, Mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2024 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
s32 XGpioPs_SelfTest(const XGpioPs *InstancePtr)
|
||||
s32 XGpioPs_SelfTest(XGpioPs *InstancePtr)
|
||||
{
|
||||
s32 Status = (s32)0;
|
||||
u32 IntrEnabled;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All Rights Reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
******************************************************************************/
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
* ----- ---- -------- -----------------------------------------------
|
||||
* 1.00a sv 01/15/10 First Release
|
||||
* 3.00 kvn 02/13/15 Modified code for MISRA-C:2012 compliance.
|
||||
* 3.12 gm 07/11/23 Added SDT support.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -57,6 +59,7 @@
|
||||
* @note None.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef SDT
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u16 DeviceId)
|
||||
{
|
||||
XGpioPs_Config *CfgPtr = NULL;
|
||||
@ -71,4 +74,21 @@ XGpioPs_Config *XGpioPs_LookupConfig(u16 DeviceId)
|
||||
|
||||
return (XGpioPs_Config *)CfgPtr;
|
||||
}
|
||||
#else
|
||||
XGpioPs_Config *XGpioPs_LookupConfig(u32 BaseAddress)
|
||||
{
|
||||
XGpioPs_Config *CfgPtr = NULL;
|
||||
u32 Index;
|
||||
|
||||
for (Index = (u32)0x0; XGpioPs_ConfigTable[Index].Name != NULL; Index++) {
|
||||
if ((XGpioPs_ConfigTable[Index].BaseAddr == BaseAddress) ||
|
||||
!BaseAddress) {
|
||||
CfgPtr = &XGpioPs_ConfigTable[Index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (XGpioPs_Config *)CfgPtr;
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user