Skip to content

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.

@pajgaonk pajgaonk requested a review from a team as a code owner February 29, 2024 00:09
@coveralls
Copy link

coveralls commented Feb 29, 2024

Pull Request Test Coverage Report for Build 9066398665

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.65%

Totals Coverage Status
Change from base Build 8818231667: 0.0%
Covered Lines: 15825
Relevant Lines: 24478

💛 - Coveralls

#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

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

};
};
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


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


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

@pcolberg pcolberg removed their request for review March 15, 2025 03:35
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.

3 participants