mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 09:41:44 +00:00
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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJRXv+xAAoJEMzrak5tbycxjscP/iw1p3mtm0/8levUUOty5vHB a4/5P5nFZDCxDW8eWbf4cN6lg4dWLDaWo9SLF1pRZXc5opliyAai8/qVJYz++2T1 6FsJOg+PqMks0UKBXS5yR+P84cdTB55B71NQpaGe2oCwyIjuNnAZ5rTp4+/1RO4S aXdshQA+1aWVrfGe3nvigrpyPSM2Mmul/Lf0dtyaoFVWknGJT+CWu6upgzwIAWiu C8oolkkqmrsU/m9m+PJtmdtn0aD8oGQOPSuCcz/ExAy7GhTgcuTRdiUjmrcBgr7t d4phwXQ2gKLdSHxToBKLxZbnRqM69I1h0Ybcxakz9ICsaQ3yE6J6qq4tYlqoezYZ l9TH5VmdfnWdU/1ZBqyX/8+EyzUu2fI6uR4d78FYkmVfcEoAe/YvOx7A/CFUI5zN kYvrLjaLTRCRsgM4WuRMLGR4TN3Zq6ciC/QECD83xMfyWjwZGWfi9+2DIdQv2ge4 DJoJhNTHCHq1fPWsadnYgL93DjXCF5+w+d3nVz0vxNHfVz6DEYJyepkfmX0poEu0 RJg32cnW8rwDcqM97vnzUnV3ZSU1VZUA3Upf7uZALPwjxV4m7fQbytQU9pd0YU5B ZNRRb6MY9xjU/Z5lK5lGNttbwfuIbKobNDiVY0lJKTrSTJLAOO9MHs8HQ+lMzYXa 1jO31FETA5RpCKrPHvSi =6+gD -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
494cc76061
@ -600,25 +600,6 @@ config ARCH_LPC32XX
|
||||
help
|
||||
Support for the NXP LPC32XX family of processors
|
||||
|
||||
config ARCH_TEGRA
|
||||
bool "NVIDIA Tegra"
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select CLKDEV_LOOKUP
|
||||
select CLKSRC_MMIO
|
||||
select CLKSRC_OF
|
||||
select COMMON_CLK
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_CLK
|
||||
select HAVE_SMP
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
select SOC_BUS
|
||||
select SPARSE_IRQ
|
||||
select USE_OF
|
||||
help
|
||||
This enables support for NVIDIA Tegra based systems (Tegra APX,
|
||||
Tegra 6xx and Tegra 2 series).
|
||||
|
||||
config ARCH_PXA
|
||||
bool "PXA2xx/PXA3xx-based"
|
||||
depends on MMU
|
||||
|
@ -1,13 +1,28 @@
|
||||
if ARCH_TEGRA
|
||||
config ARCH_TEGRA
|
||||
bool "NVIDIA Tegra" if ARCH_MULTI_V7
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select CLKDEV_LOOKUP
|
||||
select CLKSRC_MMIO
|
||||
select CLKSRC_OF
|
||||
select COMMON_CLK
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_CLK
|
||||
select HAVE_SMP
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
select SOC_BUS
|
||||
select SPARSE_IRQ
|
||||
select USE_OF
|
||||
help
|
||||
This enables support for NVIDIA Tegra based systems.
|
||||
|
||||
comment "NVIDIA Tegra options"
|
||||
menu "NVIDIA Tegra options"
|
||||
depends on ARCH_TEGRA
|
||||
|
||||
config ARCH_TEGRA_2x_SOC
|
||||
bool "Enable support for Tegra20 family"
|
||||
select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
|
||||
select ARM_ERRATA_720789
|
||||
select ARM_ERRATA_742230 if SMP
|
||||
select ARM_ERRATA_751472
|
||||
select ARM_ERRATA_754327 if SMP
|
||||
select ARM_ERRATA_764369 if SMP
|
||||
select ARM_GIC
|
||||
@ -26,8 +41,6 @@ config ARCH_TEGRA_2x_SOC
|
||||
|
||||
config ARCH_TEGRA_3x_SOC
|
||||
bool "Enable support for Tegra30 family"
|
||||
select ARM_ERRATA_743622
|
||||
select ARM_ERRATA_751472
|
||||
select ARM_ERRATA_754322
|
||||
select ARM_ERRATA_764369 if SMP
|
||||
select ARM_GIC
|
||||
@ -71,4 +84,4 @@ config TEGRA_AHB
|
||||
config TEGRA_EMC_SCALING_ENABLE
|
||||
bool "Enable scaling the memory frequency"
|
||||
|
||||
endif
|
||||
endmenu
|
||||
|
@ -1,3 +0,0 @@
|
||||
zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000
|
||||
params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100
|
||||
initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000
|
@ -40,6 +40,7 @@ int tegra_clk_debugfs_init(void);
|
||||
static inline int tegra_clk_debugfs_init(void) { return 0; }
|
||||
#endif
|
||||
|
||||
int __init tegra_powergate_init(void);
|
||||
#if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS)
|
||||
int __init tegra_powergate_debugfs_init(void);
|
||||
#else
|
||||
|
@ -27,8 +27,6 @@
|
||||
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
|
||||
#include <mach/powergate.h>
|
||||
|
||||
#include "board.h"
|
||||
#include "common.h"
|
||||
#include "fuse.h"
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-tegra/include/mach/timex.h
|
||||
*
|
||||
* Copyright (C) 2010 Google, Inc.
|
||||
*
|
||||
* Author:
|
||||
* Colin Cross <ccross@google.com>
|
||||
* Erik Gilling <konkers@google.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MACH_TEGRA_TIMEX_H
|
||||
#define __MACH_TEGRA_TIMEX_H
|
||||
|
||||
#define CLOCK_TICK_RATE 1000000
|
||||
|
||||
#endif
|
@ -1,175 +0,0 @@
|
||||
/*
|
||||
* arch/arm/mach-tegra/include/mach/uncompress.h
|
||||
*
|
||||
* Copyright (C) 2010 Google, Inc.
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
* Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved.
|
||||
*
|
||||
* Author:
|
||||
* Colin Cross <ccross@google.com>
|
||||
* Erik Gilling <konkers@google.com>
|
||||
* Doug Anderson <dianders@chromium.org>
|
||||
* Stephen Warren <swarren@nvidia.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MACH_TEGRA_UNCOMPRESS_H
|
||||
#define __MACH_TEGRA_UNCOMPRESS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/serial_reg.h>
|
||||
|
||||
#include "../../iomap.h"
|
||||
|
||||
#define BIT(x) (1 << (x))
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
#define DEBUG_UART_SHIFT 2
|
||||
|
||||
volatile u8 *uart;
|
||||
|
||||
static void putc(int c)
|
||||
{
|
||||
if (uart == NULL)
|
||||
return;
|
||||
|
||||
while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE))
|
||||
barrier();
|
||||
uart[UART_TX << DEBUG_UART_SHIFT] = c;
|
||||
}
|
||||
|
||||
static inline void flush(void)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct {
|
||||
u32 base;
|
||||
u32 reset_reg;
|
||||
u32 clock_reg;
|
||||
u32 bit;
|
||||
} uarts[] = {
|
||||
{
|
||||
TEGRA_UARTA_BASE,
|
||||
TEGRA_CLK_RESET_BASE + 0x04,
|
||||
TEGRA_CLK_RESET_BASE + 0x10,
|
||||
6,
|
||||
},
|
||||
{
|
||||
TEGRA_UARTB_BASE,
|
||||
TEGRA_CLK_RESET_BASE + 0x04,
|
||||
TEGRA_CLK_RESET_BASE + 0x10,
|
||||
7,
|
||||
},
|
||||
{
|
||||
TEGRA_UARTC_BASE,
|
||||
TEGRA_CLK_RESET_BASE + 0x08,
|
||||
TEGRA_CLK_RESET_BASE + 0x14,
|
||||
23,
|
||||
},
|
||||
{
|
||||
TEGRA_UARTD_BASE,
|
||||
TEGRA_CLK_RESET_BASE + 0x0c,
|
||||
TEGRA_CLK_RESET_BASE + 0x18,
|
||||
1,
|
||||
},
|
||||
{
|
||||
TEGRA_UARTE_BASE,
|
||||
TEGRA_CLK_RESET_BASE + 0x0c,
|
||||
TEGRA_CLK_RESET_BASE + 0x18,
|
||||
2,
|
||||
},
|
||||
};
|
||||
|
||||
static inline bool uart_clocked(int i)
|
||||
{
|
||||
if (*(u8 *)uarts[i].reset_reg & BIT(uarts[i].bit))
|
||||
return false;
|
||||
|
||||
if (!(*(u8 *)uarts[i].clock_reg & BIT(uarts[i].bit)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
|
||||
int auto_odmdata(void)
|
||||
{
|
||||
volatile u32 *pmc = (volatile u32 *)TEGRA_PMC_BASE;
|
||||
u32 odmdata = pmc[0xa0 / 4];
|
||||
|
||||
/*
|
||||
* Bits 19:18 are the console type: 0=default, 1=none, 2==DCC, 3==UART
|
||||
* Some boards apparently swap the last two values, but we don't have
|
||||
* any way of catering for that here, so we just accept either. If this
|
||||
* doesn't make sense for your board, just don't enable this feature.
|
||||
*
|
||||
* Bits 17:15 indicate the UART to use, 0/1/2/3/4 are UART A/B/C/D/E.
|
||||
*/
|
||||
|
||||
switch ((odmdata >> 18) & 3) {
|
||||
case 2:
|
||||
case 3:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (odmdata >> 15) & 7;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Setup before decompression. This is where we do UART selection for
|
||||
* earlyprintk and init the uart_base register.
|
||||
*/
|
||||
static inline void arch_decomp_setup(void)
|
||||
{
|
||||
int uart_id;
|
||||
volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE;
|
||||
u32 chip, div;
|
||||
|
||||
#if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
|
||||
uart_id = auto_odmdata();
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
|
||||
uart_id = 0;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
|
||||
uart_id = 1;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
|
||||
uart_id = 2;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
|
||||
uart_id = 3;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
|
||||
uart_id = 4;
|
||||
#endif
|
||||
|
||||
if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) ||
|
||||
!uart_clocked(uart_id))
|
||||
uart = NULL;
|
||||
else
|
||||
uart = (volatile u8 *)uarts[uart_id].base;
|
||||
|
||||
if (uart == NULL)
|
||||
return;
|
||||
|
||||
chip = (apb_misc[0x804 / 4] >> 8) & 0xff;
|
||||
if (chip == 0x20)
|
||||
div = 0x0075;
|
||||
else
|
||||
div = 0x00dd;
|
||||
|
||||
uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB;
|
||||
uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff;
|
||||
uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8;
|
||||
uart[UART_LCR << DEBUG_UART_SHIFT] = 3;
|
||||
}
|
||||
|
||||
#endif
|
@ -34,12 +34,11 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/clk/tegra.h>
|
||||
#include <linux/tegra-powergate.h>
|
||||
|
||||
#include <asm/sizes.h>
|
||||
#include <asm/mach/pci.h>
|
||||
|
||||
#include <mach/powergate.h>
|
||||
|
||||
#include "board.h"
|
||||
#include "iomap.h"
|
||||
|
||||
|
@ -27,8 +27,7 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/clk/tegra.h>
|
||||
|
||||
#include <mach/powergate.h>
|
||||
#include <linux/tegra-powergate.h>
|
||||
|
||||
#include "fuse.h"
|
||||
#include "iomap.h"
|
||||
|
@ -22,8 +22,7 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/clk/tegra.h>
|
||||
|
||||
#include <mach/powergate.h>
|
||||
#include <linux/tegra-powergate.h>
|
||||
|
||||
#include "clk.h"
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
/*
|
||||
* drivers/regulator/tegra-regulator.c
|
||||
*
|
||||
* Copyright (c) 2010 Google, Inc
|
||||
*
|
||||
* Author:
|
||||
@ -40,9 +38,6 @@ struct clk;
|
||||
#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU
|
||||
#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
|
||||
|
||||
int __init tegra_powergate_init(void);
|
||||
|
||||
int tegra_cpu_powergate_id(int cpuid);
|
||||
int tegra_powergate_is_powered(int id);
|
||||
int tegra_powergate_power_on(int id);
|
||||
int tegra_powergate_power_off(int id);
|
Loading…
Reference in New Issue
Block a user