ARM: OMAP: remove prcm.[ch]
Subsystems (8)
Paul Walmsley
maintainercover ARM: OMAP: remove prcm.[ch]
Remove arch/arm/mach-omap2/prcm.c and arch/arm/plat-omap/include/plat/prcm.h. This is in preparation for moving the PRM/CM code to drivers/, although to be fair, these files should have been removed a long time ago.
Intended for 3.8 cleanup. Applies on top of the existing PRM/CM split cleanup series, and the WDTIMER cleanup series.
- Paul
---
omap2_prcm_cleanup_3.8
text data bss dec hex filename
7521423 696876 5613996 13832295 d31067 vmlinux.omap2plus_defconfig.orig
7522239 696612 5613996 13832847 d3128f vmlinux.omap2plus_defconfig
Paul Walmsley (13):
ARM: OMAP2+: common: remove mach-omap2/common.c and map_common_io code
ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
ARM: OMAP2xxx: clock: remove global 'dclk' variable
ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c
ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
ARM: OMAP2+: board files: use SoC-specific system restart functions
ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready()
ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest()
ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call
ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]
arch/arm/mach-omap1/reset.c | 2 arch/arm/mach-omap2/Makefile | 9 + arch/arm/mach-omap2/am33xx.h | 1 arch/arm/mach-omap2/board-2430sdp.c | 2 arch/arm/mach-omap2/board-3430sdp.c | 2 arch/arm/mach-omap2/board-3630sdp.c | 2 arch/arm/mach-omap2/board-4430sdp.c | 2 arch/arm/mach-omap2/board-am3517crane.c | 2 arch/arm/mach-omap2/board-am3517evm.c | 2 arch/arm/mach-omap2/board-apollon.c | 2 arch/arm/mach-omap2/board-cm-t35.c | 18 +- arch/arm/mach-omap2/board-cm-t3517.c | 2 arch/arm/mach-omap2/board-devkit8000.c | 2 arch/arm/mach-omap2/board-generic.c | 10 + arch/arm/mach-omap2/board-h4.c | 2 arch/arm/mach-omap2/board-igep0020.c | 4 - arch/arm/mach-omap2/board-ldp.c | 2 arch/arm/mach-omap2/board-n8x0.c | 6 - arch/arm/mach-omap2/board-omap3beagle.c | 2 arch/arm/mach-omap2/board-omap3evm.c | 2 arch/arm/mach-omap2/board-omap3logic.c | 4 - arch/arm/mach-omap2/board-omap3pandora.c | 2 arch/arm/mach-omap2/board-omap3stalker.c | 2 arch/arm/mach-omap2/board-omap3touchbook.c | 2 arch/arm/mach-omap2/board-omap4panda.c | 2 arch/arm/mach-omap2/board-overo.c | 2 arch/arm/mach-omap2/board-rm680.c | 4 - arch/arm/mach-omap2/board-rx51.c | 2 arch/arm/mach-omap2/board-ti8168evm.c | 4 - arch/arm/mach-omap2/board-zoom.c | 4 - arch/arm/mach-omap2/clkt2xxx_apll.c | 57 ++----- arch/arm/mach-omap2/clkt2xxx_dpllcore.c | 36 ++++- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 70 ++++++++- arch/arm/mach-omap2/clkt_iclk.c | 1 arch/arm/mach-omap2/clock.c | 15 +- arch/arm/mach-omap2/clock.h | 28 ---- arch/arm/mach-omap2/clock2420_data.c | 26 +-- arch/arm/mach-omap2/clock2430_data.c | 26 +-- arch/arm/mach-omap2/clock2xxx.c | 16 -- arch/arm/mach-omap2/clock2xxx.h | 9 + arch/arm/mach-omap2/cm-regbits-24xx.h | 2 arch/arm/mach-omap2/cm.h | 20 ++- arch/arm/mach-omap2/cm2xxx.c | 128 ++++++++++++++++ arch/arm/mach-omap2/cm2xxx.h | 4 + arch/arm/mach-omap2/cm2xxx_3xxx.h | 8 + arch/arm/mach-omap2/cm3xxx.c | 66 ++++++++ arch/arm/mach-omap2/cm3xxx.h | 5 + arch/arm/mach-omap2/cm_common.c | 70 +++++++++ arch/arm/mach-omap2/cminst44xx.h | 2 arch/arm/mach-omap2/common.c | 202 -------------------------- arch/arm/mach-omap2/common.h | 111 ++------------ arch/arm/mach-omap2/control.c | 10 + arch/arm/mach-omap2/control.h | 2 arch/arm/mach-omap2/cpuidle34xx.c | 1 arch/arm/mach-omap2/display.c | 2 arch/arm/mach-omap2/hdq1w.c | 4 - arch/arm/mach-omap2/i2c.c | 6 - arch/arm/mach-omap2/id.c | 7 + arch/arm/mach-omap2/io.c | 87 +++++++++-- arch/arm/mach-omap2/mcbsp.c | 2 arch/arm/mach-omap2/msdi.c | 4 - arch/arm/mach-omap2/omap2-restart.c | 65 ++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++ arch/arm/mach-omap2/omap4-common.c | 18 ++ arch/arm/mach-omap2/omap_hwmod.c | 8 - arch/arm/mach-omap2/pm34xx.c | 1 arch/arm/mach-omap2/powerdomain.c | 2 arch/arm/mach-omap2/prcm-common.h | 22 --- arch/arm/mach-omap2/prcm.c | 176 ----------------------- arch/arm/mach-omap2/prcm_mpu44xx.c | 17 ++ arch/arm/mach-omap2/prcm_mpu44xx.h | 9 + arch/arm/mach-omap2/prm.h | 24 +++ arch/arm/mach-omap2/prm2xxx.c | 15 ++ arch/arm/mach-omap2/prm2xxx.h | 2 arch/arm/mach-omap2/prm2xxx_3xxx.h | 7 - arch/arm/mach-omap2/prm3xxx.c | 16 ++ arch/arm/mach-omap2/prm3xxx.h | 2 arch/arm/mach-omap2/prm44xx.c | 1 arch/arm/mach-omap2/prm_common.c | 16 ++ arch/arm/mach-omap2/prminst44xx.h | 2 arch/arm/mach-omap2/sdrc.c | 8 - arch/arm/mach-omap2/sdrc.h | 3 arch/arm/mach-omap2/ti81xx.h | 9 + arch/arm/mach-omap2/wd_timer.c | 5 - arch/arm/plat-omap/include/plat/prcm.h | 36 ----- 85 files changed, 827 insertions(+), 804 deletions(-) delete mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.c delete mode 100644 arch/arm/mach-omap2/prcm.c delete mode 100644 arch/arm/plat-omap/include/plat/prcm.h
Paul Walmsley
maintainerPATCH 1/13 ARM: OMAP2+: common: remove mach-omap2/common.c and map_common_io code
Get rid of mach-omap2/common.c by moving the global initialization for IP block addresses that must occur early into mach-omap2/io.c. In the process, remove the *_map_common_io*() and SoC-specific *set_globals* functions.
--- arch/arm/mach-omap2/Makefile | 2 arch/arm/mach-omap2/am33xx.h | 1 arch/arm/mach-omap2/common.c | 202 -------------------------------- arch/arm/mach-omap2/common.h | 104 ++-------------- arch/arm/mach-omap2/control.c | 10 +- arch/arm/mach-omap2/control.h | 2 arch/arm/mach-omap2/id.c | 7 + arch/arm/mach-omap2/io.c | 78 ++++++++++-- arch/arm/mach-omap2/omap4-common.c | 1 arch/arm/mach-omap2/prcm.c | 15 +- arch/arm/mach-omap2/sdrc.c | 8 - arch/arm/mach-omap2/sdrc.h | 3 arch/arm/mach-omap2/ti81xx.h | 9 + arch/arm/plat-omap/include/plat/prcm.h | 5 + 14 files changed, 115 insertions(+), 332 deletions(-) delete mode 100644 arch/arm/mach-omap2/common.c
arch/arm/mach-omap2/Makefile +1 -1
@@ -4,7 +4,7 @@ # Common support obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ - common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o + gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap-2-3-common = irq.o hwmod-common = omap_hwmod.o \
arch/arm/mach-omap2/am33xx.h +1 -0
@@ -21,5 +21,6 @@#define AM33XX_SCM_BASE 0x44E10000#define AM33XX_CTRL_BASE AM33XX_SCM_BASE#define AM33XX_PRCM_BASE 0x44E00000 +#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + 0x3FC)#endif /* __ASM_ARCH_AM33XX_H */
arch/arm/mach-omap2/common.c deleted +0 -202
202 lines not on this page · raw message
arch/arm/mach-omap2/common.h +12 -92
116 lines not on this page · raw message
arch/arm/mach-omap2/control.c +4 -6
@@ -149,13 +149,11 @@ static struct omap3_control_regs control_context;#define OMAP_CTRL_REGADDR (reg) (omap2_ctrl_base + (reg))#define OMAP4_CTRL_PAD_REGADDR (reg) (omap4_ctrl_pad_base + (reg)) -void __init omap2_set_globals_control (struct omap_globals *omap2_globals) +void __init omap2_set_globals_control (void __iomem *ctrl, +void __iomem *ctrl_pad) { -if (omap2_globals->ctrl) - omap2_ctrl_base = omap2_globals->ctrl; - -if (omap2_globals->ctrl_pad) - omap4_ctrl_pad_base = omap2_globals->ctrl_pad; + omap2_ctrl_base = ctrl; + omap4_ctrl_pad_base = ctrl_pad; }void __iomem *omap_ctrl_base_get (void )
arch/arm/mach-omap2/control.h +2 -0
@@ -414,6 +414,8 @@ extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);extern void omap_ctrl_write_dsp_boot_mode (u8 bootmode);extern void omap3630_ctrl_disable_rta (void );extern int omap3_ctrl_save_padconf (void ); +extern void omap2_set_globals_control (void __iomem *ctrl, +void __iomem *ctrl_pad);#else #define omap_ctrl_base_get () 0#define omap_ctrl_readb (x) 0
arch/arm/mach-omap2/id.c +4 -3
@@ -559,11 +559,12 @@ void __init omap5xxx_check_revision(void)* detect the exact revision later on in omap2_detect_revision() once map_io * is done. */ -void __init omap2_set_globals_tap (struct omap_globals *omap2_globals) +void __init omap2_set_globals_tap (u32 class,void __iomem *tap) { - omap_revision = omap2_globals->class; - tap_base = omap2_globals->tap; + omap_revision = class; + tap_base = tap; +/* XXX What is this intended to do? */ if (cpu_is_omap34xx ()) tap_prod_id =0x0210 ;else
arch/arm/mach-omap2/io.c +64 -14
174 lines not on this page · raw message
arch/arm/mach-omap2/omap4-common.c +1 -0
@@ -32,6 +32,7 @@#include "omap-wakeupgen.h" #include "soc.h" +#include "iomap.h" #include "common.h" #include "hsmmc.h" #include "omap4-sar-layout.h"
arch/arm/mach-omap2/prcm.c +6 -9
@@ -136,16 +136,13 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,return (i <MAX_MODULE_ENABLE_WAIT ) ?1 :0 ; }; -void __init omap2_set_globals_prcm (struct omap_globals *omap2_globals) +void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm, +void __iomem *cm2,void __iomem *prcm_mpu) { -if (omap2_globals->prm) - prm_base = omap2_globals->prm; -if (omap2_globals->cm) - cm_base = omap2_globals->cm; -if (omap2_globals->cm2) - cm2_base = omap2_globals->cm2; -if (omap2_globals->prcm_mpu) - prcm_mpu_base = omap2_globals->prcm_mpu; + prm_base = prm; + cm_base = cm; + cm2_base = cm2; + prcm_mpu_base = prcm_mpu;if (cpu_is_omap44xx () ||soc_is_omap54xx ()) {omap_prm_base_init ();
arch/arm/mach-omap2/sdrc.c +3 -5
@@ -115,12 +115,10 @@ int omap2_sdrc_get_params(unsigned long r, } -void __init omap2_set_globals_sdrc (struct omap_globals *omap2_globals) +void __init omap2_set_globals_sdrc (void __iomem *sdrc,void __iomem *sms) { -if (omap2_globals->sdrc) - omap2_sdrc_base = omap2_globals->sdrc; -if (omap2_globals->sms) - omap2_sms_base = omap2_globals->sms; + omap2_sdrc_base = sdrc; + omap2_sms_base = sms; }/**
arch/arm/mach-omap2/sdrc.h +3 -0
@@ -50,6 +50,9 @@ static inline u32 sms_read_reg(u16 reg) {return __raw_readl (OMAP_SMS_REGADDR (reg)); } + +extern void omap2_set_globals_sdrc (void __iomem *sdrc,void __iomem *sms); +#else #define OMAP242X_SDRC_REGADDR (reg) \ OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
arch/arm/mach-omap2/ti81xx.h +9 -0
@@ -22,6 +22,15 @@#define TI81XX_CTRL_BASE TI81XX_SCM_BASE#define TI81XX_PRCM_BASE 0x48180000 +/* +* Adjust TAP register base such that omap3_check_revision accesses the correct +* TI81XX register for checking device ID (it adds 0x204 to tap base while +* TI81XX DEVICE ID register is at offset 0x600 from control base). +*/ +#define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \ + TI81XX_CONTROL_DEVICE_ID - 0x204) + +#define TI81XX_ARM_INTC_BASE 0x48200000#endif /* __ASM_ARCH_TI81XX_H */
arch/arm/plat-omap/include/plat/prcm.h +5 -0
@@ -27,8 +27,13 @@#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H#define __ASM_ARM_ARCH_OMAP_PRCM_H +#include <linux/kernel.h> +#include <linux/io.h> +int omap2_cm_wait_idlest (void __iomem *reg,u32 mask,u8 idlest,const char *name); +void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm, +void __iomem *cm2,void __iomem *prcm_mpu);#endif
Paul Walmsley
maintainerPATCH 2/13 ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
In reply to Paul WalmsleyAdd SoC reset functions into the PRM code. These functions are based on code from mach-omap2/prcm.c. They reset the SoC using the CORE DPLL reset method (as opposed to one of the other two or three chip reset methods).
Adding them here will facilitate their removal from arch/arm/mach-omap2/prcm.c. (prcm.c is deprecated.)
--- arch/arm/mach-omap2/prm2xxx.c | 14 ++++++++++++++ arch/arm/mach-omap2/prm2xxx.h | 2 ++ arch/arm/mach-omap2/prm3xxx.c | 15 +++++++++++++++ arch/arm/mach-omap2/prm3xxx.h | 2 ++ 4 files changed, 33 insertions(+)
arch/arm/mach-omap2/prm2xxx.c +14 -0
@@ -69,6 +69,20 @@ static u32 omap2xxx_prm_read_reset_sources(void)return r; } +/** +* omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC +* +* Set the DPLL reset bit, which should reboot the SoC. This is the +* recommended way to restart the SoC. No return value. +*/ +void omap2xxx_prm_dpll_reset (void ) +{ +omap2_prm_set_mod_reg_bits (OMAP_RST_DPLL3_MASK ,WKUP_MOD , +OMAP2_RM_RSTCTRL ); +/* OCP barrier */ +omap2_prm_read_mod_reg (WKUP_MOD ,OMAP2_RM_RSTCTRL ); +} +int omap2xxx_clkdm_sleep (struct clockdomain *clkdm) { omap2_prm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
arch/arm/mach-omap2/prm2xxx.h +2 -0
@@ -124,6 +124,8 @@extern int omap2xxx_clkdm_sleep (struct clockdomain *clkdm);extern int omap2xxx_clkdm_wakeup (struct clockdomain *clkdm); +extern void omap2xxx_prm_dpll_reset (void ); +extern int __init prm2xxx_init (void ); extern int __exit prm2xxx_exit(void);
arch/arm/mach-omap2/prm3xxx.c +15 -0
@@ -123,6 +123,21 @@ u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset) }/** +* omap3xxx_prm_dpll3_reset - use DPLL3 reset to reboot the OMAP SoC +* +* Set the DPLL3 reset bit, which should reboot the SoC. This is the +* recommended way to restart the SoC, considering Errata i520. No +* return value. +*/ +void omap3xxx_prm_dpll3_reset (void ) +{ +omap2_prm_set_mod_reg_bits (OMAP_RST_DPLL3_MASK ,OMAP3430_GR_MOD , +OMAP2_RM_RSTCTRL ); +/* OCP barrier */ +omap2_prm_read_mod_reg (OMAP3430_GR_MOD ,OMAP2_RM_RSTCTRL ); +} + +/** * omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events * @events: ptr to a u32, preallocated by caller *
arch/arm/mach-omap2/prm3xxx.h +2 -0
@@ -152,6 +152,8 @@ extern void omap3xxx_prm_ocp_barrier(void);extern void omap3xxx_prm_save_and_clear_irqen (u32 *saved_mask);extern void omap3xxx_prm_restore_irqen (u32 *saved_mask); +extern void omap3xxx_prm_dpll3_reset (void ); +extern u32 omap3xxx_prm_get_reset_sources (void );#endif /* __ASSEMBLER */
Paul Walmsley
maintainerPATCH 3/13 ARM: OMAP2xxx: clock: remove global 'dclk' variable
In reply to Paul WalmsleyRemove the global 'dclk' variable, instead replacing it with a variable local to the dpllcore clock type C file. This removes some of the special-case code surrounding the OMAP2xxx clock init.
This patch is a prerequisite for the removal of the omap_prcm_restart() code from arch/arm/mach-omap2/prcm.c. It also cleans up some special-case OMAP2xxx clock code in the process.
--- arch/arm/mach-omap2/clkt2xxx_dpllcore.c | 34 ++++++++++++++++++++++---- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 2 +- arch/arm/mach-omap2/clock2420_data.c | 4 ++- arch/arm/mach-omap2/clock2430_data.c | 4 ++- arch/arm/mach-omap2/clock2xxx.c | 2 +- arch/arm/mach-omap2/clock2xxx.h | 5 ++-- 6 files changed, 37 insertions(+), 14 deletions(-)
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +29 -5
@@ -37,9 +37,15 @@/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ +/* +* dpll_core_ck: pointer to the combined dpll_ck + core_ck on OMAP2xxx +* (currently defined as "dpll_ck" in the OMAP2xxx clock tree). Set +* during dpll_ck init and used later by omap2xxx_clk_get_core_rate(). +*/ +static struct clk *dpll_core_ck; +/** * omap2xxx_clk_get_core_rate - return the CORE_CLK rate -* @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") * * Returns the CORE_CLK rate. CORE_CLK can have one of three rate * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz
@@ -47,12 +53,14 @@* struct clk *dpll_ck, which is a composite clock of dpll_ck and * core_ck. */ -unsigned long omap2xxx_clk_get_core_rate (struct clk *clk) +unsigned long omap2xxx_clk_get_core_rate (void ) {long long core_clk;u32 v; - core_clk =omap2_get_dpll_rate (clk); +WARN_ON (!dpll_core_ck); + + core_clk =omap2_get_dpll_rate (dpll_core_ck); v =omap2_cm_read_mod_reg (PLL_MOD ,CM_CLKSEL2 ); v &=OMAP24XX_CORE_CLK_SRC_MASK ;
@@ -100,7 +108,7 @@ static long omap2_dpllcore_round_rate(unsigned long target_rate)unsigned long omap2_dpllcore_recalc (struct clk *clk) { -return omap2xxx_clk_get_core_rate (clk); +return omap2xxx_clk_get_core_rate (); }int omap2_reprogram_dpllcore (struct clk *clk,unsigned long rate)
@@ -110,7 +118,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)struct prcm_config tmpset;const struct dpll_data *dd; - cur_rate =omap2xxx_clk_get_core_rate (dclk); + cur_rate =omap2xxx_clk_get_core_rate (); mult =omap2_cm_read_mod_reg (PLL_MOD ,CM_CLKSEL2 ); mult &=OMAP24XX_CORE_CLK_SRC_MASK ;
@@ -171,3 +179,19 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)return 0 ; } +/** +* omap2xxx_clkt_dpllcore_init - clk init function for dpll_ck +* @clk: struct clk *dpll_ck +* +* Store a local copy of @clk in dpll_core_ck so other code can query +* the core rate without having to clk_get(), which can sleep. Must +* only be called once. No return value. XXX If the clock +* registration process is ever changed such that dpll_ck is no longer +* statically defined, this code may need to change to increment some +* kind of use count on dpll_ck. +*/ +void omap2xxx_clkt_dpllcore_init (struct clk *clk) +{ +WARN (dpll_core_ck,"dpll_core_ck already set - should never happen" ); + dpll_core_ck = clk; +}
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +1 -1
@@ -119,7 +119,7 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) } curr_prcm_set = prcm; - cur_rate =omap2xxx_clk_get_core_rate (dclk); + cur_rate =omap2xxx_clk_get_core_rate ();if (prcm->dpll_speed == cur_rate /2 ) {omap2xxx_sdrc_reprogram (CORE_CLK_SRC_DPLL ,1 );
arch/arm/mach-omap2/clock2420_data.c +2 -2
@@ -126,6 +126,7 @@ static struct clk dpll_ck = { .name = "dpll_ck", .ops = &clkops_omap2xxx_dpll_ops, .parent = &sys_ck, /* Can be func_32k also */ + .init = &omap2xxx_clkt_dpllcore_init, .dpll_data = &dpll_dd, .clkdm_name = "wkup_clkdm", .recalc = &omap2_dpllcore_recalc,
@@ -1957,7 +1958,7 @@ int __init omap2420_clk_init(void)omap_clk_disable_autoidle_all ();/* Check the MPU rate set by bootloader */ - clkrate =omap2xxx_clk_get_core_rate (&dpll_ck); + clkrate =omap2xxx_clk_get_core_rate ();for (prcm = rate_table; prcm->mpu_speed; prcm++) {if (!(prcm->flags & cpu_mask))continue ;
@@ -1983,7 +1984,6 @@ int __init omap2420_clk_init(void)/* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ vclk =clk_get (NULL ,"virt_prcm_set" ); sclk =clk_get (NULL ,"sys_ck" ); - dclk =clk_get (NULL ,"dpll_ck" );return 0 ; }
arch/arm/mach-omap2/clock2430_data.c +2 -2
@@ -125,6 +125,7 @@ static struct clk dpll_ck = { .name = "dpll_ck", .ops = &clkops_omap2xxx_dpll_ops, .parent = &sys_ck, /* Can be func_32k also */ + .init = &omap2xxx_clkt_dpllcore_init, .dpll_data = &dpll_dd, .clkdm_name = "wkup_clkdm", .recalc = &omap2_dpllcore_recalc,
@@ -2056,7 +2057,7 @@ int __init omap2430_clk_init(void)omap_clk_disable_autoidle_all ();/* Check the MPU rate set by bootloader */ - clkrate =omap2xxx_clk_get_core_rate (&dpll_ck); + clkrate =omap2xxx_clk_get_core_rate ();for (prcm = rate_table; prcm->mpu_speed; prcm++) {if (!(prcm->flags & cpu_mask))continue ;
@@ -2082,7 +2083,6 @@ int __init omap2430_clk_init(void)/* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ vclk =clk_get (NULL ,"virt_prcm_set" ); sclk =clk_get (NULL ,"sys_ck" ); - dclk =clk_get (NULL ,"dpll_ck" );return 0 ; }
arch/arm/mach-omap2/clock2xxx.c +1 -1
@@ -30,7 +30,7 @@#include "cm.h" #include "cm-regbits-24xx.h" -struct clk *vclk, *sclk, *dclk; +struct clk *vclk, *sclk;/* * Omap24xx specific clock functions
arch/arm/mach-omap2/clock2xxx.h +2 -3
@@ -15,10 +15,11 @@ unsigned long omap2xxx_sys_clk_recalc(struct clk *clk);unsigned long omap2_osc_clk_recalc (struct clk *clk);unsigned long omap2_dpllcore_recalc (struct clk *clk);int omap2_reprogram_dpllcore (struct clk *clk,unsigned long rate); -unsigned long omap2xxx_clk_get_core_rate (struct clk *clk); +unsigned long omap2xxx_clk_get_core_rate (void );u32 omap2xxx_get_apll_clkin (void );u32 omap2xxx_get_sysclkdiv (void );void omap2xxx_clk_prepare_for_reboot (void ); +void omap2xxx_clkt_dpllcore_init (struct clk *clk);#ifdef CONFIG_SOC_OMAP2420 int omap2420_clk_init (void );
@@ -34,8 +35,6 @@ int omap2430_clk_init(void);extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; -extern struct clk *dclk; -extern const struct clkops clkops_omap2430_i2chs_wait;extern const struct clkops clkops_oscck;extern const struct clkops clkops_apll96;
Paul Walmsley
maintainerPATCH 4/13 ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c
In reply to Paul WalmsleyCollect all of the virt_prcm_set-specific clocktype code into mach-omap2/clkt2xxx_virt_prcm_set.c. Remove its dependency on the 'sclk' and 'vclk' global variables. Those variables will be removed by subsequent patches.
This is part of the process of cleaning up the OMAP2xxx clock code and preparing for the removal of the omap_prcm_restart() function.
--- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 66 +++++++++++++++++++++++--- arch/arm/mach-omap2/clock2420_data.c | 19 ++----- arch/arm/mach-omap2/clock2430_data.c | 19 ++----- arch/arm/mach-omap2/clock2xxx.h | 2 + 4 files changed, 70 insertions(+), 36 deletions(-)
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +58 -8
@@ -1,7 +1,7 @@/* * OMAP2xxx DVFS virtual clock functions * -* Copyright (C) 2005-2008 Texas Instruments, Inc. +* Copyright (C) 2005-2008, 2012 Texas Instruments, Inc. * Copyright (C) 2004-2010 Nokia Corporation * * Contacts:
@@ -47,6 +47,13 @@const struct prcm_config *curr_prcm_set;const struct prcm_config *rate_table; +/* +* sys_ck_rate: the rate of the external high-frequency clock +* oscillator on the board. Set by the SoC-specific clock init code. +* Once set during a boot, will not change. +*/ +static unsigned long sys_ck_rate; +/** * omap2_table_mpu_recalc - just return the MPU speed * @clk: virt_prcm_set struct clk
@@ -68,15 +75,14 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk)long omap2_round_to_table_rate (struct clk *clk,unsigned long rate) {const struct prcm_config *ptr; -long highest_rate, sys_clk_rate; +long highest_rate; highest_rate = -EINVAL ; - sys_clk_rate =__clk_get_rate (sclk);for (ptr = rate_table; ptr->mpu_speed; ptr++) {if (!(ptr->flags & cpu_mask))continue ; -if (ptr->xtal_speed != sys_clk_rate) +if (ptr->xtal_speed != sys_ck_rate)continue ; highest_rate = ptr->mpu_speed;
@@ -95,15 +101,12 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)const struct prcm_config *prcm;unsigned long found_speed =0 ;unsigned long flags; -long sys_clk_rate; - - sys_clk_rate =__clk_get_rate (sclk);for (prcm = rate_table; prcm->mpu_speed; prcm++) {if (!(prcm->flags & cpu_mask))continue ; -if (prcm->xtal_speed != sys_clk_rate) +if (prcm->xtal_speed != sys_ck_rate)continue ;if (prcm->mpu_speed <= rate) {
@@ -169,3 +172,50 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)return 0 ; } + +/** +* omap2xxx_clkt_vps_check_bootloader_rate - determine which of the rate +* table sets matches the current CORE DPLL hardware rate +* +* Check the MPU rate set by bootloader. Sets the 'curr_prcm_set' +* global to point to the active rate set when found; otherwise, sets +* it to NULL. No return value; +*/ +void omap2xxx_clkt_vps_check_bootloader_rates (void ) +{ +const struct prcm_config *prcm =NULL ; +unsigned long rate; + + rate =omap2xxx_clk_get_core_rate (); +for (prcm = rate_table; prcm->mpu_speed; prcm++) { +if (!(prcm->flags & cpu_mask)) +continue ; +if (prcm->xtal_speed != sys_ck_rate) +continue ; +if (prcm->dpll_speed <= rate) +break ; + } + curr_prcm_set = prcm; +} + +/** +* omap2xxx_clkt_vps_late_init - store a copy of the sys_ck rate +* +* Store a copy of the sys_ck rate for later use by the OMAP2xxx DVFS +* code. (The sys_ck rate does not -- or rather, must not -- change +* during kernel runtime.) Must be called after we have a valid +* sys_ck rate, but before the virt_prcm_set clock rate is +* recalculated. No return value. +*/ +void omap2xxx_clkt_vps_late_init (void ) +{ +struct clk *c; + + c =clk_get (NULL ,"sys_ck" ); +if (IS_ERR (c)) { +WARN (1 ,"could not locate sys_ck\n" ); + }else { + sys_ck_rate =clk_get_rate (c); +clk_put (c); + } +}
arch/arm/mach-omap2/clock2420_data.c +5 -14
@@ -1,7 +1,7 @@/* * OMAP2420 clock data * -* Copyright (C) 2005-2009 Texas Instruments, Inc. +* Copyright (C) 2005-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2004-2011 Nokia Corporation * * Contacts:
@@ -1927,9 +1927,7 @@ static struct omap_clk omap2420_clks[] = {int __init omap2420_clk_init (void ) { -const struct prcm_config *prcm;struct omap_clk *c; -u32 clkrate; prcm_clksrc_ctrl =OMAP2420_PRCM_CLKSRC_CTRL ; cm_idlest_pll =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST );
@@ -1954,20 +1952,13 @@ int __init omap2420_clk_init(void)omap2_init_clk_clkdm (c->lk.clk); } +omap2xxx_clkt_vps_late_init (); +/* Disable autoidle on all clocks; let the PM code enable it later */ omap_clk_disable_autoidle_all (); -/* Check the MPU rate set by bootloader */ - clkrate =omap2xxx_clk_get_core_rate (); -for (prcm = rate_table; prcm->mpu_speed; prcm++) { -if (!(prcm->flags & cpu_mask)) -continue ; -if (prcm->xtal_speed != sys_ck.rate) -continue ; -if (prcm->dpll_speed <= clkrate) -break ; - } - curr_prcm_set = prcm; +/* XXX Can this be done from the virt_prcm_set clk init function? */ +omap2xxx_clkt_vps_check_bootloader_rates ();recalculate_root_clocks ();
arch/arm/mach-omap2/clock2430_data.c +5 -14
@@ -1,7 +1,7 @@/* * OMAP2430 clock data * -* Copyright (C) 2005-2009 Texas Instruments, Inc. +* Copyright (C) 2005-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2004-2011 Nokia Corporation * * Contacts:
@@ -2026,9 +2026,7 @@ static struct omap_clk omap2430_clks[] = {int __init omap2430_clk_init (void ) { -const struct prcm_config *prcm;struct omap_clk *c; -u32 clkrate; prcm_clksrc_ctrl =OMAP2430_PRCM_CLKSRC_CTRL ; cm_idlest_pll =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST );
@@ -2053,20 +2051,13 @@ int __init omap2430_clk_init(void)omap2_init_clk_clkdm (c->lk.clk); } +omap2xxx_clkt_vps_late_init (); +/* Disable autoidle on all clocks; let the PM code enable it later */ omap_clk_disable_autoidle_all (); -/* Check the MPU rate set by bootloader */ - clkrate =omap2xxx_clk_get_core_rate (); -for (prcm = rate_table; prcm->mpu_speed; prcm++) { -if (!(prcm->flags & cpu_mask)) -continue ; -if (prcm->xtal_speed != sys_ck.rate) -continue ; -if (prcm->dpll_speed <= clkrate) -break ; - } - curr_prcm_set = prcm; +/* XXX Can this be done from the virt_prcm_set clk init function? */ +omap2xxx_clkt_vps_check_bootloader_rates ();recalculate_root_clocks ();
arch/arm/mach-omap2/clock2xxx.h +2 -0
@@ -20,6 +20,8 @@ u32 omap2xxx_get_apll_clkin(void);u32 omap2xxx_get_sysclkdiv (void );void omap2xxx_clk_prepare_for_reboot (void );void omap2xxx_clkt_dpllcore_init (struct clk *clk); +void omap2xxx_clkt_vps_check_bootloader_rates (void ); +void omap2xxx_clkt_vps_late_init (void );#ifdef CONFIG_SOC_OMAP2420 int omap2420_clk_init (void );
Paul Walmsley
maintainerPATCH 5/13 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
In reply to Paul WalmsleySplit omap_prcm_restart() from mach-omap2/prcm.c into SoC-specific variants. These functions need to be able to save the reboot reason into the scratchpad RAM. This implies a dependency on both the PRM and SCM IP blocks, so they've been moved into their own file. This will eventually call functions in the PRM and SCM drivers, once those are created.
--- arch/arm/mach-omap2/Makefile | 5 +++ arch/arm/mach-omap2/common.h | 4 ++ arch/arm/mach-omap2/omap2-restart.c | 65 +++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++++++++++++++++ arch/arm/mach-omap2/omap4-common.c | 16 +++++++++ 5 files changed, 126 insertions(+) create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.c
arch/arm/mach-omap2/Makefile +5 -0
@@ -49,6 +49,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6 AFLAGS_sram243x.o :=-Wa,-march=armv6 AFLAGS_sram34xx.o :=-Wa,-march=armv7-a +# Restart code (OMAP4/5 currently in omap4-common.c) +obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o +obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o +obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o + # Pin multiplexing obj-$(CONFIG_SOC_OMAP2420) += mux2420.o obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
arch/arm/mach-omap2/common.h +4 -0
@@ -115,6 +115,10 @@ void ti81xx_init_late(void);void omap4430_init_late (void );int omap2_common_pm_late_init (void );void omap_prcm_restart (char ,const char *); +void omap2xxx_restart (char ,const char *); +void omap3xxx_restart (char ,const char *); +void omap44xx_restart (char ,const char *); +void omap5xxx_restart (char ,const char *);/* This gets called from mach-omap2/io.c, do not call this */ void __init omap2_set_globals_tap (u32 class,void __iomem *tap);
arch/arm/mach-omap2/omap2-restart.c new file +65 -0
65 lines not on this page · raw message
arch/arm/mach-omap2/omap3-restart.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* omap3-restart.c - Code common to all OMAP3xxx machines. +* +* Copyright (C) 2009, 2012 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Santosh Shilimkar <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> + +#include "iomap.h" +#include "common.h" +#include "control.h" +#include "prm3xxx.h" + +/* Global address base setup code */ + +/** +* omap3xxx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap3xxx_restart (char mode,const char *cmd) +{ +omap3_ctrl_write_boot_mode ((cmd ? (u8)*cmd :0 )); +omap3xxx_prm_dpll3_reset ();/* never returns */ +while (1 ); +}
arch/arm/mach-omap2/omap4-common.c +16 -0
@@ -35,6 +35,7 @@#include "iomap.h" #include "common.h" #include "hsmmc.h" +#include "prminst44xx.h" #include "omap4-sar-layout.h" #ifdef CONFIG_CACHE_L2X0
@@ -249,6 +250,21 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)return 0 ; } +/** +* omap44xx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap44xx_restart (char mode,const char *cmd) +{ +/* XXX Should save 'cmd' into scratchpad for use after reboot */ +omap4_prminst_global_warm_sw_reset ();/* never returns */ +while (1 ); +} +static __init void omap4_twl6030_hsmmc_set_late_init (struct device *dev) {struct omap_mmc_platform_data *pdata;
PATCH 5/13 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
Quoted 39 lines · Paul Walmsley
Split
omap_prcm_restart()frommach-omap2/prcm.cinto SoC-specific variants. These functions need to be able to save the reboot reason into the scratchpad RAM. This implies a dependency on both the PRM and SCM IP blocks, so they've been moved into their own file. This will eventually call functions in the PRM and SCM drivers, once those are created.Signed-off-by Paul Walmsley <[email protected]>--- arch/arm/mach-omap2/Makefile | 5 +++ arch/arm/mach-omap2/common.h | 4 ++ arch/arm/mach-omap2/omap2-restart.c | 65 +++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++++++++++++++++ arch/arm/mach-omap2/omap4-common.c | 16 +++++++++ 5 files changed, 126 insertions(+) create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.carch/arm/mach-omap2/Makefile +5
-0@@ -49,6 +49,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6 AFLAGS_sram243x.o :=-Wa,-march=armv6 AFLAGS_sram34xx.o :=-Wa,-march=armv7-a +# Restart code (OMAP4/5 currently in omap4-common.c) +obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o +obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o +obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o + # Pin multiplexing obj-$(CONFIG_SOC_OMAP2420) += mux2420.o obj-$(CONFIG_SOC_OMAP2430) += mux2430.oarch/arm/mach-omap2/common.h +0
-0
arch/arm/mach-omap2/common.h void ti81xx_init_late(void); · line 122
Quoted 8 lines
arch/arm/mach-omap2/common.h +4
-0@@ -115,6 +115,10 @@ void ti81xx_init_late(void);void omap4430_init_late (void );int omap2_common_pm_late_init (void );void omap_prcm_restart (char ,const char *); +void omap2xxx_restart (char ,const char *); +void omap3xxx_restart (char ,const char *); +void omap44xx_restart (char ,const char *); +void omap5xxx_restart (char ,const char *);
Paul,
omap5xxx_restart declaration needs to be removed from here. There is no such function implemented in code.
Thanks,
Vaibhav
Quoted 157 lines
arch/arm/mach-omap2/common.h +0
-0/* This gets called from mach-omap2/io.c, do not call this */ void __init omap2_set_globals_tap (u32 class,void __iomem *tap);arch/arm/mach-omap2/omap2-restart.c new file +65
-0@@ -0,0 +1,65 @@ +/* +* omap2-restart.c - code common to all OMAP2xxx machines. +* +* Copyright (C) 2012 Texas Instruments +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include "common.h" +#include "prm2xxx.h" + +/* +* reset_virt_prcm_set_ck, reset_sys_ck: pointers to the virt_prcm_set +* clock and the sys_ck. Used during the reset process +*/ +static struct clk *reset_virt_prcm_set_ck, *reset_sys_ck; + +/* Reboot handling */ + +/** +* omap2xxx_restart - Set DPLL to bypass mode for reboot to work +* +* Set the DPLL to bypass so that reboot completes successfully. No +* return value. +*/ +void omap2xxx_restart (char mode,const char *cmd) +{ +u32 rate; + + rate =clk_get_rate (reset_sys_ck); +clk_set_rate (reset_virt_prcm_set_ck, rate); + +/* XXX Should save the cmd argument for use after the reboot */ + +omap2xxx_prm_dpll_reset ();/* never returns */ +while (1 ); +} + +/** +* omap2xxx_common_look_up_clks_for_reset - look up clocks needed for restart +* +* Some clocks need to be looked up in advance for the SoC restart +* operation to work - see omap2xxx_restart(). Returns -EINVAL upon +* error or 0 upon success. +*/ +static int __init omap2xxx_common_look_up_clks_for_reset (void ) +{ + reset_virt_prcm_set_ck =clk_get (NULL ,"virt_prcm_set" ); +if (IS_ERR (reset_virt_prcm_set_ck)) +return -EINVAL ; + + reset_sys_ck =clk_get (NULL ,"sys_ck" ); +if (IS_ERR (reset_sys_ck)) +return -EINVAL ; + +return 0 ; +} +core_initcall (omap2xxx_common_look_up_clks_for_reset);arch/arm/mach-omap2/omap3-restart.c new file +36
-0@@ -0,0 +1,36 @@ +/* +* omap3-restart.c - Code common to all OMAP3xxx machines. +* +* Copyright (C) 2009, 2012 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Santosh Shilimkar <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> + +#include "iomap.h" +#include "common.h" +#include "control.h" +#include "prm3xxx.h" + +/* Global address base setup code */ + +/** +* omap3xxx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap3xxx_restart (char mode,const char *cmd) +{ +omap3_ctrl_write_boot_mode ((cmd ? (u8)*cmd :0 )); +omap3xxx_prm_dpll3_reset ();/* never returns */ +while (1 ); +}arch/arm/mach-omap2/omap4-common.c +16
-0@@ -35,6 +35,7 @@#include "iomap.h" #include "common.h" #include "hsmmc.h" +#include "prminst44xx.h" #include "omap4-sar-layout.h" #ifdef CONFIG_CACHE_L2X0 @@ -249,6 +250,21 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)return 0 ; } +/** +* omap44xx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap44xx_restart (char mode,const char *cmd) +{ +/* XXX Should save 'cmd' into scratchpad for use after reboot */ +omap4_prminst_global_warm_sw_reset ();/* never returns */ +while (1 ); +} +static __init void omap4_twl6030_hsmmc_set_late_init (struct device *dev) {struct omap_mmc_platform_data *pdata;_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Paul Walmsley
maintainerPATCH 5/13 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
Quoted 2 lines · Vaibhav Hiremath
omap5xxx_restartdeclaration needs to be removed from here. There is no such function implemented in code.
Thanks, prototype dropped.
- Paul
Paul Walmsley
maintainerPATCH 5/13 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
In reply to Paul WalmsleyHere's an update of this one.
- Paul
From: Paul Walmsley <[email protected]>
Date: Mon, 29 Oct 2012 20:56:07 -0600
Subject: [PATCH] ARM: OMAP2+: PRCM: create SoC-specific chip restart
functions
Split omap_prcm_restart() from mach-omap2/prcm.c into SoC-specific variants. These functions need to be able to save the reboot reason into the scratchpad RAM. This implies a dependency on both the PRM and SCM IP blocks, so they've been moved into their own file. This will eventually call functions in the PRM and SCM drivers, once those are created.
Vaibhav Hiremath <[email protected]> identified an unused prototype in the first version of this patch - now removed.
--- arch/arm/mach-omap2/Makefile | 5 +++ arch/arm/mach-omap2/common.h | 24 +++++++++++++ arch/arm/mach-omap2/omap2-restart.c | 65 +++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++++++++++++++++ arch/arm/mach-omap2/omap4-common.c | 16 +++++++++ 5 files changed, 146 insertions(+) create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.c
arch/arm/mach-omap2/Makefile +5 -0
@@ -50,6 +50,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6 AFLAGS_sram243x.o :=-Wa,-march=armv6 AFLAGS_sram34xx.o :=-Wa,-march=armv7-a +# Restart code (OMAP4/5 currently in omap4-common.c) +obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o +obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o +obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o + # Pin multiplexing obj-$(CONFIG_SOC_OMAP2420) += mux2420.o obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
arch/arm/mach-omap2/common.h +24 -0
@@ -121,6 +121,30 @@ void omap4430_init_late(void);int omap2_common_pm_late_init (void );void omap_prcm_restart (char ,const char *); +#if defined(CONFIG_SOC_OMAP2420 ) || defined(CONFIG_SOC_OMAP2430 ) +void omap2xxx_restart (char mode,const char *cmd); +#else +static inline void omap2xxx_restart (char mode,const char *cmd) +{ +} +#endif + +#ifdef CONFIG_ARCH_OMAP3 +void omap3xxx_restart (char mode,const char *cmd); +#else +static inline void omap3xxx_restart (char mode,const char *cmd) +{ +} +#endif + +#if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) +void omap44xx_restart (char mode,const char *cmd); +#else +static inline void omap44xx_restart (char mode,const char *cmd) +{ +} +#endif +/* This gets called from mach-omap2/io.c, do not call this */ void __init omap2_set_globals_tap (u32 class,void __iomem *tap);
arch/arm/mach-omap2/omap2-restart.c new file +65 -0
65 lines not on this page · raw message
arch/arm/mach-omap2/omap3-restart.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* omap3-restart.c - Code common to all OMAP3xxx machines. +* +* Copyright (C) 2009, 2012 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Santosh Shilimkar <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> + +#include "iomap.h" +#include "common.h" +#include "control.h" +#include "prm3xxx.h" + +/* Global address base setup code */ + +/** +* omap3xxx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap3xxx_restart (char mode,const char *cmd) +{ +omap3_ctrl_write_boot_mode ((cmd ? (u8)*cmd :0 )); +omap3xxx_prm_dpll3_reset ();/* never returns */ +while (1 ); +}
arch/arm/mach-omap2/omap4-common.c +16 -0
@@ -33,6 +33,7 @@#include "common.h" #include "mmc.h" #include "hsmmc.h" +#include "prminst44xx.h" #include "omap4-sar-layout.h" #include "omap-secure.h"
@@ -248,6 +249,21 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)return 0 ; } +/** +* omap44xx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap44xx_restart (char mode,const char *cmd) +{ +/* XXX Should save 'cmd' into scratchpad for use after reboot */ +omap4_prminst_global_warm_sw_reset ();/* never returns */ +while (1 ); +} +static __init void omap4_twl6030_hsmmc_set_late_init (struct device *dev) {struct omap_mmc_platform_data *pdata;
Signature · 1 line
1.7.10.4
Paul Walmsley
maintainerPATCH 5/13 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
Another update on this one to fix a build break that Tony spotted.
- Paul
From: Paul Walmsley <[email protected]>
Date: Mon, 29 Oct 2012 20:56:07 -0600
Subject: [PATCH] ARM: OMAP2+: PRCM: create SoC-specific chip restart
functions
Split omap_prcm_restart() from mach-omap2/prcm.c into SoC-specific variants. These functions need to be able to save the reboot reason into the scratchpad RAM. This implies a dependency on both the PRM and SCM IP blocks, so they've been moved into their own file. This will eventually call functions in the PRM and SCM drivers, once those are created.
Vaibhav Hiremath <[email protected]> identified an unused prototype in the first version of this patch - now removed. Tony Lindgren <[email protected]> noted a compile problem with some RMK Kconfigs; resolved in this patch.
--- arch/arm/mach-omap2/Makefile | 5 +++ arch/arm/mach-omap2/common.h | 24 +++++++++++++ arch/arm/mach-omap2/omap2-restart.c | 65 +++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++++++++++++++++ arch/arm/mach-omap2/omap4-common.c | 17 +++++++++ 5 files changed, 147 insertions(+) create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.c
arch/arm/mach-omap2/Makefile +5 -0
@@ -50,6 +50,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6 AFLAGS_sram243x.o :=-Wa,-march=armv6 AFLAGS_sram34xx.o :=-Wa,-march=armv7-a +# Restart code (OMAP4/5 currently in omap4-common.c) +obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o +obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o +obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o + # Pin multiplexing obj-$(CONFIG_SOC_OMAP2420) += mux2420.o obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
arch/arm/mach-omap2/common.h +24 -0
@@ -113,6 +113,30 @@ void omap4430_init_late(void);int omap2_common_pm_late_init (void );void omap_prcm_restart (char ,const char *); +#if defined(CONFIG_SOC_OMAP2420 ) || defined(CONFIG_SOC_OMAP2430 ) +void omap2xxx_restart (char mode,const char *cmd); +#else +static inline void omap2xxx_restart (char mode,const char *cmd) +{ +} +#endif + +#ifdef CONFIG_ARCH_OMAP3 +void omap3xxx_restart (char mode,const char *cmd); +#else +static inline void omap3xxx_restart (char mode,const char *cmd) +{ +} +#endif + +#if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) +void omap44xx_restart (char mode,const char *cmd); +#else +static inline void omap44xx_restart (char mode,const char *cmd) +{ +} +#endif +/* This gets called from mach-omap2/io.c, do not call this */ void __init omap2_set_globals_tap (u32 class,void __iomem *tap);
arch/arm/mach-omap2/omap2-restart.c new file +65 -0
65 lines not on this page · raw message
arch/arm/mach-omap2/omap3-restart.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* omap3-restart.c - Code common to all OMAP3xxx machines. +* +* Copyright (C) 2009, 2012 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Santosh Shilimkar <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> + +#include "iomap.h" +#include "common.h" +#include "control.h" +#include "prm3xxx.h" + +/* Global address base setup code */ + +/** +* omap3xxx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap3xxx_restart (char mode,const char *cmd) +{ +omap3_ctrl_write_boot_mode ((cmd ? (u8)*cmd :0 )); +omap3xxx_prm_dpll3_reset ();/* never returns */ +while (1 ); +}
arch/arm/mach-omap2/omap4-common.c +17 -0
@@ -33,6 +33,7 @@#include "common.h" #include "mmc.h" #include "hsmmc.h" +#include "prminst44xx.h" #include "omap4-sar-layout.h" #include "omap-secure.h"
@@ -281,3 +282,19 @@ int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) return 0; }#endif + +/** +* omap44xx_restart - trigger a software restart of the SoC +* @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c +* @cmd: passed from the userspace program rebooting the system (if provided) +* +* Resets the SoC. For @cmd, see the 'reboot' syscall in +* kernel/sys.c. No return value. +*/ +void omap44xx_restart (char mode,const char *cmd) +{ +/* XXX Should save 'cmd' into scratchpad for use after reboot */ +omap4_prminst_global_warm_sw_reset ();/* never returns */ +while (1 ); +} +
Signature · 1 line
1.7.10.4
Paul Walmsley
maintainerPATCH 6/13 ARM: OMAP2+: board files: use SoC-specific system restart functions
In reply to Paul WalmsleyModify the board files to use the SoC-specific system restart functions. At this point it's possible to remove omap_prcm_restart() from mach-omap2/prcm.c.
While removing the prototypes for the now-unused restart functions, clean up a few more obsolete prototypes in mach-omap2/clock.h.
--- arch/arm/mach-omap2/board-2430sdp.c | 2 + arch/arm/mach-omap2/board-3430sdp.c | 2 + arch/arm/mach-omap2/board-3630sdp.c | 2 + arch/arm/mach-omap2/board-4430sdp.c | 2 + arch/arm/mach-omap2/board-am3517crane.c | 2 + arch/arm/mach-omap2/board-am3517evm.c | 2 + arch/arm/mach-omap2/board-apollon.c | 2 + arch/arm/mach-omap2/board-cm-t35.c | 18 +++++----- arch/arm/mach-omap2/board-cm-t3517.c | 2 + arch/arm/mach-omap2/board-devkit8000.c | 2 + arch/arm/mach-omap2/board-generic.c | 10 +++-- arch/arm/mach-omap2/board-h4.c | 2 + arch/arm/mach-omap2/board-igep0020.c | 4 +- arch/arm/mach-omap2/board-ldp.c | 2 + arch/arm/mach-omap2/board-n8x0.c | 6 ++- arch/arm/mach-omap2/board-omap3beagle.c | 2 + arch/arm/mach-omap2/board-omap3evm.c | 2 + arch/arm/mach-omap2/board-omap3logic.c | 4 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 + arch/arm/mach-omap2/board-omap3stalker.c | 2 + arch/arm/mach-omap2/board-omap3touchbook.c | 2 + arch/arm/mach-omap2/board-omap4panda.c | 2 + arch/arm/mach-omap2/board-overo.c | 2 + arch/arm/mach-omap2/board-rm680.c | 4 +- arch/arm/mach-omap2/board-rx51.c | 2 + arch/arm/mach-omap2/board-ti8168evm.c | 4 +- arch/arm/mach-omap2/board-zoom.c | 4 +- arch/arm/mach-omap2/clock.h | 28 --------------- arch/arm/mach-omap2/clock2420_data.c | 4 -- arch/arm/mach-omap2/clock2430_data.c | 4 -- arch/arm/mach-omap2/clock2xxx.c | 16 --------- arch/arm/mach-omap2/common.h | 1 - arch/arm/mach-omap2/prcm.c | 52 ---------------------------- 33 files changed, 46 insertions(+), 151 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -287,5 +287,5 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") .init_machine = omap_2430sdp_init, .init_late = omap2430_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-3430sdp.c +1 -1
@@ -597,5 +597,5 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") .init_machine = omap_3430sdp_init, .init_late = omap3430_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-3630sdp.c +1 -1
@@ -213,5 +213,5 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") .init_machine = omap_sdp_init, .init_late = omap3630_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-4430sdp.c +1 -1
@@ -881,5 +881,5 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") .init_machine = omap_4430sdp_init, .init_late = omap4430_init_late, .timer = &omap4_timer, - .restart = omap_prcm_restart, + .restart = omap44xx_restart,MACHINE_END
arch/arm/mach-omap2/board-am3517crane.c +1 -1
@@ -94,5 +94,5 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") .init_machine = am3517_crane_init, .init_late = am35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-am3517evm.c +1 -1
@@ -393,5 +393,5 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") .init_machine = am3517_evm_init, .init_late = am35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-apollon.c +1 -1
@@ -338,5 +338,5 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") .init_machine = omap_apollon_init, .init_late = omap2420_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-cm-t35.c +9 -9
@@ -753,18 +753,18 @@ MACHINE_START(CM_T35, "Compulab CM-T35") .init_machine = cm_t35_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_ENDMACHINE_START (CM_T3730 ,"Compulab CM-T3730" ) - .atag_offset =0x100 , - .reserve = omap_reserve, - .map_io = omap3_map_io, - .init_early = omap3630_init_early, - .init_irq = omap3_init_irq, + .atag_offset =0x100 , + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap3630_init_early, + .init_irq = omap3_init_irq, .handle_irq = omap3_intc_handle_irq, - .init_machine = cm_t3730_init, + .init_machine = cm_t3730_init, .init_late = omap3630_init_late, - .timer = &omap3_timer, - .restart = omap_prcm_restart, + .timer = &omap3_timer, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-cm-t3517.c +1 -1
@@ -298,5 +298,5 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517") .init_machine = cm_t3517_init, .init_late = am35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-devkit8000.c +1 -1
@@ -640,5 +640,5 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") .init_machine = devkit8000_init, .init_late = omap35xx_init_late, .timer = &omap3_secure_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-generic.c +5 -5
@@ -57,7 +57,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") .init_machine = omap_generic_init, .timer = &omap2_timer, .dt_compat = omap242x_boards_compat, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart, MACHINE_END#endif
@@ -76,7 +76,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") .init_machine = omap_generic_init, .timer = &omap2_timer, .dt_compat = omap243x_boards_compat, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart, MACHINE_END#endif
@@ -95,7 +95,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") .init_machine = omap_generic_init, .timer = &omap3_timer, .dt_compat = omap3_boards_compat, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_END#endif
@@ -134,7 +134,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") .init_late = omap4430_init_late, .timer = &omap4_timer, .dt_compat = omap4_boards_compat, - .restart = omap_prcm_restart, + .restart = omap44xx_restart, MACHINE_END#endif
@@ -154,6 +154,6 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") .init_machine = omap_generic_init, .timer = &omap5_timer, .dt_compat = omap5_boards_compat, - .restart = omap_prcm_restart, + .restart = omap44xx_restart, MACHINE_END#endif
arch/arm/mach-omap2/board-h4.c +1 -1
@@ -386,5 +386,5 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board") .init_machine = omap_h4_init, .init_late = omap2420_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-igep0020.c +2 -2
@@ -652,7 +652,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board") .init_machine = igep_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_ENDMACHINE_START (IGEP0030 ,"IGEP OMAP3 module" )
@@ -665,5 +665,5 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") .init_machine = igep_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -437,5 +437,5 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board") .init_machine = omap_ldp_init, .init_late = omap3430_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-n8x0.c +3 -3
@@ -689,7 +689,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800") .init_machine = n8x0_init_machine, .init_late = omap2420_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart, MACHINE_ENDMACHINE_START (NOKIA_N810 ,"Nokia N810" )
@@ -702,7 +702,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810") .init_machine = n8x0_init_machine, .init_late = omap2420_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart, MACHINE_ENDMACHINE_START (NOKIA_N810_WIMAX ,"Nokia N810 WiMAX" )
@@ -715,5 +715,5 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") .init_machine = n8x0_init_machine, .init_late = omap2420_init_late, .timer = &omap2_timer, - .restart = omap_prcm_restart, + .restart = omap2xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
@@ -537,5 +537,5 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") .init_machine = omap3_beagle_init, .init_late = omap3_init_late, .timer = &omap3_secure_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3evm.c +1 -1
@@ -752,5 +752,5 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM") .init_machine = omap3_evm_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3logic.c +2 -2
@@ -235,7 +235,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") .init_machine = omap3logic_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_ENDMACHINE_START (OMAP3530_LV_SOM ,"OMAP Logic 3530 LV SOM board" )
@@ -248,5 +248,5 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") .init_machine = omap3logic_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3pandora.c +1 -1
@@ -619,5 +619,5 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") .init_machine = omap3pandora_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3stalker.c +1 -1
@@ -428,5 +428,5 @@ MACHINE_START(SBC3530, "OMAP3 STALKER") .init_machine = omap3_stalker_init, .init_late = omap35xx_init_late, .timer = &omap3_secure_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap3touchbook.c +1 -1
@@ -384,5 +384,5 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") .init_machine = omap3_touchbook_init, .init_late = omap3430_init_late, .timer = &omap3_secure_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-omap4panda.c +1 -1
@@ -524,5 +524,5 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") .init_machine = omap4_panda_init, .init_late = omap4430_init_late, .timer = &omap4_timer, - .restart = omap_prcm_restart, + .restart = omap44xx_restart,MACHINE_END
arch/arm/mach-omap2/board-overo.c +1 -1
@@ -550,5 +550,5 @@ MACHINE_START(OVERO, "Gumstix Overo") .init_machine = overo_init, .init_late = omap35xx_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-rm680.c +2 -2
@@ -151,7 +151,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") .init_machine = rm680_init, .init_late = omap3630_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_ENDMACHINE_START (NOKIA_RM696 ,"Nokia RM-696 board" )
@@ -164,5 +164,5 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board") .init_machine = rm680_init, .init_late = omap3630_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-rx51.c +1 -1
@@ -127,5 +127,5 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") .init_machine = rx51_init, .init_late = omap3430_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/board-ti8168evm.c +2 -2
@@ -45,7 +45,7 @@ MACHINE_START(TI8168EVM, "ti8168evm") .timer = &omap3_timer, .init_machine = ti81xx_evm_init, .init_late = ti81xx_init_late, - .restart = omap_prcm_restart, + .restart = omap44xx_restart, MACHINE_ENDMACHINE_START (TI8148EVM ,"ti8148evm" )
@@ -57,5 +57,5 @@ MACHINE_START(TI8148EVM, "ti8148evm") .timer = &omap3_timer, .init_machine = ti81xx_evm_init, .init_late = ti81xx_init_late, - .restart = omap_prcm_restart, + .restart = omap44xx_restart,MACHINE_END
arch/arm/mach-omap2/board-zoom.c +2 -2
@@ -138,7 +138,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") .init_machine = omap_zoom_init, .init_late = omap3430_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart, MACHINE_ENDMACHINE_START (OMAP_ZOOM3 ,"OMAP Zoom3 board" )
@@ -151,5 +151,5 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") .init_machine = omap_zoom_init, .init_late = omap3630_init_late, .timer = &omap3_timer, - .restart = omap_prcm_restart, + .restart = omap3xxx_restart,MACHINE_END
arch/arm/mach-omap2/clock.h +0 -28
@@ -94,33 +94,6 @@ extern void omap2_clkt_iclk_deny_idle(struct clk *clk);u32 omap2_get_dpll_rate (struct clk *clk);void omap2_init_dpll_parent (struct clk *clk); -int omap2_wait_clock_ready (void __iomem *reg,u32 cval,const char *name); - - -#ifdef CONFIG_ARCH_OMAP2 -void omap2xxx_clk_prepare_for_reboot (void ); -#else -static inline void omap2xxx_clk_prepare_for_reboot (void ) -{ -} -#endif - -#ifdef CONFIG_ARCH_OMAP3 -void omap3_clk_prepare_for_reboot (void ); -#else -static inline void omap3_clk_prepare_for_reboot (void ) -{ -} -#endif - -#ifdef CONFIG_ARCH_OMAP4 -void omap4_clk_prepare_for_reboot (void ); -#else -static inline void omap4_clk_prepare_for_reboot (void ) -{ -} -#endif -int omap2_dflt_clk_enable (struct clk *clk);void omap2_dflt_clk_disable (struct clk *clk); void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg,
@@ -139,7 +112,6 @@ extern const struct clkops clkops_dummy;extern const struct clkops clkops_omap2_dflt;extern struct clk_functions omap2_clk_functions; -extern struct clk *vclk, *sclk;extern const struct clksel_rate gpt_32k_rates[];extern const struct clksel_rate gpt_sys_rates[];
arch/arm/mach-omap2/clock2420_data.c +0 -4
@@ -1972,10 +1972,6 @@ int __init omap2420_clk_init(void)*/ clk_enable_init_clocks (); -/* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ - vclk =clk_get (NULL ,"virt_prcm_set" ); - sclk =clk_get (NULL ,"sys_ck" ); -return 0 ; }
arch/arm/mach-omap2/clock2430_data.c +0 -4
@@ -2071,10 +2071,6 @@ int __init omap2430_clk_init(void)*/ clk_enable_init_clocks (); -/* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ - vclk =clk_get (NULL ,"virt_prcm_set" ); - sclk =clk_get (NULL ,"sys_ck" ); -return 0 ; }
arch/arm/mach-omap2/clock2xxx.c +0 -16
@@ -30,27 +30,11 @@#include "cm.h" #include "cm-regbits-24xx.h" -struct clk *vclk, *sclk; -/* * Omap24xx specific clock functions */ /* -* Set clocks for bypass mode for reboot to work. -*/ -void omap2xxx_clk_prepare_for_reboot (void ) -{ -u32 rate; - -if (vclk ==NULL || sclk ==NULL ) -return ; - - rate =clk_get_rate (sclk); -clk_set_rate (vclk, rate); -} - -/* * Switch the MPU rate if specified on cmdline. We cannot do this * early until cmdline is parsed. XXX This should be removed from the * clock code and handled by the OPP layer code in the near future.
arch/arm/mach-omap2/common.h +0 -1
@@ -114,7 +114,6 @@ void am35xx_init_late(void);void ti81xx_init_late (void );void omap4430_init_late (void );int omap2_common_pm_late_init (void ); -void omap_prcm_restart (char ,const char *);void omap2xxx_restart (char ,const char *);void omap3xxx_restart (char ,const char *);void omap44xx_restart (char ,const char *);
arch/arm/mach-omap2/prcm.c +0 -52
58 lines not on this page · raw message
Paul Walmsley
maintainerPATCH 7/13 ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready()
In reply to Paul WalmsleyConvert the OMAP2xxx APLL code to use omap2_cm_wait_module_ready(), and move the low-level CM register manipulation functions to mach-omap2/cm2xxx.c. The objectives here are to remove the dependency on the deprecated omap2_cm_wait_idlest() function in mach-omap2/prcm.c, so that code can be removed later; and move low-level register accesses to the CM IP block to the CM code, which will soon be moved into drivers/.
--- arch/arm/mach-omap2/clkt2xxx_apll.c | 56 +++++++--------------------- arch/arm/mach-omap2/clock2420_data.c | 1 - arch/arm/mach-omap2/clock2430_data.c | 1 - arch/arm/mach-omap2/clock2xxx.h | 2 + arch/arm/mach-omap2/cm-regbits-24xx.h | 2 + arch/arm/mach-omap2/cm2xxx.c | 65 ++++++++++++++++++++++++++++++++- arch/arm/mach-omap2/cm2xxx_3xxx.h | 6 +++ 7 files changed, 85 insertions(+), 48 deletions(-)
arch/arm/mach-omap2/clkt2xxx_apll.c +14 -42
@@ -38,44 +38,16 @@#define APLLS_CLKIN_13MHZ 2#define APLLS_CLKIN_12MHZ 3 -void __iomem *cm_idlest_pll; -/* Private functions */ -/* Enable an APLL if off */ -static int omap2_clk_apll_enable (struct clk *clk,u32 status_mask) -{ -u32 cval, apll_mask; - - apll_mask =EN_APLL_LOCKED << clk->enable_bit; - - cval =omap2_cm_read_mod_reg (PLL_MOD ,CM_CLKEN ); - -if ((cval & apll_mask) == apll_mask) -return 0 ;/* apll already enabled */ - - cval &= ~apll_mask; - cval |= apll_mask; -omap2_cm_write_mod_reg (cval,PLL_MOD ,CM_CLKEN ); - -omap2_cm_wait_idlest (cm_idlest_pll, status_mask, -OMAP24XX_CM_IDLEST_VAL ,__clk_get_name (clk)); - -/* -* REVISIT: Should we return an error code if omap2_wait_clock_ready() -* fails? -*/ -return 0 ; -} - -static int omap2_clk_apll96_enable (struct clk *clk) +static int _apll96_enable (struct clk *clk) { -return omap2_clk_apll_enable (clk,OMAP24XX_ST_96M_APLL_MASK ); +return omap2xxx_cm_apll96_enable (); } -static int omap2_clk_apll54_enable (struct clk *clk) +static int _apll54_enable (struct clk *clk) { -return omap2_clk_apll_enable (clk,OMAP24XX_ST_54M_APLL_MASK ); +return omap2xxx_cm_apll54_enable (); }static void _apll96_allow_idle (struct clk *clk)
@@ -98,28 +70,28 @@ static void _apll54_deny_idle(struct clk *clk)omap2xxx_cm_set_apll54_disable_autoidle (); } -/* Stop APLL */ -static void omap2_clk_apll_disable (struct clk *clk) +static void _apll96_disable (struct clk *clk) { -u32 cval; +omap2xxx_cm_apll96_disable (); +} - cval =omap2_cm_read_mod_reg (PLL_MOD ,CM_CLKEN ); - cval &= ~(EN_APLL_LOCKED << clk->enable_bit); -omap2_cm_write_mod_reg (cval,PLL_MOD ,CM_CLKEN ); +static void _apll54_disable (struct clk *clk) +{ +omap2xxx_cm_apll54_disable (); }/* Public data */ const struct clkops clkops_apll96 = { - .enable = omap2_clk_apll96_enable, - .disable = omap2_clk_apll_disable, + .enable = _apll96_enable, + .disable = _apll96_disable, .allow_idle = _apll96_allow_idle, .deny_idle = _apll96_deny_idle, };const struct clkops clkops_apll54 = { - .enable = omap2_clk_apll54_enable, - .disable = omap2_clk_apll_disable, + .enable = _apll54_enable, + .disable = _apll54_disable, .allow_idle = _apll54_allow_idle, .deny_idle = _apll54_deny_idle, };
arch/arm/mach-omap2/clock2420_data.c +0 -1
@@ -1930,7 +1930,6 @@ int __init omap2420_clk_init(void)struct omap_clk *c; prcm_clksrc_ctrl =OMAP2420_PRCM_CLKSRC_CTRL ; - cm_idlest_pll =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST ); cpu_mask =RATE_IN_242X ; rate_table = omap2420_rate_table;
arch/arm/mach-omap2/clock2430_data.c +0 -1
@@ -2029,7 +2029,6 @@ int __init omap2430_clk_init(void)struct omap_clk *c; prcm_clksrc_ctrl =OMAP2430_PRCM_CLKSRC_CTRL ; - cm_idlest_pll =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST ); cpu_mask =RATE_IN_243X ; rate_table = omap2430_rate_table;
arch/arm/mach-omap2/clock2xxx.h +1 -1
@@ -35,7 +35,7 @@ int omap2430_clk_init(void);#define omap2430_clk_init () do { } while(0)#endif -extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; +extern void __iomem *prcm_clksrc_ctrl;extern const struct clkops clkops_omap2430_i2chs_wait;extern const struct clkops clkops_oscck;
arch/arm/mach-omap2/cm-regbits-24xx.h +2 -0
@@ -333,7 +333,9 @@#define OMAP24XX_EN_DPLL_MASK (0x3 << 0)/* CM_IDLEST_CKGEN */ +#define OMAP24XX_ST_54M_APLL_SHIFT 9#define OMAP24XX_ST_54M_APLL_MASK (1 << 9) +#define OMAP24XX_ST_96M_APLL_SHIFT 8#define OMAP24XX_ST_96M_APLL_MASK (1 << 8)#define OMAP24XX_ST_54M_CLK_MASK (1 << 6)#define OMAP24XX_ST_12M_CLK_MASK (1 << 5)
arch/arm/mach-omap2/cm2xxx.c +63 -2
86 lines not on this page · raw message
arch/arm/mach-omap2/cm2xxx_3xxx.h +5 -1
@@ -96,6 +96,11 @@ static inline u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx); } +extern int omap2xxx_cm_apll54_enable (void ); +extern void omap2xxx_cm_apll54_disable (void ); +extern int omap2xxx_cm_apll96_enable (void ); +extern void omap2xxx_cm_apll96_disable (void ); +#endif /* CM register bits shared between 24XX and 3430 */
@@ -111,5 +116,4 @@ static inline u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)/* CM_IDLEST_GFX */ #define OMAP_ST_GFX_MASK (1 << 0) -#endif
Paul Walmsley
maintainerPATCH 8/13 ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
In reply to Paul WalmsleyConvert the OMAP clock code's _omap2_module_wait_ready() to use SoC-independent CM functions that are provided by the CM code, rather than using a deprecated function from mach-omap2/prcm.c.
This facilitates the future conversion of the CM code to a driver, and also removes a mach-omap2/prcm.c user. mach-omap2/prcm.c will be removed by a subsequent patch.
--- arch/arm/mach-omap2/clock.c | 14 +++++++- arch/arm/mach-omap2/cm.h | 12 +++++++ arch/arm/mach-omap2/cm2xxx.c | 65 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/cm2xxx.h | 4 ++ arch/arm/mach-omap2/cm3xxx.c | 66 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/cm3xxx.h | 5 +++ arch/arm/mach-omap2/cm_common.c | 48 ++++++++++++++++++++++++++++ arch/arm/mach-omap2/io.c | 5 +++ 8 files changed, 215 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/clock.c +11 -3
@@ -33,6 +33,7 @@#include "soc.h" #include "clockdomain.h" #include "clock.h" +#include "cm.h" #include "cm2xxx.h" #include "cm3xxx.h" #include "cm-regbits-24xx.h"
@@ -67,7 +68,9 @@ static bool clkdm_control = true;static void _omap2_module_wait_ready (struct clk *clk) {void __iomem *companion_reg, *idlest_reg; -u8 other_bit, idlest_bit, idlest_val; +u8 other_bit, idlest_bit, idlest_val, idlest_reg_id; +s16 prcm_mod; +int r;/* Not all modules have multiple clocks that their IDLEST depends on */ if (clk->ops->find_companion) {
@@ -78,8 +81,13 @@ static void _omap2_module_wait_ready(struct clk *clk) clk->ops->find_idlest (clk, &idlest_reg, &idlest_bit, &idlest_val); -omap2_cm_wait_idlest (idlest_reg, (1 << idlest_bit), idlest_val, -__clk_get_name (clk)); + r =cm_split_idlest_reg (idlest_reg, &prcm_mod, &idlest_reg_id); +if (r) { +pr_err ("clock: %s: could not split idlest reg va\n" , clk->name); +return ; + } + +cm_wait_module_ready (prcm_mod, idlest_reg_id, idlest_bit); }/* Public functions */
arch/arm/mach-omap2/cm.h +11 -1
@@ -37,8 +37,18 @@/** * struct cm_ll_data - fn ptrs to per-SoC CM function implementations +* @split_idlest_reg: ptr to the SoC CM-specific split_idlest_reg impl +* @wait_module_ready: ptr to the SoC CM-specific wait_module_ready impl */ -struct cm_ll_data {}; +struct cm_ll_data { +int (*split_idlest_reg)(void __iomem *idlest_reg,s16 *prcm_inst, +u8 *idlest_reg_id); +int (*wait_module_ready)(s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +}; + +extern int cm_split_idlest_reg (void __iomem *idlest_reg,s16 *prcm_inst, +u8 *idlest_reg_id); +extern int cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift);extern int cm_register (struct cm_ll_data *cld);extern int cm_unregister (struct cm_ll_data *cld);
arch/arm/mach-omap2/cm2xxx.c +65 -0
74 lines not on this page · raw message
arch/arm/mach-omap2/cm2xxx.h +4 -0
@@ -60,6 +60,10 @@ extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);extern bool omap2xxx_cm_is_clkdm_in_hwsup (s16 module,u32 mask);extern int omap2xxx_cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +extern int omap2xxx_cm_split_idlest_reg (void __iomem *idlest_reg, +s16 *prcm_inst,u8 *idlest_reg_id); + +extern int __init omap2xxx_cm_init (void );#endif
arch/arm/mach-omap2/cm3xxx.c +66 -0
75 lines not on this page · raw message
arch/arm/mach-omap2/cm3xxx.h +5 -0
@@ -78,9 +78,14 @@ extern bool omap3xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask);extern int omap3xxx_cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +extern int omap3xxx_cm_split_idlest_reg (void __iomem *idlest_reg, +s16 *prcm_inst,u8 *idlest_reg_id); +extern void omap3_cm_save_context (void );extern void omap3_cm_restore_context (void ); +extern int __init omap3xxx_cm_init (void ); +#endif #endif
arch/arm/mach-omap2/cm_common.c +48 -0
54 lines not on this page · raw message
arch/arm/mach-omap2/io.c +5 -0
@@ -46,6 +46,8 @@#include "clock44xx.h" #include "sdrc.h" #include "control.h" +#include "cm2xxx.h" +#include "cm3xxx.h" /* * The machine specific code may provide the extra mapping besides the
@@ -389,6 +391,7 @@ void __init omap2420_init_early(void)OMAP2_L4_IO_ADDRESS (OMAP2420_CM_BASE ), NULL, NULL);omap2xxx_check_revision (); +omap2xxx_cm_init ();omap_common_init_early ();omap2xxx_voltagedomains_init ();omap242x_powerdomains_init ();
@@ -418,6 +421,7 @@ void __init omap2430_init_early(void)OMAP2_L4_IO_ADDRESS (OMAP2430_CM_BASE ), NULL, NULL);omap2xxx_check_revision (); +omap2xxx_cm_init ();omap_common_init_early ();omap2xxx_voltagedomains_init ();omap243x_powerdomains_init ();
@@ -452,6 +456,7 @@ void __init omap3_init_early(void) NULL, NULL);omap3xxx_check_revision ();omap3xxx_check_features (); +omap3xxx_cm_init ();omap_common_init_early ();omap3xxx_voltagedomains_init ();omap3xxx_powerdomains_init ();
Paul Walmsley
maintainerPATCH 8/13 ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
Quoted 9 lines · Paul Walmsley
Convert the OMAP clock code's
_omap2_module_wait_ready()to use SoC-independent CM functions that are provided by the CM code, rather than using a deprecated function frommach-omap2/prcm.c.This facilitates the future conversion of the CM code to a driver, and also removes a
mach-omap2/prcm.cuser.mach-omap2/prcm.cwill be removed by a subsequent patch.Signed-off-by Paul Walmsley <[email protected]>
Here's an update of this one. Further testing with the AM3517/3505 boards resulted in a warning message being logged from _omap2_wait_module_ready() for emac_ick. The AM3517 designers didn't integrate the IPSS IDLEST bits into the CM as other OMAPs do. They just put them into the SCM module. This shortcut taken during hardware integration just resulted in more time wasted on the software side :-(
- Paul
From: Paul Walmsley <[email protected]>
Date: Mon, 29 Oct 2012 20:56:29 -0600
Subject: [PATCH] ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to
use SoC-independent CM functions
Convert the OMAP clock code's _omap2_module_wait_ready() to use SoC-independent CM functions that are provided by the CM code, rather than using a deprecated function from mach-omap2/prcm.c.
This facilitates the future conversion of the CM code to a driver, and also removes a mach-omap2/prcm.c user. mach-omap2/prcm.c will be removed by a subsequent patch.
Some modules have IDLEST registers that aren't in the CM module, such as the AM3517 IDLEST bits. So we also need a fallback function for these non-CM odd cases. Create a temporary one in mach-omap2/clock.c, intended to exist until the SCM drivers are ready.
--- arch/arm/mach-omap2/clock.c | 56 +++++++++++++++++++++++++++++++-- arch/arm/mach-omap2/cm.h | 12 ++++++- arch/arm/mach-omap2/cm2xxx.c | 65 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/cm2xxx.h | 4 +++ arch/arm/mach-omap2/cm3xxx.c | 66 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/cm3xxx.h | 5 +++ arch/arm/mach-omap2/cm_common.c | 48 ++++++++++++++++++++++++++++ arch/arm/mach-omap2/io.c | 5 +++ 8 files changed, 257 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/clock.c +53 -3
@@ -33,10 +33,18 @@#include "soc.h" #include "clockdomain.h" #include "clock.h" +#include "cm.h" #include "cm2xxx.h" #include "cm3xxx.h" #include "cm-regbits-24xx.h" #include "cm-regbits-34xx.h" +#include "common.h" + +/* +* MAX_MODULE_ENABLE_WAIT: maximum of number of microseconds to wait +* for a module to indicate that it is no longer in idle +*/ +#define MAX_MODULE_ENABLE_WAIT 100000u16 cpu_mask;
@@ -58,6 +66,40 @@ static DEFINE_SPINLOCK(clockfw_lock);/* Private functions */ + +/** +* _wait_idlest_generic - wait for a module to leave the idle state +* @reg: virtual address of module IDLEST register +* @mask: value to mask against to determine if the module is active +* @idlest: idle state indicator (0 or 1) for the clock +* @name: name of the clock (for printk) +* +* Wait for a module to leave idle, where its idle-status register is +* not inside the CM module. Returns 1 if the module left idle +* promptly, or 0 if the module did not leave idle before the timeout +* elapsed. XXX Deprecated - should be moved into drivers for the +* individual IP block that the IDLEST register exists in. +*/ +static int _wait_idlest_generic (void __iomem *reg,u32 mask,u8 idlest, +const char *name) +{ +int i =0 , ena =0 ; + + ena = (idlest) ?0 : mask; + +omap_test_timeout (((__raw_readl (reg) & mask) == ena), +MAX_MODULE_ENABLE_WAIT , i); + +if (i <MAX_MODULE_ENABLE_WAIT ) +pr_debug ("omap clock: module associated with clock %s ready after %d loops\n" , + name, i); +else +pr_err ("omap clock: module associated with clock %s didn't enable in %d tries\n" , + name,MAX_MODULE_ENABLE_WAIT ); + +return (i <MAX_MODULE_ENABLE_WAIT ) ?1 :0 ; +}; +/** * _omap2_module_wait_ready - wait for an OMAP module to leave IDLE * @clk: struct clk * belonging to the module
@@ -71,7 +113,9 @@ static DEFINE_SPINLOCK(clockfw_lock);static void _omap2_module_wait_ready (struct clk *clk) {void __iomem *companion_reg, *idlest_reg; -u8 other_bit, idlest_bit, idlest_val; +u8 other_bit, idlest_bit, idlest_val, idlest_reg_id; +s16 prcm_mod; +int r;/* Not all modules have multiple clocks that their IDLEST depends on */ if (clk->ops->find_companion) {
@@ -82,8 +126,14 @@ static void _omap2_module_wait_ready(struct clk *clk) clk->ops->find_idlest (clk, &idlest_reg, &idlest_bit, &idlest_val); -omap2_cm_wait_idlest (idlest_reg, (1 << idlest_bit), idlest_val, -__clk_get_name (clk)); + r =cm_split_idlest_reg (idlest_reg, &prcm_mod, &idlest_reg_id); +if (r) { +/* IDLEST register not in the CM module */ +_wait_idlest_generic (idlest_reg, (1 << idlest_bit), idlest_val, + clk->name); + }else { +cm_wait_module_ready (prcm_mod, idlest_reg_id, idlest_bit); + }; }/* Public functions */
arch/arm/mach-omap2/cm.h +11 -1
@@ -37,8 +37,18 @@/** * struct cm_ll_data - fn ptrs to per-SoC CM function implementations +* @split_idlest_reg: ptr to the SoC CM-specific split_idlest_reg impl +* @wait_module_ready: ptr to the SoC CM-specific wait_module_ready impl */ -struct cm_ll_data {}; +struct cm_ll_data { +int (*split_idlest_reg)(void __iomem *idlest_reg,s16 *prcm_inst, +u8 *idlest_reg_id); +int (*wait_module_ready)(s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +}; + +extern int cm_split_idlest_reg (void __iomem *idlest_reg,s16 *prcm_inst, +u8 *idlest_reg_id); +extern int cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift);extern int cm_register (struct cm_ll_data *cld);extern int cm_unregister (struct cm_ll_data *cld);
arch/arm/mach-omap2/cm2xxx.c +65 -0
74 lines not on this page · raw message
arch/arm/mach-omap2/cm2xxx.h +4 -0
@@ -60,6 +60,10 @@ extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);extern bool omap2xxx_cm_is_clkdm_in_hwsup (s16 module,u32 mask);extern int omap2xxx_cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +extern int omap2xxx_cm_split_idlest_reg (void __iomem *idlest_reg, +s16 *prcm_inst,u8 *idlest_reg_id); + +extern int __init omap2xxx_cm_init (void );#endif
arch/arm/mach-omap2/cm3xxx.c +66 -0
75 lines not on this page · raw message
arch/arm/mach-omap2/cm3xxx.h +5 -0
@@ -78,9 +78,14 @@ extern bool omap3xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask);extern int omap3xxx_cm_wait_module_ready (s16 prcm_mod,u8 idlest_id,u8 idlest_shift); +extern int omap3xxx_cm_split_idlest_reg (void __iomem *idlest_reg, +s16 *prcm_inst,u8 *idlest_reg_id); +extern void omap3_cm_save_context (void );extern void omap3_cm_restore_context (void ); +extern int __init omap3xxx_cm_init (void ); +#endif #endif
arch/arm/mach-omap2/cm_common.c +48 -0
54 lines not on this page · raw message
arch/arm/mach-omap2/io.c +5 -0
@@ -45,6 +45,8 @@#include "sdrc.h" #include "control.h" #include "serial.h" +#include "cm2xxx.h" +#include "cm3xxx.h" /* * The machine specific code may provide the extra mapping besides the
@@ -388,6 +390,7 @@ void __init omap2420_init_early(void)OMAP2_L4_IO_ADDRESS (OMAP2420_CM_BASE ), NULL, NULL);omap2xxx_check_revision (); +omap2xxx_cm_init ();omap_common_init_early ();omap2xxx_voltagedomains_init ();omap242x_powerdomains_init ();
@@ -417,6 +420,7 @@ void __init omap2430_init_early(void)OMAP2_L4_IO_ADDRESS (OMAP2430_CM_BASE ), NULL, NULL);omap2xxx_check_revision (); +omap2xxx_cm_init ();omap_common_init_early ();omap2xxx_voltagedomains_init ();omap243x_powerdomains_init ();
@@ -451,6 +455,7 @@ void __init omap3_init_early(void) NULL, NULL);omap3xxx_check_revision ();omap3xxx_check_features (); +omap3xxx_cm_init ();omap_common_init_early ();omap3xxx_voltagedomains_init ();omap3xxx_powerdomains_init ();
Signature · 1 line
1.7.10.4
Paul Walmsley
maintainerPATCH 9/13 ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest()
In reply to Paul WalmsleyNow that all users of mach-omap2/omap2_cm_wait_idlest() have been removed, delete the function and its supporting macros and prototypes.
--- arch/arm/mach-omap2/prcm.c | 39 -------------------------------- arch/arm/plat-omap/include/plat/prcm.h | 2 -- 2 files changed, 41 deletions(-)
arch/arm/mach-omap2/prcm.c +0 -39
@@ -44,45 +44,6 @@ void __iomem *cm_base;void __iomem *cm2_base;void __iomem *prcm_mpu_base; -#define MAX_MODULE_ENABLE_WAIT 100000 - -/** -* omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness -* @reg: physical address of module IDLEST register -* @mask: value to mask against to determine if the module is active -* @idlest: idle state indicator (0 or 1) for the clock -* @name: name of the clock (for printk) -* -* Returns 1 if the module indicated readiness in time, or 0 if it -* failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. -* -* XXX This function is deprecated. It should be removed once the -* hwmod conversion is complete. -*/ -int omap2_cm_wait_idlest (void __iomem *reg,u32 mask,u8 idlest, -const char *name) -{ -int i =0 ; -int ena =0 ; - -if (idlest) - ena =0 ; -else - ena = mask; - -/* Wait for lock */ -omap_test_timeout (((__raw_readl (reg) & mask) == ena), -MAX_MODULE_ENABLE_WAIT , i); - -if (i <MAX_MODULE_ENABLE_WAIT ) -pr_debug ("cm: Module associated with clock %s ready after %d loops\n" , - name, i); -else -pr_err ("cm: Module associated with clock %s didn't enable in %d tries\n" , - name,MAX_MODULE_ENABLE_WAIT ); - -return (i <MAX_MODULE_ENABLE_WAIT ) ?1 :0 ; -};void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm,void __iomem *cm2,void __iomem *prcm_mpu)
arch/arm/plat-omap/include/plat/prcm.h +0 -2
@@ -30,8 +30,6 @@#include <linux/kernel.h> #include <linux/io.h> -int omap2_cm_wait_idlest (void __iomem *reg,u32 mask,u8 idlest, -const char *name);void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm,void __iomem *cm2,void __iomem *prcm_mpu);
Paul Walmsley
maintainerPATCH 10/13 ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
In reply to Paul WalmsleySplit omap2_set_globals_prcm() into PRM, CM, and PRCM_MPU variants, since these are all separate IP blocks. This should make it easier to move the PRM, CM, PRCM_MPU code into drivers/ in future patchsets.
At this point arch/arm/plat-omap/include/plat/prcm.h is empty; a subsequent patch will remove it, and remove the #include from all the files that #include it.
--- arch/arm/mach-omap2/clkt2xxx_dpllcore.c | 2 + arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 2 + arch/arm/mach-omap2/cm.h | 8 ++++ arch/arm/mach-omap2/cm2xxx_3xxx.h | 2 + arch/arm/mach-omap2/cm_common.c | 22 +++++++++++ arch/arm/mach-omap2/cminst44xx.h | 2 + arch/arm/mach-omap2/io.c | 51 ++++++++++++++------------ arch/arm/mach-omap2/mcbsp.c | 2 + arch/arm/mach-omap2/omap4-common.c | 1 + arch/arm/mach-omap2/prcm-common.h | 16 -------- arch/arm/mach-omap2/prcm.c | 19 ---------- arch/arm/mach-omap2/prcm_mpu44xx.c | 17 +++++++++ arch/arm/mach-omap2/prcm_mpu44xx.h | 9 ++++- arch/arm/mach-omap2/prm.h | 7 +++- arch/arm/mach-omap2/prm_common.c | 15 ++++++++ arch/arm/mach-omap2/prminst44xx.h | 2 + arch/arm/plat-omap/include/plat/prcm.h | 6 +-- 17 files changed, 111 insertions(+), 72 deletions(-)
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +1 -1
@@ -32,7 +32,7 @@#include "clock.h" #include "clock2xxx.h" #include "opp2xxx.h" -#include "cm2xxx_3xxx.h" +#include "cm2xxx.h" #include "cm-regbits-24xx.h" /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +1 -1
@@ -41,7 +41,7 @@#include "clock.h" #include "clock2xxx.h" #include "opp2xxx.h" -#include "cm2xxx_3xxx.h" +#include "cm2xxx.h" #include "cm-regbits-24xx.h" const struct prcm_config *curr_prcm_set;
arch/arm/mach-omap2/cm.h +7 -1
@@ -1,7 +1,7 @@/* * OMAP2+ Clock Management prototypes * -* Copyright (C) 2007-2009 Texas Instruments, Inc. +* Copyright (C) 2007-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2007-2009 Nokia Corporation * * Written by Paul Walmsley
@@ -22,6 +22,12 @@*/ #define MAX_MODULE_READY_TIME 2000 +# ifndef __ASSEMBLER__ +extern void __iomem *cm_base; +extern void __iomem *cm2_base; +extern void omap2_set_globals_cm (void __iomem *cm,void __iomem *cm2); +# endif +/* * MAX_MODULE_DISABLE_TIME: max duration in microseconds to wait for * the PRCM to request that a module enter the inactive state in the
arch/arm/mach-omap2/cm2xxx_3xxx.h +1 -1
@@ -16,7 +16,7 @@#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H -#include "prcm-common.h" +#include "cm.h" /* * Module specific CM register offsets from CM_BASE + domain offset
arch/arm/mach-omap2/cm_common.c +21 -1
@@ -2,7 +2,7 @@* OMAP2+ common Clock Management (CM) IP block functions * * Copyright (C) 2012 Texas Instruments, Inc. -* Paul Walmsley <[email protected]> +* Paul Walmsley * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -17,6 +17,7 @@#include "cm2xxx.h" #include "cm3xxx.h" #include "cm44xx.h" +#include "common.h" /* * cm_ll_data: function pointers to SoC-specific implementations of
@@ -25,6 +26,25 @@static struct cm_ll_data null_cm_ll_data;static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; +/* cm_base: base virtual address of the CM IP block */ +void __iomem *cm_base; + +/* cm2_base: base virtual address of the CM2 IP block (OMAP44xx only) */ +void __iomem *cm2_base; + +/** +* omap2_set_globals_cm - set the CM/CM2 base addresses (for early use) +* @cm: CM base virtual address +* @cm2: CM2 base virtual address (if present on the booted SoC) +* +* XXX Will be replaced when the PRM/CM drivers are completed. +*/ +void __init omap2_set_globals_cm (void __iomem *cm,void __iomem *cm2) +{ + cm_base = cm; + cm2_base = cm2; +} +/** * cm_split_idlest_reg - split CM_IDLEST reg addr into its components * @idlest_reg: CM_IDLEST* virtual address
arch/arm/mach-omap2/cminst44xx.h +2 -0
@@ -38,4 +38,6 @@ extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst,extern u32 omap4_cminst_read_inst_reg_bits (u8 part,u16 inst,s16 idx,u32 mask); +extern void omap_cm_base_init (void ); +#endif
arch/arm/mach-omap2/io.c +27 -24
99 lines not on this page · raw message
arch/arm/mach-omap2/mcbsp.c +1 -1
@@ -28,7 +28,7 @@* FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle. * Sidetone needs non-gated ICLK and sidetone autoidle is broken. */ -#include "cm2xxx_3xxx.h" +#include "cm3xxx.h" #include "cm-regbits-34xx.h" static int omap3_enable_st_clock (unsigned int id,bool enable)
arch/arm/mach-omap2/omap4-common.c +1 -0
@@ -36,6 +36,7 @@#include "common.h" #include "hsmmc.h" #include "prminst44xx.h" +#include "prcm_mpu44xx.h" #include "omap4-sar-layout.h" #ifdef CONFIG_CACHE_L2X0
arch/arm/mach-omap2/prcm-common.h +0 -16
@@ -421,22 +421,6 @@#define MAX_IOPAD_LATCH_TIME 100# ifndef __ASSEMBLER__ -extern void __iomem *prm_base; -extern void __iomem *cm_base; -extern void __iomem *cm2_base; -extern void __iomem *prcm_mpu_base; - -#if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) -extern void omap_prm_base_init (void ); -extern void omap_cm_base_init (void ); -#else -static inline void omap_prm_base_init (void ) -{ -} -static inline void omap_cm_base_init (void ) -{ -} -#endif /** * struct omap_prcm_irq - describes a PRCM interrupt bit
arch/arm/mach-omap2/prcm.c +0 -19
@@ -39,25 +39,6 @@#include "prm-regbits-44xx.h" #include "control.h" -void __iomem *prm_base; -void __iomem *cm_base; -void __iomem *cm2_base; -void __iomem *prcm_mpu_base; - - -void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm, -void __iomem *cm2,void __iomem *prcm_mpu) -{ - prm_base = prm; - cm_base = cm; - cm2_base = cm2; - prcm_mpu_base = prcm_mpu; - -if (cpu_is_omap44xx () ||soc_is_omap54xx ()) { -omap_prm_base_init (); -omap_cm_base_init (); - } -}/* * Stubbed functions so that common files continue to build when
arch/arm/mach-omap2/prcm_mpu44xx.c +17 -0
@@ -20,6 +20,12 @@#include "prcm_mpu44xx.h" #include "cm-regbits-44xx.h" +/* +* prcm_mpu_base: the virtual address of the start of the PRCM_MPU IP +* block registers +*/ +void __iomem *prcm_mpu_base; +/* PRCM_MPU low-level functions */ u32 omap4_prcm_mpu_read_inst_reg (s16 inst,u16 reg)
@@ -43,3 +49,14 @@ u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)return v; } + +/** +* omap2_set_globals_prcm_mpu - set the MPU PRCM base address (for early use) +* @prcm_mpu: PRCM_MPU base virtual address +* +* XXX Will be replaced when the PRM/CM drivers are completed. +*/ +void __init omap2_set_globals_prcm_mpu (void __iomem *prcm_mpu) +{ + prcm_mpu_base = prcm_mpu; +}
arch/arm/mach-omap2/prcm_mpu44xx.h +8 -1
@@ -1,7 +1,7 @@/* * OMAP44xx PRCM MPU instance offset macros * -* Copyright (C) 2010 Texas Instruments, Inc. +* Copyright (C) 2010, 2012 Texas Instruments, Inc. * Copyright (C) 2010 Nokia Corporation * * Paul Walmsley (paul at pwsan.com)
@@ -25,6 +25,12 @@#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H +#include "common.h" + +# ifndef __ASSEMBLER__ +extern void __iomem *prcm_mpu_base; +# endif +#define OMAP4430_PRCM_MPU_BASE 0x48243000#define OMAP44XX_PRCM_MPU_REGADDR (inst, reg) \
@@ -98,6 +104,7 @@ extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx);extern void omap4_prcm_mpu_write_inst_reg (u32 val,s16 inst,u16 idx);extern u32 omap4_prcm_mpu_rmw_inst_reg_bits (u32 mask,u32 bits,s16 inst,s16 idx); +extern void __init omap2_set_globals_prcm_mpu (void __iomem *prcm_mpu);# endif #endif
arch/arm/mach-omap2/prm.h +6 -1
@@ -1,7 +1,7 @@/* * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions * -* Copyright (C) 2007-2009 Texas Instruments, Inc. +* Copyright (C) 2007-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2010 Nokia Corporation * * Paul Walmsley
@@ -15,6 +15,11 @@#include "prcm-common.h" +# ifndef __ASSEMBLER__ +extern void __iomem *prm_base; +extern void omap2_set_globals_prm (void __iomem *prm); +# endif +/* * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP *
arch/arm/mach-omap2/prm_common.c +15 -0
@@ -31,6 +31,7 @@#include "prm2xxx.h" #include "prm3xxx.h" #include "prm44xx.h" +#include "common.h" /* * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs
@@ -55,6 +56,9 @@ static struct irq_chip_generic **prcm_irq_chips;*/ static struct omap_prcm_irq_setup *prcm_irq_setup; +/* prm_base: base virtual address of the PRM IP block */ +void __iomem *prm_base; +/* * prm_ll_data: function pointers to SoC-specific implementations of * common PRM functions
@@ -329,6 +333,17 @@ err: }/** +* omap2_set_globals_prm - set the PRM base address (for early use) +* @prm: PRM base virtual address +* +* XXX Will be replaced when the PRM/CM drivers are completed. +*/ +void __init omap2_set_globals_prm (void __iomem *prm) +{ + prm_base = prm; +} + +/** * prm_read_reset_sources - return the sources of the SoC's last reset * * Return a u32 bitmask representing the reset sources that caused the
arch/arm/mach-omap2/prminst44xx.h +2 -0
@@ -30,4 +30,6 @@ extern int omap4_prminst_assert_hardreset(u8 shift, u8 part, s16 inst,extern int omap4_prminst_deassert_hardreset (u8 shift,u8 part,s16 inst,u16 rstctrl_offs); +extern void omap_prm_base_init (void ); +#endif
arch/arm/plat-omap/include/plat/prcm.h +1 -5
@@ -27,11 +27,7 @@#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H#define __ASM_ARM_ARCH_OMAP_PRCM_H -#include <linux/kernel.h> -#include <linux/io.h> - -void __init omap2_set_globals_prcm (void __iomem *prm,void __iomem *cm, -void __iomem *cm2,void __iomem *prcm_mpu); +/* XXX To be removed */ #endif
Paul Walmsley
maintainerPATCH 11/13 ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
In reply to Paul WalmsleyConsolidate all of the copies of MAX_MODULE_HARDRESET_WAIT and MAX_MODULE_SOFTRESET_WAIT into one place, arch/arm/mach-omap2/prm.h.
--- arch/arm/mach-omap2/display.c | 2 +- arch/arm/mach-omap2/hdq1w.c | 4 +--- arch/arm/mach-omap2/i2c.c | 6 ++---- arch/arm/mach-omap2/msdi.c | 4 +--- arch/arm/mach-omap2/omap_hwmod.c | 4 +--- arch/arm/mach-omap2/prcm-common.h | 6 ------ arch/arm/mach-omap2/prm.h | 17 +++++++++++++++++ arch/arm/mach-omap2/prm2xxx_3xxx.h | 7 ------- arch/arm/mach-omap2/wd_timer.c | 5 ++--- 9 files changed, 25 insertions(+), 30 deletions(-)
arch/arm/mach-omap2/display.c +1 -1
@@ -34,6 +34,7 @@#include "mux.h" #include "control.h" #include "display.h" +#include "prm.h" #define DISPC_CONTROL 0x0040#define DISPC_CONTROL2 0x0238
@@ -473,7 +474,6 @@ static void dispc_disable_outputs(void) } } -#define MAX_MODULE_SOFTRESET_WAIT 10000int omap_dss_reset (struct omap_hwmod *oh) {struct omap_hwmod_opt_clk *oc;
arch/arm/mach-omap2/hdq1w.c +1 -3
@@ -31,11 +31,9 @@#include <plat/omap_device.h> #include "hdq1w.h" +#include "prm.h" #include "common.h" -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 -/** * omap_hdq1w_reset - reset the OMAP HDQ1W module * @oh: struct omap_hwmod *
arch/arm/mach-omap2/i2c.c +2 -4
@@ -20,9 +20,10 @@*/ #include <plat/i2c.h> -#include "common.h" #include <plat/omap_hwmod.h> +#include "prm.h" +#include "common.h" #include "mux.h" /* In register I2C_CON, Bit 15 is the I2C enable bit */
@@ -30,9 +31,6 @@#define OMAP2_I2C_CON_OFFSET 0x24#define OMAP4_I2C_CON_OFFSET 0xA4 -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 -void __init omap2_i2c_mux_pins (int bus_id) {char mux_name[sizeof ("i2c2_scl.i2c2_scl" )];
arch/arm/mach-omap2/msdi.c +1 -3
@@ -29,6 +29,7 @@#include <plat/omap_device.h> #include <plat/mmc.h> +#include "prm.h" #include "common.h" #include "control.h" #include "mux.h"
@@ -44,9 +45,6 @@#define MSDI_CON_CLKD_MASK (0x3f << 0)#define MSDI_CON_CLKD_SHIFT 0 -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 -/* MSDI_TARGET_RESET_CLKD: clock divisor to use throughout the reset */ #define MSDI_TARGET_RESET_CLKD 0x3ff
arch/arm/mach-omap2/omap_hwmod.c +1 -3
@@ -151,6 +151,7 @@#include "cm3xxx.h" #include "cminst44xx.h" #include "cm33xx.h" +#include "prm.h" #include "prm3xxx.h" #include "prm44xx.h" #include "prm33xx.h"
@@ -158,9 +159,6 @@#include "mux.h" #include "pm.h" -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 -/* Name of the OMAP hwmod for the MPU */ #define MPU_INITIATOR_NAME "mpu"
arch/arm/mach-omap2/prcm-common.h +0 -6
@@ -406,11 +406,6 @@#define OMAP3430_EN_CORE_MASK (1 << 0) -/* -* MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP -* submodule to exit hardreset -*/ -#define MAX_MODULE_HARDRESET_WAIT 10000/* * Maximum time(us) it takes to output the signal WUCLKOUT of the last
@@ -419,7 +414,6 @@* microseconds on OMAP4, so this timeout may be too high. */ #define MAX_IOPAD_LATCH_TIME 100 -# ifndef __ASSEMBLER__/**
arch/arm/mach-omap2/prm.h +17 -0
@@ -20,6 +20,23 @@ extern void __iomem *prm_base;extern void omap2_set_globals_prm (void __iomem *prm);# endif + +/* +* MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP +* module to softreset +*/ +#define MAX_MODULE_SOFTRESET_WAIT 10000 + +/* +* MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP +* submodule to exit hardreset +*/ +#define MAX_MODULE_HARDRESET_WAIT 10000 + +/* +* Register bitfields +*/ +/* * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP *
arch/arm/mach-omap2/prm2xxx_3xxx.h +0 -7
@@ -241,11 +241,4 @@ extern int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm);#define OMAP_LOGICRETSTATE_MASK (1 << 2) -/* -* MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP -* submodule to exit hardreset -*/ -#define MAX_MODULE_HARDRESET_WAIT 10000 - -#endif
arch/arm/mach-omap2/wd_timer.c +2 -3
@@ -1,6 +1,8 @@/* * OMAP2+ MPU WD_TIMER-specific code * +* Copyright (C) 2012 Texas Instruments, Inc. +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or
@@ -30,9 +32,6 @@#define OMAP_WDT_WPS 0x34#define OMAP_WDT_SPR 0x48 -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 -int omap2_wd_timer_disable (struct omap_hwmod *oh) {void __iomem *base;
Paul Walmsley
maintainerPATCH 12/13 ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call
In reply to Paul WalmsleyThe hwmod code unconditionally calls _omap4_disable_module() on all SoCs when a module doesn't enable correctly. This "worked" due to the weak function omap4_cminst_wait_module_idle() in arch/arm/mach-omap2/prcm.c, which was a no-op. But now those weak functions are going away - they should not be used. So this patch will now call the SoC-specific disable_module code, assuming it exists.
Needs to be done before the weak function is removed, otherwise AM33xx will crash early in boot.
--- arch/arm/mach-omap2/omap_hwmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod.c +2 -1
@@ -2062,7 +2062,8 @@ static int _enable(struct omap_hwmod *oh)_enable_sysc (oh); } }else { -_omap4_disable_module (oh); +if (soc_ops.disable_module) + soc_ops.disable_module (oh);_disable_clocks (oh);pr_debug ("omap_hwmod: %s: _wait_target_ready: %d\n" , oh->name, r);
Paul Walmsley
maintainerPATCH 13/13 ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]
In reply to Paul Walmsleyarch/arm/mach-omap2/prcm.c and arch/arm/plat-omap/include/plat/prcm.h are now completely unused and can be removed.
--- arch/arm/mach-omap1/reset.c | 2 - arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/clkt2xxx_apll.c | 1 - arch/arm/mach-omap2/clkt_iclk.c | 1 - arch/arm/mach-omap2/clock.c | 1 - arch/arm/mach-omap2/cpuidle34xx.c | 1 - arch/arm/mach-omap2/io.c | 1 - arch/arm/mach-omap2/omap_hwmod.c | 1 - arch/arm/mach-omap2/pm34xx.c | 1 - arch/arm/mach-omap2/powerdomain.c | 2 - arch/arm/mach-omap2/prcm.c | 63 -------------------------------- arch/arm/mach-omap2/prm2xxx.c | 1 - arch/arm/mach-omap2/prm3xxx.c | 1 - arch/arm/mach-omap2/prm44xx.c | 1 - arch/arm/mach-omap2/prm_common.c | 1 - arch/arm/plat-omap/include/plat/prcm.h | 35 ------------------ 16 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 arch/arm/mach-omap2/prcm.c delete mode 100644 arch/arm/plat-omap/include/plat/prcm.h
arch/arm/mach-omap1/reset.c +0 -2
@@ -4,8 +4,6 @@#include <linux/kernel.h> #include <linux/io.h> -#include <plat/prcm.h> -#include <mach/hardware.h> #include "common.h"
arch/arm/mach-omap2/Makefile +1 -1
@@ -98,7 +98,7 @@ obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o endif # PRCM -obj-y += prcm.o prm_common.o cm_common.o +obj-y += prm_common.o cm_common.o obj-$(CONFIG_ARCH_OMAP2) += prm2xxx_3xxx.o prm2xxx.o cm2xxx.o obj-$(CONFIG_ARCH_OMAP3) += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o
arch/arm/mach-omap2/clkt2xxx_apll.c +0 -1
@@ -22,7 +22,6 @@#include <linux/io.h> #include <plat/clock.h> -#include <plat/prcm.h> #include "clock.h" #include "clock2xxx.h"
arch/arm/mach-omap2/clkt_iclk.c +0 -1
@@ -15,7 +15,6 @@#include <linux/io.h> #include <plat/clock.h> -#include <plat/prcm.h> #include "clock.h" #include "clock2xxx.h"
arch/arm/mach-omap2/clock.c +0 -1
@@ -26,7 +26,6 @@#include <asm/cpu.h> #include <plat/clock.h> -#include <plat/prcm.h> #include <trace/events/power.h>
arch/arm/mach-omap2/cpuidle34xx.c +0 -1
@@ -27,7 +27,6 @@#include <linux/export.h> #include <linux/cpu_pm.h> -#include <plat/prcm.h> #include "powerdomain.h" #include "clockdomain.h"
arch/arm/mach-omap2/io.c +0 -1
@@ -32,7 +32,6 @@#include <plat/omap_hwmod.h> #include <plat/multi.h> #include <plat/dma.h> -#include <plat/prcm.h> #include "soc.h" #include "iomap.h"
arch/arm/mach-omap2/omap_hwmod.c +0 -1
@@ -141,7 +141,6 @@#include <plat/clock.h> #include <plat/omap_hwmod.h> -#include <plat/prcm.h> #include "soc.h" #include "common.h"
arch/arm/mach-omap2/pm34xx.c +0 -1
@@ -39,7 +39,6 @@#include "clockdomain.h" #include "powerdomain.h" #include <plat/sdrc.h> -#include <plat/prcm.h> #include <plat/gpmc.h> #include <plat/dma.h>
arch/arm/mach-omap2/powerdomain.c +0 -2
@@ -29,8 +29,6 @@#include <asm/cpu.h> -#include <plat/prcm.h> -#include "powerdomain.h" #include "clockdomain.h"
arch/arm/mach-omap2/prcm.c deleted +0 -63
63 lines not on this page · raw message
arch/arm/mach-omap2/prm2xxx.c +0 -1
@@ -20,7 +20,6 @@#include "common.h" #include <plat/cpu.h> -#include <plat/prcm.h> #include "vp.h" #include "powerdomain.h"
arch/arm/mach-omap2/prm3xxx.c +0 -1
@@ -20,7 +20,6 @@#include "common.h" #include <plat/cpu.h> -#include <plat/prcm.h> #include "vp.h" #include "powerdomain.h"
arch/arm/mach-omap2/prm44xx.c +0 -1
@@ -18,7 +18,6 @@#include <linux/err.h> #include <linux/io.h> -#include <plat/prcm.h> #include "soc.h" #include "iomap.h"
arch/arm/mach-omap2/prm_common.c +0 -1
@@ -25,7 +25,6 @@#include <linux/slab.h> #include <plat/common.h> -#include <plat/prcm.h> #include "prm2xxx_3xxx.h" #include "prm2xxx.h"
arch/arm/plat-omap/include/plat/prcm.h deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* arch/arm/plat-omap/include/mach/prcm.h -* -* Access definations for use in OMAP24XX clock and power management -* -* Copyright (C) 2005 Texas Instruments, Inc. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* XXX This file is deprecated. The PRCM is an OMAP2+-only subsystem, -* so this file doesn't belong in plat-omap/include/plat. Please -* do not add anything new to this file. -*/ - -#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H -#define __ASM_ARM_ARCH_OMAP_PRCM_H - -/* XXX To be removed */ - -#endif - - -
cover ARM: OMAP: remove prcm.[ch]
In reply to Paul WalmsleyQuoted 8 lines · Paul Walmsley
Remove
arch/arm/mach-omap2/prcm.candarch/arm/plat-omap/include/plat/prcm.h. This is in preparation for moving the PRM/CM code todrivers/, although to be fair, these files should have been removed a long time ago.Intended for 3.8 cleanup. Applies on top of the existing PRM/CM split cleanup series, and the WDTIMER cleanup series.
Paul,
By any chance you have branch available with these patches, so that I can validate them here at my end?
Thanks,
Vaibhav
Quoted 124 lines
- Paul
---
omap2_prcm_cleanup_3.8
text data bss dec hex filename
7521423 696876 5613996 13832295 d31067 vmlinux.omap2plus_defconfig.orig
7522239 696612 5613996 13832847 d3128f vmlinux.omap2plus_defconfigPaul Walmsley (13):
ARM: OMAP2+: common: removemach-omap2/common.candmap_common_iocode
ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
ARM: OMAP2xxx: clock: remove global 'dclk' variable
ARM: OMAP2xxx: clock: movevirt_prcm_setcode intoclkt2xxx_virt_prcm_set.c
ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
ARM: OMAP2+: board files: use SoC-specific system restart functions
ARM: OMAP2xxx: APLL/CM: convert to useomap2_cm_wait_module_ready()
ARM: OMAP2+: CM/clock: convert_omap2_module_wait_ready()to use SoC-independent CM functions
ARM: OMAP2+: PRCM: removeomap2_cm_wait_idlest()
ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
ARM: OMAP2+: hwmod: call to_omap4_disable_module()should use the SoC-specific call
ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]arch/arm/mach-omap1/reset.c | 2 arch/arm/mach-omap2/Makefile | 9 + arch/arm/mach-omap2/am33xx.h | 1 arch/arm/mach-omap2/board-2430sdp.c | 2 arch/arm/mach-omap2/board-3430sdp.c | 2 arch/arm/mach-omap2/board-3630sdp.c | 2 arch/arm/mach-omap2/board-4430sdp.c | 2 arch/arm/mach-omap2/board-am3517crane.c | 2 arch/arm/mach-omap2/board-am3517evm.c | 2 arch/arm/mach-omap2/board-apollon.c | 2 arch/arm/mach-omap2/board-cm-t35.c | 18 +- arch/arm/mach-omap2/board-cm-t3517.c | 2 arch/arm/mach-omap2/board-devkit8000.c | 2 arch/arm/mach-omap2/board-generic.c | 10 + arch/arm/mach-omap2/board-h4.c | 2 arch/arm/mach-omap2/board-igep0020.c | 4 - arch/arm/mach-omap2/board-ldp.c | 2 arch/arm/mach-omap2/board-n8x0.c | 6 - arch/arm/mach-omap2/board-omap3beagle.c | 2 arch/arm/mach-omap2/board-omap3evm.c | 2 arch/arm/mach-omap2/board-omap3logic.c | 4 - arch/arm/mach-omap2/board-omap3pandora.c | 2 arch/arm/mach-omap2/board-omap3stalker.c | 2 arch/arm/mach-omap2/board-omap3touchbook.c | 2 arch/arm/mach-omap2/board-omap4panda.c | 2 arch/arm/mach-omap2/board-overo.c | 2 arch/arm/mach-omap2/board-rm680.c | 4 - arch/arm/mach-omap2/board-rx51.c | 2 arch/arm/mach-omap2/board-ti8168evm.c | 4 - arch/arm/mach-omap2/board-zoom.c | 4 - arch/arm/mach-omap2/clkt2xxx_apll.c | 57 ++----- arch/arm/mach-omap2/clkt2xxx_dpllcore.c | 36 ++++- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 70 ++++++++- arch/arm/mach-omap2/clkt_iclk.c | 1 arch/arm/mach-omap2/clock.c | 15 +- arch/arm/mach-omap2/clock.h | 28 ---- arch/arm/mach-omap2/clock2420_data.c | 26 +-- arch/arm/mach-omap2/clock2430_data.c | 26 +-- arch/arm/mach-omap2/clock2xxx.c | 16 -- arch/arm/mach-omap2/clock2xxx.h | 9 + arch/arm/mach-omap2/cm-regbits-24xx.h | 2 arch/arm/mach-omap2/cm.h | 20 ++- arch/arm/mach-omap2/cm2xxx.c | 128 ++++++++++++++++ arch/arm/mach-omap2/cm2xxx.h | 4 + arch/arm/mach-omap2/cm2xxx_3xxx.h | 8 + arch/arm/mach-omap2/cm3xxx.c | 66 ++++++++ arch/arm/mach-omap2/cm3xxx.h | 5 + arch/arm/mach-omap2/cm_common.c | 70 +++++++++ arch/arm/mach-omap2/cminst44xx.h | 2 arch/arm/mach-omap2/common.c | 202 -------------------------- arch/arm/mach-omap2/common.h | 111 ++------------ arch/arm/mach-omap2/control.c | 10 + arch/arm/mach-omap2/control.h | 2 arch/arm/mach-omap2/cpuidle34xx.c | 1 arch/arm/mach-omap2/display.c | 2 arch/arm/mach-omap2/hdq1w.c | 4 - arch/arm/mach-omap2/i2c.c | 6 - arch/arm/mach-omap2/id.c | 7 + arch/arm/mach-omap2/io.c | 87 +++++++++-- arch/arm/mach-omap2/mcbsp.c | 2 arch/arm/mach-omap2/msdi.c | 4 - arch/arm/mach-omap2/omap2-restart.c | 65 ++++++++ arch/arm/mach-omap2/omap3-restart.c | 36 +++++ arch/arm/mach-omap2/omap4-common.c | 18 ++ arch/arm/mach-omap2/omap_hwmod.c | 8 - arch/arm/mach-omap2/pm34xx.c | 1 arch/arm/mach-omap2/powerdomain.c | 2 arch/arm/mach-omap2/prcm-common.h | 22 --- arch/arm/mach-omap2/prcm.c | 176 ----------------------- arch/arm/mach-omap2/prcm_mpu44xx.c | 17 ++ arch/arm/mach-omap2/prcm_mpu44xx.h | 9 + arch/arm/mach-omap2/prm.h | 24 +++ arch/arm/mach-omap2/prm2xxx.c | 15 ++ arch/arm/mach-omap2/prm2xxx.h | 2 arch/arm/mach-omap2/prm2xxx_3xxx.h | 7 - arch/arm/mach-omap2/prm3xxx.c | 16 ++ arch/arm/mach-omap2/prm3xxx.h | 2 arch/arm/mach-omap2/prm44xx.c | 1 arch/arm/mach-omap2/prm_common.c | 16 ++ arch/arm/mach-omap2/prminst44xx.h | 2 arch/arm/mach-omap2/sdrc.c | 8 - arch/arm/mach-omap2/sdrc.h | 3 arch/arm/mach-omap2/ti81xx.h | 9 + arch/arm/mach-omap2/wd_timer.c | 5 - arch/arm/plat-omap/include/plat/prcm.h | 36 ----- 85 files changed, 827 insertions(+), 804 deletions(-) delete mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/mach-omap2/omap2-restart.c create mode 100644 arch/arm/mach-omap2/omap3-restart.c delete mode 100644 arch/arm/mach-omap2/prcm.c delete mode 100644 arch/arm/plat-omap/include/plat/prcm.h_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Paul Walmsley
maintainercover ARM: OMAP: remove prcm.[ch]
Quoted 8 lines · Vaibhav Hiremath
Quoted 5 lines · Paul Walmsley
Remove
arch/arm/mach-omap2/prcm.candarch/arm/plat-omap/include/plat/prcm.h. This is in preparation for moving the PRM/CM code todrivers/, although to be fair, these files should have been removed a long time ago.
Quoted 8 lines
Quoted 3 lines
Intended for 3.8 cleanup. Applies on top of the existing PRM/CM split cleanup series, and the WDTIMER cleanup series.
Paul,
By any chance you have branch available with these patches, so that I can validate them here at my end?
The current version is at
git://git.pwsan.com/linux-2.6
in the branch
prcm_cleanup_b_3.8
- Paul
cover ARM: OMAP: remove prcm.[ch]
Quoted 19 lines · Paul Walmsley
Quoted 8 lines · Vaibhav Hiremath
Quoted 5 lines · Paul Walmsley
Remove
arch/arm/mach-omap2/prcm.candarch/arm/plat-omap/include/plat/prcm.h. This is in preparation for moving the PRM/CM code todrivers/, although to be fair, these files should have been removed a long time ago.Quoted 8 lines
Quoted 3 lines
Intended for 3.8 cleanup. Applies on top of the existing PRM/CM split cleanup series, and the WDTIMER cleanup series.
Paul,
By any chance you have branch available with these patches, so that I can validate them here at my end?
Quoted 8 lines
The current version is at
git://git.pwsan.com/linux-2.6in the branch
prcm_cleanup_b_3.8
Boot tested on BeagleBone platform.
Thanks,
Vaibhav
Quoted 3 lines
- Paul