summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/common.h
AgeCommit message (Collapse)Author
2016-06-29ARM: shmobile: smp: Add function to prioritize DT SMPMagnus Damm
Add a function to check if other DT based method is available, and if so return false to not hook up smp_ops from the machine vector. This results in that DT-based SMP support has priority over older C-based smp_ops code, and in case DT-based SMP support code does not exist in the DTB then the old smp_ops code will still work as-is. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2016-04-25cpufreq: shmobile: Use generic platdev driverViresh Kumar
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform device now, reuse that and remove similar code from platform code. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-02-17ARM: shmobile: Consolidate SCU mapping codeGeert Uytterhoeven
Currently the SCU registers are mapped in SoC-specific code, using different methods, all involving the static mapping set up from machine_desc.map_io(): - On emev2, a static (non-identity) mapping is used, with ioremap(). As the static mapping uses the MT_DEVICE type, ioremap() reuses it, and the returned virtual address is suitable for passing to shmobile_smp_hook(), - On sh73a0 and r8a7779, a static identity mapping is used, with the legacy IOMEM() macro. As the static mapping uses the MT_DEVICE_NONSHARED type, replacing IOMEM() by ioremap() would create a new mapping, whose virtual address cannot be passed to shmobile_smp_hook(). Move the mapping of the SCU registers from SoC-specific code to common code, always using ioremap(). To work in the absence of a static mapping, this requires passing the physical SCU base address to shmobile_smp_hook(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2016-02-17ARM: shmobile: Remove shmobile_boot_argGeert Uytterhoeven
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-09-14ARM: shmobile: Remove legacy clock support leftoversLaurent Pinchart
The shmobile_clk_init() function has been removed and the linux/sh_clk.h header doesn't need to be included anymore. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-09-14ARM: shmobile: Remove obsolete twd_local_timer declarationGeert Uytterhoeven
The last user of twd_local_timer was removed in commit c99cd90d98a98aa1 ("ARM: shmobile: r8a7779: Remove legacy SoC code"). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-09-14ARM: shmobile: Remove obsolete earlytimer registrationGeert Uytterhoeven
The last caller of shmobile_earlytimer_init() was removed in commit c99cd90d98a98aa1 ("ARM: shmobile: r8a7779: Remove legacy SoC code"). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-09-14ARM: shmobile: Remove obsolete custom earlyprintk codeGeert Uytterhoeven
The last caller of shmobile_setup_console() was removed in commit 44d88c754e57a6d9 ("ARM: shmobile: Remove legacy SoC code for R-Mobile A1"). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-07-31ARM: 8392/3: smp: Only expose /sys/.../cpuX/online if hotpluggableStephen Boyd
Writes to /sys/.../cpuX/online fail if we determine the platform doesn't support hotplug for that CPU. Furthermore, if the cpu_die op isn't specified the system hangs when we try to offline a CPU and it comes right back online unexpectedly. Let's figure this stuff out before we make the sysfs nodes so that the online file doesn't even exist if it isn't (at least sometimes) possible to hotplug the CPU. Add a new 'cpu_can_disable' op and repoint all 'cpu_disable' implementations at it because all implementers use the op to indicate if a CPU can be hotplugged or not in a static fashion. With PSCI we may need to add a 'cpu_disable' op so that the secure OS can be migrated off the CPU we're trying to hotplug. In this case, the 'cpu_can_disable' op will indicate that all CPUs are hotpluggable by returning true, but the 'cpu_disable' op will make a PSCI migration call and occasionally fail, denying the hotplug of a CPU. This shouldn't be any worse than x86 where we may indicate that all CPUs are hotpluggable but occasionally we can't offline a CPU due to check_irq_vectors_for_cpu_disable() failing to find a CPU to move vectors to. Cc: Mark Rutland <mark.rutland@arm.com> Cc: Nicolas Pitre <nico@linaro.org> Cc: Dave Martin <Dave.Martin@arm.com> Acked-by: Simon Horman <horms@verge.net.au> [shmobile portion] Tested-by: Simon Horman <horms@verge.net.au> Cc: Magnus Damm <magnus.damm@gmail.com> Cc: <linux-sh@vger.kernel.org> Tested-by: Tyler Baker <tyler.baker@linaro.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-06-01ARM: v7 setup function should invalidate L1 cacheRussell King
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>
2015-04-22Merge tag 'armsoc-multiplatform' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC multiplatform code changes from Olof Johansson: "The changes here belong to two main platforms: - Atmel At91 is flipping the bit and going multiplatform. This includes some cleanups and removal of code, and the final flip of config dependencies - Shmobile has several platforms that are going multiplatform, but this branch also contains a bunch of cleanups that they weren't able to keep separate in a good way. THere's also a removal of one of their SoCs and the corresponding boards (sh7372 and mackerel)" * tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (67 commits) ARM: at91/pm: move AT91_MEMCTRL_* to pm.h ARM: at91/pm: move the standby functions to pm.c ARM: at91: fix pm_suspend.S compilation when ARMv6 is selected ARM: at91: add a Kconfig dependency on multi-platform ARM: at91: drop AT91_TIMER_HZ ARM: at91: remove hardware.h ARM: at91: remove SoC headers ARM: at91: remove useless mach/cpu.h ARM: at91: remove unused headers ARM: at91: switch at91_dt_defconfig to multiplatform ARM: at91: switch to multiplatform ARM: shmobile: r8a7778: enable multiplatform target ARM: shmobile: bockw: add sound to DT ARM: shmobile: r8a7778: add sound to DT ARM: shmobile: bockw: add devices hooked up to i2c0 to DT DT: i2c: add trivial binding for OKI ML86V7667 video decoder ARM: shmobile: r8a7778: common clock framework CPG driver ARM: shmobile: bockw dts: set extal clock frequency ARM: shmobile: bockw dts: Move Ethernet node to BSC ARM: shmobile: r8a73a4: Remove legacy code ...
2015-03-19ARM: shmobile: cpuidle: Remove the pointless default driverDaniel Lezcano
The default idle driver uses one state with the WFI instruction. The default idle routine invokes WFI when no cpuidle driver is present. The default cpuidle driver is pointless and does not give more than the default idle routine and moreover it pulls all the mathematics tied with the cpuidle governor for nothing, hence consuming more energy. Remove the default driver, the related code and register the driver directly. [compiled only - no board - no test] Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2015-02-24ARM: shmobile: sh7372: Remove Legacy C SoC codeMagnus Damm
Remove support for the legacy Cortex-A8 based sh7372 SoC. The Linux kernel still lacks DT bindings for the sh7372 INTC interrupt controller so DT multiplatform support is not possibile. Also, the sh7372 SoC never went into mass production anyway so to aid migration to DT multiplatform simply get rid of sh7372 support. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-11-04ARM: shmobile: Separate APMU resource data into CPU dependant partHisashi Nakamura
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-08-22ARM: shmobile: Remove shmobile_setup_delay()Magnus Damm
All ARM mach-shmobile SoCs and boards now rely on DTS for CPU Frequency information, so remove the unused function shmobile_setup_delay(). While at it, make the function shmobile_setup_delay_hz() static. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-07-07Merge tag 'renesas-soc-for-v3.17' of ↵Olof Johansson
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc Merge "Renesas ARM Based SoC Updates for v3.17" from Simon Horman: - Use shmobile_init_late on r8a7791 and r8a7790 whien booting using DT-only - Support Core-Standby for Suspend to RAM on r8a7791 and r8a7790 SoCs - Shared CMA reservation for R-Car Gen2 SoCs - Add r8a7791 SYSC power management support * tag 'renesas-soc-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1" ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update ARM: shmobile: Add shared R-Car Gen2 CMA reservation code ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM ARM: shmobile: r8a7791 SYSC setup code Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-06Merge tag 'renesas-r8a7779-multiplatform-for-v3.17' of ↵Olof Johansson
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc Pull "Renesas ARM Based SoC r8a7779-multiplatform Updates for v3.17" from Simon Horman: Move r8a7779 SoC and its Marzen board to use common clocks, multiplatform and initialise SCIF (serial) devices using DT. * tag 'renesas-r8a7779-multiplatform-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (32 commits) ARM: shmobile: marzen: Do not use workaround for scif devices ARM: shmobile: marzen: Initialise SCIF devices using DT ARM: shmobile: marzen: Remove early_printk from command line ARM: shmobile: r8a7779: Add scif nodes to dtsi ARM: shmobile: r8a7779 dtsi: Correct #address-cells/#size-cells for clocks ARM: shmobile: r8a7779 dtsi: Update unit-addresses for clocks ARM: shmobile: r8a7779: Remove unused r8a7779_init_delay() ARM: shmobile: marzen-reference: Use DT CPU Frequency ARM: shmobile: r8a7779: Use DT CPU Frequency in common case ARM: shmobile: r8a7779: Add Maximum CPU Frequency to DTS ARM: shmobile: marzen-reference: Remove legacy clock support ARM: shmobile: Remove Marzen reference DTS ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB ARM: shmobile: Remove non-multiplatform Marzen reference support ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU ARM: shmobile: marzen-reference: Initialize CPG device ARM: shmobile: r8a7779: Initial multiplatform support ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c ARM: shmobile: r8a7779: Add helper to read mode pins ... Signed-off-by: Olof Johansson <olof@lixom.net>
2014-06-17ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_initSimon Horman
The dummy shmobile_smp_apmu_suspend_init() function provided when CPU_IDLE is not set should not return a value as per the signature of the function. This problem appears to have been introduced by 867ba81f728f1daa ("ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM"). Cc: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-06-17ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAMkeita kobayashi
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 Damm
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>