Analog.com Analog Dialogue Wiki 简体中文
EngineerZone
EngineerZone
  • Log In
  • Site
  • Search
  • User
  • Support

    Popular Forums

    • RF and Microwave
    • Power Management
    • Video
    • FPGA Reference Designs
    • Precision ADCs
    • Linux Software Drivers
    • SigmaDSP Processors & SigmaStudio Dev. Tool

    Product Forums

    • A2B
    • Amplifiers
    • Analog Microcontrollers
    • Clock and Timing
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy Monitoring and Metering
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Processors and DSP
    • Switches/Multiplexers
    • Temperature Sensors
    • Voltage References
    View All

    Application Forums

    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing
    • Optical Sensing
    • Precision Technology Signal Chains
    • Video
    • Wireless Sensor Networks Reference Library

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools and Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Reference Designs
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Recent Discussions

    • Pluto + GNURADIO frequency change
    • Pluto SDR
    • pluto sdr pyadi-iio continous iq recording
    • attribute error
    • gps-sdr-sim is not working with my ADALM-PLUTO

    Places

    • ADI Education Home
    • ADI Education China
    • ADI Education India
    • ADI Education Philippines
    • StudentZone (Analog Dialogue)
    • Virtual Classroom

    Latest Webinars

    • Optimizing GaN and GaAs RF Amplifier Performance Using Novel Biasing Techniques
    • Improving Switch-Mode Power Supplies Using Noise Cancelling Technology
    • Webinar Accelerate Your Design With a 2 to 24 GHz Wideband Transceiver Reference Design
    • How to Design an Optimized Motion Control System for Intelligent Edge Based Surveillance Camera
    • How to Enhance High Precision Current Sensing Systems
    View All
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes: Taking the right shoes in the dark and in a hurry
    View All

    Places

    • Community Help
    • Logic Lounge

    Resources

    • EZ Code of Conduct
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • Blogs

     

    Can I Build My Own Phased Array Radar?

     

    How to Understand Public Key Cryptography Without Formulas

    Latest Blogs

    • How To Design Fieldbus Agnostic Smart Factory Sensors
    • You Passed EMC Testing… But Wait, Is There More?
    • The 5 Things You Need to Know about RF Matching Networks
    • Does Reliability Prediction Uncertainty Justify Mandating Two Channel Safety?
    • An Inside Look at 2022
    Read All Blogs

    ADI Blogs

    • EZ Spotlight
    • The Engineering Mind
  • Partners

    Electronic Design Services - PartnerZone

    • Boston Engineering
    • Calian, Advanced Technologies
    • Colorado Engineering Inc. (DBA CAES AT&E)
    • Clockworks Signal Processing
    • Epiq Solutions
    • Fidus
    • PalmSens
    • Richardson RFPD
    • Tri-Star Design, Inc.
    • VadaTech
    • Vanteon
    • X-Microwave
    View All
Linux Bug Archive
  • Processors and DSP
  • Software and Development Tools
  • Linux Distribution for Blackfin
  • Linux Bug Archive
  • Cancel
Linux Bug Archive
Documents [#3991] mmc_spi not working out of the box.
  • Q&A
  • Documents
  • Members
  • Tags
  • More
  • Cancel
  • +Documents
  • +ad1836: FAQ
  • +ad1938: FAQ
  • +ad1939: FAQ
  • +AD5280: FAQ
  • +ad73311: FAQ
  • +adau1361: FAQ
  • +adau1371: FAQ
  • +adau1373: FAQ
  • +adau1761: FAQ
  • +adp5588-gpio: FAQ
  • +adv7393: FAQ
  • +ADXL34x: FAQ
  • +bf518-ezbrd: FAQ
  • +bf518: FAQ
  • +bf51x: FAQ
  • +bf526-ezbrd: FAQ
  • +bf527-ezkit: FAQ
  • +bf533-stamp/ezkit: FAQ
  • +bf533: FAQ
  • +bf538-ezkit: FAQ
  • +bf548-ezkit: FAQ
  • +BF54x: FAQ
  • +bf561-ezkit: FAQ
  • +bf5xx: FAQ
  • +bfin-mac driver: FAQ
  • +bfin-uclinux-gdb: FAQ
  • +bfin_can.c: FAQ
  • +Blackfin: FAQ
  • +bluetooth: FAQ
  • +Build kernel: FAQ
  • +Build: FAQ
  • +cfcard test: FAQ
  • FAQ: [#6170] section mismatches in cifs code(2010)
  • FAQ: [#6173] linphone testing problem(2010)
  • FAQ: [#6190] BF561-EZKIT SMP kernel can not wake up by uart(2010)
  • FAQ: [#6194] libxenomai.so.0 can't be found in xenomai kernel with fdpic mode(2010)
  • FAQ: [#6207] Build error in CTS/RTS testing on board BF548-EZKIT(2010)
  • FAQ: [#6251] pread/pwrite arent decoded correctly by strace(2010)
  • FAQ: [#6253] strace build failed in trunk with outdated toolchain (missing asm/cachectl.h)(2010)
  • FAQ: [#6255] Busybox inetd crashes/rsh noconnet/ssh(2010)
  • FAQ: [#6265] libpng build fails due to not finding zlib(2010)
  • FAQ: [#6271] "nand unlock" is an unsupported command in u-boot update in nand flash(2010)
  • FAQ: [#6272] After update u-boot in spi flash, BF548-EZKIT can not boot from spi flash(2010)
  • +gadget fs bulk: FAQ
  • +gadget zero bulk: FAQ
  • +gadget zero control: FAQ
  • +Kernel xip: FAQ
  • +ltp test: FAQ
  • +microwin test: FAQ
  • +MPU kernel: FAQ
  • +Sl811-hcd.c USB: FAQ
  • +SPORT channel: FAQ
  • +trunk head kernel: FAQ
  • +usb otg driver: FAQ
  • +zlib: FAQ
  • +Illegal i2c: FAQ
  • +isp1362-hcd: FAQ
  • +Kernel: FAQ
  • +KGDBOE: FAQ
  • [#4646] Varittronix LCD driver mixes blue and Red
  • +serial driver: FAQ
  • +sigma firmware: FAQ
  • +spi transaction: FAQ
  • +strace FAQ
  • [#4787] [ltp] LTP test case shmctl01 failed in trunk for ltp-full-20081130
  • +tiff-4.0.0beta4: FAQ
  • [#5264] ping packet size test will fail for gadget ethernet test with DMA mode
  • +USBHOST: FAQ
  • +USB_EP_NI7_RXINTERVAL: FAQ
  • [#5257] Build usb gadget driver with DMA mode will fail
  • [#4708] Blackfin irda build fails for bf533-stamp
  • [#4735] unaligned accesses in qt webkit
  • [#5168] build cpufrequtils into fdpic format has error
  • [#5321] modprobe i2c lcd on bf533 stamp wait long time
  • [#4922] unwanted sound comes up after g_audio module is installed on BF548 and BF527
  • [#5176] app cpufrequtils in Blackfin app programs fails to build in FDPIC
  • [#5237] musb driver is broken after linux-2.6.30 update
  • [#5255] ping target board sometimes get wrong data byte for gadget ethernet pio mode
  • FAQ: [#6614] Kernel panic frequently when test sdio mmc on bf518-ezbrd(2011)
  • [#5336] canbus and ppifcd drivers can not be built on BF538-EZKIT
  • +SPI driver: FAQ
  • [#4714] the first time to build mtd-utils will fail in trunk
  • [#5524] drivers/video/bfin_adv7393fb.c build fails in 2.6.31 due to old i2c usage
  • [#5525] drivers/video/bf537-lq035.c build fails in 2.6.31 due to old i2c usage
  • [#5399] no sound when record in board and listen in PC for linphone test of ad1836 on bf533-stamp
  • [#5458] Drivers Serial:bfin_5xx:ttyBFx fails to generate resume from standby
  • [#4647] build samba fails on trunk now for redefinition in fcntl.h
  • [#5526] ip0x board has broken UART defines after resource reorganization
  • [#5527] drivers/media/video/blackfin/blackfin_cam.c build fails in 2.6.31 due to old i2c usage
  • [#5352] bfin_sport.c setup 2D DMA
  • [#5528] fs/binfmt_elf_fdpic.c build fails when CONFIG_ELF_CORE is enabled in 2.6.31
  • [#5464] isram_write() seems to be busted
  • [#5376] mmap05 sometimes can not pass when MPU
  • [#5534] run aplay/arecord will make system panic after kernel upgraded to 2.6.31
  • [#5361] Microwin (nanox) failed on trunk using AD7897 touch screen
  • [#5544] Sport uart TX stop waiting loop is too long to block RX interrupt in PIO mode when do duplex communication
  • [#5363] spi mmc is not supported in bf533-stamp
  • [#5550] fail to flash ubifs.img to nand
  • [#5470] build xenomai fails for no switchbench
  • [#5437] mathtest fails to compile
  • [#5551] SPI message lost when bus locked
  • [#5370] alsa tool fails to work after wake up from mem in bf537-stamp with ad1836 (can't resolve symbol)
  • [#5561] [ltp ]Kernel dump info when run ltp test cases access02, chown03, fchmod06, fchown03, fchown04
  • [#5377] amixer fail to run on ad1836 audio driver on BF537-STAMP
  • [#5475] build mkfs.ubifs on trunk head fails
  • [#5562] [ltp]some ltp test case is broken for getipckey and getcwd
  • [#5487] build usb.c fail in testsuites/usbdev/ test at asm/swab.h
  • [#5489] t2/t4 failed in gadget zero bulk test with dma mode
  • [#5567] build nand for bf537 fails on trunk
  • [#5494] Run tftlcd test case in bf548-ezkit, kernel crashed at the end
  • [#4879] traps test case 21 exception 0x3f: l1_instruction_access would make kernel panic on bf533 stamp
  • [#5568] Framebuffer DMA Error!!
  • [#5515] 4 more trap cases fails on bf533
  • [#5379] run scratchpad case sometimes would fail
  • [#5519] pushing Blackfin serial resources to boards broke many boards
  • [#5389] build pictureflow fails at branch head
  • [#5531] Usb SL811 failed on uclinux2009r1-rc6 on bf532 board.
  • [#5523] Blackfin MUSB build fails after update to 2.6.31
  • [#5391] For ad1836 and ad1981b, sometimes sound shakes at the end
  • [#5404] build kernel with 0x2000 as BOOT_LOAD address sometimes would fails at build-busybox-1.13.4
  • [#5469] CPU hardly idles anymore in svn trunk
  • [#5695] Build bf537-stamp fails at ad73322 for the latest trunk
  • [#5702] build xenomai into fdpic format fails for no libnative.so
  • [#5427] ircp failed on bf533-stamp
  • [#5708] Kernel can not boot up when spimmc driver is interrupt drivern in PIO mode
  • [#5711] gfortran case default_format_1.exe fails on 09r1 kernel but pass on trunk head
  • [#5712] I2C client drivers using dev_pm_ops fail to receive suspend/resume callbacks
  • [#5715] libpcap fails to compile in trunk
  • [#5589] STLport build fails
  • [#5724] SPORT driver crash on reload
  • [#5449] bfin_sdh doesn't save and restore peripheral context upon resume
  • [#5580] GPIO pin not reserved for CTS function on SPORT-UART driver
  • [#5521] trunk head build fails at ipc/shm.c
  • [#5636] generic gpio works on bf533 in the opposite way
  • [#5637] Kernel crashed when arecord and aplay on bf537-stamp with SoC I2S audio
  • [#5647] SPI driver bus_unlock() does not schedule postponed SPI messages
  • [#5683] build nand fails for format error
  • [#5689] while two or multi spi devices use gpio cs, spi setup will fail
  • [#5558] bfin mac multi-cast sending fails to work
  • [#5816] PREEMPT_RT: cyclic test stalls in some test mode
  • [#5824] some kernel modules fail to link due to losing strcpy in trunk head
  • [#5707] error in user/procps/Makefile
  • [#5841] [ltp] ltp test case shmctl01/semctl01 can not execute
  • [#5605] Build bf537-stamp fail at bf5xx-i2s.c in latest trunk
  • [#5614] With latest toolchain in trunk, fail to build some apps and libs at fork
  • [#5625] Build microwin app fails in trunk with 4.3 toolchain
  • [#5626] Build lib mad fail at option "-fforce-mem" with gcc 4.3
  • [#5722] bfin_sport_spi broken by cs_gpio changes
  • [#5627] fail to control gpio used by led and button through /sys/class/gpio/
  • [#5927] PR bit other than RAF bit in EMAC OPMODE register should be set for promisuous mode in bfin_mac driver
  • [#5727] build e2fsprogs-1.41.12 fail sometimes because of compiling order
  • [#5631] Build lib confuse failed with gcc 4.3 toolchain
  • [#5759] fix build for pwlib
  • [#5651] Build lirc failed at missing files
  • [#5931] Trying to compile CAN4LINUX for BF537-STAMP board but compilation is failing
  • [#5656] Build iproute2 fails at trunk for dlfcn.h when built as FLAT
  • [#5743] sound/soc/blackfin/bf5xx-ad1938.c build fails after 2.6.32 upgrade
  • [#5801] No interrupt occurs when reconnect gadget device in OTG mode.
  • [#5657] [ltp] ltp test case mount03/umount03 fail with error of "No such device"
  • [#5808] mmc configuration error in make config
  • [#5804] bf531: ethernet not working when switching to 2009R1
  • [#5810] initial sp is given wrong value and INIT_TASK_DATA is not linked into data
  • [#6335] Build xip failed in fdpic format when xenomai is enabled
  • [#7224] undifined variable x25_address in ./user/net-tools/lib/x25_src.c
  • [#5598] bluez-utils has parallel build issues with parser.h
  • [#5668] Fail to build app bluez-utils
  • [#7251] Blackfin SPI driver doesn't handle repeated changes in CPOL, CPHA and LSBF correctly
  • [#5767] In 09r1.1 branch, all ltp test cases show stack overflow in bf561 SMP kernel
  • [#5684] touching keypad on bf548 will make system dead and restart
  • [#7287] Can not build usb.c with libaio
  • [#5687] SPI read/write be wrong after suspend to memory and resume
  • [#7315] [ltp] ltp test case getrusage04 from ltp-full-20120903 fails in trunk
  • [#7328] Fail to compile pthread_test after toolchain update
  • [#5876] Repeating rsh/rcp causes error "poll: protocol failure in circuit setup"
  • [#7329] Fail to compile netperf after toolchain update
  • [#7333] Test dll fails to run after toolchain update
  • [#5741] adau1371 and adau1761 fail to build after 2.6.32 upgrade
  • [#7337] [ltp] ltp test case mount02 fails in ltp-full-20120903
  • [#7338] [ltp] ltp test case mount03 fails in ltp-full-20120903
  • [#5821] Fail to build pngview on regression machines with suse 10.2
  • [#5900] hardware single stepping in userspace does not handle syscalls correctly
  • [#5659] [ltp] ltp test case eventfd01 fail
  • [#7339] [ltp] can not apply patch of lchown02 in ltp-full-20101031 to ltp-full-20120903
  • [#7343] [ltp] LTP test case chdir04 fails in ltp-full-20120903
  • [#7396] build netperf fails for undefined reference to `___CPU_ZERO'
  • [#7483] bfin_sport driver does not work well in TDM DMA mode
  • [#7506] Dropbear does not build
  • [#5757] drop USER_SQUASHFS_MKSQUASHFS7Z as squashfs 4.0 does not support 7z anymore
  • [#5758] fix build for libopenh323
  • [#5833] trap test running on the second core of bf561 has serveral fails
  • [#5755] romfs target fails for lib/pwlib
  • [#5760] fix asterisk build
  • [#5756] romfs target fails for lib/libopenh323
  • [#5877] SPI transmit cs_change flag not properly handled
  • [#5939] bfin-can fails to build after linux-2.6.33 upgrade
  • [#5879] GPIO controlled slave request may fail when bfin_spi_setup() gets executed twice
  • [#5774] [ltp]ltp test case will be killed by oom-killer on bf533-ezkit in 09r1 branch occasionally
  • [#5894] BF527 uImage Flashing issue(Copy to Flash... Flash not Erased)
  • [#5941] links fails in trunk due to using fork()
  • [#5942] build usb host fail when remove anomaly 456 for BF526-EZBRD
  • [#7250] On bfin ppi test, it fails to quit from slave when send "q" from master
  • [#7379] Fail to build alsa lib in latest trunk with upgraded toolchain
  • [#5792] enc28j60 spi net fails to ping with host on trunk head kernel
  • [#4436] BF527-EZKIT unable to receive large files over UART in DMA mode
  • [#4764] Kernel prints warning when booting from jffs2 rootfs in nor flash on bf548-ezkit
  • [#5903] Impossible to work properly with two or more SPI slave devices using spi_bfin5xx driver.
  • FAQ: [#6386] build iproute2 may fail at ifstat.c sometimes in latest trunk(2010)
  • FAQ: [#6331] There is error in adau1371 audio testing on bf527-ezkit(2010)
  • [#5933] BF561-EZKIT SMP kernel can not wake up from standby mode by uart interrupt
  • FAQ: [#6564] dmacopy test on bf561-ezkit failed at sram_alloc in L1(2011)
  • [#4713] dmacopy tries to test L2 on BF537
  • [#4997] ppitest fails for bfin_ppi driver on bf537
  • [#5940] lynx fails in trunk due to using fork()
  • [#4104] Format usbdisk failed with mke2fs in trunk
  • FAQ: [#6578] iccutils build fails at scalar.c(2011)
  • [#3883] ftp server crash after connetion or chdir with MidnightCommander4.6.1
  • [#4697] kernel crash on bf533-stamp/bf533-ezkit after config IP for ethernet port
  • [#4050] xip test case failed in BF548-EZKIT
  • [#3991] mmc_spi not working out of the box.
  • [#3996] dhcpcd not stable on BF548-EZKIT
  • [#5136] Linphone: Can't hear each other and "Data access misaligned address violation"
  • [#5214] trunk applications don't build with trunk toolchain due to missing fork()
  • [#4055] top (busybox) crashs
  • [#5162] Linphone: Data access misaligned address
  • [#4992] bfin_sdh fails to build for BF514/BF516
  • [#5570] reboot on bf527-ezkit with nand and ubifs enabled fails
  • [#4955] 548 SDH: netperf, iperf triggers libertas error
  • [#5522] Lib DirectFB-1.4.0 crashes when run DirectFB demo on SVN trunk
  • [#3882] copy file function cp, after few times consume all memory
  • [#4773] BF527 usb-ide hard disk error

[#3991] mmc_spi not working out of the box.

[#3991] mmc_spi not working out of the box.

Submitted By: Hans Eklund

Open Date

2008-03-27 11:40:30     Close Date

2008-12-01 23:16:02

Priority:

Medium High     Assignee:

Yi Li

Status:

Closed     Fixed In Release:

N/A

Found In Release:

N/A     Release:

svn head

Category:

Drivers     Board:

STAMP

Processor:

BF537     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

App binary format:

N/A     

Summary: mmc_spi not working out of the box.

Details:

Introduction:

After a discussion the last couple of weeks with the spi-devel community, mmc_spi developers and maintainer David Brownell and others i believe it would be good to evaluate the mmc_spi driver from the mainline Linux source tree(drivers/mmc/host/mmc_spi.c), making it work vs. blackfin spi master driver.

After a small patch from Bryan last night i have built it vs uClinux-dist svn head and inserted it on a STAMP537 board using the Rubico MMC/SD addon board. I have yet to detect a card with it. I did not expect it to work either.:)

The driver does not support concurrent access just yet. But there is a patch for it but it would require the Blackfin SPI Master driver to be patched to fit a new exclusive access api for the spi framework. It has been tested on the au1550_spi master controller driver by Jan Nikitenko, one of the mmc_spi developers.

I thought it would be best to add a tracker for this topic since it seem to be reuqested from several users to have a working MMC/SD solution and to note any progress. In the end it would imply my old spi_mmc driver to be put on the shelf even though i made a fix for the concurrent access. This is the best solution in the long run.

Now, about the actual error:

I do this test:

$ modprobe mmc_block

$ modprobe mmc_probe

$ modprobe mmc_spi

I hook the scope up and see no data on MISO and MOSI, clock and CS is alive though. I guess the data dont reach the master driver. Could be the dma_map_page not working as intended, or any other dma/cache related problem. Should do a non-dma mode test and also view massive spi debug prints for now.

/Hans

Follow-ups

--- Hans Eklund                                              2008-03-27 12:25:33

Why not post progress, someone might just be interested:

Turned off dma mode, and voilá. I can read data blocks. Writing blocks seem to

fail since kernel reports an end_request error on fdisk and any other kinds of

induced writes. I allmost though block writes failed, but this nasty tell

another story:

root:/> echo "hello" > /dev/mmcblk0

mmcblk0: error -71 transferring data

end_request: I/O error, dev mmcblk0, sector 1

Buffer I/O error on device mmcblk0, logical block 0

lost page write due to I/O error on mmcblk0

root:/> dd if=/dev/mmcblk0 bs=6 count=1

hello

1+0 records in

1+0 records out

root:/>

So data block reaches card but an error is reported upwards. Multiple echo to

the card allways report error, multiple dd (reads) report end_request error one

out of ten times roughly. Test done also with module removed/reloaded and other

cards in between, written data was actually written.

Pulling my beard for awhile a believe it is probably a status check command

that report a false error for some reason.

Next: remove status check from driver after block writes.

My configuration, uclinux-dist svn head, add this to stamp.c:

#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)

static struct bfin5xx_spi_chip mmc_spi_chip_info = {

    .enable_dma = 0,

    .bits_per_word = 8,

};

#endif

And addition to static struct spi_board_info bfin_spi_board_info[] __initdata

#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)

        {

                .modalias = "mmc_spi",

                .max_speed_hz = 5000000,     /* max spi clock (SCK) speed in HZ

*/

                .bus_num = 0,

                .chip_select = 1,

                .platform_data = NULL,

                .controller_data = &mmc_spi_chip_info,

                .mode = SPI_MODE_3,

        },

#endif

Slow clock due to old crappy scope.

--- Hans Eklund                                              2008-03-27 13:18:11

Ok full debug mode(dmesg -n 8) tells me some/many blocks have CRC errors during

block reads. Dmesg -n 4(no debug messages from driver, but end_request will

still print): no errors, all fine. Writing still reports all kinds of error.

Somewhat strange. Will turn off CRC checking and verify data blocks manually.

--- Hans Eklund                                              2008-03-27 14:42:20

Allright, some success after some tweaking.

1) Turn off SPI crc checking by doing this when insterting mmc_block

$ modprobe mmc_block use_spi_crc=0

2) Need to modify mmc_spi.c to ignore status checks from block writes since it

seem to always be ff even though block was written ok. I have my ideas why it

happens, but this fix will do for now.

Can fdisk(create and write new partition), mkdosfs, mount it and write to some

extent. All using a simple Verbatim 256Mb SD card. Some end_request failiures

though on one try. md5sum verified files after remount.

All for tonight.

--- Hans Eklund                                              2008-03-28 11:20:07

Found out it is probably better to keep the crc checking and implement a block

read/write retry routine instead. Even more stable now. But not safe. Some

spooky errors now and then. MMC/SD card seem to sometimes be trapped in a mode

where i need to remove card, remove module, insert card and reload module. I

recognize this behaviour from "my" spi_mmc driver. Will se if i would

need to implement a low level reset if all else fails.

I include patch files for stamp.c and mmc_spi.c files at its current state if

anyone would like to continue/evaluate the work.

--- Bryan Wu                                                 2008-04-02 02:36:05

Hi Hans,

I am here trying to hook up your patch with MMC_SPI driver.

1. I cannot found module named mmc_probe

---

root:/> modprobe mmc_probe

modprobe: module mmc_probe not found

modprobe: failed to load module mmc_probe

---

Could you please upload your .config file for me?

2. /dev/mmcblock0 does not exist.

---

root:/> modprobe mmc_block

root:/> modprobe mmc_probe

modprobe: module mmc_probe not found

modprobe: failed to load module mmc_probe

root:/> modprobe mmc_spi

mmc_spi spi0.1: ASSUMING SPI bus stays unshared!

mmc_spi spi0.1: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.1: SD/MMC host mmc0, no DMA, no WP, no poweroff

mmc_spi spi0.1: requested mode not fully supported

mmc_spi spi0.1: can't change chip-select polarity

root:/> ls /dev

console   mem       ram1      ram14     ram5      random    ttyBF0

full      null      ram10     ram15     ram6      rtc0      urandom

kmem      ptmx      ram11     ram2      ram7      sport0    watchdog

kmsg      pts       ram12     ram3      ram8      sport1    zero

log       ram0      ram13     ram4      ram9      tty

---

Sorry for the replying delay, because I am struggling in the USB OTG bugs.

Thanks

-Bryan

--- Hans Eklund                                              2008-04-02 03:56:03

Sorry, in the haste i was sloppy, it should be

$ modprobe mmc_core

and not mmc_probe. My fault. Hope to continue testing soon. Is occupied with

other work for a few days now.

/Hans

--- Bryan Wu                                                 2008-04-02 06:34:54

I still cannot found /dev/mmcblock0

--

root:/> modprobe mmc_core

root:/> modprobe mmc_block

root:/> modprobe mmc_spi

mmc_spi spi0.1: ASSUMING SPI bus stays unshared!

mmc_spi spi0.1: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.1: SD/MMC host mmc0, no DMA, no WP, no poweroff

mmc_spi spi0.1: requested mode not fully supported

mmc_spi spi0.1: can't change chip-select polarity

root:/> ls /dev/

console   mem       ram1      ram14     ram5      random    ttyBF0

full      null      ram10     ram15     ram6      rtc0      urandom

kmem      ptmx      ram11     ram2      ram7      sport0    watchdog

kmsg      pts       ram12     ram3      ram8      sport1    zero

log       ram0      ram13     ram4      ram9      tty

root:/>

--

Need I create it manually?

-Bryan

--- Hans Eklund                                              2008-04-03 02:52:43

Nope, no need to create the device nodes, they should pop up once the driver

finds a card. It does not need to be partitioned correctly, the "whole

disk"-partition mmcblk0 should allways appear. I´ll post a step by step

instruction and verify the patches my self soon.

--- Hans Eklund                                              2008-04-08 12:57:09

Ok. short guide here. Can format a card and do basic data transfers.

I did this test with 5Mhz SPI clock:

This is a dump from a testrun, Verbatim 256mb SD card:

root:/> modprobe mmc_core use_spi_crc=0

root:/> modprobe mmc_block

root:/> modprobe mmc_spi use_tdr=0

mmc_spi spi0.1: ASSUMING SPI bus stays unshared!

mmc_spi spi0.1: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.1: requested mode not fully supported

mmc_spi spi0.1: can't change chip-select polarity

mmc_spi spi0.1: SD/MMC host mmc0, no DMA, no WP, no poweroff

root:/> mmc0: new SD card on SPI

mmcblk0: mmc0:0000 SD256 249088KiB

mmcblk0:<7>mmc0: starting CMD18 arg 00000000 flags 000000b5

p1 p2

root:/> mkdosfs /dev/mmcblk0p1

mkdosfs 2.10 (22 Sep 2003)

root:/>

Should work better, you could try witout the use_spi_crc force parameter also.

Need to test some more cards.

/Hans

--- Bryan Wu                                                 2008-05-08 00:02:25

Hi Hans,

Sorry for long silence. I tested the MMC card on my side. But this driver does

not work.

1. I did this test with 5Mhz SPI clock:

.max_speed_hz = 5000000,

System hangs and was reset by watchdogd

--

root:/>

root:/> modprobe mmc_core use_spi_crc=0

root:/> modprobe mmc_block

root:/> modprobe mmc_spi use_tdr=0

mmc_spi spi0.4: ASSUMING SPI bus stays unshared!

mmc_spi spi0.4: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.4: SD/MMC host mmc0, no DMA, no WP, no poweroff

--

2. set SPI clock for 2M, I can detect the card, but mkdosfs failed.

--

root:/> modprobe mmc_core use_spi_crc=0

root:/> modprobe mmc_block

root:/> modprobe mmc_spi use_tdr=0

mmc_spi spi0.4: ASSUMING SPI bus stays unshared!

mmc_spi spi0.4: ASSUMING 3.2-3.4 V slot power

mmc_spi spi0.4: SD/MMC host mmc0, no DMA, no WP, no poweroff

mmc_spi spi0.4: requested mode not fully supported

mmc_spi spi0.4: can't change chip-select polarity

root:/> mmc0: new MMC card on SPI

mmcblk0: mmc0:0001 MMC512 495104KiB

mmcblk0:<7>mmc0: starting CMD18 arg 00000000 flags 000000b5

p1 p2

root:/>

root:/>

root:/> mkdosfs /dev/mmcblk0p1

mkdosfs 2.11 (12 Mar 2005)

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 78

Buffer I/O error on device mmcblk0p1, logical block 8

lost page write due to I/O error on mmcblk0p1

end_request: I/O error, dev mmcblk0, sector 80

end_request: I/O error, dev mmcblk0, sector 82

end_request: I/O error, dev mmcblk0, sector 84

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 118

end_request: I/O error, dev mmcblk0, sector 120

end_request: I/O error, dev mmcblk0, sector 122

end_request: I/O error, dev mmcblk0, sector 124

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 142

end_request: I/O error, dev mmcblk0, sector 144

end_request: I/O error, dev mmcblk0, sector 146

end_request: I/O error, dev mmcblk0, sector 148

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 150

end_request: I/O error, dev mmcblk0, sector 152

end_request: I/O error, dev mmcblk0, sector 154

end_request: I/O error, dev mmcblk0, sector 156

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 174

end_request: I/O error, dev mmcblk0, sector 176

end_request: I/O error, dev mmcblk0, sector 178

end_request: I/O error, dev mmcblk0, sector 180

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 198

end_request: I/O error, dev mmcblk0, sector 200

end_request: I/O error, dev mmcblk0, sector 202

end_request: I/O error, dev mmcblk0, sector 204

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 230

end_request: I/O error, dev mmcblk0, sector 232

end_request: I/O error, dev mmcblk0, sector 234

end_request: I/O error, dev mmcblk0, sector 236

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 262

end_request: I/O error, dev mmcblk0, sector 264

end_request: I/O error, dev mmcblk0, sector 266

end_request: I/O error, dev mmcblk0, sector 268

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 270

end_request: I/O error, dev mmcblk0, sector 272

end_request: I/O error, dev mmcblk0, sector 274

end_request: I/O error, dev mmcblk0, sector 276

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 294

end_request: I/O error, dev mmcblk0, sector 296

end_request: I/O error, dev mmcblk0, sector 298

end_request: I/O error, dev mmcblk0, sector 300

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 302

end_request: I/O error, dev mmcblk0, sector 304

end_request: I/O error, dev mmcblk0, sector 306

end_request: I/O error, dev mmcblk0, sector 308

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 310

end_request: I/O error, dev mmcblk0, sector 312

end_request: I/O error, dev mmcblk0, sector 314

end_request: I/O error, dev mmcblk0, sector 316

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 334

end_request: I/O error, dev mmcblk0, sector 336

end_request: I/O error, dev mmcblk0, sector 338

end_request: I/O error, dev mmcblk0, sector 340

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 342

end_request: I/O error, dev mmcblk0, sector 344

end_request: I/O error, dev mmcblk0, sector 346

end_request: I/O error, dev mmcblk0, sector 348

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 366

end_request: I/O error, dev mmcblk0, sector 368

end_request: I/O error, dev mmcblk0, sector 370

end_request: I/O error, dev mmcblk0, sector 372

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 374

end_request: I/O error, dev mmcblk0, sector 376

end_request: I/O error, dev mmcblk0, sector 378

end_request: I/O error, dev mmcblk0, sector 380

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 398

end_request: I/O error, dev mmcblk0, sector 400

end_request: I/O error, dev mmcblk0, sector 402

end_request: I/O error, dev mmcblk0, sector 404

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 430

printk: 67 messages suppressed.

Buffer I/O error on device mmcblk0p1, logical block 184

lost page write due to I/O error on mmcblk0p1

end_request: I/O error, dev mmcblk0, sector 432

end_request: I/O error, dev mmcblk0, sector 434

end_request: I/O error, dev mmcblk0, sector 436

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 438

end_request: I/O error, dev mmcblk0, sector 440

end_request: I/O error, dev mmcblk0, sector 442

end_request: I/O error, dev mmcblk0, sector 444

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 462

end_request: I/O error, dev mmcblk0, sector 464

end_request: I/O error, dev mmcblk0, sector 466

end_request: I/O error, dev mmcblk0, sector 468

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 486

end_request: I/O error, dev mmcblk0, sector 488

end_request: I/O error, dev mmcblk0, sector 490

end_request: I/O error, dev mmcblk0, sector 492

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 494

end_request: I/O error, dev mmcblk0, sector 496

end_request: I/O error, dev mmcblk0, sector 498

end_request: I/O error, dev mmcblk0, sector 500

mmcblk0: error -110 sending read/write command

end_request: I/O error, dev mmcblk0, sector 550

end_request: I/O error, dev mmcblk0, sector 552

end_request: I/O error, dev mmcblk0, sector 554

end_request: I/O error, dev mmcblk0, sector 556

mmcblk0: error -53 sending read/write command

end_request: I/O error, dev mmcblk0, sector 582

end_request: I/O error, dev mmcblk0, sector 584

end_request: I/O error, dev mmcblk0, sector 586

end_request: I/O error, dev mmcblk0, sector 588

root:/>

--

It looks like the compatibility of this driver is not very good.

-Bryan

--- Sonic Zhang                                              2008-10-20 23:51:16

Yi took over the investigation of mainline spi mmc driver.

--- Sonic Zhang                                              2008-10-20 23:51:51

Yi took over the investigation of mainline spi mmc driver.

--- Yi Li                                                    2008-12-01 02:24:31

Wolfgang Mües fixed problem in spi_bfin5xx.c and mmc_spi.c, finally the mmc_spi

driver works on Blackfin. Details of the solutions can be found at:

  blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_action=ForumMessageBrowse&thread_id=31066.

Also at:

  www.mail-archive.com/uclinux-dist-devel@blackfin.uclinux.org/msg01038.html.

Here is summary:

For spi_bfin5xx.c:

1. Rewrite of the non-dma data transfer functions to use only ONE mode of TIMOD

(TIMOD = 0x1): With TIMOD=0, it was not possible to set the TX bit pattern. So

the TDBR = 0xFFFF inside the read calls won't work.

2. Clear SPI_RDBR before reading (and before duplex transfer). Otherwise the

garbage data will get read. Since mmc_spi uses a lot of duplex transfer, this is

the main cause of mmc_spi failure.

3. Poll RXS for transfer completion. Polling SPIF or TXS cannot guarantee

transfer finish. This may leave garbage data in buffer and affect next

transfer.

--- Yi Li                                                    2008-12-01 22:11:09

For mmc_spi.c:

change log:

- Use jiffies for busy waiting. No need to deal with ns-Precision and 64 bit

variables if all we need is timeouts in the ms area.

- Release CPU time if busy timeout gets long.

- Extend write timeout to 1s to cope with cheap high capacity SDHC cards which

got totaly upset if we write large chunks of data at once.

- Allow for the fact that a card is not able to send the response token after a

data transfer in time. The token may be delayed a few bits(!).

- Make the driver accept SPI_MODE_3

--- Yi Li                                                    2008-12-01 23:16:02

fixed and close the bug.

Next step would be:

- Wait and hope mainline accept changes in mmc_spi.c

- Performance testing

...

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

File Name     File Type     File Size     Posted By

stamp.c.diff    application/octet-stream    1077    Hans Eklund

mmc_spi.c.diff    application/octet-stream    2794    Hans Eklund

  • Share
  • History
  • More
  • Cancel
Related
Recommended
 
Social
Quick Links
  • About ADI
  • Partners
  • Analog Dialogue
  • Careers
  • Contact us
  • Investor Relations
  • News Room
  • Quality & Reliability
  • Sales & Distribution
  • Analog Garage
Languages
  • English
  • 简体中文
  • 日本語
  • Руccкий
Newsletters

Interested in the latest news and articles about ADI products, design tools, training and events? Choose from one of our 12 newsletters that match your product area of interest, delivered monthly or quarterly to your inbox.

Sign Up
Switch to mobile view
Analog Logo
© 1995 - 2023 Analog Devices, Inc. All Rights Reserved 沪ICP备09046653号-1
  • ©
  • 1995 - 2023 Analog Devices, Inc. All Rights Reserved
  • 沪ICP备09046653号-1
  • Sitemap
  • Privacy & Security
  • Privacy Settings
  • Terms of use
EngineerZone Uses cookies to ensure you get the best experience in our community. For more information on cookies, please read our Privacy & Security Statement.