From: Vaibhav Hiremath <hvaibhav@ti.com>
To: linux-omap@vger.kernel.org
Cc: tony@atomide.com, Vaibhav Hiremath <hvaibhav@ti.com>,
Kevin Hilman <khilman@ti.com>, Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH-V2 3/3] arm:omap:omap4: Hook-up am33xx support to existing prm code
Date: Sun, 8 Jan 2012 15:48:14 +0530 [thread overview]
Message-ID: <1326017894-7632-4-git-send-email-hvaibhav@ti.com> (raw)
In-Reply-To: <1326017894-7632-1-git-send-email-hvaibhav@ti.com>
AM33XX PRM module (L4_WK domain) will be treated as another seperate
partition in _prm_bases[] table.
Also, since cpu_is_omap34xx check is true for am33xx family of
devices, we must check cpu_is_am33xx fisrt, in order to follow
omap4 execution path.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 44 ++++++++++++++++++++++++++-----------
arch/arm/mach-omap2/prcm44xx.h | 4 ++-
arch/arm/mach-omap2/prminst44xx.c | 2 +
3 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5192cab..3639f80 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1288,14 +1288,20 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
if (IS_ERR_VALUE(ret))
return ret;
- if (cpu_is_omap24xx() || cpu_is_omap34xx())
- return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
- ohri.rst_shift);
- else if (cpu_is_omap44xx())
+ /*
+ * In order to use omap4 prm code for am33xx family of devices,
+ * first check cpu_is_am33xx here.
+ *
+ * Note: cpu_is_omap34xx is true for am33xx device as well.
+ */
+ if (cpu_is_omap44xx() || cpu_is_am33xx())
return omap4_prminst_assert_hardreset(ohri.rst_shift,
oh->clkdm->pwrdm.ptr->prcm_partition,
oh->clkdm->pwrdm.ptr->prcm_offs,
oh->prcm.omap4.rstctrl_offs);
+ else if (cpu_is_omap24xx() || cpu_is_omap34xx())
+ return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
+ ohri.rst_shift);
else
return -EINVAL;
}
@@ -1322,11 +1328,13 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
if (IS_ERR_VALUE(ret))
return ret;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
- ret = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
- ohri.rst_shift,
- ohri.st_shift);
- } else if (cpu_is_omap44xx()) {
+ /*
+ * In order to use omap4 prm code for am33xx family of devices,
+ * first check cpu_is_am33xx here.
+ *
+ * Note: cpu_is_omap34xx is true for am33xx device as well.
+ */
+ if (cpu_is_omap44xx() || cpu_is_am33xx()) {
if (ohri.st_shift)
pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
oh->name, name);
@@ -1334,6 +1342,10 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
oh->clkdm->pwrdm.ptr->prcm_partition,
oh->clkdm->pwrdm.ptr->prcm_offs,
oh->prcm.omap4.rstctrl_offs);
+ } else if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ ret = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
+ ohri.rst_shift,
+ ohri.st_shift);
} else {
return -EINVAL;
}
@@ -1364,14 +1376,20 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
if (IS_ERR_VALUE(ret))
return ret;
- if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
- return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
- ohri.st_shift);
- } else if (cpu_is_omap44xx()) {
+ /*
+ * In order to use omap4 prm code for am33xx family of devices,
+ * first check cpu_is_am33xx here.
+ *
+ * Note: cpu_is_omap34xx is true for am33xx device as well.
+ */
+ if (cpu_is_omap44xx() || cpu_is_am33xx()) {
return omap4_prminst_is_hardreset_asserted(ohri.rst_shift,
oh->clkdm->pwrdm.ptr->prcm_partition,
oh->clkdm->pwrdm.ptr->prcm_offs,
oh->prcm.omap4.rstctrl_offs);
+ } else if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+ return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
+ ohri.st_shift);
} else {
return -EINVAL;
}
diff --git a/arch/arm/mach-omap2/prcm44xx.h b/arch/arm/mach-omap2/prcm44xx.h
index 7334ffb..d193f91 100644
--- a/arch/arm/mach-omap2/prcm44xx.h
+++ b/arch/arm/mach-omap2/prcm44xx.h
@@ -31,12 +31,14 @@
#define OMAP4430_CM2_PARTITION 3
#define OMAP4430_SCRM_PARTITION 4
#define OMAP4430_PRCM_MPU_PARTITION 5
+/* AM33XX PRCM is closer to OMAP4, so try to reuse all API's */
+#define AM33XX_PRM_PARTITION 6
/*
* OMAP4_MAX_PRCM_PARTITIONS: set to the highest value of the PRCM partition
* IDs, plus one
*/
-#define OMAP4_MAX_PRCM_PARTITIONS 6
+#define OMAP4_MAX_PRCM_PARTITIONS 7
#endif
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index 3d9894f..fcc4123 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -19,6 +19,7 @@
#include "common.h"
#include "prm44xx.h"
+#include "prm33xx.h"
#include "prminst44xx.h"
#include "prm-regbits-44xx.h"
#include "prcm44xx.h"
@@ -31,6 +32,7 @@ static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
[OMAP4430_CM2_PARTITION] = 0,
[OMAP4430_SCRM_PARTITION] = 0,
[OMAP4430_PRCM_MPU_PARTITION] = OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE),
+ [AM33XX_PRM_PARTITION] = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE),
};
/* Read a register in a PRM instance */
--
1.7.0.4
next prev parent reply other threads:[~2012-01-08 10:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-08 10:18 [PATCH-V2 0/3] arm:omap:omap4:Remove hardcoded reg-offs for PWRSTCTRL & PWRSTST Vaibhav Hiremath
2012-01-08 10:18 ` [PATCH-V2 1/3] arm:omap:omap4: Remove " Vaibhav Hiremath
2012-01-10 18:09 ` Kevin Hilman
2012-01-11 16:21 ` Hiremath, Vaibhav
2012-01-17 5:54 ` Hiremath, Vaibhav
2012-01-08 10:18 ` [PATCH-V2 2/3] arm:omap:omap4: Maintain virtual addr in in _prm_bases table Vaibhav Hiremath
2012-01-08 10:18 ` Vaibhav Hiremath [this message]
2012-01-10 18:09 ` [PATCH-V2 3/3] arm:omap:omap4: Hook-up am33xx support to existing prm code Kevin Hilman
2012-01-11 16:18 ` Hiremath, Vaibhav
2012-01-23 8:53 ` Hiremath, Vaibhav
2012-01-23 22:35 ` Kevin Hilman
2012-02-01 6:48 ` Hiremath, Vaibhav
2012-02-01 17:33 ` Kevin Hilman
2012-02-02 9:28 ` Hiremath, Vaibhav
2012-02-02 17:59 ` Kevin Hilman
2012-02-02 18:05 ` Hiremath, Vaibhav
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=1326017894-7632-4-git-send-email-hvaibhav@ti.com \
--to=hvaibhav@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).