public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sanjeev Premi <premi@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] OMAP3, AM35x: Update the checks for CPU revision
Date: Wed, 16 Dec 2009 00:07:46 +0530	[thread overview]
Message-ID: <1260902266-26009-5-git-send-email-premi@ti.com> (raw)
In-Reply-To: <1260902266-26009-1-git-send-email-premi@ti.com>

The usage of get_cpu_rev() to check for cpu revision
is no longer appropriate - after updates in previous
patches.

This patch ensures correct usage.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 cpu/arm_cortexa8/omap3/cache.S |   30 ++++++++++++++++++++++++++++--
 cpu/arm_cortexa8/omap3/clock.c |    3 ++-
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/cpu/arm_cortexa8/omap3/cache.S b/cpu/arm_cortexa8/omap3/cache.S
index 0f63815..8e985d8 100644
--- a/cpu/arm_cortexa8/omap3/cache.S
+++ b/cpu/arm_cortexa8/omap3/cache.S
@@ -131,10 +131,23 @@ finished_inval:
 
 l2_cache_enable:
 	push	{r0, r1, r2, lr}
-	@ ES2 onwards we can disable/enable L2 ourselves
+	@ We can disable/enable L2 ourselves for these devices
+	@ - OMAP3430/OMAP35xx (ES2 onwards)
+	@ - AM35xx
+	mov	r0, #CPU_AM35XX
+	bl	is_cpu_family
+	cmp	r0, #1
+	beq	l2_cache_enable_LATER_THAN_ES2	@ family is AM35xx
+
+	mov	r0, #CPU_OMAP34XX
+	bl	is_cpu_family
+	cmp	r0, #1
+	bne	l2_cache_enable_END		@ Family isn't OMAP34xx/35xx
+
 	bl	get_cpu_rev
 	cmp	r0, #CPU_3XX_ES20
 	blt	l2_cache_disable_EARLIER_THAN_ES2
+l2_cache_enable_LATER_THAN_ES2:
 	mrc	15, 0, r3, cr1, cr0, 1
 	orr	r3, r3, #2
 	mcr	15, 0, r3, cr1, cr0, 1
@@ -162,10 +175,23 @@ l2_cache_enable_END:
 
 l2_cache_disable:
 	push	{r0, r1, r2, lr}
-	@ ES2 onwards we can disable/enable L2 ourselves
+	@ We can disable/enable L2 ourselves for these devices
+	@ - OMAP3430/OMAP35xx (ES2 onwards)
+	@ - AM35xx
+	mov	r0, #CPU_AM35XX
+	bl	is_cpu_family
+	cmp	r0, #1
+	beq	l2_cache_disable_LATER_THAN_ES2	@ family is AM35xx
+
+	mov	r0, #CPU_OMAP34XX
+	bl	is_cpu_family
+	cmp	r0, #1
+	bne	l2_cache_enable_END		@ Family isn't OMAP34xx/35xx
+
 	bl	get_cpu_rev
 	cmp	r0, #CPU_3XX_ES20
 	blt	l2_cache_disable_EARLIER_THAN_ES2
+l2_cache_disable_LATER_THAN_ES2:
 	mrc	15, 0, r3, cr1, cr0, 1
 	bic	r3, r3, #2
 	mcr	15, 0, r3, cr1, cr0, 1
diff --git a/cpu/arm_cortexa8/omap3/clock.c b/cpu/arm_cortexa8/omap3/clock.c
index 174c453..0a1e603 100644
--- a/cpu/arm_cortexa8/omap3/clock.c
+++ b/cpu/arm_cortexa8/omap3/clock.c
@@ -170,7 +170,8 @@ void prcm_init(void)
 	 * and sil_index will get the values for that SysClk for the
 	 * appropriate silicon rev.
 	 */
-	if (get_cpu_rev())
+	if ((is_cpu_family(CPU_OMAP34XX) && (get_cpu_rev() >= CPU_3XX_ES20)) ||
+		(is_cpu_family(CPU_AM35XX)))
 		sil_index = 1;
 
 	/* Unlock MPU DPLL (slows things down, and needed later) */
-- 
1.6.2.2

  parent reply	other threads:[~2009-12-15 18:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 18:37 [U-Boot] [PATCH 0/4] AM35x: Initial support for the processor Sanjeev Premi
2009-12-15 18:37 ` [U-Boot] [PATCH 1/4] AM35x: Introduce support for AM35x processors Sanjeev Premi
2009-12-15 18:37 ` [U-Boot] [PATCH 2/4] OMAP3, AM35x: Detect exact CPU in arch_cpu_init() Sanjeev Premi
2009-12-16 22:11   ` Wolfgang Denk
2009-12-15 18:37 ` [U-Boot] [PATCH 3/4] OMAP3, AM35x: Update function print_cpuinfo() Sanjeev Premi
2009-12-16 22:13   ` Wolfgang Denk
2009-12-15 18:37 ` Sanjeev Premi [this message]
2009-12-15 20:01 ` [U-Boot] [PATCH 0/4] AM35x: Initial support for the processor Tom
2009-12-16  8:45   ` Hiremath, Vaibhav
2010-01-07 14:56 ` Premi, Sanjeev

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=1260902266-26009-5-git-send-email-premi@ti.com \
    --to=premi@ti.com \
    --cc=u-boot@lists.denx.de \
    /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