2011-03-14 17:33:52     Using Blackfin GPIO as SPI CS for SD Card

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

2011-03-14 17:33:52     Using Blackfin GPIO as SPI CS for SD Card

Ashish Gupta (INDIA)

Message: 98930   

 

Hi,

 

I have three SPI devices on by BF527 based board, I am using the 2010R1 toolchain and the 2010R1-RC5 uclinux distribution. : -

 

1. LCD - SHARP LQ035Q1 - SPI CS  connected to Blackfin GPIO PH10

 

2. SD CARD - SPI CS connected to Blackfin GPIO PH12

 

3. Generic SPI port which I want to map to SPI DEV.  The CS for this is the Blackfin native SPI controller's SSEL5. Since I want to be able to use this SPI Port for SPI MODE3 where CS is controlled by HW and is toggled after every word under DMA transfers, I've configured the paltform file to use this as native CS and not as Blackfin GPIO according to   docs.blackfin.uclinux.org/doku.php?id=spi)

 

Attached is the extracted platform file entries I made for supporting the above configuration.

 

I get the following error while boot up and the sdcard does not get instantiated:

 

root:/proc> dmesg | grep spi

bfin-spi bfin-spi.0: registered master spi0

spi spi0.52: setup spi chip mmc_spi, width is 8, dma is 0

spi spi0.52: ctl_reg is 0x1000, flag_reg is 0x0

spi spi0.52: chip select number is 52

spi spi0.52: setup mode 0, 8 bits/w, 15000000 Hz max --> 0

bfin-spi bfin-spi.0: registered child spi0.52

spi spi0.5: setup spi chip spidev, width is 8, dma is 0

spi spi0.5: ctl_reg is 0x1c00, flag_reg is 0x2000

spi spi0.5: chip select number is 5

spi spi0.5: setup mode 3, 8 bits/w, 15000000 Hz max --> 0

bfin-spi bfin-spi.0: registered child spi0.5

spi spi0.50: setup spi chip bfin-lq035q1-spi, width is 8, dma is 0

spi spi0.50: ctl_reg is 0x1c00, flag_reg is 0x0

spi spi0.50: chip select number is 50

spi spi0.50: setup mode 3, 8 bits/w, 15000000 Hz max --> 0

bfin-spi bfin-spi.0: registered child spi0.50

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

mmc_spi spi0.52: setup spi chip mmc_spi, width is 8, dma is 0

mmc_spi spi0.52: ctl_reg is 0x1000, flag_reg is 0x0

mmc_spi spi0.52: chip select number is 52

mmc_spi spi0.52: setup mode 0, 8 bits/w, 15000000 Hz max --> 0

mmc_spi spi0.52: can't share SPI bus

mmc_spi: probe of spi0.52 failed with error -16

 

Is it not possible to mix SPI CS (use some devices with native SPI controller SPISEL and some devices with Blackfin native GPIOs) ?

 

Regards,

 

Ashish

 

platformfileentries.txt

QuoteReplyEditDelete

 

 

2011-03-14 17:38:31     Re: Using Blackfin GPIO as SPI CS for SD Card

Mike Frysinger (UNITED STATES)

Message: 98931   

 

the issue isnt really with the CS.  it's with using the spi_mmc and its need for bus exclusivity.  this is already fixed in svn trunk.

Attachments

Outcomes