-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Vendor-specific APIs in Zephyr #91373
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
Comments
We could end up having vendor-specific APIs that are not tied to a SoC, but rather a peripheral IC. |
Sure, I had not covered that specific case, but is it common? Do you think we will actually find one of those? Have we seen one so far, or are all external ICs documented and generic to all SoCs? |
Hmm, not a fan of this, include/zephyr should not have any vendor specific APIs that are exposed as Zephyr public APIs and would never have a chance of following our API lifecycles, because they will be experimental for the entirty of their existence. If something, on arrival, can't evolve through the API life cycle, then it should not be exposed as a Zephyr API. The only reason I would consider drivers/soc/ is to be able to share across a vast number of hardware which might get problematic inside soc/. But we could consider a parallel to
IMO this is cleanest solution for things that we know for sure will not evolve into something generic, if something like this happens and there are more vendors introducing somethig similar, that is where we will consider creating a new driver class and moving things out of soc/ into drivers/. Here is an example, intel adsp IPC, see https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h and https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/intel/intel_adsp/common/ipc.c This was introduced as part of the SoC, whether that was the right thing to do at the time, is a question for another discussion. it is not available as public API, completely contained and does not touch anyone else and part of the SoC, i.e if I drop the SoC, it goes away with it, completely managed by the vendor, does not have to go through some API lifecycle or review etc. etc, however, all of that said, years later you realize it was the wrtong thing to do, and now there is an effor to move this to use some public IPC Zephyr APIs (that came later I think) and use the same approach in SOF by other vendors, who happen to do things in different ways.
I think this is an option we should explore and should be the first choice if something has potential or it is not clear yet, how it evolves and their it is feasible to abstract it and build on top of it. so, in the right order:
|
here are the draft slides i was sharing yesterday in the arch WG meeting: https://docs.google.com/presentation/d/1URk28GanuvnKC9FBxkDzOMnDtbD62dCTGOlhTGpqipI/edit?usp=sharing |
Thanks @nashif for the proposal. I will start a PR based on this and other thoughts I have and we can continue there. |
I meant something like what we saw in #69920 - a driver for an external/peripheral IC, which doesn't really fit into any of the existing driver subsystems. This IC is not a SoC, so placing it's driver under |
We already have a few for these. For example there are Nordic specific functions for qspi to enable XIP (
Also Flash API defines ex_op callback that allows to define vendor specific operations, without extending the API dispatch structure. I would gladly see some better way to do that, specifically the userspace support is clunky. Still, we need a way to allow vendor specific APIs, because user may want, for an app code, functionalities that we can not universally provide across devices, because these functionalities have been a reason for an user to select IC in the first place (like mem protections, etc). |
Uh oh!
There was an error while loading. Please reload this page.
Problem Description
This issue started from discussions in the following two PRs:
Which introduce similar but subtly different API types:
Proposed Change (Summary)
The options we have for the different vendor-specific APIs are:
a. Keep the headers in
include/zephyr/drivers/soc/<vendor-function>.h
and the implementation indrivers/soc/<vendor-function>.c
b. Keep both headers and implementations in
soc/<vendor>/<function>
c. Start new driver classes every time a new proposal like this comes. For example, in the case of the Renesas ELC above, a new
include/zephyr/drivers/interconnect/
could have been started that tries to generalize the API to a certain extentProposed Change (Detailed)
Not available yet.
Dependencies
No response
Concerns and Unresolved Questions
No response
Alternatives Considered
No response
The text was updated successfully, but these errors were encountered: