devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	"wsa+renesas@sang-engineering.com"
	<wsa+renesas@sang-engineering.com>,
	"andi.shyti@kernel.org" <andi.shyti@kernel.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Chris Brandt <Chris.Brandt@renesas.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"magnus.damm@gmail.com" <magnus.damm@gmail.com>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"sboyd@kernel.org" <sboyd@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v2 07/12] i2c: riic: Define individual arrays to describe the register offsets
Date: Sat, 29 Jun 2024 14:11:05 +0300	[thread overview]
Message-ID: <e2a3672a-5f1b-4969-8ddb-aad63a776db3@tuxon.dev> (raw)
In-Reply-To: <CAMuHMdUmiQjsKt93jM62V5YR_NdtUDXhcxFs+F+BCu3NTNsx8Q@mail.gmail.com>



On 28.06.2024 14:39, Geert Uytterhoeven wrote:
> On Fri, Jun 28, 2024 at 12:29 PM claudiu beznea
> <claudiu.beznea@tuxon.dev> wrote:
>> On 28.06.2024 12:13, Geert Uytterhoeven wrote:
>>> On Fri, Jun 28, 2024 at 10:12 AM claudiu beznea
>>> <claudiu.beznea@tuxon.dev> wrote:
>>>> On 28.06.2024 11:09, Biju Das wrote:
>>>>>> -----Original Message-----
>>>>>> From: claudiu beznea <claudiu.beznea@tuxon.dev>
>>>>>> On 28.06.2024 10:55, Biju Das wrote:
>>>>>>>> -----Original Message-----
>>>>>>>> From: claudiu beznea <claudiu.beznea@tuxon.dev>
>>>>>>>> Patch 09/12 "i2c: riic: Add support for fast mode plus" adds a new member to struct
>>>>>> riic_of_data.
>>>>>>>> That new member is needed to differentiate b/w hardware versions
>>>>>>>> supporting fast mode plus based on compatible.
>>>>>>>
>>>>>>> Are we sure RZ/A does not support fast mode plus?
>>>>>>
>>>>>> From commit description of patch 09/12:
>>>>>>
>>>>>> Fast mode plus is available on most of the IP variants that RIIC driver is working with. The
>>>>>> exception is (according to HW manuals of the SoCs where this IP is available) the Renesas RZ/A1H.
>>>>>> For this, patch introduces the struct riic_of_data::fast_mode_plus.
>>>>>>
>>>>>> I checked the manuals of all the SoCs where this driver is used.
>>>>>>
>>>>>> I haven't checked the H/W manual?
>>>>>>
>>>>>> On the manual I've downloaded from Renesas web site the FMPE bit of RIICnFER is not available on
>>>>>> RZ/A1H.
>>>>>
>>>>> I just found RZ/A2M manual, it supports FMP and register layout looks similar to RZ/G2L.
>>>>
>>>> I introduced struct riic_of_data::fast_mode_plus because of RZ/A1H.
>>>
>>> Do you need to check for that?
>>>
>>> The ICFER_FMPE bit won't be set unless the user specifies the FM+
>>> clock-frequency.  Setting clock-frequency beyond Fast Mode on RZ/A1H
>>> would be very wrong.
>>
>> I need it to avoid this scenario ^. In patch 09/12 there is this code:
>>
>> +       if ((!info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) ||
>> +           (info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ)) {
>> +               dev_err(dev, "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz,
>> +                       info->fast_mode_plus ? I2C_MAX_FAST_MODE_PLUS_FREQ :
>> +                       I2C_MAX_FAST_MODE_FREQ);
>>                 return -EINVAL;
>>

FTR, the full context of this change is (from patch 09/12):

@@ -315,11 +319,13 @@ static int riic_init_hw(struct riic_dev *riic)
 	int total_ticks, cks, brl, brh;
 	struct i2c_timings *t = &riic->i2c_t;
 	struct device *dev = riic->adapter.dev.parent;
+	const struct riic_of_data *info = riic->info;

-	if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) {
-		dev_err(dev,
-			"unsupported bus speed (%dHz). %d max\n",
-			t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ);
+	if ((!info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) ||
+	    (info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ)) {
+		dev_err(dev, "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz,
+			info->fast_mode_plus ? I2C_MAX_FAST_MODE_PLUS_FREQ :
+			I2C_MAX_FAST_MODE_FREQ);
 		return -EINVAL;
 	}

Thank you,
Claudiu Beznea

>> to avoid giving the user the possibility to set FM+ freq on platforms not
>> supporting it.
>>
>> Please let me know if I'm missing something (or wrongly understood your
>> statement).
> 
> Wolfram/Andi: what is your view on this?
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 

  reply	other threads:[~2024-06-29 11:11 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 12:13 [PATCH v2 00/12] i2c: riic: Add support for Renesas RZ/G3S Claudiu
2024-06-25 12:13 ` [PATCH v2 01/12] clk: renesas: r9a08g045: Add clock, reset and power domain support for I2C Claudiu
2024-06-26 12:19   ` Geert Uytterhoeven
2024-06-25 12:13 ` [PATCH v2 02/12] i2c: riic: Use temporary variable for struct device Claudiu
2024-07-04 22:30   ` Andi Shyti
2024-07-08  5:13     ` claudiu beznea
2024-06-25 12:13 ` [PATCH v2 03/12] i2c: riic: Call pm_runtime_get_sync() when need to access registers Claudiu
2024-07-04 22:32   ` Andi Shyti
2024-06-25 12:13 ` [PATCH v2 04/12] i2c: riic: Use pm_runtime_resume_and_get() Claudiu
2024-06-25 15:53   ` Biju Das
2024-06-26  6:13     ` claudiu beznea
2024-06-26  6:23       ` Biju Das
2024-06-26  6:30         ` claudiu beznea
2024-06-27 19:21           ` Andi Shyti
2024-06-26  7:10         ` Geert Uytterhoeven
2024-06-26  8:15           ` Biju Das
2024-07-04 22:42   ` Andi Shyti
2024-07-05  7:19     ` Geert Uytterhoeven
2024-07-05 12:14       ` Andi Shyti
2024-07-08  5:19       ` claudiu beznea
2024-07-08  5:36     ` Biju Das
2024-07-08  9:33       ` Biju Das
2024-06-25 12:13 ` [PATCH v2 05/12] i2c: riic: Enable runtime PM autosuspend support Claudiu
2024-06-25 12:13 ` [PATCH v2 06/12] i2c: riic: Add suspend/resume support Claudiu
2024-06-25 12:13 ` [PATCH v2 07/12] i2c: riic: Define individual arrays to describe the register offsets Claudiu
2024-06-28  5:59   ` Biju Das
2024-06-28  7:32     ` claudiu beznea
2024-06-28  7:55       ` Biju Das
2024-06-28  8:02         ` claudiu beznea
2024-06-28  8:04           ` claudiu beznea
2024-06-28  8:09           ` Biju Das
2024-06-28  8:12             ` claudiu beznea
2024-06-28  8:24               ` Biju Das
2024-06-28  8:29                 ` Biju Das
2024-06-28 10:25                 ` claudiu beznea
2024-06-28 10:49                   ` Biju Das
2024-06-28 11:24                     ` claudiu beznea
2024-06-28 11:29                       ` Biju Das
2024-06-28 15:05                         ` Biju Das
2024-06-28  9:13               ` Geert Uytterhoeven
2024-06-28 10:28                 ` claudiu beznea
2024-06-28 11:39                   ` Geert Uytterhoeven
2024-06-29 11:11                     ` claudiu beznea [this message]
2024-08-19 19:56                     ` Andi Shyti
2024-06-28  9:08             ` Geert Uytterhoeven
2024-06-28  9:13               ` Biju Das
2024-06-25 12:13 ` [PATCH v2 08/12] dt-bindings: i2c: renesas,riic: Document the R9A08G045 support Claudiu
2024-06-25 16:28   ` Conor Dooley
2024-06-25 12:13 ` [PATCH v2 09/12] i2c: riic: Add support for fast mode plus Claudiu
2024-06-28  9:22   ` Geert Uytterhoeven
2024-06-28 10:06     ` claudiu beznea
2024-07-10 14:20     ` claudiu beznea
2024-07-11  7:53       ` Geert Uytterhoeven
2024-07-11 10:55         ` claudiu beznea
2024-06-29  5:38   ` Biju Das
2024-06-29 11:13     ` claudiu beznea
2024-06-25 12:13 ` [PATCH v2 10/12] arm64: dts: renesas: r9a08g045: Add I2C nodes Claudiu
2024-06-25 12:13 ` [PATCH v2 11/12] arm64: dts: renesas: rzg3s-smarc: Enable i2c0 node Claudiu
2024-06-25 12:13 ` [PATCH v2 12/12] arm64: dts: renesas: rzg3s-smarc-som: Enable i2c1 node Claudiu

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=e2a3672a-5f1b-4969-8ddb-aad63a776db3@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=Chris.Brandt@renesas.com \
    --cc=andi.shyti@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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).