diff mbox

[v3,02/10] ARM: tegra: export Tegra chipid

Message ID 1328831277-21002-3-git-send-email-pdeschrijver@nvidia.com
State Accepted, archived
Headers show

Commit Message

Peter De Schrijver Feb. 9, 2012, 11:47 p.m. UTC
The powergating and reset handling code needs to differentiate between Tegra
variants. Therefore we export the chipid here.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
 arch/arm/mach-tegra/fuse.c |    2 +-
 arch/arm/mach-tegra/fuse.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

Comments

Colin Cross Feb. 20, 2012, 11:13 p.m. UTC | #1
On Thu, Feb 9, 2012 at 3:47 PM, Peter De Schrijver
<pdeschrijver@nvidia.com> wrote:
> The powergating and reset handling code needs to differentiate between Tegra
> variants. Therefore we export the chipid here.
>
> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> ---
>  arch/arm/mach-tegra/fuse.c |    2 +-
>  arch/arm/mach-tegra/fuse.h |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
> index 032a936..3298880 100644
> --- a/arch/arm/mach-tegra/fuse.c
> +++ b/arch/arm/mach-tegra/fuse.c
> @@ -34,7 +34,7 @@
>  int tegra_sku_id;
>  int tegra_cpu_process_id;
>  int tegra_core_process_id;
> -static int tegra_chip_id;
> +int tegra_chip_id;
>  enum tegra_revision tegra_revision;
>
>  /* The BCT to use at boot is specified by board straps that can be read
> diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h
> index c554572..d2107b2 100644
> --- a/arch/arm/mach-tegra/fuse.h
> +++ b/arch/arm/mach-tegra/fuse.h
> @@ -41,6 +41,7 @@ enum tegra_revision {
>  extern int tegra_sku_id;
>  extern int tegra_cpu_process_id;
>  extern int tegra_core_process_id;
> +extern int tegra_chip_id;
>  extern enum tegra_revision tegra_revision;
>
>  extern int tegra_bct_strapping;

Other platforms use accessors for this (cpu_is_xxx(), although
soc_is_xxx() is probably more appropriate).
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Olof Johansson Feb. 20, 2012, 11:30 p.m. UTC | #2
Hi,

On Mon, Feb 20, 2012 at 3:13 PM, Colin Cross <ccross@android.com> wrote:

> Other platforms use accessors for this (cpu_is_xxx(), although
> soc_is_xxx() is probably more appropriate).

I have previously objected to additions of said functions on tegra,
since they tend to start crawling into drivers as runtime tests
instead of providing more appropriate detection at probe time.

I can be persuaded differently but I haven't yet seen a strong case
for changing my mind. :)


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Colin Cross Feb. 22, 2012, 7:19 p.m. UTC | #3
On Mon, Feb 20, 2012 at 3:30 PM, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> On Mon, Feb 20, 2012 at 3:13 PM, Colin Cross <ccross@android.com> wrote:
>
>> Other platforms use accessors for this (cpu_is_xxx(), although
>> soc_is_xxx() is probably more appropriate).
>
> I have previously objected to additions of said functions on tegra,
> since they tend to start crawling into drivers as runtime tests
> instead of providing more appropriate detection at probe time.
>
> I can be persuaded differently but I haven't yet seen a strong case
> for changing my mind. :)

soc_is_xxx() is better than spreading tegra_chip_id == XXX all over
the place, but keeping them out of drivers completely is even better.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index 032a936..3298880 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -34,7 +34,7 @@ 
 int tegra_sku_id;
 int tegra_cpu_process_id;
 int tegra_core_process_id;
-static int tegra_chip_id;
+int tegra_chip_id;
 enum tegra_revision tegra_revision;
 
 /* The BCT to use at boot is specified by board straps that can be read
diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h
index c554572..d2107b2 100644
--- a/arch/arm/mach-tegra/fuse.h
+++ b/arch/arm/mach-tegra/fuse.h
@@ -41,6 +41,7 @@  enum tegra_revision {
 extern int tegra_sku_id;
 extern int tegra_cpu_process_id;
 extern int tegra_core_process_id;
+extern int tegra_chip_id;
 extern enum tegra_revision tegra_revision;
 
 extern int tegra_bct_strapping;