From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Vinod Koul <vkoul@kernel.org>, <dmaengine@vger.kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] dmaengine: add peripheral configuration
Date: Wed, 30 Sep 2020 08:47:01 +0300 [thread overview]
Message-ID: <aaa3f7df-3625-1b65-aeaa-33dc43566c99@ti.com> (raw)
In-Reply-To: <29f95fff-c484-0131-d1fe-b06e3000fb9f@ti.com>
Hi Vinod,
On 29/09/2020 11.06, Peter Ujfalusi wrote:
>
> I know that you want this to be as generic as much as it is possible,
> but do we really want to?
> GPIv2 will also handle I2S peripheral, other vendor's similar solution
> would require different sets of parameters unique to their IPs?
>
> How we are going to handle similar setups for DMA which is used for
> networking, SPI/I2C/I2S/NAND/display/capture, etc?
>
> Imho these settings are really part of the peripheral's domain and not
> the DMA. It is just a small detail that instead of direct register
> writes, your setup is using the DMA descriptors to write.
> It is similar to what I use as metadata (part of the descriptor belongs
> and owned by the client driver).
>
> I think it would be better to have:
>
> enum dmaengine_peripheral {
> DMAENGINE_PERIPHERAL_GPI_SPI = 1,
> DMAENGINE_PERIPHERAL_GPI_UART,
> DMAENGINE_PERIPHERAL_GPI_I2C,
> DMAENGINE_PERIPHERAL_XYZ_SPI,
> DMAENGINE_PERIPHERAL_XYZ_AASRC,
> DMAENGINE_PERIPHERAL_ABC_CAM,
> ...
> DMAENGINE_PERIPHERAL_LAST,
> };
>
> enum dmaengine_peripheral peripheral_type;
> void *peripheral_config;
TI have an AASRC (Audio Asynchronous Sample Rate Converted) in j721e and
to configure the DMA side (AASRC_PDMA) we need special configuration
parameters passed from the AASRC driver to the DMA channel.
This peripheral config extension would be perfect for it, but the
parameters I would need is not generic in any ways.
The other thing which might need to be considered is to have src/dst
pair of this. When we do DMA_DEV_TO_DEV, it would help to figure out
which side we should apply which config (if you have the same type of
device on both ends with different config?).
> and that's it. The set_config is specific to GPI.
> It can be debated where the structs should be defined, in the generic
> dmaengine.h or in include/linux/dma/ as controller specific
> (gpi_peripheral.h) or a generic one, like dmaengine_peripheral.h
>
> The SPI/I2C/UART client of yours would pass the GPI specific struct as
> in any case it has to know what is the DMA it is serviced by.
>
>> +};
>> /**
>> * struct dma_slave_config - dma slave channel runtime config
>> * @direction: whether the data shall go in or out on this slave
>> @@ -418,6 +506,8 @@ enum dma_slave_buswidth {
>> * @slave_id: Slave requester id. Only valid for slave channels. The dma
>> * slave peripheral will have unique id as dma requester which need to be
>> * pass as slave config.
>> + * @peripheral: peripheral configuration for programming peripheral for
>> + * dmaengine transfer
>> *
>> * This struct is passed in as configuration data to a DMA engine
>> * in order to set up a certain channel for DMA transport at runtime.
>> @@ -443,6 +533,7 @@ struct dma_slave_config {
>> u32 dst_port_window_size;
>> bool device_fc;
>> unsigned int slave_id;
>> + struct dmaengine_peripheral_config *peripheral;
>> };
>>
>> /**
>>
>
> - Péter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2020-09-30 5:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 6:34 [PATCH v3 0/3] dmaengine: Add support for QCOM GSI dma controller Vinod Koul
2020-09-23 6:34 ` [PATCH v3 1/3] dt-bindings: dmaengine: Document qcom,gpi dma binding Vinod Koul
2020-09-29 18:44 ` Rob Herring
2020-10-01 11:14 ` Vinod Koul
2020-09-23 6:34 ` [PATCH v3 2/3] dmaengine: add peripheral configuration Vinod Koul
2020-09-29 8:06 ` Peter Ujfalusi
2020-09-30 5:47 ` Peter Ujfalusi [this message]
2020-10-01 11:23 ` Vinod Koul
2020-10-02 8:48 ` Peter Ujfalusi
2020-10-07 11:28 ` Vinod Koul
2020-10-07 11:49 ` Peter Ujfalusi
2020-09-23 6:34 ` [PATCH v3 3/3] dmaengine: qcom: Add GPI dma driver Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaa3f7df-3625-1b65-aeaa-33dc43566c99@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).