微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > real6410移植记录一

real6410移植记录一

时间:11-10 来源:互联网 点击:
配置开发板的NFS驱动和移植NandFlash驱动

开发板为华天正的real6410,选定的内核版本为linux-2.6.37,交叉工具链为开发板自带的。

1、修改Makefile

首先修改Makefile,对交叉工具和目标架构进行设置。具体如下:

-ARCH ?= $(SUBARCH)

-CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)

+ARCH ?= arm

+CROSS_COMPILE ?= arm-none-linux-gnueabi-

2、修改机器码

可以修改u-boot,也可以修改kernel,只要两者匹配即可。建议修改kernel的,因为内核的修改比较容易一些。

在u-boot/include/configs/smdk6410.h文件中:

#define MACH_TYPE 1626

在linux-2.6.37/arch/arm/tools/mach-types中修改如下:

-real6410 MACH_REAL6410 REAL6410 2990

+real6410 MACH_REAL6410 REAL6410 1626

3、进行NFS相关配置,并从NFS启动系统

设置启动方式:

setenv bootargs noinitrd root=/dev/nfs console=ttySAC0 nfsroot=192.168.1.10:/home/fantity/work/real6410/target/real6410_fs ip=192.168.1.20:192.168.1.10:192.168.1.1:255.255.255.0::eth0:on fbcon=rotate:1 init=/linuxrc

移植过程中需要配置NFS和相关的网络驱动,否则出现如下错误:

VFS: Cannot open root device "nfs" or unknown-block(0,255)

Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)

[] (unwind_backtrace+0x0/0xec) from [] (panic+0x54/0x174)

[] (panic+0x54/0x174) from [] (mount_block_root+0x25c/0x2ac)

[] (mount_block_root+0x25c/0x2ac) from [] (prepare_namespace+0x164/0x1bc)

[] (prepare_namespace+0x164/0x1bc) from [] (kernel_init+0x10c/0x14c)

[] (kernel_init+0x10c/0x14c) from [] (kernel_thread_exit+0x0/0x8)

相关的配置如下图所示,注意,NFS的配置选项必须在TCP/IP选择之后才可以看到。

[*] Networking support --->

Networking options --->

[*] TCP/IP networking

[*] IP: kernel level autoconfiguration

[*] IP: BOOTP support

Device Drivers --->

[*] Network device support --->

<*> PHY Device support and infrastructure --->

[*] Ethernet (10 or 100Mbit) --->

<*> DM9000 support

File systems --->

[*] Network File Systems --->

<*> NFS client support

[*] NFS client support for NFS version 3

[ ] NFS client support for the NFSv3 ACL protocol extension

[*] NFS client support for NFS version 4

[ ] NFS client support for NFSv4.1

[*] Root file system on NFS

4、Nand Flash配置

对arch/arm/mach-s3c64xx/mach-real6410.c作出如下修改:

static struct mtd_partition real6410_nand_part[] = {

[0] = {

- .name = "uboot",

- .size = SZ_1M,

- .offset = 0,

+ .name = "uboot",

+ .offset = 0,

+ .size = (256*SZ_1K),

+ .mask_flags = MTD_CAP_NANDFLASH,

},

[1] = {

- .name = "kernel",

- .size = SZ_2M,

- .offset = SZ_1M,

+ .name = "Kernel",

+ .offset = (256*SZ_1K),

+ .size = (4*SZ_1M) - (256*SZ_1K),

+ .mask_flags = MTD_CAP_NANDFLASH,

},

[2] = {

- .name = "rootfs",

- .size = MTDPART_SIZ_FULL,

- .offset = SZ_1M + SZ_2M,

+ .name = "cramfs",

+ .offset = (4*SZ_1M),

+ .size = (4*SZ_1M),

+ },

+ [3] = {

+ .name = "ubifs",

+ .offset = MTDPART_OFS_APPEND,

+ .size = MTDPART_SIZ_FULL,

},

};

将驱动s3c_nand.c、regs-nand.h文件拷贝到相应的目录drivers/mtd/nand/s3c_nand.c和arch/arm/plat-samsung/include/plat/regs-nand.h下。

同时修改文件drivers/mtd/nand/Kconfig

+config MTD_NAND_S3C

+ state "NAND Flash support for Samsung S3C SoCs"

+ depends on ARCH_S3C2410 || ARCH_S3C64XX

+ help

+ This enables the NAND flash controller on the S3C SoCs

+

+ No board specific support is done by this driver, each board

+ must advertise a platform_device for the driver to attach.

+

+config MTD_NAND_S3C_DEBUG

+ bool "Samsung S3C NAND driver debug"

+ depends on MTD_NAND_S3C

+ help

+ Enable debugging of the S3C NAND driver

+

+config MTD_NAND_S3C_HWECC

+ bool "Samsung S3C NAND Hardware ECC"

+ depends on MTD_NAND_S3C

+ help

+ Enable the use of the controllers internal ECC generator when

+ using NAND. Early versions of the chips have

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top