Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
73625e3
Documentation
arch
alpha
arm
boot
common
configs
include
kernel
lib
mach-aaec2000
mach-at91
mach-bcmring
mach-clps711x
mach-cns3xxx
mach-davinci
mach-dove
mach-ebsa110
mach-ep93xx
mach-footbridge
mach-gemini
mach-h720x
mach-imx
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp2000
mach-ixp23xx
mach-ixp4xx
mach-kirkwood
mach-ks8695
mach-l7200
mach-lh7a40x
mach-loki
mach-lpc32xx
mach-mmp
mach-msm
mach-mv78xx0
mach-mx25
mach-mx3
mach-mx5
mach-mxc91231
mach-netx
mach-nomadik
mach-ns9xxx
mach-nuc93x
mach-omap1
mach-omap2
mach-orion5x
mach-pnx4008
mach-pxa
mach-realview
mach-rpc
mach-s3c2400
mach-s3c2410
mach-s3c2412
mach-s3c2416
mach-s3c2440
mach-s3c2443
mach-s3c24a0
mach-s3c64xx
mach-s5p6442
mach-s5p64x0
mach-s5pc100
mach-s5pv210
mach-s5pv310
mach-sa1100
mach-shark
mach-shmobile
mach-spear3xx
mach-spear6xx
mach-stmp378x
mach-stmp37xx
mach-tcc8k
mach-tegra
include
Kconfig
Makefile
Makefile.boot
board-harmony-pinmux.c
board-harmony.c
board-harmony.h
board.h
clock.c
clock.h
common.c
fuse.c
fuse.h
gpio-names.h
gpio.c
headsmp.S
hotplug.c
io.c
irq.c
legacy_irq.c
localtimer.c
pinmux-t2-tables.c
pinmux.c
platsmp.c
tegra2_clocks.c
timer.c
mach-u300
mach-ux500
mach-versatile
mach-vexpress
mach-w90x900
mm
nwfpe
oprofile
plat-iop
plat-mxc
plat-nomadik
plat-omap
plat-orion
plat-pxa
plat-s3c24xx
plat-s5p
plat-samsung
plat-spear
plat-stmp3xxx
plat-tcc
plat-versatile
tools
vfp
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile
avr32
blackfin
cris
frv
h8300
ia64
m32r
m68k
m68knommu
microblaze
mips
mn10300
parisc
powerpc
s390
score
sh
sparc
tile
um
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm
/
mach-tegra
/
fuse.c
Copy path
Blame
Blame
Latest commit
Colin Cross
[ARM] tegra: Add support for reading fuses
Oct 22, 2010
73625e3
·
Oct 22, 2010
History
History
84 lines (71 loc) · 1.88 KB
Breadcrumbs
linux
/
arch
/
arm
/
mach-tegra
/
fuse.c
Top
File metadata and controls
Code
Blame
84 lines (71 loc) · 1.88 KB
Raw
/* * arch/arm/mach-tegra/fuse.c * * Copyright (C) 2010 Google, Inc. * * Author: * Colin Cross <ccross@android.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/kernel.h> #include <linux/io.h> #include <mach/iomap.h> #include "fuse.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) { 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)); } void tegra_init_fuse(void) { u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); reg |= 1 << 28; writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); pr_info("Tegra SKU: %d CPU Process: %d Core Process: %d\n", tegra_sku_id(), tegra_cpu_process_id(), tegra_core_process_id()); } unsigned long long tegra_chip_uid(void) { unsigned long long lo, hi; lo = fuse_readl(FUSE_UID_LOW); hi = fuse_readl(FUSE_UID_HIGH); return (hi << 32ull) | lo; } int tegra_sku_id(void) { int sku_id; u32 reg = 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); 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); core_process_id = (reg >> 12) & 3; return core_process_id; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
You can’t perform that action at this time.