ARM: 7011/1: Add ARM cpu topology definition

The affinity between ARM processors is defined in the MPIDR register.
We can identify which processors are in the same cluster,
and which ones have performance interdependency. We can define the
cpu topology of ARM platform, that is then used by sched_mc and sched_smt.

The default state of sched_mc and sched_smt config is disable.
When enabled, the behavior of the scheduler can be modified with
sched_mc_power_savings and sched_smt_power_savings sysfs interfaces.

Changes since v4 :
*  Remove unnecessary parentheses and blank lines

Changes since v3 :
* Update the format of printk message
* Remove blank line

Changes since v2 :
* Update the commit message and some comments

Changes since v1 :
* Update the commit message
* Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h
* Modify header of arch/arm/kernel/topology.c
* Modify tests and manipulation of MPIDR's bitfields
* Modify the place and dependancy of the config
* Modify Noop functions

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: 7182/1: ARM cpu topology: fix warning

kernel/sched.c:7354:2: warning: initialization from incompatible pointer type

Align cpu_coregroup_mask prototype interface with sched_domain_mask_f typedef
use int cpu instead of unsigned int cpu

Cc: <stable@vger.kernel.org>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: topology: save cpu id of each core
ARM: topology: Update topology according to current sched_mc mode
ARM: topology: Add a cpu_power function
ARM: topology: Add a topology update notification
ARM: cpu topology: Add asym topology flag for using cpu0 1st

Modify the CPU sched_domain flags in powersave mode for using the cpu0 in ched_mc powersave mode

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
ARM: cpu topology: add debugfs
sched_features: enable arch_power
samsung_battery: Charge level interface

- defaults are stock currents
- now separate interfaces for ac and usb
cpufreq: 1600MHz CPU OC

Corrected CPU freq. going above scaling_max (even if only fractions of seconds)

Dynamically adjust cpufreq_max_limit according to scaling_max setting without breaking power save mode
cpufreq: CPU undervolting interface

credits to Simone201

adjusted to properly support overclocking by andip71
mali/midas-power: Decrease minimum voltage boundary

mali:
Decrease minimum voltage initialisation data for MAX77686 on buck3 rail / vdd_g3d to minimum value as defined in regulator driver.
Decrease minimum voltage soft-limit in GPU voltage control to same value.

midas-power.c: Adjust min/max voltages of several regulators to properly support undervolting
mali: platform rewrite

Samsung integrated checks on in the Pegasus platform that prevented the GPU control interfaces to work; on every decideNextStatus call the DVFS tables would be rewritten with separate fixed values. Module parameters for these values were present in the kernel so the hypothesis is that they were used for debugging during development.

-All checks are removed and the driver now looks very similar to the Orion platform.

-Removal of the CPU frequency lock to 1200MHz if the GPU is at 440MHz, this is excessive as 3D load heavy applications usually do not tax the CPU that far, and is an unnecessary power consumption burden.

-The thermal control unit temperature throttling causes to fix the voltage to a fixed value when throttling is in place; this is useless considering frequency is not limited, making the whole thing senseless. Thus removed.

-Cleaned up the files from unnecessary ifdef's for readability considering the fixed platform values.

thx to AndreiLux
mali: disable mali_runtime_resume setting which continuously sets the clock to 266MHz while resuming from idle state
mali: disable voltage clamping and reset even if it isn't really needed as it is already removed, i apply it anyway

thx to gm
mali: fixing frequencies levels issues we were going over the dvfs level limit, now fixed also disabled mali bottom_lock to have complete control over freq and voltages

thanks to AndreiLux for the heads up
mali: add GPU overclocking frequencies

credits to Simone201
mali: GPU control (thx to AndreiLux)

GPU frequency, scaling and voltage control.
Based on netarchy's initial implementation and improvements of gokhanmoral and ported onto the pegasus-m400 / Galaxy S3 platform.

adjusted and slightly corrected by andip71
mdnie: black crush fix

credits to AndreiLux