summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/platsmp-apmu.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-28Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-armLinus Torvalds1-3/+3
Pull ARM updates from Russell King: - nommu updates from Afzal Mohammed cleaning up the vectors support - allow DMA memory "mapping" for nommu Benjamin Gaignard - fixing a correctness issue with R_ARM_PREL31 relocations in the module linker - add strlen() prototype for the decompressor - support for DEBUG_VIRTUAL from Florian Fainelli - adjusting memory bounds after memory reservations have been registered - unipher cache handling updates from Masahiro Yamada - initrd and Thumb Kconfig cleanups * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (23 commits) ARM: mm: round the initrd reservation to page boundaries ARM: mm: clean up initrd initialisation ARM: mm: move initrd init code out of arm_memblock_init() ARM: 8655/1: improve NOMMU definition of pgprot_*() ARM: 8654/1: decompressor: add strlen prototype ARM: 8652/1: cache-uniphier: clean up active way setup code ARM: 8651/1: cache-uniphier: include <linux/errno.h> instead of <linux/types.h> ARM: 8650/1: module: handle negative R_ARM_PREL31 addends correctly ARM: 8649/2: nommu: remove Hivecs configuration is asm ARM: 8648/2: nommu: display vectors base ARM: 8647/2: nommu: dynamic exception base address setting ARM: 8646/1: mmu: decouple VECTORS_BASE from Kconfig ARM: 8644/1: Reduce "CPU: shutdown" message to debug level ARM: 8641/1: treewide: Replace uses of virt_to_phys with __pa_symbol ARM: 8640/1: Add support for CONFIG_DEBUG_VIRTUAL ARM: 8639/1: Define KERNEL_START and KERNEL_END ARM: 8638/1: mtd: lart: Rename partition defines to be prefixed with PART_ ARM: 8637/1: Adjust memory boundaries after reservations ARM: 8636/1: Cleanup sanity_check_meminfo ARM: add CPU_THUMB_CAPABLE to indicate possible Thumb support ...
2017-02-28ARM: 8641/1: treewide: Replace uses of virt_to_phys with __pa_symbolFlorian Fainelli1-3/+3
All low-level PM/SMP code using virt_to_phys() should actually use __pa_symbol() against kernel symbols. Update code where relevant to move away from virt_to_phys(). Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-03ARM: shmobile: apmu: Allow booting secondary CPU cores in debug modeGeert Uytterhoeven1-13/+1
Now debug resource reset is handled properly, allow booting secondary CPU cores when hardware debug mode is enabled (MD21=1) on SoCs using the "renesas,apmu" enable method. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-01-03ARM: shmobile: apmu: Add debug resource reset for secondary CPU bootGeert Uytterhoeven1-0/+13
In debug mode (MD21=1), reset requests derived from power-shutoff to the AP-system CPU cores must be enabled before the AP-system CPU cores resume from power-shutoff for the first time. Else resume may fail, causing the system to hang during boot. As setting these bits is a no-op in normal mode, there's no need to check the actual state of MD21 first. Inspired by CPU-specific patches in the BSP by Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2017-01-03ARM: shmobile: apmu: Add more register documentationGeert Uytterhoeven1-4/+10
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2016-06-29ARM: shmobile: apmu: Add APMU DT support via Enable methodMagnus Damm1-4/+88
Allow DT configuration of the APMU hardware in the case when the APMU is pointed out in the DTB via the enable-method. The ability to configure the APMU via C code is still kept intact to prevent DTB breakage for older SoCs that do not rely on the enable-method for SMP support. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> [geert: Fix CONFIG_SMP=n build] Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2016-06-29ARM: shmobile: apmu: Move #ifdef CONFIG_SMP to cover more functionsGeert Uytterhoeven1-1/+1
shmobile_smp_apmu_prepare_cpus() is used only if CONFIG_SMP=y. Hence move the #ifdef to cover shmobile_smp_apmu_prepare_cpus() and all functions only called by it (apmu_init_cpu() and apmu_parse_cfg()). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2016-02-17ARM: shmobile: Remove shmobile_boot_argGeert Uytterhoeven1-1/+0
CPU boot configuration writes to shmobile_boot_arg, which is located in the .text section, and thus should not be written to. As of commit 1d33a354bbb618ba ("ARM: shmobile: Per-CPU SMP boot / sleep code for SCU SoCs"), and ignoring accidental remainings, shmobile_boot_arg is always set to MPIDR_HWID_BITMASK by C code. Hence we can just hardcode this in the assembler code, and remove the variable, and thus also remove the need to write to this variable. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-10-02ARM: shmobile: apmu: correct type of CPU idAndrzej Hajda1-1/+1
CPU id can be negative, so it cannot be assigned to unsigned variable. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-10-01ARM: shmobile: smp: Make shmobile_smp_apmu_cpu_shutdown() staticGeert Uytterhoeven1-1/+1
shmobile_smp_apmu_cpu_shutdown() is used inside platsmp-apmu.c only. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-07-14ARM: shmobile: apmu: silence build warningsWolfram Sang1-2/+2
With shmobile_defconfig but SMP=n && SUSPEND=n, I get: arch/arm/mach-shmobile/platsmp-apmu.c:49:12: warning: 'apmu_power_off' defined but not used [-Wunused-function] arch/arm/mach-shmobile/platsmp-apmu.c:70:12: warning: 'apmu_wrap' defined but not used [-Wunused-function] Annotate those functions like the functions around it. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-06-01ARM: v7 setup function should invalidate L1 cacheRussell King1-1/+1
All ARMv5 and older CPUs invalidate their caches in the early assembly setup function, prior to enabling the MMU. This is because the L1 cache should not contain any data relevant to the execution of the kernel at this point; all data should have been flushed out to memory. This requirement should also be true for ARMv6 and ARMv7 CPUs - indeed, these typically do not search their caches when caching is disabled (as it needs to be when the MMU is disabled) so this change should be safe. ARMv7 allows there to be CPUs which search their caches while caching is disabled, and it's permitted that the cache is uninitialised at boot; for these, the architecture reference manual requires that an implementation specific code sequence is used immediately after reset to ensure that the cache is placed into a sane state. Such functionality is definitely outside the remit of the Linux kernel, and must be done by the SoC's firmware before _any_ CPU gets to the Linux kernel. Changing the data cache clean+invalidate to a mere invalidate allows us to get rid of a lot of platform specific hacks around this issue for their secondary CPU bringup paths - some of which were buggy. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Thierry Reding <treding@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Wei Xu <xuwei5@hisilicon.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-11-04ARM: shmobile: Separate APMU resource data into CPU dependant partHisashi Nakamura1-18/+9
APMU resources are not common to all R-Car SoCs so don't share this data. A subsequent patch will correct the CPU cores for the r8a7791. Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-07-06ARM: shmobile: fix shmobile_smp_apmu_suspend_init build failure for !SUSPENDArnd Bergmann1-2/+0
Patch d6d757c9a4e ("ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM") added both an inline wrapper for shmobile_smp_apmu_suspend_init and an empty function in arch/arm/mach-shmobile/platsmp-apmu.c. We get a build failure when both are present, so this patch removes the one in the .c file and keeps the inline version. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-06-26ARM: shmobile: Use __init for APMU suspend init functionMagnus Damm1-1/+1
The function shmobile_smp_apmu_suspend_init() should be put into the init section to not trigger section mismatch warnings. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-06-26ARM: shmobile: Adjust APMU code to build for non-SMPMagnus Damm1-4/+7
Adjust the APMU code to allow build when CONFIG_SMP=n. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-06-17ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAMkeita kobayashi1-4/+56
This patch add Core-Standby-state for Suspend to RAM. Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Acked-by: Magnus Damm <damm+renesas@opensource.se> [horms+renesas@verge.net.au: rebase] Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-06-17ARM: shmobile: Move common.hMagnus Damm1-1/+1
Change location for common.h so it can be used as #include "common.h" instead of the old style #include <mach/common.h>. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-03-06ARM: shmobile: APMU: Fix warnings due to improper printk formatsLaurent Pinchart1-2/+1
Use the %pr printk specifier to print resource variables. This fixes warnings on platforms where resource_size_t has a different size than int. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2013-09-30ARM: shmobile: Include CA7 cores in APMU tableMagnus Damm1-0/+4
Add information to the shared APMU code regarding the APMU instance used to control the CA7 cores. This can be used on r8a7790 and r8a73a4, but should most likely be converted to DT in the future. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2013-09-30ARM: shmobile: Extend APMU code to allow single cluster onlyMagnus Damm1-0/+13
Extend the APMU code with a check to only allow boot of CPU cores that sit in the same cluster as CPU0. This makes it possible for people to use the r8a790 CA7 boot mode with CA7-cores only. The default CA15 boot mode will enable CA15 cores only. This is an intentional software limitation to cope with lacking scheduler support. By removing this patch it is possible to run all 8 cores in parallel, but this is not recommended without out of tree scheduler modfications or custom user space code to control the CPU affinitiy. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2013-09-30ARM: shmobile: Shared APMU SMP support code without DTMagnus Damm1-0/+178
Introduce shared APMU SMP code for mach-shmobile. Both SMP boot up and CPU Hotplug is supported. This version does not use DT but if needed this will be added as an incremental feature patch. The code is designed around CONFIG_NR_CPUS and should in theory support any number of APMUs, however due to the current DT-less static design only a single APMU is supported. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>