Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1645979
  • 博文数量: 245
  • 博客积分: 10378
  • 博客等级: 上将
  • 技术积分: 2571
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-27 08:19
文章分类

全部博文(245)

文章存档

2013年(4)

2012年(8)

2011年(13)

2010年(68)

2009年(152)

分类: LINUX

2009-07-02 17:57:24

    刚开始内核的移植,以前没有什么移植的经验,看了一些别人的文档, 主要是修改mtd分区表,这个分区表在arch/arm/plat-s3c24xx/common-smdk.c中, 这是 2.6.30的内核,09年6月10日发布的,是目前最稳定的最高版本的内核了,修改完mtd分区表之后,就本就没有什么大的问题的,仔细的看了30核,发现对一些常用的驱动增加了不少,常见的驱动只要修改了就可以了,kernel可以正常跑了,当还没有找到根文件系统。
下边是启动信息:
 

MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux.............................................................................................................................. done, booting the kernel.
Linux version 2.6.30 (root@localhost.localdomain) (gcc version 3.4.5) #1 Wed Jul 1 18:28:22 CST 2009

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 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=/mtdblock3 init=/linuxrc console=ttySAC0 115200s
NR_IRQS:99
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
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: 60768KB available (3616K code, 338K data, 152K init, 0K highmem)
Calibrating delay loop... 99.73 BogoMIPS (lpj=249344)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 936 bytes
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2410: Initialising architecture
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
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c2410-i2c s3c2410-i2c: slave address 0x10
s3c2410-i2c s3c2410-i2c: bus frequency set to 97 KHz
s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
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
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY) &Acirc;&copy; 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 118
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
dm9000 Ethernet Driver, V1.31
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand s3c2410-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000020000 : "Boot Agent"
0x000000020000-0x000000030000 : "S3C2410 flash partition 1"
0x000000030000-0x000000330000 : "S3C2410 flash partition 2"
0x000000330000-0x000000430000 : "S3C2410 flash partition 3"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
Advanced Linux Sound Architecture Driver Version 1.0.20.
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "/mtdblock3" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 128 mtdblock0 (driver?)
1f01 64 mtdblock1 (driver?)
1f02 3072 mtdblock2 (driver?)
1f03 1024 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace:
[<c00328c8>] (dump_backtrace+0x0/0x104) from [<c00329e4>] (dump_stack+0x18/0x1c)
 r7:c3872000 r6:c03ddf9c r5:00000000 r4:c3817f5c
[<c00329cc>] (dump_stack+0x0/0x1c) from [<c0051aec>] (panic+0x40/0x114)
[<c0051aac>] (panic+0x0/0x114) from [<c000900c>] (mount_block_root+0x1d8/0x21c)
 r3:00000000 r2:20000013 r1:c3817f5c r0:c035abc4
[<c0008e34>] (mount_block_root+0x0/0x21c) from [<c000921c>] (mount_root+0xd0/0xf0)
[<c000914c>] (mount_root+0x0/0xf0) from [<c00093ac>] (prepare_namespace+0x170/0x1d0)
 r6:00000000 r5:c0027888 r4:c03dd6e4
[<c000923c>] (prepare_namespace+0x0/0x1d0) from [<c0008bec>] (kernel_init+0xb8/0xe4)
 r5:c0026bb4 r4:c03dd6d8
[<c0008b34>] (kernel_init+0x0/0xe4) from [<c0053ff8>] (do_exit+0x0/0x588)
 r5:00000000 r4:00000000

 

 根据上边的错误,又做了一些修改:

/* 一个Nand Flash总共64MB, 按如下大小进行分区 分区大小自己看着办*/

    static struct mtd_partition partition_info[] ={

        { /* 1MB */

            name: "bootloader",

            size: 0x00100000,

            offset: 0x0,

        },{ /* 3MB */

            name: "kernel",

            size: 0x00300000,

            offset: 0x00100000,

        }, { /* 40MB */

            name: "root",

            size: 0x02800000,

            offset: 0x00400000,

        }, { /* 20MB */

        name: "user",

        size: 0x00f00000,

        offset: 0x02d00000,

        }

    };

 

    /*加入Nand Flash分区*/

    struct s3c2410_nand_set nandset ={

    nr_partitions: 4, /*指明partition_info中定义的分区数目*/

    partitions: partition_info, /* partition table分区信息表*/

    };

 

    /*建立Nand Flash芯片支持*/

    struct s3c2410_platform_nand superlpplatform={

        tacls:0,

        twrph0:30,

        twrph1:0,

        sets: &nandset,

        nr_sets: 1,

    };

    tacls, twrph0, twrph1的意思见S3C2410手册的63,

    3个值最后会被设置到NFCONF,S3C2410手册66.

    sets: 支持的分区集        nr_set:分区集的个数

   

    /*加入Nand Flash芯片支持到Nand Flash驱动

    另外还要修改此文件中的s3c_device_nand结构体变量,添加对dev成员的赋值*/

    struct platform_device s3c_device_nand = {

        .name = "s3c2410-nand",

            /* Device name */

        .id = -1,

            /* Device ID */

        .num_resources = ARRAY_SIZE(s3c_nand_resource),

        .resource = s3c_nand_resource, /* Nand Flash Controller Registers */

            /* Add the Nand Flash device */

        .dev = {

        .platform_data = &superlpplatform

        }

    };

 

阅读(1703) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-07-28 11:19:13

/*建立Nand Flash芯片支持*/ struct s3c2410_platform_nand superlpplatform={ tacls:0, twrph0:30, twrph1:0, sets: &nandset, nr_sets: 1, }; 在30的Kernel中都是等号,风格都不一样啊

tastesweet2009-07-22 15:57:26

30的kernel 怎么不是一个版本的??

chinaunix网友2009-07-21 18:04:44

你改的那个根本不是一个版本的kernel嘛!!!!!!!