linux内核移植与开发板,Linux 2.6.36内核移植飞凌OK6410开发板完整步骤详解

Linux 2.6.36内核移植飞凌OK6410开发板完整步骤详解

[复制链接]

今天终于让Linux内核在飞凌的板子上跑起来了,想来也是艰辛,为了移植成功,断断续续做了将近两个月的努力,期间郁闷不可言

语形容啊,   了解其中艰辛,将自己移植步骤与心得与大家分享,希望对初踏次领域之人有所帮助,我所写的成果一部分也是网上前

辈的所作,并非完全本人原创。

一、       移植环境

主 机:VMWare-Ubuntu

开发板:飞凌OK6410 nandflash,Kernel:2.6.36.2

编译器:arm-linux-gcc-4.3.2.tgz

u-boot:u-boot-1.1.6

注:编译器和u-boot 都是飞凌开发板自带的

二、  源码获得

三、    移植步骤:

1.将Linux2.6.34.2内核源码放到工作目录文件夹下,并解压。

#tar xzvf linux2.6.36.2.tar.gz –c /

#pwd

/

# cd linux2.6.36.2

2. 修改内核源码根目录下的Makefile文件(CROSS_COMPILE    =的值因个人情况而定,其他可以照做)

#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分区信息.

修改arch/arm/mach-s3c64xx/mach-smdk6410.c文件,添加Nand Flash的分区信息和Nand Flash的硬件信息。(蓝色字体为添加部分)

#pwd

#gedit mach-smdk6410.c               //add here 注意:此处的nandflash分区信息是飞凌自带的2.6.28的内核设置,由

于此处要用到uboot是飞凌的,所以分区信息也要按人家的来 添加头文件 #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…

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值