public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/14] sunxi: dram: Configurable MBUS clock speed (use PLL5 or PLL6)
Date: Fri, 25 Jul 2014 07:00:40 +0300	[thread overview]
Message-ID: <20140725070040.5b2cebdf@i7> (raw)
In-Reply-To: <1405971090.4100.15.camel@hastur.hellion.org.uk>

On Mon, 21 Jul 2014 20:31:30 +0100
Ian Campbell <ijc@hellion.org.uk> wrote:

> On Fri, 2014-07-18 at 19:22 +0300, Siarhei Siamashka wrote:
> > The sun5i hardware (Allwinner A13) introduced configurable MBUS clock speed.
> > Allwinner A13 uses only 16-bit data bus width to connect the external DRAM,
> > which is halved compared to the 32-bit data bus of sun4i (Allwinner A10), so
> > it does not make much sense to clock a wider internal bus at a very high speed.
> > The Allwinner A13 manual specifies 300 MHz MBUS clock speed limit and 533 MHz
> > DRAM clock speed limit. Newer sun7i hardware (Allwinner A20) has a full width
> > 32-bit external memory interface again, but still keeps the MBUS clock speed
> > configurable. Clocking MBUS too low inhibits memory performance and one has
> > to find the optimal MBUS/DRAM clock speed ratio, which may depend on many
> > factors.
> > 
> > This patch introduces a new 'mbus_clock' parameter for the 'dram_para' struct
> > and uses it as a desired MBUS clock speed target. If 'mbus_clock' is not set,
> > 300 MHz is used by default to match the older hardcoded settings.
> 
> Nothing in this series seems to set it for any board -- is that
> expected?

Yes. Not touching the board config files avoids any extra dependencies
and merging conflicts. I could explicitly add ".mbus_clock = 300" to
the Cubietruck 'dram_para' struct, but this is the default MBUS value
anyway and makes no real difference.

If we wanted to set something other than 300MHz, there are too many
possible options to select from:
    http://linux-sunxi.org/A10_DRAM_Controller_Performance

> > +	if (pll6x_div <= 16 && pll6x_clk / pll6x_div > pll5p_clk / pll5p_div) {
> 
> Some brackets or perhaps some temporaries ({pll5p,pll6x}_rate ?) might
> help clarity/readability here.

With the brackets we would exceed the 80 characters line limit. This
leaves us with the only choice. I'll add the temporaries.

> When pll6 is viable you prefer the faster clock, even if it might happen
> to be further from the requested clock, is that right? Or does all the
> arithmetic end up with that never being the case?

The 'pll5p_rate' and 'pll6x_rate' values are always equal to or less
than the requested 'mbus_clock'. Selecting the larger of these two will
make it closer to the requested clock.

-- 
Best regards,
Siarhei Siamashka

  reply	other threads:[~2014-07-25  4:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 16:22 [U-Boot] [PATCH 00/14] sunxi: Allwinner A10/A13/A20 DRAM controller fixes Siarhei Siamashka
2014-07-18 16:22 ` [U-Boot] [PATCH 01/14] sunxi: dram: Remove useless 'dramc_scan_dll_para()' function Siarhei Siamashka
2014-07-21 18:42   ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 02/14] sunxi: dram: Remove broken super-standby remnants Siarhei Siamashka
2014-07-21 18:45   ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 03/14] sunxi: dram: Respect the DDR3 reset timing requirements Siarhei Siamashka
2014-07-21 18:46   ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 04/14] sunxi: dram: Code cleanup and comments for the CKE delay handling Siarhei Siamashka
2014-07-21 18:51   ` Ian Campbell
2014-07-25  1:41     ` Siarhei Siamashka
2014-07-25  7:27       ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 05/14] sunxi: dram: Code cleanup for the impedance calibration Siarhei Siamashka
2014-07-21 19:20   ` Ian Campbell
2014-07-25  3:44     ` [U-Boot] [linux-sunxi] " Siarhei Siamashka
2014-07-25  7:30       ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 06/14] sunxi: dram: Configurable MBUS clock speed (use PLL5 or PLL6) Siarhei Siamashka
2014-07-21 19:31   ` Ian Campbell
2014-07-25  4:00     ` Siarhei Siamashka [this message]
2014-07-25  7:31       ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 07/14] sunxi: dram: Use divisor P=1 for PLL5 Siarhei Siamashka
2014-07-21 19:35   ` Ian Campbell
2014-07-18 16:22 ` [U-Boot] [PATCH 08/14] sunxi: dram: Improve DQS gate data training error handling Siarhei Siamashka
2014-07-21 19:36   ` Ian Campbell
2014-07-18 16:23 ` [U-Boot] [PATCH 09/14] sunxi: dram: Add a helper function 'mctl_get_number_of_lanes' Siarhei Siamashka
2014-07-21 19:41   ` Ian Campbell
2014-07-25  4:26     ` Siarhei Siamashka
2014-07-25  7:33       ` Ian Campbell
2014-07-18 16:23 ` [U-Boot] [PATCH 10/14] sunxi: dram: Configurable DQS gating window mode and delay Siarhei Siamashka
2014-07-18 16:23 ` [U-Boot] [PATCH 11/14] sunxi: dram: Support sun4i (Allwinner A10) and sun5i (Allwinner A13) Siarhei Siamashka
2014-07-21 19:49   ` Ian Campbell
2014-07-18 16:23 ` [U-Boot] [PATCH 12/14] sunxi: dram: Drop DDR2 support and assume only single rank DDR3 memory Siarhei Siamashka
2014-07-21 19:51   ` Ian Campbell
2014-07-25  4:36     ` Siarhei Siamashka
2014-07-18 16:23 ` [U-Boot] [PATCH 13/14] sunxi: dram: Derive write recovery delay from DRAM clock speed Siarhei Siamashka
2014-07-21 19:52   ` Ian Campbell
2014-07-18 16:23 ` [U-Boot] [PATCH 14/14] sunxi: dram: Autodetect DDR3 bus width and density Siarhei Siamashka
2014-07-21 19:54   ` Ian Campbell
2014-07-19 10:59 ` [U-Boot] [PATCH 00/14] sunxi: Allwinner A10/A13/A20 DRAM controller fixes Hans de Goede
2014-07-21 19:58   ` Ian Campbell

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=20140725070040.5b2cebdf@i7 \
    --to=siarhei.siamashka@gmail.com \
    --cc=u-boot@lists.denx.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