[#5836] run spi flash with dma mode enabled fails to mount.

Document created by Aaronwu Employee on Sep 5, 2013
Version 1Show Document
  • View in full screen mode

[#5836] run spi flash with dma mode enabled fails to mount.

Submitted By: Mingquan Pan

Open Date

2010-01-19 23:11:31     Close Date

2010-08-05 05:30:26

Priority:

Medium     Assignee:

Michael Hennerich

Status:

Closed     Fixed In Release:

2010R1

Found In Release:

2010R1     Release:

Category:

N/A     Board:

N/A

Processor:

BF537     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

4.3.4 (ADI-trunk/svn-3801)

App binary format:

N/A     

Summary: run spi flash with dma mode enabled fails to mount.

Details:

 

run spi flash with dma mode enabled fails to mount, while with pio mode it is ok.

 

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

   Image Name:   bf537-2.6.32.4-ADI-2010R1-pre-sv

   Created:      2010-01-20   3:44:56 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    2263220 Bytes =  2.2 MB

   Load Address: 00001000

   Entry Point:  001a1724

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 001a1724

Linux version 2.6.32.4-ADI-2010R1-pre-svn8183 (test@my-local-machine) (gcc version 4.3.4 (ADI-trunk/svn-3801) ) #13 Wed Jan 20 11:44:48 CST 2010

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00118290

  rodata    = 0x00118290-0x00172ef8

  bss       = 0x00173000-0x0018447c

  data      = 0x0018447c-0x00196000

    stack   = 0x00194000-0x00196000

  init      = 0x00196000-0x00423000

  available = 0x00423000-0x03800000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 0

Reset caused by Software reset

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

Compiled for ADSP-BF537 Rev 0.2

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: 14224

Kernel command line: root=/dev/mtdblock0 rw ip=10.100.4.50 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=10.100.4.50:10.100.4.174:192.168.0.1:255.255.255.0:bf537-stamp:eth0:off

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: 52540k/65536k RAM, (2612k init code, 1116k kernel code, 504k data, 1024k dma, 7740k reserved)

Hierarchical RCU implementation.

NR_IRQS:98

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 997.37 BogoMIPS (lpj=1994752)

Security Framework initialized

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 (36 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

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

NET: Registered protocol family 1

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

msgmni has been set to 102

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-uart: Blackfin serial driver

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

brd: module loaded

m25p80 spi0.1: m25p64 (8192 Kbytes)

Creating 3 MTD partitions on "m25p80":

0x000000000000-0x000000040000 : "bootloader(spi)"

0x000000040000-0x0000001c0000 : "linux kernel(spi)"

0x0000001c0000-0x000000800000 : "file system(spi)"

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

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: Blackfin on-chip Ethernet MAC driver, Version 1.1

TCP cubic registered

NET: Registered protocol family 17

IP-Config: Gateway not on directly connected network.

Freeing unused kernel memory: 2612k freed

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

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/

\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/

/     \.___.d|    .'           - http://www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.15.3 (2010-01-18 18:33:20 CST) hush - the humble shell

 

root:/> versioPHY: 0:01 - Link is Up - 100/Full

n

kernel:    Linux release 2.6.32.4-ADI-2010R1-pre-svn8183, build #13 Wed Jan 20 11:44:48 CST 2010

toolchain: bfin-uclinux-gcc release gcc version 4.3.4 (ADI-trunk/svn-3801)

user-dist: release svn-9391, build #48 Wed Jan 20 11:44:21 CST 2010

root:/>

*******************************************************************

STEP 3: MTD test

 

 

cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00040000 00010000 "bootloader(spi)"

mtd1: 00180000 00010000 "linux kernel(spi)"

mtd2: 00640000 00010000 "file system(spi)"

root:/>

Case 1 ...PASS

 

*******************************************************************

STEP 4: Mount MTD

 

 

mount -t jffs2 /dev/mtdblock2 /mnt

BUG: soft lockup - CPU#0 stuck for 61s! [swapper:0]

Modules linked in:

 

ADSP-BF537-0.2 500(MHz CCLK) 125(MHz SCLK) (mpu off)

Linux version 2.6.32.4-ADI-2010R1-pre-svn8183 (test@my-local-machine) (gcc version 4.3.4 (ADI-trunk/svn-3801) ) #13 Wed Jan 20 11:44:48 CST 2010

 

SEQUENCER STATUS:               Not tainted

SEQSTAT: 00002000  IPEND: 8450  IMASK: 0000  SYSCFG: 0006

  Global Interrupts Disabled (IPEND[4])

  Peripheral interrupts masked off

  Kernel interrupts masked off

  EXCAUSE   : 0x0

  interrupts disabled

  physical IVG6 asserted : <0xffa00da0> { _evt_timer + 0x0 }

  physical IVG10 asserted : <0xffa00ed0> { _evt_evt10 + 0x0 }

  physical IVG15 asserted : <0xffa01000> { _evt_system_call + 0x0 }

  logical irq   6 mapped  : <0xffa003a0> { _bfin_coretmr_interrupt + 0x0 }

  logical irq  17 mapped  : <0x000c617c> { _bfin_spi_dma_irq_handler + 0x0 }

  logical irq  18 mapped  : <0x000b9388> { _bfin_serial_dma_rx_int + 0x0 }

  logical irq  19 mapped  : <0x000b90e4> { _bfin_serial_dma_tx_int + 0x0 }

  logical irq  24 mapped  : <0x000c9970> { _bfin_mac_interrupt + 0x0 }

RETE: <0x00000000> /* Maybe null pointer? */

RETN: <0x0270a000> /* kernel dynamic memory */

RETX: <0x02782892> [ mount + 0x2892 ]

RETS: <0x0002f5e4> { _handle_simple_irq + 0x3c }

PC  : <0x0002df14> { _handle_IRQ_event + 0x1c }

PROCESSOR STATE:

R0 : 0000ffff    R1 : 0243fc60    R2 : 00000000    R3 : 00000065

R4 : 00000000    R5 : 00000011    R6 : 00000000    R7 : 00000011

P0 : 0017805c    P1 : 0002f5a8    P2 : 00185990    P3 : 00194008

P4 : 00194008    P5 : 0243fc60    FP : 00173268    SP : 00195d8c

LB0: ffa01530    LT0: ffa0152e    LC0: 00000000

LB1: 00008b62    LT1: 00008b62    LC1: 00000000

B0 : 00000000    L0 : 00000000    M0 : 0000002c    I0 : 0019127c

B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : 02709cc0

B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : 00000000

B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 00000000

A0.w: 00001c76   A0.x: 00000000   A1.w: 00000476   A1.x: 00000000

USP : 00196000  ASTAT: 02002020

 

 

Follow-ups

 

--- Barry Song                                               2010-01-21 03:57:16

Surely that problem has nothing to do with the flash. SPI driver DMA should have

been bad.

 

--- Barry Song                                               2010-01-22 05:02:47

Fixed.

Added dma_disable_irq_nosync() api to disable irq by nosync way in dma_irq of

SPI driver. Log:

m25p80 spi0.1: m25p64 (8192 Kbytes)

m25p80 spi0.1: ignoring 3 default partitions on m25p80

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0,

regs_base@ffc00500, dma channel@7

...

root:/> mount /dev/mtdblock0 -t jffs2 /mnt

root:/> cd /mnt/

root:/mnt> cp /bin/sh /mnt/

root:/mnt> sync

root:/mnt> ls

sh

 

--- Barry Song                                               2010-02-04 22:50:40

It can't work at trunk head again.

 

--- Michael Hennerich                                        2010-05-21 09:15:14

Vivi, I assume that didn't fix your kernel hung on BF537-STAMP?

Assign to me.

 

--- Michael Hennerich                                        2010-05-21 09:19:06

Some peripherals may generate an error interrupt shortly after the

Data Interrupt, due to the fact that the peripheral isn't serviced fast

enough.

In most cases this doesn't harm and is expected behavior.

On Blackfin priority driven nested interrupts the Error interrupt

(with the current priority) overtakes the Data Interrupt.

This hasn't been a problem on most parts since you simply don't request the

ERROR interrupt (or leave it disabled while there is an expected ERROR/STATUS

indication) and do the peripheral status checking in the data interrupt.

On BF537/6/4 the ERROR interrupt can't be enabled on peripheral basis,

once you enable the ERROR interrupt for one peripheral, it automatically

enables it for all peripherals.

 

Therefore lower the multiplexed ERROR interrupt priority

and deal with ERROR/STATUS flags in the Data Interrupt.

 

--- Vivi Li                                                  2010-08-05 05:30:26

OK, close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes