diff options
author | Danny Huang <dahuang@nvidia.com> | 2012-11-15 15:42:33 +0800 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-11-15 14:34:20 -0700 |
commit | 25cd5a391478b1e29ef7de172b3bd612159a07cc (patch) | |
tree | 3dd124908a55cba2427cf0b7a6c1637c14ce8d81 /arch/arm/mach-tegra/fuse.c | |
parent | 1f851a262baf7cbd4096d4d279c73cb697021773 (diff) |
ARM: tegra: Add speedo-based process identification
Detect CPU and core process ID by checking speedo corner tables.
This can provide a more accurate process ID.
Signed-off-by: Danny Huang <dahuang@nvidia.com>
[swarren s/Tegra2/Tegra20/ in log print]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/fuse.c')
-rw-r--r-- | arch/arm/mach-tegra/fuse.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c index bd19c2f53a9..9fd02c50ae2 100644 --- a/arch/arm/mach-tegra/fuse.c +++ b/arch/arm/mach-tegra/fuse.c @@ -35,9 +35,11 @@ int tegra_sku_id; int tegra_cpu_process_id; int tegra_core_process_id; int tegra_chip_id; +int tegra_soc_speedo_id; enum tegra_revision tegra_revision; static int tegra_fuse_spare_bit; +static void (*tegra_init_speedo_data)(void); /* The BCT to use at boot is specified by board straps that can be read * through a APB misc register and decoded. 2 bits, i.e. 4 possible BCTs. @@ -91,6 +93,16 @@ static enum tegra_revision tegra_get_revision(u32 id) } } +static void tegra_get_process_id(void) +{ + u32 reg; + + reg = tegra_fuse_readl(tegra_fuse_spare_bit); + tegra_cpu_process_id = (reg >> 6) & 3; + reg = tegra_fuse_readl(tegra_fuse_spare_bit); + tegra_core_process_id = (reg >> 12) & 3; +} + void tegra_init_fuse(void) { u32 id; @@ -102,21 +114,24 @@ void tegra_init_fuse(void) reg = tegra_fuse_readl(FUSE_SKU_INFO); tegra_sku_id = reg & 0xFF; - tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT; - - reg = tegra_fuse_readl(tegra_fuse_spare_bit); - tegra_cpu_process_id = (reg >> 6) & 3; - - reg = tegra_fuse_readl(tegra_fuse_spare_bit); - tegra_core_process_id = (reg >> 12) & 3; - reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT); tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT; id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); tegra_chip_id = (id >> 8) & 0xff; + tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT; + + switch (tegra_chip_id) { + case TEGRA20: + tegra_init_speedo_data = &tegra20_init_speedo_data; + break; + default: + tegra_init_speedo_data = &tegra_get_process_id; + } + tegra_revision = tegra_get_revision(id); + tegra_init_speedo_data(); pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n", tegra_revision_name[tegra_revision], |