2011-05-26 05:07:07 SD card, SPI at BF537 ezkit
Morten Kvistgaard (DENMARK)
Message: 100866
Hello there,
We're trying to make the SD card work at a BF537 ezkit, using the SPI driver. We've tried with 2 different SD cards with the same result. (And it doesn't seems the cards, that's the problem.)
We have 8k pullups on MOSI, CLK, and CS.
The commands get through to the card and the card responds. But the Blackfin doesn't seems to pick up on the responses. (We're using a scope to peek at the spi data.)
We're using the newest uClinux, compiler and uboot.
This is our dmesg output:
===============================================================
Linux version 2.6.34.7-ADI-2010R1 (mk@PCHe-Ubuntu) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #78 Thu May 26 10:46:05 CEST 2011
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-0x001231f8
rodata = 0x001231f8-0x00181c70
bss = 0x00182000-0x00192498
data = 0x00192498-0x001a4000
stack = 0x001a2000-0x001a4000
init = 0x001a4000-0x0088f000
available = 0x0088f000-0x03800000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Boot Mode: 0
Reset caused by Software reset
Blackfin support (C) 2004-2010 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Warning: Compiled for Rev 2, but running on Rev 3
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 125 MHz System Clock
boot memmap: 000000000088f000 - 0000000003800000 (usable)
On node 0 totalpages: 14336
free_area_init_node: node 0, pgdat 0019fd28, node_mem_map 00891000
DMA zone: 112 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 14224 pages, LIFO batch:0
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 clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=172.19.1.69:172.19.1.21:172.19.1.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)
Kernel managed physical pages: 14336
Memory available: 48012k/65536k RAM, (7084k init code, 1160k kernel code, 516k data, 1024k dma, 7740k reserved)
Hierarchical RCU implementation.
NR_IRQS:138
Configuring Blackfin Priority Driven Interrupts
console [ttyBF0] enabled, bootconsole disabled
Calibrating delay loop... 993.28 BogoMIPS (lpj=1986560)
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 (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_base@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
Setting up Blackfin MMR debugfs
msgmni has been set to 93
io scheduler noop registered
io scheduler cfq registered (default)
bfin-uart: Blackfin serial driver
bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
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
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
mmc_spi spi0.5: ASSUMING SPI bus stays unshared!
mmc_spi spi0.5: ASSUMING 3.2-3.4 V slot power
mmc0: clock 0Hz busmode 0 powermode 0 cs 0 Vdd 0 width 0 timing 0
mmc_spi spi0.5: SD/MMC host mmc0, no DMA, no WP, no poweroff
mmc0: clock 0Hz busmode 2 powermode 1 cs 1 Vdd 21 width 0 timing 0
mmc_spi spi0.5: mmc_spi: power up (21)
TCP cubic registered
NET: Registered protocol family 17
mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
mmc_spi spi0.5: mmc_spi: power on (21)
mmc_spi spi0.5: can't change chip-select polarity
mmc_spi spi0.5: mmc_spi: clock to 400000 Hz, 0
mmc0: starting CMD52 arg 00000c00 flags 00000195
mmc_spi spi0.5: mmc_spi: CMD52, resp R2/R5
mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD52 arg 80000c08 flags 00000195
mmc_spi spi0.5: mmc_spi: CMD52, resp R2/R5
mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD0 arg 00000000 flags 000000c0
mmc_spi spi0.5: mmc_spi: CMD0, resp R1
mmc0: req done (CMD0): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD8 arg 000001aa flags 000002f5
mmc_spi spi0.5: mmc_spi: CMD8, resp R3/R4/R7
mmc0: req done (CMD8): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD5 arg 00000000 flags 000002e1
mmc_spi spi0.5: mmc_spi: CMD5, resp R3/R4/R7
mmc0: req failed (CMD5): -110, retrying...
mmc_spi spi0.5: mmc_spi: CMD5, resp R3/R4/R7
mmc0: req failed (CMD5): -110, retrying...
mmc_spi spi0.5: mmc_spi: CMD5, resp R3/R4/R7
mmc0: req failed (CMD5): -110, retrying...
mmc_spi spi0.5: mmc_spi: CMD5, resp R3/R4/R7
mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.5: mmc_spi: CMD55, resp R1
mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.5: mmc_spi: CMD55, resp R1
mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.5: mmc_spi: CMD55, resp R1
mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.5: mmc_spi: CMD55, resp R1
mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc0: starting CMD1 arg 00000000 flags 000000e1
mmc_spi spi0.5: mmc_spi: CMD1, resp R1
mmc0: req done (CMD1): -110: 00000000 00000000 00000000 00000000
mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0
mmc_spi spi0.5: mmc_spi: power off (0)
IP-Config: Complete:
device=eth0, addr=172.19.1.69, mask=255.255.255.0, gw=172.19.1.1,
host=bf537-stamp, domain=, nis-domain=(none),
bootserver=172.19.1.21, rootserver=172.19.1.21, rootpath=
dma_alloc_init: dma_page @ 0x028cd000 - 256 pages at 0x03f00000
Freeing unused kernel memory: 7084k freed
PHY: 0:01 - Link is Up - 100/Full
===============================================================
Any ideas on what could be wrong?
QuoteReplyEditDelete
2011-05-26 05:09:22 Re: SD card, SPI at BF537 ezkit
Morten Kvistgaard (DENMARK)
Message: 100867
Also as far as we can tell, the responses from card is correct. Eg. CMD0 results in response 0x1.
QuoteReplyEditDelete
2011-05-26 11:47:12 Re: SD card, SPI at BF537 ezkit
Mike Frysinger (UNITED STATES)
Message: 100875
what mmc card hardware are you using exactly ? i'm assuming you're actually using a bf537-ezkit, and you havent made any changes to the bf537-ezkit board file in the kernel.
so far, every time someone has run into a problem with the spi mmc card, it's because they didnt follow the schematic exactly and tried to deviate in some way. the documentation for example says to use 10k pullups on all the lines. please consult:
https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:spi_mmc
www.rubico.se/docs/spi-mmc_schematic.pdf
QuoteReplyEditDelete
2011-05-27 04:00:07 Re: SD card, SPI at BF537 ezkit
Morten Kvistgaard (DENMARK)
Message: 100897
My hw colleagues assures me, that they've been very throughout ... several times.
I think I'm going to try with some sort of SPI echo device. Just to see if there're connection both ways.
I'm using this brakout board from Sparkfun, if anyone's interested: www.sparkfun.com/products/204
QuoteReplyEditDelete
2011-05-27 11:13:13 Re: SD card, SPI at BF537 ezkit
Mike Frysinger (UNITED STATES)
Message: 100899
being through doesnt mean the result is always correct
usually it's saner on the first spins to be a bit conservative and then once you have a known working base, back off closer to the theoretical limits. then you have things to compare rather than just one platform that is broken and you dont know why.