public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Joseph Lo <josephl@nvidia.com>
To: Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Rob Herring <robh+dt@kernel.org>, Stephen Boyd <sboyd@kernel.org>
Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V3 4/8] memory: tegra: Add Tegra210 EMC clock driver
Date: Tue, 14 May 2019 17:22:26 +0800	[thread overview]
Message-ID: <27db5517-e2fc-ff24-7a96-932202160478@nvidia.com> (raw)
In-Reply-To: <50d5719c-63fb-279b-cf8a-388010e7bdb3@gmail.com>

On 5/14/19 12:54 AM, Dmitry Osipenko wrote:
> 10.05.2019 11:47, Joseph Lo пишет:
>> This is the initial patch for Tegra210 EMC clock driver, which doesn't
>> include the support code and detail sequence for clock scaling yet.
>>
>> The driver is designed to support LPDDR4 SDRAM. Because of the LPDDR4
>> devices need to do initial time training before it can be used, the
>> firmware will help to do that at early boot stage. Then, the trained
>> table for the rates we support will pass to the kernel via DT. So the
>> driver can get the trained table for clock scaling support.
>>
>> For the higher rate support (above 800MHz), the periodic training is
>> needed for the timing compensation. So basically, two methodologies for
>> clock scaling are supported, one is following the clock changing
>> sequence to update the EMC table to EMC registers and another is if the
>> rate needs periodic training, then we will start a timer to do that
>> periodically until it scales to the lower rate.
>>
>> Based on the work of Peter De Schrijver <pdeschrijver@nvidia.com>.
>>
>> Signed-off-by: Joseph Lo <josephl@nvidia.com>
>> ---
>> v3:
>> - address almost all the comments from the previous version
>> - remove the DT parser of EMC table
>> - The EMC table is passing as a binary blob now.
>> ---
snip.
>> +#ifdef CONFIG_DEBUG_FS
>> +static int emc_stats_show(struct seq_file *s, void *data)
>> +{
>> +	int i;
>> +	struct tegra_emc *emc = (struct tegra_emc *)s->private;
> 
> There is no need for casting of the void*.
> 
>> +
>> +	if (!emc->emc_table_size || !seq)
>> +		return 0;
>> +
>> +	emc_last_stats_update(TEGRA_EMC_MAX_FREQS);
>> +
>> +	seq_printf(s, "%-10s %-10s\n", "rate kHz", "time");
>> +	for (i = 0; i < emc->emc_table_size; i++) {
>> +		if (emc_clk_sel[i].input == NULL)
>> +			continue;
>> +
>> +		seq_printf(s, "%-10u %-10llu\n",
>> +			   emc->emc_table[i].rate,
>> +			   jiffies_64_to_clock_t(
>> +			   emc_stats.time_at_clock[i]));
>> +	}
>> +	seq_printf(s, "%-15s %llu\n", "transitions:",
>> +		   emc_stats.clkchange_count);
>> +	seq_printf(s, "%-15s %llu\n", "time-stamp:",
>> +		   jiffies_64_to_clock_t(emc_stats.last_update));
> 
> Devfreq subsystem has the transition stats too and it is a bit more advanced than what you have here.
> 
>   cat /sys/class/devfreq/devfreq0/trans_stat
>        From  :   To
>              :  50000000 100000000 150000000 300000000 600000000   time(ms)
>   *  50000000:         0         4         4         0        46 118096210
>     100000000:        21         0         0         0         5     15460
>     150000000:        10         9         0         0     10560  20213940
>     300000000:        13         6      5058         0     22375   6848690
>     600000000:        11         7      5517     27452         0  11958990
>   Total transition : 71098
> 
> Hence I'm questioning the necessity of the debug-info duplication.
> 

Okay, will remove the statistic data in the next version. BTW, I think 
we will use Interconnect framework for the EMC BW manager for the Tegra 
chips >= T210.

Thanks,
Joseph

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-05-14  9:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10  8:47 [PATCH V3 0/8] Add EMC scaling support for Tegra210 Joseph Lo
2019-05-10  8:47 ` [PATCH V3 1/8] dt-bindings: memory: tegra: Add external memory controller binding " Joseph Lo
2019-05-14 16:28   ` Dmitry Osipenko
2019-05-15  7:17     ` Joseph Lo
2019-05-15 13:50       ` Dmitry Osipenko
2019-05-16  9:01         ` Joseph Lo
2019-05-16 14:39           ` Dmitry Osipenko
2019-05-10  8:47 ` [PATCH V3 2/8] clk: tegra: Add PLLP_UD and PLLMB_UD " Joseph Lo
2019-05-10  8:47 ` [PATCH V3 3/8] clk: tegra: Export functions for EMC clock scaling Joseph Lo
2019-05-14 16:29   ` Dmitry Osipenko
2019-05-15  7:25     ` Joseph Lo
2019-05-10  8:47 ` [PATCH V3 4/8] memory: tegra: Add Tegra210 EMC clock driver Joseph Lo
2019-05-13 16:54   ` Dmitry Osipenko
2019-05-14  9:22     ` Joseph Lo [this message]
2019-05-14 17:04   ` Dmitry Osipenko
2019-05-15  8:42     ` Joseph Lo
2019-05-15 15:25       ` Dmitry Osipenko
2019-05-16  7:52         ` Joseph Lo
2019-05-16 14:29           ` Dmitry Osipenko
2019-05-10  8:47 ` [PATCH V3 5/8] memory: tegra: Add EMC scaling support code for Tegra210 Joseph Lo
2019-05-13 17:02   ` Dmitry Osipenko
2019-05-14  8:47     ` Joseph Lo
2019-05-14 16:30   ` Dmitry Osipenko
2019-05-15 14:09   ` Dmitry Osipenko
2019-05-15 15:26   ` Dmitry Osipenko
2019-05-10  8:47 ` [PATCH V3 6/8] memory: tegra: Add EMC scaling sequence " Joseph Lo
2019-05-10  8:47 ` [PATCH V3 7/8] clk: tegra: Remove the old emc_mux clock " Joseph Lo
2019-05-10  8:47 ` [PATCH V3 8/8] arm64: tegra: Add external memory controller node " Joseph Lo

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=27db5517-e2fc-ff24-7a96-932202160478@nvidia.com \
    --to=josephl@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pdeschrijver@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@gmail.com \
    /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