jackzheng2002 发表于 2005-4-11 20:28:32

嵌入式Linux 2.6 内核专题

Linux 2.6 内核集成了很多针对嵌入式的内容,现在就从我们手头的ARM开发板开始,来跑自己的Linux 2.6吧 :)
-------------------------------------------------------------------------------------
希望大家有什么问题和资源,来这里交流!

jackzheng2002 发表于 2005-4-12 18:48:27

Linux 2.6.10以后,Samsung S3C2410已经成为linux的一个标准支持平台,
无需任何patch就可以在S3C2410的目标板上运行得很好。

从目前追踪2.6内核代码的情况来看:
1、2.4内核代码越升级写的越混乱,特别是mizi的那套release版本,韩国人的编码风格实在不好。
2、2.6的代码结构比2.4更加清晰,资源的定义进行了分类,可读性很好,条理清楚,修改起来容易。
3、2.6的代码相当精炼,大量使用C的struct实现了C++的面向对象风格,看起来很舒服。
4、2.6支持标准的高级电源管理apm,mizi的那个mizi_bios和apm2是他们自己写的,和标准不兼容,修改起来费劲。
5、在同样的目标板上,我发现2.6的内核跑起来比2.4省电,电流表上的显示结果相差近50mA左右,
可以相信,2.6在硬件资源的管理上做得很好。这可真是个意外的发现。


Linux 2.6: http://www.kernel.org/pub/linux/kernel/v2.6/
Ben Dooks是s3c2410/s3c2440平台内核的主要开发人员,http://www.fluff.org/ben/linux-26/
这个人的精神值得敬佩,看他的代码就知道了。

2.6.11在2.6.10上又作了一些修改和更新,就从2.6.11开始吧,
在2.6.11内核的基础上,要做的工作是:
1、增加自己的Nand flash分区信息:
在arch/arm/mach-s3c2410/devs.c中定义nand flash的分区信息s3c_nand_info,
然后在s3c_device_nand中增加
.dev = {
.platform_data = &s3c_nand_info
}
在arch/arm/mach-s3c2410/mach-smdk2410.c中的__initdata部分增加&s3c_device_nand使内核在启动的时候初始化nand flash信息。

这样基本上就可以跑起来了,但是默认的MTD在使用ECC的时候总是不对,可以把ECC设置为chip->eccmode = NAND_ECC_NONE; 但是并不推荐这种方式。

2、2.6版本的yaffs文件系统:
从这里http://husaberg.toby-churchill.com/balloon/linux-2.6.8.1-tcl1/fs/把yaffs拖下来加入代码树中,
配置一下就可以使用。

3、2.6.11的内核能够很好的进入POWER_OFF模式。
在arch/arm/mach-s3c2410/irq.c中定义好wake up的中断资源和掩码:
unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
unsigned long s3c_irqwake_intmask = 0xffffffffL;
unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
unsigned long s3c_irqwake_eintmask = 0xffffffffL;

2.6可以通过两种方式唤醒,一个是定时器,另一个是外部中断,把s3c_irqwake_eintallow设置成自己定义的中断位,
然后,用apm -s可以使系统进入休眠模式,通过对应的外部中断按钮可以唤醒系统。
实测结果是S3C2410休眠后仍然消耗20mA的电流,有点偏大,这可能与板子的其他资源有关,还需要在休眠前关掉其他的资源。

但是,在2.4和2.6都存在的两个问题是:
a、root文件系统是cramfs,系统进入休眠模式再唤醒后会出现“Error -3 while decompressing!“,
这是fs/cramfs/uncompress.c在解压的时候出的问题,原因还没搞清楚。
b、/usr作为yaffs来使用,系统进入休眠模式再唤醒后所有的文件及文件夹都不见了,只剩下一个lost+found,
即使是休眠前umount,唤醒后再mount,结果都是一样的。
怀疑是mtd的信息丢失,或者是nand controller registers的值没有保存好。

4、剩下的工作就是LCD driver、Touch Screen driver、Sound driver、NetWork driver等等驱动的工作了,
可以根据iPAQ 1940: http://www.handhelds.org/projects/h1940.html的patch进行修改,
也可以从google和论坛中找到的各个patch和diff文件进行分析、拷贝和粘贴,不同的板子作相应的调整。

-------------
From: www.linuxforum.net

appy 发表于 2005-4-15 13:00:40

2410的USB驱动怎么搞进去呀,各位大侠能说说吗?

dwkkfekoa 发表于 2005-4-15 22:57:29

VIVI version 0.1.4 (root@n600clinux) (gcc version 2.95.2 20000516 (release) [Reb
el.com]) #0.1.4 Fri Apr 15 21:06:59 EDT 2005
MMU table base address = 0x33DFC000
Succeed memory mapping.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Found saved vivi parameters.
Press Return to start the LINUX now, any other key for vivi
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x001c0000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySA
C0"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux............................................................
done, booting the kernel.
Linux version 2.6.11.7 (root@n600clinux) (gcc version 3.4.3) #3 Fri Apr 15 20:18
:28 EDT 2005
CPU: ARM920Tid(wb) revision 0 (ARMv4T)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410 (id 0x32410000)
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C2410 Clock control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62864KB available (1530K code, 304K data, 80K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: devfs_debug: 0x0
devfs: boot_options: 0x1
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
NFTL driver: nftlcore.c $Revision: 1.97 $, nftlmount.c $Revision: 1.40 $
INFTL: inftlcore.c $Revision: 1.18 $, inftlmount.c $Revision: 1.16 $
block2mtd: version $Revision: 1.23 $
S3C2410 NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4980000
s3c2410-nand: timing: Tacls 10ns, Twrph0 40ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
Scanning device for bad blocks
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
0x00020000-0x00030000 : "param"
0x00030000-0x00200000 : "kernel"
0x00200000-0x00400000 : "root"
0x00400000-0x04000000 : "user"
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
NET: Registered protocol family 1
end_request: I/O error, dev mtdblock3, sector 2
EXT2-fs: unable to read superblock
end_request: I/O error, dev mtdblock3, sector 0
Buffer I/O error on device mtdblock3, logical block 0
end_request: I/O error, dev mtdblock3, sector 0
Buffer I/O error on device mtdblock3, logical block 0
end_request: I/O error, dev mtdblock3, sector 8
Buffer I/O error on device mtdblock3, logical block 1
end_request: I/O error, dev mtdblock3, sector 8
Buffer I/O error on device mtdblock3, logical block 1
end_request: I/O error, dev mtdblock3, sector 16
Buffer I/O error on device mtdblock3, logical block 2
end_request: I/O error, dev mtdblock3, sector 16
Buffer I/O error on device mtdblock3, logical block 2
end_request: I/O error, dev mtdblock3, sector 24
Buffer I/O error on device mtdblock3, logical block 3
end_request: I/O error, dev mtdblock3, sector 24
Buffer I/O error on device mtdblock3, logical block 3
end_request: I/O error, dev mtdblock3, sector 0
romfs: unable to read superblock
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)



大侠!MTD要做改动吗?

dwkkfekoa 发表于 2005-4-18 14:52:47

去掉ECC之后可以挂ROOT文件系统
但还没有进入console,大概是rootfs的问题。

其它的我没改过什么地方

NET: Registered protocol family 1
VFS: Mounted root (cramfs filesystem) readonly.
Mounted devfs on /dev
Freeing init memory: 92K

jackzheng2002 发表于 2005-4-23 19:35:31

去掉ECC之后可以挂ROOT文件系统
但还没有进入console,大概是rootfs的问题。

其它的我没改过什么地方

NET: Registered protocol family 1
VFS: Mounted root (cramfs filesystem) readonly.
Mounted devfs on /dev
Freeing init memory: 92K

呵呵,去掉ecc用nand! 以前我是这么做的,不过听人说这样会对nand造成坏块。。。
我现在在重建rootfs, 2。4。18的要做不少的改动吧。。。

jackzheng2002 发表于 2005-5-8 17:00:30

感谢superlp 的总结。。。。
http://superlp.blogchina.com/1391393.html

--------------------------------------------------------------------------------
port linux 2.6.11.7 kernel to s3c2410(SMDK2410) - -
                                       



1 preparation
   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
#include
#include
/***********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;

3config 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 May2 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
# CONFIG_MACH_RX3715 is not set
CONFIG_CPU_S3C2410=y

#
# S3C2410 Setup
#
# CONFIG_S3C2410_DMA is not set
CONFIG_S3C2410_LOWLEVEL_UART_PORT=0

#
# Processor Type
#
CONFIG_CPU_32=y
CONFIG_CPU_ARM920T=y
CONFIG_CPU_32v4=y
CONFIG_CPU_ABRT_EV4T=y
CONFIG_CPU_CACHE_V4WT=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_COPY_V4WB=y
CONFIG_CPU_TLB_V4WBI=y

#
# Processor Features
#
CONFIG_ARM_THUMB=y
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set

#
# General setup
#
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_XIP_KERNEL is not set

#
# PCCARD (PCMCIA/CardBus) support
#
# CONFIG_PCCARD is not set

#
# PC-card bridges
#

#
# At least one math emulation must be selected
#
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_MISC=y

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_PM is not set
# CONFIG_PREEMPT is not set
# CONFIG_ARTHUR is not set
CONFIG_CMDLINE=""
CONFIG_ALIGNMENT_TRAP=y

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_AFS_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
CONFIG_NFTL=y
# CONFIG_NFTL_RW is not set
# CONFIG_INFTL is not set

#
# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set
# CONFIG_MTD_BLOCK2MTD is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set

#
# NAND Flash Device Drivers
#
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_NAND_S3C2410=y
# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
# CONFIG_MTD_NAND_S3C2410_HWECC is not set
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set

#
# Plug and Play support
#

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_RAM is not set
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CDROM_PKTCDVD is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Networking support
#
# CONFIG_NET is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set

#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set

#
# SCSI device support
#
# CONFIG_SCSI is not set

#
# Fusion MPT device support
#

#
# IEEE 1394 (FireWire) support
#

#
# I2O device support
#

#
# ISDN subsystem
#

#
# Input device support
#
CONFIG_INPUT=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
# CONFIG_SERIO is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_S3C2410=y
CONFIG_SERIAL_S3C2410_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_S3C2410_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set

#
# I2C support
#
# CONFIG_I2C is not set

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#

#
# File systems
#
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set

#
# XFS support
#
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_SYSFS=y
CONFIG_DEVFS_FS=y
CONFIG_DEVFS_MOUNT=y
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS_XATTR is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_NAND=y
# CONFIG_JFFS2_FS_NOR_ECC is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
# CONFIG_JFFS2_RUBIN is not set
CONFIG_CRAMFS=y
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Graphics support
#
# CONFIG_FB is not set

#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y

#
# Sound
#
# CONFIG_SOUND is not set

#
# Misc devices
#

#
# USB support
#
# CONFIG_USB is not set
CONFIG_USB_ARCH_HAS_HCD=y
# CONFIG_USB_ARCH_HAS_OHCI is not set

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
#

#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set

#
# MMC/SD Card support
#
# CONFIG_MMC is not set

#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_FS is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_WAITQ is not set
# CONFIG_DEBUG_ERRORS is not set
CONFIG_DEBUG_LL=y
# CONFIG_DEBUG_ICEDCC is not set
CONFIG_DEBUG_S3C2410_PORT=y
CONFIG_DEBUG_S3C2410_UART=0

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Hardware crypto devices
#

#
# Library routines
#
# CONFIG_CRC_CCITT is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y

4 compile kernel
    make
5 set linux command line
   for example:    noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200 mac=00:0e:3a:aa:bb:cc
6 result
the result is as follows:
Uncompressing Linux........................................ done, booting the kernel.
Linux version 2.6.11.7 ([email protected]) (gcc version 3.4.1) #7 Mon May 2 14:21:51 CST 2005
CPU: ARM920Tid(wb) revision 0 (ARMv4T)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C2410 Clock control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200 mac=00:0e:3a:aa:bb:cc
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 63520KB available (961K code, 238K data, 56K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Linux NoNET1.0 for Linux 2.6
S3C2410: Initialising architecture
NetWinder Floating Point Emulator V0.97 (double precision)
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: boot_options: 0x1
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
NFTL driver: nftlcore.c $Revision: 1.97 $, nftlmount.c $Revision: 1.40 $
S3C2410 NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4880000
s3c2410-nand: timing: Tacls 10ns, Twrph0 40ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "loader"
0x00020000-0x00030000 : "param"
0x00030000-0x001f0000 : "kernel"
0x00200000-0x00400000 : "root"
0x00400000-0x03ef8000 : "user"
mice: PS/2 mouse device common for all mice
Reading data from NAND FLASH without ECC is not recommended
VFS: Mounted root (cramfs filesystem) readonly.
Mounted devfs on /dev
Freeing init memory: 56K
mount /etc as ramfs
re-create the /etc/mtab entries
Reading data from NAND FLASH without ECC is not recommended
/sbin/insmod: relocation error: /sbin/insmod: symbol query_module, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
mount: Mounting /dev/mtdblock/4 on /usr failed: No such device
console=/dev/console
init started:BusyBox v0.60.3 (2002.05.13-08:36+0000) multi-call binary
Starting pid 23, console /dev/console: '/etc/init.d/rcS'
mount: Mounting tmpfs on /dev/shm failed: No such file or directory
exec: /usr/etc/rc.local: No such file or directory
Waiting for enter to start '/bin/sh' (pid 26, terminal /dev/console)

Please press Enter to activate this console.
Starting pid 26, console /dev/console: '/bin/sh'


BusyBox v0.60.3 (2002.05.13-08:36+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

#

7 conclusion
the basic function is ok now , next the ecc should be corrected and many drivers should be added.(to be continued)

jackzheng2002 发表于 2005-5-8 17:05:30

欢迎大家来此交流2.6.11的应用。。。。

jackzheng2002 发表于 2005-5-8 17:13:31

欢迎大家来此交流2.6.11的应用。。。。

jackzheng2002 发表于 2005-5-10 15:10:39

yaffs 已经 编译到内核了,但是yaffs作为root还有点问题:

Kernel command line: noinitrd root=/dev/mtdblock/3 init=/linuxrc console=ttySAC0irq: clearing pending ext status 00000300
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62848KB available (1573K code, 347K data, 80K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
NetWinder Floating Point Emulator V0.97 (double precision)
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: devfs_debug: 0x0
devfs: boot_options: 0x1
Initializing Cryptographic API
Real Time Clock Driver v1.12
S3C2410 RTC, (c) 2004 Simtec Electronics
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev E at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
S3C2410 NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4a00000
s3c2410-nand: timing: Tacls 10ns, Twrph0 40ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bi)NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Bad eraseblock 307 at 0x004cc000
Bad eraseblock 308 at 0x004d0000
Bad eraseblock 309 at 0x004d4000
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00020000 : "vivi"
mtd: Giving out device 0 to vivi
0x00020000-0x00030000 : "param"
mtd: Giving out device 1 to param
0x00030000-0x00200000 : "kernel"
mtd: Giving out device 2 to kernel
0x00200000-0x00500000 : "root"
mtd: Giving out device 3 to root
0x00400000-0x03f00000 : "usr"
mtd: Giving out device 4 to usr
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
NET: Registered protocol family 1
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
Reading data from NAND FLASH without ECC is not recommended
yaffs: dev is 32505859 name is "(unavailable)"
VFS: Mounted root (yaffs filesystem).
mount_devfs_fs(): unable to mount devfs, err: -2
Freeing init memory: 80K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.Try passing init= option to kernel.

分区 mtdblock/3烧录了 mkyaffsimage作成的root的映象...

Myforever 发表于 2005-5-12 20:29:11

/***********add here*************/
#include
#include
#include
/***********end add*************/


请问上面引用了哪些头文件?

安照那个修改打方法做,编译有错误

arch/arm/mach-s3c2410/devs.c:154: warning: (near initialization for `nandset')
arch/arm/mach-s3c2410/devs.c:157: error: variable `superlpplatform' has initiali
zer but incomplete type
arch/arm/mach-s3c2410/devs.c:158: error: unknown field `tacls' specified in init
ializer
arch/arm/mach-s3c2410/devs.c:158: warning: excess elements in struct initializer
arch/arm/mach-s3c2410/devs.c:158: warning: (near initialization for `superlpplat
form')
arch/arm/mach-s3c2410/devs.c:159: error: unknown field `twrph0' specified in ini
tializer
arch/arm/mach-s3c2410/devs.c:159: warning: excess elements in struct initializer
arch/arm/mach-s3c2410/devs.c:159: warning: (near initialization for `superlpplat
form')
arch/arm/mach-s3c2410/devs.c:160: error: unknown field `twrph1' specified in ini
tializer
arch/arm/mach-s3c2410/devs.c:160: warning: excess elements in struct initializer
arch/arm/mach-s3c2410/devs.c:160: warning: (near initialization for `superlpplat
form')
arch/arm/mach-s3c2410/devs.c:161: error: unknown field `sets' specified in initi
alizer
arch/arm/mach-s3c2410/devs.c:161: warning: excess elements in struct initializer
arch/arm/mach-s3c2410/devs.c:161: warning: (near initialization for `superlpplat
form')
arch/arm/mach-s3c2410/devs.c:162: error: unknown field `nr_sets' specified in in
itializer
arch/arm/mach-s3c2410/devs.c:162: warning: excess elements in struct initializer
arch/arm/mach-s3c2410/devs.c:162: warning: (near initialization for `superlpplat
form')
arch/arm/mach-s3c2410/devs.c:165: error: redefinition of 's3c_device_nand'
arch/arm/mach-s3c2410/devs.c:122: error: previous definition of 's3c_device_nand
' was here
arch/arm/mach-s3c2410/devs.c:152: error: storage size of `nandset' isn't known
arch/arm/mach-s3c2410/devs.c:157: error: storage size of `superlpplatform' isn't
known
include/linux/mtd/nand_ids.h:31: warning: 'nand_flash_ids' defined but not used
arch/arm/mach-s3c2410/devs.c:178: warning: 's3c_usbgadget_resource' defined but
not used
make: *** Error 1
make: *** Error 2
#

jackzheng2002 发表于 2005-5-12 22:03:09

http://superlp.blogchina.com/1391393.html

Myforever 发表于 2005-5-14 09:05:50

http://superlp.blogchina.com/1391393.html

这里我看了

就是因为开头引用了三个未知的头文件

???

这三个头文件是?

superlp 发表于 2005-5-15 05:24:39



这里我看了

就是因为开头引用了三个未知的头文件

???

这三个头文件是?

#include <linux/mtd/partitions.h>
#include <asm/arch/nand.h>
#include <linux/mtd/nand.h>

刚刚加进去了

superlp 发表于 2005-5-15 05:26:56

终于把yaffs作root搞定了
http://superlp.blogchina.com/1528758.html
                                    

add yaffs fs support in kernel and make yaffs rootfs
1 preparation
a>download yaffs source code and add it in your kernel source code in fs/yaffs
    http://husaberg.toby-churchill.com/balloon/linux-2.6.8.1-tcl1/fs/yaffs
    modify fs/Kconfig , add following option
    config YAFFS_FS
      tristate "YAFFS filesystem support"
      depends on MTD_NAND
       help
      If you want YAFFS support on NAND flash devices you either need to have
      NAND mtd support or customise the NAND interface.
      YAFFS is a journaling filesystem tailored to the idiosyncrasies of
      NAND flash memory. For further details see
      YAFFS is also available as a module ( = code which can be
      i nserted in and removed from the running kernel whenever you want).
      The module is called nfsd. If you want to compile it as a module,
      say M here and read . If unsure,
      say N.

      config CRAMFS
      tristate "Compressed ROM file system support (cramfs)"
      ...

b>download nandwrite.c , nanddump.c and eraseall.c from
      ftp://166.111.68.183/pub/embed/uclinux/soft/uClinux-dist/user/mtd-utils/
      compile them.
      arm-linux-gcc nandwrite.c -o nandwrite
      arm-linux-gcc nanddump.c -o nanddump
      arm-linux-gcc eraseall.c -o eraseall

c>modify devs.c to add a new partition in mtd (optional) , the yaffs will be in the"yaffs" partition
    like:
    {
      name: "user",
      size: 0x00c00000,
      offset: 0x00400000,
      mask_flags: MTD_WRITEABLE,
    }, {
      name: "yaffs",
      size: 0x02000000,
      offset: 0x01000000,
      mask_flags: MTD_WRITEABLE,
    }
    ......
    nr_partitions: 6 ,

    note: if you do so, the bootloader(vivi)'s partition table should be changed too.(part del/add)
2 compile your kernel
3 make yaffs partition
    a>make yaffs image
      download mkyaffsimage from http://husaberg.toby-churchill.com/balloon/releases/v0.7/roots/
      put your files in temp directory
      ./mkyaffsimage temp temp.yaffs
    b>write image to flash
      ./eraseall /dev/mtd/5
      ./nandwrite /dev/mtd/5 temp.yaffs 16384
    note:I've read the source code of yaffs, and find that the first block is not scaned when the super block is loaded. So             your image should be write to the second block.
            Each block is 512*32 (BYTESPERCHUNK*CHUNKSPERBLOCK) bytes.
4 Good luck.....
页: [1] 2 3 4 5 6 7
查看完整版本: 嵌入式Linux 2.6 内核专题