All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-omap@vger.kernel.org
Cc: Mike Chan <mikechan@google.com>, Richard Woodruff <r-woodruff2@ti.com>
Subject: [PATCH -pm 1/2] SDRC: check for stuck DLL state machine and kick
Date: Mon, 15 Jun 2009 15:42:54 -0700	[thread overview]
Message-ID: <1245105775-28844-2-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1245105775-28844-1-git-send-email-khilman@deeprootsystems.com>

From: Richard Woodruff <r-woodruff2@ti.com>

I'm thinking DLL state is an exceptional condition which happens based
on some wrong early programming when initially setting DLL up.  Some
kind of race between idle features and lock happens early on.  This
patch recognizes the issue and moves state machine into locked state.

Its my guess the kick case won't be executed that often.  As long as
DLL is not on you can mess with idle state.  When its on to mess with
DDR control you need to be in self-refresh and not making
accesses... like in dvfs code.

Tested-by: Mike Chan <mikechan@google.com>
---
 arch/arm/mach-omap2/sleep34xx.S |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index aedcf94..c469bbe 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -595,20 +595,38 @@ wait_sdrc_ok:
         ldr     r5, [r4]
         bic     r5, r5, #0x40
         str     r5, [r4]
-wait_dll_lock:
-        /* Is dll in lock mode? */
+is_dll_in_lock_mode:
         ldr     r4, sdrc_dlla_ctrl
         ldr     r5, [r4]
         tst     r5, #0x4
         bxne    lr
         /* wait till dll locks */
+wait_dll_lock_timed:
         ldr     r4, sdrc_dlla_status
+        mov     r6, #0x2000
+wait_dll_lock:
+        subs    r6, r6, #0x1
+        beq     kick_dll
         ldr     r5, [r4]
         and     r5, r5, #0x4
         cmp     r5, #0x4
         bne     wait_dll_lock
         bx      lr
 
+        /* Kick DLL state machine if lock not started */
+kick_dll:
+	ldr     r4, sdrc_dlla_ctrl	/* get dlla addr */
+	ldr     r5, [r4]		/* grab value */
+	mov	r6, r5			/* save value */
+	orr	r6, r6, #0x10		/* dllidle on */
+	str	r6, [r4]
+	dsb
+	bic	r6, #0x10		/* dllidle off */
+	str	r6, [r4]
+	dsb
+	str	r6, [r4]		/* restore old value */
+	b wait_dll_lock_timed
+
 cm_idlest1_core:
 	.word	CM_IDLEST1_CORE_V
 sdrc_dlla_status:
-- 
1.6.3.2


  reply	other threads:[~2009-06-15 22:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 22:42 [PATCH -pm 0/2] SDRC tweaks for stuck DLL state machine Kevin Hilman
2009-06-15 22:42 ` Kevin Hilman [this message]
2009-06-15 22:42   ` [PATCH -pm 2/2] SDRC: whitespace cleanups in DLL lock code Kevin Hilman
2009-06-17  8:04   ` [PATCH -pm 1/2] SDRC: check for stuck DLL state machine and kick Paul Walmsley
2009-06-18  0:04     ` Woodruff, Richard
2009-06-18 15:03       ` Kevin Hilman
2009-06-18 19:21         ` Woodruff, Richard
2009-06-18 21:06       ` Paul Walmsley
2009-06-20  1:42         ` Woodruff, Richard
2009-06-23 20:05           ` Paul Walmsley
2009-06-23 20:11             ` Woodruff, Richard
2009-06-26  8:45               ` Paul Walmsley
2009-06-26 16:07                 ` Woodruff, Richard
     [not found]   ` <8bb80c380906181142m54f543c2v626849983f4507b4@mail.gmail.com>
2009-06-18 18:55     ` Woodruff, Richard
2009-06-18 19:27       ` Wang Sawsd-A24013
2009-06-18 19:32         ` Woodruff, Richard

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=1245105775-28844-2-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mikechan@google.com \
    --cc=r-woodruff2@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.