mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "TY_Chang[張子逸]" <tychang@realtek.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: "linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Stanley Chang[昌育德]" <stanley_chang@realtek.com>
Subject: RE: [PATCH 1/2] dt-bindings: phy: realtek: Add Realtek DHC RTD SoC PCIe PHY
Date: Fri, 8 Dec 2023 09:01:36 +0000	[thread overview]
Message-ID: <c7dfa01f7b114d56adf8561125536580@realtek.com> (raw)
In-Reply-To: <c864f62e-0ac2-4e5e-83d3-28e493a6f6c0@linaro.org>

Hi Krzysztof,

>>> On 01/12/2023 11:52, Tzuyi Chang wrote:
>>>> +  "#phy-cells":
>>>> +    const: 0
>>>> +
>>>> +  nvmem-cells:
>>>> +    maxItems: 1
>>>> +    description:
>>>> +      Phandle to nvmem cell that contains 'Tx swing trim'
>>>> +      tuning parameter value for PCIe phy.
>>>> +
>>>> +  nvmem-cell-names:
>>>> +    items:
>>>> +      - const: tx_swing_trim
>>>> +
>>>> +  realtek,pcie-syscon:
>>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>>> +    description: phandle of syscon used to control PCIe MDIO register.
>>>
>>> Why this does not have reg property but syscon? This looks hacky.
>>>
>>
>> Our PCIe PHY driver needs to access two registers:
>> 1. PCIe MDIO register: Utilized for configuring the PCIe PHY.
>> 2. PCIe MAC Link Control and Link Status Register: Use to get the current
>>   link speed for calibration purposes.
>>
>> Both these registers reside within the PCIe controller registers. The
>> PCIe driver has mapped these register address region, so I use regmap
>> to access these registers.
>
>Hm, isn't in such case PCIe PHY a child of the PCIe controller? How is it with
>resources, like power domains or regulators?

In fact, I positioned the PCIe PHY node outside the PCIe controller node.
It would be more appropriate for the PCIe PHY as the child node of the PCIe
controller. I will revise to this structure.
I will also remove the "realtek,pcie-syscon" property and use dev->parent->of_node
to get the syscon of the PCIe controller.

Since the MDIO register is located within the PCIe controller registers, it can
only be accessed after enabling the clock and asserting the resets of the PCIe controller.
Therefore, the PCIe PHY driver only registers the callback functions of phy_ops (.init and .calibrate).
After the PCIe controller driver sets the clock and resets, it will execute PHY framework API to
configure the PHY.

Thanks,
Tzuyi Chang

  reply	other threads:[~2023-12-08  9:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 10:52 [PATCH 0/2] Add PCIe PHY driver support for Realtek DHC SoCs Tzuyi Chang
2023-12-01 10:52 ` [PATCH 1/2] dt-bindings: phy: realtek: Add Realtek DHC RTD SoC PCIe PHY Tzuyi Chang
2023-12-01 16:03   ` Conor Dooley
2023-12-07 10:09     ` TY_Chang[張子逸]
2023-12-03 16:46   ` Krzysztof Kozlowski
2023-12-07 10:10     ` TY_Chang[張子逸]
2023-12-07 11:30       ` Krzysztof Kozlowski
2023-12-08  9:01         ` TY_Chang[張子逸] [this message]
2023-12-01 10:52 ` [PATCH 2/2] phy: realtek: pcie: Add PCIe PHY support for Realtek DHC RTD SoCs Tzuyi Chang
2023-12-11 17:51   ` Rob Herring
2023-12-12  9:58     ` TY_Chang[張子逸]

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=c7dfa01f7b114d56adf8561125536580@realtek.com \
    --to=tychang@realtek.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=stanley_chang@realtek.com \
    --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

all inboxes | Powered by JetHome®