From: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Tomeu Vizoso
<tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Javier Martinez Canillas
<javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>,
Mikko Perttunen
<mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Peter De Schrijver
<pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 03/13] soc/tegra: Add ram code reader helper
Date: Thu, 6 Nov 2014 14:25:02 +0900 [thread overview]
Message-ID: <545B062E.2040508@nvidia.com> (raw)
In-Reply-To: <1414599796-30597-4-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
On 10/30/2014 01:22 AM, Tomeu Vizoso wrote:
> From: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Needed for the EMC and MC drivers to know what timings from the DT to use.
>
> Signed-off-by: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> ---
> 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..e580892 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_MASK_LONG (0xf << 4)
> +#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT (0x3 << 4)
Shouldn't these two shifts also use PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT
defined right after?
> +#define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT 4
> +
> 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;
... this is what triggered my remark above, since it seems like you want
to return the ram_code field.
> +}
> +
> 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");
> }
> diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h
> index 8e12494..4ad6fd9 100644
> --- a/include/soc/tegra/fuse.h
> +++ b/include/soc/tegra/fuse.h
> @@ -55,6 +55,7 @@ struct tegra_sku_info {
> };
>
> u32 tegra_read_straps(void);
> +u32 tegra_read_ram_code(void);
> u32 tegra_read_chipid(void);
> int tegra_fuse_readl(unsigned long offset, u32 *value);
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Courbot <acourbot@nvidia.com>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>, <linux-tegra@vger.kernel.org>
Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
"Mikko Perttunen" <mperttunen@nvidia.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Thierry Reding <thierry.reding@gmail.com>,
Alexandre Courbot <gnurou@gmail.com>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 03/13] soc/tegra: Add ram code reader helper
Date: Thu, 6 Nov 2014 14:25:02 +0900 [thread overview]
Message-ID: <545B062E.2040508@nvidia.com> (raw)
In-Reply-To: <1414599796-30597-4-git-send-email-tomeu.vizoso@collabora.com>
On 10/30/2014 01:22 AM, Tomeu Vizoso 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>
> ---
> 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..e580892 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_MASK_LONG (0xf << 4)
> +#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT (0x3 << 4)
Shouldn't these two shifts also use PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT
defined right after?
> +#define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT 4
> +
> 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;
... this is what triggered my remark above, since it seems like you want
to return the ram_code field.
> +}
> +
> 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");
> }
> diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h
> index 8e12494..4ad6fd9 100644
> --- a/include/soc/tegra/fuse.h
> +++ b/include/soc/tegra/fuse.h
> @@ -55,6 +55,7 @@ struct tegra_sku_info {
> };
>
> u32 tegra_read_straps(void);
> +u32 tegra_read_ram_code(void);
> u32 tegra_read_chipid(void);
> int tegra_fuse_readl(unsigned long offset, u32 *value);
>
>
next prev parent reply other threads:[~2014-11-06 5:25 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 16:22 [PATCH v3 00/13] Tegra124 EMC (external memory controller) support Tomeu Vizoso
2014-10-29 16:22 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 01/13] clk: tegra124: Remove old emc clock Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 02/13] of: Document long-ram-code property in nvidia,tegra20-apbmisc Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 03/13] soc/tegra: Add ram code reader helper Tomeu Vizoso
[not found] ` <1414599796-30597-4-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-11-06 5:25 ` Alexandre Courbot [this message]
2014-11-06 5:25 ` Alexandre Courbot
[not found] ` <545B062E.2040508-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-06 9:07 ` Tomeu Vizoso
2014-11-06 9:07 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 04/13] of: document new emc-timings subnode in nvidia,tegra124-car Tomeu Vizoso
2014-11-06 6:37 ` Alexandre Courbot
2014-11-06 6:37 ` Alexandre Courbot
[not found] ` <545B172C.4060105-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-06 9:11 ` Tomeu Vizoso
2014-11-06 9:11 ` Tomeu Vizoso
[not found] ` <CAAObsKBe8kigKfEs_ER+1X5fqLw3dZD69XHicEn4cVuQTyoFAw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-06 9:15 ` Alexandre Courbot
2014-11-06 9:15 ` Alexandre Courbot
2014-11-06 15:12 ` Rob Herring
2014-11-07 5:31 ` Alexandre Courbot
2014-11-07 11:35 ` Mikko Perttunen
[not found] ` <545C5927.3010001-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-07 13:03 ` Tomeu Vizoso
2014-11-07 13:03 ` Tomeu Vizoso
[not found] ` <CAL_JsqKYSF3JVrXH_dkqRXQrgUU3igzvoK1C2k1Caz-4UuHX6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-07 13:10 ` Tomeu Vizoso
2014-11-07 13:10 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 05/13] of: Document timings subnode of nvidia,tegra-mc Tomeu Vizoso
[not found] ` <1414599796-30597-6-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-11-06 8:12 ` Alexandre Courbot
2014-11-06 8:12 ` Alexandre Courbot
[not found] ` <545B2D6B.9030001-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-06 10:32 ` Tomeu Vizoso
2014-11-06 10:32 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 06/13] of: Add Tegra124 EMC bindings Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 07/13] ARM: tegra: Add EMC to Tegra124 device tree Tomeu Vizoso
2014-10-29 16:22 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 08/13] ARM: tegra: Add EMC timings to Jetson TK1 " Tomeu Vizoso
2014-10-29 16:22 ` Tomeu Vizoso
2014-10-29 16:22 ` Tomeu Vizoso
[not found] ` <1414599796-30597-9-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-11-06 12:21 ` Nikolaus Schulz
2014-11-06 12:21 ` Nikolaus Schulz
2014-11-06 12:21 ` Nikolaus Schulz
[not found] ` <20141106122149.GC3863-GNrqntRiisjPWV3K8zbkiAH8Oo8bv1DvZkel5v8DVj8@public.gmane.org>
2014-11-07 16:12 ` Tomeu Vizoso
2014-11-07 16:12 ` Tomeu Vizoso
[not found] ` <1414599796-30597-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-10-29 16:22 ` [PATCH v3 09/13] memory: tegra: Add API needed by the EMC driver Tomeu Vizoso
2014-10-29 16:22 ` Tomeu Vizoso
[not found] ` <1414599796-30597-10-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-11-06 7:26 ` Alexandre Courbot
2014-11-06 7:26 ` Alexandre Courbot
2014-10-29 16:22 ` [PATCH v3 10/13] memory: tegra: Add EMC (external memory controller) driver Tomeu Vizoso
2014-11-06 7:56 ` Alexandre Courbot
2014-11-06 7:56 ` Alexandre Courbot
[not found] ` <545B29AA.8030006-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-06 11:35 ` Mikko Perttunen
2014-11-06 11:35 ` Mikko Perttunen
[not found] ` <545B5D15.6030705-/1wQRMveznE@public.gmane.org>
2014-11-07 16:16 ` Tomeu Vizoso
2014-11-07 16:16 ` Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 11/13] clk: tegra: Add EMC clock driver Tomeu Vizoso
2014-11-06 8:04 ` Alexandre Courbot
2014-11-06 8:04 ` Alexandre Courbot
[not found] ` <545B2B89.8010801-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-06 11:41 ` Mikko Perttunen
2014-11-06 11:41 ` Mikko Perttunen
[not found] ` <545B5E58.4040404-/1wQRMveznE@public.gmane.org>
2014-11-07 5:34 ` Alexandre Courbot
2014-11-07 5:34 ` Alexandre Courbot
2014-10-29 16:22 ` [PATCH v3 12/13] memory: tegra: Add debugfs entry for getting and setting the EMC rate Tomeu Vizoso
2014-10-29 16:22 ` [PATCH v3 13/13] 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=545B062E.2040508@nvidia.com \
--to=acourbot-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.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.