在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Linux2.6.36移植到飛凌S3C6410開(kāi)發(fā)板 步驟

            Linux2.6.36移植到飛凌S3C6410開(kāi)發(fā)板 步驟

            作者: 時(shí)間:2016-11-23 來(lái)源:網(wǎng)絡(luò) 收藏
            今天終于讓linux內(nèi)核在飛凌ok6410的板子上跑起來(lái)了,想來(lái)也是艱辛,為了移植成功,斷斷續(xù)續(xù)做了將近兩個(gè)月的努力,期間郁悶不可言語(yǔ)形容啊, 了解其中艱辛,將自己移植步驟與心得與大家分享,希望對(duì)初踏次領(lǐng)域之人有所幫助,我所寫(xiě)的成果一部分也是網(wǎng)上前輩的所作,并非本人原創(chuàng)。


            一、 移植環(huán)境
            主 機(jī):VMWare-Ubuntu
            開(kāi)發(fā)板:飛凌OK6410 nandflash,Kernel:2.6.36.2
            編譯器:arm-linux-gcc-4.3.2.tgz
            u-boot:u-boot-1.1.6

            注:編譯器和u-boot 都是飛凌開(kāi)發(fā)板自帶的
            二、 源碼獲得
            內(nèi)核源碼到http://www.all.kernel.org/下載;
            三、 移植步驟:
            1.將Linux2.6.34.2內(nèi)核源碼放到工作目錄文件夾下,并解壓。
            #tar xzvf linux2.6.36.2.tar.gz –c /
            #pwd
            /
            # cd linux2.6.36.2
            2. 修改內(nèi)核源碼根目錄下的Makefile文件(CROSS_COMPILE =的值因個(gè)人情況而定,其他可以照做,藍(lán)色部分為修改部分。)
            #gedit Makefile
            ......
            #SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/
            # -e s/arm.*/arm/ -e s/sa110/arm/
            # -e s/s390x/s390/ -e s/parisc64/parisc/
            # -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
            ......
            #ARCH ?= $(SUBARCH)
            #CROSS_COMPILE ?=
            ARCH = arm
            CROSS_COMPILE = /usr/local/arm/usr/local/arm/4.3.2/bin/arm-none-linux- gnueabi-
            3添加NandFlash分區(qū)信息.
            修改arch/arm/mach-s3c64xx/mach-smdk6410.c文件,添加Nand Flash的分區(qū)信息和Nand Flash的硬件信息。(藍(lán)色字體為添加部分)
            #pwd
            #gedit mach-smdk6410.c //add here
            // 注意:此處的nandflash分區(qū)信息是飛凌自帶的2.6.28的內(nèi)核設(shè)置,由于此處要用到uboot是飛凌的,所以分區(qū)信息也要按人家的來(lái)
            添加頭文件
            #include
            #include
            #include
            #include
            struct mtd_partition s3c_partition_info[] = {
            {
            .name = "Bootloader",
            .offset = 0,
            .size = (256*SZ_1K),
            .mask_flags =MTD_CAP_NANDFLASH,
            },
            {
            .name = "Kernel",
            .offset = (256*SZ_1K),
            .size = (4*SZ_1M) - (256*SZ_1K),
            .mask_flags = MTD_CAP_NANDFLASH,
            },
            #if defined (CONFIG_SPLIT_ROOT_FILESYSTEM)
            {
            .name = "Rootfs",
            .offset = (4*SZ_1M),
            .size = (80*SZ_1M),//
            },
            #endif
            {
            .name = "File System",
            .offset = MTDPART_OFS_APPEND,
            .size = MTDPART_SIZ_FULL,
            }
            };
            static struct s3c2410_nand_set s3c_nandset[]={
            [0]= {
            .name ="s3c24xx-nand",
            .nr_chips = 1,
            .nr_partitions =ARRAY_SIZE(s3c_partition_info),
            .partitions =s3c_partition_info,
            }
            };
            static struct s3c2410_platform_nand s3c_platform={
            .tacls =25,
            .twrph0 =55,
            .sets = &s3c_nandset,
            .nr_sets =ARRAY_SIZE(s3c_nandset),};
            //add here…
            static struct platform_device *smdk6410_devices[] __initdata = {
            #ifdef CONFIG_SMDK6410_SD_CH0
            &s3c_device_hsmmc0,
            #endif
            #ifdef CONFIG_SMDK6410_SD_CH1
            &s3c_device_hsmmc1,
            #endif
            &s3c_device_i2c0,
            &s3c_device_i2c1,
            &s3c_device_fb,
            &s3c_device_ohci,
            &s3c_device_usb_hsotg,
            &s3c64xx_device_iisv4,
            //add here
            &s3c_device_nand,
            //add here…
            }
            static void __init smdk6410_map_io(void){
            u32 tmp;
            //add here
            s3c_device_nand.name = "s3c6410-nand";
            //add here…

            }
            static void __init smdk6410_machine_init(void){
            u32 cs1;
            s3c_i2c0_set_platdata(NULL);
            s3c_i2c1_set_platdata(NULL);
            s3c_fb_set_platdata(&smdk6410_lcd_pdata);
            //add here
            s3c_nand_set_platdata(&s3c_platform);//
            //add here…
            }


            5.配置內(nèi)核。(arch/arm/configs/目錄下是一般內(nèi)核的默認(rèn)配置)
            支持NandFlash
            Device Drivers --->
            <*> Memory Technology Device (MTD) support --->

            MTD partitioning support
            <*> NAND Device Support --->
            <*> NAND Flash support for S3C/S3C SoC
            再把這個(gè)選項(xiàng)選上
            device drivers ->
            Memory Technology Device (MTD) support --->
            Caching block device access to MTD devices
            (此出勾選可防止出現(xiàn):VFS: Cannot open root device "mtdblock2" or unknown-block(2,0) 錯(cuò)誤)
            保存退出
            復(fù)制config文件,編譯內(nèi)核
            #pwd
            #/linux2.6.34.2
            #cp –f arch/arm/configs/s3c6400_defconfig .config
            可以使用make menuconfig對(duì)剛剛配置的內(nèi)核根據(jù)具體的情況進(jìn)行修改,開(kāi)始我沒(méi)有進(jìn)行修改直接make zImage,最后在arch/arm/boot/目錄下生成zImage鏡像文件。
            6.編譯內(nèi)核 make zImage
            下載到板子上,發(fā)現(xiàn)如下問(wèn)題,此問(wèn)題郁悶我最久,
            …………………………………..
            CPU: Testing write buffer coherency: ok
            s3c6400-nand: failed to claim resource 0
            WARNING: at drivers/base/core.c:130 device_release+0x70/0x84()
            …………………………………………………….
            ------------[ cut here ]------------
            WARNING: at drivers/base/core.c:130 device_release+0x70/0x84()
            Device s3c64xx-rtc does not have a release() function, it is broken and must be fixed.
            Modules linked in:
            ……………………………………………………….

            [] (kernel_init+0x94/0x14c) from [] (kernel_thread_exit+0x0/0x8)
            ---[ end trace 1b75b31a2719ed1e ]---
            ------------[ cut here ]------------
            WARNING: at drivers/base/core.c:130 device_release+0x70/0x84()
            Device s3c64xx-pata.0 does not have a release() function, it is broken and must be fixed.
            Modules linked in:
            ……………………………………………………………………………..
            這個(gè)問(wèn)題就是在mach-smdk6410.c 中的static struct platform_device *smdk6410_devices[] __initdata = {
            ……………………………………………….
            &smdk6410_smsc911x,
            &s3c_device_adc,
            &s3c_device_cfcon,
            &s3c_device_rtc,
            &s3c_device_ts,
            &s3c_device_wdt,
            &s3c_device_nand,
            }; 結(jié)構(gòu)體中所有設(shè)備都找不到釋放函數(shù),經(jīng)過(guò)分析,可能是這些板級(jí)設(shè)備初始化時(shí)出現(xiàn)問(wèn)題,所以系統(tǒng)調(diào)用釋放資源的函數(shù),可是內(nèi)核中沒(méi)有這些函數(shù)(可能是沒(méi)有必要吧,所以內(nèi)核中沒(méi)有定義!此上純屬個(gè)人胡猜,希望高手指正),所以出現(xiàn)如上問(wèn)題,通過(guò)我大量的分析,問(wèn)題在static struct resource s3c_nand_resource[](路徑:arch./arm/plat-samsung) 這個(gè)機(jī)構(gòu)體中,
            static struct resource s3c_nand_resource[] = {
            [0] = {
            .start = S3C_PA_NAND,
            .end = S3C_PA_NAND + SZ_1M-1,
            .flags = IORESOURCE_MEM,
            }
            };
            .end = S3C_PA_NAND + SZ_1M-1, 這個(gè)值后面再減去1,就可以了,這是對(duì)比其他的設(shè)備資源結(jié)構(gòu)做出的修改,此處涉及到這些設(shè)備的總線地址范圍,我琢磨著出現(xiàn)上述問(wèn)題,就是這個(gè)總線地址沖突了,希望高手指正?。。▋?nèi)核中的定義,怎么會(huì)出現(xiàn)錯(cuò)誤呢,這地方我還真搞不懂?。?,不知道自己修改的合適不合適
            所以解決方法就是修改arch./arm/plat-samsung/dev-nand.c 中的
            static struct resource s3c_nand_resource[] = {
            [0] = {
            .start = S3C_PA_NAND,
            .end = S3C_PA_NAND + SZ_1M-1,
            .flags = IORESOURCE_MEM,
            }
            };
            .end = S3C_PA_NAND + SZ_1M-1, 減去一就行了
            7.再次編譯內(nèi)核,下載運(yùn)行:
            …………………………………
            ifconfig: socket: Function not implemented
            Try to bring eth0 interface up......ifconfig: socket: Function not implemented
            ifconfig: socket: Function not implemented
            ifconfig: socket: Function not implemented
            route: socket: Function not implemented
            Done

            Starting Qtopia, please waiting...
            Please press Enter to activate this console. touch...
            說(shuō)明內(nèi)核已經(jīng)成功引導(dǎo)啟動(dòng)文件系統(tǒng),只不過(guò)現(xiàn)在的內(nèi)核沒(méi)有觸摸板驅(qū)動(dòng),下一步你就可以移植一下觸摸板驅(qū)動(dòng)了
            此教程只是本人所遇到問(wèn)題的總結(jié),一些問(wèn)題只做參考,交流,并不具備通用性,如按照上述步驟遇到問(wèn)題,聯(lián)系我,可以幫著一起解決,本人菜鳥(niǎo),教程制作倉(cāng)卒,如有錯(cuò)誤,請(qǐng)大家見(jiàn)諒,
            引用文章:
            http://hi.baidu.com/serial_story ... fd0edd267fb500.html
            http://www.linuxidc.com/Linux/2010-08/27828p3.htm
            http://www.witech.com.cn


            關(guān)鍵詞: Linux2.6.36移植飛凌S3C641

            評(píng)論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉