发新话题
打印

Linux-2.6.25移植

Linux-2.6.25移植

4月17号linux-2.6.25稳定版发布,伟研科技 http://www.gzweiyan.com 将该内核移植到S3C2440平台上,下面是我们移植的第一步:
编译内核:
1) 解压内核,当前目录为/new_disk/weiyan/
tar jxf /new_disk/weiyan/linux-2.6.25.tar.bz2
cd linux-2.6.25
2) 修改体系架构并指定交叉编译器
vi Makefile ,将193行和194行的
#ARCH            ?= $(SUBARCH)
#CROSS_COMPILE   ?=
修改为
ARCH            ?= arm
CROSS_COMPILE   ?= arm-linux- #最后有“—”,Makefile会调用arm-linux-gcc
3) 载入默认配置
make s3c2410_defconfig
make menuconfig
按Esc键保存退出。
4) 添加生成U-Boot镜像的工具
cp /new_disk/weiyan/mkimage ./
vi scripts/mkuboot.sh ,将
MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
修改为MKIMAGE=$PWD/mkimage
vi arch/arm/mach-s3c2440/mach-smdk2440.c
5) 添加nand划分信息
static struct mtd_partition wy_nand_part[] = {
        [0] = { //u-boot及内存存放的分区
                .name   = "BOOT",
                .size   = SZ_2M,
                .offset = 0,
        },
        [1] = { //文件系统存放的分区
                .name   = "ROOTFS",
                .offset = SZ_2M,
                .size   = SZ_32M,
        },
        [2] = { //剩余空间
                .name   = "BACKUP",
                .offset = SZ_32M + SZ_2M,
                .size   = SZ_32M - SZ_2M,
        },
};
static struct s3c2410_nand_set wy_nand_sets[] = {
        [0] = {
                .name        = "NAND",
                .nr_chips     = 1,
                .nr_partitions  = ARRAY_SIZE(wy_nand_part),
6) 添加nand flash的读写匹配时间,各时间定义如图
static struct s3c2410_platform_nand wy_nand_info = {
        .tacls          = 10,
        .twrph0         = 25,
        .twrph1         = 10,
        .nr_sets        = ARRAY_SIZE(wy_nand_sets),
        .sets           = wy_nand_sets,
};
                .partitions     = wy_nand_part,
        },
};
7) 添加支持硬件校验:
   
make menuconfig
Device Drivers  --->
<*> Memory Technology Device (MTD) support  --->
<*>   NAND Device Support  --->
  •      S3C2410 NAND Hardware ECC
    8) 编译并拷贝到tftp下载目录
    make uImage && cp arch/arm/boot/uImage /new_disk/tftp

    ……
    Image Name:   Linux-2.6.25
    Created:      Mon Apr  7 13:50:19 2008
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    1591184 Bytes = 1553.89 kB = 1.52 MB
    Load Address: 0x30008000
    Entry Point:  0x30008000
      Image arch/arm/boot/uImage is ready
    启动新内核:
    dm9000 i/o: 0x18000300, id: 0x90000a46
    MAC: 00:0c:20:02:0a:5b
    TFTP from server 192.168.1.5; our IP address is 192.168.1.6
    Filename 'uImage'.
    Load address: 0x31000000
    Loading: #################################################################
             #############################################
    done
    Bytes transferred = 1591268 (1847e4 hex)
    ## Booting image at 31000000 ...
       Image Name:   Linux-2.6.25
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1591204 Bytes =  1.5 MB
       Load Address: 30008000
       Entry Point:  30008000
       Verifying Checksum ... OK
    OK
    Starting kernel ...
    Uncompressing Linux....................................................................................................... done, booting the kernel.
    Linux version 2.6.25 ([email=root@ubuntu-server]root@ubuntu-server[/email]) (gcc version 3.4.1) #4 Mon Apr 21 04:28:37 CST 2008
    CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
    Machine: SMDK2440
    Memory policy: ECC disabled, Data cache writeback
    CPU S3C2440A (id 0x32440001)
    S3C244X: core 406.425 MHz, memory 135.475 MHz, peripheral 67.737 MHz
    S3C24XX Clocks, (c) 2004 Simtec Electronics
    CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
    CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
    Kernel command line: root=/dev/mtdblock1 rootfstype=jffs2 console=ttySAC0 ip=192.168.1.6:192.168.1.5:192.168.1.5:255.255.255.0:WEIYAN:eth0ff
    …….
    S3C24XX NAND Driver, (c) 2004 Simtec Electronics
    s3c2440-nand s3c2440-nand: Tacls=2, 14ns Twrph0=4 29ns, Twrph1=2 14ns
    NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
    Scanning device for bad blocks
    Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
    0x00000000-0x00200000 : "BOOT"
    0x00200000-0x02200000 : "ROOTFS"
    0x02200000-0x04000000 : "BACKUP"
    ……
    Empty flash at 0x0096200c ends at 0x00962200
    Empty flash at 0x01470628 ends at 0x01470800
    jffs2_scan_eraseblock(): Node at 0x01470dfc {0x1985, 0xe001, 0xe0021985) has invalid CRC 0x00000044 (calculated 0x515918d5)
    VFS: Mounted root (jffs2 filesystem).
    Freeing init memory: 140K
    JFFS2 notice: (775) check_node_data: wrong data CRC in data node at 0x01470578: read 0x5cc80399, calculated 0x36a47240.
    init started: BusyBox v1.9.1 (2008-04-19 19:49:32 CST)
    starting pid 777, tty '': '/etc/init.d/rcS'
    starting initial script, WEIYAN
    Please press Enter to activate this console.
    starting pid 795, tty '': '/bin/sh'
    [root@WEIYAN /]$ ls
    bin      etc      linuxrc  opt      sbin     tmp      var
    dev      lib      mnt      proc     sys      usr
    [root@WEIYAN /]$
  • 伟研科技,S3C2440嵌入式学习包

    伟研科技,S3C2440嵌入式学习包,详细的学习资料&源代码
    http://www.gzweiyan.com
    linux-2.6.25
    一、系统移植篇
    1.   交叉编译环境搭建及内核编译
    2.   基于busybox-1.10.1的简易根文件系统制作
    3.   Nand flash驱动移植及带硬件Ecc的Jffs2文件系统制作
    4.   DM9000AEp网卡驱动移植
    5.   根文件系统的优化及配置
    6.   NFS根文件系统的移植及使用
    7.   实时时钟RTC的移植及使用
    8.   GPIO按键驱动移植
    9.   U盘挂载移植
    10.  UDA1341音频驱动移植
    11.  SD卡驱动移植
    12.  USB DEVICE驱动移植
    13.  内核裁剪
    14.  带硬件Ecc的Yaffs2文件系统移植
    15.  USB摄像头驱动移植
    16.  LCD驱动移植
    17.  触摸屏驱动移植

    二、应用程序移植篇
    1.   madplay mp3播放器移植
    2.   简易web服务器移植
    3.   tslib移植
    4.   mplayer播放器移植
    5.   Qt2.3.10移植

    三、简单驱动及应用程序编写篇
    1.   GPIO LED 驱动编写
    2.   基于命令行的LED控制程序编写
    3.   4*4 16按键键盘驱动编写
    4.   按键检测程序编写
    5.   USB图像采集程序编写
    6.   基于web的图片显示静态html脚本编写
    7.   基于web的LED控制动态cgi脚本编写
    不错,不错,好文章呀,支持

    推荐

    伟研科技,999元超值WY2440嵌入式学习包(包奇美 3.5'TFT LCD)
    http://www.gzweiyan.com/html/products/20080820/35.html

    linux wifi

    54M usb无线网卡,提供Linux驱动源代码及配置程序。
    发新话题