From: Paul Walmsley <paul@pwsan.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH 16/18] omap2: convert DSP code to use new PRCM functions & defines
Date: Fri, 25 May 2007 02:23:38 -0600 [thread overview]
Message-ID: <20070525082502.654505806@pwsan.com> (raw)
In-Reply-To: 20070525082322.168056647@pwsan.com
[-- Attachment #1: 0016-omap2-convert-DSP-code-to-use-new-PRCM-functions.patch --]
[-- Type: text/plain, Size: 3598 bytes --]
Convert the OMAP2-specific code in plat-omap/dsp to use the new PRCM
read/write functions and symbolic constants for registers and register
bits.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
arch/arm/plat-omap/dsp/dsp_common.h | 39 ++++++++++++++++++++++++++---------
arch/arm/plat-omap/dsp/omap2_dsp.h | 1 -
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/arch/arm/plat-omap/dsp/dsp_common.h b/arch/arm/plat-omap/dsp/dsp_common.h
index 898c9ea..2369dad 100644
--- a/arch/arm/plat-omap/dsp/dsp_common.h
+++ b/arch/arm/plat-omap/dsp/dsp_common.h
@@ -28,6 +28,11 @@
#include <asm/arch/mmu.h>
#include "hardware_dsp.h"
+#include "../../mach-omap2/prm.h"
+#include "../../mach-omap2/prm_regbits_24xx.h"
+#include "../../mach-omap2/cm.h"
+#include "../../mach-omap2/cm_regbits_24xx.h"
+
#define DSPSPACE_SIZE 0x1000000
#define omap_set_bit_regw(b,r) \
@@ -97,17 +102,21 @@
#ifdef CONFIG_ARCH_OMAP2
/*
* PRCM / IPI control logic
+ *
+ * REVISIT: these macros should probably be static inline functions
*/
-#define RSTCTRL_RST1_DSP 0x00000001
-#define RSTCTRL_RST2_DSP 0x00000002
#define __dsp_core_enable() \
- do { RM_RSTCTRL_DSP &= ~RSTCTRL_RST1_DSP; } while (0)
+ do { prm_write_mod_reg(prm_read_mod_reg(OMAP24XX_DSP_MOD, RM_RSTCTRL) \
+ & ~OMAP24XX_RST1_DSP, OMAP24XX_DSP_MOD, RM_RSTCTRL); } while (0)
#define __dsp_core_disable() \
- do { RM_RSTCTRL_DSP |= RSTCTRL_RST1_DSP; } while (0)
+ do { prm_write_mod_reg(prm_read_mod_reg(OMAP24XX_DSP_MOD, RM_RSTCTRL) \
+ | OMAP24XX_RST1_DSP, OMAP24XX_DSP_MOD, RM_RSTCTRL); } while (0)
#define __dsp_per_enable() \
- do { RM_RSTCTRL_DSP &= ~RSTCTRL_RST2_DSP; } while (0)
+ do { prm_write_mod_reg(prm_read_mod_reg(OMAP24XX_DSP_MOD, RM_RSTCTRL) \
+ & ~OMAP24XX_RST2_DSP, OMAP24XX_DSP_MOD, RM_RSTCTRL); } while (0)
#define __dsp_per_disable() \
- do { RM_RSTCTRL_DSP |= RSTCTRL_RST2_DSP; } while (0)
+ do { prm_write_mod_reg(prm_read_mod_reg(OMAP24XX_DSP_MOD, RM_RSTCTRL) \
+ | OMAP24XX_RST2_DSP, OMAP24XX_DSP_MOD, RM_RSTCTRL); } while (0)
#endif /* CONFIG_ARCH_OMAP2 */
typedef u32 dsp_long_t; /* must have ability to carry TADD_ABORTADR */
@@ -150,10 +159,19 @@ static inline void dsp_clk_disable(void) {}
#elif defined(CONFIG_ARCH_OMAP2)
static inline void dsp_clk_enable(void)
{
+ u32 r;
+
/*XXX should be handled in mach-omap[1,2] XXX*/
- PM_PWSTCTRL_DSP = (1 << 18) | (1 << 0);
- CM_AUTOIDLE_DSP |= (1 << 1);
- CM_CLKSTCTRL_DSP |= (1 << 0);
+ prm_write_mod_reg(OMAP24XX_FORCESTATE | (1 << OMAP_POWERSTATE_SHIFT),
+ OMAP24XX_DSP_MOD, PM_PWSTCTRL);
+
+ r = cm_read_mod_reg(OMAP24XX_DSP_MOD, CM_AUTOIDLE);
+ r |= OMAP2420_AUTO_DSP_IPI;
+ cm_write_mod_reg(r, OMAP24XX_DSP_MOD, CM_AUTOIDLE);
+
+ r = cm_read_mod_reg(OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
+ r |= OMAP24XX_AUTOSTATE_DSP;
+ cm_write_mod_reg(r, OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
clk_enable(dsp_fck_handle);
clk_enable(dsp_ick_handle);
@@ -165,7 +183,8 @@ static inline void dsp_clk_disable(void)
clk_disable(dsp_ick_handle);
clk_disable(dsp_fck_handle);
- PM_PWSTCTRL_DSP = (1 << 18) | (3 << 0);
+ prm_write_mod_reg(OMAP24XX_FORCESTATE | (3 << OMAP_POWERSTATE_SHIFT),
+ OMAP24XX_DSP_MOD, PM_PWSTCTRL);
}
#endif
diff --git a/arch/arm/plat-omap/dsp/omap2_dsp.h b/arch/arm/plat-omap/dsp/omap2_dsp.h
index 28a98ad..2e90835 100644
--- a/arch/arm/plat-omap/dsp/omap2_dsp.h
+++ b/arch/arm/plat-omap/dsp/omap2_dsp.h
@@ -32,7 +32,6 @@
#endif
#include <asm/arch/hardware.h>
-#include "../../mach-omap2/prcm-regs.h"
/*
* DSP IPI registers: mapped to 0xe1000000 -- use readX(), writeX()
--
1.5.1.3
--
next prev parent reply other threads:[~2007-05-25 8:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 8:23 [PATCH 00/18] PRCM cleanup - remove prcm-regs.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 01/18] omap2: add OMAP24XX and OMAP2/3 modules to prcm_common.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 02/18] omap2: add OMAP24XX register bit defines shared between CM and PRM Paul Walmsley
2007-05-25 8:23 ` [PATCH 03/18] omap2: add OMAP2_PRM_BASE/OMAP2_CM_BASE #defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 04/18] omap2: add OMAP24XX Clock Management register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 05/18] omap2: add Clock Management shared register bit defines to cm.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 06/18] omap2: add OMAP24XX Power/Reset Management register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 07/18] omap2: add Power/Reset Management shared register bit defines to prm.h Paul Walmsley
2007-05-25 8:23 ` [PATCH 08/18] omap2: add OMAP24XX Clock Management register bit defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 09/18] omap2: add OMAP24XX Power/Reset " Paul Walmsley
2007-05-25 8:23 ` [PATCH 10/18] omap2: convert pm.c to use new PRCM functions and symbolic constants Paul Walmsley
2007-05-25 8:23 ` [PATCH 11/18] omap2: convert clock.c " Paul Walmsley
2007-05-25 8:59 ` Igor Stoppa
2007-05-25 9:03 ` Igor Stoppa
2007-05-25 18:53 ` Tony Lindgren
2007-05-25 8:23 ` [PATCH 12/18] omap2: convert prcm.c to use symbolic register & register bit constants Paul Walmsley
2007-05-25 8:23 ` [PATCH 13/18] omap2: convert sram-fn.S to use OMAP2_{PRM, CM}_BASE rather than OMAP2_PRCM_BASE Paul Walmsley
2007-05-25 8:23 ` [PATCH 14/18] omap2: convert clock.h to use symbolic register defines Paul Walmsley
2007-05-25 8:23 ` [PATCH 15/18] omap2: convert clock.h to use symbolic register bit defines Paul Walmsley
2007-05-25 8:23 ` Paul Walmsley [this message]
2007-05-25 8:23 ` [PATCH 17/18] omap2: remove remaining prcm-regs.h includes Paul Walmsley
2007-05-25 8:23 ` [PATCH 18/18] omap2: remove prcm-regs.h Paul Walmsley
-- strict thread matches above, loose matches on Subject: below --
2007-05-17 0:11 [PATCH 00/18] PRCM cleanup - " Paul Walmsley
2007-05-17 0:11 ` [PATCH 16/18] omap2: convert DSP code to use new PRCM functions & defines Paul Walmsley
2007-05-25 21:32 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070525082502.654505806@pwsan.com \
--to=paul@pwsan.com \
--cc=linux-omap-open-source@linux.omap.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox