Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pajgaonk
Copy link

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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8088850712

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 64.688%

Totals Coverage Status
Change from base Build 8041155286: 0.0%
Covered Lines: 15820
Relevant Lines: 24456

💛 - 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";
Copy link
Contributor

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];
Copy link
Contributor

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];
Copy link
Contributor

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) {
Copy link
Contributor

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");
Copy link
Contributor

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){
Copy link
Contributor

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,
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants