linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Viken Dadhaniya <quic_vdadhani@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, gregkh@linuxfoundation.org,
	jirislaby@kernel.org, broonie@kernel.or, andersson@kernel.org,
	konradybcio@kernel.org, johan+linaro@kernel.org,
	dianders@chromium.org, agross@kernel.org,
	linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, linux-spi@vger.kernel.org,
	quic_msavaliy@quicinc.com, quic_anupkulk@quicinc.com
Subject: Re: [PATCH v2 2/8] dt-bindings: i2c: qcom,i2c-geni: Add support for selecting data transfer mode
Date: Mon, 27 Jan 2025 07:58:08 +0100	[thread overview]
Message-ID: <2ef6561c-d5ba-40d9-a085-fdced597233f@kernel.org> (raw)
In-Reply-To: <38d24c6b-369e-4254-ae50-5387e2b6063e@quicinc.com>

On 24/01/2025 16:16, Viken Dadhaniya wrote:
> 
> 
> On 1/24/2025 8:33 PM, Dmitry Baryshkov wrote:
>> On Fri, Jan 24, 2025 at 05:52:24PM +0530, Viken Dadhaniya wrote:
>>>
>>>
>>> On 1/24/2025 4:48 PM, Dmitry Baryshkov wrote:
>>>> On Fri, Jan 24, 2025 at 04:23:03PM +0530, Viken Dadhaniya wrote:
>>>>> Data transfer mode is fixed by TrustZone (TZ), which currently restricts
>>>>> developers from modifying the transfer mode from the APPS side.
>>>>>
>>>>> Document the 'qcom,xfer-mode' properties to select the data transfer mode,
>>>>> either GPI DMA (Generic Packet Interface) or non-GPI mode (PIO/CPU DMA).
>>>>>
>>>>> I2C controller can operate in one of two modes based on the
>>>>> 'qcom,xfer-mode' property, and the firmware is loaded accordingly.
>>>>
>>>> Is it possible to load the firmware after it being loaded by TZ? Is it
>>>> possible to change the mode at runtime too?
>>>
>>> No, firmware can be loaded either from the TZ side or APPS side.
>>
>> You answer actually reads as "No, yes" (excuse me, non-native here).
>> Most likely you mean that it can not be reloaded once either TZ or APPS
>> has loaded it.
> 
> Yes correct. it can not be reloaded once either TZ or APPS has loaded it.
> 
>>
>>> In non-GPI mode, the transfer mode will change runtime between PIO and CPU
>>> DMA based on the data length.
>>>
>>> We need to update the device tree property(qcom,xfer-mode) to change the
>>> mode between non-GPI and GPI.
>>
>> So, is it actually possible to change the mode? E.g. if the TZ has
>> loaded the firmware and configured SE for PIO/SE DMA, is it possible to
>> change it to GPI DMA?
> 
> No, if the TZ has loaded the firmware, it is not possible to switch from 
> non-GPI (PIO/SE DMA) to GPI DMA mode.
> 
>>
>>>
>>>>
>>>>>
>>>>> Co-developed-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
>>>>> Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
>>>>> Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
>>>>> ---
>>>>>
>>>>> v1 -> v2:
>>>>>
>>>>> - Drop 'qcom,load-firmware' property and add 'firmware-name' property in
>>>>>     qup common driver.
>>>>> - Update commit log.
>>>>>
>>>>> v1 Link: https://lore.kernel.org/linux-kernel/20241204150326.1470749-2-quic_vdadhani@quicinc.com/
>>>>> ---
>>>>> ---
>>>>>    .../devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml        | 7 +++++++
>>>>>    1 file changed, 7 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml
>>>>> index 9f66a3bb1f80..68e4bf0c84d1 100644
>>>>> --- a/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml
>>>>> +++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-geni-qcom.yaml
>>>>> @@ -66,6 +66,12 @@ properties:
>>>>>      required-opps:
>>>>>        maxItems: 1
>>>>> +  qcom,xfer-mode:
>>>>> +    description: Set the value to 1 for non-GPI (FIFO/CPU DMA) mode and 3 for GPI DMA mode.
>>>>> +      The default mode is FIFO.
>>>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>>>> +    enum: [1, 3]
>>>>> +
>>>>>    required:
>>>>>      - compatible
>>>>>      - interrupts
>>>>> @@ -142,5 +148,6 @@ examples:
>>>>>            interconnect-names = "qup-core", "qup-config", "qup-memory";
>>>>>            power-domains = <&rpmhpd SC7180_CX>;
>>>>>            required-opps = <&rpmhpd_opp_low_svs>;
>>>>> +        qcom,xfer-mode = <1>;
>>>>
>>>> What does <1> mean? Please provide corresponding defines.
>>>
>>> Do we need to add a string instead of a number, like
>>> include/dt-bindings/dma/qcom-gpi.h?
>>
>> You need to '#define FOO_BAR 1', then another one for 3. String is a
>> "string", it's not required here (in my opinion).
>>
> 
> Sure, I will update it in the next patch.

Well, no. Not 3 but 2, because why having gap there?

But anyway use string and explain what is GPI. I assume that DMA is
present in both cases, you just choose not to use it? If so, then why?

Best regards,
Krzysztof

  reply	other threads:[~2025-01-27  6:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24 10:53 [PATCH v2 0/8] Add support to load QUP SE firmware from Viken Dadhaniya
2025-01-24 10:53 ` [PATCH v2 1/8] dt-bindings: qcom: geni-se: Add 'firmware-name' property for firmware loading Viken Dadhaniya
2025-01-24 11:00   ` Krzysztof Kozlowski
2025-01-24 11:33     ` Viken Dadhaniya
2025-01-24 10:53 ` [PATCH v2 2/8] dt-bindings: i2c: qcom,i2c-geni: Add support for selecting data transfer mode Viken Dadhaniya
2025-01-24 11:18   ` Dmitry Baryshkov
2025-01-24 12:22     ` Viken Dadhaniya
2025-01-24 15:03       ` Dmitry Baryshkov
2025-01-24 15:16         ` Viken Dadhaniya
2025-01-27  6:58           ` Krzysztof Kozlowski [this message]
2025-01-24 10:53 ` [PATCH v2 3/8] spi: dt-bindings: " Viken Dadhaniya
2025-01-27  6:59   ` Krzysztof Kozlowski
2025-01-24 10:53 ` [PATCH v2 4/8] dt-bindings: serial: " Viken Dadhaniya
2025-01-27  7:02   ` Krzysztof Kozlowski
2025-01-27 14:27     ` Dmitry Baryshkov
2025-01-27 16:24       ` Krzysztof Kozlowski
2025-01-27 17:50         ` Konrad Dybcio
2025-01-28 11:40           ` Konrad Dybcio
2025-01-29  2:21         ` Dmitry Baryshkov
2025-01-29  7:23           ` Krzysztof Kozlowski
2025-01-29  8:18           ` neil.armstrong
2025-02-09 10:11             ` Viken Dadhaniya
2025-02-09 10:19               ` Krzysztof Kozlowski
2025-02-10  7:01                 ` Viken Dadhaniya
2025-02-09 10:27         ` Viken Dadhaniya
2025-01-24 10:53 ` [PATCH v2 5/8] soc: qcom: geni-se: Add support to load QUP SE Firmware via Linux subsystem Viken Dadhaniya
2025-01-27  7:06   ` Krzysztof Kozlowski
2025-03-03 12:47     ` Viken Dadhaniya
2025-01-27 12:07   ` Mukesh Kumar Savaliya
2025-01-24 10:53 ` [PATCH v2 6/8] i2c: qcom-geni: Load i2c qup Firmware from linux side Viken Dadhaniya
2025-01-24 15:04   ` Dmitry Baryshkov
2025-01-24 15:24     ` Viken Dadhaniya
2025-01-24 15:55       ` Dmitry Baryshkov
2025-01-27  5:40         ` Viken Dadhaniya
2025-01-24 10:53 ` [PATCH v2 7/8] spi: geni-qcom: Load spi " Viken Dadhaniya
2025-01-24 10:53 ` [PATCH v2 8/8] serial: qcom-geni: Load UART " Viken Dadhaniya

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=2ef6561c-d5ba-40d9-a085-fdced597233f@kernel.org \
    --to=krzk@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=broonie@kernel.or \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=quic_anupkulk@quicinc.com \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_vdadhani@quicinc.com \
    --cc=robh@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).