当前位置: 技术问答>linux和unix
怎样为driver预留内存?
来源: 互联网 发布时间:2016-11-08
本文导语: 本意是想预留一部分内存给DMA用 在u-boot环境变量中修改 bootargs,结果启动过程中就报 OOPS 了。 修改前是ok的。 本人新手,请大家多多帮忙啊,多谢多谢! 环境: ppc + u-boot + 2.6.24 => printenv 。。。 bootargs=console=t...
本意是想预留一部分内存给DMA用
在u-boot环境变量中修改 bootargs,结果启动过程中就报 OOPS 了。
修改前是ok的。
本人新手,请大家多多帮忙啊,多谢多谢!
环境: ppc + u-boot + 2.6.24
=> printenv
。。。
bootargs=console=ttyS0,115200 console=tty0 root=/dev/ram rw
。。。
=> setenv bootargs console=ttyS0,115200 console=tty0 root=/dev/ram rw mem=92M
=> saveenv
重启
[ 0.000000] mem_pieces_remove: [7b34000,7f2df94) not in any region
[ 0.000000] Linux version 2.6.24.2 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)) #9 Wed Dec 8 15:37:24 CST 2010
[ 0.000000] TCR i= c2000000
[ 0.000000] serio setup, c0 = 3a19cc, c1= 3a19cc, c2= 3a19cc,c3= 3a19cc
[ 0.000000] AMCC PowerPC 440EP Yosemite Platform
[ 0.000000] Zone PFN ranges:
[ 0.000000] DMA 0 -> 23552
[ 0.000000] Normal 23552 -> 23552
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[1] active PFN ranges
[ 0.000000] 0: 0 -> 23552
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 23368
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/ram rw mem=92M
[ 0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[ 0.000032] console [ttyS0] enabled
[ 0.080174] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.087516] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.104067] Memory: 90916k available (1684k kernel code, 572k data, 124k init, 0k highmem)
[ 0.212119] Mount-cache hash table entries: 512
[ 0.217710] net_namespace: 64 bytes
[ 0.222996] NET: Registered protocol family 16
[ 0.228244] PCI: Probing PCI hardware
[ 0.232367] 27,28,29,50,51, idsel=10, pin=1
[ 0.236543] 27,28,29,50,51, idsel=11, pin=1
[ 0.240701] 27,28,29,50,51, idsel=12, pin=1
[ 0.244851] 27,28,29,50,51, idsel=13, pin=1
[ 0.260574] NET: Registered protocol family 2
[ 0.300269] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.308065] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.315063] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.321406] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.327573] TCP reno registered
[ 0.340444] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
[ 1.445917] Freeing initrd memory: 4071k freed
[ 1.450270] Bad page state in process 'swapper'
[ 1.450277] page:c034d780 flags:0x0000003c mapping:c7002ca0 mapcount:0 count:0
[ 1.450287] Trying to fix it up, but a reboot is needed
[ 1.450294] Backtrace:
[ 1.469038] Call Trace:
[ 1.471414] [c5817ec0] [c0008ae8] show_stack+0x48/0x190 (unreliable)
[ 1.477648] [c5817ef0] [c0046a98] bad_page+0x60/0xac
[ 1.482520] [c5817f00] [c00483e8] free_hot_cold_page+0x1ac/0x1b0
[ 1.488393] [c5817f20] [c000a704] free_initrd_mem+0x94/0xbc
[ 1.493845] [c5817f40] [c0220384] free_initrd+0x5c/0x7c
[ 1.498962] [c5817f50] [c0220474] populate_rootfs+0xd0/0x114
[ 1.504498] [c5817f70] [c021a868] kernel_init+0xa4/0x290
[ 1.509707] [c5817ff0] [c0003d9c] kernel_thread+0x48/0x64
[ 1.515016] Bad page state in process 'swapper'
[ 1.515023] page:c034d7a0 flags:0x0000003c mapping:c7002ca0 mapcount:0 count:0
[ 1.515032] Trying to fix it up, but a reboot is needed
[ 1.515039] Backtrace:
[ 1.533785] Call Trace:
[ 1.536167] [c5817ec0] [c0008ae8] show_stack+0x48/0x190 (unreliable)
[ 1.542388] [c5817ef0] [c0046a98] bad_page+0x60/0xac
[ 1.547244] [c5817f00] [c00483e8] free_hot_cold_page+0x1ac/0x1b0
[ 1.553116] [c5817f20] [c000a704] free_initrd_mem+0x94/0xbc
[ 1.558568] [c5817f40] [c0220384] free_initrd+0x5c/0x7c
[ 1.563684] [c5817f50] [c0220474] populate_rootfs+0xd0/0x114
[ 1.569213] [c5817f70] [c021a868] kernel_init+0xa4/0x290
[ 1.574414] [c5817ff0] [c0003d9c] kernel_thread+0x48/0x64
后面就一直循环打印了
是不是还有哪里需要修改的?
在u-boot环境变量中修改 bootargs,结果启动过程中就报 OOPS 了。
修改前是ok的。
本人新手,请大家多多帮忙啊,多谢多谢!
环境: ppc + u-boot + 2.6.24
=> printenv
。。。
bootargs=console=ttyS0,115200 console=tty0 root=/dev/ram rw
。。。
=> setenv bootargs console=ttyS0,115200 console=tty0 root=/dev/ram rw mem=92M
=> saveenv
重启
[ 0.000000] mem_pieces_remove: [7b34000,7f2df94) not in any region
[ 0.000000] Linux version 2.6.24.2 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)) #9 Wed Dec 8 15:37:24 CST 2010
[ 0.000000] TCR i= c2000000
[ 0.000000] serio setup, c0 = 3a19cc, c1= 3a19cc, c2= 3a19cc,c3= 3a19cc
[ 0.000000] AMCC PowerPC 440EP Yosemite Platform
[ 0.000000] Zone PFN ranges:
[ 0.000000] DMA 0 -> 23552
[ 0.000000] Normal 23552 -> 23552
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[1] active PFN ranges
[ 0.000000] 0: 0 -> 23552
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 23368
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/ram rw mem=92M
[ 0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[ 0.000032] console [ttyS0] enabled
[ 0.080174] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.087516] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.104067] Memory: 90916k available (1684k kernel code, 572k data, 124k init, 0k highmem)
[ 0.212119] Mount-cache hash table entries: 512
[ 0.217710] net_namespace: 64 bytes
[ 0.222996] NET: Registered protocol family 16
[ 0.228244] PCI: Probing PCI hardware
[ 0.232367] 27,28,29,50,51, idsel=10, pin=1
[ 0.236543] 27,28,29,50,51, idsel=11, pin=1
[ 0.240701] 27,28,29,50,51, idsel=12, pin=1
[ 0.244851] 27,28,29,50,51, idsel=13, pin=1
[ 0.260574] NET: Registered protocol family 2
[ 0.300269] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.308065] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.315063] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.321406] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.327573] TCP reno registered
[ 0.340444] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
[ 1.445917] Freeing initrd memory: 4071k freed
[ 1.450270] Bad page state in process 'swapper'
[ 1.450277] page:c034d780 flags:0x0000003c mapping:c7002ca0 mapcount:0 count:0
[ 1.450287] Trying to fix it up, but a reboot is needed
[ 1.450294] Backtrace:
[ 1.469038] Call Trace:
[ 1.471414] [c5817ec0] [c0008ae8] show_stack+0x48/0x190 (unreliable)
[ 1.477648] [c5817ef0] [c0046a98] bad_page+0x60/0xac
[ 1.482520] [c5817f00] [c00483e8] free_hot_cold_page+0x1ac/0x1b0
[ 1.488393] [c5817f20] [c000a704] free_initrd_mem+0x94/0xbc
[ 1.493845] [c5817f40] [c0220384] free_initrd+0x5c/0x7c
[ 1.498962] [c5817f50] [c0220474] populate_rootfs+0xd0/0x114
[ 1.504498] [c5817f70] [c021a868] kernel_init+0xa4/0x290
[ 1.509707] [c5817ff0] [c0003d9c] kernel_thread+0x48/0x64
[ 1.515016] Bad page state in process 'swapper'
[ 1.515023] page:c034d7a0 flags:0x0000003c mapping:c7002ca0 mapcount:0 count:0
[ 1.515032] Trying to fix it up, but a reboot is needed
[ 1.515039] Backtrace:
[ 1.533785] Call Trace:
[ 1.536167] [c5817ec0] [c0008ae8] show_stack+0x48/0x190 (unreliable)
[ 1.542388] [c5817ef0] [c0046a98] bad_page+0x60/0xac
[ 1.547244] [c5817f00] [c00483e8] free_hot_cold_page+0x1ac/0x1b0
[ 1.553116] [c5817f20] [c000a704] free_initrd_mem+0x94/0xbc
[ 1.558568] [c5817f40] [c0220384] free_initrd+0x5c/0x7c
[ 1.563684] [c5817f50] [c0220474] populate_rootfs+0xd0/0x114
[ 1.569213] [c5817f70] [c021a868] kernel_init+0xa4/0x290
[ 1.574414] [c5817ff0] [c0003d9c] kernel_thread+0x48/0x64
后面就一直循环打印了
是不是还有哪里需要修改的?
|
预留内存改为mem=64M看下。
|
kernel/u-boot不需要改吧,还有其他的启动参数呢,或许是bootaddr没给对吧