diff options
author | Suzuki Poulose <suzuki@in.ibm.com> | 2011-12-14 17:59:24 -0500 |
---|---|---|
committer | Josh Boyer <jwboyer@gmail.com> | 2011-12-20 10:21:57 -0500 |
commit | 26ecb6c44bb33afc62905ba01b636dde70fc2dc6 (patch) | |
tree | 1e2a12510dcc81b40705ed04a1f4e1470856b041 /arch/powerpc/Kconfig | |
parent | 368ff8f14d6ed8e9fd3b7c2156f2607719bf5a7a (diff) |
powerpc/44x: Enable CONFIG_RELOCATABLE for PPC44x
The following patch adds relocatable kernel support - based on processing
of dynamic relocations - for PPC44x kernel.
We find the runtime address of _stext and relocate ourselves based
on the following calculation.
virtual_base = ALIGN(KERNELBASE,256M) +
MODULO(_stext.run,256M)
relocate() is called with the Effective Virtual Base Address (as
shown below)
| Phys. Addr| Virt. Addr |
Page (256M) |------------------------|
Boundary | | |
| | |
| | |
Kernel Load |___________|_ __ _ _ _ _|<- Effective
Addr(_stext)| | ^ |Virt. Base Addr
| | | |
| | | |
| |reloc_offset|
| | | |
| | | |
| |______v_____|<-(KERNELBASE)%256M
| | |
| | |
| | |
Page(256M) |-----------|------------|
Boundary | | |
The virt_phys_offset is updated accordingly, i.e,
virt_phys_offset = effective. kernel virt base - kernstart_addr
I have tested the patches on 440x platforms only. However this should
work fine for PPC_47x also, as we only depend on the runtime address
and the current TLB XLAT entry for the startup code, which is available
in r25. I don't have access to a 47x board yet. So, it would be great if
somebody could test this on 47x.
Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Cc: Josh Boyer <jwboyer@gmail.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Diffstat (limited to 'arch/powerpc/Kconfig')
-rw-r--r-- | arch/powerpc/Kconfig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 2ad5ea827820..1703509649b0 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -851,7 +851,7 @@ config DYNAMIC_MEMSTART | |||
851 | 851 | ||
852 | config RELOCATABLE | 852 | config RELOCATABLE |
853 | bool "Build a relocatable kernel (EXPERIMENTAL)" | 853 | bool "Build a relocatable kernel (EXPERIMENTAL)" |
854 | depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM | 854 | depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && 44x |
855 | select NONSTATIC_KERNEL | 855 | select NONSTATIC_KERNEL |
856 | help | 856 | help |
857 | This builds a kernel image that is capable of running at the | 857 | This builds a kernel image that is capable of running at the |