Skip to content

Commit

Permalink
Merge tag 'tegra-for-3.13-soc-v2' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/swarren/linux-tegra into next/soc

From Stephen Warren:
ARM: tegra: core SoC support changes for 3.13

This branch includes:
* SoC fuse values are used as device randomness at boot.
* Initial support for the Tegra124 SoC is added. When coupled with an
  appropriate clock driver, which should also be merged for 3.13, we are
  able to boot to user-space using an initrd.
* The powergate code gains support for Tegra114.

This branch is based on previous pull request tegra-for-3.13-cleanup.

* tag 'tegra-for-3.13-soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: Add Tegra114 powergate support
  ARM: tegra: Constify list of CPU domains
  ARM: tegra: Remove duplicate powergate defines
  ARM: tegra: add LP1 support code for Tegra124
  ARM: tegra: re-calculate the LP1 data for Tegra30/114
  ARM: tegra: enable CPU idle for Tegra124
  ARM: tegra: make tegra_resume can work with current and later chips
  ARM: tegra: CPU hotplug support for Tegra124
  ARM: tegra: add PMC compatible value for Tegra124
  ARM: tegra: add Tegra124 SoC support
  ARM: tegra: add fuses as device randomness
  ARM: tegra: fix ARCH_TEGRA_114_SOC select sort order
  ARM: tegra: make tegra_init_fuse() __init
  ARM: tegra: remove much of iomap.h
  ARM: tegra: move resume vector define to irammap.h
  ARM: tegra: delete gpio-names.h
  ARM: tegra: delete stale header content
  ARM: tegra: remove common.c
  ARM: tegra: split tegra_pmc_init() in two

Signed-off-by: Kevin Hilman <khilman@linaro.org>
  • Loading branch information
Kevin Hilman committed Oct 25, 2013
2 parents abcba00 + bd6a9dd commit 4dcf033
Show file tree
Hide file tree
Showing 26 changed files with 320 additions and 625 deletions.
10 changes: 9 additions & 1 deletion arch/arm/mach-tegra/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ config ARCH_TEGRA_3x_SOC

config ARCH_TEGRA_114_SOC
bool "Enable support for Tegra114 family"
select HAVE_ARM_ARCH_TIMER
select ARM_ERRATA_798181
select ARM_L1_CACHE_SHIFT_6
select HAVE_ARM_ARCH_TIMER
select PINCTRL_TEGRA114
help
Support for NVIDIA Tegra T114 processor family, based on the
ARM CortexA15MP CPU

config ARCH_TEGRA_124_SOC
bool "Enable support for Tegra124 family"
select ARM_L1_CACHE_SHIFT_6
select HAVE_ARM_ARCH_TIMER
help
Support for NVIDIA Tegra T124 processor family, based on the
ARM CortexA15MP CPU

config TEGRA_AHB
bool "Enable AHB driver for NVIDIA Tegra SoCs"
default y
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-tegra/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
asflags-y += -march=armv7-a

obj-y += common.o
obj-y += io.o
obj-y += irq.o
obj-y += fuse.o
Expand Down Expand Up @@ -36,5 +35,10 @@ obj-$(CONFIG_ARCH_TEGRA_114_SOC) += pm-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += pm-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += cpuidle-tegra114.o
endif

obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
5 changes: 2 additions & 3 deletions arch/arm/mach-tegra/board-paz00.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
#include <linux/platform_device.h>
#include <linux/rfkill-gpio.h>
#include "board.h"
#include "board-paz00.h"

static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
.name = "wifi_rfkill",
.reset_gpio = TEGRA_WIFI_RST,
.shutdown_gpio = TEGRA_WIFI_PWRN,
.reset_gpio = 25, /* PD1 */
.shutdown_gpio = 85, /* PK5 */
.type = RFKILL_TYPE_WLAN,
};

Expand Down
25 changes: 0 additions & 25 deletions arch/arm/mach-tegra/board-paz00.h

This file was deleted.

12 changes: 0 additions & 12 deletions arch/arm/mach-tegra/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,8 @@
#include <linux/types.h>
#include <linux/reboot.h>

void tegra_assert_system_reset(enum reboot_mode mode, const char *cmd);

void __init tegra_init_early(void);
void __init tegra_map_common_io(void);
void __init tegra_init_irq(void);
void __init tegra_dt_init_irq(void);

void tegra_init_late(void);

#ifdef CONFIG_DEBUG_FS
int tegra_clk_debugfs_init(void);
#else
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)
Expand Down
115 changes: 0 additions & 115 deletions arch/arm/mach-tegra/common.c

This file was deleted.

4 changes: 3 additions & 1 deletion arch/arm/mach-tegra/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ void __init tegra_cpuidle_init(void)
tegra30_cpuidle_init();
break;
case TEGRA114:
if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
case TEGRA124:
if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
tegra114_cpuidle_init();
break;
}
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-tegra/flowctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
break;
case TEGRA30:
case TEGRA114:
case TEGRA124:
/* clear wfe bitmap */
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
/* clear wfi bitmap */
Expand Down Expand Up @@ -125,6 +126,7 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid)
break;
case TEGRA30:
case TEGRA114:
case TEGRA124:
/* clear wfe bitmap */
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
/* clear wfi bitmap */
Expand Down
56 changes: 55 additions & 1 deletion arch/arm/mach-tegra/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,26 @@
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/export.h>
#include <linux/random.h>
#include <linux/tegra-soc.h>

#include "fuse.h"
#include "iomap.h"
#include "apbio.h"

/* Tegra20 only */
#define FUSE_UID_LOW 0x108
#define FUSE_UID_HIGH 0x10c

/* Tegra30 and later */
#define FUSE_VENDOR_CODE 0x200
#define FUSE_FAB_CODE 0x204
#define FUSE_LOT_CODE_0 0x208
#define FUSE_LOT_CODE_1 0x20c
#define FUSE_WAFER_ID 0x210
#define FUSE_X_COORDINATE 0x214
#define FUSE_Y_COORDINATE 0x218

#define FUSE_SKU_INFO 0x110

#define TEGRA20_FUSE_SPARE_BIT 0x200
Expand Down Expand Up @@ -112,21 +124,51 @@ u32 tegra_read_chipid(void)
return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
}

void tegra_init_fuse(void)
static void __init tegra20_fuse_init_randomness(void)
{
u32 randomness[2];

randomness[0] = tegra_fuse_readl(FUSE_UID_LOW);
randomness[1] = tegra_fuse_readl(FUSE_UID_HIGH);

add_device_randomness(randomness, sizeof(randomness));
}

/* Applies to Tegra30 or later */
static void __init tegra30_fuse_init_randomness(void)
{
u32 randomness[7];

randomness[0] = tegra_fuse_readl(FUSE_VENDOR_CODE);
randomness[1] = tegra_fuse_readl(FUSE_FAB_CODE);
randomness[2] = tegra_fuse_readl(FUSE_LOT_CODE_0);
randomness[3] = tegra_fuse_readl(FUSE_LOT_CODE_1);
randomness[4] = tegra_fuse_readl(FUSE_WAFER_ID);
randomness[5] = tegra_fuse_readl(FUSE_X_COORDINATE);
randomness[6] = tegra_fuse_readl(FUSE_Y_COORDINATE);

add_device_randomness(randomness, sizeof(randomness));
}

void __init tegra_init_fuse(void)
{
u32 id;
u32 randomness[5];

u32 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
reg |= 1 << 28;
writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));

reg = tegra_fuse_readl(FUSE_SKU_INFO);
randomness[0] = reg;
tegra_sku_id = reg & 0xFF;

reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT);
randomness[1] = reg;
tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT;

id = tegra_read_chipid();
randomness[2] = id;
tegra_chip_id = (id >> 8) & 0xff;

switch (tegra_chip_id) {
Expand All @@ -149,6 +191,18 @@ void tegra_init_fuse(void)

tegra_revision = tegra_get_revision(id);
tegra_init_speedo_data();
randomness[3] = (tegra_cpu_process_id << 16) | tegra_core_process_id;
randomness[4] = (tegra_cpu_speedo_id << 16) | tegra_soc_speedo_id;

add_device_randomness(randomness, sizeof(randomness));
switch (tegra_chip_id) {
case TEGRA20:
tegra20_fuse_init_randomness();
case TEGRA30:
case TEGRA114:
default:
tegra30_fuse_init_randomness();
}

pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
tegra_revision_name[tegra_revision],
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-tegra/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define TEGRA20 0x20
#define TEGRA30 0x30
#define TEGRA114 0x35
#define TEGRA124 0x40

#ifndef __ASSEMBLY__
enum tegra_revision {
Expand Down
Loading

0 comments on commit 4dcf033

Please sign in to comment.