From: Brian Masney <bmasney@redhat.com>
To: Caleb James DeLisle <cjd@cjdns.fr>
Cc: linux-mips@vger.kernel.org, naseefkm@gmail.com,
mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
tsbogend@alpha.franken.de, ryder.lee@mediatek.com,
jianjun.wang@mediatek.com, lpieralisi@kernel.org,
kwilczynski@kernel.org, mani@kernel.org, bhelgaas@google.com,
vkoul@kernel.org, neil.armstrong@linaro.org,
p.zabel@pengutronix.de, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, nbd@nbd.name,
ansuelsmth@gmail.com, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/8] clk: airoha: Add econet EN751221 clock/reset support to en7523-scu
Date: Wed, 11 Mar 2026 15:44:50 -0400 [thread overview]
Message-ID: <abHGMgGCyPh1G5jC@redhat.com> (raw)
In-Reply-To: <de6e8440-99a1-4be7-80aa-3645fdb0bdb9@cjdns.fr>
On Wed, Mar 11, 2026 at 06:12:59PM +0100, Caleb James DeLisle wrote:
> Hello Brian,
>
> Thank you for taking the time!
>
>
> On 11/03/2026 15:39, Brian Masney wrote:
> > Hi Caleb,
> >
> > On Mon, Mar 09, 2026 at 01:18:12PM +0000, Caleb James DeLisle wrote:
> > > EcoNet EN751221 clock/reset driver is significantly similar to the
> > > EN7523 / EN7581, however the EN751221 does not have a neat batch of clock
> > > divider registers so there are fewer known clocks, and the frequency of
> > > each clock is derived differently. This clock driver will probably work
> > > correctly on EN751627, EN7528, and EN7580.
> > >
> > > Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
> > > ---
> > > static u32 en7523_get_base_rate(const struct en_clk_desc *desc, u32 val)
> > > {
> > > @@ -604,7 +703,8 @@ static int en7523_clk_hw_init(struct platform_device *pdev,
> > > en7523_register_clocks(&pdev->dev, clk_data, base, np_base);
> > > return en7581_reset_register(&pdev->dev, np_base, en7523_rst_map,
> > > - ARRAY_SIZE(en7523_rst_map));
> > > + ARRAY_SIZE(en7523_rst_map),
> > > + en7581_rst_ofs);
> > I assume the mix of en7523 and en7581 is ok here?
>
>
> Correct, en7581 came first, then when en7523 was added they reused the
> function. I'm only changing the offsets to be passed in because en751221 has
> more reset registers so different offset table than the others.
Sounds good. I just wanted to confirm.
> > > + else
> > > + clk_data->hws[key] = hw;
> > Should the error code be returned here? I know the function has try in
> > it's name, however if this fails, then it still registers it.
>
>
> This function follows the general pattern of en7581_register_clocks(). If a
> clock can't be registered, leave clk_data->hws[key] as NULL, log, and
> continue. There's only two possible reasons for failing, if
> clk_hw_register_fixed_rate() fails then it's not registered because it
> failed. If key >= EN751221_MAX_CLKS, it does register but I'll fix this so
> it's checking that before clk_hw_register_fixed_rate().
I see that Stephen picked up this driver in 2022 with that behavior. I'm
fine with it if he is.
> > > + /* BUS */
> > > + rate = FIELD_GET(EN751221_REG_BUS_MASK,
> > > + readl(np_base + EN751221_REG_BUS));
> > > + rate *= 1000000;
> > > + en751221_try_register_clk(dev, EN751221_CLK_BUS, clk_data, "bus",
> > > + rate);
> > > +
> > > + /* CPU */
> > > + en751221_try_register_clk(dev, EN751221_CLK_CPU, clk_data, "cpu",
> > > + rate * 4);
> > > +
> > > + /* HPT */
> > > + switch (hid) {
> > > + case HIR_EN751221:
> > > + case HIR_EN751627:
> > > + case HIR_EN7526C:
> > > + case HIR_EN7580:
> > > + case HIR_EN7528:
> > > + rate = 200000000;
> > > + break;
> > > + case HIR_MT7505:
> > > + rate = 100000000;
> > > + break;
> > > + case HIR_MT751020:
> > > + rate = 800000000 / 3;
> > > + break;
> > > + default:
> > > + rate = 250000000;
> > Should a warning be logged here or in get_hw_id() above? hid can be set
> > to HIR_UNKNOWN here.
>
> Now that I'm looking at this again, I'm starting to think it might be better
> to just remove it and use a fixed-clock in the DT. I wrote it aiming for
> completeness, but this particular clock has so much code supporting it, I'm
> feeling like it just doesn't make any sense.
>
> Let me know if you have a feeling on this because I'm swaying in the
> direction of just re-sending with it removed.
That makes sense to me.
Brian
WARNING: multiple messages have this Message-ID (diff)
From: Brian Masney <bmasney@redhat.com>
To: Caleb James DeLisle <cjd@cjdns.fr>
Cc: linux-mips@vger.kernel.org, naseefkm@gmail.com,
mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
tsbogend@alpha.franken.de, ryder.lee@mediatek.com,
jianjun.wang@mediatek.com, lpieralisi@kernel.org,
kwilczynski@kernel.org, mani@kernel.org, bhelgaas@google.com,
vkoul@kernel.org, neil.armstrong@linaro.org,
p.zabel@pengutronix.de, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, nbd@nbd.name,
ansuelsmth@gmail.com, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/8] clk: airoha: Add econet EN751221 clock/reset support to en7523-scu
Date: Wed, 11 Mar 2026 15:44:50 -0400 [thread overview]
Message-ID: <abHGMgGCyPh1G5jC@redhat.com> (raw)
In-Reply-To: <de6e8440-99a1-4be7-80aa-3645fdb0bdb9@cjdns.fr>
On Wed, Mar 11, 2026 at 06:12:59PM +0100, Caleb James DeLisle wrote:
> Hello Brian,
>
> Thank you for taking the time!
>
>
> On 11/03/2026 15:39, Brian Masney wrote:
> > Hi Caleb,
> >
> > On Mon, Mar 09, 2026 at 01:18:12PM +0000, Caleb James DeLisle wrote:
> > > EcoNet EN751221 clock/reset driver is significantly similar to the
> > > EN7523 / EN7581, however the EN751221 does not have a neat batch of clock
> > > divider registers so there are fewer known clocks, and the frequency of
> > > each clock is derived differently. This clock driver will probably work
> > > correctly on EN751627, EN7528, and EN7580.
> > >
> > > Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
> > > ---
> > > static u32 en7523_get_base_rate(const struct en_clk_desc *desc, u32 val)
> > > {
> > > @@ -604,7 +703,8 @@ static int en7523_clk_hw_init(struct platform_device *pdev,
> > > en7523_register_clocks(&pdev->dev, clk_data, base, np_base);
> > > return en7581_reset_register(&pdev->dev, np_base, en7523_rst_map,
> > > - ARRAY_SIZE(en7523_rst_map));
> > > + ARRAY_SIZE(en7523_rst_map),
> > > + en7581_rst_ofs);
> > I assume the mix of en7523 and en7581 is ok here?
>
>
> Correct, en7581 came first, then when en7523 was added they reused the
> function. I'm only changing the offsets to be passed in because en751221 has
> more reset registers so different offset table than the others.
Sounds good. I just wanted to confirm.
> > > + else
> > > + clk_data->hws[key] = hw;
> > Should the error code be returned here? I know the function has try in
> > it's name, however if this fails, then it still registers it.
>
>
> This function follows the general pattern of en7581_register_clocks(). If a
> clock can't be registered, leave clk_data->hws[key] as NULL, log, and
> continue. There's only two possible reasons for failing, if
> clk_hw_register_fixed_rate() fails then it's not registered because it
> failed. If key >= EN751221_MAX_CLKS, it does register but I'll fix this so
> it's checking that before clk_hw_register_fixed_rate().
I see that Stephen picked up this driver in 2022 with that behavior. I'm
fine with it if he is.
> > > + /* BUS */
> > > + rate = FIELD_GET(EN751221_REG_BUS_MASK,
> > > + readl(np_base + EN751221_REG_BUS));
> > > + rate *= 1000000;
> > > + en751221_try_register_clk(dev, EN751221_CLK_BUS, clk_data, "bus",
> > > + rate);
> > > +
> > > + /* CPU */
> > > + en751221_try_register_clk(dev, EN751221_CLK_CPU, clk_data, "cpu",
> > > + rate * 4);
> > > +
> > > + /* HPT */
> > > + switch (hid) {
> > > + case HIR_EN751221:
> > > + case HIR_EN751627:
> > > + case HIR_EN7526C:
> > > + case HIR_EN7580:
> > > + case HIR_EN7528:
> > > + rate = 200000000;
> > > + break;
> > > + case HIR_MT7505:
> > > + rate = 100000000;
> > > + break;
> > > + case HIR_MT751020:
> > > + rate = 800000000 / 3;
> > > + break;
> > > + default:
> > > + rate = 250000000;
> > Should a warning be logged here or in get_hw_id() above? hid can be set
> > to HIR_UNKNOWN here.
>
> Now that I'm looking at this again, I'm starting to think it might be better
> to just remove it and use a fixed-clock in the DT. I wrote it aiming for
> completeness, but this particular clock has so much code supporting it, I'm
> feeling like it just doesn't make any sense.
>
> Let me know if you have a feeling on this because I'm swaying in the
> direction of just re-sending with it removed.
That makes sense to me.
Brian
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-03-11 19:45 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 13:18 [PATCH v2 0/8] mips: econet: Add clk/reset and PCIe support Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-09 13:18 ` [PATCH v2 1/8] dt-bindings: clock, reset: Add econet EN751221 Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-10 8:21 ` Krzysztof Kozlowski
2026-03-10 8:21 ` Krzysztof Kozlowski
2026-03-10 8:37 ` Caleb James DeLisle
2026-03-10 8:37 ` Caleb James DeLisle
2026-03-10 8:51 ` Krzysztof Kozlowski
2026-03-10 8:51 ` Krzysztof Kozlowski
2026-03-09 13:18 ` [PATCH v2 2/8] clk: airoha: Add econet EN751221 clock/reset support to en7523-scu Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-11 14:39 ` Brian Masney
2026-03-11 14:39 ` Brian Masney
2026-03-11 17:12 ` Caleb James DeLisle
2026-03-11 17:12 ` Caleb James DeLisle
2026-03-11 19:44 ` Brian Masney [this message]
2026-03-11 19:44 ` Brian Masney
2026-03-09 13:18 ` [PATCH v2 3/8] dt-bindings: phy: Document PCIe PHY in EcoNet EN751221 and EN7528 Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-10 8:24 ` Krzysztof Kozlowski
2026-03-10 8:24 ` Krzysztof Kozlowski
2026-03-10 10:37 ` Caleb James DeLisle
2026-03-10 10:37 ` Caleb James DeLisle
2026-03-10 10:40 ` Krzysztof Kozlowski
2026-03-10 10:40 ` Krzysztof Kozlowski
2026-03-10 10:40 ` Krzysztof Kozlowski
2026-03-10 10:40 ` Krzysztof Kozlowski
2026-03-10 11:13 ` Caleb James DeLisle
2026-03-10 11:13 ` Caleb James DeLisle
2026-03-10 11:20 ` Krzysztof Kozlowski
2026-03-10 11:20 ` Krzysztof Kozlowski
2026-03-09 13:18 ` [PATCH v2 4/8] phy: econet: Add PCIe PHY driver for EcoNet EN751221 and EN7528 SoCs Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-09 13:18 ` [PATCH v2 5/8] dt-bindings: PCI: mediatek: Add support for EcoNet EN7528 Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-10 8:25 ` Krzysztof Kozlowski
2026-03-10 8:25 ` Krzysztof Kozlowski
2026-03-10 8:49 ` Caleb James DeLisle
2026-03-10 8:49 ` Caleb James DeLisle
2026-03-09 13:18 ` [PATCH v2 6/8] PCI: mediatek: Add support for EcoNet EN7528 SoC Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-09 13:18 ` [PATCH v2 7/8] PCI: Skip bridge window reads when window is not supported Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-03-09 13:18 ` [PATCH v2 8/8] mips: dts: Add PCIe to EcoNet EN751221 Caleb James DeLisle
2026-03-09 13:18 ` Caleb James DeLisle
2026-04-06 12:37 ` Thomas Bogendoerfer
2026-04-06 12:37 ` Thomas Bogendoerfer
2026-04-08 12:58 ` Caleb James DeLisle
2026-04-08 12:58 ` Caleb James DeLisle
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=abHGMgGCyPh1G5jC@redhat.com \
--to=bmasney@redhat.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=ansuelsmth@gmail.com \
--cc=bhelgaas@google.com \
--cc=cjd@cjdns.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jianjun.wang@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@baylibre.com \
--cc=naseefkm@gmail.com \
--cc=nbd@nbd.name \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=ryder.lee@mediatek.com \
--cc=sboyd@kernel.org \
--cc=tsbogend@alpha.franken.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.