Commit e9daa0ea authored by Olof Johansson's avatar Olof Johansson

Merge tag 'tegra-for-3.9-soc-t114' of...

Merge tag 'tegra-for-3.9-soc-t114' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/soc

From Stepen Warren:
ARM: tegra: add Tegra114 SoC support

This pull request adds initial support for the Tegra114 SoC, which
integrates a quad-core ARM Cortex-A15 CPU. I'm proud to observe that we
posted the initial versions of these patches before the final official
announcement of this chip.

These patches are enough to boot with a UART-based console, support the
Dalmore and Pluto reference/evaluation boards, instantiate the GPIO and
pinctrl drivers, and enable a cpuidle state. As yet, no clocks or
storage devices are supported, but patches for those will follow shortly.

This pull request is based on (most of) the previous pull request with
tag tegra-for-3.9-soc-cpuidle, followed by a merge of the previous pull
request with tag tegra-for-3.9-scu-base-rework.

* tag 'tegra-for-3.9-soc-t114' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: (24 commits)
  ARM: DT: tegra114: add pinmux DT entry
  ARM: DT: tegra114: add GPIO DT entry
  ARM: tegra114: select PINCTRL for Tegra114 SoC
  ARM: tegra: add Tegra114 ARM_CPUIDLE_WFI_STATE support
  ARM: tegra: Add SMMU entry to Tegra114 DT
  ARM: tegra: add AHB entry to Tegra114 DT
  ARM: tegra: Add initial support for Tegra114 SoC.
  ARM: dt: tegra114: Add new board, Pluto
  ARM: dt: tegra114: Add new board, Dalmore
  ARM: dt: tegra114: Add new SoC base, Tegra114 SoC
  ARM: tegra: fuse: Add chip ID Tegra114 0x35
  ARM: OMAP: Make use of available scu_a9_get_base() interface
  ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9
  ARM: Add API to detect SCU base address from CP15
  ARM: tegra: Use DT /cpu node to detect number of CPU core
  ARM: tegra: Add CPU nodes to Tegra30 device tree
  ARM: tegra: Add CPU nodes to Tegra20 device tree
  ARM: perf: simplify __hw_perf_event_init err handling
  ARM: perf: remove unnecessary checks for idx < 0
  ARM: perf: handle armpmu_register failing
  ...
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>

Remove/add conflict in arch/arm/mach-tegra/common.c resolved.
Remove/remove conflict in arch/arm/mach-tegra/platsmp.c. Leave the empty
stub function for now since removing it in the merge commit is confusing;
will be cleaned up in a separate commit.  # # It looks like you may be
committing a merge.  # If this is not correct, please remove the file #
.git/MERGE_HEAD # and try again.
parents c8bfea36 031b77af
...@@ -144,7 +144,9 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ ...@@ -144,7 +144,9 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
tegra20-ventana.dtb \ tegra20-ventana.dtb \
tegra20-whistler.dtb \ tegra20-whistler.dtb \
tegra30-cardhu-a02.dtb \ tegra30-cardhu-a02.dtb \
tegra30-cardhu-a04.dtb tegra30-cardhu-a04.dtb \
tegra114-dalmore.dtb \
tegra114-pluto.dtb
dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
vexpress-v2p-ca9.dtb \ vexpress-v2p-ca9.dtb \
vexpress-v2p-ca15-tc1.dtb \ vexpress-v2p-ca15-tc1.dtb \
......
/dts-v1/;
/include/ "tegra114.dtsi"
/ {
model = "NVIDIA Tegra114 Dalmore evaluation board";
compatible = "nvidia,dalmore", "nvidia,tegra114";
memory {
reg = <0x80000000 0x40000000>;
};
serial@70006300 {
status = "okay";
clock-frequency = <408000000>;
};
pmc {
nvidia,invert-interrupt;
};
};
/dts-v1/;
/include/ "tegra114.dtsi"
/ {
model = "NVIDIA Tegra114 Pluto evaluation board";
compatible = "nvidia,pluto", "nvidia,tegra114";
memory {
reg = <0x80000000 0x40000000>;
};
serial@70006300 {
status = "okay";
clock-frequency = <408000000>;
};
pmc {
nvidia,invert-interrupt;
};
};
/include/ "skeleton.dtsi"
/ {
compatible = "nvidia,tegra114";
interrupt-parent = <&gic>;
gic: interrupt-controller {
compatible = "arm,cortex-a15-gic";
#interrupt-cells = <3>;
interrupt-controller;
reg = <0x50041000 0x1000>,
<0x50042000 0x1000>,
<0x50044000 0x2000>,
<0x50046000 0x2000>;
interrupts = <1 9 0xf04>;
};
timer@60005000 {
compatible = "nvidia,tegra114-timer", "nvidia,tegra20-timer";
reg = <0x60005000 0x400>;
interrupts = <0 0 0x04
0 1 0x04
0 41 0x04
0 42 0x04
0 121 0x04
0 122 0x04>;
};
tegra_car: clock {
compatible = "nvidia,tegra114-car, nvidia,tegra30-car";
reg = <0x60006000 0x1000>;
#clock-cells = <1>;
};
ahb: ahb {
compatible = "nvidia,tegra114-ahb", "nvidia,tegra30-ahb";
reg = <0x6000c004 0x14c>;
};
gpio: gpio {
compatible = "nvidia,tegra114-gpio", "nvidia,tegra30-gpio";
reg = <0x6000d000 0x1000>;
interrupts = <0 32 0x04
0 33 0x04
0 34 0x04
0 35 0x04
0 55 0x04
0 87 0x04
0 89 0x04
0 125 0x04>;
#gpio-cells = <2>;
gpio-controller;
#interrupt-cells = <2>;
interrupt-controller;
};
pinmux: pinmux {
compatible = "nvidia,tegra114-pinmux";
reg = <0x70000868 0x148 /* Pad control registers */
0x70003000 0x40c>; /* Mux registers */
};
serial@70006000 {
compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
reg = <0x70006000 0x40>;
reg-shift = <2>;
interrupts = <0 36 0x04>;
status = "disabled";
};
serial@70006040 {
compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
reg = <0x70006040 0x40>;
reg-shift = <2>;
interrupts = <0 37 0x04>;
status = "disabled";
};
serial@70006200 {
compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
reg = <0x70006200 0x100>;
reg-shift = <2>;
interrupts = <0 46 0x04>;
status = "disabled";
};
serial@70006300 {
compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
reg = <0x70006300 0x100>;
reg-shift = <2>;
interrupts = <0 90 0x04>;
status = "disabled";
};
rtc {
compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc";
reg = <0x7000e000 0x100>;
interrupts = <0 2 0x04>;
};
pmc {
compatible = "nvidia,tegra114-pmc", "nvidia,tegra30-pmc";
reg = <0x7000e400 0x400>;
};
iommu {
compatible = "nvidia,tegra114-smmu", "nvidia,tegra30-smmu";
reg = <0x7000f010 0x02c
0x7000f1f0 0x010
0x7000f228 0x074>;
nvidia,#asids = <4>;
dma-window = <0 0x40000000>;
nvidia,swgroups = <0x18659fe>;
nvidia,ahb = <&ahb>;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <1>;
};
cpu@2 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <2>;
};
cpu@3 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <3>;
};
};
timer {
compatible = "arm,armv7-timer";
interrupts = <1 13 0xf08>,
<1 14 0xf08>,
<1 11 0xf08>,
<1 10 0xf08>;
};
};
...@@ -489,6 +489,23 @@ sdhci@c8000600 { ...@@ -489,6 +489,23 @@ sdhci@c8000600 {
status = "disabled"; status = "disabled";
}; };
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <1>;
};
};
pmu { pmu {
compatible = "arm,cortex-a9-pmu"; compatible = "arm,cortex-a9-pmu";
interrupts = <0 56 0x04 interrupts = <0 56 0x04
......
...@@ -506,6 +506,35 @@ sdhci@78000600 { ...@@ -506,6 +506,35 @@ sdhci@78000600 {
status = "disabled"; status = "disabled";
}; };
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <1>;
};
cpu@2 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <2>;
};
cpu@3 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <3>;
};
};
pmu { pmu {
compatible = "arm,cortex-a9-pmu"; compatible = "arm,cortex-a9-pmu";
interrupts = <0 144 0x04 interrupts = <0 144 0x04
......
...@@ -64,6 +64,24 @@ extern unsigned int processor_id; ...@@ -64,6 +64,24 @@ extern unsigned int processor_id;
#define read_cpuid_ext(reg) 0 #define read_cpuid_ext(reg) 0
#endif #endif
#define ARM_CPU_IMP_ARM 0x41
#define ARM_CPU_IMP_INTEL 0x69
#define ARM_CPU_PART_ARM1136 0xB360
#define ARM_CPU_PART_ARM1156 0xB560
#define ARM_CPU_PART_ARM1176 0xB760
#define ARM_CPU_PART_ARM11MPCORE 0xB020
#define ARM_CPU_PART_CORTEX_A8 0xC080
#define ARM_CPU_PART_CORTEX_A9 0xC090
#define ARM_CPU_PART_CORTEX_A5 0xC050
#define ARM_CPU_PART_CORTEX_A15 0xC0F0
#define ARM_CPU_PART_CORTEX_A7 0xC070
#define ARM_CPU_XSCALE_ARCH_MASK 0xe000
#define ARM_CPU_XSCALE_ARCH_V1 0x2000
#define ARM_CPU_XSCALE_ARCH_V2 0x4000
#define ARM_CPU_XSCALE_ARCH_V3 0x6000
/* /*
* The CPU ID never changes at run time, so we might as well tell the * The CPU ID never changes at run time, so we might as well tell the
* compiler that it's constant. Use this function to read the CPU ID * compiler that it's constant. Use this function to read the CPU ID
...@@ -74,6 +92,21 @@ static inline unsigned int __attribute_const__ read_cpuid_id(void) ...@@ -74,6 +92,21 @@ static inline unsigned int __attribute_const__ read_cpuid_id(void)
return read_cpuid(CPUID_ID); return read_cpuid(CPUID_ID);
} }
static inline unsigned int __attribute_const__ read_cpuid_implementor(void)
{
return (read_cpuid_id() & 0xFF000000) >> 24;
}
static inline unsigned int __attribute_const__ read_cpuid_part_number(void)
{
return read_cpuid_id() & 0xFFF0;
}
static inline unsigned int __attribute_const__ xscale_cpu_arch_version(void)
{
return read_cpuid_part_number() & ARM_CPU_XSCALE_ARCH_MASK;
}
static inline unsigned int __attribute_const__ read_cpuid_cachetype(void) static inline unsigned int __attribute_const__ read_cpuid_cachetype(void)
{ {
return read_cpuid(CPUID_CACHETYPE); return read_cpuid(CPUID_CACHETYPE);
......
...@@ -6,6 +6,23 @@ ...@@ -6,6 +6,23 @@
#define SCU_PM_POWEROFF 3 #define SCU_PM_POWEROFF 3
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
#include <asm/cputype.h>
static inline bool scu_a9_has_base(void)
{
return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
}
static inline unsigned long scu_a9_get_base(void)
{
unsigned long pa;
asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
return pa;
}
unsigned int scu_get_core_count(void __iomem *); unsigned int scu_get_core_count(void __iomem *);
void scu_enable(void __iomem *); void scu_enable(void __iomem *);
int scu_power_mode(void __iomem *, unsigned int); int scu_power_mode(void __iomem *, unsigned int);
......
...@@ -149,12 +149,6 @@ u64 armpmu_event_update(struct perf_event *event) ...@@ -149,12 +149,6 @@ u64 armpmu_event_update(struct perf_event *event)
static void static void
armpmu_read(struct perf_event *event) armpmu_read(struct perf_event *event)
{ {
struct hw_perf_event *hwc = &event->hw;
/* Don't read disabled counters! */
if (hwc->idx < 0)
return;
armpmu_event_update(event); armpmu_event_update(event);
} }
...@@ -207,8 +201,6 @@ armpmu_del(struct perf_event *event, int flags) ...@@ -207,8 +201,6 @@ armpmu_del(struct perf_event *event, int flags)
struct hw_perf_event *hwc = &event->hw; struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx; int idx = hwc->idx;
WARN_ON(idx < 0);
armpmu_stop(event, PERF_EF_UPDATE); armpmu_stop(event, PERF_EF_UPDATE);
hw_events->events[idx] = NULL; hw_events->events[idx] = NULL;
clear_bit(idx, hw_events->used_mask); clear_bit(idx, hw_events->used_mask);
...@@ -358,7 +350,7 @@ __hw_perf_event_init(struct perf_event *event) ...@@ -358,7 +350,7 @@ __hw_perf_event_init(struct perf_event *event)
{ {
struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
struct hw_perf_event *hwc = &event->hw; struct hw_perf_event *hwc = &event->hw;
int mapping, err; int mapping;
mapping = armpmu->map_event(event); mapping = armpmu->map_event(event);
...@@ -407,14 +399,12 @@ __hw_perf_event_init(struct perf_event *event) ...@@ -407,14 +399,12 @@ __hw_perf_event_init(struct perf_event *event)
local64_set(&hwc->period_left, hwc->sample_period); local64_set(&hwc->period_left, hwc->sample_period);
} }
err = 0;
if (event->group_leader != event) { if (event->group_leader != event) {
err = validate_group(event); if (validate_group(event) != 0);
if (err)
return -EINVAL; return -EINVAL;
} }
return err; return 0;
} }
static int armpmu_event_init(struct perf_event *event) static int armpmu_event_init(struct perf_event *event)
......
...@@ -147,7 +147,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu) ...@@ -147,7 +147,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
cpu_pmu->free_irq = cpu_pmu_free_irq; cpu_pmu->free_irq = cpu_pmu_free_irq;
/* Ensure the PMU has sane values out of reset. */ /* Ensure the PMU has sane values out of reset. */
if (cpu_pmu && cpu_pmu->reset) if (cpu_pmu->reset)
on_each_cpu(cpu_pmu->reset, cpu_pmu, 1); on_each_cpu(cpu_pmu->reset, cpu_pmu, 1);
} }
...@@ -201,48 +201,46 @@ static struct platform_device_id cpu_pmu_plat_device_ids[] = { ...@@ -201,48 +201,46 @@ static struct platform_device_id cpu_pmu_plat_device_ids[] = {
static int probe_current_pmu(struct arm_pmu *pmu) static int probe_current_pmu(struct arm_pmu *pmu)
{ {
int cpu = get_cpu(); int cpu = get_cpu();
unsigned long cpuid = read_cpuid_id(); unsigned long implementor = read_cpuid_implementor();
unsigned long implementor = (cpuid & 0xFF000000) >> 24; unsigned long part_number = read_cpuid_part_number();
unsigned long part_number = (cpuid & 0xFFF0);
int ret = -ENODEV; int ret = -ENODEV;
pr_info("probing PMU on CPU %d\n", cpu); pr_info("probing PMU on CPU %d\n", cpu);
/* ARM Ltd CPUs. */ /* ARM Ltd CPUs. */
if (0x41 == implementor) { if (implementor == ARM_CPU_IMP_ARM) {
switch (part_number) { switch (part_number) {
case 0xB360: /* ARM1136 */ case ARM_CPU_PART_ARM1136:
case 0xB560: /* ARM1156 */ case ARM_CPU_PART_ARM1156:
case 0xB760: /* ARM1176 */ case ARM_CPU_PART_ARM1176:
ret = armv6pmu_init(pmu); ret = armv6pmu_init(pmu);
break; break;
case 0xB020: /* ARM11mpcore */ case ARM_CPU_PART_ARM11MPCORE:
ret = armv6mpcore_pmu_init(pmu); ret = armv6mpcore_pmu_init(pmu);
break; break;
case 0xC080: /* Cortex-A8 */ case ARM_CPU_PART_CORTEX_A8:
ret = armv7_a8_pmu_init(pmu); ret = armv7_a8_pmu_init(pmu);
break; break;
case 0xC090: /* Cortex-A9 */ case ARM_CPU_PART_CORTEX_A9:
ret = armv7_a9_pmu_init(pmu); ret = armv7_a9_pmu_init(pmu);
break; break;
case 0xC050: /* Cortex-A5 */ case ARM_CPU_PART_CORTEX_A5:
ret = armv7_a5_pmu_init(pmu); ret = armv7_a5_pmu_init(pmu);
break; break;
case 0xC0F0: /* Cortex-A15 */ case ARM_CPU_PART_CORTEX_A15:
ret = armv7_a15_pmu_init(pmu); ret = armv7_a15_pmu_init(pmu);
break; break;
case 0xC070: /* Cortex-A7 */ case ARM_CPU_PART_CORTEX_A7:
ret = armv7_a7_pmu_init(pmu); ret = armv7_a7_pmu_init(pmu);
break; break;
} }
/* Intel CPUs [xscale]. */ /* Intel CPUs [xscale]. */
} else if (0x69 == implementor) { } else if (implementor == ARM_CPU_IMP_INTEL) {
part_number = (cpuid >> 13) & 0x7; switch (xscale_cpu_arch_version()) {
switch (part_number) { case ARM_CPU_XSCALE_ARCH_V1:
case 1:
ret = xscale1pmu_init(pmu); ret = xscale1pmu_init(pmu);
break; break;
case 2: case ARM_CPU_XSCALE_ARCH_V2:
ret = xscale2pmu_init(pmu); ret = xscale2pmu_init(pmu);
break; break;
} }
...@@ -279,17 +277,22 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) ...@@ -279,17 +277,22 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
} }
if (ret) { if (ret) {
pr_info("failed to register PMU devices!"); pr_info("failed to probe PMU!");
kfree(pmu); goto out_free;
return ret;
} }
cpu_pmu = pmu; cpu_pmu = pmu;
cpu_pmu->plat_device = pdev; cpu_pmu->plat_device = pdev;
cpu_pmu_init(cpu_pmu); cpu_pmu_init(cpu_pmu);
armpmu_register(cpu_pmu, PERF_TYPE_RAW); ret = armpmu_register(cpu_pmu, PERF_TYPE_RAW);
if (!ret)
return 0; return 0;
out_free:
pr_info("failed to register PMU devices!");
kfree(pmu);
return ret;
} }
static struct platform_driver cpu_pmu_driver = { static struct platform_driver cpu_pmu_driver = {
......
...@@ -106,7 +106,7 @@ static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -106,7 +106,7 @@ static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
...@@ -259,7 +259,7 @@ static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -259,7 +259,7 @@ static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
......
...@@ -157,8 +157,8 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -157,8 +157,8 @@ static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = ARMV7_A8_PERFCTR_L1_ICACHE_ACCESS, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
...@@ -282,7 +282,7 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -282,7 +282,7 @@ static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
...@@ -399,8 +399,8 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -399,8 +399,8 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
/* /*
* The prefetch counters don't differentiate between the I * The prefetch counters don't differentiate between the I
...@@ -527,8 +527,8 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -527,8 +527,8 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
...@@ -651,8 +651,8 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -651,8 +651,8 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
......
...@@ -83,7 +83,7 @@ static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] ...@@ -83,7 +83,7 @@ static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
}, },
[C(OP_WRITE)] = { [C(OP_WRITE)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
[C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
}, },
[C(OP_PREFETCH)] = { [C(OP_PREFETCH)] = {
[C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
......
...@@ -215,7 +215,7 @@ static void __init omap4_smp_init_cpus(void) ...@@ -215,7 +215,7 @@ static void __init omap4_smp_init_cpus(void)
* Currently we can't call ioremap here because * Currently we can't call ioremap here because
* SoC detection won't work until after init_early. * SoC detection won't work until after init_early.
*/ */
scu_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_SCU_BASE); scu_base = OMAP2_L4_IO_ADDRESS(scu_a9_get_base());
BUG_ON(!scu_base); BUG_ON(!scu_base);
ncores = scu_get_core_count(scu_base); ncores = scu_get_core_count(scu_base);
} else if (cpu_id == CPU_CORTEX_A15) { } else if (cpu_id == CPU_CORTEX_A15) {
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#define OMAP44XX_GIC_DIST_BASE 0x48241000 #define OMAP44XX_GIC_DIST_BASE 0x48241000
#define OMAP44XX_GIC_CPU_BASE 0x48240100 #define OMAP44XX_GIC_CPU_BASE 0x48240100
#define OMAP44XX_IRQ_GIC_START 32 #define OMAP44XX_IRQ_GIC_START 32
#define OMAP44XX_SCU_BASE 0x48240000
#define OMAP44XX_LOCAL_TWD_BASE 0x48240600 #define OMAP44XX_LOCAL_TWD_BASE 0x48240600
#define OMAP44XX_L2CACHE_BASE 0x48242000 #define OMAP44XX_L2CACHE_BASE 0x48242000
#define OMAP44XX_WKUPGEN_BASE 0x48281000 #define OMAP44XX_WKUPGEN_BASE 0x48281000
......
...@@ -45,6 +45,18 @@ config ARCH_TEGRA_3x_SOC ...@@ -45,6 +45,18 @@ config ARCH_TEGRA_3x_SOC
Support for NVIDIA Tegra T30 processor family, based on the Support for NVIDIA Tegra T30 processor family, based on the
ARM CortexA9MP CPU and the ARM PL310 L2 cache controller ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
config ARCH_TEGRA_114_SOC
bool "Enable support for Tegra114 family"
select ARM_GIC
select CPU_V7
select ARM_L1_CACHE_SHIFT_6
select ARM_ARCH_TIMER
select PINCTRL
select PINCTRL_TEGRA114
help
Support for NVIDIA Tegra T114 processor family, based on the
ARM CortexA15MP CPU
config TEGRA_PCI config TEGRA_PCI
bool "PCI Express support" bool "PCI Express support"
depends on ARCH_TEGRA_2x_SOC depends on ARCH_TEGRA_2x_SOC
......
...@@ -29,6 +29,10 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o ...@@ -29,6 +29,10 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o
......
/*
* NVIDIA Tegra114 device tree board support
*
* Copyright (C) 2013 NVIDIA Corporation
*
* 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.
*
*/
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/clocksource.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
#include "board.h"
#include "common.h"
static void __init tegra114_dt_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
static const char * const tegra114_dt_board_compat[] = {
"nvidia,tegra114",
NULL,
};
DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra30_init_early,
.init_irq = tegra_dt_init_irq,
.handle_irq = gic_handle_irq,
.init_time = clocksource_of_init,
.init_machine = tegra114_dt_init,
.init_late = tegra_init_late,
.restart = tegra_assert_system_reset,
.dt_compat = tegra114_dt_board_compat,
MACHINE_END
/*
* Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/cpuidle.h>
#include <asm/cpuidle.h>
static struct cpuidle_driver tegra_idle_driver = {
.name = "tegra_idle",
.owner = THIS_MODULE,
.en_core_tk_irqen = 1,
.state_count = 1,
.states = {
[0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
},
};
static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
int __init tegra114_cpuidle_init(void)
{
int ret;
unsigned int cpu;
struct cpuidle_device *dev;
struct cpuidle_driver *drv = &tegra_idle_driver;
ret = cpuidle_register_driver(&tegra_idle_driver);
if (ret) {
pr_err("CPUidle driver registration failed\n");
return ret;
}
for_each_possible_cpu(cpu) {
dev = &per_cpu(tegra_idle_device, cpu);
dev->cpu = cpu;
dev->state_count = drv->state_count;
ret = cpuidle_register_device(dev);
if (ret) {
pr_err("CPU%u: CPUidle device registration failed\n",
cpu);
return ret;
}
}
return 0;
}
...@@ -38,6 +38,9 @@ static int __init tegra_cpuidle_init(void) ...@@ -38,6 +38,9 @@ static int __init tegra_cpuidle_init(void)
case TEGRA30: case TEGRA30:
ret = tegra30_cpuidle_init(); ret = tegra30_cpuidle_init();
break; break;
case TEGRA114:
ret = tegra114_cpuidle_init();
break;
default: default:
ret = -ENODEV; ret = -ENODEV;
break; break;
......
...@@ -29,4 +29,10 @@ int tegra30_cpuidle_init(void); ...@@ -29,4 +29,10 @@ int tegra30_cpuidle_init(void);
static inline int tegra30_cpuidle_init(void) { return -ENODEV; } static inline int tegra30_cpuidle_init(void) { return -ENODEV; }
#endif #endif
#ifdef CONFIG_ARCH_TEGRA_114_SOC
int tegra114_cpuidle_init(void);
#else
static inline int tegra114_cpuidle_init(void) { return -ENODEV; }
#endif
#endif #endif
...@@ -37,6 +37,7 @@ enum tegra_revision { ...@@ -37,6 +37,7 @@ enum tegra_revision {
#define TEGRA20 0x20 #define TEGRA20 0x20
#define TEGRA30 0x30 #define TEGRA30 0x30
#define TEGRA114 0x35
extern int tegra_sku_id; extern int tegra_sku_id;
extern int tegra_cpu_process_id; extern int tegra_cpu_process_id;
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
extern void tegra_secondary_startup(void); extern void tegra_secondary_startup(void);
static cpumask_t tegra_cpu_init_mask; static cpumask_t tegra_cpu_init_mask;
static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE);
#define EVP_CPU_RESET_VECTOR \ #define EVP_CPU_RESET_VECTOR \
(IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100) (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100)
...@@ -177,22 +176,8 @@ static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct * ...@@ -177,22 +176,8 @@ static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *
return status; return status;
} }
/*
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
static void __init tegra_smp_init_cpus(void) static void __init tegra_smp_init_cpus(void)
{ {
unsigned int i, ncores = scu_get_core_count(scu_base);
if (ncores > nr_cpu_ids) {
pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
ncores, nr_cpu_ids);
ncores = nr_cpu_ids;
}
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
} }
static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
...@@ -200,7 +185,8 @@ static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) ...@@ -200,7 +185,8 @@ static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
/* Always mark the boot CPU (CPU0) as initialized. */ /* Always mark the boot CPU (CPU0) as initialized. */
cpumask_set_cpu(0, &tegra_cpu_init_mask); cpumask_set_cpu(0, &tegra_cpu_init_mask);
scu_enable(scu_base); if (scu_a9_has_base())
scu_enable(IO_ADDRESS(scu_a9_get_base()));
} }
struct smp_operations tegra_smp_ops __initdata = { struct smp_operations tegra_smp_ops __initdata = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment