Skip to content

Commit 783c8f4

Browse files
p2mate-nvthierryreding
authored andcommitted
soc/tegra: Add efuse driver for Tegra
Implement fuse driver for Tegra20, Tegra30, Tegra114 and Tegra124. This replaces functionality previously provided in arch/arm/mach-tegra, which is removed in this patch. While at it, move the only user of the global tegra_revision variable over to tegra_sku_info.revision and export tegra_fuse_readl() to allow drivers to read calibration fuses. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 35874f3 commit 783c8f4

20 files changed

Lines changed: 1047 additions & 461 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
What: /sys/devices/*/<our-device>/fuse
2+
Date: February 2014
3+
Contact: Peter De Schrijver <pdeschrijver@nvidia.com>
4+
Description: read-only access to the efuses on Tegra20, Tegra30, Tegra114
5+
and Tegra124 SoC's from NVIDIA. The efuses contain write once
6+
data programmed at the factory. The data is layed out in 32bit
7+
words in LSB first format. Each bit represents a single value
8+
as decoded from the fuse registers. Bits order/assignment
9+
exactly matches the HW registers, including any unused bits.
10+
Users: any user space application which wants to read the efuses on
11+
Tegra SoC's

‎arch/arm/mach-tegra/Makefile‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ asflags-y += -march=armv7-a
22

33
obj-y += io.o
44
obj-y += irq.o
5-
obj-y += fuse.o
65
obj-y += pmc.o
76
obj-y += flowctrl.o
87
obj-y += powergate.o
@@ -13,13 +12,11 @@ obj-y += reset-handler.o
1312
obj-y += sleep.o
1413
obj-y += tegra.o
1514
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
16-
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o
1715
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o
1816
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pm-tegra20.o
1917
ifeq ($(CONFIG_CPU_IDLE),y)
2018
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += cpuidle-tegra20.o
2119
endif
22-
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_speedo.o
2320
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-tegra30.o
2421
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pm-tegra30.o
2522
ifeq ($(CONFIG_CPU_IDLE),y)
@@ -28,7 +25,6 @@ endif
2825
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
2926
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
3027

31-
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114_speedo.o
3228
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += sleep-tegra30.o
3329
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += pm-tegra30.o
3430
ifeq ($(CONFIG_CPU_IDLE),y)

‎arch/arm/mach-tegra/fuse.c‎

Lines changed: 0 additions & 260 deletions
This file was deleted.

‎arch/arm/mach-tegra/fuse.h‎

Lines changed: 0 additions & 60 deletions
This file was deleted.

‎arch/arm/mach-tegra/reset.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <asm/firmware.h>
2626
#include <asm/hardware/cache-l2x0.h>
2727

28-
#include "fuse.h"
2928
#include "iomap.h"
3029
#include "irammap.h"
3130
#include "reset.h"

‎arch/arm/mach-tegra/tegra.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ static void __init tegra_dt_init(void)
104104
goto out;
105105

106106
soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra");
107-
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_revision);
107+
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d",
108+
tegra_sku_info.revision);
108109
soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id());
109110

110111
soc_dev = soc_device_register(soc_dev_attr);

‎drivers/misc/fuse/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_ARCH_TEGRA) += tegra/

‎drivers/soc/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
#
44

55
obj-$(CONFIG_ARCH_QCOM) += qcom/
6+
obj-$(CONFIG_ARCH_TEGRA) += tegra/

‎drivers/soc/tegra/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_ARCH_TEGRA) += fuse/

‎drivers/soc/tegra/fuse/Makefile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
obj-y += fuse-tegra.o
2+
obj-y += fuse-tegra30.o
3+
obj-y += tegra-apbmisc.o
4+
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += fuse-tegra20.o
5+
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += speedo-tegra20.o
6+
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += speedo-tegra30.o
7+
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += speedo-tegra114.o
8+
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += speedo-tegra124.o

0 commit comments

Comments
 (0)