aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig19
-rw-r--r--arch/arm/mach-tegra/Kconfig27
-rw-r--r--arch/arm/mach-tegra/Makefile.boot3
-rw-r--r--arch/arm/mach-tegra/board.h1
-rw-r--r--arch/arm/mach-tegra/common.c2
-rw-r--r--arch/arm/mach-tegra/include/mach/timex.h26
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h175
-rw-r--r--arch/arm/mach-tegra/pcie.c3
-rw-r--r--arch/arm/mach-tegra/powergate.c3
-rw-r--r--drivers/clk/tegra/clk-tegra30.c3
-rw-r--r--include/linux/tegra-powergate.h (renamed from arch/arm/mach-tegra/include/mach/powergate.h)5
11 files changed, 24 insertions, 243 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6584941e0fab..3a6333e66b41 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -600,25 +600,6 @@ config ARCH_LPC32XX
600 help 600 help
601 Support for the NXP LPC32XX family of processors 601 Support for the NXP LPC32XX family of processors
602 602
603config ARCH_TEGRA
604 bool "NVIDIA Tegra"
605 select ARCH_HAS_CPUFREQ
606 select ARCH_REQUIRE_GPIOLIB
607 select CLKDEV_LOOKUP
608 select CLKSRC_MMIO
609 select CLKSRC_OF
610 select COMMON_CLK
611 select GENERIC_CLOCKEVENTS
612 select HAVE_CLK
613 select HAVE_SMP
614 select MIGHT_HAVE_CACHE_L2X0
615 select SOC_BUS
616 select SPARSE_IRQ
617 select USE_OF
618 help
619 This enables support for NVIDIA Tegra based systems (Tegra APX,
620 Tegra 6xx and Tegra 2 series).
621
622config ARCH_PXA 603config ARCH_PXA
623 bool "PXA2xx/PXA3xx-based" 604 bool "PXA2xx/PXA3xx-based"
624 depends on MMU 605 depends on MMU
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index d1c4893894ce..df99ee93030a 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -1,13 +1,28 @@
1if ARCH_TEGRA 1config ARCH_TEGRA
2 bool "NVIDIA Tegra" if ARCH_MULTI_V7
3 select ARCH_HAS_CPUFREQ
4 select ARCH_REQUIRE_GPIOLIB
5 select CLKDEV_LOOKUP
6 select CLKSRC_MMIO
7 select CLKSRC_OF
8 select COMMON_CLK
9 select GENERIC_CLOCKEVENTS
10 select HAVE_CLK
11 select HAVE_SMP
12 select MIGHT_HAVE_CACHE_L2X0
13 select SOC_BUS
14 select SPARSE_IRQ
15 select USE_OF
16 help
17 This enables support for NVIDIA Tegra based systems.
2 18
3comment "NVIDIA Tegra options" 19menu "NVIDIA Tegra options"
20 depends on ARCH_TEGRA
4 21
5config ARCH_TEGRA_2x_SOC 22config ARCH_TEGRA_2x_SOC
6 bool "Enable support for Tegra20 family" 23 bool "Enable support for Tegra20 family"
7 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 24 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
8 select ARM_ERRATA_720789 25 select ARM_ERRATA_720789
9 select ARM_ERRATA_742230 if SMP
10 select ARM_ERRATA_751472
11 select ARM_ERRATA_754327 if SMP 26 select ARM_ERRATA_754327 if SMP
12 select ARM_ERRATA_764369 if SMP 27 select ARM_ERRATA_764369 if SMP
13 select ARM_GIC 28 select ARM_GIC
@@ -26,8 +41,6 @@ config ARCH_TEGRA_2x_SOC
26 41
27config ARCH_TEGRA_3x_SOC 42config ARCH_TEGRA_3x_SOC
28 bool "Enable support for Tegra30 family" 43 bool "Enable support for Tegra30 family"
29 select ARM_ERRATA_743622
30 select ARM_ERRATA_751472
31 select ARM_ERRATA_754322 44 select ARM_ERRATA_754322
32 select ARM_ERRATA_764369 if SMP 45 select ARM_ERRATA_764369 if SMP
33 select ARM_GIC 46 select ARM_GIC
@@ -71,4 +84,4 @@ config TEGRA_AHB
71config TEGRA_EMC_SCALING_ENABLE 84config TEGRA_EMC_SCALING_ENABLE
72 bool "Enable scaling the memory frequency" 85 bool "Enable scaling the memory frequency"
73 86
74endif 87endmenu
diff --git a/arch/arm/mach-tegra/Makefile.boot b/arch/arm/mach-tegra/Makefile.boot
deleted file mode 100644
index 29433816233c..000000000000
--- a/arch/arm/mach-tegra/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
1zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000
2params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100
3initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 60431de585ca..1787327fae3a 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -40,6 +40,7 @@ int tegra_clk_debugfs_init(void);
40static inline int tegra_clk_debugfs_init(void) { return 0; } 40static inline int tegra_clk_debugfs_init(void) { return 0; }
41#endif 41#endif
42 42
43int __init tegra_powergate_init(void);
43#if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS) 44#if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS)
44int __init tegra_powergate_debugfs_init(void); 45int __init tegra_powergate_debugfs_init(void);
45#else 46#else
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index eb1f3c8c74cc..9f852c6fe5b9 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -27,8 +27,6 @@
27 27
28#include <asm/hardware/cache-l2x0.h> 28#include <asm/hardware/cache-l2x0.h>
29 29
30#include <mach/powergate.h>
31
32#include "board.h" 30#include "board.h"
33#include "common.h" 31#include "common.h"
34#include "fuse.h" 32#include "fuse.h"
diff --git a/arch/arm/mach-tegra/include/mach/timex.h b/arch/arm/mach-tegra/include/mach/timex.h
deleted file mode 100644
index a44ccbdb7dbf..000000000000
--- a/arch/arm/mach-tegra/include/mach/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/timex.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 * Erik Gilling <konkers@google.com>
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 */
20
21#ifndef __MACH_TEGRA_TIMEX_H
22#define __MACH_TEGRA_TIMEX_H
23
24#define CLOCK_TICK_RATE 1000000
25
26#endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
deleted file mode 100644
index 08386418196f..000000000000
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ /dev/null
@@ -1,175 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/uncompress.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 Google, Inc.
6 * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved.
7 *
8 * Author:
9 * Colin Cross <ccross@google.com>
10 * Erik Gilling <konkers@google.com>
11 * Doug Anderson <dianders@chromium.org>
12 * Stephen Warren <swarren@nvidia.com>
13 *
14 * This software is licensed under the terms of the GNU General Public
15 * License version 2, as published by the Free Software Foundation, and
16 * may be copied, distributed, and modified under those terms.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 */
24
25#ifndef __MACH_TEGRA_UNCOMPRESS_H
26#define __MACH_TEGRA_UNCOMPRESS_H
27
28#include <linux/types.h>
29#include <linux/serial_reg.h>
30
31#include "../../iomap.h"
32
33#define BIT(x) (1 << (x))
34#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
35
36#define DEBUG_UART_SHIFT 2
37
38volatile u8 *uart;
39
40static void putc(int c)
41{
42 if (uart == NULL)
43 return;
44
45 while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE))
46 barrier();
47 uart[UART_TX << DEBUG_UART_SHIFT] = c;
48}
49
50static inline void flush(void)
51{
52}
53
54static const struct {
55 u32 base;
56 u32 reset_reg;
57 u32 clock_reg;
58 u32 bit;
59} uarts[] = {
60 {
61 TEGRA_UARTA_BASE,
62 TEGRA_CLK_RESET_BASE + 0x04,
63 TEGRA_CLK_RESET_BASE + 0x10,
64 6,
65 },
66 {
67 TEGRA_UARTB_BASE,
68 TEGRA_CLK_RESET_BASE + 0x04,
69 TEGRA_CLK_RESET_BASE + 0x10,
70 7,
71 },
72 {
73 TEGRA_UARTC_BASE,
74 TEGRA_CLK_RESET_BASE + 0x08,
75 TEGRA_CLK_RESET_BASE + 0x14,
76 23,
77 },
78 {
79 TEGRA_UARTD_BASE,
80 TEGRA_CLK_RESET_BASE + 0x0c,
81 TEGRA_CLK_RESET_BASE + 0x18,
82 1,
83 },
84 {
85 TEGRA_UARTE_BASE,
86 TEGRA_CLK_RESET_BASE + 0x0c,
87 TEGRA_CLK_RESET_BASE + 0x18,
88 2,
89 },
90};
91
92static inline bool uart_clocked(int i)
93{
94 if (*(u8 *)uarts[i].reset_reg & BIT(uarts[i].bit))
95 return false;
96
97 if (!(*(u8 *)uarts[i].clock_reg & BIT(uarts[i].bit)))
98 return false;
99
100 return true;
101}
102
103#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
104int auto_odmdata(void)
105{
106 volatile u32 *pmc = (volatile u32 *)TEGRA_PMC_BASE;
107 u32 odmdata = pmc[0xa0 / 4];
108
109 /*
110 * Bits 19:18 are the console type: 0=default, 1=none, 2==DCC, 3==UART
111 * Some boards apparently swap the last two values, but we don't have
112 * any way of catering for that here, so we just accept either. If this
113 * doesn't make sense for your board, just don't enable this feature.
114 *
115 * Bits 17:15 indicate the UART to use, 0/1/2/3/4 are UART A/B/C/D/E.
116 */
117
118 switch ((odmdata >> 18) & 3) {
119 case 2:
120 case 3:
121 break;
122 default:
123 return -1;
124 }
125
126 return (odmdata >> 15) & 7;
127}
128#endif
129
130/*
131 * Setup before decompression. This is where we do UART selection for
132 * earlyprintk and init the uart_base register.
133 */
134static inline void arch_decomp_setup(void)
135{
136 int uart_id;
137 volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE;
138 u32 chip, div;
139
140#if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
141 uart_id = auto_odmdata();
142#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
143 uart_id = 0;
144#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
145 uart_id = 1;
146#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
147 uart_id = 2;
148#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
149 uart_id = 3;
150#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
151 uart_id = 4;
152#endif
153
154 if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) ||
155 !uart_clocked(uart_id))
156 uart = NULL;
157 else
158 uart = (volatile u8 *)uarts[uart_id].base;
159
160 if (uart == NULL)
161 return;
162
163 chip = (apb_misc[0x804 / 4] >> 8) & 0xff;
164 if (chip == 0x20)
165 div = 0x0075;
166 else
167 div = 0x00dd;
168
169 uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB;
170 uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff;
171 uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8;
172 uart[UART_LCR << DEBUG_UART_SHIFT] = 3;
173}
174
175#endif
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index b60165f1ca02..46144a19a7e7 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -34,12 +34,11 @@
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/export.h> 35#include <linux/export.h>
36#include <linux/clk/tegra.h> 36#include <linux/clk/tegra.h>
37#include <linux/tegra-powergate.h>
37 38
38#include <asm/sizes.h> 39#include <asm/sizes.h>
39#include <asm/mach/pci.h> 40#include <asm/mach/pci.h>
40 41
41#include <mach/powergate.h>
42
43#include "board.h" 42#include "board.h"
44#include "iomap.h" 43#include "iomap.h"
45 44
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index c6bc8f85759c..585d2974a3c1 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -27,8 +27,7 @@
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/clk/tegra.h> 29#include <linux/clk/tegra.h>
30 30#include <linux/tegra-powergate.h>
31#include <mach/powergate.h>
32 31
33#include "fuse.h" 32#include "fuse.h"
34#include "iomap.h" 33#include "iomap.h"
diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index ba6f51bc9f3b..f15f147d473c 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -22,8 +22,7 @@
22#include <linux/of.h> 22#include <linux/of.h>
23#include <linux/of_address.h> 23#include <linux/of_address.h>
24#include <linux/clk/tegra.h> 24#include <linux/clk/tegra.h>
25 25#include <linux/tegra-powergate.h>
26#include <mach/powergate.h>
27 26
28#include "clk.h" 27#include "clk.h"
29 28
diff --git a/arch/arm/mach-tegra/include/mach/powergate.h b/include/linux/tegra-powergate.h
index 06763fe7529d..55c29a8d5015 100644
--- a/arch/arm/mach-tegra/include/mach/powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * drivers/regulator/tegra-regulator.c
3 *
4 * Copyright (c) 2010 Google, Inc 2 * Copyright (c) 2010 Google, Inc
5 * 3 *
6 * Author: 4 * Author:
@@ -40,9 +38,6 @@ struct clk;
40#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU 38#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU
41#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 39#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
42 40
43int __init tegra_powergate_init(void);
44
45int tegra_cpu_powergate_id(int cpuid);
46int tegra_powergate_is_powered(int id); 41int tegra_powergate_is_powered(int id);
47int tegra_powergate_power_on(int id); 42int tegra_powergate_power_on(int id);
48int tegra_powergate_power_off(int id); 43int tegra_powergate_power_off(int id);