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>
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>
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>
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>
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>
Jon Medhurst [Wed, 17 Jul 2013 11:02:21 +0000 (12:02 +0100)]
Merge 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-psci' 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
Jon Medhurst [Wed, 17 Jul 2013 11:02:10 +0000 (12:02 +0100)]
Merge branch 'tracking-armlt-dcscb' 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
Jon Medhurst [Wed, 17 Jul 2013 11:01:55 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-spc' 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
Jon Medhurst [Wed, 17 Jul 2013 11:01:44 +0000 (12:01 +0100)]
Merge 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-tc2-dt' 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
Jon Medhurst [Wed, 17 Jul 2013 11:01:43 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-clcd' 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
Jon Medhurst [Wed, 17 Jul 2013 11:01:37 +0000 (12:01 +0100)]
Merge 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-rtsm' 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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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".
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Catalin Marinas [Fri, 4 Jan 2013 12:56:49 +0000 (12:56 +0000)]
amba-clcd: Only use dma_alloc_writecombine() if the arch supports it
This patch hides the dma_(alloc|free)_writecombine() calls behind macros
to allow the amba-clcd.c to be used on architectures that do not provide
this DMA API. With this patch, the *_writecombine() API is only used on
ARM (AArch32).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Jon Medhurst [Wed, 10 Oct 2012 12:27:25 +0000 (13:27 +0100)]
amba-clcd: Remove check for 'reg' value in clcdfb_probe
This check was attempting to ensure only one clcd device in the
device-tree was probed, however the check fails in the valid case where
the device is a child of another device and the 'reg' value is a offset
from the start of that other device, not an absolute address. This
occurs on vexpress with the motherboard clcd being a child of iofga.
For now, we will just have to rely on there only being one display
device specified in device-tree.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Thu, 28 Mar 2013 15:57:56 +0000 (15:57 +0000)]
amba-clcd: Add Device Tree support to amba-clcd driver
Add support to parse the display configuration from device tree.
If the board does not provide platform specific functions in the struct
clcd_board contained with the amba device info, then defaults are provided
by the driver.
The device tree configuration can either ask for a DMA setup or provide a
framebuffer address to be remapped into the driver.
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Jon Medhurst [Fri, 14 Jun 2013 17:30:08 +0000 (18:30 +0100)]
ARM HDLCD: Fix clock initialisation sequence
This reworks HDLCD initialisation to mirror how CLCD does this, in
particular to prepare the clock immediately after it has been got which
ensures that we don't try and enable clocks before they were prepared,
e.g. in the former clk_enable after register_framebuffer().
The reason this issue wasn't noticed before is that we have been
setting CONFIG_FRAMEBUFFER_CONSOLE and this caused
register_framebuffer() to trigger the creation of a console which calls
hdlcd_set_par(), which in turn was preparing and enabling the clock.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Tue, 26 Mar 2013 13:06:11 +0000 (13:06 +0000)]
ARM: vexpress: Update TC2 device tree for HDLCD hack
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Wed, 13 Jun 2012 09:01:28 +0000 (10:01 +0100)]
ARM: vexpress: Add support for HDLCD
This is a temporary solution to get everything running.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Tue, 5 Mar 2013 01:24:57 +0000 (09:24 +0800)]
ARM HDLCD: Fix compilation on Linux 3.9
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Thu, 4 Oct 2012 11:38:06 +0000 (12:38 +0100)]
ARM HDLCD: Changes to get HDLCD working with 've-updates'
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Jon Medhurst [Fri, 13 Jul 2012 13:25:50 +0000 (14:25 +0100)]
ARM HDLCD: Enable HDLCD_NO_VIRTUAL_SCREEN on Android
This is a hack which prevents annoying screen flicker in the Android UI.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Chris Redpath [Thu, 12 Jul 2012 11:33:13 +0000 (12:33 +0100)]
ARM HDLCD: Add developer option to remove double-height framebuffers
This option can be used with Android to push the graphics subsystem into a
different composition strategy which is more effective when used on hardware
where the framebuffer memory is not cacheable.
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Chris Redpath [Fri, 29 Jun 2012 15:07:46 +0000 (16:07 +0100)]
ARM HDLCD: Review comments from Liviu - extraneous memcpy
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Reviewed-By: Liviu Dudau <liviu.dudau@arm.com>
Chris Redpath [Fri, 29 Jun 2012 15:07:08 +0000 (16:07 +0100)]
ARM HDLCD: Add useful functions to HDLCD driver for system integration
During TC2 integration a bad config option resulted in HDLCD memory reads
not being serviced often enough. This lead to unsightly screen blanking.
These options allow the developer to count the number of underruns and
to control the color used by HDLCD when an underrun prevents accessing
pixel data. The combination of these two options allow easy diagnosis
of HDLCD underrun conditions.
Signed-off-by: Chris Redpath <chris.redpath@arm.com>