aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-09-26 15:08:59 -0400
committerStephen Warren <swarren@nvidia.com>2013-03-29 20:10:25 -0400
commit9002722560ba86a2f59811e3d11a2575bf47e1f6 (patch)
tree3bbdaa0359cf2b64740dbd4e3aec5eb219b96f48 /arch/arm
parente4bcda28344cc4762c57ad7333f0472a39e83479 (diff)
ARM: tegra: convert to multi-platform
This allows Tegra be included in a kernel build that supports multiple SoCs at once, which is useful for distro kernels. This change: * Moves Tegra's Kconfig into its own directory, as seems typical for multi-platform conversions. * Stops selecting some ARM errata that are incompatible with multi- platform. This requires that you use a bootloader that enables the workaround! * Deletes some headers and Makefile.boot that aren't needed now that we support multi-platform. Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm')
-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/include/mach/timex.h26
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h175
5 files changed, 20 insertions, 230 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 59b7be794582..f6dfe23eb57d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -663,25 +663,6 @@ config ARCH_LPC32XX
663 help 663 help
664 Support for the NXP LPC32XX family of processors 664 Support for the NXP LPC32XX family of processors
665 665
666config ARCH_TEGRA
667 bool "NVIDIA Tegra"
668 select ARCH_HAS_CPUFREQ
669 select ARCH_REQUIRE_GPIOLIB
670 select CLKDEV_LOOKUP
671 select CLKSRC_MMIO
672 select CLKSRC_OF
673 select COMMON_CLK
674 select GENERIC_CLOCKEVENTS
675 select HAVE_CLK
676 select HAVE_SMP
677 select MIGHT_HAVE_CACHE_L2X0
678 select SOC_BUS
679 select SPARSE_IRQ
680 select USE_OF
681 help
682 This enables support for NVIDIA Tegra based systems (Tegra APX,
683 Tegra 6xx and Tegra 2 series).
684
685config ARCH_PXA 666config ARCH_PXA
686 bool "PXA2xx/PXA3xx-based" 667 bool "PXA2xx/PXA3xx-based"
687 depends on MMU 668 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/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