Re: [PATCH v5 3/9] spi: support controllers with multiple data lanes

Andy Shevchenko
2026-01-12T19:07:23Z

On Mon, Jan 12, 2026 at 11:45:21AM -0600, David Lechner wrote:
> Add support for SPI controllers with multiple physical SPI data lanes.
> (A data lane in this context means lines connected to a serializer, so a
> controller with two data lanes would have two serializers in a single
> controller).
>
> This is common in the type of controller that can be used with parallel
> flash memories, but can be used for general purpose SPI as well.
>
> To indicate support, a controller just needs to set ctlr->num_data_lanes
> to something greater than 1. Peripherals indicate which lane they are
> connected to via device tree (ACPI support can be added if needed).
>
> The spi-{tx,rx}-bus-width DT properties can now be arrays. The length of
> the array indicates the number of data lanes, and each element indicates
> the bus width of that lane. For now, we restrict all lanes to have the
> same bus width to keep things simple. Support for an optional controller
> lane mapping property is also implemented.

...

> struct spi_device {

> + /* Multi-lane SPI controller support. */
> + u32 tx_lane_map[SPI_DEVICE_DATA_LANE_CNT_MAX];
> + u32 num_tx_lanes;
> + u32 rx_lane_map[SPI_DEVICE_DATA_LANE_CNT_MAX];
> + u32 num_rx_lanes;

This adds 72 bytes in _each_ instance of spi_device on the platforms that do
not use the feature and might not ever use it. Can we move to the pointer
and allocate the mentioned fields separately, please?

--
With Best Regards,
Andy Shevchenko