From: Mikko Perttunen <mikko.perttunen@kapsi.fi>
To: Alexandre Courbot <gnurou@gmail.com>,
Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
Mikko Perttunen <mperttunen@nvidia.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Thierry Reding <thierry.reding@gmail.com>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 03/15] soc/tegra: Add ram code reader helper
Date: Mon, 02 Mar 2015 11:52:11 +0200 [thread overview]
Message-ID: <54F432CB.20800@kapsi.fi> (raw)
In-Reply-To: <CAAVeFuKLp=rG5oQxg7CjfZk9h2hA5kM0OoxKhyeLxAUcaB-2Eg@mail.gmail.com>
On 03/02/2015 10:46 AM, Alexandre Courbot wrote:
> On Thu, Feb 12, 2015 at 11:06 PM, Tomeu Vizoso
> <tomeu.vizoso@collabora.com> wrote:
>> From: Mikko Perttunen <mperttunen@nvidia.com>
>>
>> Needed for the EMC and MC drivers to know what timings from the DT to use.
>>
>> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>>
>> ---
>>
>> v4: Replace magic number with PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT
>> ---
>> drivers/soc/tegra/fuse/tegra-apbmisc.c | 19 +++++++++++++++++++
>> include/soc/tegra/fuse.h | 1 +
>> 2 files changed, 20 insertions(+)
>>
>> diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
>> index 3bf5aba..dc96a62 100644
>> --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
>> +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
>> @@ -28,8 +28,13 @@
>> #define APBMISC_SIZE 0x64
>> #define FUSE_SKU_INFO 0x10
>>
>> +#define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT 4
>> +#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG (0xf << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT)
>> +#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT (0x3 << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT)
>
> I think you are slightly over 80 chars here.
>
>> +
>> static void __iomem *apbmisc_base;
>> static void __iomem *strapping_base;
>> +static bool long_ram_code;
>>
>> u32 tegra_read_chipid(void)
>> {
>> @@ -54,6 +59,18 @@ u32 tegra_read_straps(void)
>> return 0;
>> }
>>
>> +u32 tegra_read_ram_code(void)
>> +{
>> + u32 straps = tegra_read_straps();
>> +
>> + if (long_ram_code)
>> + straps &= PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG;
>> + else
>> + straps &= PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT;
>> +
>> + return straps >> PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT;
>> +}
>> +
>> static const struct of_device_id apbmisc_match[] __initconst = {
>> { .compatible = "nvidia,tegra20-apbmisc", },
>> {},
>> @@ -112,4 +129,6 @@ void __init tegra_init_apbmisc(void)
>> strapping_base = of_iomap(np, 1);
>> if (!strapping_base)
>> pr_err("ioremap tegra strapping_base failed\n");
>> +
>> + long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
>
> Is this long-ram property chip-dependent? If so, couldn't we just use
> the chip ID or matched compatible string to decide whether the RAM
> code length, instead of having a dedicated property for it?
>
I am under the impression that it is board-specific.
Mikko
next prev parent reply other threads:[~2015-03-02 9:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 14:06 [PATCH v6 00/15] Tegra124 EMC (external memory controller) support Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 01/15] clk: tegra124: Remove old emc clock Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 02/15] of: Document long-ram-code property in nvidia,tegra20-apbmisc Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 03/15] soc/tegra: Add ram code reader helper Tomeu Vizoso
2015-03-02 8:46 ` Alexandre Courbot
2015-03-02 9:52 ` Mikko Perttunen [this message]
2015-03-09 14:36 ` Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 04/15] of: document new emc-timings subnode in nvidia,tegra124-car Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 05/15] of: Document timings subnode of nvidia,tegra-mc Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 06/15] of: Add Tegra124 EMC bindings Tomeu Vizoso
2015-03-02 8:47 ` Alexandre Courbot
2015-03-02 9:51 ` Mikko Perttunen
2015-02-12 14:06 ` [PATCH v6 07/15] of: document external-memory-controller property in tegra124-car Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 08/15] ARM: tegra: Add EMC to Tegra124 device tree Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 09/15] ARM: tegra: Add EMC timings to Jetson TK1 " Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 10/15] memory: tegra: Add API needed by the EMC driver Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 11/15] memory: tegra: Add EMC (external memory controller) driver Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 12/15] clk: Expose clk_hw_reparent to providers Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 13/15] clk: tegra: Add EMC clock driver Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 14/15] memory: tegra: Add debugfs entry for getting and setting the EMC rate Tomeu Vizoso
2015-02-12 14:06 ` [PATCH v6 15/15] clk: tegra: Set the EMC clock as the parent of the MC clock Tomeu Vizoso
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=54F432CB.20800@kapsi.fi \
--to=mikko.perttunen@kapsi.fi \
--cc=gnurou@gmail.com \
--cc=javier.martinez@collabora.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=pdeschrijver@nvidia.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
--cc=tomeu.vizoso@collabora.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
Powered by JetHome