Open
Description
Introduction
Currently it is not possible to have multiple ICE40 on the same SPI bus, as described in #77983. The reason for this is the necessity in some cases to do some bitbanging instead of real SPI to get the timing right. To do so the ICE40 driver currently instantiates the pinctrl config from its parent, the SPI master, which will create a name collision if multiple ICE40 are on the same SPI bus.
Proposed change
There are several options how this problem can be addressed:
- Extend the SPI driver API with a function which resets or reapplies the pinctrl config. This was already proposed in Enable multiple ICE40 on the same bus #77980 and rejected by the SPI maintainer.
Implement a Kconfig which selects the available load modes (SPI and GPIO bitbang). This will then reduce the impact of the issue, as MCUs on which the GPIO bitbang mode is not required can then use multiple ICE40 on the same bus. But it won't solve it completely.- obsolete due to the merge of optional load modes for iCE40 #80854- Implement some peripheral deallocation/allocation mechanism, like in Support peripheral deallocation at runtime #20012. This would definitely resolve the issue, but it hasn't gotten much traction since its creation in 2019.
- Modify the pinctrl macros to avoid the name collision. This would resolve the issue, but the pinctrl maintainer hasn't been too fond of the general idea that a foreign device modifies the pinctrl anyway.
This issue has already been discussed in the Dev-WG and the decision there was to try find a bigger audience to get more inputs. Therefore, I'm absolutely glad for ideas on how I can proceed. It is a nasty bug, which we should definitely get rid of in the long run.
Metadata
Metadata
Assignees
Type
Projects
Status
No status
Status
In Progress