Tiny6410内核移植及多种驱动移植

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Linux内核移植

一、环境

1.开发板

Tiny6410 NAND:2G RAM:256M MLC

2.操作系统

Fedora13

3.交叉编译器

arm-linux-gcc-4.5.1(linux自带)

4.内核版本

Linux-2.6.38

二、准备

配置交叉编译器

三、下载内核

四、解压内核

#tar -jxvf linux-2.6.38.tar.bz2 -C 路径

五、NAND Flash移植

1.修改根下的Makefile

#vim Makefile

将约191行修改为:

ARCH ?=(空格)arm

CROSS_COMPILE ?= arm-linux-

2.执行下面命令生成默认配置文件

# cp arch/arm/configs/s3c6400_defconfig .config

如省略这个操作的话,后面会找不到System Type

3.运行配置菜单,做基本配置

#make menuconfig

General setup->(/usr/4.5.1/bin/arm-linux-) Cross-compiler tool prefix 上面的设置可以通过修改内核根下的Makefiel中的如下行实现:

CROSS_COMPILE ?= arm-linux-

然后再选择如下项目:

System Type --->

ARM system type (ARM Ltd. Versatile family) --->

( X) Samsung S3C64XX

返回上述菜单后,选择:

System Type->[*] MINI6410

上面这个选项,首先选上,其他的可以去掉,不确定的可以参考友善之臂的

4.拷贝友善配套光盘的NAND Flash驱动

drivers/mtd/nand/s3c_nand.c

arch/arm/plat-samsung/include/plat/regs-nand.h

drivers/mtd/nand/s3c_nand_mlc.fo

drivers/mtd/nand/nand_base.c

drivers/mtd/nand/Kconfig

drivers/mtd/nand/Makefile

5.再次配置nand驱动

#make menuconfig

做如下选择

Device Drivers--->

<*> Memory Technology Device (MTD) support --->

[*] MTD partitioning support

[*] Command line partition table parsing

<*> Direct char device access to MTD devices

<*> Caching block device access to MTD devices

<*> NAND Device Support --->

<> NAND Flash support for Samsung S3C SoCs

<*> NAND Flash support for S3C SoC

[*] S3C NAND Hardware ECC

上面红色的不配置,UBIFS配置将无效!

6.执行编译

#make

成功后后面几行出下如下内容

SYSMAP System.map

SYSMAP .tmp_System.map

OBJCOPY arch/arm/boot/Image

Kernel: arch/arm/boot/Image is ready

AS arch/arm/boot/compressed/head.o

GZIP arch/arm/boot/compressed/piggy.gzip

AS arch/arm/boot/compressed/piggy.gzip.o

CC arch/arm/boot/compressed/misc.o

CC arch/arm/boot/compressed/decompress.o

SHIPPED arch/arm/boot/compressed/lib1funcs.S

AS arch/arm/boot/compressed/lib1funcs.o

LD arch/arm/boot/compressed/vmlinux

OBJCOPY arch/arm/boot/zImage内核就是这个

Kernel: arch/arm/boot/zImage is ready

Building modules, stage 2.

MODPOST 16 modules

六、UBIFS驱动移植

1.配置内核支持UBIFS

Device Drivers --->

Memory Technology Device (MTD) support --->

UBI - Unsorted block images --->

Enable UBI

2.配置MTD支持UBI接口

File systems --->

Miscellaneous filesystems --->

UBIFS file system support

3.#make

4.下载测试

UBIFS: recovery needed

UBIFS: recovery completed

UBIFS: mounted UBI device 0, volume 0, name "FriendlyARM-root"

UBIFS: file system size: 2066448384 bytes (2018016 KiB, 1970 MiB, 2002 LEBs)

UBIFS: journal size: 12517376 bytes (12224 KiB, 11 MiB, 13 LEBs)

UBIFS: media format: w4/r0 (latest is w4/r0)

UBIFS: default compressor: lzo

UBIFS: reserved for root: 0 bytes (0 KiB)

成功后出现以上内容。

七、网卡(DM9000)移植

1.修改DM9000网卡头文件

#vi include/linux/dm9000.h

28行增加

unsigned char param_addr[6];

2.修改驱动文件

#vi drivers/net/dm9000.c

大概1586行增加

if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {

mac_src = "param data";

memcpy(ndev->dev_addr, pdata->param_addr, 6);

}

3.配置内核

#make menuconfig

[*] Networking support --->

Networking options --->

<*> Packet socket

<*> Unix domain sockets

相关文档
最新文档