include/linux/adi-axi-common.h

Source file repositories/reference/linux-study-clean/include/linux/adi-axi-common.h

File Facts

System
Linux kernel
Corpus path
include/linux/adi-axi-common.h
Extension
.h
Size
2338 bytes
Lines
78
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/types.h>

#ifndef ADI_AXI_COMMON_H_
#define ADI_AXI_COMMON_H_

#define ADI_AXI_REG_VERSION			0x0000
#define ADI_AXI_REG_FPGA_INFO			0x001C

#define ADI_AXI_PCORE_VER(major, minor, patch)	\
	(((major) << 16) | ((minor) << 8) | (patch))

#define ADI_AXI_PCORE_VER_MAJOR(version)	(((version) >> 16) & 0xff)
#define ADI_AXI_PCORE_VER_MINOR(version)	(((version) >> 8) & 0xff)
#define ADI_AXI_PCORE_VER_PATCH(version)	((version) & 0xff)

/**
 * adi_axi_pcore_ver_gteq() - check if a version is satisfied
 * @version: the full version read from the hardware
 * @major: the major version to compare against
 * @minor: the minor version to compare against
 *
 * ADI AXI IP Cores use semantic versioning, so this can be used to check for
 * feature availability.
 *
 * Return: true if the version is greater than or equal to the specified
 *         major and minor version, false otherwise.
 */
static inline bool adi_axi_pcore_ver_gteq(u32 version, u32 major, u32 minor)
{
	return ADI_AXI_PCORE_VER_MAJOR(version) > (major) ||
	       (ADI_AXI_PCORE_VER_MAJOR(version) == (major) &&
		ADI_AXI_PCORE_VER_MINOR(version) >= (minor));
}

#define ADI_AXI_INFO_FPGA_TECH(info)            (((info) >> 24) & 0xff)
#define ADI_AXI_INFO_FPGA_FAMILY(info)          (((info) >> 16) & 0xff)
#define ADI_AXI_INFO_FPGA_SPEED_GRADE(info)     (((info) >> 8) & 0xff)

enum adi_axi_fpga_technology {
	ADI_AXI_FPGA_TECH_UNKNOWN = 0,
	ADI_AXI_FPGA_TECH_SERIES7,
	ADI_AXI_FPGA_TECH_ULTRASCALE,
	ADI_AXI_FPGA_TECH_ULTRASCALE_PLUS,
};

enum adi_axi_fpga_family {
	ADI_AXI_FPGA_FAMILY_UNKNOWN = 0,
	ADI_AXI_FPGA_FAMILY_ARTIX,
	ADI_AXI_FPGA_FAMILY_KINTEX,
	ADI_AXI_FPGA_FAMILY_VIRTEX,
	ADI_AXI_FPGA_FAMILY_ZYNQ,
};

enum adi_axi_fpga_speed_grade {
	ADI_AXI_FPGA_SPEED_UNKNOWN      = 0,
	ADI_AXI_FPGA_SPEED_1    = 10,
	ADI_AXI_FPGA_SPEED_1L   = 11,
	ADI_AXI_FPGA_SPEED_1H   = 12,
	ADI_AXI_FPGA_SPEED_1HV  = 13,
	ADI_AXI_FPGA_SPEED_1LV  = 14,
	ADI_AXI_FPGA_SPEED_2    = 20,
	ADI_AXI_FPGA_SPEED_2L   = 21,
	ADI_AXI_FPGA_SPEED_2LV  = 22,
	ADI_AXI_FPGA_SPEED_3    = 30,
};

#endif /* ADI_AXI_COMMON_H_ */

Annotation

Implementation Notes