xref: /openbmc/linux/arch/arm/mach-omap2/cm.h (revision a58caad1)
169d88a00SPaul Walmsley #ifndef __ARCH_ASM_MACH_OMAP2_CM_H
269d88a00SPaul Walmsley #define __ARCH_ASM_MACH_OMAP2_CM_H
369d88a00SPaul Walmsley 
469d88a00SPaul Walmsley /*
569d88a00SPaul Walmsley  * OMAP2/3 Clock Management (CM) register definitions
669d88a00SPaul Walmsley  *
769d88a00SPaul Walmsley  * Copyright (C) 2007-2008 Texas Instruments, Inc.
869d88a00SPaul Walmsley  * Copyright (C) 2007-2008 Nokia Corporation
969d88a00SPaul Walmsley  *
1069d88a00SPaul Walmsley  * Written by Paul Walmsley
1169d88a00SPaul Walmsley  *
1269d88a00SPaul Walmsley  * This program is free software; you can redistribute it and/or modify
1369d88a00SPaul Walmsley  * it under the terms of the GNU General Public License version 2 as
1469d88a00SPaul Walmsley  * published by the Free Software Foundation.
1569d88a00SPaul Walmsley  */
1669d88a00SPaul Walmsley 
1769d88a00SPaul Walmsley #include "prcm-common.h"
1869d88a00SPaul Walmsley 
1969d88a00SPaul Walmsley #ifndef __ASSEMBLER__
2069d88a00SPaul Walmsley #define OMAP_CM_REGADDR(module, reg)					\
2169d88a00SPaul Walmsley 	(void __iomem *)IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
2269d88a00SPaul Walmsley #else
2369d88a00SPaul Walmsley #define OMAP2420_CM_REGADDR(module, reg)				\
2469d88a00SPaul Walmsley 			IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
2569d88a00SPaul Walmsley #define OMAP2430_CM_REGADDR(module, reg)				\
2669d88a00SPaul Walmsley 			IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
2769d88a00SPaul Walmsley #define OMAP34XX_CM_REGADDR(module, reg)				\
2869d88a00SPaul Walmsley 			IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
2969d88a00SPaul Walmsley #endif
3069d88a00SPaul Walmsley 
3169d88a00SPaul Walmsley /*
3269d88a00SPaul Walmsley  * Architecture-specific global CM registers
3369d88a00SPaul Walmsley  * Use cm_{read,write}_reg() with these registers.
3469d88a00SPaul Walmsley  * These registers appear once per CM module.
3569d88a00SPaul Walmsley  */
3669d88a00SPaul Walmsley 
3769d88a00SPaul Walmsley #define OMAP3430_CM_REVISION		OMAP_CM_REGADDR(OCP_MOD, 0x0000)
3869d88a00SPaul Walmsley #define OMAP3430_CM_SYSCONFIG		OMAP_CM_REGADDR(OCP_MOD, 0x0010)
3969d88a00SPaul Walmsley #define OMAP3430_CM_POLCTRL		OMAP_CM_REGADDR(OCP_MOD, 0x009c)
4069d88a00SPaul Walmsley 
4169d88a00SPaul Walmsley #define OMAP3430_CM_CLKOUT_CTRL		OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
4269d88a00SPaul Walmsley 
4369d88a00SPaul Walmsley /*
4469d88a00SPaul Walmsley  * Module specific CM registers from CM_BASE + domain offset
4569d88a00SPaul Walmsley  * Use cm_{read,write}_mod_reg() with these registers.
4669d88a00SPaul Walmsley  * These register offsets generally appear in more than one PRCM submodule.
4769d88a00SPaul Walmsley  */
4869d88a00SPaul Walmsley 
4969d88a00SPaul Walmsley /* Common between 24xx and 34xx */
5069d88a00SPaul Walmsley 
5169d88a00SPaul Walmsley #define CM_FCLKEN					0x0000
5269d88a00SPaul Walmsley #define CM_FCLKEN1					CM_FCLKEN
5369d88a00SPaul Walmsley #define CM_CLKEN					CM_FCLKEN
5469d88a00SPaul Walmsley #define CM_ICLKEN					0x0010
5569d88a00SPaul Walmsley #define CM_ICLKEN1					CM_ICLKEN
5669d88a00SPaul Walmsley #define CM_ICLKEN2					0x0014
5769d88a00SPaul Walmsley #define CM_ICLKEN3					0x0018
5869d88a00SPaul Walmsley #define CM_IDLEST					0x0020
5969d88a00SPaul Walmsley #define CM_IDLEST1					CM_IDLEST
6069d88a00SPaul Walmsley #define CM_IDLEST2					0x0024
6169d88a00SPaul Walmsley #define CM_AUTOIDLE					0x0030
6269d88a00SPaul Walmsley #define CM_AUTOIDLE1					CM_AUTOIDLE
6369d88a00SPaul Walmsley #define CM_AUTOIDLE2					0x0034
6469d88a00SPaul Walmsley #define CM_AUTOIDLE3					0x0038
6569d88a00SPaul Walmsley #define CM_CLKSEL					0x0040
6669d88a00SPaul Walmsley #define CM_CLKSEL1					CM_CLKSEL
6769d88a00SPaul Walmsley #define CM_CLKSEL2					0x0044
6869d88a00SPaul Walmsley #define CM_CLKSTCTRL					0x0048
6969d88a00SPaul Walmsley 
7069d88a00SPaul Walmsley 
7169d88a00SPaul Walmsley /* Architecture-specific registers */
7269d88a00SPaul Walmsley 
7369d88a00SPaul Walmsley #define OMAP24XX_CM_FCLKEN2				0x0004
7469d88a00SPaul Walmsley #define OMAP24XX_CM_ICLKEN4				0x001c
7569d88a00SPaul Walmsley #define OMAP24XX_CM_AUTOIDLE4				0x003c
7669d88a00SPaul Walmsley 
7769d88a00SPaul Walmsley #define OMAP2430_CM_IDLEST3				0x0028
7869d88a00SPaul Walmsley 
7969d88a00SPaul Walmsley #define OMAP3430_CM_CLKEN_PLL				0x0004
8069d88a00SPaul Walmsley #define OMAP3430ES2_CM_CLKEN2				0x0004
8169d88a00SPaul Walmsley #define OMAP3430ES2_CM_FCLKEN3				0x0008
8269d88a00SPaul Walmsley #define OMAP3430_CM_IDLEST_PLL				CM_IDLEST2
8369d88a00SPaul Walmsley #define OMAP3430_CM_AUTOIDLE_PLL			CM_AUTOIDLE2
8469d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL1				CM_CLKSEL
8569d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL1_PLL				CM_CLKSEL
8669d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL2_PLL				CM_CLKSEL2
8769d88a00SPaul Walmsley #define OMAP3430_CM_SLEEPDEP				CM_CLKSEL2
8869d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL3				CM_CLKSTCTRL
8969d88a00SPaul Walmsley #define OMAP3430_CM_CLKSTST				0x004c
9069d88a00SPaul Walmsley #define OMAP3430ES2_CM_CLKSEL4				0x004c
9169d88a00SPaul Walmsley #define OMAP3430ES2_CM_CLKSEL5				0x0050
9269d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL2_EMU				0x0050
9369d88a00SPaul Walmsley #define OMAP3430_CM_CLKSEL3_EMU				0x0054
9469d88a00SPaul Walmsley 
9569d88a00SPaul Walmsley 
9669d88a00SPaul Walmsley /* Clock management domain register get/set */
9769d88a00SPaul Walmsley 
9869d88a00SPaul Walmsley #ifndef __ASSEMBLER__
9969d88a00SPaul Walmsley 
100a58caad1STony Lindgren extern u32 cm_read_mod_reg(s16 module, u16 idx);
101a58caad1STony Lindgren extern void cm_write_mod_reg(u32 val, s16 module, u16 idx);
102a58caad1STony Lindgren 
10369d88a00SPaul Walmsley #endif
10469d88a00SPaul Walmsley 
10569d88a00SPaul Walmsley /* CM register bits shared between 24XX and 3430 */
10669d88a00SPaul Walmsley 
10769d88a00SPaul Walmsley /* CM_CLKSEL_GFX */
10869d88a00SPaul Walmsley #define OMAP_CLKSEL_GFX_SHIFT				0
10969d88a00SPaul Walmsley #define OMAP_CLKSEL_GFX_MASK				(0x7 << 0)
11069d88a00SPaul Walmsley 
11169d88a00SPaul Walmsley /* CM_ICLKEN_GFX */
11269d88a00SPaul Walmsley #define OMAP_EN_GFX_SHIFT				0
11369d88a00SPaul Walmsley #define OMAP_EN_GFX					(1 << 0)
11469d88a00SPaul Walmsley 
11569d88a00SPaul Walmsley /* CM_IDLEST_GFX */
11669d88a00SPaul Walmsley #define OMAP_ST_GFX					(1 << 0)
11769d88a00SPaul Walmsley 
11869d88a00SPaul Walmsley 
11969d88a00SPaul Walmsley #endif
120