my board is s3c2410 SMDK2410
a>download kernel
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.7.tar.gz
decompress and no patch is needed
b>install the gcc compiler
ftp://ftp.handhelds.org/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2
2 modify kernel source
a>add your nand flash partition information
modify the arch/arm/mach-s3c2410/devs.c file
for example:
/***********add here*************/
#include <linux/mtd/partitions.h>
#include <asm/arch/nand.h>
#include <linux/mtd/nand.h>
/***********end add*************/
...
/*****************************add here***************************/
static struct mtd_partition partition_info[] ={
{
name: "loader",
size: 0x00020000,
offset: 0,
}, {
name: "param",
size: 0x00010000,
offset: 0x00020000,
}, {
name: "kernel",
size: 0x001c0000,
offset: 0x00030000,
}, {
name: "root",
size: 0x00200000,
offset: 0x00200000,
mask_flags: MTD_WRITEABLE,
}, {
name: "user",
size: 0x03af8000,
offset: 0x00400000,
}
};
struct s3c2410_nand_set nandset ={
nr_partitions: 5 ,
partitions: partition_info ,
};
struct s3c2410_platform_nand superlpplatform={
tacls:0,
twrph0:30,
twrph1:0,
sets: &nandset,
nr_sets: 1,
};
/********************************end add****************************/
struct platform_device s3c_device_nand = {
.name = "s3c2410-nand",
.id = 0xec,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
.dev = {
.platform_data = &superlpplatform //***********add here*****
}
};
b>add "&s3c_device_nand" to the __initdata in the arch/arm/mach-s3c2410/mach-smdk2410.c
c>disable the ecc
modify the drivers/mtd/nand/s3c2410.c
for example:
/**** chip->eccmode = NAND_ECC_SOFT; **/
chip->eccmode = NAND_ECC_NONE;
3 config the kernel
a>modify the MakeFile
for example:
##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/ )
SUBARCH :=arm
##CROSS_COMPILE ?=
CROSS_COMPILE ?=/toolchain/bin/arm-linux- ##according to your situation
b>make menuconfig....
the following is my configuration
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11.7
# Mon May 2 14:26:10 2005
#
CONFIG_ARM=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_IOMAP=y
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y
#
# General setup
#
CONFIG_LOCALVERSION=""
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_HOTPLUG is not set
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SHMEM=y
CONFIG_CC_ALIGN_FUNCTIONS=0
CONFIG_CC_ALIGN_LABELS=0
CONFIG_CC_ALIGN_LOOPS=0
CONFIG_CC_ALIGN_JUMPS=0
# CONFIG_TINY_SHMEM is not set
#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
#
# System Type
#
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_CAMELOT is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_IOP3XX is not set
# CONFIG_ARCH_IXP4XX is not set
# CONFIG_ARCH_IXP2000 is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_RPC is not set
# CONFIG_ARCH_SA1100 is not set
CONFIG_ARCH_S3C2410=y
# CONFIG_ARCH_SHARK is not set
# CONFIG_ARCH_LH7A40X is not set
# CONFIG_ARCH_OMAP is not set
# CONFIG_ARCH_VERSATILE is not set
# CONFIG_ARCH_IMX is not set
# CONFIG_ARCH_H720X is not set
#
# S3C24XX Implementations
#
# CONFIG_ARCH_BAST is not set
# CONFIG_ARCH_H1940 is not set
CONFIG_ARCH_SMDK2410=y
# CONFIG_MACH_VR1000 is not set
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




