All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code at runtime
Date: Wed, 14 Nov 2007 01:30:10 -0700	[thread overview]
Message-ID: <20071114083010.938764990@pwsan.com> (raw)


Several SRAM-based assembly-language routines in the Linux OMAP kernel
use hardcoded virtual addresses to access system registers.  These
addresses were defined at compile-time by the preprocessor, since the
same registers often appeared at different virtual addresses
depending upon the target OMAP architecture.  Hardcoding the addresses
is efficient and convenient to implement; but precludes a single kernel
binary image from supporting multiple OMAP architectures.

This patches implement a different approach.  They patch in the
correct register addresses at runtime into the SRAM, just after the
code is copied there.  While the current code simply writes in the
preprocessor-defined address bases, a forthcoming patch series uses
this code to write runtime-computed address bases.

The code that does the patching is quite paranoid by default, and will
refuse to overwrite any address that does not contain a magic number,
SRAM_VA_MAGIC.  It also contains debugging printks which can be
activated by defining the DEBUG symbol in sram.c and compiling with
CONFIG_DEBUG_LL enabled.

Boot-tested on N800 and 3430SDP.  If someone out there with a 2430SDP
can give these a whirl, that would be appreciated.  Comments welcome,


- Paul

---

diffstat: 

 arch/arm/mach-omap2/pm.c         |   13 +++
 arch/arm/mach-omap2/sdrc.h       |    2
 arch/arm/mach-omap2/sleep.S      |   21 +++---
 arch/arm/mach-omap2/sram-fn.S    |  125 +++++++++++++++++++-----------------
 arch/arm/plat-omap/Kconfig       |   10 ++
 arch/arm/plat-omap/sram.c        |  135 +++++++++++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/sram.h |    3
 include/linux/poison.h           |    6 +
 8 files changed, 245 insertions(+), 70 deletions(-)

size:

   text    data     bss     dec     hex filename
2924328  152944   85112 3162384  304110 vmlinux.orig.n800
2924504  152944   85112 3162560  3041c0 vmlinux.patched.nodebug.n800
2924928  152944   85112 3162984  304368 vmlinux.patched.debug.n800

             reply	other threads:[~2007-11-14  8:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14  8:30 Paul Walmsley [this message]
2007-11-14  8:30 ` [PATCH 1/5] SRAM patcher: add SRAM virtual address patcher Paul Walmsley
2007-11-14  8:30 ` [PATCH 2/5] SRAM patcher: convert omap24xx_sram_suspend to use runtime SRAM patcher Paul Walmsley
2007-11-14  8:30 ` [PATCH 3/5] SRAM patcher: convert sram_ddr_init " Paul Walmsley
2007-11-14  8:30 ` [PATCH 4/5] SRAM patcher: convert sram_reprogram_sdrc " Paul Walmsley
2007-11-14  8:30 ` [PATCH 5/5] SRAM patcher: convert omap2_set_prcm " Paul Walmsley
2007-11-14 17:38 ` [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code at runtime Kevin Hilman
2007-11-14 19:12 ` [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code atruntime Woodruff, Richard
2007-11-16 19:33   ` Paul Walmsley
2007-11-16 19:42     ` Woodruff, Richard
2007-11-16 22:35       ` Tony Lindgren
2007-11-19 19:11       ` [PATCH] flush I-cache after omap_sram_push() Paul Walmsley
2007-11-20 16:14         ` Woodruff, Richard
2007-11-23 21:15           ` 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=20071114083010.938764990@pwsan.com \
    --to=paul@pwsan.com \
    --cc=linux-omap-open-source@linux.omap.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.