Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'tegra-for-3.10-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/multiplatform

From Stephen Warren <swarren@wwwdotorg.org>:

ARM: tegra: multi-platform conversion

This branch converts Tegra to support multi-platform/single-zImage.

One header is made accessible to drivers. The earlyprintk implementation
is moved to the multi-platform location. Some Kconfig changes are made
to enable multi-platform. Some dead files are deleted.

The APIs exposed in the now-global tegra-powergate.h should be replaced
with standard reset and power domain APIs in the future.

This branch is based on (part of) the previous soc pull request.

* tag 'tegra-for-3.10-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
ARM: tegra: convert to multi-platform
ARM: tegra: move <mach/powergate.h> to <linux/tegra-powergate.h>

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+24 -243
-19
arch/arm/Kconfig
··· 600 600 help 601 601 Support for the NXP LPC32XX family of processors 602 602 603 - config 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 - 622 603 config ARCH_PXA 623 604 bool "PXA2xx/PXA3xx-based" 624 605 depends on MMU
+20 -7
arch/arm/mach-tegra/Kconfig
··· 1 - if ARCH_TEGRA 1 + config 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 3 - comment "NVIDIA Tegra options" 19 + menu "NVIDIA Tegra options" 20 + depends on ARCH_TEGRA 4 21 5 22 config ARCH_TEGRA_2x_SOC 6 23 bool "Enable support for Tegra20 family" 7 24 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 8 25 select ARM_ERRATA_720789 9 - select ARM_ERRATA_742230 if SMP 10 - select ARM_ERRATA_751472 11 26 select ARM_ERRATA_754327 if SMP 12 27 select ARM_ERRATA_764369 if SMP 13 28 select ARM_GIC ··· 41 26 42 27 config ARCH_TEGRA_3x_SOC 43 28 bool "Enable support for Tegra30 family" 44 - select ARM_ERRATA_743622 45 - select ARM_ERRATA_751472 46 29 select ARM_ERRATA_754322 47 30 select ARM_ERRATA_764369 if SMP 48 31 select ARM_GIC ··· 84 71 config TEGRA_EMC_SCALING_ENABLE 85 72 bool "Enable scaling the memory frequency" 86 73 87 - endif 74 + endmenu
-3
arch/arm/mach-tegra/Makefile.boot
··· 1 - zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000 2 - params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100 3 - initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000
+1
arch/arm/mach-tegra/board.h
··· 40 40 static inline int tegra_clk_debugfs_init(void) { return 0; } 41 41 #endif 42 42 43 + int __init tegra_powergate_init(void); 43 44 #if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS) 44 45 int __init tegra_powergate_debugfs_init(void); 45 46 #else
-2
arch/arm/mach-tegra/common.c
··· 27 27 28 28 #include <asm/hardware/cache-l2x0.h> 29 29 30 - #include <mach/powergate.h> 31 - 32 30 #include "board.h" 33 31 #include "common.h" 34 32 #include "fuse.h"
-5
arch/arm/mach-tegra/include/mach/powergate.h include/linux/tegra-powergate.h
··· 1 1 /* 2 - * drivers/regulator/tegra-regulator.c 3 - * 4 2 * Copyright (c) 2010 Google, Inc 5 3 * 6 4 * Author: ··· 38 40 #define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU 39 41 #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 40 42 41 - int __init tegra_powergate_init(void); 42 - 43 - int tegra_cpu_powergate_id(int cpuid); 44 43 int tegra_powergate_is_powered(int id); 45 44 int tegra_powergate_power_on(int id); 46 45 int tegra_powergate_power_off(int id);
-26
arch/arm/mach-tegra/include/mach/timex.h
··· 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
-175
arch/arm/mach-tegra/include/mach/uncompress.h
··· 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 - 38 - volatile u8 *uart; 39 - 40 - static 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 - 50 - static inline void flush(void) 51 - { 52 - } 53 - 54 - static 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 - 92 - static 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 104 - int 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 - */ 134 - static 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
+1 -2
arch/arm/mach-tegra/pcie.c
··· 34 34 #include <linux/delay.h> 35 35 #include <linux/export.h> 36 36 #include <linux/clk/tegra.h> 37 + #include <linux/tegra-powergate.h> 37 38 38 39 #include <asm/sizes.h> 39 40 #include <asm/mach/pci.h> 40 - 41 - #include <mach/powergate.h> 42 41 43 42 #include "board.h" 44 43 #include "iomap.h"
+1 -2
arch/arm/mach-tegra/powergate.c
··· 27 27 #include <linux/seq_file.h> 28 28 #include <linux/spinlock.h> 29 29 #include <linux/clk/tegra.h> 30 - 31 - #include <mach/powergate.h> 30 + #include <linux/tegra-powergate.h> 32 31 33 32 #include "fuse.h" 34 33 #include "iomap.h"
+1 -2
drivers/clk/tegra/clk-tegra30.c
··· 22 22 #include <linux/of.h> 23 23 #include <linux/of_address.h> 24 24 #include <linux/clk/tegra.h> 25 - 26 - #include <mach/powergate.h> 25 + #include <linux/tegra-powergate.h> 27 26 28 27 #include "clk.h" 29 28