[U-Boot] [PATCH] malta: define CONFIG_MEMSIZE_IN_BYTES
Paul Burton
paul.burton at imgtec.com
Thu Oct 24 16:24:22 CEST 2013
On 24/10/13 13:32, Gabor Juhos wrote:
> The memsize environment variable must contain the
> memory size in bytes on the Malta board. Otherwise
> Linux will use wrong memory size which causes a kernel
> panic.
>
> Define CONFIG_MEMSIZE_IN_BYTES in malta.h to avoid
> that.
>
> Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
> Cc: Daniel Schwierzeck <daniel.schwierzeck at googlemail.com>
> Cc: Paul Burton <paul.burton at imgtec.com>
> ---
> Note:
>
> The patch depends on Paul's 'MIPS Malta board support' series.
> If we want to fix the problem before his patches will be merged,
> I will send a different patch.
>
> -Gabor
>
> For the record, the kernel panic looks like this:
>
> qemu-malta # setenv ipaddr 10.0.2.1
> qemu-malta # setenv serverip 10.0.2.2
> qemu-malta # setenv ethadd 00:11:22:33:44:55
> qemu-malta # tftp 0xa1000000 openwrt-malta-be-uImage-gzip
> Using pcnet#0 device
> TFTP from server 10.0.2.2; our IP address is 10.0.2.1
> Filename 'openwrt-malta-be-uImage-gzip'.
> Load address: 0xa1000000
> Loading:
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> #######################################################
> 45.2 MiB/s
> done
> Bytes transferred = 2940191 (2cdd1f hex)
> qemu-malta # bootm
> ## Current stack ends at 0x8ff83a38
> ## Booting kernel from Legacy Image at a1000000 ...
> Image Name: MIPS OpenWrt Linux-3.8.13
> Image Type: MIPS Linux Kernel Image (gzip compressed)
> Data Size: 2940127 Bytes = 2.8 MiB
> Load Address: 80100000
> Entry Point: 80104a90
> Verifying Checksum ... OK
> Uncompressing Kernel Image ... OK
> ## Giving linux memsize in MB, 256
> ## Transferring control to Linux (at address 80104a90) ...
>
> Starting kernel ...
>
> [ 0.000000] Linux version 3.8.13 (juhosg at mag2) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #1 SMP Wed May 22 14:28:37 CEST 2013
> [ 0.000000] Config serial console: console=ttyS0,38400n8r
> [ 0.000000] bootconsole [early0] enabled
> [ 0.000000] CPU revision is: 00019300 (MIPS 24Kc)
> [ 0.000000] FPU revision is: 00739300
> [ 0.000000] Determined physical RAM map:
> [ 0.000000] memory: 00001000 @ 00000000 (reserved)
> [ 0.000000] memory: 000ef000 @ 00001000 (ROM data)
> [ 0.000000] memory: 00676000 @ 000f0000 (reserved)
> [ 0.000000] memory: ff899100 @ 00766000 (usable)
> [ 0.000000] Wasting 60608 bytes for tracking 1894 unused pages
> [ 0.000000] Initrd not found or empty - disabling initrd
> [ 0.000000] Zone ranges:
> [ 0.000000] DMA [mem 0x00000000-0x00ffffff]
> [ 0.000000] Normal [mem 0x01000000-0x1fffffff]
> [ 0.000000] Movable zone start for each node
> [ 0.000000] Early memory node ranges
> [ 0.000000] node 0: [mem 0x00000000-0x1fffffff]
> [ 0.000000] Primary instruction cache 2kB, VIPT, 2-way, linesize 16 bytes.
> [ 0.000000] Primary data cache 2kB, 2-way, VIPT, no aliases, linesize 16 bytes
> [ 0.000000] PERCPU: Embedded 7 pages/cpu @81404000 s6464 r8192 d14016 u32768
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
> [ 0.000000] Kernel command line: console=ttyS0,38400n8r
> [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
> [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
> [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
> [ 0.000000] __ex_table already sorted, skipping sort
> [ 0.000000] Writing ErrCtl register=00000000
> [ 0.000000] Readback ErrCtl register=00000000
> [ 0.000000] Memory: 512156k/516712k available (2519k kernel code, 4556k reserved, 622k data, 3320k init, 0k highmem)
> [ 0.000000] CPU 0 Unable to handle kernel paging request at virtual address 00000004, epc == 8019c018, ra == 8019bec0
> [ 0.000000] Oops[#1]:
> [ 0.000000] Cpu 0
> [ 0.000000] $ 0 : 00000000 00000030 00000000 00000000
> [ 0.000000] $ 4 : 80407174 00100100 00000000 803ffe54
> [ 0.000000] $ 8 : 00000001 81404a54 803ffe54 00000000
> [ 0.000000] $12 : 80401a2c 00000000 00000019 00000000
> [ 0.000000] $16 : 80407100 9f801000 80407164 8043e340
> [ 0.000000] $20 : ffffffff ffffffff 00008000 8043e350
> [ 0.000000] $24 : 00000003 80401be4
> [ 0.000000] $28 : 803f0000 803f1e10 80760000 8019bec0
> [ 0.000000] Hi : 00000050
> [ 0.000000] Lo : 005214c3
> [ 0.000000] epc : 8019c018 cache_alloc_refill+0x1e4/0x698
> [ 0.000000] Not tainted
> [ 0.000000] ra : 8019bec0 cache_alloc_refill+0x8c/0x698
> [ 0.000000] Status: 10000002 KERNEL EXL
> [ 0.000000] Cause : 4080840c
> [ 0.000000] BadVA : 00000004
> [ 0.000000] PrId : 00019300 (MIPS 24Kc)
> [ 0.000000] Modules linked in:
> [ 0.000000] Process swapper (pid: 0, threadinfo=803f0000, task=80402458, tls=00000000)
> [ 0.000000] Stack : 8075b03e 00000000 00000001 00000000 00000000 8043e364 00000080 00000006
> 8043e3ec 00000000 80407100 00008000 80400000 8043e340 80440000 80440000
> a12cdd1f 8019c6b8 000011cc 80760000 80760000 80760000 80407100 8043e3ec
> 803ad668 00000020 00002000 8041f098 00000000 00000000 803a6170 803f1ea4
> 803f1ea4 8043e3ec 80760000 80440000 8040704c 80420e0c 0007e268 000009d7
> ...
> [ 0.000000] Call Trace:
> [ 0.000000] [<8019c018>] cache_alloc_refill+0x1e4/0x698
> [ 0.000000] [<8019c6b8>] kmem_cache_alloc+0x98/0x108
> [ 0.000000] [<8041f098>] create_kmalloc_cache+0x34/0xa8
> [ 0.000000] [<80420e0c>] kmem_cache_init+0x124/0x2c4
> [ 0.000000] [<8041274c>] start_kernel+0x1c4/0x3b8
> [ 0.000000]
> [ 0.000000]
> Code: 8e230000 3c050010 34a50100 <ac620004> ac430000 8e230014 3c020020 24420200 ae220004
> [ 0.000000] ---[ end trace 139ce121c98e96c9 ]---
> [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
> qemu: terminating on signal 15 from pid 4169
> ---
> include/configs/malta.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/configs/malta.h b/include/configs/malta.h
> index 19acf3a..a4370ae 100644
> --- a/include/configs/malta.h
> +++ b/include/configs/malta.h
> @@ -15,6 +15,8 @@
> */
> #define CONFIG_MALTA
>
> +#define CONFIG_MEMSIZE_IN_BYTES
> +
> #define CONFIG_PCI
> #define CONFIG_PCI_GT64120
> #define CONFIG_PCI_MSC01
>
Yup, looks good to me :)
Paul
More information about the U-Boot
mailing list