AnsweredAssumed Answered

uClinux can't mount JFFS2 partition

Question asked by BryanH on Oct 4, 2012
Latest reply on Oct 10, 2012 by lliubbo

I'm putting uClinux 2011r1 on a BF537 EZ-Kit lite board in preparation for porting to our hardware. I haven't made any changes to the kernel other than changing configuration options. The kernel gets quite a ways into booting, but then it can't mount the JFFS2 partition I've created and panics.

 

I'm using the stock stamp.c MTD partition:

static struct mtd_partition stamp_partitions[] = {

    {

        .name       = "bootloader(nor)",

        .size       = 0x40000,

        .offset     = 0,

    }, {

        .name       = "linux kernel(nor)",

        .size       = 0x180000,

        .offset     = MTDPART_OFS_APPEND,

    }, {

        .name       = "file system(nor)",

        .size       = 0x400000 - 0x40000 - 0x180000 - 0x10000,

        .offset     = MTDPART_OFS_APPEND,

    }, {

        .name       = "MAC Address(nor)",

        .size       = MTDPART_SIZ_FULL,

        .offset     = 0x3F0000,

        .mask_flags = MTD_WRITEABLE,

    }

};

 

I disabled a bunch of applications so that the JFFS2 partition would fit in the 2.3M "file system(nor)" area. My rootfs.jffs2 is 1,703,936 bytes.

 

I verified the JFFS2 magic number in flash:

bfin> md.b 0x201c0000 2

201c0000: 85 19    ..

 

So what am I doing wrong? Here is the full output of the failure...

 

U-Boot 2011.09 (ADI-2011R1) (Sep 25 2012 - 18:54:10)

 

CPU:   ADSP bf537-0.2 (Detected Rev: 0.3) (parallel flash boot)

Board: ADI BF537 stamp board

       Support: http://blackfin.uclinux.org/

Clock: VCO: 500 MHz, Core: 500 MHz, System: 125 MHz

RAM:   64 MiB

Flash: 4 MiB

MMC:

In:    serial

Out:   serial

Err:   serial

KGDB:  [on serial] ready

Net:   bfin_mac

Hit any key to stop autoboot:  0

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

   Image Name:   bf537-0.3-3.0.8-ADI-2011R1

   Created:      2012-10-04   0:01:41 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    1090666 Bytes = 1 MiB

   Load Address: 00001000

   Entry Point:  001d39c0

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 001d39c0

Linux version 3.0.8-ADI-2011R1 (bhilterbrand@bh-ubuntu) (gcc version 4.5.3 (ADI-2011R1-RC4_45) ) #35 Wed Oct 3 18:01:32 MDT 2012

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x001399e0

  rodata    = 0x001399e0-0x001a704c

  bss       = 0x001a8000-0x001b84a0

  data      = 0x001b84a0-0x001cc000

    stack   = 0x001ca000-0x001cc000

  init      = 0x001cc000-0x001e9000

  available = 0x001e9000-0x03f00000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace active and enabled

Boot Mode: 1

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.3

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 16002

Kernel command line: root=/dev/mtdblock2 rw rootfstype=jffs2 clkin_hz=25000000 earlyprintk=serial,uart0,57600

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 61948k/65536k RAM, (116k init code, 1250k kernel code, 586k data, 1024k dma, 612k reserved)

NR_IRQS:146

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (35 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs@ffc00500, dma channel@7

Switching to clocksource bfin_cs_cycles

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

debug-mmrs: setting up Blackfin MMR debugfs

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

JFFS2: default compression mode: priority

msgmni has been set to 120

io scheduler noop registered (default)

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: eth0: Blackfin on-chip Ethernet MAC driver, Version 1.1

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-02 23:42:35 UTC (171755)

dma_alloc_init: dma_page @ 0x021ac000 - 256 pages at 0x03f00000

List of all partitions:

No filesystem could mount root, tried:  jffs2

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

Hardware Trace:

   0 Target : <0x001397b0> { _dump_stack + 0x0 }

     Source : <0x00139838> { _panic + 0x50 } CALL pcrel

   1 Target : <0x00139838> { _panic + 0x50 }

     Source : <0x00139974> { _printk + 0x14 } RTS

   2 Target : <0x00139970> { _printk + 0x10 }

     Source : <0x000117dc> { _vprintk + 0x198 } RTS

   3 Target : <0x000117d0> { _vprintk + 0x18c }

     Source : <0xffa00cc8> { __common_int_entry + 0xcc } RTI

   4 Target : <0xffa00c66> { __common_int_entry + 0x6a }

     Source : <0xffa00ab0> { _return_from_int + 0x58 } RTS

   5 Target : <0xffa00ab0> { _return_from_int + 0x58 }

     Source : <0xffa00a86> { _return_from_int + 0x2e } IF !CC JUMP pcrel

   6 Target : <0xffa00a58> { _return_from_int + 0x0 }

     Source : <0xffa00c62> { __common_int_entry + 0x66 } JUMP.L

   7 Target : <0xffa00c60> { __common_int_entry + 0x64 }

     Source : <0xffa003a6> { _asm_do_IRQ + 0x6a } RTS

   8 Target : <0xffa0039e> { _asm_do_IRQ + 0x62 }

     Source : <0x00015092> { ___local_bh_enable + 0x36 } RTS

   9 Target : <0x0001505c> { ___local_bh_enable + 0x0 }

     Source : <0x000155d6> { ___do_softirq + 0xae } CALL pcrel

  10 Target : <0x000155ca> { ___do_softirq + 0xa2 }

     Source : <0x000155be> { ___do_softirq + 0x96 } IF CC JUMP pcrel

  11 Target : <0x000155b2> { ___do_softirq + 0x8a }

     Source : <0x00037a06> { _rcu_bh_qs + 0x42 } RTS

  12 Target : <0x000379ec> { _rcu_bh_qs + 0x28 }

     Source : <0x000379dc> { _rcu_bh_qs + 0x18 } IF CC JUMP pcrel

  13 Target : <0x000379c4> { _rcu_bh_qs + 0x0 }

     Source : <0x000155ae> { ___do_softirq + 0x86 } JUMP.L

  14 Target : <0x000155a6> { ___do_softirq + 0x7e }

     Source : <0x00018fe0> { _run_timer_softirq + 0xb4 } RTS

  15 Target : <0x00018f83> { _run_timer_softirq + 0x57 }

     Source : <0x00018fcc> { _run_timer_softirq + 0xa0 } IF !CC JUMP pcrel (BP)

Stack info:

SP: [0x0201bf28] <0x0201bf28> /* kernel dynamic memory (maybe user-space) */

FP: (0x0201bfe4)

Memory from 0x0201bf20 to 0201c000

0201bf20: 0201bf28  00000000 [0016c294] 0013983c  0207a006  0016c294  001ad3df  001ad3df

0201bf40: 001ad3df  0201bf70  00000000  001cc992  0207a006  001dfa0c  00000000  0201bf80

0201bf60: 00008000  0016c2fc  00000000  001df9cd  0201bf80  0201bf80  00008000  00000000

0201bf80: 6e6b6e75  2d6e776f  636f6c62  2c30286b  02002930  001ccaa2  001a8068  00000000

0201bfa0: 001ccc1c  001a8068  001dfa18  00000000  00000000  00000000  00000000  00000000

0201bfc0: 001cc688  001a8018  001e4574  00000000  001cc694  001a8018  001e4574  00000000

0201bfe0: 00000000 (00000000)<000014f6> 00000000  00000000  00000000  ffffffff  00000006

Return addresses in stack:

   frame  1 : <0x000014f6> { _kernel_thread_helper + 0x6 }

Outcomes