Chinaunix首页 | 论坛 | 博客
  • 博客访问: 120677
  • 博文数量: 17
  • 博客积分: 1450
  • 博客等级: 上尉
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-13 16:45
文章分类

全部博文(17)

文章存档

2011年(2)

2010年(15)

我的朋友

分类: 嵌入式

2011-03-27 21:44:25

内核挂载根文件系统异常
load Image of Linux...Uncompressing Linux.................................................................................................. done, booting the kernel.
Linux version 2.6.32.2 () (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #12 Wed Dec 29 20:48:38 CST 2010
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0006173
CPU: VIVT data cache, VIVT instruction cache
Machine: mini2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache buffered
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61664KB available (2788K code, 321K data, 100K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:85
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 4.22 BogoMIPS (lpj=10560)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
yaffs Dec 25 2010 21:59:59 Installing.
msgmni has been set to 120
alg: No test for stdrng (krng)
io scheduler noop registered (default)
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
loop: module loaded
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
s3c24xx-nand s3c2440-nand: NAND soft ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 375 at 0x000002ee0000
Bad eraseblock 647 at 0x0000050e0000
Bad eraseblock 792 at 0x000006300000
Creating 5 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "supervivi"
0x000000040000-0x000000060000 : "param"
0x000000060000-0x000000560000 : "Kernel"
0x000000560000-0x000008000000 : "root"
0x000000000000-0x000008000000 : "user"
dm9000 Ethernet Driver, V1.31
eth0: dm9000e at c480c300,c4810304 IRQ 51 MAC: 08:90:90:90:90:90 (chip)
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 33
s3c2410-rtc s3c2410-rtc: setting system clock to 2010-12-29 20:50:37 UTC (1293655837)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: auto selecting yaffs2
block 333 is bad
block 605 is bad
block 750 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:3.
Freeing init memory: 100K
Unable to handle kernel paging request at virtual address 72617020
pgd = c3918000
[72617020] *pgd=00000000
Internal error: Oops: 80000005 [#1]
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.32.2 #12)
PC is at 0x72617020
LR is at s3c2410_nand_select_chip+0x70/0xb0
pc : [<72617020>]    lr : []    psr: 20000013
sp : c3823808  ip : c3823828  fp : c3823824
r10: c38239b8  r9 : c385f400  r8 : c385f580
r7 : 00708800  r6 : 00000003  r5 : 00000000  r4 : c3854cc0
r3 : 72617020  r2 : c4c00004  r1 : 00000000  r0 : c001d748
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: c000617b  Table: 33918000  DAC: 00000015
Process linuxrc (pid: 1, stack limit = 0xc3822270)
Stack: (0xc3823808 to 0xc3824000)
3800:                   0000003f 00000001 00000000 00708800 c382389c c3823828
3820: c018d990 c0191d04 fffffff8 00000008 00000000 c385f400 00000000 00000000
3840: 55000000 0000003f 00000800 0000001c 00000000 c3820030 00000000 00000000
3860: 00000000 00000000 00000003 00000000 00000000 c3823948 c3823948 c38aa000
3880: 00000000 c3814000 c385f400 c38239b8 c38238fc c38238a0 c018ddc4 c018d900
38a0: c3823948 00000000 c38238fc c38238b8 00708800 00000000 0000001b c02e4944
38c0: c02e4a54 00000100 00000009 c3822000 0000000a 001a8800 00000000 c38aa000
38e0: 00000000 c3814000 c001d800 c38239b8 c3823924 c3823900 c018752c c018dd50
3900: c3823948 c02e0570 0000001e c38aa000 c38a8580 001a8800 c38239b4 c3823928
3920: c01199f8 c01874c4 c3823948 c3823938 c0040c0c c0040ab4 c3823968 00000351
3940: 00000000 0000001c 00000001 00000800 00000000 0000001c c3823a1c 00000000
3960: c001d800 c38a84c0 00000391 00000040 000003d1 c010e2b8 c39152e4 00000125
3980: c3814000 c39152e4 000002ec c3814000 c38239b8 00000391 00175800 00000000
39a0: 00000800 00000800 c3823a1c c38239b8 c0117d9c c01197b8 aaaaaaaa 00000001
39c0: 00000125 000002eb 00000800 00000001 00000000 00000000 00000000 00001000
39e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 55555555
3a00: c39152e4 c001d800 c39152e4 00175800 c3823a34 c3823a20 c010e54c c0117d5c
3a20: 00000800 c3814000 c3823a7c c3823a38 c0112194 c010e4f4 c3814000 c001d800
3a40: 000002ec 00000800 00000800 00000000 00000174 c001d000 c032c3a0 c39152e4
3a60: c3814000 c02e7b70 0000017d c340909c c3823aac c3823a80 c010bcf0 c0111eb0
3a80: 00001000 c340909c c3823ab4 c032c3a0 c38ff980 c02e7b70 00200200 00100100
3aa0: c3823acc c3823ab0 c010bfa0 c010bc78 c032c3a0 00000008 00000011 00200200
3ac0: c3823b1c c3823ad0 c006f80c c010bf80 00000001 c3823ae8 00000020 c38ff980
3ae0: c3409098 00000011 c032c178 c032c3d8 00000000 c38ff9c0 c3409098 00000000
3b00: c38ff980 0000017d c3823b88 c3409098 c3823b34 c3823b20 c006f8e0 c006f65c
3b20: 00000000 c38b70b0 c3823b74 c3823b38 c00683c0 c006f8c4 c3823b44 000284d0
3b40: c3409000 0000001b c02e4944 00000001 c38b6000 c3918000 c38b70b0 c3823b88
3b60: 00000000 0018d000 c3823bc4 c3823b78 c007ad6c c0068028 c3918000 00000001
3b80: c3918000 c38b6000 00000001 0000017d 0018d000 00000000 c3823bc4 00000001
3ba0: c3918000 c3918000 c3822000 0000018d 00000000 00000000 c3823c2c c3823bc8
3bc0: c007b7f0 c007ad24 0000017d 00000001 00000000 ffffffff f4000000 0018d000
3be0: c38b70b0 c38b6000 00000634 c0021b24 c0021010 c391e180 00000e80 00000000
3c00: 00000000 c38b70b0 c38b6000 0018d9e6 c3820000 c38b6034 00000805 c3823db0
3c20: c3823cdc c3823c30 c0028c08 c007b6fc c0142320 20000013 ffffffff c006d50c
3c40: 00000041 c0067214 ffffffff 00000018 00000000 c02f9944 c02f993c 00000000
3c60: 00000000 00000000 000284d0 00000000 c02f9944 c00a166c 00000000 c02f9f18
3c80: c006d6bc c02f9924 000000f4 000084d0 000084d0 c02f9f14 00000000 00000000
3ca0: c3823ce4 c3823cb0 c0145d6c c01459bc c38b70d4 c02de588 c3823de4 00000805
3cc0: c02de5d8 c3823db0 60000013 0018d9e6 c3823cfc c3823ce0 c0028d84 c0028a74
3ce0: c02de588 c3823de4 00000805 c02de5d8 c3823dac c3823d00 c00212b4 c0028d1c
3d00: c3823d2c c3823d10 c0080568 c007fc70 c38b7070 c00a166c c38b7070 0018d000
3d20: c3823d8c c3823d30 c0081b38 c007f428 c38b7108 c38b6000 c38b7020 c38b7108
3d40: 00100077 001ba000 c3823d6c c3823d58 c00804f4 c0083364 c38b7108 c38b6000
3d60: c3823d8c c3823d70 c0080568 c007fc70 c38b7018 c38b7020 c38b7018 0018e000
3d80: c3823dec c3823d90 ffffffff c3823de4 c38b1200 00000000 c3823f58 001b944c
3da0: c3823e0c c3823db0 c0021ae0 c0021284 0018d9e6 0000061a 00000000 4118dfff
3dc0: 0018d9e6 c38ff700 c38b1200 00000000 c3823f58 001b944c 001b944c c3823e0c
3de0: 00000002 c3823df8 c00c5278 c013ff1c 60000013 ffffffff 0000061a c00c5278
3e00: c3823edc c3823e10 c00c5d90 c00c5230 00001812 00000000 c007c364 c0029404
3e20: c3822000 00000000 00008000 00000000 00000001 00000000 c38b3240 0018d9e6
3e40: c3823ea4 c38b1200 00008000 00184d74 0018d000 0018d9e6 c3823e8c c3823e68
3e60: c007c544 c007c1e4 00000017 c3823ea4 00184d74 c007c4fc 0018d9e6 00000006
3e80: c3823ec4 0018d000 c0093858 c007c4fc 00000001 00000001 c3823ea4 00008000
3ea0: c3823efc c032c400 00000fe1 00000009 00000000 c02e5ab4 c38b1200 fffffff8
3ec0: c02e5718 c3822000 00000000 00000000 c3823f14 c3823ee0 c0093d60 c00c567c
3ee0: c3823f58 c38b1202 c3823f58 00000000 c02de1a0 c38b1200 c02de198 c02de110
3f00: c3823f58 c3822000 c3823f54 c3823f18 c0094f38 c0093cb0 c02f9924 00000000
3f20: c032c400 00000000 00030021 c03b0082 c02de110 c02de198 c3823f58 00000000
3f40: 00000000 00000000 c3823fbc c3823f58 c00254dc c0094ca4 00000000 00000000
3f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fa0: c02de110 c02f9f60 c001bb1c 00000000 c3823fd4 c3823fc0 c00215ec c00254ac
3fc0: c001bd9c c001bd9c c3823ff4 c3823fd8 c00084c4 c00214f0 00000000 00000000
3fe0: 00000000 00000000 00000000 c3823ff8 c003e6a4 c00083e0 33cc33cc 33cc33cc
Backtrace:
[] (s3c2410_nand_select_chip+0x0/0xb0) from [] (nand_do_read_ops+0xa0/0x450)
 r7:00708800 r6:00000000 r5:00000001 r4:0000003f
[] (nand_do_read_ops+0x0/0x450) from [] (nand_read_oob+0x84/0x34c)
[] (nand_read_oob+0x0/0x34c) from [] (part_read_oob+0x78/0xd4)
[] (part_read_oob+0x0/0xd4) from [] (nandmtd2_ReadChunkWithTagsFromNAND+0x250/0x278)
 r6:001a8800 r5:c38a8580 r4:c38aa000
[] (nandmtd2_ReadChunkWithTagsFromNAND+0x0/0x278) from [] (yaffs_ReadChunkWithTagsFromNAND+0x50/0xe8)
[] (yaffs_ReadChunkWithTagsFromNAND+0x0/0xe8) from [] (yaffs_ReadChunkDataFromObject+0x68/0x80)
 r7:00175800 r6:c39152e4 r5:c001d800 r4:c39152e4
[] (yaffs_ReadChunkDataFromObject+0x0/0x80) from [] (yaffs_ReadDataFromFile+0x2f4/0x304)
 r5:c3814000 r4:00000800
[] (yaffs_ReadDataFromFile+0x0/0x304) from [] (yaffs_readpage_nolock+0x88/0x180)
[] (yaffs_readpage_nolock+0x0/0x180) from [] (yaffs_readpage+0x30/0x74)
 r8:00100100 r7:00200200 r6:c02e7b70 r5:c38ff980 r4:c032c3a0
[] (yaffs_readpage+0x0/0x74) from [] (__do_page_cache_readahead+0x1c0/0x268)
 r7:00200200 r6:00000011 r5:00000008 r4:c032c3a0
[] (__do_page_cache_readahead+0x0/0x268) from [] (ra_submit+0x2c/0x34)
[] (ra_submit+0x0/0x34) from [] (filemap_fault+0x3a8/0x3bc)
[] (filemap_fault+0x0/0x3bc) from [] (__do_fault+0x58/0x3e0)
[] (__do_fault+0x0/0x3e0) from [] (handle_mm_fault+0x104/0xae8)
[] (handle_mm_fault+0x0/0xae8) from [] (do_page_fault+0x1a4/0x200)
[] (do_page_fault+0x0/0x200) from [] (do_translation_fault+0x78/0x80)
[] (do_translation_fault+0x0/0x80) from [] (do_DataAbort+0x40/0xa4)
 r7:c02de5d8 r6:00000805 r5:c3823de4 r4:c02de588
[] (do_DataAbort+0x0/0xa4) from [] (__dabt_svc+0x40/0x60)
Exception stack(0xc3823db0 to 0xc3823df8)
3da0:                                     0018d9e6 0000061a 00000000 4118dfff
3dc0: 0018d9e6 c38ff700 c38b1200 00000000 c3823f58 001b944c 001b944c c3823e0c
3de0: 00000002 c3823df8 c00c5278 c013ff1c 60000013 ffffffff
[] (padzero+0x0/0x64) from [] (load_elf_binary+0x724/0x12fc)
[] (load_elf_binary+0x0/0x12fc) from [] (search_binary_handler+0xc0/0x25c)
[] (search_binary_handler+0x0/0x25c) from [] (do_execve+0x2a4/0x334)
[] (do_execve+0x0/0x334) from [] (kernel_execve+0x40/0x8c)
[] (kernel_execve+0x0/0x8c) from [] (init_post+0x10c/0x178)
 r7:00000000 r6:c001bb1c r5:c02f9f60 r4:c02de110
[] (init_post+0x0/0x178) from [] (kernel_init+0xf4/0x124)
 r5:c001bd9c r4:c001bd9c
[] (kernel_init+0x0/0x124) from [] (do_exit+0x0/0x62c)
 r7:00000000 r6:00000000 r5:00000000 r4:00000000
Code: bad PC value
---[ end trace 11944ce5569ff850 ]---
Kernel panic - not syncing: Attempted to kill init!
Backtrace:
[] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c)
 r7:c3820000 r6:c02fa7d0 r5:72617010 r4:0000000b
[] (dump_stack+0x0/0x1c) from [] (panic+0x4c/0x134)
[] (panic+0x0/0x134) from [] (do_exit+0x534/0x62c)
 r3:c02e2804 r2:c3823578 r1:c382344c r0:c02a32ac
[] (do_exit+0x0/0x62c) from [] (die+0x254/0x288)
[] (die+0x0/0x288) from [] (__do_kernel_fault+0x6c/0x7c)
[] (__do_kernel_fault+0x0/0x7c) from [] (do_page_fault+0x148/0x200)
 r7:c3820000 r6:72617020 r5:c38b6000 r4:00010000
[] (do_page_fault+0x0/0x200) from [] (do_translation_fault+0x78/0x80)
[] (do_translation_fault+0x0/0x80) from [] (do_PrefetchAbort+0x40/0xa4)
 r7:c02de7d8 r6:00000005 r5:c38237f4 r4:c02de788
[] (do_PrefetchAbort+0x0/0xa4) from [] (__pabt_svc+0x44/0x80)
Exception stack(0xc38237c0 to 0xc3823808)
37c0: c001d748 00000000 c4c00004 72617020 c3854cc0 00000000 00000003 00708800
37e0: c385f580 c385f400 c38239b8 c3823824 c3823828 c3823808 c0191d64 72617020
3800: 20000013 ffffffff
[] (s3c2410_nand_select_chip+0x0/0xb0) from [] (nand_do_read_ops+0xa0/0x450)
 r7:00708800 r6:00000000 r5:00000001 r4:0000003f
[] (nand_do_read_ops+0x0/0x450) from [] (nand_read_oob+0x84/0x34c)
[] (nand_read_oob+0x0/0x34c) from [] (part_read_oob+0x78/0xd4)
[] (part_read_oob+0x0/0xd4) from [] (nandmtd2_ReadChunkWithTagsFromNAND+0x250/0x278)
 r6:001a8800 r5:c38a8580 r4:c38aa000
[] (nandmtd2_ReadChunkWithTagsFromNAND+0x0/0x278) from [] (yaffs_ReadChunkWithTagsFromNAND+0x50/0xe8)
[] (yaffs_ReadChunkWithTagsFromNAND+0x0/0xe8) from [] (yaffs_ReadChunkDataFromObject+0x68/0x80)
 r7:00175800 r6:c39152e4 r5:c001d800 r4:c39152e4
[] (yaffs_ReadChunkDataFromObject+0x0/0x80) from [] (yaffs_ReadDataFromFile+0x2f4/0x304)
 r5:c3814000 r4:00000800
[] (yaffs_ReadDataFromFile+0x0/0x304) from [] (yaffs_readpage_nolock+0x88/0x180)
[] (yaffs_readpage_nolock+0x0/0x180) from [] (yaffs_readpage+0x30/0x74)
 r8:00100100 r7:00200200 r6:c02e7b70 r5:c38ff980 r4:c032c3a0
[] (yaffs_readpage+0x0/0x74) from [] (__do_page_cache_readahead+0x1c0/0x268)
 r7:00200200 r6:00000011 r5:00000008 r4:c032c3a0
[] (__do_page_cache_readahead+0x0/0x268) from [] (ra_submit+0x2c/0x34)
[] (ra_submit+0x0/0x34) from [] (filemap_fault+0x3a8/0x3bc)
[] (filemap_fault+0x0/0x3bc) from [] (__do_fault+0x58/0x3e0)
[] (__do_fault+0x0/0x3e0) from [] (handle_mm_fault+0x104/0xae8)
[] (handle_mm_fault+0x0/0xae8) from [] (do_page_fault+0x1a4/0x200)
[] (do_page_fault+0x0/0x200) from [] (do_translation_fault+0x78/0x80)
[] (do_translation_fault+0x0/0x80) from [] (do_DataAbort+0x40/0xa4)
 r7:c02de5d8 r6:00000805 r5:c3823de4 r4:c02de588
[] (do_DataAbort+0x0/0xa4) from [] (__dabt_svc+0x40/0x60)
Exception stack(0xc3823db0 to 0xc3823df8)
3da0:                                     0018d9e6 0000061a 00000000 4118dfff
3dc0: 0018d9e6 c38ff700 c38b1200 00000000 c3823f58 001b944c 001b944c c3823e0c
3de0: 00000002 c3823df8 c00c5278 c013ff1c 60000013 ffffffff
[] (padzero+0x0/0x64) from [] (load_elf_binary+0x724/0x12fc)
[] (load_elf_binary+0x0/0x12fc) from [] (search_binary_handler+0xc0/0x25c)
[] (search_binary_handler+0x0/0x25c) from [] (do_execve+0x2a4/0x334)
[] (do_execve+0x0/0x334) from [] (kernel_execve+0x40/0x8c)
[] (kernel_execve+0x0/0x8c) from [] (init_post+0x10c/0x178)
 r7:00000000 r6:c001bb1c r5:c02f9f60 r4:c02de110
[] (init_post+0x0/0x178) from [] (kernel_init+0xf4/0x124)
 r5:c001bd9c r4:c001bd9c
[] (kernel_init+0x0/0x124) from [] (do_exit+0x0/0x62c)
 r7:00000000 r6:00000000 r5:00000000 r4:00000000
出现异常原因是这样的,是由于mach-mini2440.c的nand flash相关部分__initdata标志导致的
static struct mtd_partition mini2440_default_nand_part[] __initdata= {
 [0] = {
  .name = "supervivi",
  .size = 0x00040000,
  .offset = 0,
 },
 [1] = {
  .name = "param",
  .offset = 0x00040000,
  .size = 0x00020000,
 },
 [2] = {
  .name = "Kernel",
  .offset = 0x00060000,
  .size = 0x00500000,
 },
 [3] = {
  .name = "root",
  .offset = 0x00560000,
  .size = 1024 * 1024 * 1024, //
 },
 [4] = {
  .name = "nand",
  .offset = 0x00000000,
  .size = 1024 * 1024 * 1024, //
 }
};
static struct s3c2410_nand_set mini2440_nand_sets[] __initdata= {
 [0] = {
  .name  = "nand",
  .nr_chips = 1,
  .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
  .partitions = mini2440_default_nand_part,
 },
};
static struct s3c2410_platform_nand mini2440_nand_info __initdata= {
 .tacls  = 20,
 .twrph0  = 60,
 .twrph1  = 20,
 .nr_sets = ARRAY_SIZE(mini2440_nand_sets),
 .sets  = mini2440_nand_sets,
 .ignore_unset_ecc = 1,
};
将所有的__initdata标志去掉
根文件系统挂载成功
__initdata,和__init的作用基本上一样,不过它是针对变量而不是函数的。
__init 宏最常用的地方是驱动模块初始化函数的定义处,其目的是将驱动模块的初始化函数放入名叫.init.text的输入段。对于__initdata来说,用于数据定义,目的是将数据放入名叫.init.data的输入段。这两个段中只能被使用一次,使用完后要释放回收这两个段内存空间
所以在内核启动过程中有这么一句
Freeing init memory: 100K
就是表示释放init段内存的大小
同样DM9000部分也一样,不要__initdata这个标志,不然有可能网络不能连接
修改过后mach-mini2440.c中nand和dm9000部分代码
/*nand*/
static struct mtd_partition mini2440_default_nand_part[] __initdata= {
 [0] = {
  .name = "supervivi",
  .size = 0x00040000,
  .offset = 0,
 },
 [1] = {
  .name = "param",
  .offset = 0x00040000,
  .size = 0x00020000,
 },
 [2] = {
  .name = "Kernel",
  .offset = 0x00060000,
  .size = 0x00500000,
 },
 [3] = {
  .name = "root",
  .offset = 0x00560000,
  .size = 1024 * 1024 * 1024, //
 },
 [4] = {
  .name = "nand",
  .offset = 0x00000000,
  .size = 1024 * 1024 * 1024, //
 }
};
static struct s3c2410_nand_set mini2440_nand_sets[] __initdata= {
 [0] = {
  .name  = "nand",
  .nr_chips = 1,
  .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
  .partitions = mini2440_default_nand_part,
 },
};
static struct s3c2410_platform_nand mini2440_nand_info __initdata= {
 .tacls  = 20,
 .twrph0  = 60,
 .twrph1  = 20,
 .nr_sets = ARRAY_SIZE(mini2440_nand_sets),
 .sets  = mini2440_nand_sets,
 .ignore_unset_ecc = 1,
};
/*dm9000*/
static struct resource mini2440_dm9000_resource[]={
 [0] = {
  .start = MINI2440_DM9000_BASE,
  .end   = MINI2440_DM9000_BASE + 3,
  .flags = IORESOURCE_MEM
  },
 [1] = {
  .start = MINI2440_DM9000_BASE + 4,
  .end   = MINI2440_DM9000_BASE + 7,
  .flags = IORESOURCE_MEM
 },
 [2] = {  
  .start = IRQ_EINT7,
  .end   = IRQ_EINT7,
  .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 }
};
static struct dm9000_plat_data mini2440_dm9000_pdata={
 .flags  = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
};
static struct platform_device mini2440_dm9000_device={
 .name  = "dm9000",
 .id  = -1, 
 .num_resources = ARRAY_SIZE(mini2440_dm9000_resource),
 .resource = mini2440_dm9000_resource,
 .dev  = {
  .platform_data = &mini2440_dm9000_pdata,
 },
};
阅读(3815) | 评论(0) | 转发(0) |
0

上一篇:IIC总线协议

下一篇:求1~100之间素数

给主人留下些什么吧!~~