2009-08-10 11:55:56     status of bfin_spi_mmc.c?

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

2009-08-10 11:55:56     status of bfin_spi_mmc.c?

Ben Matthews (UNITED STATES)

Message: 78573   

 

I'm trying to get SD support working on the blackstamp board for u-boot and I'm finding that there is a driver, but that it needs some of the register names and constants fixed. I was wondering if this code was known to work, and what is involved in making it happen? Do I just need to correct the few constants that prevent it from compiling or is there more to it than that? Are there plans to put this code into more general use?

 

 

 

Thanks

 

Ben

 

 

 

make[1]: Entering directory `/home/bmat/blackfin-latest/u-boot/u-boot-2009.06/drivers/mmc'

bfin-uclinux-gcc  -g  -Os   -ffixed-P5 -fomit-frame-pointer -mno-fdpic -ffunction-sections -fdata-sections -mcpu=bf532-0.5 -D__KERNEL__ -I/home/bmat/blackfin-latest/u-boot/u-boot-2009.06/include -fno-builtin -ffreestanding -nostdinc -isystem /scratch/bmat/blackfin/toolchain-jun22_09-locale/bin/../lib/gcc/bfin-uclinux/4.1.2/include -pipe-DCONFIG_BLACKFIN -Wall -Wstrict-prototypes -fno-stack-protector   -o bfin_spi_mmc.obfin_spi_mmc.c -c

bfin_spi_mmc.c: In function ‘spi_assert’:

bfin_spi_mmc.c:112: error: ‘pPORTFIO_CLEAR’ undeclared (first use in this function)

bfin_spi_mmc.c:112: error: (Each undeclared identifier is reported only once

bfin_spi_mmc.c:112: error: for each function it appears in.)

bfin_spi_mmc.c: In function ‘spi_deassert’:

bfin_spi_mmc.c:118: error: ‘pPORTFIO_SET’ undeclared (first use in this function)

bfin_spi_mmc.c: In function ‘init_spi’:

bfin_spi_mmc.c:198: error: ‘pPORT_MUX’ undeclared (first use in this function)

bfin_spi_mmc.c:198: error: ‘PJSE’ undeclared (first use in this function)

bfin_spi_mmc.c:202: error: ‘PFS4E’ undeclared (first use in this function)

bfin_spi_mmc.c:206: error: ‘PFS5E’ undeclared (first use in this function)

bfin_spi_mmc.c:210: error: ‘PFS6E’ undeclared (first use in this function)

bfin_spi_mmc.c:214: error: ‘PJCE_SPI’ undeclared (first use in this function)

bfin_spi_mmc.c:222: error: ‘pPORTF_FER’ undeclared (first use in this function)

bfin_spi_mmc.c:226: error: ‘pPORTFIO_DIR’ undeclared (first use in this function)

make[1]: *** [bfin_spi_mmc.o] Error 1

QuoteReplyEditDelete

 

 

2009-08-10 22:40:57     Re: status of bfin_spi_mmc.c?

Sonic Zhang (CHINA)

Message: 78582   

 

Only BF537 and BF533 is tested.

QuoteReplyEditDelete

 

 

2009-08-11 05:50:34     Re: status of bfin_spi_mmc.c?

Mike Frysinger (UNITED STATES)

Message: 78610   

 

i dont think that's true.  i think only BF537 will work with the current u-boot driver.

QuoteReplyEditDelete

 

 

2009-08-11 14:57:51     Re: status of bfin_spi_mmc.c?

Ben Matthews (UNITED STATES)

Message: 78674   

 

It looks to me like it never worked on BF-533 (otherwise I wouldn't be asking).  It looks like bfin_spi_mmc.c merely handles the hardware specific parts and that the actual framing of MMC packets happens elsewhere? Is it correct that all I should need to do is rework bfin_spi_mmc.c to use the BF533's SPI registers?

 

What's the best way to seperate a hypothetical implementation for the BF-533? Check the value of CONFIG_BFIN_CPU and use preprocessor directives? A seperate file?

 

It looks like the current code uses the SPISEL flags in GPIO mode (for odd length transfers?), how does this work on the BF533? Should I just write to the registers or is there some sort of higher level API to be used?

 

Any other hints you could offer to someone thinking about fixing this to work on the BF532/BF533?

 

 

 

Thanks again

QuoteReplyEditDelete

 

 

2009-08-11 15:35:52     Re: status of bfin_spi_mmc.c?

Mike Frysinger (UNITED STATES)

Message: 78675   

 

afaik, the Blackfin specific stuff is mostly in bfin_spi_mmc.c and the bfin_spimmc_mode.c has the higher logic parts

 

if you really wanted to generalize it, you could change all the MMR code to have it call the common SPI functions (see include/spi.h).  then it should (in theory) work on all Blackfin parts.

 

otherwise, if you just want to graft the BF533 parts in, dont worry about doing it cleanly.  the driver isnt meant to be perm (it's a hack for people), so adding stuff like:

#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__)

    /* do BF533 stuff */

#elif defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__)

    /* do BF537 stuff */

#else

# error not supported

#endif

Attachments

    Outcomes