summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/cm33xx.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-18ARM: OMAP2+: Add functions to save and restore clockdomain context en-masse.Russ Dill1-0/+53
This is used to support suspend modes like RTC-only and hibernate where the state of the registers controlling clockdomains is lost. Signed-off-by: Russ Dill <Russ.Dill@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2017-12-11Merge branch '4.15-rc1-clkctrl-mach-omap2' of ↵Tony Lindgren1-0/+6
https://github.com/t-kristo/linux-pm into omap-for-v4.16/soc
2017-12-11ARM: OMAP2+: CM: make cm_ll_data structures as constBhumika Goyal1-1/+1
Make these const as they are only getting passed to the functions cm_register and cm_unregister having the arguments as const. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2017-12-04ARM: AM33xx: CM: add support for getting physical address for a registerTero Kristo1-0/+6
Needed for mapping the hwmods towards their corresponding clkctrl providers and clocks. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2017-06-06ARM: OMAP2+: PRCM: store also physical addresses for instancesTero Kristo1-2/+2
In some cases the physical address info is needed, so store this under the existing cm*_base, prm_base and prcm_mpu_base variables. These are converted now to structs that contain both virtual and physical address base for the instance. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2016-07-23ARM: OMAP4+: CM: Remove redundant checks for clkctrl_offs of zeroDave Gerlach1-6/+0
Now that we have moved the check for valid clkctrl_offs to the caller of am33xx_cm_wait_module_ready/idle and omap4_cminst_wait_module_ready/idle let's remove the now redundant check for clkctrl_offs from these functions. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Acked-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2016-07-04ARM: AM33xx: fix module_wait_ready without clkctrl registerTero Kristo1-0/+3
If the module has no clkctrl register defined, module_wait_ready should not try to access this. This can potentially cause an illegal register access, and result in bad idle reporting also. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2015-03-31ARM: OMAP2+: CM: move SoC specific init calls within a generic APITero Kristo1-2/+1
This gets rid of need for some exported driver APIs, and simplifies the initialization of the CM driver. Done in preparation to make CM a separate driver. The init data is now also passed to the SoC specific implementations, allowing future expansion to add feature flags etc. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2015-03-27ARM: OMAP2+: CM: determine CM base address from device treeTero Kristo1-0/+1
There is no need to provide the CM base address through a low-level API from the low-level IO init, as this information is available through DT. Re-routed the parsing function to be called from the CM drivers also to simplify the implementation under io.c. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2015-01-07ARM: OMAP2+: cm33xx.c: Remove some unused functionsRickard Strandqvist1-21/+0
Removes some functions that are not used anywhere: am33xx_cm_read_reg_bits() am33xx_cm_clear_reg_bits() am33xx_cm_set_reg_bits() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: OMAP2+: CM: add common APIs for cm_module_enable/disableTero Kristo1-4/+7
Adds a generic CM driver API for enabling/disabling modules. The SoC specific implementations are registered through cm_ll_data. Signed-off-by: Tero Kristo <t-kristo@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: OMAP2+: CM: make clkdm_hwsup operations staticTero Kristo1-5/+5
These are not accessed outside the cm*.c files themselves, so make them static. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Paul Walmsley <paul@pwsan.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: OMAP4+/AM33xx: CM: add common API for cm_wait_module_idleTero Kristo1-1/+5
Adds a generic CM driver API for waiting module to enter idle / standby. The SoC specific implementations are registered through cm_ll_data. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Paul Walmsley <paul@pwsan.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: OMAP2+: CM: add common API for cm_wait_module_readyTero Kristo1-2/+7
This patch consolidates the parameters provided for the SoC specific cm_*_wait_module_ready calls, adds the missing cm_ll_data function pointers and uses the now generic call from the mach-omap2 board code. SoC specific *_wait_module_ready calls are also made static so they can only be accessed through the generic CM driver API only. Signed-off-by: Tero Kristo <t-kristo@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: OMAP4/AM33xx: add cm_init / cm_exit calls for AM33xx and OMAP4+Tero Kristo1-0/+13
This is needed for expanding the generic CM driver API to include AM33xx and OMAP4 also. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Paul Walmsley <paul@pwsan.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-10-27ARM: AM33xx/OMAP4+: CM: remove cdoffs parameter from wait_module_idle/readyTero Kristo1-11/+7
This is not needed for anything. This also eases the consolidation of the wait_module_ready / wait_module_idle calls behind a generic CM driver API by reducing the number of needed parameters. Signed-off-by: Tero Kristo <t-kristo@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2014-05-08ARM: OMAP2+: raw read and write endian fixVictor Kamensky1-2/+2
All OMAP IP blocks expect LE data, but CPU may operate in BE mode. Need to use endian neutral functions to read/write h/w registers. I.e instead of __raw_read[lw] and __raw_write[lw] functions code need to use read[lw]_relaxed and write[lw]_relaxed functions. If the first simply reads/writes register, the second will byteswap it if host operates in BE mode. Changes are trivial sed like replacement of __raw_xxx functions with xxx_relaxed variant. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
2013-10-14ARM: OMAP2+: CM: cm_inst offset s16->u16Ankur Kishore1-8/+8
Most of the AM43x CM reg address offsets are with MSB bit '1' (on 16-bit value) leading to arithmetic miscalculations while calculating CLOCK ENABLE register's address because cm_inst field was a type of "const s16", so make it "const u16". Also modify relevant functions so as to take care of the above. [afzal@ti.com: fixup and cleanup] Signed-off-by: Ankur Kishore <a-kishore@ti.com> Signed-off-by: Afzal Mohammed <afzal@ti.com> Acked-by: Rajendra Nayak <rnayak@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2013-02-08ARM: OMAP2: am33xx-hwmod: Fix "register offset NULL check" bugHebbar Gururaja1-3/+0
am33xx_cm_wait_module_ready() checks if register offset is NULL. int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs) { int i = 0; if (!clkctrl_offs) return 0; In case of AM33xx, CLKCTRL register offset for different clock domains are not uniformly placed. An example of this would be the RTC clock domain with CLKCTRL offset at 0x00. In such cases the module ready check is skipped which leads to a data abort during boot-up when RTC registers is accessed. Remove this check here to avoid checking module readiness for modules with clkctrl register offset at 0x00. Koen Kooi notes that this patch fixes a crash on boot with CONFIG_RTC_DRV_OMAP=y with v3.8-rc5. Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com> Cc: Koen Kooi <koen@dominion.thruhere.net> [paul@pwsan.com: noted Koen's test in the patch description] Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-13Merge tag 'omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3-signed' of ↵Arnd Bergmann1-2/+0
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/headers From Tony Lindgren <tony@atomide.com>: These changes deal with the issues of relative includes introduced by the earlier clean-up and clean up few more things for enabling multiplatform support. The multiplatform kernel has been booted on omaps on top of this branch with the work-in-progress patches applied manually. We cannot yet enable the multiplatform support though. We still need the common clock framework patches, some solution for dma-omap.h, and serial-omap.h moved before we can enable it. * tag 'omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: Remove omap_init_consistent_dma_size() ARM: OMAP: Remove NEED_MACH_GPIO_H ARM: OMAP: Remove unnecessary mach and plat includes ARM: OMAP2+: Fix relative includes for serial.h ARM: OMAP: Fix relative includes for fpga.h ARM: OMAP1: Remove relative includes ARM: OMAP: Remove cpu_is_omap usage from plat-omap/dma.c ARM: OMAP: Fix relative includes for debug-devices.h ARM: OMAP: Remove plat-omap/common.h ARM: OMAP: Move omap-pm-noop.c local to mach-omap2 ARM: OMAP: Fix relative includes for shared i2c.h file ARM: OMAP: Make plat-omap/i2c.c port checks local ARM: OMAP: Move omap2+ specific parts of sram.c to mach-omap2 ARM: OMAP: Move omap1 specific code to local sram.c ARM: OMAP: Introduce common omap_map_sram() and omap_sram_reset() ARM: OMAP: Split sram.h to local headers and minimal shared header ARM: OMAP1: usb: fix sparse warnings Conflicts: arch/arm/mach-omap2/cm33xx.c Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-01ARM: OMAP: Remove plat-omap/common.hTony Lindgren1-2/+0
Most of the prototypes in plat-omap/common.h are not common to omap1 and omap2+, they are local to omap2+ and should not be in plat-omap/common.h. The only shared function prototype in this file is omap_init_clocksource_32k(), let's put that into counter-32k.h. Note that the new plat/counter-32k.h must not be included from drivers, that will break omap2+ build for CONFIG_MULTIPLATFORM. Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-25Merge tag 'omap-cleanup-a-for-3.8' of ↵Tony Lindgren1-0/+56
git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.8/cleanup-prcm The first set of OMAP PRM/CM-related cleanup patches for 3.8. Prepares for the future move of the PRM/CM code to drivers/. Also includes some prcm.[ch] cleanup patches from the WDTIMER cleanup series that don't need external acks. Basic test logs for this branch on top of v3.7-rc2 are here: http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121021123719/ But due to the number of unrelated regressions present in v3.7-rc[12], it's not particularly usable as a testing base. With reverts, fixes, and workarounds applied as documented in: http://www.pwsan.com/omap/testlogs/test_v3.7-rc2/20121020134755/README.txt the following test logs were obtained: http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121020231757/ which indicate that the series tests cleanly. Conflicts: arch/arm/mach-omap2/Makefile arch/arm/mach-omap2/clockdomain2xxx_3xxx.c arch/arm/mach-omap2/pm24xx.c
2012-10-21ARM: OMAP2/3: clockdomain/PRM/CM: move the low-level clockdomain functions ↵Paul Walmsley1-0/+56
into PRM/CM Move the low-level SoC-specific clockdomain control functions into cm*.c and prm*.c. For example, OMAP2xxx low-level clockdomain functions go into cm2xxx.c. Then remove the unnecessary clockdomain*xxx*.c files. The objective is to centralize low-level CM and PRM register accesses into the cm*.[ch] and prm*.[ch] files, and then to export an OMAP SoC-independent API to higher-level OMAP power management code. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Vaibhav Hiremath <hvaibhav@ti.com> Acked-by: Rajendra Nayak <rnayak@ti.com> Reviewed-by: Russ Dill <Russ.Dill@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-10-17ARM: OMAP: Make plat/common.h local to mach-omap1 and mach-omap2Tony Lindgren1-1/+1
We cannot keep this in plat/common.h for common zImage support. Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-06-18ARM: OMAP AM33xx: CM: Introduce AM33xx CM APIs and register level detailsVaibhav Hiremath1-0/+313
As far as PRM/CM/PRCM modules are concerned, AM33XX device is different than OMAP3 and OMAP4 architectures; so similar to PRM implementation, handle AM33XX CM separately. This patch introduces AM33XX CM module low-level api's, used and required by omap clockdomain and hwmod framework. Please note that cm-regbits-33xx.h (register bit field offset) and cm33xx.h (register addr offset) files are mostly auto generated. Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Afzal Mohammed <afzal@ti.com> Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com> Cc: Kevin Hilman <khilman@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> CC: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> [paul@pwsan.com: split the hwmod code changes in this patch into a separate patch; updated for 3.5] Signed-off-by: Paul Walmsley <paul@pwsan.com>