-
Notifications
You must be signed in to change notification settings - Fork 7
Ubuntu Core enablement changes #6
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
base: xlnx_rel_v2025.2
Are you sure you want to change the base?
Conversation
1088fc4 to
2891143
Compare
|
@artiepoole Thanks for reporting these, we will check and get back on these |
|
@sivadur Thank you for the haste! I created this as a draft. There have been some tweaks since creation, so please take these into account during assessment. I have now tested it more thoroughly and have marked this as "ready for review" |
2891143 to
7d1a593
Compare
|
do we have any update on review @sivadur ? |
|
Hey @sivadur, On the dfx-mgr side of things, it was suggested that we should remove the state.txt file completely and instead do the comparisons handled by state.txt using C, instead of using the shell via system commands. If you agree, I would like to make those changes in this PR as well. |
|
Hi @artiepoole , Agree with removing dependency on state.txt file in libdfx and directly reading contents of |
|
Thanks @arthokal, I'll go ahead and implement this then Is there any objection to adding |
|
To save you having to explore: DFX_DBG example: DFX_ERR example: Current libdfx print example: |
|
Regarding addition of DFX_DBG and DFX_ERR equivalent macros to libdfx, we can take these in a separate PR. |
…tion Use `/sys/kernel/config/device-tree/overlays/` insted of remounting Signed-off-by: Artie Poole <stuart.poole@canonical.com>
7d1a593 to
2470702
Compare
the kernel provides a mechanism to set where firmware loads will look to match filenames during probe events. This file is located at `/sys/module/firmware_class/parameters/path`. These changes remove the need for copying firmware files into /lib/firmware. The /lib/firmware location is still probed if the file is not found in the custom location. See https://docs.kernel.org/driver-api/firmware/fw_search_path.html for more information. Signed-off-by: Artie Poole <stuart.poole@canonical.com>
73426df to
50a362b
Compare
|
Please be aware that I am unable to test I have made the changes to remove the need for P.S. dfx-mgr has been adjusted to use the functions I exposed in libdfx.h to save duplication |
this made it preferable to implement several helper functions which are convenient to export for use in dfx-mgr. define debugging macros Signed-off-by: Artie Poole <stuart.poole@canonical.com>
50a362b to
361b434
Compare
Adds docs for functions: - dfx_set_firmware_search_path - dfx_get_fpga_state - dfx_set_overlay_path - dfx_set_fpga_firmware - dfx_set_fpga_flags - dfx_set_fpga_key - dfx_get_overlay_path - dfx_get_overlay_status Signed-off-by: Artie Poole <stuart.poole@canonical.com>
|
Thanks for spotting those mistakes and missing README changes. Best, |
arthokal
left a comment
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.
Changes looks fine to me.
@NavaKishoreManne, please review and approve if changes looks fine.
arthokal
left a comment
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.
With these changes, we tested libdfx application from our end including dfx_cfg_drivers_load. Testing looks good.
Approving from my end. Let @sivadur review too and approve.
Thank you,
Aravind.
|
I see all parties agreed, do we know when we would have this merged? |
|
Hi @talhaHavadar |
In an ongoing attempt to enable fpga device functionality in Ubuntu Core, three issues have arisen in relation to the requirement for snaps to be strictly confined. In our case, we are attempting to redistribute dfx-mgr (and libdfx) as part of FPGAd. Once the concept of "softeners" is in place, this snap will enable downstream customers to use dfx-mgr as they expect to be able to, but with the caveat that FPGAd will be the gatekeeper for accessing the FPGA subsystems.
In these efforts, we found three challenges in the way dfx-mgr and libdfx operate:
state.txt. In real operation, this file is created at/state.txtwhich is not allowed in a strictly confined snap, and no layout can be applied to files in the root directory, except as files inside known pre-defined directories./configfs. This mount call requires strong permissions, which the store team can't/wont to grant to the fpgad snap.In order to tackle these three problems, I have edited dfx-mgr and libdfx with the following solutions:
for libdfx, state.txt is now moved toC stdlib io operations are used to write into internal buffers instead of relying on state.txt, generated using system calls. Several of the functions are exported for use in dfx-mgr (and similar) to save duplication./etc/dfx/state.txt/run/dfx/state.txt. I would actually prefer to remove the "system(command)" calls to mitigate the need for this file at all, but that is out of scope here./lib/firmware, the containing directory is written to/sys/module/firmware_class/parameters/pathinstead. This is exported for use by dfx-mgr to save duplication./configfsare removed, and all paths pointing to "/configfs/" are replaced by/sys/kernel/config/Please see Xilinx/dfx-mgr#12 for the dfx-mgr changes
Please do not hesitate to suggest changes or ask for clarification.