aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/Kconfig1
-rw-r--r--arch/arm/mach-tegra/fuse.c41
-rw-r--r--arch/arm/mach-tegra/iomap.h14
-rw-r--r--arch/arm/mach-tegra/tegra.c4
4 files changed, 49 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 15c09294effa..d1a12a496525 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -65,6 +65,7 @@ config ARCH_TEGRA_124_SOC
65 bool "Enable support for Tegra124 family" 65 bool "Enable support for Tegra124 family"
66 select ARM_L1_CACHE_SHIFT_6 66 select ARM_L1_CACHE_SHIFT_6
67 select HAVE_ARM_ARCH_TIMER 67 select HAVE_ARM_ARCH_TIMER
68 select PINCTRL_TEGRA124
68 help 69 help
69 Support for NVIDIA Tegra T124 processor family, based on the 70 Support for NVIDIA Tegra T124 processor family, based on the
70 ARM CortexA15MP CPU 71 ARM CortexA15MP CPU
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index 3a9c1f1c219d..c9ac23b385be 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/export.h> 23#include <linux/export.h>
24#include <linux/random.h> 24#include <linux/random.h>
25#include <linux/clk.h>
25#include <linux/tegra-soc.h> 26#include <linux/tegra-soc.h>
26 27
27#include "fuse.h" 28#include "fuse.h"
@@ -54,6 +55,7 @@ int tegra_cpu_speedo_id; /* only exist in Tegra30 and later */
54int tegra_soc_speedo_id; 55int tegra_soc_speedo_id;
55enum tegra_revision tegra_revision; 56enum tegra_revision tegra_revision;
56 57
58static struct clk *fuse_clk;
57static int tegra_fuse_spare_bit; 59static int tegra_fuse_spare_bit;
58static void (*tegra_init_speedo_data)(void); 60static void (*tegra_init_speedo_data)(void);
59 61
@@ -77,6 +79,22 @@ static const char *tegra_revision_name[TEGRA_REVISION_MAX] = {
77 [TEGRA_REVISION_A04] = "A04", 79 [TEGRA_REVISION_A04] = "A04",
78}; 80};
79 81
82static void tegra_fuse_enable_clk(void)
83{
84 if (IS_ERR(fuse_clk))
85 fuse_clk = clk_get_sys(NULL, "fuse");
86 if (IS_ERR(fuse_clk))
87 return;
88 clk_prepare_enable(fuse_clk);
89}
90
91static void tegra_fuse_disable_clk(void)
92{
93 if (IS_ERR(fuse_clk))
94 return;
95 clk_disable_unprepare(fuse_clk);
96}
97
80u32 tegra_fuse_readl(unsigned long offset) 98u32 tegra_fuse_readl(unsigned long offset)
81{ 99{
82 return tegra_apb_readl(TEGRA_FUSE_BASE + offset); 100 return tegra_apb_readl(TEGRA_FUSE_BASE + offset);
@@ -84,7 +102,15 @@ u32 tegra_fuse_readl(unsigned long offset)
84 102
85bool tegra_spare_fuse(int bit) 103bool tegra_spare_fuse(int bit)
86{ 104{
87 return tegra_fuse_readl(tegra_fuse_spare_bit + bit * 4); 105 bool ret;
106
107 tegra_fuse_enable_clk();
108
109 ret = tegra_fuse_readl(tegra_fuse_spare_bit + bit * 4);
110
111 tegra_fuse_disable_clk();
112
113 return ret;
88} 114}
89 115
90static enum tegra_revision tegra_get_revision(u32 id) 116static enum tegra_revision tegra_get_revision(u32 id)
@@ -113,10 +139,14 @@ static void tegra_get_process_id(void)
113{ 139{
114 u32 reg; 140 u32 reg;
115 141
142 tegra_fuse_enable_clk();
143
116 reg = tegra_fuse_readl(tegra_fuse_spare_bit); 144 reg = tegra_fuse_readl(tegra_fuse_spare_bit);
117 tegra_cpu_process_id = (reg >> 6) & 3; 145 tegra_cpu_process_id = (reg >> 6) & 3;
118 reg = tegra_fuse_readl(tegra_fuse_spare_bit); 146 reg = tegra_fuse_readl(tegra_fuse_spare_bit);
119 tegra_core_process_id = (reg >> 12) & 3; 147 tegra_core_process_id = (reg >> 12) & 3;
148
149 tegra_fuse_disable_clk();
120} 150}
121 151
122u32 tegra_read_chipid(void) 152u32 tegra_read_chipid(void)
@@ -159,6 +189,15 @@ void __init tegra_init_fuse(void)
159 reg |= 1 << 28; 189 reg |= 1 << 28;
160 writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48)); 190 writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
161 191
192 /*
193 * Enable FUSE clock. This needs to be hardcoded because the clock
194 * subsystem is not active during early boot.
195 */
196 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x14));
197 reg |= 1 << 7;
198 writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x14));
199 fuse_clk = ERR_PTR(-EINVAL);
200
162 reg = tegra_fuse_readl(FUSE_SKU_INFO); 201 reg = tegra_fuse_readl(FUSE_SKU_INFO);
163 randomness[0] = reg; 202 randomness[0] = reg;
164 tegra_sku_id = reg & 0xFF; 203 tegra_sku_id = reg & 0xFF;
diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h
index 26b1c2ad0ceb..ee79808e93a3 100644
--- a/arch/arm/mach-tegra/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -19,6 +19,7 @@
19#ifndef __MACH_TEGRA_IOMAP_H 19#ifndef __MACH_TEGRA_IOMAP_H
20#define __MACH_TEGRA_IOMAP_H 20#define __MACH_TEGRA_IOMAP_H
21 21
22#include <asm/pgtable.h>
22#include <asm/sizes.h> 23#include <asm/sizes.h>
23 24
24#define TEGRA_IRAM_BASE 0x40000000 25#define TEGRA_IRAM_BASE 0x40000000
@@ -115,27 +116,26 @@
115 * two 256MB io windows (that actually only use about 64KB 116 * two 256MB io windows (that actually only use about 64KB
116 * at the start of each). 117 * at the start of each).
117 * 118 *
118 * We will just map the first 1MB of each window (to minimize 119 * We will just map the first MMU section of each window (to minimize
119 * pt entries needed) and provide a macro to transform physical 120 * pt entries needed) and provide a macro to transform physical
120 * io addresses to an appropriate void __iomem *. 121 * io addresses to an appropriate void __iomem *.
121 *
122 */ 122 */
123 123
124#define IO_IRAM_PHYS 0x40000000 124#define IO_IRAM_PHYS 0x40000000
125#define IO_IRAM_VIRT IOMEM(0xFE400000) 125#define IO_IRAM_VIRT IOMEM(0xFE400000)
126#define IO_IRAM_SIZE SZ_256K 126#define IO_IRAM_SIZE SZ_256K
127 127
128#define IO_CPU_PHYS 0x50040000 128#define IO_CPU_PHYS 0x50040000
129#define IO_CPU_VIRT IOMEM(0xFE000000) 129#define IO_CPU_VIRT IOMEM(0xFE440000)
130#define IO_CPU_SIZE SZ_16K 130#define IO_CPU_SIZE SZ_16K
131 131
132#define IO_PPSB_PHYS 0x60000000 132#define IO_PPSB_PHYS 0x60000000
133#define IO_PPSB_VIRT IOMEM(0xFE200000) 133#define IO_PPSB_VIRT IOMEM(0xFE200000)
134#define IO_PPSB_SIZE SZ_1M 134#define IO_PPSB_SIZE SECTION_SIZE
135 135
136#define IO_APB_PHYS 0x70000000 136#define IO_APB_PHYS 0x70000000
137#define IO_APB_VIRT IOMEM(0xFE300000) 137#define IO_APB_VIRT IOMEM(0xFE000000)
138#define IO_APB_SIZE SZ_1M 138#define IO_APB_SIZE SECTION_SIZE
139 139
140#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) 140#define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz)))
141#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst))) 141#define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst)))
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 73368176c6e8..ea14d380fc0c 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -60,15 +60,13 @@
60 * kernel is loaded. The data is declared here rather than debug-macro.S so 60 * kernel is loaded. The data is declared here rather than debug-macro.S so
61 * that multiple inclusions of debug-macro.S point at the same data. 61 * that multiple inclusions of debug-macro.S point at the same data.
62 */ 62 */
63u32 tegra_uart_config[4] = { 63u32 tegra_uart_config[3] = {
64 /* Debug UART initialization required */ 64 /* Debug UART initialization required */
65 1, 65 1,
66 /* Debug UART physical address */ 66 /* Debug UART physical address */
67 0, 67 0,
68 /* Debug UART virtual address */ 68 /* Debug UART virtual address */
69 0, 69 0,
70 /* Scratch space for debug macro */
71 0,
72}; 70};
73 71
74static void __init tegra_init_cache(void) 72static void __init tegra_init_cache(void)