-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Update] usrclk DFHv0 -> DFHv1 migration #3111
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 9066398665Details
💛 - Coveralls |
@@ -135,6 +135,8 @@ | |||
#define IOPLL_WRITE_POLL_TIMEOUT_US 1000000 /* Write poll timeout */ | |||
|
|||
#define USRCLK_FEATURE_ID 0x14 | |||
const char USRCLK_GUID[] = "45AC5052C481412582380B8FF6C2F943"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define GUID and Feature ID to opae-sdk/blob/master/libraries/plugins/xfpga/types_int.h
@@ -151,10 +153,29 @@ struct dfh { | |||
uint64_t type : 4; | |||
}; | |||
}; | |||
char guid_l[64]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct dfhv0 and dfhv1 sturct used by other function in xfpga , so define dfhv0 and dfhv1 in types_int.h
@@ -151,10 +153,29 @@ struct dfh { | |||
uint64_t type : 4; | |||
}; | |||
}; | |||
char guid_l[64]; | |||
char guid_h[64]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fpga_guid
is compatible with libuuid's uuid_t, so users can use libuuid
fpga_guid is defined in /include/opae/types.h
use fpga_guid varabile
}; | ||
|
||
static int using_iopll(char *sysfs_usrpath, const char *sysfs_path); | ||
|
||
bool is_file_empty(char* file_path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this function to sysfs.c
}; | ||
|
||
static int using_iopll(char *sysfs_usrpath, const char *sysfs_path); | ||
|
||
bool is_file_empty(char* file_path) { | ||
FILE *fp = fopen(file_path, "r"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check file_path is null or not
change char* file_path to const har* file_path
}; | ||
|
||
static int using_iopll(char *sysfs_usrpath, const char *sysfs_path); | ||
|
||
bool is_file_empty(char* file_path) { | ||
FILE *fp = fopen(file_path, "r"); | ||
if(fp == NULL){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return true or false
@@ -501,15 +522,20 @@ fpga_result usrclk_calibrate(uint8_t *uio_ptr, uint8_t *seq) | |||
|
|||
fpga_result get_usrclk_uio(const char *sysfs_path, | |||
uint32_t feature_id, | |||
const char* guid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define enum_fpga_feature() or find_fpga_feature() new function in common.c file, it enums fpga features and returns dfl_dev.x
Description
Added GUID support (generated using guid generation tool) as per DFHV1 spec.
Made sure update is backwards compatible and usrclk utility can be used with DFHV0 as well as DFHV1 FIM.
Reference Document - https://docs.kernel.org/fpga/dfl.html
Collateral (docs, reports, design examples, case IDs): https://hsdes.intel.com/appstore/article/#/14019248776 (DFHv1 Key IP Driver Support)
Tests run:
usrclk utility on DFHV0 FIM and usrclk utility on DFHV1 FIM.
DFHV1 FIM is special test FIM created by OFS hardware team ,with RAM where we can poke DFHV1 headers.