This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

u-boot2010.06 对YAFFS2的支持

Other Parts Discussed in Thread: AM3505

 按照网上的方法修改了cmd_nand.c,nand_util.c, nand_base.c等文件,用生成的u-boot.bin烧写文件系统,

再用nand read重新读出刚刚写进flash的数据,但是显示都是0xFF 说明没有烧进去,请问需要怎样修改u-boot?
  • 你这个是用的什么片子,跑的什么系统,在什么板子上跑?

  • am3505,linux2.6.37,板子是自己设计的,现在移植的u-boot.bin已经可以将yaffs2文件镜像下载到nand中,nand分区:

    0x000000000000-0x000000080000 : "xloader-nand"

    0x000000080000-0x000000240000 : "uboot-nand"

    0x000000240000-0x000000280000 : "params-nand"

    0x000000280000-0x000000780000 : "linux-nand"

    0x000000780000-0x000006b80000 : "jffs2-nand"

    0x000006b80000-0x000010000000 : "yaffs2-nand"

    或者

    0x000000000000-0x000000080000 : "xloader-nand"

    0x000000080000-0x000000240000 : "uboot-nand"

    0x000000240000-0x000000280000 : "params-nand"

    0x000000280000-0x000000780000 : "linux-nand"

    0x000000780000-0x000010000000 : "yffs2-nand"

    这两种方法都不能正常挂载yaffs2,提示:

    yaffs: dev is 32505861 name is "mtdblock5" rw

    yaffs: passed flags ""

  • 链接看过了,好像没讲怎么移植yaffs,我目前使用的是jffs2根文件系统,但是挂载时很慢差不多要10s,而且进入文件系统后,启动QT应用程序也很慢,将近20s,所以我想换成yaffs试试,但是移植没有移植成功。我还有个思路,就是根文件系统用cramfs,然后在jffs2系统中启动QT程序,不知道能否提高系统启动速度,以下是目前串口打印的启动信息:

    40X

    Texas Instruments X-Loader_Luheng 1.51 (Mar  7 2012 - 17:24:11)

    MFR:Samsung,ID:0xda

    Booting from nand . . .

    Starting OS Bootloader...

    U-Boot 2010.06 (Aug 07 2012 - 11:34:40)

    OMAP34xx/35xx-GP ES1.0, CPU-OPP2 L3-165MHz

    AM3505_3I Board + LPDDR/NAND

    I2C:   ready

    DRAM:  256 MiB

    NAND:  HW ECC [Kernel/FS layout] selected

    nand MFR:0xEC,ID:0xDA

    256 MiB

    *** Warning - bad CRC or NAND, using default environment

    In:    serial

    Out:   serial

    Err:   serial

    Die ID #734400010000000001608a901200f014

    Hit any key to stop autoboot:  0

    Booting from nand ...

    NAND read: device 0 offset 0x280000, size 0x400000

    Skipping bad block 0x00540000

    Skipping bad block 0x00560000

    4194304 bytes read: OK

    ## Booting kernel from Legacy Image at 82000000 ...

      Image Name:   Linux-2.6.37

      Image Type:   ARM Linux Kernel Image (uncompressed)

      Data Size:    2338092 Bytes = 2.2 MiB

      Load Address: 80008000

      Entry Point:  80008000

      Verifying Checksum ... OK

      Loading Kernel Image ... OK

    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.

    [    0.000000] Linux version 2.6.37 (luheng@luheng) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #6 Tue Aug 7 11:17:45 CST 2012

    [    0.000000] CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7), cr=10c53c7f

    [    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

    [    0.000000] Machine: AM3505 3I_BOARD

    [    0.000000] Reserving 4194304 bytes SDRAM for VRAM

    [    0.000000] Memory policy: ECC disabled, Data cache writeback

    [    0.000000] AM3505 ES1.1 (l2cache iva neon isp )

    [    0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000

    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64000

    [    0.000000] Kernel command line: console=ttyO2,115200n8 root=/dev/mtdblock4 rw rootfstype=jffs2

    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

    [    0.000000] Memory: 252MB = 252MB total

    [    0.000000] Memory: 243896k/243896k available, 18248k reserved, 0K highmem

    [    0.000000] Virtual kernel memory layout:

    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

    [    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)

    [    0.000000]     vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)

    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)

    [    0.000000]       .init : 0xc0008000 - 0xc008f000   ( 540 kB)

    [    0.000000]       .text : 0xc008f000 - 0xc045d0d8   (3897 kB)

    [    0.000000]       .data : 0xc045e000 - 0xc06001a0   (1673 kB)

    [    0.000000] NR_IRQS:375

    [    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz

    [    0.000000] omap_hwmod: i2c1: softreset failed (waited 10000 usec)

    [    0.000000] omap_hwmod: i2c2: softreset failed (waited 10000 usec)

    [    0.000000] omap_hwmod: i2c3: softreset failed (waited 10000 usec)

    [    0.000000] Reprogramming SDRC clock to 332000000 Hz

    [    0.000000] dpll3_m2_clk rate change failed: -22

    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts

    [    0.000000] Total of 96 interrupts on 1 active controller

    [    0.000000] GPMC revision 5.0

    [    0.000000] Trying to install interrupt handler for IRQ368

    [    0.000000] Trying to install interrupt handler for IRQ369

    [    0.000000] Trying to install interrupt handler for IRQ370

    [    0.000000] Trying to install interrupt handler for IRQ371

    [    0.000000] Trying to install interrupt handler for IRQ372

    [    0.000000] Trying to install interrupt handler for IRQ373

    [    0.000000] Trying to install interrupt handler for IRQ374

    [    0.000000] Trying to install type control for IRQ375

    [    0.000000] Trying to set irq flags for IRQ375

    [    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz

    [    0.000000] Console: colour dummy device 80x30

    [    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar

    [    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8

    [    0.000000] ... MAX_LOCK_DEPTH:          48

    [    0.000000] ... MAX_LOCKDEP_KEYS:        8191

    [    0.000000] ... CLASSHASH_SIZE:          4096

    [    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384

    [    0.000000] ... MAX_LOCKDEP_CHAINS:      32768

    [    0.000000] ... CHAINHASH_SIZE:          16384

    [    0.000000]  memory used by lock dependency info: 3951 kB

    [    0.000000]  per task-struct memory footprint: 2304 bytes

    [    0.000000] Calibrating delay loop... 601.84 BogoMIPS (lpj=2351104)

    [    0.000000] pid_max: default: 32768 minimum: 301

    [    0.000000] Security Framework initialized

    [    0.000000] Mount-cache hash table entries: 512

    [    0.000000] CPU: Testing write buffer coherency: ok

    [    0.000000] regulator: core version 0.5

    [    0.000000] regulator: dummy:

    [    0.000000] NET: Registered protocol family 16

    [    0.000000] ------------[ cut here ]------------

    [    0.000000] WARNING: at arch/arm/mach-omap2/pm.c:94 _init_omap_device+0x84/0xa4()

    [    0.000000] _init_omap_device: could not find omap_hwmod for iva

    [    0.000000] Modules linked in:

    [    0.000000] [<c009f678>] (unwind_backtrace+0x0/0xec) from [<c00c60b0>] (warn_slowpath_common+0x4c/0x64)

    [    0.000000] [<c00c60b0>] (warn_slowpath_common+0x4c/0x64) from [<c00c6148>] (warn_slowpath_fmt+0x2c/0x3c)

    [    0.000000] [<c00c6148>] (warn_slowpath_fmt+0x2c/0x3c) from [<c00a6d54>] (_init_omap_device+0x84/0xa4)

    [    0.000000] [<c00a6d54>] (_init_omap_device+0x84/0xa4) from [<c000fda8>] (omap2_common_pm_init+0x2c/0x10c)

    [    0.000000] [<c000fda8>] (omap2_common_pm_init+0x2c/0x10c) from [<c008f3b8>] (do_one_initcall+0xc8/0x1a0)

    [    0.000000] [<c008f3b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>] (kernel_init+0x94/0x14c)

    [    0.000000] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009a590>] (kernel_thread_exit+0x0/0x8)

    [    0.000000] ---[ end trace 1b75b31a2719ed1c ]---

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] OMAP GPIO hardware version 2.5

    [    0.000000] omap_mux_init: Add partition: #1: core, flags: 0

    [    0.000000] Display initialized successfully

    [    0.000000] hw-breakpoint: debug architecture 0x4 unsupported.

    [    0.000000] !!!mcbsp.c261:omap2_mcbsp_init enter

    [    0.000000] OMAP DMA hardware revision 4.0

    [    0.056182] bio: create slab <bio-0> at 0

    [    0.064178] SCSI subsystem initialized

    [    0.067169] usbcore: registered new interface driver usbfs

    [    0.068908] usbcore: registered new interface driver hub

    [    0.070190] usbcore: registered new device driver usb

    [    0.075134] omap_device: omap_i2c.1: new worst case activate latency 0: 30517

    [    0.075286] omap_i2c omap_i2c.1: bus 1 rev3.12 at 400 kHz

    [    0.079162] omap_device: omap_i2c.1: new worst case deactivate latency 0: 30517

    [    0.086029] Switching to clocksource 32k_counter

    [    0.240875] musb-hdrc: version 6.0, otg (peripheral+host), debug=0

    [    0.241455] musb-hdrc musb-hdrc.0: dma type: dma-cppi41

    [    0.243103] <6>Waiting for PHY clock good...

    [    0.260620] musb-hdrc musb-hdrc.0: USB OTG mode controller at d0810000 using DMA, IRQ 71

    [    0.262481] NET: Registered protocol family 1

    [    0.263824] NetWinder Floating Point Emulator V0.97 (double precision)

    [    0.265808] omap_init_opp_table: no hwmod or odev for iva, [9] cannot add OPPs.

    [    0.269256] AM3505  Linux PSP version 04.02.00.07 (AM3517EVM)

    [    0.390686] VFS: Disk quotas dquot_6.5.2

    [    0.390960] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)

    [    0.392578] JFFS2 version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.

    [    0.393737] msgmni has been set to 476

    [    0.398162] io scheduler noop registered

    [    0.398193] io scheduler deadline registered

    [    0.398406] io scheduler cfq registered (default)

    [    0.404357] HZ=128Generic Backlight Driver Initialized.

    [    0.469299] OMAP DSS rev 2.0

    [    0.469421] omapdss supply vdds_dsi not found, using dummy regulator

    [    0.469940] OMAP DISPC rev 3.0

    [    0.469970] omapdss supply vdda_dac not found, using dummy regulator

    [    0.470092] OMAP VENC rev 2

    [    0.471496] OMAP DSI rev 1.0

    [    0.636169] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

    [    0.646362] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0

    [    0.648529] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1

    [    0.650421] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2

    [    1.351318] console [ttyO2] enabled

    [    1.409698] brd: module loaded

    [    1.439483] loop: module loaded

    [    1.443664] usbcore: registered new interface driver ub

    [    1.457061] mtdoops: mtd device (mtddev=name/number) must be supplied

    [    1.465179] omap2-nand driver initializing

    [    1.470001] nand MFR:0xEC,ID:0xDA

    [    1.473602] NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung )

    [    1.480804] Creating 6 MTD partitions on "omap2-nand.0":

    [    1.486450] 0x000000000000-0x000000080000 : "xloader-nand"

    [    1.503082] 0x000000080000-0x000000240000 : "uboot-nand"

    [    1.517089] 0x000000240000-0x000000280000 : "params-nand"

    [    1.530212] 0x000000280000-0x000000780000 : "linux-nand"

    [    1.545745] 0x000000780000-0x000006b80000 : "jffs2-nand"

    [    1.611267] 0x000006b80000-0x000010000000 : "yaffs2-nand"

    [    1.705871] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

    [    1.713195] ehci-omap.0 supply hsusb0 not found, using dummy regulator

    [    2.726837] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller

    [    2.738098] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1

    [    2.746795] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800

    [    2.766021] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00

    [    2.773010] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

    [    2.780181] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    [    2.787780] usb usb1: Product: OMAP-EHCI Host Controller

    [    2.793395] usb usb1: Manufacturer: Linux 2.6.37 ehci_hcd

    [    2.799102] usb usb1: SerialNumber: ehci-omap.0

    [    2.809936] hub 1-0:1.0: USB hub found

    [    2.814239] hub 1-0:1.0: 3 ports detected

    [    2.852966] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

    [    2.860565] Initializing USB Mass Storage driver...

    [    2.866668] usbcore: registered new interface driver usb-storage

    [    2.873046] USB Mass Storage support registered.

    [    2.878906] usbcore: registered new interface driver usbtest

    [    2.885009] zero gadget: Gadget Zero, version: Cinco de Mayo 2008

    [    2.891479] zero gadget: zero ready

    [    2.895111] musb-hdrc musb-hdrc.0: MUSB HDRC host driver

    [    2.903198] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2

    [    2.911560] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002

    [    2.919067] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    [    2.926666] usb usb2: Product: MUSB HDRC host driver

    [    2.931945] usb usb2: Manufacturer: Linux 2.6.37 musb-hcd

    [    2.937530] usb usb2: SerialNumber: musb-hdrc.0

    [    2.947692] hub 2-0:1.0: USB hub found

    [    2.951782] hub 2-0:1.0: 1 port detected

    [    2.964324] input: matrix-keypad as /devices/platform/matrix-keypad/input/input0

    [    2.985992] bq32k 1-0068: rtc core: registered bq32k as rtc0

    [    2.992950] i2c /dev entries driver

    [    3.001281] omap_device: omap_wdt.-1: new worst case activate latency 0: 61035

    [    3.011779] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec

    [    3.018249] omap_device: omap_wdt.-1: new worst case deactivate latency 0: 30517

    [    3.026977] oprofile: hardware counters not available

    [    3.032348] oprofile: using timer interrupt.

    [    3.036834] NET: Registered protocol family 17

    [    3.041625] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1

    [    3.051239] ThumbEE CPU extension supported.

    [    3.071350] Power Management for TI OMAP3.

    [    3.124359] clock: disabling unused clocks to save power

    [    3.422363] usb 2-1: new high speed USB device using musb-hdrc and address 2

    [    3.581695] usb 2-1: device v125f p102e is not supported

    [    3.587341] usb 2-1: New USB device found, idVendor=125f, idProduct=102e

    [    3.594390] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

    [    3.601898] usb 2-1: Product: USB Flash Drive

    [    3.606414] usb 2-1: Manufacturer: USB 2.0

    [    3.610778] usb 2-1: SerialNumber: 8741619113a742

    [    3.691741]  uba: uba1

    [    4.133148] VRAM: dma timeout while clearing memory

    [    4.154022] Console: switching to colour frame buffer device 100x30

    [    4.252258] omap_device: omap_i2c.1: new worst case activate latency 0: 91552

    [    4.260406] bq32k 1-0068: hctosys: unable to read the hardware clock

    //以下时间戳说明挂载jffs2要10s

    [   11.912322] JFFS2 notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

    [   11.932708] VFS: Mounted root (jffs2 filesystem) on device 31:4.

    [   11.939483] Freeing init memory: 540K

       System initialization...

       Hostname       : ICONTROL_3I

       Filesystem     : v1.0.0

       Kernel release : Linux 2.6.37

       Kernel version : #6 Tue Aug 7 11:17:45 CST 2012

    Mounting /proc             : [SUCCESS]

    Mounting /sys              : [SUCCESS]

    Mounting /dev              : [SUCCESS]

    Mounting /dev/pts          : [SUCCESS]

    Enabling hot-plug          : [SUCCESS]

    Populating /dev            : [SUCCESS]

    Mounting other filesystems : [SUCCESS]

    Starting syslogd           : [SUCCESS]

    System initialization complete.

    / # [   27.219421] JFFS2 notice: (433) check_node_data: wrong data CRC in data node at 0x01c980ac: read 0x56795ad0, calculated 0x2926fb2a.

    [   32.688751] HZ=128Could1 not initialize virtual console switching //此句是QT程序启动后打印的,说明QT程序启动速度很慢

  • 根文件系统和所使用文件系统的格式(yaffs)是两个概念,链接 processors.wiki.ti.com/.../Create_a_YAFFS_Target_Image%E5%B0%B1%E6%98%AF%E5%91%8A%E8%AF%89%E4%BD%A0%E6%80%8E%E4%B9%88%E5%81%9Ayaffs%E7%9A%84,而你要求的是怎么改变文件系统的内容,两个概念,如果你要改变文件系统的内容,你可以把sdk自带的文件系统mount到linux机器上进行修改。

  • 1 目前我已经实现了cramfs+jffs2这种方案,就是根文件系统用cramfs格式,QT程序运行在jffs2系统上,但是jffs2系统挂载速度还是比较慢;

    2 所以我想实现cramfs+yaffs2这个方案,但是yaffs2移植不成功,挂载目录下显示lost+host

       根据网上资料,我修改了u-boot代码中nand的驱动,使u-boot支持yaffs2镜像的烧写,又下载了yaffs2源代码,给内核打了补丁,使内核支持yaffs2,之后我把yaffs2镜像烧到nand后,手动挂载或者把yaffs2作为根文件系统自动挂载都失败,不知道和oob有没有关系