summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/setup.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-02-08 16:41:38 +0100
committerMichal Simek <monstr@monstr.eu>2012-03-23 09:28:18 +0100
commit95b0f9ea66661681f6ae081ea28416744d622c07 (patch)
treec4d387b9e4a5add47945be3036c7e5682ea5330c /arch/microblaze/kernel/setup.c
parent3a1d26769f61fe8a1f517a66dfcee935a76fd61c (diff)
downloadlinux-95b0f9ea66661681f6ae081ea28416744d622c07.tar.bz2
microblaze: Improve TLB calculation for small systems
Systems with small amount of memory need to be handled differently. Linux can't allocate the whole 32MB with two TLBs because then there is no MMU protection. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/setup.c')
-rw-r--r--arch/microblaze/kernel/setup.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 604cd9dd1333..a1fa2a5813bf 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -97,8 +97,11 @@ inline unsigned get_romfs_len(unsigned *addr)
}
#endif /* CONFIG_MTD_UCLINUX_EBSS */
+unsigned long kernel_tlb;
+
void __init machine_early_init(const char *cmdline, unsigned int ram,
- unsigned int fdt, unsigned int msr)
+ unsigned int fdt, unsigned int msr, unsigned int tlb0,
+ unsigned int tlb1)
{
unsigned long *src, *dst;
unsigned int offset = 0;
@@ -145,6 +148,12 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
setup_early_printk(NULL);
#endif
+ /* setup kernel_tlb after BSS cleaning
+ * Maybe worth to move to asm code */
+ kernel_tlb = tlb0 + tlb1;
+ /* printk("TLB1 0x%08x, TLB0 0x%08x, tlb 0x%x\n", tlb0,
+ tlb1, kernel_tlb); */
+
printk("Ramdisk addr 0x%08x, ", ram);
if (fdt)
printk("FDT at 0x%08x\n", fdt);