lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f57e41f-3534-4188-ae78-d323aa45e2a1@baylibre.com>
Date: Fri, 26 Jul 2024 14:17:00 -0500
From: David Lechner <dlechner@...libre.com>
To: Rob Herring <robh@...nel.org>
Cc: Mark Brown <broonie@...nel.org>, Jonathan Cameron <jic23@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Nuno Sá <nuno.sa@...log.com>,
 Michael Hennerich <Michael.Hennerich@...log.com>,
 Lars-Peter Clausen <lars@...afoo.de>, David Jander <david@...tonic.nl>,
 Martin Sperl <kernel@...tin.sperl.org>, linux-spi@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-iio@...r.kernel.org
Subject: Re: [PATCH RFC v3 5/9] spi: dt-bindings: axi-spi-engine: document
 spi-offloads

On 7/26/24 7:38 AM, Rob Herring wrote:
> On Mon, Jul 22, 2024 at 04:57:12PM -0500, David Lechner wrote:
>> The AXI SPI Engine has support for hardware offloading capabilities.
>> There can be up to 32 offload instances per SPI controller, so the
>> bindings limit the value accordingly.
>>
>> Signed-off-by: David Lechner <dlechner@...libre.com>
>> ---
>>
>> RFC: I have a few questions about this one...
>>
>> 1.  The trigger-source properties are borrowed from the leds bindings.
>>     Do we want to promote this to a generic binding that can be used by
>>     any type of device?
> 
> I would make it specific to spi-offload.

OK

Meanwhile, we are working on some other ADCs (without SPI offload) and
finding that they are using basically the same sorts of triggers. And
on the driver side of things in this series, I'm getting feedback that
we should have some sort of generic trigger device rather than using,
e.g. a clk directly. If we need this same sort of trigger abstraction
for both SPI offloads and IIO device, it does seems like we might want
to consider something like a new trigger subsystem.

> 
>>
>> 2.  Some folks are working on adding DMA to TX stream support to the
>>     AXI SPI Engine hardware. I assume that the `dmas` property is like
>>     others where the order/index in the phandle array matters. So this
>>     would mean that for device that only uses 1 out of the 32 offloads
>>     and only uses 1 TX DMA channel, we would have to have 32 <0>s for
>>     each of the possible RX dmas in the array. Any way to do some kind
>>     of mapping to avoid this?
> 
> That's why -names exists.

OK

> 
>>
>> 3.  In v2, we discussed about having some sort of data processing unit
>>     between the AXI SPI Engine RX stream interface and the DMA channel
>>     interface on the DMA controller. I haven't included this in the
>>     bindings yet because we don't have a user yet. But it was suggested
>>     that we could use the graph bindings for this. So here is what that
>>     might look like:
>>
>>     Additional property for the AXI SPI Engine controller bindings:
>>
>>         out-ports:
>>             $ref: /schemas/graph.yaml#/properties/ports
>>             unevaluatedProperties: false
>>             patternProperties:
>>             "^port@1?[0-9a-f]$":
>>                 $ref: /schemas/graph.yaml#/properties/port
>>                 unevaluatedProperties: false
>>
>>     And this would be connected to a device node similar to this:
>>
>>         ip-block@...0 {
>>             // Something similar to, but not exactly like
>>             // http://analogdevicesinc.github.io/hdl/library/util_extract/index.html
>>             compatible = "adi,crc-check";
>>             // clock that runs this IP block
>>             clocks = <&sysclk 15>;
>>             // interrupt raised on bad CRC
>>             interrupts = <&intc 99>;
>>             interrupt-names = "crc";
>>             // output stream with CRC byte removed piped to DMA
>>             dmas = <&adc_dma 0>;
>>             dma-names = "rx";
>>
>>             port {
>>                 adc_crc_check: endpoint {
>>                     remote-endpoint: <&offload0_rx>;
>>                 };
>>             };
>>         };
>>
>>     Does this sound reasonable?
> 
> Shrug.
> 
> Unlike the offload which is internal to the controller driver?

Correct. And in the case of the AXI SPI Engine, the offload is
part of the controller IP block in hardware as well.

> isn't 
> this specific to the device because it needs to be aware of any 
> processing done or not done. Or maybe it wants to configure the 
> processing.

Yes, the SPI peripheral driver would be the one needing to know
what sort of data processing unit it is connected to so it knows
how to configure the chip and how to interpret the received data
or other signals from the data processing unit.

> 
> OTOH, maybe this isn't any different than offload?

Also true since the SPI peripheral needs to know what kind of
capabilities that the offload itself has.

> 
> Rob


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ