Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

View: New views
5 Messages — Rating Filter:   Alert me  

Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

by vneethv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to port linux on IBM powerpc-440x5. I have this board which has this processor, a 16MB SRAM sits on location 0x0, uart and a flash.I have a simple bootloader which does the following.
    1. Initialize the processor (as part of it, we Generates the tlbs for UART,16MB flash,16MB SRAM)
    2. Initialize the UART
    3. Copy the simple-boot linux_image (binary file) from flash to 0x400000 location of SRAM.
    4. Kernel entry to 0x400000
I also have a device tree structure file (image.dts) which i am passing while generating the linux image.
It all went through and linux got extracted to the 0x0th location of SRAM. and started executing.
(plz find the log below)

it always crashed @ "Unable to handle kernel paging request for data at address 0x0xxxxxxx"
is there anything i have to change in the boot loader or kernel with respect to the MMU initialization ?

in the kernel code @ /arch/powerpc/kernel/head_44x.s; there is a comment saying "its trying to invalidate all the TLB entries except the one it currently working on". Will it make any issues as in our case we have only one TLB for the entire 16MB sram, which will be the current working one..

Can someone suggest us some clue or details on this.

Thanks & Regards,
Vineeth

LINUX BOOT LOG
----------------------------------------------------------------------------------------
Initialized the System
Initialized the UART
Copying Linux Image to RAM > !!!!!!!!!!!!!!!!!!!!!!!!!!!
Copying Image Done
-KERNEL ENTRY-
-
zImage starting: loaded at 0x00400000 (sp: 0x004deeb0)
Allocating 0x1dad84 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040c000:0x004dd3f1)...done 0x1c31cc bytes

Linux/PowerPC load: console=ttyS0 root=/dev/ram
Finalizing device tree... flat tree at 0x4eb300
id mach(): done
inside skybeam_register_console function
MMU:enterMMU:hw initMMU:mapinMMU:setioMMU:exitinside _setup_arch-begininginside _setup_arch-1inside _setup_arch-2setup_arch: bootmemarch: exit<7>Top of RAM: 0x1000000, Total RAM: 0x1000000
Zone PFN ranges:
 DMA      0x00000000 -> 0x00001000
 Normal   0x00001000 -> 0x00001000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
   0: 0x00000000 -> 0x00001000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttyS0 root=/dev/ram
Unable to handle kernel paging request for data at address 0x00021000
Faulting instruction address: 0xc010a7c4
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: c010a7c4 LR: c010dc50 CTR: 00000000
REGS: c01bfeb0 TRAP: 0300   Not tainted  (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24000044  XER: 00000000
DEAR: 00021000, ESR: 00000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00001180 c01bff60 c01a94b8 00021000 00000025 00000008 c0104968 00000000
GPR08: 2f72616d c0110000 c0155938 c01a0000 22000024 00000000 fffff104 00000000
GPR16: 00000000 00000000 00000000 00000000 fffffff8 000008b8 c010d758 c0104968
GPR24: 00001198 00001190 c018a001 c01c5498 000008c0 00001188 00021000 c01c42f0
NIP [c010a7c4] strchr+0x0/0x3c
LR [c010dc50] match_token+0x138/0x228
Call Trace:
[c01bff60] [c016b99c] 0xc016b99c (unreliable)
[c01bffa0] [c0104a00] sort_extable+0x28/0x38
[c01bffb0] [c01938ec] sort_main_extable+0x20/0x30
[c01bffc0] [c018c734] start_kernel+0x140/0x288
[c01bfff0] [c0000200] skpinv+0x190/0x1cc
Instruction dump:
7ca903a6 88040000 38a5ffff 38840001 2f800000 98090000 39290001 419e0010
4200ffe4 98a90000 4e800020 4e800020 <88030000> 5484063e 7f802000 4d9e0020
---[ end trace 31fd0ba7d8756001 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
Call Trace:
[c01bfd90] [c0005d5c] show_stack+0x4c/0x16c (unreliable)
[c01bfdd0] [c002f17c] panic+0xa0/0x168
[c01bfe20] [c0032eb8] do_exit+0x61c/0x638
[c01bfe60] [c000b60c] kernel_bad_stack+0x0/0x4c
[c01bfe90] [c000f310] bad_page_fault+0x90/0xd8
[c01bfea0] [c000e184] handle_page_fault+0x7c/0x80
[c01bff60] [c016b99c] 0xc016b99c
[c01bffa0] [c0104a00] sort_extable+0x28/0x38
[c01bffb0] [c01938ec] sort_main_extable+0x20/0x30
[c01bffc0] [c018c734] start_kernel+0x140/0x288
[c01bfff0] [c0000200] skpinv+0x190/0x1cc
Rebooting in 180 seconds..

Re: Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

by nilwil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This could be a problem with the tool chain/kernel configuration you are using. What versions and configurations are you using for the tools and kernel?

Re: Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

by vneethv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Please find the crosstool.config.txt file info below. And the kernel configuration file (".config") is attached.

AR=
BINUTILS_DIR=binutils-2.16.1
BINUTILS_EXTRA_CONFIG=
BUILD=x86_64-unknown-linux-gnu
BUILD_DIR=/home/sumesh/crosstool-0.43/build/powerpc-440-linux-gnu/gcc-4.2.4-glibc-2.3.6
CC=
DEJAGNU=
EXTRA_TARGET_CFLAGS=
GCC_BUILD=
GCC_CORE_DIR=gcc-3.4.6
GCC_DIR=gcc-4.2.4
GCC_EXTRA_CONFIG=--with-cpu=440 --enable-cxx-flags=-mcpu=440
GCC_HOST=
GCC_LANGUAGES=c,c++
GDB_DIR=gdb-6.5
GLIBC_ADDON_OPTIONS==linuxthreads,
GLIBC_DIR=glibc-2.3.6
GLIBC_EXTRA_CC_ARGS=
GLIBC_EXTRA_CONFIG=--without-fp
GLIBC_EXTRA_ENV=
JUST_DOWNLOAD=
KERNELCONFIG=
LINUX_DIR=linux-2.6.15.4
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
NO_DOWNLOAD=
PREFIX=/opt/crosstool/gcc-4.2.4-glibc-2.3.6/powerpc-440-linux-gnu
PTXDIST_DIR=
SHARED_MODE=--enable-shared
SRC_DIR=/home/sumesh/crosstool-0.43/build/powerpc-440-linux-gnu/gcc-4.2.4-glibc-2.3.6
TARBALLS_DIR=/home/sky/downloads
TARGET=powerpc-440-linux-gnu
TARGET_CFLAGS=-O -mcpu=440
TOP_DIR=/home/sumesh/crosstool-0.43
USE_SYSROOT=

Please tell me if i am missing smthing in this.

Thanks,
Vineeth.config

nilwil wrote:
This could be a problem with the tool chain/kernel configuration you are using. What versions and configurations are you using for the tools and kernel?

Re: Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

by nilwil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The crosstool config says LINUX_DIR=linux-2.6.15.4, while the kernel config says 2.6.30. Assuming you are using the right kernel image, the reason I could see is having insufficient RAM.

How much RAM do you have? A typical Linux image (uncompressed) will take at least 1-2MB space. If you can't provide enough RAM for this, you might want to configure XIP (execute in place), to run the kernel from flash. However, this might require writing a flash driver for your NAND/NOR chip.


Re: Problem with linux kernal Booting on ppc440x5 processor & SRAM Memory

by vneethv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

we have 16MB of SRAM from location 0x0 till 0x0FFFFFF. In this we r using the last 1 MB for the Simple bootloader to execute. We created a TLB for the entire 16Mb RAM while initializing the processor (from our simple bootloader.)i hope this is enough memory to boot linux.

We tried changing the configuration of the crosstool and found its crashing at the same level again..please find the log below. We are diggin more now on the reason for DEAR and MSR having the same value.


Bootloader : Initialized the System
Bootloader : Initialized the UART
Bootloader : Copying Linux Image to RAM
Bootloader : !!!!!!!!!!!!!!!!!!!!!!!!!!!
Bootloader : Copying Image from FLASH to 0x400000 of SRAM is Done
Bootloader : -KENTRY -

zImage starting: loaded at 0x00400000 (sp: 0x004deeb0)
Allocating 0x1dad84 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040c000:0x004dd407)...done 0x1c31cc bytes

Linux/PowerPC load: console=ttyS0 root=/dev/ram
Finalizing device tree... flat tree at 0x4eb300
inside _setup_arch-begininginside _setup_arch-1inside skybeam_register_console function
oodikkooo...inside _setup_arch-2<7>Top of RAM: 0x1a00000, Total RAM: 0x1a00000
Zone PFN ranges:
  DMA      0x00000000 -> 0x00001a00
  Normal   0x00001a00 -> 0x00001a00
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00001a00
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 6604
Kernel command line: console=ttyS0 root=/dev/ram
Unable to handle kernel paging request for data at address 0x00021000
Faulting instruction address: 0xc010a7a4
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: c010a7a4 LR: c010dc30 CTR: 00000000
REGS: c01bfeb0 TRAP: 0300   Not tainted  (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24000044  XER: 00000000
DEAR: 00021000, ESR: 00000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00001180 c01bff60 c01a94b8 00021000 00000025 00000008 c0104948 00000000
GPR08: 2f72616d c0110000 c0155920 c01a0000 22000024 00000000 fffff104 00000000
GPR16: 00000000 00000000 00000000 00000000 fffffff8 000008b8 c010d738 c0104948
GPR24: 00001198 00001190 c018a001 c01c5498 000008c0 00001188 00021000 c01c42f0
NIP [c010a7a4] strchr+0x0/0x3c
LR [c010dc30] match_token+0x138/0x228
Call Trace:
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Oops: Kernel access of bad area, sig: 11 [#2]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: 00000008 LR: 00000009 CTR: c010ca04
REGS: c01bfa50 TRAP: 0400   Not tainted  (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24004042  XER: 00000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00000009 c01bfb00 c01a94b8 00000000 c01bfaf8 00000010 c01bfaf8 c01bfb7c
GPR08: ffffffff c01c628c ffffffff c01bfb00 24004048 00000000 c0152754 c0152838
GPR16: c0152604 c01528c4 c01bfc70 ffffffff c01b8628 c005bd94 00000004 c01c628c
GPR24: c01bfdb8 00000000 c016b96c c01bfb7c c01bfb10 c005be3c 00000010 c01c628c
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Recursive die() failure, output suppressed
---[ end trace 31fd0ba7d8756001 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
Call Trace:
[c01bf510] [c0005d5c] show_stack+0x4c/0x16c (unreliable)
[c01bf550] [c002f15c] panic+0xa0/0x168
[c01bf5a0] [c0032e98] do_exit+0x61c/0x638
[c01bf5e0] [c000b60c] kernel_bad_stack+0x0/0x4c
[c01bf610] [c000f310] bad_page_fault+0x90/0xd8
[c01bf620] [c000e184] handle_page_fault+0x7c/0x80
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Oops: Kernel access of bad area, sig: 11 [#3]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: 00000008 LR: 00000009 CTR: c010ca04
REGS: c01bf170 TRAP: 0400   Tainted: G      D     (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24004042  XER: 20000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00000009 c01bf220 c01a94b8 00000000 c01bf218 00000010 c01bf218 c01bf29c
GPR08: ffffffff c01c628c ffffffff c01bf220 24004048 00000000 c0152754 c0152838
GPR16: c0152604 c01528c4 c01bf390 ffffffff c01b8628 c005bd94 0000007c c01c628c
GPR24: c01bf4d8 00000000 00000009 c01bf29c c01bf230 c005be3c 00000010 c01c628c
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Oops: Kernel access of bad area, sig: 11 [#4]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: 00000008 LR: 00000009 CTR: c010ca04
REGS: c01bed50 TRAP: 0400   Tainted: G      D     (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24004042  XER: 20000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00000009 c01bee00 c01a94b8 00000000 c01bedf8 00000010 c01bedf8 c01bee7c
GPR08: ffffffff c01c628c ffffffff c01bee00 24004048 00000000 c0152754 c0152838
GPR16: c0152604 c01528c4 c01bef70 ffffffff c01b8628 c005bd94 00000000 c01c628c
GPR24: c01bf0b8 00000000 00000008 c01bee7c c01bee10 c005be3c 00000010 c01c628c
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Recursive die() failure, output suppressed
---[ end trace 31fd0ba7d8756002 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
Call Trace:
[c01be810] [c0005d5c] show_stack+0x4c/0x16c (unreliable)
[c01be850] [c002f15c] panic+0xa0/0x168
[c01be8a0] [c0032e98] do_exit+0x61c/0x638
[c01be8e0] [c000b60c] kernel_bad_stack+0x0/0x4c
[c01be910] [c000f310] bad_page_fault+0x90/0xd8
[c01be920] [c000e184] handle_page_fault+0x7c/0x80
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Oops: Kernel access of bad area, sig: 11 [#5]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: 00000008 LR: 00000009 CTR: c010ca04
REGS: c01be470 TRAP: 0400   Tainted: G      D     (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24004042  XER: 20000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00000009 c01be520 c01a94b8 00000000 c01be518 00000010 c01be518 c01be59c
GPR08: ffffffff c01c628c ffffffff c01be520 24004048 00000000 c0152754 c0152838
GPR16: c0152604 c01528c4 c01be690 ffffffff c01b8628 c005bd94 0000007c c01c628c
GPR24: c01be7d8 00000000 00000009 c01be59c c01be530 c005be3c 00000010 c01c628c
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Oops: Kernel access of bad area, sig: 11 [#6]
PREEMPT PowerPC 44x Platform
Modules linked in:
NIP: 00000008 LR: 00000009 CTR: c010ca04
REGS: c01be050 TRAP: 0400   Tainted: G      D     (2.6.30)
MSR: 00021000 <ME,CE>  CR: 24004042  XER: 20000000
TASK = c01a94b8[0] 'swapper' THREAD: c01be000
GPR00: 00000009 c01be100 c01a94b8 00000000 c01be0f8 00000010 c01be0f8 c01be17c
GPR08: ffffffff c01c628c ffffffff c01be100 24004048 00000000 c0152754 c0152838
GPR16: c0152604 c01528c4 c01be270 ffffffff c01b8628 c005bd94 00000000 c01c628c
GPR24: c01be3b8 00000000 00000008 c01be17c c01be110 c005be3c 00000010 c01c628c
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000008
Recursive die() failure, output suppressed
Kernel panic - not syncing: Fatal exception in interrupt
Call Trace:
Rebooting in 180 seconds..
/**************NEW LOG ****************************************/
Thanks & Regards
Vineeth V



nilwil wrote:
The crosstool config says LINUX_DIR=linux-2.6.15.4, while the kernel config says 2.6.30. Assuming you are using the right kernel image, the reason I could see is having insufficient RAM.

How much RAM do you have? A typical Linux image (uncompressed) will take at least 1-2MB space. If you can't provide enough RAM for this, you might want to configure XIP (execute in place), to run the kernel from flash. However, this might require writing a flash driver for your NAND/NOR chip.