Chinaunix首页 | 论坛 | 博客
  • 博客访问: 154375
  • 博文数量: 24
  • 博客积分: 15
  • 博客等级: 民兵
  • 技术积分: 100
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-15 00:14
文章分类

全部博文(24)

文章存档

2015年(3)

2014年(2)

2013年(7)

2012年(12)

分类:

2012-03-16 15:18:27

硬件环境:Tiny6410(SLC Flash)

一、u-boot-2011.06部分
基于:tekkamanninja-u-boot-2011.06-for-MINI6410-d9a2446.tar.gz
1. 解压u-boot后,打开,gedit Makefile,ctrl + F ,输入CROSS,找到交叉编译工具所在部分,修改为:CROSS_COMPILE = arm-linux-。然后保存退出。
2. gedit include/configs/mini6410.h,
line 222

点击(此处)折叠或打开

  1. #ifdef CONFIG_ENABLE_MMU
  2. #define CONFIG_SYS_MAPPED_RAM_BASE    0xc0000000
  3. #define CONFIG_BOOTCOMMAND    "nand read 0xc0018000 0x80000 0x500000;" \
  4.                     "bootm 0xc0018000"
  5. #else
  6. #define CONFIG_SYS_MAPPED_RAM_BASE    CONFIG_SYS_SDRAM_BASE
  7. #define CONFIG_BOOTCOMMAND    "nand read 0x50018000 0x80000 0x500000;" \
  8.                     "bootm 0x50018000"
  9. #endif
line2 297

点击(此处)折叠或打开

  1. #define CONFIG_BOOTARGS        "= root=ubi0:FriendlyARM-root ubi.mtd=2 rootfstype=ubifs init=/linuxrc console=ttySAC0,115200"
保存,退出。
3. 命令行输入:
make mini6410_config
make

二、Linux3.2.8内核部分

实验1:u-boot引导内核启动
1. Makefile
original:
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
new:
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-

2. .config
cp arch/arm/configs/s3c6400_defconfig .config //先使用三星Demo板的默认配置

3. 命令行输入:
mkimage -A arm -O linux -T kernel -C none -a 0x50018000 -e 0x50018040 -n "Jason Linux" -d arch/arm/boot/zImage ./uImage

点击(此处)折叠或打开

  1. U-Boot 2011.06 (Mar 13 2012 - 13:42:03) for MINI6410


  2. CPU: S3C6400@667MHz
  3.          Fclk = 667MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)
  4. Board: MINI6410
  5. DRAM: 256 MiB
  6. NAND: 256 MiB
  7. MMC: SAMSUNG SD/MMC: Host controler CH0
  8. No SD/MMC card
  9. No MMC card for
  10. Using default environment

  11. Video: no Video params found, try bootargs~~ 640x480x24 31kHz 59Hz
  12. No SD/MMC card
  13. Video: No MMC card for background
  14. In: serial
  15. Out: serial
  16. Err: serial
  17. Net: dm9000
  18. Hit any key to stop autoboot: 0

  19. NAND read: device 0 offset 0x80000, size 0x500000
  20.  5242880 bytes read: OK
  21. ## Booting kernel from Legacy Image at 50018000 ...
  22.    Image Name: Jason Linux
  23.    Image Type: ARM Linux Kernel Image (uncompressed)
  24.    Data Size: 1399384 Bytes = 1.3 MiB
  25.    Load Address: 50018000
  26.    Entry Point: 50018040
  27.    Verifying Checksum ... OK
  28.    XIP Kernel Image ... OK
  29. OK

  30. Starting kernel ...

实验2:mach-smdk6410.c中添加Maching ID和MTD分区信息
1. arch/arm/mach-s3c64xx/mach-smdk6410.c
original:
MACHINE_START(SMDK6410, "SMDK6410")
new:
MACHINE_START(MINI6410, "MINI6410")

如果不修改Machine ID,就会输出如下打印信息:

点击(此处)折叠或打开

  1. Starting kernel ...

  2. Uncompressing Linux... done, booting the kernel.

  3. Error: unrecognized/unsupported machine ID (r1 = 0x000009d8).

  4. Available machine support:

  5. ID (hex) NAME
  6. 00000887 A&W6410
  7. 000004f6 SMDK6400
  8. 0000065a SMDK6410
  9. 0000078d NCP
  10. 000008ce Airgoo-HMT
  11. 000009e6 SmartQ 5
  12. 000009af SmartQ 7

  13. Please check your kernel config and/or bootloader.
2. arch/arm/mach-s3c64xx/mach-smdk6410.c
2.1 add:
#include
#include
#include

/* Nand flash */
struct mtd_partition mini6410_nand_part[] = {
{
.name = "Bootloader",
.offset = 0,
.size = (4 * 128 *SZ_1K),
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "Kernel",
.offset = MTDPART_OFS_APPEND,
.size = (5*SZ_1M) ,
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "File System",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
}
};

static struct s3c2410_nand_set mini6410_nand_sets[] = {
[0] = {
.name       = "nand",
.nr_chips   = 1,
.nr_partitions  = ARRAY_SIZE(mini6410_nand_part),
.partitions = mini6410_nand_part,
},
};

static struct s3c2410_platform_nand mini6410_nand_info = {
.tacls      = 25,
.twrph0     = 55,
.twrph1     = 40,
.nr_sets    = ARRAY_SIZE(mini6410_nand_sets),
.sets       = mini6410_nand_sets,
};

2.2. in the function:
static void __init smdk6410_machine_init(void)();
add:
s3c_device_nand.name = "s3c6410-nand";
s3c_nand_set_platdata(&mini6410_nand_info);

2.3. in the struct:
static struct platform_device *smdk6410_devices[] __initdata
add:
&s3c_device_nand,

如上修改后,打印如下信息:

点击(此处)折叠或打开

  1. Starting kernel ...

  2. Uncompressing Linux... done, booting the kernel.
  3. Linux version 3.2.8 (root@jason) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #5 Tue Mar 13 15:00:46 CST 2012
  4. CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d
  5. CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
  6. Machine: MINI6410
  7. Memory policy: ECC disabled, Data cache writeback
  8. CPU S3C6410 (id 0x36410101)
  9. S3C24XX Clocks, Copyright 2004 Simtec Electronics
  10. camera: no parent clock specified
  11. S3C64XX: PLL settings, A=667000000, M=533000000, E=48000000
  12. S3C64XX: HCLK2=266500000, HCLK=133250000, PCLK=66625000
  13. mout_apll: source is fout_apll (1), rate is 667000000
  14. mout_epll: source is epll (1), rate is 48000000
  15. mout_mpll: source is mpll (1), rate is 533000000
  16. mmc_bus: source is mout_epll (0), rate is 48000000
  17. mmc_bus: source is mout_epll (0), rate is 48000000
  18. mmc_bus: source is mout_epll (0), rate is 48000000
  19. usb-bus-host: source is clk_48m (0), rate is 48000000
  20. uclk1: source is mout_epll (0), rate is 48000000
  21. spi-bus: source is mout_epll (0), rate is 48000000
  22. spi-bus: source is mout_epll (0), rate is 48000000
  23. audio-bus: source is mout_epll (0), rate is 48000000
  24. audio-bus: source is mout_epll (0), rate is 48000000
  25. audio-bus: source is mout_epll (0), rate is 48000000
  26. irda-bus: source is mout_epll (0), rate is 48000000
  27. camera: no parent clock specified
  28. CPU: found DTCM0 8k @ 00000000, not enabled
  29. CPU: moved DTCM0 8k to fffe8000, enabled
  30. CPU: found DTCM1 8k @ 00000000, not enabled
  31. CPU: moved DTCM1 8k to fffea000, enabled
  32. CPU: found ITCM0 8k @ 00000000, not enabled
  33. CPU: moved ITCM0 8k to fffe0000, enabled
  34. CPU: found ITCM1 8k @ 00000000, not enabled
  35. CPU: moved ITCM1 8k to fffe2000, enabled
  36. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
  37. Kernel command line: = root=ubi0:FriendlyARM-root ubi.mtd=2 rootfstype=ubifs init=/linuxrc console=ttySAC0,115200
  38. PID hash table entries: 1024 (order: 0, 4096 bytes)
  39. Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
  40. Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
  41. Memory: 256MB = 256MB total
  42. Memory: 256916k/256916k available, 5228k reserved, 0K highmem
  43. Virtual kernel memory layout:
  44.     vector : 0xffff0000 - 0xffff1000 ( 4 kB)
  45.     DTCM : 0xfffe8000 - 0xfffec000 ( 16 kB)
  46.     ITCM : 0xfffe0000 - 0xfffe4000 ( 16 kB)
  47.     fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
  48.     vmalloc : 0xd0800000 - 0xf6000000 ( 600 MB)
  49.     lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
  50.     modules : 0xbf000000 - 0xc0000000 ( 16 MB)
  51.       .text : 0xc0008000 - 0xc0267db4 (2432 kB)
  52.       .init : 0xc0268000 - 0xc0284000 ( 112 kB)
  53.       .data : 0xc0284000 - 0xc02a85c0 ( 146 kB)
  54.        .bss : 0xc02a9024 - 0xc02d95cc ( 194 kB)
  55. SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
  56. NR_IRQS:246
  57. VIC @f6000000: id 0x00041192, vendor 0x41
  58. VIC @f6010000: id 0x00041192, vendor 0x41
  59. Console: colour dummy device 80x30
  60. Calibrating delay loop... 666.41 BogoMIPS (lpj=3332096)
  61. pid_max: default: 32768 minimum: 301
  62. Mount-cache hash table entries: 512
  63. CPU: Testing write buffer coherency: ok
  64. s3c64xx_dma_init: Registering DMA channels
  65. PL080: IRQ 73, at d0804000, channels 0..8
  66. PL080: IRQ 74, at d0806000, channels 8..16
  67. S3C6410: Initialising architecture
  68. bio: create slab <bio-0> at 0
  69. usbcore: registered new interface driver usbfs
  70. usbcore: registered new interface driver hub
  71. usbcore: registered new device driver usb
  72. s3c-i2c s3c2440-i2c.0: slave address 0x10
  73. s3c-i2c s3c2440-i2c.0: bus frequency set to 65 KHz
  74. s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
  75. s3c-i2c s3c2440-i2c.1: slave address 0x10
  76. s3c-i2c s3c2440-i2c.1: bus frequency set to 65 KHz
  77. s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
  78. ROMFS MTD (C) 2007 Red Hat, Inc.
  79. io scheduler noop registered
  80. io scheduler deadline registered
  81. io scheduler cfq registered (default)
  82. start plist test
  83. end plist test
  84. s3c-fb s3c-fb: window 0: fb
  85. Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  86. s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
  87. console [ttySAC0] enabled
  88. s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
  89. s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
  90. s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
  91. brd: module loaded
  92. loop: module loaded
  93. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  94. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  95. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  96. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  97. s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
  98. s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
  99. ohci_hcd: can't start s3c24xx
  100. s3c2410-ohci s3c2410-ohci: startup error -75
  101. s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
  102. s3c2410-ohci: probe of s3c2410-ohci failed with error -75
  103. mousedev: PS/2 mouse device common for all mice
  104. S3C24XX RTC, (c) 2004,2006 Simtec Electronics
  105. s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
  106. s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
  107. i2c /dev entries driver
  108. sdhci: Secure Digital Host Controller Interface driver
  109. sdhci: Copyright(c) Pierre Ossman
  110. s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133250000 Hz)
  111. s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133250000 Hz)
  112. s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (48000000 Hz)
  113. mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
  114. mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
  115. usbcore: registered new interface driver usbhid
  116. usbhid: USB HID core driver
  117. VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
  118. s3c-rtc s3c64xx-rtc: setting system clock to 2012-03-13 15:22:16 UTC (1331652136)
  119. VFS: Cannot open root device "ubi0:FriendlyARM-root" or unknown-block(0,0)
  120. Please append a correct "root=" boot option; here are the available partitions:
  121. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  122. [<c00138b8>] (unwind_backtrace+0x0/0xf0) from [<c01c3e78>] (panic+0x58/0x188)
  123. [<c01c3e78>] (panic+0x58/0x188) from [<c0268b40>] (mount_block_root+0x1d8/0x29c)
  124. [<c0268b40>] (mount_block_root+0x1d8/0x29c) from [<c0268df4>] (prepare_namespace+0x8c/0x1b8)
  125. [<c0268df4>] (prepare_namespace+0x8c/0x1b8) from [<c026882c>] (kernel_init+0xe8/0x11c)
  126. [<c026882c>] (kernel_init+0xe8/0x11c) from [<c000ef40>] (kernel_thread_exit+0x0/0x8)

实验3:添加s3c_nand驱动
在实验2结束后,一直把重点关注在120行开始的错误上,尝试了各种内核配置,都不得行。后来对比启动信息,发现94行后面应该打印出的MTD分区信息没有。查了下内核,在driver/mtd/nand/目录下,已没有s3c_nand.c这个驱动!
现在做了如下工作:
1. s3c_nand.c
cp s3c_nand.c driver/mtd/nand/
@driver/mtd/nand/Makefile line20:
obj-$(CONFIG_MTD_NAND_S3C) += s3c_nand.o
@driver/mtd/nand/Kconfig line230:
config MTD_NAND_S3C
tristate "NAND Flash support for S3C SoC"
depends on (ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX) && MTD_NAND
help
 This enables the NAND flash controller on the S3C.

 No board specfic support is done by this driver, each board
 must advertise a platform_device for the driver to attach.

config MTD_NAND_S3C_DEBUG
bool "S3C NAND driver debug"
depends on MTD_NAND_S3C
help
 Enable debugging of the S3C NAND driver

config MTD_NAND_S3C_HWECC
bool "S3C NAND Hardware ECC"
depends on MTD_NAND_S3C
help
 Enable the use of the S3C's internal ECC generator when
 using NAND. Early versions of the chip have had problems with
 incorrect ECC generation, and if using these, the default of
 software ECC is preferable.

 If you lay down a device with the hardware ECC, then you will
 currently not be able to switch to software, as there is no
 implementation for ECC method used by the S3C

make menuconfig
Device Driver
--->Memory Technology Device (MTD) support
--->NAND Device Support
--->< > NAND Flash support for Samsung S3C SoCs
   [*] S3C NAND driver debug 
   [*] S3C NAND Hardware ECC
   <*> NAND Flash support for S3C SoC

2.regs-nand.h
@arch/arm/plat-samsung/include/plat/regs-nand.h
add:
/* for s3c_nand.c */
#define S3C_NFCONF S3C2410_NFREG(0x00)
#define S3C_NFCONT S3C2410_NFREG(0x04)
#define S3C_NFCMMD S3C2410_NFREG(0x08)
#define S3C_NFADDR S3C2410_NFREG(0x0c)
#define S3C_NFDATA8 S3C2410_NFREG(0x10)
#define S3C_NFDATA S3C2410_NFREG(0x10)
#define S3C_NFMECCDATA0 S3C2410_NFREG(0x14)
#define S3C_NFMECCDATA1 S3C2410_NFREG(0x18)
#define S3C_NFSECCDATA S3C2410_NFREG(0x1c)
#define S3C_NFSBLK S3C2410_NFREG(0x20)
#define S3C_NFEBLK S3C2410_NFREG(0x24)
#define S3C_NFSTAT S3C2410_NFREG(0x28)
#define S3C_NFMECCERR0 S3C2410_NFREG(0x2c)
#define S3C_NFMECCERR1 S3C2410_NFREG(0x30)
#define S3C_NFMECC0 S3C2410_NFREG(0x34)
#define S3C_NFMECC1 S3C2410_NFREG(0x38)
#define S3C_NFSECC S3C2410_NFREG(0x3c)
#define S3C_NFMLCBITPT S3C2410_NFREG(0x40)
#define S3C_NF8ECCERR0 S3C2410_NFREG(0x44)
#define S3C_NF8ECCERR1 S3C2410_NFREG(0x48)
#define S3C_NF8ECCERR2 S3C2410_NFREG(0x4c)
#define S3C_NFM8ECC0 S3C2410_NFREG(0x50)
#define S3C_NFM8ECC1 S3C2410_NFREG(0x54)
#define S3C_NFM8ECC2 S3C2410_NFREG(0x58)
#define S3C_NFM8ECC3 S3C2410_NFREG(0x5c)
#define S3C_NFMLC8BITPT0 S3C2410_NFREG(0x60)
#define S3C_NFMLC8BITPT1 S3C2410_NFREG(0x64)

#define S3C_NFCONF_NANDBOOT (1<<31)
#define S3C_NFCONF_ECCCLKCON (1<<30)
#define S3C_NFCONF_ECC_MLC (1<<24)
#define S3C_NFCONF_ECC_1BIT (0<<23)
#define S3C_NFCONF_ECC_4BIT (2<<23)
#define S3C_NFCONF_ECC_8BIT (1<<23)
#define S3C_NFCONF_TACLS(x) ((x)<<12)
#define S3C_NFCONF_TWRPH0(x) ((x)<<8)
#define S3C_NFCONF_TWRPH1(x) ((x)<<4)
#define S3C_NFCONF_ADVFLASH (1<<3)
#define S3C_NFCONF_PAGESIZE (1<<2)
#define S3C_NFCONF_ADDRCYCLE (1<<1)
#define S3C_NFCONF_BUSWIDTH (1<<0)

#define S3C_NFCONT_ECC_ENC (1<<18)
#define S3C_NFCONT_LOCKTGHT (1<<17)
#define S3C_NFCONT_LOCKSOFT (1<<16)
#define S3C_NFCONT_8BITSTOP (1<<11)
#define S3C_NFCONT_MECCLOCK (1<<7)
#define S3C_NFCONT_SECCLOCK (1<<6)
#define S3C_NFCONT_INITMECC (1<<5)
#define S3C_NFCONT_INITSECC (1<<4)
#define S3C_NFCONT_nFCE1 (1<<2)
#define S3C_NFCONT_nFCE0 (1<<1)
#define S3C_NFCONT_INITECC (S3C_NFCONT_INITSECC | S3C_NFCONT_INITMECC)

#define S3C_NFSTAT_ECCENCDONE (1<<7)
#define S3C_NFSTAT_ECCDECDONE (1<<6)
#define S3C_NFSTAT_BUSY (1<<0)

#define S3C_NFECCERR0_ECCBUSY (1<<31)

3. partitions.h
@include/linux/mtd/partitions.h
add:
int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
int del_mtd_partitions(struct mtd_info *);

经过如上修改,打印信息中终于有了MTD分区信息,但是报错还是一样,看来还有其它问题。

点击(此处)折叠或打开

  1. s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
  2. s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
  3. s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
  4. brd: module loaded
  5. loop: module loaded
  6. S3C NAND Driver, (c) 2008 Samsung Electronics
  7. S3C NAND Driver is using hardware ECC.
  8. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  9. Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  10. 0x000000000000-0x000000080000 : "Bootloader"
  11. 0x000000080000-0x000000580000 : "Kernel"
  12. 0x000000580000-0x000010000000 : "File System"
  13. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  14. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI

实验4:添加对UBIFS文件系统的支持
对于实验2中串口120行开始的三条报错信息,打开一些MTD的DEBUG选项后,查看打印信息如下:

点击(此处)折叠或打开

  1. VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
  2. s3c-rtc s3c64xx-rtc: setting system clock to 2012-03-14 22:19:32 UTC (1331763572)
  3. VFS: Cannot open root device "ubi0:FriendlyARM-root" or unknown-block(0,0)
  4. Please append a correct "root=" boot option; here are the available partitions:
  5. 1f00 512 mtdblock0 (driver?)
  6. 1f01 5120 mtdblock1 (driver?)
  7. 1f02 256512 mtdblock2 (driver?)
  8. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  9. [<c00138b8>] (unwind_backtrace+0x0/0xf0) from [<c01f4d6c>] (panic+0x58/0x188)
  10. [<c01f4d6c>] (panic+0x58/0x188) from [<c02b0b40>] (mount_block_root+0x1d8/0x29c)
  11. [<c02b0b40>] (mount_block_root+0x1d8/0x29c) from [<c02b0cf4>] (prepare_namespace+0x8c/0x180)
  12. [<c02b0cf4>] (prepare_namespace+0x8c/0x180) from [<c02b082c>] (kernel_init+0xe8/0x11c)
  13. [<c02b082c>] (kernel_init+0xe8/0x11c) from [<c000ef40>] (kernel_thread_exit+0x0/0x8)
以为没挂上文件系统是因为需要添加一些驱动,网上查了UBIFS的资料,没查出个思路。中午去图书馆看嵌入式的书,打算试试cramfs,制作、配置内核,也启动不了。晚上干脆在图形化配置界面里对照友善对2.6.38内核的配置,一条条配置。文件系统挂载成功!!!所以,5/6/7行中的“(driver?)”应该是指UBIFS的驱动,这个比较高版本的内核自带有的。以下是内核支持UBIFS的配置。

make menuconfig
Device Drivers  --->
<*> Memory Technology Device (MTD) support  --->
<*>   Enable UBI - Unsorted block images  --->  

File systems  ---> 
[*] Miscellaneous filesystems  --->
<*>   UBIFS file system support (NEW) 

如上配置后,成功挂载文件系统,串口打印信息如下:

点击(此处)折叠或打开

  1. Starting kernel ...

  2. Uncompressing Linux... done, booting the kernel.
  3. Linux version 3.2.8 (root@jason) (gcc version 4.5.1 (ctng-1.8.1-FA) ) #1 Wed Mar 14 21:34:16 CST 2012
  4. CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d
  5. CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
  6. Machine: MINI6410
  7. Memory policy: ECC disabled, Data cache writeback
  8. CPU S3C6410 (id 0x36410101)
  9. S3C24XX Clocks, Copyright 2004 Simtec Electronics
  10. camera: no parent clock specified
  11. S3C64XX: PLL settings, A=667000000, M=533000000, E=48000000
  12. S3C64XX: HCLK2=266500000, HCLK=133250000, PCLK=66625000
  13. mout_apll: source is fout_apll (1), rate is 667000000
  14. mout_epll: source is epll (1), rate is 48000000
  15. mout_mpll: source is mpll (1), rate is 533000000
  16. mmc_bus: source is mout_epll (0), rate is 48000000
  17. mmc_bus: source is mout_epll (0), rate is 48000000
  18. mmc_bus: source is mout_epll (0), rate is 48000000
  19. usb-bus-host: source is clk_48m (0), rate is 48000000
  20. uclk1: source is mout_epll (0), rate is 48000000
  21. spi-bus: source is mout_epll (0), rate is 48000000
  22. spi-bus: source is mout_epll (0), rate is 48000000
  23. audio-bus: source is mout_epll (0), rate is 48000000
  24. audio-bus: source is mout_epll (0), rate is 48000000
  25. audio-bus: source is mout_epll (0), rate is 48000000
  26. irda-bus: source is mout_epll (0), rate is 48000000
  27. camera: no parent clock specified
  28. CPU: found DTCM0 8k @ 00000000, not enabled
  29. CPU: moved DTCM0 8k to fffe8000, enabled
  30. CPU: found DTCM1 8k @ 00000000, not enabled
  31. CPU: moved DTCM1 8k to fffea000, enabled
  32. CPU: found ITCM0 8k @ 00000000, not enabled
  33. CPU: moved ITCM0 8k to fffe0000, enabled
  34. CPU: found ITCM1 8k @ 00000000, not enabled
  35. CPU: moved ITCM1 8k to fffe2000, enabled
  36. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
  37. Kernel command line: = root=ubi0:FriendlyARM-root ubi.mtd=2 rootfstype=ubifs init=/linuxrc console=ttySAC0,115200
  38. PID hash table entries: 1024 (order: 0, 4096 bytes)
  39. Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
  40. Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
  41. Memory: 256MB = 256MB total
  42. Memory: 256652k/256652k available, 5492k reserved, 0K highmem
  43. Virtual kernel memory layout:
  44.     vector : 0xffff0000 - 0xffff1000 ( 4 kB)
  45.     DTCM : 0xfffe8000 - 0xfffec000 ( 16 kB)
  46.     ITCM : 0xfffe0000 - 0xfffe4000 ( 16 kB)
  47.     fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
  48.     vmalloc : 0xd0800000 - 0xf6000000 ( 600 MB)
  49.     lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
  50.     modules : 0xbf000000 - 0xc0000000 ( 16 MB)
  51.       .text : 0xc0008000 - 0xc02a5dcc (2680 kB)
  52.       .init : 0xc02a6000 - 0xc02c3000 ( 116 kB)
  53.       .data : 0xc02c4000 - 0xc02e9bc0 ( 151 kB)
  54.        .bss : 0xc02ea024 - 0xc031b068 ( 197 kB)
  55. SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
  56. NR_IRQS:246
  57. VIC @f6000000: id 0x00041192, vendor 0x41
  58. VIC @f6010000: id 0x00041192, vendor 0x41
  59. Console: colour dummy device 80x30
  60. Calibrating delay loop... 666.41 BogoMIPS (lpj=3332096)
  61. pid_max: default: 32768 minimum: 301
  62. Mount-cache hash table entries: 512
  63. CPU: Testing write buffer coherency: ok
  64. s3c64xx_dma_init: Registering DMA channels
  65. PL080: IRQ 73, at d0804000, channels 0..8
  66. PL080: IRQ 74, at d0806000, channels 8..16
  67. S3C6410: Initialising architecture
  68. bio: create slab <bio-0> at 0
  69. usbcore: registered new interface driver usbfs
  70. usbcore: registered new interface driver hub
  71. usbcore: registered new device driver usb
  72. s3c-i2c s3c2440-i2c.0: slave address 0x10
  73. s3c-i2c s3c2440-i2c.0: bus frequency set to 65 KHz
  74. s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
  75. s3c-i2c s3c2440-i2c.1: slave address 0x10
  76. s3c-i2c s3c2440-i2c.1: bus frequency set to 65 KHz
  77. s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
  78. ROMFS MTD (C) 2007 Red Hat, Inc.
  79. io scheduler noop registered
  80. io scheduler deadline registered
  81. io scheduler cfq registered (default)
  82. start plist test
  83. end plist test
  84. s3c-fb s3c-fb: window 0: fb
  85. Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  86. s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
  87. console [ttySAC0] enabled
  88. s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
  89. s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
  90. s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
  91. brd: module loaded
  92. loop: module loaded
  93. S3C NAND Driver, (c) 2008 Samsung Electronics
  94. S3C NAND Driver is using hardware ECC.
  95. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  96. Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  97. 0x000000000000-0x000000080000 : "Bootloader"
  98. 0x000000080000-0x000000580000 : "Kernel"
  99. 0x000000580000-0x000010000000 : "File System"
  100. UBI: attaching mtd2 to ubi0
  101. UBI: physical eraseblock size: 131072 bytes (128 KiB)
  102. UBI: logical eraseblock size: 129024 bytes
  103. UBI: smallest flash I/O unit: 2048
  104. UBI: sub-page size: 512
  105. UBI: VID header offset: 512 (aligned 512)
  106. UBI: data offset: 2048
  107. UBI: max. sequence number: 12
  108. UBI: attached mtd2 to ubi0
  109. UBI: MTD device name: "File System"
  110. UBI: MTD device size: 250 MiB
  111. UBI: number of good PEBs: 2004
  112. UBI: number of bad PEBs: 0
  113. UBI: number of corrupted PEBs: 0
  114. UBI: max. allowed volumes: 128
  115. UBI: wear-leveling threshold: 4096
  116. UBI: number of internal volumes: 1
  117. UBI: number of user volumes: 1
  118. UBI: available PEBs: 0
  119. UBI: total number of reserved PEBs: 2004
  120. UBI: number of PEBs reserved for bad PEB handling: 20
  121. UBI: max/mean erase counter: 2/0
  122. UBI: image sequence number: 1032572376
  123. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  124. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  125. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  126. s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
  127. UBI: background thread "ubi_bgt0d" started, PID 868
  128. s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
  129. ohci_hcd: can't start s3c24xx
  130. s3c2410-ohci s3c2410-ohci: startup error -75
  131. s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
  132. s3c2410-ohci: probe of s3c2410-ohci failed with error -75
  133. mousedev: PS/2 mouse device common for all mice
  134. S3C24XX RTC, (c) 2004,2006 Simtec Electronics
  135. s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
  136. s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
  137. i2c /dev entries driver
  138. sdhci: Secure Digital Host Controller Interface driver
  139. sdhci: Copyright(c) Pierre Ossman
  140. s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133250000 Hz)
  141. s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133250000 Hz)
  142. s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (48000000 Hz)
  143. mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
  144. mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
  145. usbcore: registered new interface driver usbhid
  146. usbhid: USB HID core driver
  147. VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
  148. s3c-rtc s3c64xx-rtc: setting system clock to 2012-03-14 22:15:40 UTC (1331763340)
  149. mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz
  150. UBIFS: recovery needed
  151. mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz
  152. UBIFS: recovery completed
  153. UBIFS: mounted UBI device 0, volume 0, name "FriendlyARM-root"
  154. UBIFS: file system size: 254048256 bytes (248094 KiB, 242 MiB, 1969 LEBs)
  155. UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
  156. UBIFS: media format: w4/r0 (latest is w4/r0)
  157. UBIFS: default compressor: lzo
  158. UBIFS: reserved for root: 0 bytes (0 KiB)
  159. VFS: Mounted root (ubifs filesystem) on device 0:8.
  160. Freeing init memory: 116K
  161. mmc0: mmc_rescan_try_freq: trying to init card at 187500 Hz
  162. depmod: chdir(3.2.8): No such file or directory
  163. [14/Mar/2012:14:15:47 +0000] boa.c:173 - unable to create socket: Function not implemented
  164.                         
  165. open device leds: No such file or directory
  166. /usr/sbin/alsactl: load_state:1610: No soundcards found...
  167.                         
  168. ifconfig: socket: Function not implemented
  169. Try to bring eth0 interface up......cat: can't open '/sys/class/net/eth0/address': No such file or directory
  170. ifconfig: socket: Function not implemented
  171. route: socket: Function not implemented
  172. Done

  173. Please press Enter to activate this console.
以下是最后的内核配置、内核修改过程以及低版本才有的的s3c_nand.c


阅读(3796) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~