public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Paul Walmsley <paul@pwsan.com>,
	Richard Woodruff <r-woodruff2@ti.com>
Subject: [PATCH 02/10] OMAP3 SRAM: add ARM barriers to omap3_sram_configure_core_dpll
Date: Tue, 12 May 2009 18:05:16 -0600	[thread overview]
Message-ID: <20090513000515.10349.36000.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090512235713.10349.49339.stgit@localhost.localdomain>

Add more barriers in the SRAM CORE DPLL M2 divider change code.

- Add a DSB SY after the function's entry point to flush all cached
  and buffered writes and wait for the interconnect to claim that they
  have completed[1].  The idea here is to force all delayed write
  traffic going to the SDRAM to at least post to the L3 interconnect
  before continuing.  If these writes are allowed to occur after the
  SDRC is idled, the writes will not be acknowledged and the ARM will
  stall.

  Note that in this case, it does not matter if the writes actually
  complete to the SDRAM - it is only necessary for the writes to leave
  the ARM itself.  If the writes are posted by the interconnect when
  the SDRC goes into idle, the writes will be delayed until the SDRC
  returns from idle[2].  If the SDRC is in the middle of a write when
  it is requested to enter idle, the SDRC will not acknowledge the
  idle request until the writes complete to the SDRAM.[3]

  The old-style DMB in sdram_in_selfrefresh is now superfluous, so,
  remove it.

- Add an ISB before the function's exit point to prevent the ARM from
  speculatively executing into SDRAM before the SDRAM is enabled[4].

...

1. ARMv7 ARM (DDI 0406A) A3-47, A3-48.

2. Private communication with Richard Woodruff <r-woodruff2@ti.com>.

3. Private communication with Richard Woodruff <r-woodruff2@ti.com>.

4. ARMv7 ARM (DDI 0406A) A3-48.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
---
 arch/arm/mach-omap2/sram34xx.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 2c71461..f4a356d 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -43,6 +43,7 @@
  */
 ENTRY(omap3_sram_configure_core_dpll)
 	stmfd	sp!, {r1-r12, lr}	@ store regs to stack
+	dsb				@ flush buffered writes to interconnect
 	cmp	r3, #0x2
 	blne	configure_sdrc
 	cmp	r3, #0x2
@@ -58,6 +59,7 @@ ENTRY(omap3_sram_configure_core_dpll)
 	blne	wait_dll_lock
 	cmp	r3, #0x1
 	blne	configure_sdrc
+	isb				@ prevent speculative exec past here
 	mov 	r0, #0 			@ return value
 	ldmfd	sp!, {r1-r12, pc}	@ restore regs and return
 unlock_dll:
@@ -73,8 +75,6 @@ lock_dll:
 	str	r5, [r4]
 	bx	lr
 sdram_in_selfrefresh:
-	mov	r5, #0x0		@ Move 0 to R5
-	mcr	p15, 0, r5, c7, c10, 5	@ memory barrier
 	ldr	r4, omap3_sdrc_power	@ read the SDRC_POWER register
 	ldr	r5, [r4]		@ read the contents of SDRC_POWER
 	orr 	r5, r5, #0x40		@ enable self refresh on idle req



  parent reply	other threads:[~2009-05-13  0:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  0:05 [PATCH 00/10] OMAP clock/SDRC patches on v2.6.30-rc5 Paul Walmsley
2009-05-13  0:05 ` [PATCH 01/10] OMAP3 SRAM: mark OCM RAM as Non-cacheable Normal memory Paul Walmsley
2009-05-13  0:05 ` Paul Walmsley [this message]
2009-05-13  0:05 ` [PATCH 03/10] OMAP3 clock: add interconnect barriers to CORE DPLL M2 change Paul Walmsley
2009-05-13  0:05 ` [PATCH 04/10] OMAP3 SRAM: clear the SDRC PWRENA bit during SDRC frequency change Paul Walmsley
2009-05-13  0:05 ` [PATCH 05/10] OMAP3 SDRC: initialize SDRC_POWER at boot Paul Walmsley
2009-05-13  0:05 ` [PATCH 06/10] OMAP3 SRAM: renumber registers to make space for argument passing Paul Walmsley
2009-05-13  0:05 ` [PATCH 07/10] OMAP3 clock: only unlock SDRC DLL if SDRC clk < 83MHz Paul Walmsley
2009-05-13  0:05 ` [PATCH 08/10] OMAP3 clock: use pr_debug() rather than pr_info() in some clock change code Paul Walmsley
2009-05-13  0:05 ` [PATCH 09/10] OMAP3 clock: lessen amount of noisy messages Paul Walmsley
2009-05-13  0:05 ` [PATCH 10/10] OMAP2xxx clock: rename clk_init_one() to clk_preinit() Paul Walmsley
2009-05-26 16:29 ` [PATCH 00/10] OMAP clock/SDRC patches on v2.6.30-rc5 Paul Walmsley
2009-05-26 16:37   ` Russell King - ARM Linux
2009-05-26 16:51     ` Paul Walmsley
2009-05-26 22:04       ` Tony Lindgren

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=20090513000515.10349.36000.stgit@localhost.localdomain \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox