Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296074
b: refs/heads/master
c: d262f49
h: refs/heads/master
v: v3
  • Loading branch information
Olof Johansson committed Feb 7, 2012
1 parent a7b77e6 commit 4785cb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 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: e2f91578b35347341482f6af9e4fcf3174531efd
refs/heads/master: d262f49d10554ae2908e6d1d0e93fa736c4c0d06
20 changes: 8 additions & 12 deletions trunk/arch/arm/mach-tegra/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,16 @@
#include <mach/iomap.h>

#include "fuse.h"
#include "apbio.h"

#define FUSE_UID_LOW 0x108
#define FUSE_UID_HIGH 0x10c
#define FUSE_SKU_INFO 0x110
#define FUSE_SPARE_BIT 0x200

static inline u32 fuse_readl(unsigned long offset)
static inline u32 tegra_fuse_readl(unsigned long offset)
{
return readl(IO_TO_VIRT(TEGRA_FUSE_BASE + offset));
}

static inline void fuse_writel(u32 value, unsigned long offset)
{
writel(value, IO_TO_VIRT(TEGRA_FUSE_BASE + offset));
return tegra_apb_readl(TEGRA_FUSE_BASE + offset);
}

void tegra_init_fuse(void)
Expand All @@ -54,31 +50,31 @@ unsigned long long tegra_chip_uid(void)
{
unsigned long long lo, hi;

lo = fuse_readl(FUSE_UID_LOW);
hi = fuse_readl(FUSE_UID_HIGH);
lo = tegra_fuse_readl(FUSE_UID_LOW);
hi = tegra_fuse_readl(FUSE_UID_HIGH);
return (hi << 32ull) | lo;
}

int tegra_sku_id(void)
{
int sku_id;
u32 reg = fuse_readl(FUSE_SKU_INFO);
u32 reg = tegra_fuse_readl(FUSE_SKU_INFO);
sku_id = reg & 0xFF;
return sku_id;
}

int tegra_cpu_process_id(void)
{
int cpu_process_id;
u32 reg = fuse_readl(FUSE_SPARE_BIT);
u32 reg = tegra_fuse_readl(FUSE_SPARE_BIT);
cpu_process_id = (reg >> 6) & 3;
return cpu_process_id;
}

int tegra_core_process_id(void)
{
int core_process_id;
u32 reg = fuse_readl(FUSE_SPARE_BIT);
u32 reg = tegra_fuse_readl(FUSE_SPARE_BIT);
core_process_id = (reg >> 12) & 3;
return core_process_id;
}

0 comments on commit 4785cb6

Please sign in to comment.