-
Notifications
You must be signed in to change notification settings - Fork 81
schemas: pci: Add W_DISABLE1# and VIO supply properties for M.2 slot #171
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: main
Are you sure you want to change the base?
Conversation
As per M.2 spec r4.0, add below PCI specific properties to describe a M.2 slot: 1. w-disable1-gpios: Specifies the GPIO controlled connection to W_DISABLE1# signal used for disabling the wireless radio on the M.2 card. When present, this signal is used to disable WLAN radio of the M.2 card. The spec defines one more signal, W_DISABLE2#, but that is applicable for Bluetooth only. Hence, not added here. 2. vio1v8-supply - Specifies the phandle to the VIO 1.8v regulator which supplies power to the Adapter I/O buffer circuitry operating at 1.8 V sideband signaling. Signed-off-by: Manivannan Sadhasivam <[email protected]>
This property was added to specify that the PCI bridge supports D3 state, as it cannot be discovered by the OS using PMCSR registers. This was added to use it with the PCI subsystem of Linux Kernel. But this property was never used, as the PCI subsystem in Linux Kernel decided to assume that all PCI bridges of the DT based platforms supports transitioning to D3 state by default. So remove this unused property. Signed-off-by: Manivannan Sadhasivam <[email protected]>
This is not entirely correct. The spec says it is okay to have just a single W_DISABLE1# signal, in which case it should be used to disable all the radios on a chip. In that case, you would need some kind of reference counting for the GPIO (which is sort of what the pwrseq framework in Linux could do, I suppose). An M.2 card is much more than just PCIe (or might not have PCIe at all), so I'm not sure it makes sense to model it separately as a PCIe slot. I've been recently playing with the idea of modelling an
The tricky part is that the M.2 specification leaves lots of room for vendor customization. Sometimes pins are abused for other functionality. We can't auto-discover all of the interfaces (e.g. UART). I haven't come further than defining the idea yet :-) |
Yes, I should've mentioned it as well.
That's the job of the gpiolib subsystem in Linux. Right now, it doesn't have that capability, but work is in progress.
We are not modeling the M.2 card here, just the resources pertaining to the PCIe interface of the card. We discussed the M.2 DT connector binding recently internally, too, but to me, it looked wrong as it ties the whole card functionality to a single driver as if all the resources are shared. But in reality, each interface acts independently (AFAIK). So defining the resources in the relevant DT node (PCIe, USB, UART, etc...) seemed correct to me. Even if some of the resources are shared, the software drivers should be able to keep refcount on them. But I'll defer to @robherring here on how we want to model it.
Right. Even, it allows the vendors to implement any interface of their need, not limited to the interfaces defined in the spec. In that case, the signal functionality will totally vary. |
This is the case for the Qualcomm WiFi/BT chips, but I don't think we can make any assumption about this for the general case. I don't see why a M.2 card couldn't, for example, use one firmware for all functionality on the chip (WiFi, BT, etc). In that case, the drivers would need to be aware of each other and coordinate with each other. The M.2 card is one entity that is either fully plugged in or not. The fact that the PCIe/UART/USB/... interfaces belong to this one entity should be definitely visible in the device tree through some links, in my opinion. There are also more complex power sequencing a M.2 may or may not need. For example, WWAN M.2 cards may also have a FULL_CARD_POWER_OFF# and RESET# signal that turns off/resets the entire adapter (including, presumably all interfaces used by the WWAN modem such as PCIe, USB etc). I don't think reimplementing all those signals separately in every subsystem is a good idea. I definitely see value in describing the |
Hmm, I don't disagree. Since there is a room for interpretation in the spec, we can't trust vendors.
We may see different forms of the same chip. For instance, WCN7850 may appear in a proper M.2 Key M and something else. So we might end up with a form factor specific compatible to handle these shenanigans. If we get a go from @robherring, I can do a PoC, or if you have something, we can co-work. |
I would like to explore how far we can get without hardcoding the plugged M.2 card in the device tree. On some devices, M.2 cards are easily replaceable, so having some form of auto-detection would be useful to have. Plus, for things like NVMe M.2 cards, we obviously don't want to hardcode the actual SSD. Replacing the SSD is quite common. For the WCN7850 case, a rough idea I had was to have the generic I don't have a POC for this yet and I'm not actively working on it right now. Feel free to draft something (with or without auto-discovery). The basic modelling in DT will be probably more or less the same. |
As per M.2 spec r4.0, add below PCI specific properties to describe a M.2 slot:
w-disable1-gpios: Specifies the GPIO controlled connection to W_DISABLE1# signal used for disabling the wireless radio on the M.2 card. When present, this signal is used to disable WLAN radio of the M.2 card. The spec defines one more signal, W_DISABLE2#, but that is applicable for Bluetooth only. Hence, not added here.
vio1v8-supply - Specifies the phandle to the VIO 1.8v regulator which supplies power to the Adapter I/O buffer circuitry operating at 1.8 V sideband signaling.