From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Frank Wunderlich <linux@fw-web.de>, linux-mediatek@lists.infradead.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC v1 02/12] dt-bindings: PCI: mediatek-gen3: add support for mt7986
Date: Wed, 19 Oct 2022 10:28:59 +0200 [thread overview]
Message-ID: <97916360-a24b-0e7d-cc86-9b801fadf869@collabora.com> (raw)
In-Reply-To: <20221017104141.7338-3-linux@fw-web.de>
Il 17/10/22 12:41, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
>
> Add compatible string for mt7986.
>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> mt7986a.dtsi misses clock-names which are now required since support of
> MT8192/MT8188/MT8195. This change also introduces a 6th clock which is
> now needed for all pcie-gen3 dts.
>
> i do not know how to map the clocks to the names...
>
> mediatek-pcie-gen3.yaml:
>
> clock-names:
> items:
> - const: pl_250m
> - const: tl_26m
> - const: tl_96m
> - const: tl_32k
> - const: peri_26m
> - enum:
> - top_133m # for MT8192
> - peri_mem # for MT8188/MT8195
>
> mt7986a.dtsi:
>
> clocks = <&infracfg CLK_INFRA_PCIE_SEL>,
> <&infracfg CLK_INFRA_IPCIE_CK>,
> <&infracfg CLK_INFRA_IPCIE_PIPE_CK>,
> <&infracfg CLK_INFRA_IPCIER_CK>,
> <&infracfg CLK_INFRA_IPCIEB_CK>;
If this SoC has a different clock tree... then you should add bindings for this
kind of clock tree.
CLK_INFRA_IPCIER_CK is *not* a peri clock: "peri" means PERICFG, which does not
seem to be present in this SoC... so no, you can't assign it to "peri_26m", nor
you can assign it to tl_32k, as that's not a 32KHz clock.
CLK_INFRA_PCIEB_CK can be a "top_133m" clock... as it is gating "sysaxi_sel",
which is a topckgen clock.
CLK_INFRA_IPCIE_CK is your "tl_(something)" clock, as that's effectively gating
"pextp_tl_ck_sel" (which is the PCIe Transaction Layer clock mux).
CLK_INFRA_IPCIE_PIPE_CK seems to be parented to "top_xtal", frequency = 40MHz,
so I don't see how can this be a pl_250m? Looks like being a 40m clock and I
wish we didn't have clock frequencies specified in the names, as "pl" would fit,
but "pl_250m" does not.
I wonder if we can change the clock names and reflect the changes to the mt8192
devicetree (mt8195 does not have any pcie node yet), and if that would be a good
idea right now.
...and I've left the first for last, because...
CLK_INFRA_PCIE_SEL: I have no datasheet for this SoC, but if you're sure that
this clock is selecting the source clock to CLK_INFRA_IPCIE_CK, then the clock
driver is wrong...
Right now, I see the following:
static const char *const infra_pcie_parents[] __initconst = {
"top_rtc_32p7k", "csw_f26m_sel", "top_xtal", "pextp_tl_ck_sel"
};
GATE_INFRA2(CLK_INFRA_IPCIE_CK, "infra_ipcie", "pextp_tl_ck_sel", 12),
MUX_GATE_CLR_SET_UPD(CLK_INFRA_PCIE_SEL, "infra_pcie_sel",
infra_pcie_parents, 0x0028, 0x0020, 0x0024, 0, 2,
-1, -1, -1),
....so if you're right, we should instead have:
GATE_INFRA2(CLK_INFRA_IPCIE_CK, "infra_ipcie", "infra_pcie_sel", 12),
....with this meaning that adding CLK_INFRA_PCIE_SEL in devicetree is useless.
This clock tree looks a bit unclear (because again, there's no datasheet around),
but that's what I understand with a rather fast look in the clock drivers and
with some experience on other MTK SoCs.
Then again, if this tree is effectively incompatible with the one from MT8192 and
MT8195, you should have different clock names... and just as a fast idea:
clock-names = "axi", "tl", "pl", "top";
with clocks, in order:
CLK_INFRA_PCIEB_CK, CLK_INFRA_IPCIE_CK,
CLK_INFRA_IPCIE_PIPE_CK, CLK_INFRA_IPCIER_CK.
...but feel free to reiterate that :-)
Hope that was helpful.
Cheers,
Angelo
next prev parent reply other threads:[~2022-10-19 8:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 10:41 [RFC v1 00/12] Add BananaPi R3 Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 01/12] dt-bindings: phy: mediatek,tphy: add support for mt7986 Frank Wunderlich
2022-10-18 15:34 ` Krzysztof Kozlowski
2022-10-17 10:41 ` [RFC v1 02/12] dt-bindings: PCI: mediatek-gen3: " Frank Wunderlich
2022-10-18 15:35 ` Krzysztof Kozlowski
2022-10-18 15:45 ` Aw: " Frank Wunderlich
2022-10-19 8:28 ` AngeloGioacchino Del Regno [this message]
2022-10-19 9:36 ` Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 03/12] dt-bindings: usb: mtk-xhci: " Frank Wunderlich
2022-10-18 15:35 ` Krzysztof Kozlowski
2022-10-17 10:41 ` [RFC v1 04/12] dt-bindings: arm64: dts: mediatek: add compatible for bananapi r3 Frank Wunderlich
2022-10-18 15:35 ` Krzysztof Kozlowski
2022-10-17 10:41 ` [RFC v1 05/12] arm64: dts: mt7986: harmonize device node order Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 06/12] arm64: dts: mt7986: add spi related device nodes Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 07/12] arm64: dts: mt7986: add pcie " Frank Wunderlich
2022-10-18 15:11 ` Aw: " Frank Wunderlich
2022-10-23 18:07 ` Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 08/12] arm64: dts: mt7986: add usb " Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 09/12] arm64: dts: mt7986: add crypto " Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 10/12] arm64: dts: mt7986: add mmc " Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 11/12] arm64: dts: mt7986: add i2c node Frank Wunderlich
2022-10-17 10:41 ` [RFC v1 12/12] arm64: dts: mt7986: add Bananapi R3 Frank Wunderlich
2022-10-18 15:38 ` Krzysztof Kozlowski
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=97916360-a24b-0e7d-cc86-9b801fadf869@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@fw-web.de \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@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®