Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296636
b: refs/heads/master
c: 35b1498
h: refs/heads/master
v: v3
  • Loading branch information
Peter De Schrijver authored and Olof Johansson committed Feb 26, 2012
1 parent 6ef1374 commit 0e105a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f830e5c902106e7fe51460fd1e3263bea72bf41
refs/heads/master: 35b1498a34390c4927659abb1076b829ad3a7519
18 changes: 11 additions & 7 deletions trunk/arch/arm/mach-tegra/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
int tegra_sku_id;
int tegra_cpu_process_id;
int tegra_core_process_id;
static int tegra_chip_id;
enum tegra_revision tegra_revision;

/* The BCT to use at boot is specified by board straps that can be read
Expand Down Expand Up @@ -65,20 +66,18 @@ static inline bool get_spare_fuse(int bit)
return tegra_fuse_readl(FUSE_SPARE_BIT + bit * 4);
}

static enum tegra_revision tegra_get_revision(void)
static enum tegra_revision tegra_get_revision(u32 id)
{
void __iomem *chip_id = IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804;
u32 id = readl(chip_id);
u32 minor_rev = (id >> 16) & 0xf;
u32 chipid = (id >> 8) & 0xff;

switch (minor_rev) {
case 1:
return TEGRA_REVISION_A01;
case 2:
return TEGRA_REVISION_A02;
case 3:
if (chipid == 0x20 && (get_spare_fuse(18) || get_spare_fuse(19)))
if (tegra_chip_id == TEGRA20 &&
(get_spare_fuse(18) || get_spare_fuse(19)))
return TEGRA_REVISION_A03p;
else
return TEGRA_REVISION_A03;
Expand All @@ -91,6 +90,8 @@ static enum tegra_revision tegra_get_revision(void)

void tegra_init_fuse(void)
{
u32 id;

u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
reg |= 1 << 28;
writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
Expand All @@ -107,10 +108,13 @@ void tegra_init_fuse(void)
reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT);
tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT;

tegra_revision = tegra_get_revision();
id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
tegra_chip_id = (id >> 8) & 0xff;

tegra_revision = tegra_get_revision(id);

pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
tegra_revision_name[tegra_get_revision()],
tegra_revision_name[tegra_revision],
tegra_sku_id, tegra_cpu_process_id,
tegra_core_process_id);
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-tegra/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ enum tegra_revision {
#define SKU_ID_AP25E 27
#define SKU_ID_T25E 28

#define TEGRA20 0x20
#define TEGRA30 0x30

extern int tegra_sku_id;
extern int tegra_cpu_process_id;
extern int tegra_core_process_id;
Expand Down

0 comments on commit 0e105a2

Please sign in to comment.