devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>,
	linux-clk@vger.kernel.org
Cc: linux-mips@vger.kernel.org, tsbogend@alpha.franken.de,
	john@phrozen.org, linux-kernel@vger.kernel.org,
	p.zabel@pengutronix.de, mturquette@baylibre.com,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	matthias.bgg@gmail.com, devicetree@vger.kernel.org,
	arinc.unal@arinc9.com
Subject: Re: [PATCH v3 2/9] clk: ralink: add clock and reset driver for MTMIPS SoCs
Date: Fri, 16 Jun 2023 11:03:34 -0700	[thread overview]
Message-ID: <86c4012d945a5a1594c5e191ee6186e9.sboyd@kernel.org> (raw)
In-Reply-To: <20230418090312.2818879-3-sergio.paracuellos@gmail.com>

Quoting Sergio Paracuellos (2023-04-18 02:03:05)
> Until now, clock related code for old ralink SoCs was based in fixed clocks
> using 'clk_register_fixed_rate' and 'clkdev_create' directly doing in code
> and not using device tree at all for their definition. Including this driver
> is an effort to be able to define proper clocks using device tree and also
> cleaning all the clock and reset related code from 'arch/mips/ralink' dir.
> This clock and reset driver covers all the ralink SoCs but MT7621 which is
> the newest and provides gating and some differences that make it different
> from its predecesors. It has its own driver since some time ago. The ralink
> SoCs we are taking about are RT2880, RT3050, RT3052, RT3350, RT3352, RT3883,
> RT5350, MT7620, MT7628 and MT7688. Mostly the code in this new driver has
> been extracted from 'arch/mips/ralink' and cleanly put using kernel clock
> driver APIs. The clock plans for this SoCs only talks about relation between
> CPU frequency and BUS frequency. This relation is different depending on the
> particular SoC. CPU clock is derived from XTAL frequencies.
> 
> Depending on the SoC we have the following frequencies:
> * RT2880 SoC:
>     - XTAL: 40 MHz.
>     - CPU: 250, 266, 280 or 300 MHz.
>     - BUS: CPU / 2 MHz.
> * RT3050, RT3052, RT3350:
>     - XTAL: 40 MHz.
>     - CPU: 320 or 384 MHz.
>     - BUS: CPU / 3 MHz.
> * RT3352:
>     - XTAL: 40 MHz.
>     - CPU: 384 or 400 MHz.
>     - BUS: CPU / 3 MHz.
>     - PERIPH: 40 MHz.
> * RT3383:
>     - XTAL: 40 MHz.
>     - CPU: 250, 384, 480 or 500 MHz.
>     - BUS: Depends on RAM Type and CPU:
>         + RAM DDR2: 125. ELSE 83 MHz.
>         + RAM DDR2: 128. ELSE 96 MHz.
>         + RAM DDR2: 160. ELSE 120 MHz.
>         + RAM DDR2: 166. ELSE 125 MHz.
> * RT5350:
>     - XTAL: 40 MHz.
>     - CPU: 300, 320 or 360 MHz.
>     - BUS: CPU / 3, CPU / 4, CPU / 3 MHz.
>     - PERIPH: 40 MHz.
> * MT7628 and MT7688:
>     - XTAL: 20 MHz or 40 MHz.
>     - CPU: 575 or 580 MHz.
>     - BUS: CPU / 3.
>     - PCMI2S: 480 MHz.
>     - PERIPH: 40 MHz.
> * MT7620:
>     - XTAL: 20 MHz or 40 MHz.
>     - PLL: XTAL, 480, 600 MHz.
>     - CPU: depends on PLL and some mult and dividers.
>     - BUS: depends on PLL and some mult and dividers.
>     - PERIPH: 40 or XTAL MHz.
> 
> MT7620 is a bit more complex deriving CPU clock from a PLL and an bunch of
> register reads and predividers. To derive CPU and BUS frequencies in the
> MT7620 SoC 'mt7620_calc_rate()' helper is used.
> 
> In the case XTAL can have different frequencies and we need a different
> clock frequency for peripherals 'periph' clock in introduced.
> 
> The rest of the peripherals present in the SoC just follow their parent
> frequencies.
> 
> With this information the clk driver will provide all the clock and reset
> functionality from a set of hardcoded clocks allowing to define a nice
> device tree without fixed clocks.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

  reply	other threads:[~2023-06-16 18:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  9:03 [PATCH v3 0/9] mips: ralink: add complete clock and reset driver for mtmips SoCs Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 1/9] dt-bindings: clock: add mtmips SoCs system controller Sergio Paracuellos
2023-04-21 18:00   ` Rob Herring
2023-06-16 18:03   ` Stephen Boyd
2023-04-18  9:03 ` [PATCH v3 2/9] clk: ralink: add clock and reset driver for MTMIPS SoCs Sergio Paracuellos
2023-06-16 18:03   ` Stephen Boyd [this message]
2023-06-17  4:51   ` yangshiji66
2023-06-17  5:06     ` Sergio Paracuellos
2023-06-17  5:50       ` Shiji Yang
2023-06-17  6:00         ` Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 3/9] mips: ralink: rt288x: remove clock related code Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 4/9] mips: ralink: rt305x: " Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 5/9] mips: ralink: rt3883: " Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 6/9] mips: ralink: mt7620: " Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 7/9] mips: ralink: remove reset " Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 8/9] mips: ralink: get cpu rate from new driver code Sergio Paracuellos
2023-04-18  9:03 ` [PATCH v3 9/9] MAINTAINERS: add Mediatek MTMIPS Clock maintainer Sergio Paracuellos
2023-05-04 14:48 ` [PATCH v3 0/9] mips: ralink: add complete clock and reset driver for mtmips SoCs Sergio Paracuellos
2023-05-23  9:47   ` Sergio Paracuellos
2023-06-16  6:12     ` Sergio Paracuellos
2023-06-16  6:47       ` Thomas Bogendoerfer
  -- strict thread matches above, loose matches on Subject: below --
2023-06-17  5:24 [PATCH v4 2/9] clk: ralink: add clock and reset driver for MTMIPS SoCs Sergio Paracuellos
2023-06-17 12:54 ` [PATCH v3 " Shiji Yang
2023-06-17 13:07   ` Krzysztof Kozlowski
2023-06-17 13:31     ` Sergio Paracuellos
2023-06-17 14:43       ` Krzysztof Kozlowski
2023-06-17 15:37         ` Sergio Paracuellos
2023-06-17 17:20           ` Krzysztof Kozlowski
2023-06-17 19:11             ` Sergio Paracuellos
2023-06-18  5:04               ` Sergio Paracuellos
2023-06-17 13:26   ` Sergio Paracuellos
2023-06-17 14:43     ` Krzysztof Kozlowski
2023-06-17 15:31       ` Sergio Paracuellos

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=86c4012d945a5a1594c5e191ee6186e9.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=arinc.unal@arinc9.com \
    --cc=devicetree@vger.kernel.org \
    --cc=john@phrozen.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sergio.paracuellos@gmail.com \
    --cc=tsbogend@alpha.franken.de \
    /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).