-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Clarify driver vendor compatibility requirements for drivers for standalone external devices #61798
Comments
My opinion here is that unless there's a strict limitation, we should not allow these kinds of drivers. To me, this violates some Zephyr basic design principles. |
Add an item to the coding style list asking to avoid using binary literals. Link: zephyrproject-rtos#61798 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
@fabiobaltieri I think we should limit the scope of this issue to drivers for "external devices", i.e. devices that are connected via an external physical bus and that are compatible by design with any MCU or SoC. This includes:
EDIT: I see that you've already added the following:
which encapsulates my thoughts perfectly. Thanks! |
My take on this: Drivers for standalone devices that are compatible with any MCU/SoC should not be restricted to a single vendor. This is aligned with the Open Source philosophy:
The only exceptions to this would be when it makes technical sense to do so, such as:
I would also allow extensions to this approach, in the following way:
|
Yeah thanks for rewording @carlescufi, this would obviously only apply to something that goes on an external bus that is somewhat standardized. I would also add that I would not see any problem with a driver supporting multiple busses, including a vendor specific implementation (for performance reasons or whatever), as long as it's not the only one - for instance on the rpi pico this is using some odd two wire SPI implemented with the RPi PIO. That obviously has to be platform specific, but it should not be the only interface supported by an upstream driver, otherwise (as @gmarull pointed out in the original issue) the driver may as well live in the SoC HAL code base itself. |
Did you read my thoughts ? :D |
I'd not consider this a valid point, a new API can be proposed for the bus. |
In fairness that's what they are doing for the whole rpi pico PIO story. |
I disagree. It may be a very specialized bus or even one that we have no interest of supporting in-tree. |
If it's a vendor-specific bus, then yes. I'm talking about vendor-agnostic cases. |
If it's done for performance reasons, then I think it makes sense, as soon as the driver is designed in a way that allows to (1) use a generic layer or (2) is designed to be easily extensible. |
Add an item to the coding style list asking to avoid using binary literals. Link: #61798 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add an item to the coding style list asking to avoid using binary literals. (cherry picked from commit bef540b) Original-Link: zephyrproject-rtos/zephyr#61798 Original-Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> GitOrigin-RevId: bef540b Change-Id: I998a564023f614fbd05eaf767c5c5321e01912b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4810116 Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Add an item to the coding style list asking to avoid using binary literals. Link: zephyrproject-rtos#61798 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Arch WG:
Exception text: |
Reworked host agnostic version of AIROC (cyw43xx) wi-fi driver: #63721 |
Introduction
TL;DR: should we accept vendor specific drivers for devices with a vendor agnostic interface?
Problem description
Hi, this is spinning off a discussion started in #59444 (comment), the specific case is for a WiFi driver that supports multiple interfaces (SPI, SDIO, ...) that have an existing abstraction in the Zephyr code base (SPI subsystem) so that a driver could be written in a SoC agonistc way, but the proposed implementation is tied to a specific SoC vendor in this case the Cypress HAL. So while the device does not necessarily have to be paired with SoC of the same vendor and is marketed as a standalone product, the proposed implementation does not allow interoperability with any other device.
The RFC is about clarifying whether this should or should not be accepted upstream. The main issue I see is that the fact that the driver only works when paired with some specific SoC is non obvious, and certainly not expected from a system that abstracts busses and peripherals. One could imagine someone looking at the code thinking that they could design this device in with any other SOC with an SPI or SDIO interface, just to find out that the two don't work while doing the board configuration.
For this specific case the situation is particularly sad as we already have in-tree boards that could use the driver (RPI Pico W and Arduino Giga R1, STM32H7 based).
Proposed change
Clarify the requirements for upstream drivers compatibility when a device is marketed as a standalone product and uses an interface for which we already have an abstraction/subsystem.
The text was updated successfully, but these errors were encountered: