Devicetree
 help / color / mirror / Atom feed
From: <Manikandan.M@microchip.com>
To: <Frank.li@nxp.com>, <sashiko-reviews@lists.linux.dev>
Cc: <conor+dt@kernel.org>, <devicetree@vger.kernel.org>, <robh@kernel.org>
Subject: Re: [PATCH v7 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk
Date: Thu, 4 Jun 2026 10:53:19 +0000	[thread overview]
Message-ID: <5a4c037e-5988-49ca-8fcc-7abaf79cf1d4@microchip.com> (raw)
In-Reply-To: <ah8LiLPXssB5VYjm@lizhi-Precision-Tower-5810>

Hi Frank,

On 02/06/26 10:27 pm, Frank Li wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Mon, May 25, 2026 at 10:23:31AM +0000, sashiko-bot@kernel.org wrote:
>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>> - [High] Reusing AMD-specific hardcoded timing quirks for a Microchip SoC will result in incorrect I3C bus frequencies.
>> --
>>
>> commit 8dab9b9edc49c0214800ec48372900ae0b5bbae4
>> Author: Manikandan Muralidharan <manikandan.m@microchip.com>
>>
>> i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk
>>
>> This commit adds support for the Microchip sama7d65 SoC I3C HCI master IP.
>> It introduces clock acquisition during probe and applies specific quirks
>> to the new compatible string.
>>
>>> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
>>> index b781dbed21650..4cdf2abd42197 100644
>>> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
>>> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
>> [ ... ]
>>> @@ -969,6 +970,7 @@ static int i3c_hci_init(struct i3c_hci *hci)
>>>   static int i3c_hci_probe(struct platform_device *pdev)
>>>   {
>>>      const struct mipi_i3c_hci_platform_data *pdata = pdev->dev.platform_data;
>>> +   struct clk_bulk_data *clks;
>>>      struct i3c_hci *hci;
>>>      int irq, ret;
>> [ ... ]
>>> @@ -1001,6 +1003,11 @@ static int i3c_hci_probe(struct platform_device *pdev)
>>>      if (!hci->quirks && platform_get_device_id(pdev))
>>>              hci->quirks = platform_get_device_id(pdev)->driver_data;
>>>
>>> +   ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);
>>> +   if (ret < 0)
>>> +           return dev_err_probe(&pdev->dev, ret,
>>> +                                "Failed to get clocks\n");
>>> +
>>>      ret = i3c_hci_init(hci);
>> [ ... ]
>>> @@ -1031,6 +1038,9 @@ static void i3c_hci_remove(struct platform_device *pdev)
>>>
>>>   static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
>>>      { .compatible = "mipi-i3c-hci", },
>>> +   { .compatible = "microchip,sama7d65-i3c-hci",
>>> +     .data = (void *)(ulong)(HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING |
>>> +                             HCI_QUIRK_RESP_BUF_THLD) },
>>
>> [Severity: High]
>> Will applying HCI_QUIRK_OD_PP_TIMING to this Microchip SoC result in
>> incorrect I3C bus frequencies?
>>
>> This quirk typically invokes amd_set_od_pp_timing(), which writes hardcoded
>> timing divisors (0x00cf00cf for Open Drain and 0x00160016 for Push-Pull) to
>> the controller's vendor-specific registers. These fixed values were
>> calculated for a 9MHz I3C bus frequency assuming an AMD platform's specific
>> fixed input clock of roughly 400 MHz.
> 
> Look like make sense. Is it true?
> 

During the I3C sensor slave integration, a similar OD and PP timing 
configuration was required, so the values had to be chosen with previous 
implementation as reference at the time. Going forward, a dynamic timing 
configuration approach would be the most reliable and robust solution.

I am currently working on integrating dynamic timing register updates 
based on the core clock and I3C/I2C bus clock frequencies with CLK 
quirks, and will share the patch series shortly.

Thank you for your cooperation.

> Frank
>>
>> Since the Microchip SoC acquires its clocks dynamically via
>> devm_clk_bulk_get_all_enabled() as seen above, its input clock rate could
>> differ and vary based on the system's clock tree configuration.
>>
>> Should these timing divisors be calculated dynamically against the actual
>> input clock rate obtained from the clock framework rather than blindly
>> reusing the fixed AMD divisors?
>>
>>>      {},
>>>   };
>>>   MODULE_DEVICE_TABLE(of, i3c_hci_of_match);
>>
>> --
>> Sashiko AI review · https://sashiko.dev/#/patchset/20260525092405.1514213-1-manikandan.m@microchip.com?part=3

-- 
Thanks and Regards,
Manikandan M.


  reply	other threads:[~2026-06-04 10:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  9:24 [PATCH v7 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
2026-05-25  9:24 ` [PATCH v7 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
2026-05-25  9:24 ` [PATCH v7 2/5] clk: at91: sama7d65: add peripheral clock for I3C Manikandan Muralidharan
2026-05-31 14:50   ` Claudiu Beznea
2026-05-25  9:24 ` [PATCH v7 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the required quirk Manikandan Muralidharan
2026-05-25 10:23   ` sashiko-bot
2026-06-02 16:57     ` Frank Li
2026-06-04 10:53       ` Manikandan.M [this message]
2026-06-08 17:04   ` Frank Li
2026-05-25  9:24 ` [PATCH v7 4/5] ARM: dts: microchip: add I3C controller Manikandan Muralidharan
2026-05-25 10:30   ` sashiko-bot
2026-05-25  9:24 ` [PATCH v7 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci Manikandan Muralidharan
2026-06-07 12:19 ` [PATCH v7 0/5] Add microchip sama7d65 SoC I3C support Claudiu Beznea
2026-06-14 20:39 ` (subset) " Alexandre Belloni

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=5a4c037e-5988-49ca-8fcc-7abaf79cf1d4@microchip.com \
    --to=manikandan.m@microchip.com \
    --cc=Frank.li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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