aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap-iommu.c
AgeCommit message (Collapse)Author
2020-07-22ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879Suman Anna
[ Upstream commit 2f14101a1d760db72393910d481fbf7768c44530 ] Errata Title: i879: DSP MStandby requires CD_EMU in SW_WKUP Description: The DSP requires the internal emulation clock to be actively toggling in order to successfully enter a low power mode via execution of the IDLE instruction and PRCM MStandby/Idle handshake. This assumes that other prerequisites and software sequence are followed. Workaround: The emulation clock to the DSP is free-running anytime CCS is connected via JTAG debugger to the DSP subsystem or when the CD_EMU clock domain is set in SW_WKUP mode. The CD_EMU domain can be set in SW_WKUP mode via the CM_EMU_CLKSTCTRL [1:0]CLKTRCTRL field. Implementation: This patch implements this workaround by denying the HW_AUTO mode for the EMU clockdomain during the power-up of any DSP processor and re-enabling the HW_AUTO mode during the shutdown of the last DSP processor (actually done during the enabling and disabling of the respective DSP MDMA MMUs). Reference counting has to be used to manage the independent sequencing between the multiple DSP processors. This switching is done at runtime rather than a static clockdomain flags value to meet the target power domain state for the EMU power domain during suspend. Note that the DSP MStandby behavior is not consistent across all boards prior to this fix. Please see commit 45f871eec6c0 ("ARM: OMAP2+: Extend DRA7 IPU1 MMU pdata quirks to DSP MDMA MMUs") for details. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-09iommu/omap: fix boot issue on remoteprocs with AMMU/UnicacheSuman Anna
Support has been added to the OMAP IOMMU driver to fix a boot hang issue on OMAP remoteprocs with AMMU/Unicache, caused by an improper AMMU/Unicache state upon initial deassertion of the processor reset. The issue is described in detail in the next three paragraphs. All the Cortex M3/M4 IPU processor subsystems in OMAP SoCs have a AMMU/Unicache IP that dictates the memory attributes for addresses seen by the processor cores. The AMMU/Unicache is configured/enabled by the SCACHE_CONFIG.BYPASS bit - a value of 1 enables the cache and mandates all addresses accessed by M3/M4 be defined in the AMMU. This bit is not programmable from the host processor. The M3/M4 boot sequence starts out with the AMMU/Unicache in disabled state, and SYS/BIOS programs the AMMU regions and enables the Unicache during one of its initial boot steps. This SCACHE_CONFIG.BYPASS bit is however enabled by default whenever a RET reset is applied to the IP, irrespective of whether it was previously enabled or not. The AMMU registers lose their context whenever this reset is applied. The reset is effective as long as the MMU portion of the subsystem is enabled and clocked. This behavior is common to all the IPU and DSP subsystems that have an AMMU/Unicache. The IPU boot sequence involves enabling and programming the MMU, and loading the processor and releasing the reset(s) for the processor. The PM setup code currently sets the target state for most of the power domains to RET. The L2 MMU can be enabled, programmed and accessed properly just fine with the domain in hardware supervised mode, while the power domain goes through a RET->ON->RET transition during the programming sequence. However, the ON->RET transition asserts a RET reset, and the SCACHE_CONFIG.BYPASS bit gets auto-set. An AMMU fault is thrown immediately when the M3/M4 core's reset is released since the first instruction address itself will not be defined in any valid AMMU regions. The ON->RET transition happens automatically on the power domain after enabling the iommu due to the hardware supervised mode. This patch adds and invokes the .set_pwrdm_constraint pdata ops, if present, during the OMAP IOMMU enable and disable functions to resolve the above boot hang issue. The ops will allow to invoke a mach-omap2 layer API pwrdm_set_next_pwrst() in a multi-arch kernel environment. The ops also returns the current power domain state while enforcing the constraint so that the driver can store it and use it to set back the power domain state while releasing the constraint. The pdata ops implementation restricts the target power domain to ON during enable, and back to the original power domain state during disable, and thereby eliminating the conditions for the boot issue. The implementation is effective only when the original power domain state is either RET or OFF, and is a no-op when it is ON or INACTIVE. The .set_pwrdm_constraint ops need to be plugged in pdata-quirks for the affected remote processors to be able to boot properly. Note that the current issue is seen only on kernels with the affected power domains programmed to enter RET. For eg., IPU1 on DRA7xx is in a separate domain and is susceptible to this bug, while the IPU2 subsystem is within CORE power domain, and CORE RET is not supported on this SoC. IPUs on OMAP4 and OMAP5 are also susceptible since they are in CORE power domain, and CORE RET is a valid power target on these SoCs. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
2015-11-30ARM: OMAP2+: Remove legacy device instantiation of IOMMUsSuman Anna
The legacy-style IOMMU device creation is maintained currently only for OMAP3 SoC, as all other SoCs are DT-boot only, and also to ensure functionality of the OMAP3 ISP driver, the only in-kernel client user on OMAP3 that supported both modes. Commit 78c66fbcec71 ("[media] v4l: omap3isp: Drop platform data support") removed the legacy device support from the OMAP3 ISP driver, so the legacy device instantiation of OMAP IOMMU devices is no longer needed, and is cleaned up. Signed-off-by: Suman Anna <s-anna@ti.com> [tony@atomide.com: updated to remove also the Makefile entry] Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-07-16ARM: OMAP2+: Remove module references from IOMMU machine layerSuman Anna
The OMAP IOMMU driver has been adapted to the IOMMU framework for a while now, and it no longer supports being built as a module. Cleanup all the module related references both from the code and in the build. While at it, also relocate a comment around the initcall to avoid a checkpatch strict warning about using a blank line after function/struct/union/enum declarations. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-07-29ARM: omap: Don't set iommu pdata da_start and da_end fieldsLaurent Pinchart
The fields are not used by the driver and will be removed from platform data. Don't set them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
2014-03-04iommu/omap: Add devicetree supportFlorian Vaussard
As OMAP2+ is moving to a full DT boot for all SoC families, commit 7ce93f3 "ARM: OMAP2+: Fix more missing data for omap3.dtsi file" adds basic DT bits for OMAP3. But the driver is not yet converted, so this will not work and driver will not be probed. Convert it! The legacy boot mode is still supported until OMAP3 is converted to DT-boot only. Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> [s-anna@ti.com: dev_name adaptation and improved error checking] Signed-off-by: Suman Anna <s-anna@ti.com> [tony@atomide.com: Ack for arch/arm/*omap* parts] Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
2013-02-21Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds
Pull ARM SoC-specific updates from Arnd Bergmann: "This is a larger set of new functionality for the existing SoC families, including: - vt8500 gains support for new CPU cores, notably the Cortex-A9 based wm8850 - prima2 gains support for the "marco" SoC family, its SMP based cousin - tegra gains support for the new Tegra4 (Tegra114) family - socfpga now supports a newer version of the hardware including SMP - i.mx31 and bcm2835 are now using DT probing for their clocks - lots of updates for sh-mobile - OMAP updates for clocks, power management and USB - i.mx6q and tegra now support cpuidle - kirkwood now supports PCIe hot plugging - tegra clock support is updated - tegra USB PHY probing gets implemented diffently" * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (148 commits) ARM: prima2: remove duplicate v7_invalidate_l1 ARM: shmobile: r8a7779: Correct TMU clock support again ARM: prima2: fix __init section for cpu hotplug ARM: OMAP: Consolidate OMAP USB-HS platform data (part 3/3) ARM: OMAP: Consolidate OMAP USB-HS platform data (part 1/3) arm: socfpga: Add SMP support for actual socfpga harware arm: Add v7_invalidate_l1 to cache-v7.S arm: socfpga: Add entries to enable make dtbs socfpga arm: socfpga: Add new device tree source for actual socfpga HW ARM: tegra: sort Kconfig selects for Tegra114 ARM: tegra: enable ARCH_REQUIRE_GPIOLIB for Tegra114 ARM: tegra: Fix build error w/ ARCH_TEGRA_114_SOC w/o ARCH_TEGRA_3x_SOC ARM: tegra: Fix build error for gic update ARM: tegra: remove empty tegra_smp_init_cpus() ARM: shmobile: Register ARM architected timer ARM: MARCO: fix the build issue due to gic-vic-to-irqchip move ARM: shmobile: r8a7779: Correct TMU clock support ARM: mxs_defconfig: Select CONFIG_DEVTMPFS_MOUNT ARM: mxs: decrease mxs_clockevent_device.min_delta_ns to 2 clock cycles ARM: mxs: use apbx bus clock to drive the timers on timrotv2 ...
2013-02-09ARM: OMAP2+: Make sure files with omap initcalls include soc.hTony Lindgren
Looks like there are few more places that I missed that can cause compiler warnings. After grepping for omap initcall, all files needing soc.h should now have it. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-01-26ARM: OMAP2+: omap_device: remove obsolete pm_lats and early_device codePaul Walmsley
Remove now-obsolete code from arch/arm/mach-omap2/omap_device.c. This mostly consists of removing the first attempt at device PM latency handling. This was never really used, has been replaced by the common dev_pm_qos code, and needs to go away as part of the DT conversion. Also, the early platform_device creation code has been removed, as it appears to be unused. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@deeprootsystems.com>
2013-01-11ARM: OMAP2+: Use omap initcallsTony Lindgren
This way the initcalls don't run on other SoCs on multiplatform kernels. Otherwise we'll get something like this when booting on vexpress: omap_hwmod: _ensure_mpu_hwmod_is_setup: MPU initiator hwmod mpu not yet registered ... WARNING: at arch/arm/mach-omap2/pm.c:82 _init_omap_device+0x74/0x94() _init_omap_device: could not find omap_hwmod for mpu ... omap-dma-engine omap-dma-engine: OMAP DMA engine driver ... Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-12-20ARM: OMAP2+: Trivial fix for IOMMU merge issueTony Lindgren
Commit 787314c35fbb ("Merge tag 'iommu-updates-v3.8' of git://git./linux/kernel/git/joro/iommu") did not account for the changed header location. The headers were made local to mach-omap2 as they are specific to omap2+ only, and we wanted to get most of the #include <plat/*.h> headers fixed up anyways for the ARM multiplatform support. We attempted to avoid this kind of merge conflict early on by setting up a minimal git branch shared by the arm-soc tree and the iommu tree, but looks like we still hit a merge issue there as the branches got merged as various topic branches. Cc: Joerg Roedel <joro@8bytes.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-03iommu/omap: Adapt to runtime pmOmar Ramirez Luna
Use runtime PM functionality interfaced with hwmod enable/idle functions, to replace direct clock operations and sysconfig handling. Due to reset sequence, pm_runtime_[get|put]_sync must be used, to avoid possible operations with the module under reset. Because of this and given that the driver uses spin_locks to protect their critical sections, we must use pm_runtime_irq_safe in order for the runtime ops to be happy, otherwise might_sleep_if checks in runtime framework will complain. The remaining pm_runtime out of iommu_enable and iommu_disable corresponds to paths that can be accessed through debugfs, some of them doesn't work if the module is not enabled first, but in future if the mmu is idled withouth freeing, these are needed to debug. Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
2012-12-03iommu/omap: Migrate to hwmod frameworkOmar Ramirez Luna
Use hwmod data and device attributes to build and register an omap device for iommu driver. - Update the naming convention in isp module. - Remove unneeded check for number of resources, as this is now handled by omap_device and prevents driver from loading. - Now unused, remove platform device and resource data, handling of sysconfig register for softreset purposes, use default latency structure. - Use hwmod API for reset handling. Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
2012-11-20ARM: OMAP2+: Move iommu/iovmm headers to platform_dataTony Lindgren
Move iommu/iovmm headers from plat/ to platform_data/ as part of the single zImage work. Partially based on an earlier version by Ido Yariv <ido@wizery.com>. Cc: Ido Yariv <ido@wizery.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Omar Ramirez Luna <omar.luna@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Joerg Roedel <joro@8bytes.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12ARM: OMAP2+: Prepare for irqs.h removalTony Lindgren
As the interrupts should only be defined in the platform_data, and eventually coming from device tree, there's no need to define them in header files. Let's remove the hardcoded references to irqs.h and fix up the includes so we don't rely on headers included in irqs.h. Note that we're defining OMAP_INTC_START as 0 to the interrupts. This will be needed when we enable SPARSE_IRQ. For some drivers we need to add #include <plat/cpu.h> for now until these drivers are fixed to remove cpu_is_omapxxxx() usage. While at it, sort som of the includes the standard way, and add the trailing commas where they are missing in the related data structures. Note that for drivers/staging/tidspbridge we just define things locally. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-05-13ARM: OMAP4: fix irq and clock name for dsp-iommuJuan Gutierrez
Irq and clock names were wrong for dsp iommu configuration for omap4. - Renamed tesla_ick to dsp_fck: This is required because the new naming convention introduced by: commit 0e43327 "OMAP4 clock: Fix clock names and align with hwmod names" - Renamed INT_44XX_DSP_MMU to OMAP44XX_IRQ_TESLA_MMU. Naming convention adopted since: commit e927f8d "omap4: Add auto-generated irq and dma headers" - dsp-iommu is enabled by default. Signed-off-by: Juan Gutierrez <jgutierrez@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
2012-03-05ARM: OMAP: fix iommu, not mailboxOhad Ben-Cohen
For some weird (freudian?) reason, commit 435792d "ARM: OMAP: make iommu subsys_initcall to fix builtin omap3isp" unintentionally changed the mailbox's initcall instead of the iommu's. Fix that. Reported-by: Fernando Guzman Lugo <fernando.lugo@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Joerg Roedel <Joerg.Roedel@amd.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-11-07ARM: OMAP: Fix export.h or module.h includesTony Lindgren
Commit 32aaeffbd4a7457bf2f7448b33b5946ff2a960eb (Merge branch 'modsplit-Oct31_2011'...) caused some build errors. Fix these and make sure we always have export.h or module.h included for MODULE_ and EXPORT_SYMBOL users: $ grep -rl ^MODULE_ arch/arm/*omap*/*.c | xargs \ grep -L linux/module.h arch/arm/mach-omap2/dsp.c arch/arm/mach-omap2/mailbox.c arch/arm/mach-omap2/omap-iommu.c arch/arm/mach-omap2/smartreflex.c Also check we either have export.h or module.h included for the files exporting symbols: $ grep -rl EXPORT_SYMBOL arch/arm/*omap*/*.c | xargs \ grep -L linux/export.h | xargs grep -L linux/module.h Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-07-04OMAP4: iommu: fix clock nameOhad Ben-Cohen
0e43327 "OMAP4: clock: Fix clock names and align with hwmod names" renamed ducati_ick to ipu_fck. Update OMAP4's iommu_device accordingly, so that omap_iommu_probe doesn't break when calling clk_get. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
2010-12-15OMAP: iommu: make iva2 iommu selectableFelipe Contreras
It seems dsp-link will do this, and tidspbridge too at some point, but right now it's not possible to select CONFIG_MPU_BRIDGE_IOMMU. Cc: Fernando Guzman Lugo <fernando.lugo@ti.com> Cc: Yogesh Marathe <yogesh_marathe@ti.com> Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
2010-12-15OMAP: iommu: create new api to set valid da rangeGuzman Lugo, Fernando
Some IOMMUs cannot use the whole 0x0 - 0xFFFFFFFF range. With this new API the valid range can be set. Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com> Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2010-06-29omap iommu: update ducati mmu irq define nameKanigeri, Hari
2.6.34-rc6 kernel has the Ducati mmu irq define name changed, which is resulting in compilation error. Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2010-05-14omap iommu: support for OMAP4Kanigeri, Hari
This patch provides the iommu support for OMAP4 co-processors. Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2010-05-14omap iommu: renamed omap3-iommu to omap-iommuKanigeri, Hari
This patch includes changes to omap3-iommu.c file to make it generic for all OMAPs. Renamed omap3-iommu.c to omap-iommu.c [Hiroshi DOYU: Remove unnecessary "iommu-y" in Makefile] Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>