* [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal)
@ 2012-02-13 6:15 Afzal Mohammed
2012-02-13 14:24 ` Peter Korsgaard
0 siblings, 1 reply; 5+ messages in thread
From: Afzal Mohammed @ 2012-02-13 6:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Vaibhav Bedia <vaibhav.bedia@ti.com>
Update SRAM start & size for am33xx SoC's.
Note: cpu_is_34xx() is true for am33xx also. Doing
cpu_is_am33xx() check after cpu_is_34xx() will not
achieve what we want due to the above reason.
Hence cpu_is_am33xx() is done before cpu_is_34xx()
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Signed-off-by: Afzal Mohammed <afzal@ti.com>
---
v2: Use OMAP naming conventions for subject
arch/arm/plat-omap/include/plat/sram.h | 1 +
arch/arm/plat-omap/sram.c | 14 ++++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 75aa1b2..227ae26 100644
--- a/arch/arm/plat-omap/include/plat/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -101,4 +101,5 @@ static inline void omap_push_sram_idle(void) {}
#else
#define OMAP4_SRAM_PA 0x40300000
#endif
+#define AM33XX_SRAM_PA 0x40300000
#endif
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 4243bdc..596f222 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -86,7 +86,7 @@ static int is_sram_locked(void)
__raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */
__raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
}
- if (cpu_is_omap34xx()) {
+ if (cpu_is_omap34xx() && !cpu_is_am33xx()) {
__raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
__raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */
__raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */
@@ -124,7 +124,10 @@ static void __init omap_detect_sram(void)
omap_sram_size = 0x800; /* 2K */
}
} else {
- if (cpu_is_omap34xx()) {
+ if (cpu_is_am33xx()) {
+ omap_sram_start = AM33XX_SRAM_PA;
+ omap_sram_size = 0x10000; /* 64K */
+ } else if (cpu_is_omap34xx()) {
omap_sram_start = OMAP3_SRAM_PA;
omap_sram_size = 0x10000; /* 64K */
} else if (cpu_is_omap44xx()) {
@@ -368,6 +371,11 @@ static inline int omap34xx_sram_init(void)
return 0;
}
+static inline int am33xx_sram_init(void)
+{
+ return 0;
+}
+
int __init omap_sram_init(void)
{
omap_detect_sram();
@@ -379,6 +387,8 @@ int __init omap_sram_init(void)
omap242x_sram_init();
else if (cpu_is_omap2430())
omap243x_sram_init();
+ else if (cpu_is_am33xx())
+ am33xx_sram_init();
else if (cpu_is_omap34xx())
omap34xx_sram_init();
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal)
2012-02-13 6:15 [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal) Afzal Mohammed
@ 2012-02-13 14:24 ` Peter Korsgaard
2012-02-13 16:07 ` Bedia, Vaibhav
0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2012-02-13 14:24 UTC (permalink / raw)
To: linux-arm-kernel
>>>>> "Afzal" == Afzal Mohammed <afzal@ti.com> writes:
Afzal> From: Vaibhav Bedia <vaibhav.bedia@ti.com>
Afzal> Update SRAM start & size for am33xx SoC's.
Afzal> Note: cpu_is_34xx() is true for am33xx also. Doing
Afzal> cpu_is_am33xx() check after cpu_is_34xx() will not
Afzal> achieve what we want due to the above reason.
Afzal> Hence cpu_is_am33xx() is done before cpu_is_34xx()
Afzal> } else {
Afzal> - if (cpu_is_omap34xx()) {
Afzal> + if (cpu_is_am33xx()) {
Afzal> + omap_sram_start = AM33XX_SRAM_PA;
Afzal> + omap_sram_size = 0x10000; /* 64K */
Afzal> + } else if (cpu_is_omap34xx()) {
Afzal> omap_sram_start = OMAP3_SRAM_PA;
Afzal> omap_sram_size = 0x10000; /* 64K */
I don't particular know the omap sram stuff, but doesn't the 33xx have
2x 64K blocks of SRAM?
Afzal> +static inline int am33xx_sram_init(void)
Afzal> +{
Afzal> + return 0;
I know you mentioned it in the commit message, but it might be good with
a comment here as well that this dummy function is needed to not get the 34xx
init function called for 33xx, so it doesn't get removed when somebody
decides to cleanup.
Afzal> +}
Afzal> +
Afzal> int __init omap_sram_init(void)
Afzal> {
Afzal> omap_detect_sram();
Afzal> @@ -379,6 +387,8 @@ int __init omap_sram_init(void)
Afzal> omap242x_sram_init();
Afzal> else if (cpu_is_omap2430())
Afzal> omap243x_sram_init();
Afzal> + else if (cpu_is_am33xx())
Afzal> + am33xx_sram_init();
Afzal> else if (cpu_is_omap34xx())
Afzal> omap34xx_sram_init();
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal)
2012-02-13 14:24 ` Peter Korsgaard
@ 2012-02-13 16:07 ` Bedia, Vaibhav
2012-03-05 23:14 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Bedia, Vaibhav @ 2012-02-13 16:07 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 13, 2012 at 19:54:05, Peter Korsgaard wrote:
> >>>>> "Afzal" == Afzal Mohammed <afzal@ti.com> writes:
>
> Afzal> From: Vaibhav Bedia <vaibhav.bedia@ti.com>
> Afzal> Update SRAM start & size for am33xx SoC's.
>
This is a really awkward quoting style :|
>
> I don't particular know the omap sram stuff, but doesn't the 33xx have
> 2x 64K blocks of SRAM?
>
Yes, but since the lower 64KB will not be available on non-GP device and
only A8 can access it, for now we make use of the higher 64KB which is referred
to as the OCMC RAM in the TRM. This will also enable SRAM usage by other drivers
like PRU and McASP.
>
> Afzal> +static inline int am33xx_sram_init(void)
> Afzal> +{
> Afzal> + return 0;
>
>
> I know you mentioned it in the commit message, but it might be good with
> a comment here as well that this dummy function is needed to not get the 34xx
> init function called for 33xx, so it doesn't get removed when somebody
> decides to cleanup.
You are right in saying that the dummy function is needed to avoid 34xx SRAM init.
We'll have some PM related code coming in soon and hopefully the SRAM code won't change
Without us noticing ;)
Regards,
Vaibhav B.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal)
2012-02-13 16:07 ` Bedia, Vaibhav
@ 2012-03-05 23:14 ` Tony Lindgren
2012-03-07 9:56 ` Hiremath, Vaibhav
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2012-03-05 23:14 UTC (permalink / raw)
To: linux-arm-kernel
* Bedia, Vaibhav <vaibhav.bedia@ti.com> [120213 07:36]:
> On Mon, Feb 13, 2012 at 19:54:05, Peter Korsgaard wrote:
> > >>>>> "Afzal" == Afzal Mohammed <afzal@ti.com> writes:
> >
> > Afzal> From: Vaibhav Bedia <vaibhav.bedia@ti.com>
> > Afzal> Update SRAM start & size for am33xx SoC's.
> >
>
> This is a really awkward quoting style :|
>
> >
> > I don't particular know the omap sram stuff, but doesn't the 33xx have
> > 2x 64K blocks of SRAM?
> >
>
> Yes, but since the lower 64KB will not be available on non-GP device and
> only A8 can access it, for now we make use of the higher 64KB which is referred
> to as the OCMC RAM in the TRM. This will also enable SRAM usage by other drivers
> like PRU and McASP.
>
> >
> > Afzal> +static inline int am33xx_sram_init(void)
> > Afzal> +{
> > Afzal> + return 0;
> >
> >
> > I know you mentioned it in the commit message, but it might be good with
> > a comment here as well that this dummy function is needed to not get the 34xx
> > init function called for 33xx, so it doesn't get removed when somebody
> > decides to cleanup.
>
> You are right in saying that the dummy function is needed to avoid 34xx SRAM init.
> We'll have some PM related code coming in soon and hopefully the SRAM code won't change
> Without us noticing ;)
OK, applying into fixes-non-critical-part2. Our sram.c should get turned
into a device driver, there's been already similar sram driver posted
to LAKML. So that should allow us to remove the cpu_is_xxxx checks.
Regards,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal)
2012-03-05 23:14 ` Tony Lindgren
@ 2012-03-07 9:56 ` Hiremath, Vaibhav
0 siblings, 0 replies; 5+ messages in thread
From: Hiremath, Vaibhav @ 2012-03-07 9:56 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 06, 2012 at 04:44:13, Tony Lindgren wrote:
> * Bedia, Vaibhav <vaibhav.bedia@ti.com> [120213 07:36]:
> > On Mon, Feb 13, 2012 at 19:54:05, Peter Korsgaard wrote:
> > > >>>>> "Afzal" == Afzal Mohammed <afzal@ti.com> writes:
> > >
> > > Afzal> From: Vaibhav Bedia <vaibhav.bedia@ti.com>
> > > Afzal> Update SRAM start & size for am33xx SoC's.
> > >
> >
> > This is a really awkward quoting style :|
> >
> > >
> > > I don't particular know the omap sram stuff, but doesn't the 33xx have
> > > 2x 64K blocks of SRAM?
> > >
> >
> > Yes, but since the lower 64KB will not be available on non-GP device and
> > only A8 can access it, for now we make use of the higher 64KB which is referred
> > to as the OCMC RAM in the TRM. This will also enable SRAM usage by other drivers
> > like PRU and McASP.
> >
> > >
> > > Afzal> +static inline int am33xx_sram_init(void)
> > > Afzal> +{
> > > Afzal> + return 0;
> > >
> > >
> > > I know you mentioned it in the commit message, but it might be good with
> > > a comment here as well that this dummy function is needed to not get the 34xx
> > > init function called for 33xx, so it doesn't get removed when somebody
> > > decides to cleanup.
> >
> > You are right in saying that the dummy function is needed to avoid 34xx SRAM init.
> > We'll have some PM related code coming in soon and hopefully the SRAM code won't change
> > Without us noticing ;)
>
> OK, applying into fixes-non-critical-part2. Our sram.c should get turned
> into a device driver, there's been already similar sram driver posted
> to LAKML. So that should allow us to remove the cpu_is_xxxx checks.
>
I think I missed this, let me check the post.
Thanks,
Vaibhav
> Regards,
>
> Tony
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-07 9:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 6:15 [PATCH v2 2/2] ARM: OMAP: sram: Add am33xx SRAM support (minimal) Afzal Mohammed
2012-02-13 14:24 ` Peter Korsgaard
2012-02-13 16:07 ` Bedia, Vaibhav
2012-03-05 23:14 ` Tony Lindgren
2012-03-07 9:56 ` Hiremath, Vaibhav
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).