[#4558] DMA with SPI flash doesnt work on BF533-STAMP w/W25X10
Submitted By: Mike Frysinger
Open Date
2008-10-21 05:09:01 Close Date
2009-07-03 01:31:35
Priority:
Medium Assignee:
Mike Frysinger
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
svn trunk
Category:
N/A Board:
STAMP
Processor:
BF533 Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
trunk head
App binary format:
N/A
Summary: DMA with SPI flash doesnt work on BF533-STAMP w/W25X10
Details:
using a BF533-STAMP here with a W25X10 SPI flash. it works fine when enable_dma is disabled, but doesnt work at all when turning DMA on. i get just 0xff bytes back when trying to read the device.
U-Boot 1.1.6-svn1423 (ADI-2009R1-pre) (Oct 18 2008 - 05:53:43)
CPU: ADSP bf533-0.3 (Detected Rev: 0.3)
Board: ADI BF533 Stamp board
Support: blackfin.uclinux.org/
Clock: VCO: 497 MHz, Core: 497 MHz, System: 99 MHz
RAM: 128 MB
Flash: 4 MB
In: serial
Out: serial
Err: serial
Net: SMC91111 at 0x20300300
MAC: 00:E0:22:FE:05:3F
Hit any key to stop autoboot: 0
TFTP from server 192.168.0.2; our IP address is 192.168.0.15
Filename 'uImage'.
Load address: 0x1000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
###############################################################
done
Bytes transferred = 4647845 (46eba5 hex)
## Booting image at 01000000 ...
Image Name: Linux-2.6.26.5-ADI-2009R1-pre-sv
Created: 2008-10-21 9:07:07 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 4647781 Bytes = 4.4 MB
Load Address: 00001000
Entry Point: 00186cb8
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 186cb8
Linux version 2.6.26.5-ADI-2009R1-pre-svn5461-dirty (vapier@G5) (gcc version 4.3.2 (ADI-trunk/git-fb713f) ) #260 Tue Oct 21 05:07:00 EDT 2008
console [early_BFuart0] enabled
early printk enabled on early_BFuart0
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 128MB
Kernel Managed Memory: 128MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x0010e5c0
rodata = 0x0010e5c0-0x0015da8c
bss = 0x0015daa0-0x0016c708
data = 0x0016c708-0x0017c000
stack = 0x0017a000-0x0017c000
init = 0x0017c000-0x00916000
available = 0x00916000-0x037ff000
DMA Zone = 0x07f00000-0x08000000
Hardware Trace Active and Enabled
Reset caused by Software reset
Blackfin support (C) 2004-2008 Analog Devices, Inc.
Compiled for ADSP-BF533 Rev 0.3
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 497 MHz core clock and 99 MHz System Clock
NOMPU: setting up cplb tables for global access
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 14223
Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:bf533-s
tamp:eth0:off
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console handover: boot [early_BFuart0] -> real [ttyBF0]
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 47456k/131072k RAM, (7784k init code, 1077k kernel code, 439k data, 1024k dma, 73292k reserved)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (15 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 64 KB (57 KB free)
net_namespace: 192 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
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
msgmni has been set to 92
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 21) is a BFIN-UART
brd: module loaded
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>
eth0: SMC91C11xFD (rev 1) at 20300300 IRQ 40 [nowait]
eth0: Ethernet addr: 00:e0:22:fe:05:3f
m25p80 spi0.2: w25x10 (128 Kbytes)
Creating 3 MTD partitions on "m25p80":
0x00000000-0x00040000 : "bootloader(spi)"
mtd: partition "bootloader(spi)" extends beyond the end of device "m25p80" -- size truncated to 0x20000
0x00040000-0x00120000 : "linux kernel(spi)"
mtd: partition "linux kernel(spi)" is out of reach -- disabled
0x00120000-0x00020000 : "file system(spi)"
mtd: partition "file system(spi)" is out of reach -- disabled
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@5
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 1986-02-05 20:46:28 UTC (508020388)
eth0: link down
IP-Config: Complete:
device=eth0, addr=192.168.0.15, mask=255.255.255.0, gw=192.168.0.1,
host=bf533-stamp, domain=, nis-domain=(none),
bootserver=192.168.0.2, rootserver=192.168.0.2, rootpath=
Freeing unused kernel memory: 7784k freed
dma_alloc_init: dma_page @ 0x00913000 - 256 pages at 0x07f00000
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
_____________________________________
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| - blackfin.uclinux.org/
\ YP" `| 8P `. - docs.blackfin.uclinux.org/
/ \.___.d| .' - www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - www.analog.com/blackfin
Have a lot of fun...
BusyBox v1.12.1 (2008-10-21 02:08:45 EDT) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> hexdump -C /dev/mtdblock0
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00020000
Follow-ups
--- Mike Frysinger 2008-10-22 15:28:05
looking at the signals, in non-dma mode the CS stays low between the
transmission of the address byte and the actual reading of the data
in dma mode, the cs gets toggled in between and so the chip doesnt send
anything back ...
--- Robin Getz 2008-10-22 22:49:51
I think this is controlled by the CPHA bit in SPI_CTL.
0 - slave select pins controlled by hardware
(the slave select be deasserted between transferred words)
1 - slave select pins controlled by software
(The user must set or clear the appropriate FLGx bits)
--- Mike Frysinger 2008-10-23 02:26:45
it's because we disable the SPI bus before doing a DMA. see bfin_spi_disable()
in pump_transfers() ...
--- Robin Getz 2008-10-23 07:56:21
Hmm - yeah, that is the recommended way to do things. (SPI needs to be
"off" when programming the DMA registers, so that the SPI transactions
don't start before things are set up properly).
I guess - GPIO based SPI selects? I think we already had a task for this...
#4450
Does that need to be done before this will work?
-Robin
--- Mike Frysinger 2008-10-23 20:32:17
we do it in u-boot though
if i change the code around so that it programs the SPI first and then enables
DMA, it seems to work a lot better ...
--- Mike Frysinger 2009-07-03 01:31:35
things should be fine in trunk now
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found