public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code at runtime
@ 2007-11-14  8:30 Paul Walmsley
  2007-11-14  8:30 ` [PATCH 1/5] SRAM patcher: add SRAM virtual address patcher Paul Walmsley
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Paul Walmsley @ 2007-11-14  8:30 UTC (permalink / raw)
  To: linux-omap-open-source


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-23 21:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14  8:30 [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code at runtime Paul Walmsley
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox