From: Suzuki Poulose Date: Wed, 14 Dec 2011 22:57:57 +0000 (+0000) Subject: powerpc/44x: Enable DYNAMIC_MEMSTART for 440x X-Git-Tag: next-20111221~86^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=239132454583d474932d8835f87a244f6f1bff9e;p=karo-tx-linux.git powerpc/44x: Enable DYNAMIC_MEMSTART for 440x DYNAMIC_MEMSTART(old RELOCATABLE) was restricted only to PPC_47x variants of 44x. This patch enables DYNAMIC_MEMSTART for 440x based chipsets. Signed-off-by: Suzuki K. Poulose Cc: Josh Boyer Cc: Kumar Gala Cc: Benjamin Herrenschmidt Cc: linux ppc dev Signed-off-by: Josh Boyer --- diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 6c8475692322..8b323b7b0a61 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -833,7 +833,7 @@ config LOWMEM_CAM_NUM config DYNAMIC_MEMSTART bool "Enable page aligned dynamic load address for kernel (EXPERIMENTAL)" - depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && (FSL_BOOKE || PPC_47x) + depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && (FSL_BOOKE || 44x) select NONSTATIC_KERNEL help This option enables the kernel to be loaded at any page aligned diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S index d7a1debda10b..0878bf5d8a68 100644 --- a/arch/powerpc/kernel/head_44x.S +++ b/arch/powerpc/kernel/head_44x.S @@ -804,12 +804,24 @@ skpinv: addi r4,r4,1 /* Increment */ /* * Configure and load pinned entry into TLB slot 63. */ +#ifdef CONFIG_DYNAMIC_MEMSTART + + /* Read the XLAT entry for our current mapping */ + tlbre r25,r23,PPC44x_TLB_XLAT + + lis r3,KERNELBASE@h + ori r3,r3,KERNELBASE@l + + /* Use our current RPN entry */ + mr r4,r25 +#else lis r3,PAGE_OFFSET@h ori r3,r3,PAGE_OFFSET@l /* Kernel is at the base of RAM */ li r4, 0 /* Load the kernel physical address */ +#endif /* Load the kernel PID = 0 */ li r0,0