Skip to contentSkip to conversation

problems to boot 2.6.23 kernel on XILINX ppc with 8Mbytes of RAM

PATCH New manu 3 participants 5 messages Oct 24, 2007 – Oct 27, 2007

lore
Share & tools
lore

manu

author
#0 lore raw

Hello,
I work on a custom board based on a virtex 2 pro FPGA and 8Mbytes of SDRAM. Untill now I used a 2.4.31 linux ppc kernel with John Williams patches and uclinux distribution and everything worked perfectly.
I've decided to move to the latest 2.6 version from kernel.org (2.6.23.1) with an initramfs containing a busybox.
My complete zImage including the initramfs has a size of 900Kbytes. I made some tests with a ML300 board and I managed to get a shell easily. When I migrated to the custom board, I had the "Now booting the kernel" message and then nothing.
When I trace the code running on the ppc with the debugger, execution seems to be stuck in some early initialization code.
I managed to reproduce the problem on the ML300 using "mem=8m" parameter on the bootline.
With "mem=16m" the kernel boots correctly.
I'm really surprised by the amount of RAM required to boot the kernel. Is there a way to make it boot with only 8Mbytes of RAM ? Thanks for your help.

Manu

#1 lore raw

Hello Manu,

Could you try the attached patch to arch/ppc/mm/4xx_mmu.c and see if it solves your problem?

Best regards,
Magnus

Quoted 25 lines · manu

Hello,
I work on a custom board based on a virtex 2 pro FPGA and 8Mbytes of SDRAM. Untill now I used a 2.4.31 linux ppc kernel with John Williams patches and uclinux distribution and everything worked perfectly.
I've decided to move to the latest 2.6 version from kernel.org (2.6.23.1) with an initramfs containing a busybox.
My complete zImage including the initramfs has a size of 900Kbytes. I made some tests with a ML300 board and I managed to get a shell easily. When I migrated to the custom board, I had the "Now booting the kernel" message and then nothing.
When I trace the code running on the ppc with the debugger, execution seems to be stuck in some early initialization code.
I managed to reproduce the problem on the ML300 using "mem=8m" parameter on the bootline.
With "mem=16m" the kernel boots correctly.
I'm really surprised by the amount of RAM required to boot the kernel. Is there a way to make it boot with only 8Mbytes of RAM ? Thanks for your help.

Manu
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 7 lines
Magnus Hjorth, M.Sc.
Omnisys Instruments AB
Gruvgatan 8
SE-421 30  Västra Frölunda, SWEDEN
Phone: +46 31 734 34 09
Fax: +46 31 734 34 29
http://www.omnisys.se 
4xx_mmu.c renamed from 4xx_mmu_old.c +2 -2
@@ -105,7 +105,7 @@
 		return s;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+	while (s + LARGE_PAGE_SIZE_16M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -120,7 +120,7 @@
 		s += LARGE_PAGE_SIZE_16M;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+	while (s + LARGE_PAGE_SIZE_4M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
author
#2 lore raw

Hello Magnus,
your patch solved the problem.
Thank you.

Manu

Quoted 62 lines · Magnus Hjorth

Hello Manu,

Could you try the attached patch to arch/ppc/mm/4xx_mmu.c and see if it solves your problem?

Best regards,
Magnus

Quoted 21 lines · manu

Hello,
I work on a custom board based on a virtex 2 pro FPGA and 8Mbytes of SDRAM.
Untill now I used a 2.4.31 linux ppc kernel with John Williams patches and uclinux distribution and everything worked perfectly. I've decided to move to the latest 2.6 version from kernel.org (2.6.23.1) with an initramfs containing a busybox.
My complete zImage including the initramfs has a size of 900Kbytes. I made some tests with a ML300 board and I managed to get a shell easily.
When I migrated to the custom board, I had the "Now booting the kernel" message and then nothing.
When I trace the code running on the ppc with the debugger, execution seems to be stuck in some early initialization code.
I managed to reproduce the problem on the ML300 using "mem=8m" parameter on the bootline.
With "mem=16m" the kernel boots correctly.
I'm really surprised by the amount of RAM required to boot the kernel. Is there a way to make it boot with only 8Mbytes of RAM ? Thanks for your help.

Quoted 6 lines

Manu
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

------------------------------------------------------------------------

4xx_mmu.c renamed from 4xx_mmu_old.c +2 -2
@@ -105,7 +105,7 @@
 		return s;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+	while (s + LARGE_PAGE_SIZE_16M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -120,7 +120,7 @@
 		s += LARGE_PAGE_SIZE_16M;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+	while (s + LARGE_PAGE_SIZE_4M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
#4 lore raw

PATCH 1/1 ppc4xx: mmu_mapin_ram bugfix for booting with mem<16 MB

From: Magnus Hjorth <[email protected]>

This patch (for 2.6.23.1) fixes an unsigned arithmetic bug causing the kernel to hang when booting with less than 16 MB of memory on ppc4xx.

---

OK, trying to do this by the book now...

arch/ppc/mm/4xx_mmu.c renamed from arch/ppc/mm/4xx_mmu.c.orig +2 -2
@@ -105,7 +105,7 @@ unsigned long __init mmu_mapin_ram(void)
 		return s;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+	while (s + LARGE_PAGE_SIZE_16M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
 
@@ -120,7 +120,7 @@ unsigned long __init mmu_mapin_ram(void)
 		s += LARGE_PAGE_SIZE_16M;
 	}
 
-	while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+	while (s + LARGE_PAGE_SIZE_4M <= total_lowmem) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;