Rework of the TI81xx PRCM support
Paul Walmsley
maintainercover Rework of the TI81xx PRCM support
This is a rework of the TI81xx PRCM, powerdomain, and clockdomain code and data. Compile-tested only.
- Paul
---
Hemant Pedanekar (3):
ARM: OMAP: TI81XX: prcm: Add module and register offsets
ARM: OMAP: TI81xx: add powerdomain data
ARM: OMAP: TI81xx: add clockdomain data
Paul Walmsley (2):
ARM: OMAP: TI81xx: add powerdomain code
ARM: OMAP: TI81xx: add clockdomain control code
arch/arm/mach-omap2/Makefile | 7 + arch/arm/mach-omap2/clockdomain.h | 3 arch/arm/mach-omap2/clockdomain81xx.c | 77 +++++++++ arch/arm/mach-omap2/clockdomains81xx_data.c | 223 +++++++++++++++++++++++++++ arch/arm/mach-omap2/io.c | 2 arch/arm/mach-omap2/powerdomain.h | 2 arch/arm/mach-omap2/powerdomain81xx.c | 81 ++++++++++ arch/arm/mach-omap2/powerdomain81xx_data.c | 91 +++++++++++ arch/arm/mach-omap2/prcm-regbits-81xx.h | 23 +++ arch/arm/mach-omap2/prcm814x.h | 62 ++++++++ arch/arm/mach-omap2/prcm816x.h | 186 +++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.c | 184 ++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.h | 212 ++++++++++++++++++++++++++ 13 files changed, 1153 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/clockdomain81xx.c create mode 100644 arch/arm/mach-omap2/clockdomains81xx_data.c create mode 100644 arch/arm/mach-omap2/powerdomain81xx.c create mode 100644 arch/arm/mach-omap2/powerdomain81xx_data.c create mode 100644 arch/arm/mach-omap2/prcm-regbits-81xx.h create mode 100644 arch/arm/mach-omap2/prcm814x.h create mode 100644 arch/arm/mach-omap2/prcm816x.h create mode 100644 arch/arm/mach-omap2/prcm81xx.c create mode 100644 arch/arm/mach-omap2/prcm81xx.h
Signature · 1 line
Signature
Paul Walmsley
maintainerRFC PATCH 1/5 ARM: OMAP: TI81XX: prcm: Add module and register offsets
From: Hemant Pedanekar <[email protected]>
This patch adds some of the PRCM register offsets for the TI814X and TI816X devices as required for the clockdomain, powerdomain, clock, and hwmod data.
This patch is a collaboration between Hemant Pedanekar <[email protected]> and Paul Walmsley <[email protected]>.
--- arch/arm/mach-omap2/Makefile | 1 arch/arm/mach-omap2/prcm814x.h | 62 +++++++++++++ arch/arm/mach-omap2/prcm816x.h | 186 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.c | 32 +++++++ arch/arm/mach-omap2/prcm81xx.h | 193 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 474 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/prcm814x.h create mode 100644 arch/arm/mach-omap2/prcm816x.h create mode 100644 arch/arm/mach-omap2/prcm81xx.c create mode 100644 arch/arm/mach-omap2/prcm81xx.h
arch/arm/mach-omap2/Makefile +1 -0
@@ -87,6 +87,7 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ cm44xx.o prcm_mpu44xx.o \ prminst44xx.o vc44xx_data.o \ vp44xx_data.o +obj-$(CONFIG_SOC_OMAPTI81XX) += prcm81xx.o # OMAP voltage domains ifeq ($(CONFIG_PM),y)
arch/arm/mach-omap2/prcm814x.h new file +62 -0
62 lines not on this page · raw message
arch/arm/mach-omap2/prcm816x.h new file +186 -0
186 lines not on this page · raw message
arch/arm/mach-omap2/prcm81xx.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* TI81XX PRCM register access functions +* +* Copyright (C) 2010-2011 Texas Instruments, Inc. - http://www.ti.com/ +* +* 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 version 2. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/kernel.h> +#include <linux/errno.h> +#include <linux/io.h> + +#include "prcm81xx.h" + +static u32 ti81xx_prcm_inst_read (u16 inst,u16 offs) +{ +return __raw_readl (prm_base + inst + offs); +} + +static void ti81xx_prcm_inst_write (u32 v,u16 inst,u16 offs) +{ +__raw_writel (v, prm_base + inst + offs); +} + +
arch/arm/mach-omap2/prcm81xx.h new file +193 -0
193 lines not on this page · raw message
Paul Walmsley
maintainerRFC PATCH 2/5 ARM: OMAP: TI81xx: add powerdomain code
In reply to Paul WalmsleyTI81xx uses a novel PRCM register layout. It most closely resembles the OMAP4 PRCM, but with a few changes. These devices also have limited power management functionality.
Add powerdomain & PRCM implementation code for the TI81xx chips.
This patch is a collaboration between Hemant Pedanekar <[email protected]> and Paul Walmsley <[email protected]>.
--- arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/powerdomain.h | 1 arch/arm/mach-omap2/powerdomain81xx.c | 81 +++++++++++++++++++++++++++ arch/arm/mach-omap2/prcm-regbits-81xx.h | 23 ++++++++ arch/arm/mach-omap2/prcm81xx.c | 93 +++++++++++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.h | 14 +++++ 6 files changed, 214 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/powerdomain81xx.c create mode 100644 arch/arm/mach-omap2/prcm-regbits-81xx.h
arch/arm/mach-omap2/Makefile +2 -0
@@ -112,6 +112,8 @@ obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common) \ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ powerdomain44xx.o \ powerdomains44xx_data.o +obj-$(CONFIG_SOC_OMAPTI81XX) += $(powerdomain-common) \ + powerdomain81xx.o # PRCM clockdomain control obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
arch/arm/mach-omap2/powerdomain.h +1 -0
@@ -218,6 +218,7 @@ extern void omap44xx_powerdomains_init(void);extern struct pwrdm_ops omap2_pwrdm_operations;extern struct pwrdm_ops omap3_pwrdm_operations;extern struct pwrdm_ops omap4_pwrdm_operations; +extern struct pwrdm_ops ti81xx_pwrdm_operations;/* Common Internal functions used across OMAP rev's */ extern u32 omap2_pwrdm_get_mem_bank_onstate_mask (u8 bank);
arch/arm/mach-omap2/powerdomain81xx.c new file +81 -0
81 lines not on this page · raw message
arch/arm/mach-omap2/prcm-regbits-81xx.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* OMAP81xx PRCM register bits +* +* Copyright (C) 2011 Texas Instruments, Inc. +* +* Paul Walmsley (paul at pwsan.com) +* +* 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. +*/ + +#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_REGBITS_81XX_H +#define __ARCH_ARM_MACH_OMAP2_PRCM_REGBITS_81XX_H + +/* +* Used by PM_ACTIVE_PWRSTST, PM_HDVICP_PWRSTST, PM_ISP_PWRSTST, +* PM_DSS_PWRSTST, PM_SGX_PWRSTST +*/ +#define TI81XX_MEM_STATEST_SHIFT 4 +#define TI81XX_MEM_STATEST_MASK (0x3 << 4) + +#endif
arch/arm/mach-omap2/prcm81xx.c +93 -0
104 lines not on this page · raw message
arch/arm/mach-omap2/prcm81xx.h +14 -0
@@ -188,6 +188,20 @@#define TI81XX_CM_ALWON_SR_1_CLKCTRL_OFFSET 0x020C#define TI81XX_CM_ALWON_SR_1_CLKCTRL TI81XX_CM_REGADDR(TI81XX_CM_ALWON_INST, 0x020C) +/* +* Register offset aliases (for clearer code,@least in theory) +*/ +#define TI81XX_PM_PWRSTCTRL_OFFSET TI81XX_PRM_ACTIVE_PM_PWRSTCTRL_OFFSET +#define TI81XX_PM_PWRSTST_OFFSET TI81XX_PRM_ACTIVE_PM_PWRSTST_OFFSET +/* Function prototypes */ +extern void ti81xx_prcm_pwrdm_set_powerstate (u16 offs,u8 pwrst); +extern u8 ti81xx_prcm_pwrdm_read_powerstate (u16 offs); +extern u8 ti81xx_prcm_pwrdm_read_powerstatest (u16 offs); +extern u8 ti81xx_prcm_pwrdm_read_logicstatest (u16 offs); +extern u8 ti81xx_prcm_pwrdm_read_mem_statest (u16 offs); +extern void ti81xx_prcm_pwrdm_set_lowpowerstatechange (u16 offs); +extern int ti81xx_prcm_pwrdm_wait_transition (u16 offs); +#endif
Paul Walmsley
maintainerRFC PATCH 3/5 ARM: OMAP: TI81xx: add powerdomain data
In reply to Paul WalmsleyFrom: Hemant Pedanekar <[email protected]>
Add powerdomain data for the TI81xx family of SoCs.
This patch is a collaboration between Hemant Pedanekar <[email protected]> and Paul Walmsley <[email protected]>.
--- arch/arm/mach-omap2/Makefile | 3 + arch/arm/mach-omap2/io.c | 1 arch/arm/mach-omap2/powerdomain.h | 1 arch/arm/mach-omap2/powerdomain81xx_data.c | 91 ++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap2/powerdomain81xx_data.c
arch/arm/mach-omap2/Makefile +2 -1
@@ -113,7 +113,8 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ powerdomain44xx.o \ powerdomains44xx_data.o obj-$(CONFIG_SOC_OMAPTI81XX) += $(powerdomain-common) \ - powerdomain81xx.o + powerdomain81xx.o \ + powerdomain81xx_data.o \ # PRCM clockdomain control obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
arch/arm/mach-omap2/io.c +1 -0
@@ -350,6 +350,7 @@ void __init omap2_init_common_infrastructure(void)omap2430_hwmod_init (); }else if (cpu_is_omap34xx ()) {omap3xxx_powerdomains_init (); +ti81xx_powerdomains_init ();omap3xxx_clockdomains_init ();omap3xxx_hwmod_init (); }else if (cpu_is_omap44xx ()) {
arch/arm/mach-omap2/powerdomain.h +1 -0
@@ -214,6 +214,7 @@ extern void omap242x_powerdomains_init(void);extern void omap243x_powerdomains_init (void );extern void omap3xxx_powerdomains_init (void );extern void omap44xx_powerdomains_init (void ); +extern void ti81xx_powerdomains_init (void );extern struct pwrdm_ops omap2_pwrdm_operations;extern struct pwrdm_ops omap3_pwrdm_operations;
arch/arm/mach-omap2/powerdomain81xx_data.c new file +91 -0
91 lines not on this page · raw message
Paul Walmsley
maintainerRFC PATCH 4/5 ARM: OMAP: TI81xx: add clockdomain control code
In reply to Paul WalmsleyAdd clockdomain control code for the TI816x and TI814x SoCs.
This patch is a collaboration between Hemant Pedanekar <[email protected]> and Paul Walmsley <[email protected]>.
--- arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/clockdomain.h | 1 arch/arm/mach-omap2/clockdomain81xx.c | 77 +++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.c | 59 +++++++++++++++++++++++++ arch/arm/mach-omap2/prcm81xx.h | 5 ++ 5 files changed, 144 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/clockdomain81xx.c
arch/arm/mach-omap2/Makefile +2 -0
@@ -129,6 +129,8 @@ obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ clockdomain44xx.o \ clockdomains44xx_data.o +obj-$(CONFIG_SOC_OMAPTI81XX) += clockdomain.o \ + clockdomain81xx.o # Clock framework obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
arch/arm/mach-omap2/clockdomain.h +1 -0
@@ -202,6 +202,7 @@ extern void _clkdm_del_autodeps(struct clockdomain *clkdm);extern struct clkdm_ops omap2_clkdm_operations;extern struct clkdm_ops omap3_clkdm_operations;extern struct clkdm_ops omap4_clkdm_operations; +extern struct clkdm_ops ti81xx_clkdm_operations;extern struct clkdm_dep gfx_24xx_wkdeps[];extern struct clkdm_dep dsp_24xx_wkdeps[];
arch/arm/mach-omap2/clockdomain81xx.c new file +77 -0
77 lines not on this page · raw message
arch/arm/mach-omap2/prcm81xx.c +59 -0
74 lines not on this page · raw message
arch/arm/mach-omap2/prcm81xx.h +5 -0
@@ -203,5 +203,10 @@ extern u8 ti81xx_prcm_pwrdm_read_logicstatest(u16 offs);extern u8 ti81xx_prcm_pwrdm_read_mem_statest (u16 offs);extern void ti81xx_prcm_pwrdm_set_lowpowerstatechange (u16 offs);extern int ti81xx_prcm_pwrdm_wait_transition (u16 offs); +extern void ti81xx_prcm_clkdm_enable_hwsup (s16 inst,u16 offs); +extern void ti81xx_prcm_clkdm_disable_hwsup (s16 inst,u16 offs); +extern void ti81xx_prcm_clkdm_force_sleep (s16 inst,u16 offs); +extern void ti81xx_prcm_clkdm_force_wakeup (s16 inst,u16 offs); +extern bool ti81xx_prcm_is_clkdm_in_hwsup (s16 inst,u16 offs);#endif
Paul Walmsley
maintainerRFC PATCH 5/5 ARM: OMAP: TI81xx: add clockdomain data
In reply to Paul WalmsleyFrom: Hemant Pedanekar <[email protected]>
Add clockdomain data for the TI816x and TI814x SoCs.
This patch is a collaboration between Hemant Pedanekar <[email protected]> and Paul Walmsley <[email protected]>.
--- arch/arm/mach-omap2/Makefile | 3 arch/arm/mach-omap2/clockdomain.h | 2 arch/arm/mach-omap2/clockdomains81xx_data.c | 223 +++++++++++++++++++++++++++ arch/arm/mach-omap2/io.c | 1 4 files changed, 228 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap2/clockdomains81xx_data.c
arch/arm/mach-omap2/Makefile +2 -1
@@ -130,7 +130,8 @@ obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ clockdomain44xx.o \ clockdomains44xx_data.o obj-$(CONFIG_SOC_OMAPTI81XX) += clockdomain.o \ - clockdomain81xx.o + clockdomain81xx.o \ + clockdomains81xx_data.o # Clock framework obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
arch/arm/mach-omap2/clockdomain.h +2 -0
@@ -196,6 +196,8 @@ extern void __init omap242x_clockdomains_init(void);extern void __init omap243x_clockdomains_init (void );extern void __init omap3xxx_clockdomains_init (void );extern void __init omap44xx_clockdomains_init (void ); +extern void __init ti81xx_clockdomains_init (void ); +extern void _clkdm_add_autodeps (struct clockdomain *clkdm);extern void _clkdm_del_autodeps (struct clockdomain *clkdm);
arch/arm/mach-omap2/clockdomains81xx_data.c new file +223 -0
223 lines not on this page · raw message
arch/arm/mach-omap2/io.c +1 -0
@@ -352,6 +352,7 @@ void __init omap2_init_common_infrastructure(void)omap3xxx_powerdomains_init ();ti81xx_powerdomains_init ();omap3xxx_clockdomains_init (); +ti81xx_clockdomains_init ();omap3xxx_hwmod_init (); }else if (cpu_is_omap44xx ()) {omap44xx_powerdomains_init ();