SRAM patcher: patch register addresses in SRAM code at runtime
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | SRAM patcher: add SRAM virtual address patcherarch/ arch/ include/ +1 more | +80 | 0 replies | |
| 2/5 | SRAM patcher: convert omap24xx_sram_suspend to use runtime SRAM patcherarch/ arch/ | +24 | 0 replies | |
| 3/5 | SRAM patcher: convert sram_ddr_init to use runtime SRAM patcherarch/ arch/ | +44 | 0 replies | |
| 4/5 | SRAM patcher: convert sram_reprogram_sdrc to use runtime SRAM patcherarch/ arch/ arch/ | +44 | 0 replies | |
| 5/5 | SRAM patcher: convert omap2_set_prcm to use runtime SRAM patcherarch/ arch/ | +53 | 0 replies |
Reviews trailers per patch
None of the 5 patches has a Reviewed-by or Acked-by.
| Patch | Richard Woodruff |
|---|---|
| Series | Signedoff-by |
| 1/5 | |
| 2/5 | |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/5] SRAM patcher: patch register addresses in SRAM code at runtime
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