firefly-linux-kernel-4.4.55.git
10 years agoamba-clcd: set video mode via module parameter on kernel commandline
Ryan Harkin [Wed, 16 Apr 2014 17:08:01 +0000 (18:08 +0100)]
amba-clcd: set video mode via module parameter on kernel commandline

Specifying the module parameter "amba-clcd.mode=<mode>" will over-ride
the default mode used when the driver is initialised.

Where <mode> can either be VGA or XVGA (the default).

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoarm: dtbs: add virtio mmio device to rtsm
Ryan Harkin [Wed, 15 Jan 2014 12:13:43 +0000 (12:13 +0000)]
arm: dtbs: add virtio mmio device to rtsm

Add the virtio MMIO device to the rtsm include file.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agoARM: 7861/1: cacheflush: consolidate single-CPU ARMv7 cache disabling code
Nicolas Pitre [Fri, 18 Oct 2013 21:06:03 +0000 (22:06 +0100)]
ARM: 7861/1: cacheflush: consolidate single-CPU ARMv7 cache disabling code

Commit 39792c7cf3111d69dc4aa0923859d8b929e9039f upstream

This code is becoming duplicated in many places.  So let's consolidate
it into a handy macro that is known to be right and available for reuse.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
10 years agoARM: vexpress/MCPM: fix cache disable sequence when CONFIG_FRAME_POINTER=y
Nicolas Pitre [Wed, 14 Aug 2013 14:25:14 +0000 (10:25 -0400)]
ARM: vexpress/MCPM: fix cache disable sequence when CONFIG_FRAME_POINTER=y

Commit fac2e57742d9aa3dbe41860280352efda9d5566e upstream

If CONFIG_FRAME_POINTER=y we get the following error:

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Let's fix that by explicitly preserving r11 on the stack and removing it
from the clobber list.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
10 years agoARM: vexpress/dcscb: fix cache disabling sequences
Nicolas Pitre [Wed, 17 Jul 2013 00:59:53 +0000 (20:59 -0400)]
ARM: vexpress/dcscb: fix cache disabling sequences

Commit e8f9bb1bd6bb93fff773345cc54c42585e0e3ece upstream

Unlike real A15/A7's, the RTSM simulation doesn't appear to hit the
cache when the CTRL.C bit is cleared.  Let's ensure there is no memory
access within the disable and flush cache sequence, including to the
stack.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
10 years agoARM: vexpress/TC2: Match mainline cache disabling sequence in tc2_pm_down
Jon Medhurst [Mon, 2 Dec 2013 11:47:16 +0000 (11:47 +0000)]
ARM: vexpress/TC2: Match mainline cache disabling sequence in tc2_pm_down

When the TC2 pm code was finally upstreamed [1] the cache disbling sequence
had been modified to avoid some potential race conditions. So lets backport
these changes.

[1] Commit 11b277eabe70 ARM: vexpress/TC2: basic PM support

Signed-off-by: Jon Medhurst <tixy@linaro.org>
10 years agoARM: vexpress: tc2: fix hotplug/idle/kexec race on cluster power down
Lorenzo Pieralisi [Fri, 29 Nov 2013 09:53:12 +0000 (09:53 +0000)]
ARM: vexpress: tc2: fix hotplug/idle/kexec race on cluster power down

Commit 64270d82d4bf7fb8e5347c41ea7d0477aa551391 upstream

On the TC2 testchip, when all CPUs in a cluster enter standbywfi
and commit a power down request, the power controller will wait
for standbywfil2 coming from L2 cache controller to shut the
cluster down.
By the time all CPUs in a cluster commit a power down request
and enter wfi, the power controller cannot backtrack, or put it
another way, a CPU must not be allowed to complete execution
independently of the power controller, the only way for it to
resume properly must be upon wake-up IRQ pending and subsequent
reset triggered from the power controller.

Current MCPM back-end for TC2 disables the GIC CPU IF only when
power down is committed through the tc2_pm_suspend() method, that
makes sense since a suspended CPU is still online and can receive
interrupts whereas a hotplugged CPU, since it is offline,
migrated all IRQs and shutdown the per-CPU peripherals, hence
their PPIs.

The flaw with this reasoning is the following. If all CPUs in
a clusters are entering a power down state either through CPU
idle or CPU hotplug, when the last man successfully completes
the MCPM power down sequence (and executes wfi), power controller
waits for L2 wfi signal to quiesce the cluster and shut it down.
If, when all CPUs are sitting in wfi, an online CPU hotplugs back
in one of the CPUs in the cluster being shutdown, that CPU
receives an IPI that causes wfi to complete (since tc2_pm_down()
method does not disable the GIC CPU IF in that case - CPU being
hotplugged out, not idle) and the power controller will never see
the stanbywfil2 signal coming from L2 that is required for
shutdown to happen and the system deadlocks.

Further to this issue, kexec hotplugs secondary CPUs out during
kernel reload/restart.
Because kexec may (deliberately) trash the old kernel text, it is
not OK for CPUs to follow the MCPM soft reboot path, since
instructions after the WFI may have been replaced by kexec.

If tc2_pm_down() does not disable the GIC cpu interface, there is a
race between CPU powerdown in the old kernel and the IPI from the
new kernel that triggers secondary boot, particularly if the
powerdown is slow (due to L2 cache cleaning for example).  If the
new kernel wins the race, the affected CPU(s) will not really be
reset and may execute garbage after the WFI.

The only solution to this problem consists in disabling the GIC
CPU IF on a CPU committed to power down regardless of the power
down entry method (CPU hotplug or CPU idle). This way, CPU wake-up
is under power controller control, which prevents unexpected wfi
exit caused by a pending IRQ.

This patch moves the GIC CPU IF disable call in the TC2 MCPM
implementation from the tc2_pm_suspend() method to the
tc2_pm_down() method to fix the mentioned race condition(s).

Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Tested-by: Dave Martin <Dave.Martin@arm.com> (for kexec)
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agocpufreq_stats: improve config option isolation
Mark Hambleton [Mon, 25 Nov 2013 18:54:13 +0000 (18:54 +0000)]
cpufreq_stats: improve config option isolation

Add missing pre-processor protection around calls to IKS APIs

Signed-off-by: Mark Hambleton <mahamble@broadcom.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agocpufreq: arm-big-little: don't use cpu_last_req_freq for MP
Viresh Kumar [Thu, 8 Aug 2013 14:26:26 +0000 (15:26 +0100)]
cpufreq: arm-big-little: don't use cpu_last_req_freq for MP

While getting support for In-Kernel-Switcher in big LITTLE cpufreq driver we
introduced cpu_last_req_freq per-cpu variable that stores the last frequency
requested for a cpu. It was important for IKS as CPUs in the same cluster can
have separate struct cpufreq_policy associated with them and so cpufreq core may
try to set different frequencies on both CPUs of same cluster.

But for non-IKS solution or MP we don't need to cache last requested frequency.
Currently there is a bug in code where if cpufreq_driver->get() is called for
any cpu other than policy->cpu, we are returning 0, because we set
cpu_last_req_freq only for policy->cpu and not for others.

This problem could have been fixed by setting cpu_last_req_freq for all CPUs in
policy->cpus, but that wouldn't be the best solution. Purpose of
cpufreq_driver->get() is to get exact frequency from the hardware instead of
returning cached frequency that was last requested as that is already present
with the core.

Hence, this patch forces only IKS to use cpu_last_req_freq and not MP. We will
get the frequency from hardware when ->get() is called for MP.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agodrivers/bus: arm-cci:nobody uses cci_pmu_destroy
Andy Green [Tue, 6 Aug 2013 12:49:22 +0000 (13:49 +0100)]
drivers/bus: arm-cci:nobody uses cci_pmu_destroy

Nobody uses static function, get rid of the function and warning

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agoMerge branch 'lsk-3.10-iks-cpufreq' of git://git.linaro.org/people/tixy/kernel into...
Mark Brown [Fri, 19 Jul 2013 16:10:09 +0000 (17:10 +0100)]
Merge branch 'lsk-3.10-iks-cpufreq' of git://git.linaro.org/people/tixy/kernel into lsk-v3.10-tc2

11 years agocpufreq/arm_big_little.c: Fixing non-terminated string
Mathieu J. Poirier [Wed, 10 Apr 2013 15:20:21 +0000 (09:20 -0600)]
cpufreq/arm_big_little.c: Fixing non-terminated string

When declaring char name[9] = "cluster";

name[7] is equal to the string termination character '\0'.
But later on doing:

name[7] = cluster_id + '0';

clobbers the termination character, leaving non terminated
strings in the system and potentially causing undertermined
behavior.

By initialising name[9] to "clusterX" the 8th character is
set to '\0' and affecting the 7th character with the cluster
number doesn't overwite anything.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
[ np: The C standard says that the reminder of an initialized array of
  a known size should be initialized to zero and therefore this patch is
  unneeded, however this patch makes the intent more explicit to others
  reading the code. ]

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
11 years agocpufreq: arm_big_little: Don't destroy/create freq table/clk for every cpu on/off
Viresh Kumar [Fri, 14 Dec 2012 02:34:07 +0000 (08:04 +0530)]
cpufreq: arm_big_little: Don't destroy/create freq table/clk for every cpu on/off

When a cpu goes down, exit would be called for it. Similarly for every cpu up
init would be called. This would result in same freq table and clk structure to
get freed/allocated again. There is no way for freq table/clk structures to
change between these calls.

Also, when we disable switcher, firstly cpufreq unregister would be called and
hence exit for all cpus and then register would be called, i.e. init would be
called.

For saving time/energy for both cases, lets not free table/clk until module exit
is not done.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agocpufreq: arm_big_little: Unregister/register cpufreq driver with switcher notifiers
Nicolas Pitre [Tue, 11 Dec 2012 05:20:29 +0000 (00:20 -0500)]
cpufreq: arm_big_little: Unregister/register cpufreq driver with switcher notifiers

Cpufreq driver must be unregistered/registered on switcher on/off to get correct
freq tables for all cpus. This patch does it.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
11 years agocpufreq: arm_big_little: add in-kernel switching(IKS) support
Viresh Kumar [Thu, 13 Dec 2012 08:13:10 +0000 (13:43 +0530)]
cpufreq: arm_big_little: add in-kernel switching(IKS) support

This patch adds IKS (In Kernel Switcher) support to cpufreq driver. This creates
separate freq table for A7-A15 cpu pair. A7 frequency is virtualized and is
halved, so that it touches boundaries with A7 frequencies.

Based on Earlier Work from Sudeep.

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agocpufreq: cpufreq_stats: Register for bL_switcher notifiers
Viresh Kumar [Tue, 11 Dec 2012 11:00:01 +0000 (16:30 +0530)]
cpufreq: cpufreq_stats: Register for bL_switcher notifiers

cpufreq_stat has registered notifiers with both cpufreq and cpu core. It adds
cpu/cpu0/cpufreq/stats/ directory with a notifier of cpufreq CPUFREQ_NOTIFY and
removes this directory with a notifier to cpu core.

On bL_switcher enable/disable, cpufreq drivers notifiers gets called and they
call cpufreq_unregister(), followed by cpufreq_register(). For unregister stats
directories per cpu aren't removed, because cpu never went to dead state and cpu
notifier isn't called.

When cpufreq_register() is called, we try to add these directories again and
that simply fails, as directories were already present.

Fix these issues by registering cpufreq_stats too with bL_switcher notifiers, so
that they get unregistered and registered on switcher enable/disable.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agoMerge branch 'lsk-3.10-vexpress' of git://git.linaro.org/people/tixy/kernel into...
Mark Brown [Wed, 17 Jul 2013 17:39:13 +0000 (18:39 +0100)]
Merge branch 'lsk-3.10-vexpress' of git://git.linaro.org/people/tixy/kernel into lsk-v3.10-tc2

11 years agoMerge branch 'tracking-armlt-tc2-cpufreq' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:02:21 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-tc2-cpufreq' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-tc2-psci' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:02:21 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-tc2-psci' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-tc2-pm' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:02:16 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-tc2-pm' into lsk-3.10-vexpress

Conflicts:
arch/arm/mach-vexpress/Makefile

11 years agoMerge branch 'tracking-armlt-dcscb' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:02:10 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-dcscb' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-psci' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:02:02 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-psci' into lsk-3.10-vexpress

Conflicts:
arch/arm/kernel/psci.c

11 years agoMerge branch 'tracking-armlt-spc' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:55 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-spc' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-cci' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:50 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-cci' into lsk-3.10-vexpress

Conflicts:
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts

11 years agoMerge branch 'tracking-armlt-mcpm' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:44 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-mcpm' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-tc2-dt' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:44 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-tc2-dt' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-misc-fixes' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:43 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-misc-fixes' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-clcd' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:43 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-clcd' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-hdlcd' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:42 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-hdlcd' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-ve-updates' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:37 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-ve-updates' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-rtsm' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:37 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-rtsm' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-config' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:36 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-config' into lsk-3.10-vexpress

11 years agocpufreq: ARM big LITTLE: Fixup for new SPC driver
Jon Medhurst [Fri, 31 May 2013 14:12:16 +0000 (15:12 +0100)]
cpufreq: ARM big LITTLE: Fixup for new SPC driver

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agocpufreq: ARM big LITTLE: Add Vexpress glue driver
Viresh Kumar [Mon, 29 Apr 2013 09:19:50 +0000 (14:49 +0530)]
cpufreq: ARM big LITTLE: Add Vexpress glue driver

Vexpress depends on motherboard firmware + spc for getting opp table. This patch
adds Vexpress glue driver for ARM big LITTLE parent driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agoclk: Vexpress-spc: Fixup for new SPC driver
Jon Medhurst [Fri, 31 May 2013 14:10:41 +0000 (15:10 +0100)]
clk: Vexpress-spc: Fixup for new SPC driver

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoclk: Vexpress-spc: Add clock driver
Viresh Kumar [Fri, 23 Nov 2012 19:21:07 +0000 (00:51 +0530)]
clk: Vexpress-spc: Add clock driver

This patch adds spc clock controller. In Vexpress cpu cluster clock is controlled via
spc controller and so it must be present in clk framework.

vexpress_clk_[of_]register_spc() registers cluster clocks with and without DT.
These are added as root clocks without any parents and their names are
"cluster[0|1|..]".

Now, platform must add clocks of all the cpus below these clusters. cpufreq
driver would get cpu clock and will do clk_get[set]_rate() on cpu clock, which
will then pass it to cluster clocks. And finally spc will get programmed.

This patch doesn't add non-DT clocks for clusters and cpus as i don't see a user
of that for now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agoVexpress: Enable OPP library for cpufreq
Viresh Kumar [Mon, 29 Apr 2013 10:06:46 +0000 (15:36 +0530)]
Vexpress: Enable OPP library for cpufreq

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agoARM: Select ARCH_HAS_CPUFREQ for ARCH_VEXPRESS
Sudeep KarkadaNagesha [Fri, 13 Jul 2012 16:05:30 +0000 (17:05 +0100)]
ARM: Select ARCH_HAS_CPUFREQ for ARCH_VEXPRESS

This patch enables ARCH_HAS_CPUFREQ for Versatile Express platforms in order
to support CPU frequency scaling.

Signed-off-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
11 years agocpufreq: ARM big LITTLE: Add depends on BIG_LITTLE
Viresh Kumar [Mon, 29 Apr 2013 08:37:37 +0000 (14:07 +0530)]
cpufreq: ARM big LITTLE: Add depends on BIG_LITTLE

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
11 years agoARM: vexpress: Ensure SPC driver is loaded before using it in PSCI init
Jon Medhurst [Wed, 19 Jun 2013 09:17:00 +0000 (10:17 +0100)]
ARM: vexpress: Ensure SPC driver is loaded before using it in PSCI init

Otherwise we get a nullptr dereference calling vexpress_spc_get_nb_cpus.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Get tc2_pm_psci.c to use common CP15 accessor functions
Jon Medhurst [Thu, 21 Mar 2013 12:00:09 +0000 (12:00 +0000)]
ARM: vexpress: Get tc2_pm_psci.c to use common CP15 accessor functions

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Fixup tc2_pm_psci.c for mcpm APIs
Jon Medhurst [Thu, 21 Mar 2013 11:15:56 +0000 (11:15 +0000)]
ARM: vexpress: Fixup tc2_pm_psci.c for mcpm APIs

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: add psci support in TC2 device tree
Achin Gupta [Sun, 16 Dec 2012 22:41:02 +0000 (22:41 +0000)]
ARM: vexpress: add psci support in TC2 device tree

This patch adds a psci device node to allow the ospm subsystems on the
TC2 to work with a psci backend implemented in the secure firmware. The
function offsets start from 1 instead of 0 as thats whats the current
secure firmware implements.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: vexpress: add shim layer for psci backend on TC2
Achin Gupta [Tue, 26 Feb 2013 15:33:25 +0000 (15:33 +0000)]
ARM: vexpress: add shim layer for psci backend on TC2

This patch introduces a shim layer for the TC2 platform which converts
'bL_platform_power_ops' routines to their psci counterparts. The psci
counterparts are implemented by the secure firmware. The shim layer
is used only when Linux is running in non-secure world and the secure
firmware implements psci.

It also introduces the use of a reference count to allow a power up call
to go ahead of a power down call.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: vexpress: allow native pm ops backends to probe for psci suppport
Achin Gupta [Mon, 17 Dec 2012 00:15:00 +0000 (00:15 +0000)]
ARM: vexpress: allow native pm ops backends to probe for psci suppport

This patch allows the vexpress 'tc2' native backend to probe
the dt for presence of the psci backend. If present then the native
implementation of the 'bL_platform_power_ops' is not used.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: TC2: replace hard coded cluster and cpu values with constants
Achin Gupta [Sun, 10 Mar 2013 22:36:51 +0000 (22:36 +0000)]
ARM: TC2: replace hard coded cluster and cpu values with constants

This patch adds constants in a tc2 specific header file to prevent
use of hard coded values for specifying the number of cpus and
clusters.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agotc2_pm: Fixup for new SPC driver
Jon Medhurst [Fri, 31 May 2013 12:43:05 +0000 (13:43 +0100)]
tc2_pm: Fixup for new SPC driver

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: use generic CCI code to turn on CCI ports on TC2
Nicolas Pitre [Wed, 22 May 2013 21:04:06 +0000 (17:04 -0400)]
ARM: vexpress: use generic CCI code to turn on CCI ports on TC2

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agotc2_pm: fixup for new CCI driver
Jon Medhurst [Thu, 9 May 2013 15:50:56 +0000 (16:50 +0100)]
tc2_pm: fixup for new CCI driver

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agocpuidle: arm_big_little: Initialise earlier by using device_initcall
Jon Medhurst [Tue, 14 May 2013 09:05:05 +0000 (10:05 +0100)]
cpuidle: arm_big_little: Initialise earlier by using device_initcall

Using late_initcall is too late for IKS.

Requested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: TC2: reset CPUs spuriously woken up on cluster power up
Lorenzo Pieralisi [Thu, 14 Mar 2013 14:07:20 +0000 (14:07 +0000)]
ARM: TC2: reset CPUs spuriously woken up on cluster power up

On TC2, all CPUs in a cluster are woken up when an IRQ event triggers for a
CPU in a cluster in shutdown state.

This patch puts spuriously woken CPUs back in reset by checking the
pending IRQ status in the SPC wake-up interrupt status register; if the
CPU has no pending IRQ routed to it, the core reexecutes wfi and it is put
in reset by FW straight away.

Tested-by: Viresh Kumar <viresh.kumar2@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
11 years agocpuidle: arm_big_little: fixup for MCPM
Nicolas Pitre [Tue, 19 Mar 2013 19:59:24 +0000 (15:59 -0400)]
cpuidle: arm_big_little: fixup for MCPM

The low-level layer is now called "mcpm".

11 years agoUse dts compatible node to init cpuidle-tc2
mark hambleton [Fri, 18 Jan 2013 14:16:19 +0000 (14:16 +0000)]
Use dts compatible node to init cpuidle-tc2

Change the init code for cpuidle-tc2 to check for a
compatible node in the devicetree of "arm,generic"
in preparation for moving it to driver/cpuidle.

Rename functions / variable from tc2_ to bl_.

Signed-off-by: mark hambleton <mahamble@broadcom.com>
11 years agoARM: vexpress/tc2: clean up the cpuidle driver
Nicolas Pitre [Mon, 10 Dec 2012 05:36:26 +0000 (00:36 -0500)]
ARM: vexpress/tc2: clean up the cpuidle driver

Use the bL_cpu_suspend method instead of bL_cpu_power_down.

This allows for the driver to become usable on non SPC based platform
such as RTSM if vexpress_spc_check_loaded() is removed.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: mcpm: Make all mcpm functions notrace
Dave Martin [Wed, 20 Feb 2013 17:34:20 +0000 (17:34 +0000)]
ARM: mcpm: Make all mcpm  functions notrace

The functions in mcpm_entry.c are mostly intended for use during
scary cache and coherency disabling sequences, or do other things
which confuse trace ...  like powering a CPU down and not
returning.  Similarly for the backend code.

For simplicity, this patch just makes whole files notrace.
There should be more than enough traceable points on the paths to
these functions, but we can be more fine-grained later if there is
a need for it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
11 years agoARM: vexpress/tc2: implement PM suspend method
Nicolas Pitre [Mon, 10 Dec 2012 05:22:06 +0000 (00:22 -0500)]
ARM: vexpress/tc2: implement PM suspend method

This is simplistic for the moment as the expected residency is used to
prevent the shutting down of L2 and the cluster if the residency for
the last man is lower than 5 ms.  To make this right, the residency
end time for each CPU would need to be recorded and taken into account.

On a suspend, the firmware mailbox address has to be set prior entering
low power mode.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: TC2: disable GIC CPU IF on power down
Lorenzo Pieralisi [Tue, 5 Feb 2013 11:09:16 +0000 (11:09 +0000)]
ARM: TC2: disable GIC CPU IF on power down

On TC2 testchip the GIC CPU IF must be disabled before powering down a
core since a pending IRQ might cause wfi completion and the processor
would exit wfi state while power controller is taking action to reset or
power up the CPU upon IRQ reception.

This patch adds code that disables the GIC CPU IF in TC2 specific
power API methods.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
11 years agogic: introduce gic_cpu_if_down()
Nicolas Pitre [Wed, 20 Mar 2013 03:59:04 +0000 (23:59 -0400)]
gic: introduce gic_cpu_if_down()

This should be queued right before 'Revert "ARM: common: add GIC bybass disable
on GIC CPU IF save function"'.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: TC2: basic PM support
Nicolas Pitre [Sat, 20 Oct 2012 00:48:50 +0000 (20:48 -0400)]
ARM: TC2: basic PM support

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: b.L: assume aliasing I-cache
Nicolas Pitre [Wed, 13 Jun 2012 13:19:05 +0000 (09:19 -0400)]
ARM: b.L: assume aliasing I-cache

To deal with the I-cache discrepancy between Cortex-A15 and Cortex-A7,
let's assume aliasing I-cache in both cases.

Note: this might need to be refined i.e. detect a big.LITTLE system
somehow by probing all CPUs not only the boot one.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: vexpress: Make cpuidle check for presence of SPC driver
Jon Medhurst [Wed, 25 Jul 2012 14:13:46 +0000 (15:13 +0100)]
ARM: vexpress: Make cpuidle check for presence of SPC driver

The cpuidle code requires SPC hardware, so check for its presence
before initialising. This enables the cpuidle code to safely exist
in kernels run on hardware without SPC support.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: add TC2 CPU idle PM
Lorenzo Pieralisi [Fri, 13 Jul 2012 11:06:26 +0000 (12:06 +0100)]
ARM: vexpress: add TC2 CPU idle PM

TC2 test-chip integrates power management circuitry and firmware that
allows to remove voltage from both (A7 and A15) clusters when they are
idle or more generically when the system is forced into shutdown mode.

All CPUs in a cluster share the same voltage source so they cannot be
shutdown independently. In order to take advantage of TC2 power
management capabilities this patch implements a multi-cluster aware
CPU idle implementation. It is based on coupled C-state concept provided
by this code:

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-April/097084.html

CPUs that are part of the same cluster are coupled using the mask
provided by the MPIDR at boot. Once all CPUs hit the coupled barrier the
primary CPU in the cluster (the one with MPIDR[7:0] == 0) waits for
secondaries to clean their L1 and enter wfi. Then it cleans all cache
levels, exits cluster coherency and starts the procedure to shutdown the
respective cluster. All wake-up IRQ sources are enabled by default.

Deep shutdown states for clusters are not enabled by default.

To enabled them:

A15 cluster

echo 0 > /sys/kernel/debug/idle_debug/enable_idle

A7 cluster

echo 1 > /sys/kernel/debug/idle_debug/enable_idle

Tested thoroughly using lookbusy to modulate system load and trigger idle
states entry/exit.

11 years agoARM: kernel: Fix compilation of sleep.S on ARMv6
Jon Medhurst [Wed, 29 Aug 2012 08:16:44 +0000 (09:16 +0100)]
ARM: kernel: Fix compilation of sleep.S on ARMv6

The patch "ARM: kernel: fix MPIDR cpu_{suspend}/{resume} usage"
uses the BFC assembler instruction but this isn't available
on ARMv6 CPUs, which breaks compilation when building kernels which
support both SMP and ARMv6, e.g. omap2plus_defconifg.

Fix this by using a BIC instruction instead.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: kernel: fix MPIDR cpu_{suspend}/{resume} usage
Lorenzo Pieralisi [Fri, 4 May 2012 16:20:44 +0000 (17:20 +0100)]
ARM: kernel: fix MPIDR cpu_{suspend}/{resume} usage

The current version of cpu_{suspend}/{resume} relies on the 8 LSBs of
the MPIDR register to index the context pointer saved and restored on
CPU shutdown. This approach breaks as soon as platforms with populated
MPIDR affinity levels 1 and 2 are deployed, since the MPIDR cannot be
considered a linear index anymore.

There are multiple solutions to this problem, each with pros and cons.

This patch changes cpu_{suspend}/{resume} so that the CPU logical id
is used to retrieve an index into the context pointers array.

Performance is impacted on both save and restore paths. On save path
the CPU logical id has to be retrieved from thread_info; since caches
are on, the performance hit should be neglectable. In the resume code
path the MMU is off and so are the caches. The patch adds a trivial for
loop that polls the cpu_logical_map array scanning the present MPIDRs and
retrieves the actual CPU logical index. Since everything runs out of
strongly ordered memory the perfomance hit in the resume code path must
be measured and thought over; it worsens as the number of CPUs increases
since it is a linear search (but can be improved).

On the up side, the logical index approach is by far the easiest solution in
terms of coding and make dynamic changes to the cpu mapping trivial at
run-time.

Any change to the cpu_logical_map (ie in-kernel switcher) at run time must be
cleaned from the caches since this data has to be retrieved with the MMU
off, when caches are not searched.

Tested on TC2 and fast models.

11 years agoARM: mcpm: Make all mcpm functions notrace
Dave Martin [Wed, 20 Feb 2013 17:34:20 +0000 (17:34 +0000)]
ARM: mcpm: Make all mcpm functions notrace

The functions in mcpm_entry.c are mostly intended for use during
scary cache and coherency disabling sequences, or do other things
which confuse trace ...  like powering a CPU down and not
returning.  Similarly for the backend code.

For simplicity, this patch just makes whole files notrace.
There should be more than enough traceable points on the paths to
these functions, but we can be more fine-grained later if there is
a need for it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
11 years agoARM: vexpress: allow native pm ops backends to probe for psci suppport
Achin Gupta [Mon, 17 Dec 2012 00:15:00 +0000 (00:15 +0000)]
ARM: vexpress: allow native pm ops backends to probe for psci suppport

This patch allows the vexpress 'rtsm' native backend to probe
the dt for presence of the psci backend. If present then the native
implementation of the 'bL_platform_power_ops' is not used.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress/dcscb: handle platform coherency exit/setup and CCI
Dave Martin [Tue, 17 Jul 2012 13:25:44 +0000 (14:25 +0100)]
ARM: vexpress/dcscb: handle platform coherency exit/setup and CCI

Add the required code to properly handle race free platform coherency exit
to the DCSCB power down method.

The power_up_setup callback is used to enable the CCI interface for
the cluster being brought up.  This must be done in assembly before
the kernel environment is entered.

Thanks to Achin Gupta and Nicolas Pitre for their help and
contributions.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: vexpress/dcscb: do not hardcode number of CPUs per cluster
Nicolas Pitre [Wed, 18 Jul 2012 20:41:16 +0000 (16:41 -0400)]
ARM: vexpress/dcscb: do not hardcode number of CPUs per cluster

If 4 CPUs are assumed, the A15x1-A7x1 model configuration would never
shut down the initial cluster as the 0xf reset bit mask will never be
observed.  Let's construct this mask based on the provided information
in the DCSCB config register for the number of CPUs per cluster.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: vexpress/dcscb: add CPU use counts to the power up/down API implementation
Nicolas Pitre [Tue, 17 Jul 2012 02:07:10 +0000 (22:07 -0400)]
ARM: vexpress/dcscb: add CPU use counts to the power up/down API implementation

It is possible for a CPU to be told to power up before it managed
to power itself down.  Solve this race with a usage count to deal
with this possibility as mandated by the MCPM API definition.

Signed-off-by: nicolas Pitre <nico@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: vexpress: introduce DCSCB support
Nicolas Pitre [Thu, 3 May 2012 00:56:52 +0000 (20:56 -0400)]
ARM: vexpress: introduce DCSCB support

This adds basic CPU and cluster reset controls on RTSM for the
A15x4-A7x4 model configuration using the Dual Cluster System
Configuration Block (DCSCB).

The cache coherency interconnect (CCI) is not handled yet.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: introduce common set_auxcr/get_auxcr functions
Rob Herring [Wed, 16 Jan 2013 23:57:33 +0000 (17:57 -0600)]
ARM: introduce common set_auxcr/get_auxcr functions

Move the private set_auxcr/get_auxcr functions from
drivers/cpuidle/cpuidle-calxeda.c so they can be used across platforms.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
11 years agoARM: psci: add cmdline option to enable use of psci
Achin Gupta [Sun, 10 Mar 2013 22:04:29 +0000 (22:04 +0000)]
ARM: psci: add cmdline option to enable use of psci

This patch adds the 'psci' kernel command line option. Secure firmware cannot
yet add a psci device node in the dt to indicate whether it supports psci or
not. So in the current dt, the psci device node is present by default. The
probe function will always indicate that the secure firmware implements psci
irrespective of the address space linux runs in as the same device tree will
be used in either case. Hence a kernel cmdline option is required to choose
either the native or psci power api backend depending upon the address space
linux is running in.

Specifying 'psci=enable' in the cmdline will allow Linux running in the
non-secure address space to use the same dt but use the psci backend instead
of the native backend. It effectively overrides the presence of the native
implementation by ensuring registration of the psci backend. Linux running in
the secure address space will use the native backend for power management when
'psci=disable' in the cmdline (also the default value i.e. psci backend is
disabled by default) or the psci node in the dt is absent.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: psci: add probe function to discover presence of a psci implementation
Achin Gupta [Sun, 16 Dec 2012 23:11:32 +0000 (23:11 +0000)]
ARM: psci: add probe function to discover presence of a psci implementation

This patch adds a probe function to check if the secure firmware has an
implementation of the Power State Coordination Interface.

'bL_platform_power_ops' will be implemented by:

a. a native backend when Linux runs in secure world
b. a psci backend which relies on the secure firmware to implement the
   power ops

presence of b. will be indicated by the psci device node in the device tree.
The device node is expected to be populated by the secure firmware if it
supports psci. If the native backend detects a psci node then it bails out
allowing the psci backend to be registered.

Also a dummy 'psci_probe' function is added for the case when psci support
is not included. This prevents the build from breaking for tc2 and the
rtsm platforms.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: psci: convert psci '-EALREADYON' error code to linux '-EAGAIN'
Achin Gupta [Sun, 10 Mar 2013 21:31:29 +0000 (21:31 +0000)]
ARM: psci: convert psci '-EALREADYON' error code to linux '-EAGAIN'

This patch adds a possible error code of the cpu_on psci api. It
indicates that the cpu specified in the cpu_on call is up and running
(e.g. the firmware still has not seen the preceding cpu_off call).

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: psci: add constants to specify affinity levels
Achin Gupta [Sun, 16 Dec 2012 21:46:10 +0000 (21:46 +0000)]
ARM: psci: add constants to specify affinity levels

This patch defines constants to allow callers of the psci 'suspend'
& 'off' calls specify supported affinity levels.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoARM: vexpress: Add SPC node to TC2 device-tree
Jon Medhurst [Fri, 31 May 2013 10:20:41 +0000 (11:20 +0100)]
ARM: vexpress: Add SPC node to TC2 device-tree

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agodrivers: mfd: vexpress: add Serial Power Controller (SPC) support
Lorenzo Pieralisi [Thu, 6 Jun 2013 09:59:23 +0000 (10:59 +0100)]
drivers: mfd: vexpress: add Serial Power Controller (SPC) support

The TC2 versatile express core tile integrates a logic block that provides the
interface between the dual cluster test-chip and the M3 microcontroller that
carries out power management. The logic block, called Serial Power Controller
(SPC), contains several memory mapped registers to control among other things
low-power states, operating points and reset control.

This patch provides a driver that enables run-time control of features
implemented by the SPC control logic.

The driver also provides a bridge interface through the vexpress config
infrastructure. Operations allowing to read/write operating points are
made to go via the same interface as configuration transactions so that
all requests to M3 are serialized.

Device tree bindings documentation for the SPC component is provided with
the patchset.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
11 years agodrivers: mfd: refactor the vexpress config bridge API
Pawel Moll [Thu, 6 Jun 2013 09:59:22 +0000 (10:59 +0100)]
drivers: mfd: refactor the vexpress config bridge API

The introduction of Serial Power Controller (SPC) requires the vexpress
config interface to change slightly since the SPC memory mapped interface
can be used as configuration bus but also for operating points
programming and retrieval. The helper that allocates the bridge functions
requires an additional parameter allowing to request component specific
functions that need not be initialized through device tree bindings but
just using simple look-up and statically defined constants.

This patch introduces the necessary changes to the vexpress config layer
to cater for the new vexpress bridge interface requirements.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Amit Kucheria <amit.kucheria@linaro.org>
Cc: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
11 years agoSupport CCI PMU in perf
Punit Agrawal [Thu, 20 Sep 2012 15:39:25 +0000 (16:39 +0100)]
Support CCI PMU in perf

CCI400 has a set of counters that can be used to profile different
transations at CCI master and slave interfaces. These counters can
observe different kinds of transations passing through the CCI and
provide a system-level view of activity.

This patch adds support for CCI PMU by extending the existing CCI
driver.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agodrivers: ARM CCI: Add a platform driver stub for the PMU
Jon Medhurst [Fri, 10 May 2013 13:47:27 +0000 (14:47 +0100)]
drivers: ARM CCI: Add a platform driver stub for the PMU

This is a hack to enable the old CCI PMU patches to be used with the new
CCI driver. The CCI PMU is (mis)represented by a separate node in TC2
device-tree.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Add CCI nodes to TC2 device-tree
Jon Medhurst [Fri, 10 May 2013 13:37:37 +0000 (14:37 +0100)]
ARM: vexpress: Add CCI nodes to TC2 device-tree

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agodrivers/bus: arm-cci: function to enable CCI ports from early boot code
Nicolas Pitre [Wed, 22 May 2013 03:34:41 +0000 (23:34 -0400)]
drivers/bus: arm-cci: function to enable CCI ports from early boot code

This provides cci_enable_port_for_self().  This is the counterpart to
cci_disable_port_by_cpu(self).

This is meant to be called from the MCPM machine specific power_up_setup
callback code when the appropriate affinity level needs to be initialized.
The code therefore has to be position independent as the MMU is still off
and it cannot rely on any stack space.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Dave Martin <dave.martin@linaro.org>
11 years agodrivers: bus: add ARM CCI support
Lorenzo Pieralisi [Fri, 13 Jul 2012 14:55:52 +0000 (15:55 +0100)]
drivers: bus: add ARM CCI support

On ARM multi-cluster systems coherency between cores running on
different clusters is managed by the cache-coherent interconnect (CCI).
It allows broadcasting of TLB invalidates and memory barriers and it
guarantees cache coherency at system level through snooping of slave
interfaces connected to it.

This patch enables the basic infrastructure required in Linux to handle and
programme the CCI component.

Non-local variables used by the CCI management functions called by power
down function calls after disabling the cache must be flushed out to main
memory in advance, otherwise incoherency of those values may occur if they
are sitting in the cache of some other CPU when power down functions
execute. Driver code ensures that relevant data structures are flushed
from inner and outer caches after the driver probe is completed.

CCI slave port resources are linked to set of CPUs through bus masters
phandle properties that link the interface resources to masters node in
the device tree.

Documentation describing the CCI DT bindings is provided with the patch.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
11 years agoARM: introduce a standalone CONFIG_BIG_LITTLE option
Nicolas Pitre [Tue, 19 Mar 2013 20:07:17 +0000 (16:07 -0400)]
ARM: introduce a standalone CONFIG_BIG_LITTLE option

The BIG_LITTLE config option is independent from the MCPM one.
Semantically, they cover different things.  MCPM can be used on non
b.L systems for example.

Signed-of-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: mcpm: Make all mcpm functions notrace
Dave Martin [Wed, 20 Feb 2013 17:34:20 +0000 (17:34 +0000)]
ARM: mcpm: Make all mcpm  functions notrace

The functions in mcpm_entry.c are mostly intended for use during
scary cache and coherency disabling sequences, or do other things
which confuse trace ...  like powering a CPU down and not
returning.  Similarly for the backend code.

For simplicity, this patch just makes whole files notrace.
There should be more than enough traceable points on the paths to
these functions, but we can be more fine-grained later if there is
a need for it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
11 years agoARM: vexpress: Select multi-cluster SMP operation if required
Jon Medhurst [Wed, 30 Jan 2013 09:12:55 +0000 (09:12 +0000)]
ARM: vexpress: Select multi-cluster SMP operation if required

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: Enable selection of SMP operations at boot time
Jon Medhurst [Tue, 21 May 2013 13:40:51 +0000 (13:40 +0000)]
ARM: Enable selection of SMP operations at boot time

Add a new 'smp_init' hook to machine_desc so platforms can specify a
function to be used to setup smp ops instead of having a statically
defined value.  The hook must return true when smp_ops are initialized.
If false the static mdesc->smp_ops will be used by default.

Add the definition of "bool" by including the linux/types.h file to
asm/mach/arch.h and make it self-contained.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
11 years agoarm: introduce psci_smp_ops
Stefano Stabellini [Tue, 21 May 2013 14:24:11 +0000 (14:24 +0000)]
arm: introduce psci_smp_ops

Rename virt_smp_ops to psci_smp_ops and move them to arch/arm/kernel/psci_smp.c.
Remove mach-virt/platsmp.c, now unused.
Compile psci_smp if CONFIG_ARM_PSCI and CONFIG_SMP.

Add a cpu_die smp_op based on psci_ops.cpu_off.

Initialize PSCI before setting smp_ops in setup_arch.

If PSCI is available on the platform, prefer psci_smp_ops over the
platform smp_ops.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Will Deacon <will.deacon@arm.com>
CC: arnd@arndb.de
CC: marc.zyngier@arm.com
CC: linux@arm.linux.org.uk
CC: nico@linaro.org
CC: rob.herring@calxeda.com
11 years agoARM: bL boot on A7 cluster
Vincent Guittot [Fri, 17 May 2013 09:20:19 +0000 (11:20 +0200)]
ARM: bL boot on A7 cluster

Ensure that A7 cluster will be mapped on CPU0-2

Suggested-by: Chris Redpath <Chris.Redpath@arm.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
11 years agoARM: vexpress: update TC2 dts to support multiple PMUs
Sudeep KarkadaNagesha [Mon, 16 Jul 2012 12:29:43 +0000 (12:29 +0000)]
ARM: vexpress: update TC2 dts to support multiple PMUs

This patch adds support for both A15 and A7 PMUs on vexpress TC2

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
11 years agoARM: vexpress: Add CPU clock-frequencies to TC2 device-tree
Jon Medhurst [Tue, 26 Mar 2013 13:06:53 +0000 (13:06 +0000)]
ARM: vexpress: Add CPU clock-frequencies to TC2 device-tree

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Update TC2 memory to 2GB
Jon Medhurst [Tue, 26 Mar 2013 13:04:51 +0000 (13:04 +0000)]
ARM: vexpress: Update TC2 memory to 2GB

All TC2 boards 'in the wild' will have 2GB of memory, so lets make it
all available.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Add proper DT support for the dual cluster V2P-CA15_CA7 CoreTile
Liviu Dudau [Fri, 29 Jun 2012 16:50:14 +0000 (17:50 +0100)]
ARM: vexpress: Add proper DT support for the dual cluster V2P-CA15_CA7 CoreTile

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoarm: versatile: don't mark pen as __INIT
Mark Rutland [Mon, 10 Jun 2013 15:07:24 +0000 (16:07 +0100)]
arm: versatile: don't mark pen as __INIT

When booting fewer cores than are physically present on a versatile
platform (e.g. when passing maxcpus=N on the command line), some
secondary cores may remain in the holding pen, which is marked __INIT.
Late in the boot process, the memory comprising the holding pen will be
released to the kernel for more general use, and may be overwritten with
arbitrary data, which can cause the held secondaries to start behaving
unpredictably. This can lead to all manner of odd behaviour from the
kernel.

Instead don't mark the section as __INIT. This means we can't reuse the
pen memory, but we won't get secondaries corrupting the rest of the
kernel.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
11 years agotimer: Avoid masking EVENTEN bit in CNTKCTL register
Mathieu J. Poirier [Tue, 11 Jun 2013 23:07:50 +0000 (17:07 -0600)]
timer: Avoid masking EVENTEN bit in CNTKCTL register

Will Deacon has a better solution and his patch should
be coming in soon.  In the mean time please consider for inclusion.

This is an in-between solution that prevents the EVENTEN bit in
the CNTKCTL register from being mask, resulting in events between
clusters being lost.

Bug: LP1188778

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
11 years agoARM: vexpress: Select CONFIG_ARM_ERRATA_643719
Jon Medhurst [Thu, 6 Jun 2013 13:36:40 +0000 (14:36 +0100)]
ARM: vexpress: Select CONFIG_ARM_ERRATA_643719

The CA9X4 CoreTile suffers from this errata and as a consequence has
reboot and shutdown crashes since the cpu hotplug changes introduced in
Linux 3.10. (Commit bca7a5a04933 "ARM: cpu hotplug: remove majority of
cache flushing from platforms")

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agonet: smc91x: Do not cast pointer to int
Catalin Marinas [Thu, 9 May 2013 08:48:54 +0000 (08:48 +0000)]
net: smc91x: Do not cast pointer to int

The patch removes a compiler warning when casting the ioaddr pointer to
(unsigned int) in the smc_probe() function of the smc91x.c driver. The
casting is now done to (unsigned long).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoARM: LPAE: Invalidate the TLB for module addresses during translation fault
Catalin Marinas [Thu, 23 Feb 2012 17:16:41 +0000 (17:16 +0000)]
ARM: LPAE: Invalidate the TLB for module addresses during translation fault

During the free_pgtables() call all user and modules/pkmap entries are
removed. If a translation fault for the modules/pkmap area occurs before
we switched away from the current pgd, do_translation_fault() would copy
the init_mm pud into the user pud.

There is a small window between pud_clear() and pmd_free_tlb() in
free_pmd_range() where the pud entry was cleared but the TLB has not
been invalidated yet and the CPU may have cached the original (valid)
pud entry in the TLB. A scenario like below would get stuck in
continuous prefetch abort:

1. Current process exiting. The modules pmd entries not populated
2. exit_mmap() -> ... -> pmd_free_tlb()
3. pud_clear() for the 1GB pud containing user stack and modules (no TLB
   invalidation yet)
4. Interrupt -> module interrupt routine
5. Level 2 (pmd) translation fault occurs when executing the module
   interrupt routine. The CPU previously cached (TLB) the old valid pud
   value for the modules area, so we don't get a level 1 translation
   fault
6. do_translation fault() copies the pud_k into the pud
7. Linux returns to the faulty instruction. Goes back to 5

At point 7, since the CPU still has the old pud value, it goes back to
point 5 and never gets out of this loop. With this patch, the stale pud
TLB entry is invalidated after point 6 and the subsequent prefetch abort
doesn't occur.

Reported-by: Tony Thompson <Anthony.Thompson@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoARM: vexpress: configure CLCD driver device tree support for A9 CoreTile
Ryan Harkin [Thu, 26 Jul 2012 18:05:10 +0000 (19:05 +0100)]
ARM: vexpress: configure CLCD driver device tree support for A9 CoreTile

Configuration for the amba-clcd PL111 driver is added to the A9 CoreTile's DTS
file.

Configuration of the motherboard CLCD driver is disabled in the DTSI files to
prevent duplicate CLCD drivers being registered.

A generic set of CLCD panel descriptions has been split into its own DTSI file.
Currently, only XVGA and VGA monitors are described.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoamba-clcd: separate ioremap framebuffer from DMA implementation
Will Deacon [Mon, 28 Jan 2013 12:06:58 +0000 (12:06 +0000)]
amba-clcd: separate ioremap framebuffer from DMA implementation

The amba-clcd device can be configured to use either DMA or, when this
feature is not available, an ioremapped frambuffer in static ram.

In the case of the latter, we must take care not to pass ioremapped
addresses to dma_common_mmap, since this expects only addresses from
dma_mmap_coherent, which reside in the kernel linear mapping.

This patch reworks the fb initialisation code so that either DMA or IO
implementations of the mmap/remove functions are chosen as appropriate.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>