linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SD/MMC over SPI on 2.6.24-rc1
@ 2007-11-06 21:32 cksim
       [not found] ` <200711062132.lA6LWOLr005428-kStlDfoawLFc9vzhF02D5Ynh5Q2U4q7d@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: cksim @ 2007-11-06 21:32 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

Hi,

I have just tested kernel 2.6.24-rc1 with SD/MMC through SPI bus on the
AT91SAM9261EK board (SPI NPCS3) and noted that the SD card was detected and
info were noted under "/sys/bus/mmc" directory.

However, no device, such as mmcblk0p1, was assigned at all.

I have 2 questions with regards to SD/MMC over SPI.

1) In the code, I have commented out all other SPI devices on SPI0 bus
except for the SD card at spi0.3. However, I got an error "can't share SPI
bus". Anyone can advise what is the reason behind this error ?
(In order to proceed with my test below, I temporary got over this issue by
commenting out the check that gives this error.)

2) The kernel 2.6.24-rc1 boots up and detected the SD card with the console
output "new SD card on SPI". However, no device name, such as mmcblk0p1,
were allocated. In addition, I noted the following messages before the
sentence "mmc0: new SD card on SPI".

****** extract from console output ***********
WARNING: at drivers/mmc/core/core.c:397 mmc_set_clock()
[<c002901c>] (dump_stack+0x0/0x14) from [<c018dfd8>]
(mmc_set_clock+0x40/0xb4)
[<c018df98>] (mmc_set_clock+0x0/0xb4) from [<c01907b4>]
(mmc_attach_sd+0x610/0x844)
[<c01901a4>] (mmc_attach_sd+0x0/0x844) from [<c018e3e4>]
(mmc_rescan+0x204/0x2e0)
[<c018e1e0>] (mmc_rescan+0x0/0x2e0) from [<c004b154>]
(run_workqueue+0xb8/0x148)
 r7:00000000 r6:c018e1e0 r5:c044e000 r4:c048d4a0
[<c004b09c>] (run_workqueue+0x0/0x148) from [<c004bbe4>]
(worker_thread+0xa8/0xbc)
 r6:c004bb3c r5:c048d4a0 r4:c048d4a8
[<c004bb3c>] (worker_thread+0x0/0xbc) from [<c004f5f4>] (kthread+0x58/0x90)
 r5:c048d4a0 r4:c044e000
[<c004f59c>] (kthread+0x0/0x90) from [<c003e698>] (do_exit+0x0/0x6fc)
 r6:00000000 r5:00000000 r4:00000000
****** end of extract ***********

(I have attached a console debug output, including dmesg output, as well)

FYI, I am using a blank 16MB SD card with FAT filesystem.

Appreciate any advices/help given.

Lastly, I would like to know if the SD/MMC over SPI can be shared with other
SPI devices, such as touchscreen controller ADS7843 (purposely left out in
the current code) ?

Thanks in advance.

[-- Attachment #2: mini_011107_1.txt --]
[-- Type: text/plain, Size: 22082 bytes --]



dm9000 i/o: 0x30000000, id: 0x90000a46 
MAC: de:ad:be:ef:01:01
operating at 100M full duplex mode
TFTP from server 192.168.3.1; our IP address is 192.168.3.77
Filename 'vmImage'.
Load address: 0x22000000
Loading: *\b#################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #########
done
Bytes transferred = 1375579 (14fd5b hex)
## Booting image at 22000000 ...
   Image Name:   ET Linux Kernel Only Image
   Image Type:   ARM Linux Kernel Image (gzip compressed)
   Data Size:    1375515 Bytes =  1.3 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.24-rc1 (root@Debian-Laptop) (gcc version 4.1.2) #20 Thu Nov 1 15:23:46 SGT 2007
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: Atmel AT91SAM9261-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 199 MHz, master 99 MHz, main 18.432 MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/nfs rw nfsroot=192.168.3.1:/ronetix/rootfs mtdparts=physmap-flash.0:256k(u-boot)ro,64k(u-boot-env)ro,1344k(kernel),-(rootfs);nand:-(nand) ip=192.168.3.77:192.168.3.1:192.168.3.1:255.255.255.0:nini:eth0:off
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [tty0] enabled
console [ttyS0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61952KB available (2568K code, 239K data, 112K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 64 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
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
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
dm9000 Ethernet Driver
eth0: dm9000 at c485c000,c485e004 IRQ 56 MAC: de:ad:be:ef:01:01
physmap platform flash device: 00400000 at 10000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
4 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 4 MTD partitions on "physmap-flash.0":
0x00000000-0x00040000 : "u-boot"
0x00040000-0x00050000 : "u-boot-env"
0x00050000-0x001a0000 : "kernel"
0x001a0000-0x00400000 : "rootfs"
NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 473 at 0x03b20000
Bad eraseblock 728 at 0x05b00000
Bad eraseblock 743 at 0x05ce0000
Bad eraseblock 813 at 0x065a0000
Bad eraseblock 1001 at 0x07d20000
Bad eraseblock 1730 at 0x0d840000
Creating 1 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x10000000 : "nand"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)
usbmon: debugfs is not available
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
mmc_spi spi0.3: ASSUMING 3.2-3.4 V slot power
mmc_spi spi0.3: SD/MMC host mmc0, no WP, no poweroff
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
WARNING: at drivers/mmc/core/core.c:397 mmc_set_clock()
[<c002901c>] (dump_stack+0x0/0x14) from [<c018dfd8>] (mmc_set_clock+0x40/0xb4)
[<c018df98>] (mmc_set_clock+0x0/0xb4) from [<c01907b4>] (mmc_attach_sd+0x610/0x844)
[<c01901a4>] (mmc_attach_sd+0x0/0x844) from [<c018e3e4>] (mmc_rescan+0x204/0x2e0)
[<c018e1e0>] (mmc_rescan+0x0/0x2e0) from [<c004b154>] (run_workqueue+0xb8/0x148)
 r7:00000000 r6:c018e1e0 r5:c044e000 r4:c048d4a0
[<c004b09c>] (run_workqueue+0x0/0x148) from [<c004bbe4>] (worker_thread+0xa8/0xbc)
 r6:c004bb3c r5:c048d4a0 r4:c048d4a8
[<c004bb3c>] (worker_thread+0x0/0xbc) from [<c004f5f4>] (kthread+0x58/0x90)
 r5:c048d4a0 r4:c044e000
[<c004f59c>] (kthread+0x0/0x90) from [<c003e698>] (do_exit+0x0/0x6fc)
 r6:00000000 r5:00000000 r4:00000000
eth0: link down
IP-Config: Complete:
      device=eth0, addr=192.168.3.77, mask=255.255.255.0, gw=192.168.3.1,
     host=nini, domain=, nis-domain=(none),
     bootserver=192.168.3.1, rootserver=192.168.3.1, rootpath=
Looking up port of RPC 100003/2 on 192.168.3.1
eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Looking up port of RPC 100005/1 on 192.168.3.1
VFS: Mounted root (nfs filesystem).
Freeing init memory: 112K
mount: can't find udev in /etc/fstab
Starting portmap: done
Starting network...
ip: RTNETLINK answers: File exists
Starting NFS statd: done
Starting NFS services: done
Starting NFS daemon: done
Starting NFS mountd: done
Starting HPA's tftpd: done
 thttpd


nini login: root
[root@nini ~]# dmesg
D8 response SPI_R3/R4/R: resp 0005 ffffffff
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD8): -22: 00000005 ffffffff 00000000 00000000
mmc0: starting CMD5 arg 00000000 flags 000002e1
mmc_spi spi0.3:   mmc_spi: CMD5, resp R3/R4/R7
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 21 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 21 bytes transferred
mmc_spi spi0.3:   ... CMD5 response SPI_R3/R4/R: resp 0005 ffffffff
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD5): -22: 00000005 ffffffff 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.3:   mmc_spi: CMD55, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD41 arg 00000000 flags 000000e1
mmc_spi spi0.3:   mmc_spi: CMD41, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD0 arg 00000000 flags 000000c0
mmc_spi spi0.3:   mmc_spi: CMD0, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD58 arg 00000000 flags 00000280
mmc_spi spi0.3:   mmc_spi: CMD58, resp R3/R4/R7
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 21 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 21 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD58): 0: 00000001 00ff8000 00000000 00000000
mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0
mmc0: starting CMD0 arg 00000000 flags 000000c0
mmc_spi spi0.3:   mmc_spi: CMD0, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD0): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD8 arg 000001aa flags 000002f5
mmc_spi spi0.3:   mmc_spi: CMD8, resp R3/R4/R7
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 21 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 21 bytes transferred
mmc_spi spi0.3:   ... CMD8 response SPI_R3/R4/R: resp 0005 ffffffff
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD8): -22: 00000005 ffffffff 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.3:   mmc_spi: CMD55, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD41 arg 00000000 flags 000000e1
mmc_spi spi0.3:   mmc_spi: CMD41, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD41): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc_spi spi0.3:   mmc_spi: CMD55, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD55): 0: 00000001 00000000 00000000 00000000
mmc0: starting CMD41 arg 00000000 flags 000000e1
mmc_spi spi0.3:   mmc_spi: CMD41, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD41): 0: 00000000 00000000 00000000 00000000
mmc0: starting CMD59 arg 00000001 flags 00000080
mmc_spi spi0.3:   mmc_spi: CMD59, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD59): 0: 00000000 00000000 00000000 00000000
mmc0: starting CMD10 arg 00000000 flags 000000b5
mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 0
mmc_spi spi0.3:   mmc_spi: CMD10, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 9 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 9 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
mmc_spi spi0.3:     mmc_spi: read block, 16 bytes
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3:   start xfer c057a9d4: len 16 tx c0595600/20595600 rx c05a0a40/205a0a40 imr 018
mmc_spi spi0.3:   start xfer c057a9f8: len 2 tx c0595600/20595600 rx c05a0c5e/205a0c5e imr 018
mmc_spi spi0.3: DEactivate 38, mr 000f0011
atmel_spi atmel_spi.0: xfer complete: 18 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD10): 0: 00000000 00000000 00000000 00000000
mmc0:     16 bytes transferred: 0
mmc0: starting CMD9 arg 00000000 flags 000000b5
mmc0:     blksz 16 blocks 1 flags 00000200 tsac 0 ms nsac 0
mmc_spi spi0.3:   mmc_spi: CMD9, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 9 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 9 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
mmc_spi spi0.3:     mmc_spi: read block, 16 bytes
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3:   start xfer c057a9d4: len 16 tx c0595600/20595600 rx c05a0a40/205a0a40 imr 018
mmc_spi spi0.3:   start xfer c057a9f8: len 2 tx c0595600/20595600 rx c05a0c5e/205a0c5e imr 018
mmc_spi spi0.3: DEactivate 38, mr 000f0011
atmel_spi atmel_spi.0: xfer complete: 18 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD9): 0: 00000000 00000000 00000000 00000000
mmc0:     16 bytes transferred: 0
mmc0: starting CMD55 arg 00000000 flags 00000095
mmc_spi spi0.3:   mmc_spi: CMD55, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 17 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 17 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD55): 0: 00000000 00000000 00000000 00000000
mmc0: starting CMD51 arg 00000000 flags 000000b5
mmc0:     blksz 8 blocks 1 flags 00000200 tsac 100 ms nsac 0
mmc_spi spi0.3:   mmc_spi: CMD51, resp R1
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3: activate 38, mr 00070011
mmc_spi spi0.3:   start xfer c057a9d4: len 9 tx c05a0c40/205a0c40 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 9 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
mmc_spi spi0.3:     mmc_spi: read block, 8 bytes
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa90 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa90 for spi0.3
mmc_spi spi0.3:   start xfer c057aa6c: len 1 tx c0595600/20595600 rx c05a0c40/205a0c40 imr 018
atmel_spi atmel_spi.0: xfer complete: 1 bytes transferred
atmel_spi atmel_spi.0: new message c057aa40 submitted for spi0.3
atmel_spi atmel_spi.0: start message c057aa40 for spi0.3
mmc_spi spi0.3:   start xfer c057a9d4: len 8 tx c0595600/20595600 rx c057df34/2057df34 imr 018
mmc_spi spi0.3:   start xfer c057a9f8: len 2 tx c0595600/20595600 rx c05a0c5e/205a0c5e imr 018
mmc_spi spi0.3: DEactivate 38, mr 000f0011
atmel_spi atmel_spi.0: xfer complete: 10 bytes transferred
mmc_spi spi0.3: DEactivate 38, mr 000f0011
mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902
mmc0: req done (CMD51): 0: 00000000 00000000 00000000 00000000
mmc0:     8 bytes transferred: 0
WARNING: at drivers/mmc/core/core.c:397 mmc_set_clock()
[<c002901c>] (dump_stack+0x0/0x14) from [<c018dfd8>] (mmc_set_clock+0x40/0xb4)
[<c018df98>] (mmc_set_clock+0x0/0xb4) from [<c01907b4>] (mmc_attach_sd+0x610/0x844)
[<c01901a4>] (mmc_attach_sd+0x0/0x844) from [<c018e3e4>] (mmc_rescan+0x204/0x2e0)
[<c018e1e0>] (mmc_rescan+0x0/0x2e0) from [<c004b154>] (run_workqueue+0xb8/0x148)
 r7:00000000 r6:c018e1e0 r5:c044e000 r4:c048d4a0
[<c004b09c>] (run_workqueue+0x0/0x148) from [<c004bbe4>] (worker_thread+0xa8/0xbc)
 r6:c004bb3c r5:c048d4a0 r4:c048d4a8
[<c004bb3c>] (worker_thread+0x0/0xbc) from [<c004f5f4>] (kthread+0x58/0x90)
 r5:c048d4a0 r4:c044e000
[<c004f59c>] (kthread+0x0/0x90) from [<c003e698>] (do_exit+0x0/0x6fc)
 r6:00000000 r5:00000000 r4:00000000
mmc0: clock 0Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0
eth0: link down
IP-Config: Complete:
      device=eth0, addr=192.168.3.77, mask=255.255.255.0, gw=192.168.3.1,
     host=nini, domain=, nis-domain=(none),
     bootserver=192.168.3.1, rootserver=192.168.3.1, rootpath=
Looking up port of RPC 100003/2 on 192.168.3.1
eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Looking up port of RPC 100005/1 on 192.168.3.1
VFS: Mounted root (nfs filesystem).
Freeing init memory: 112K
[root@nini ~]# 

[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: SD/MMC over SPI on 2.6.24-rc1
       [not found] ` <200711062132.lA6LWOLr005428-kStlDfoawLFc9vzhF02D5Ynh5Q2U4q7d@public.gmane.org>
@ 2007-11-06 22:47   ` David Brownell
  2007-11-07  6:12   ` David Brownell
  1 sibling, 0 replies; 3+ messages in thread
From: David Brownell @ 2007-11-06 22:47 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	cksim-rdc5FV7LBygPGFelY5Zqew

On Tuesday 06 November 2007, cksim wrote:
> I have 2 questions with regards to SD/MMC over SPI.

Answering one at a time ...

> 1) In the code, I have commented out all other SPI devices on SPI0 bus
> except for the SD card at spi0.3. However, I got an error "can't share SPI
> bus". Anyone can advise what is the reason behind this error ?

This should be resolved in the current GIT code.  Getting rid of the
class_device caused the "is this bus shared" check to break, and
ISTR the fix was merged shortly after RC1.


> ...
> 
> Lastly, I would like to know if the SD/MMC over SPI can be shared with other
> SPI devices, such as touchscreen controller ADS7843 (purposely left out in
> the current code) ?

By "shared" I presume you mean allowing e.g. both the MMC and
touchscreen operations on the same bus, rather than continuing
with the current "MMC must be alone" restriction?


The issue is that MMC needs a way to issue a sequence of SPI
messages without allowing another device on the bus.  For
example, issuing a "read block" command, is one operation;
then there can be several operations reading "busy" status
until the card has data; then another operation reading that
data block; and then a final operation.

The way SPI normally works is that when one message completes,
the next one in the controller queue is handled.  Which could
mean for example reading touchscreen sensor values ... while
that MMC card is writing "busy" status on the MISO line.  So
the touchscreen sensor values would be corrupted, and maybe
that MMC data block would be lost ...

There are a couple nuances there (notably that it's possible
to drop acess to the bus during that "busy" state), but the
key point is that unless (and until!) the SPI stack gets a
new primitive to let drivers temporarily get exclusive access,
sharing a bus segment between MMC and anything else can't work.


There are a few proposals for such an API extension that I
know about, and as more people start to care about mmc_spi
it seems likely they'll attract interest that has previously
been lacking.  ;)

- Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: SD/MMC over SPI on 2.6.24-rc1
       [not found] ` <200711062132.lA6LWOLr005428-kStlDfoawLFc9vzhF02D5Ynh5Q2U4q7d@public.gmane.org>
  2007-11-06 22:47   ` David Brownell
@ 2007-11-07  6:12   ` David Brownell
  1 sibling, 0 replies; 3+ messages in thread
From: David Brownell @ 2007-11-07  6:12 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	cksim-rdc5FV7LBygPGFelY5Zqew
  Cc: Pierre Ossman

On Tuesday 06 November 2007, cksim wrote:
>
> 2) The kernel 2.6.24-rc1 boots up and detected the SD card with the console
> output "new SD card on SPI". However, no device name, such as mmcblk0p1,
> were allocated.

Did you load the mmc_block driver, and include partitioning support?


> In addition, I noted the following messages before the 
> sentence "mmc0: new SD card on SPI".
> 
> ****** extract from console output ***********

> mmc_spi spi0.3: ASSUMING 3.2-3.4 V slot power
> mmc_spi spi0.3: SD/MMC host mmc0, no WP, no poweroff

You should at least tell it the right values for what
voltage is provided that slot ... that's part of what
the platform data will let you do.  :)


> mmc_spi spi0.3: setup: 399730 Hz bpw 8 mode 0x0 -> csr3 0a0af902

Which looks like a good match for 400 KHz.


> WARNING: at drivers/mmc/core/core.c:397 mmc_set_clock()

Which is presumably "WARN_ON(hz < host->f_min);" ...

When you add some debug messages, what does it tell you
about the actual speed being requested there?


> [<c002901c>] (dump_stack+0x0/0x14) from [<c018dfd8>]
> (mmc_set_clock+0x40/0xb4)
> [<c018df98>] (mmc_set_clock+0x0/0xb4) from [<c01907b4>]
> (mmc_attach_sd+0x610/0x844)
> [<c01901a4>] (mmc_attach_sd+0x0/0x844) from [<c018e3e4>]
> (mmc_rescan+0x204/0x2e0)
> [<c018e1e0>] (mmc_rescan+0x0/0x2e0) from [<c004b154>]
> (run_workqueue+0xb8/0x148)
>  r7:00000000 r6:c018e1e0 r5:c044e000 r4:c048d4a0
> [<c004b09c>] (run_workqueue+0x0/0x148) from [<c004bbe4>]
> (worker_thread+0xa8/0xbc)
>  r6:c004bb3c r5:c048d4a0 r4:c048d4a8
> [<c004bb3c>] (worker_thread+0x0/0xbc) from [<c004f5f4>] (kthread+0x58/0x90)
>  r5:c048d4a0 r4:c044e000
> [<c004f59c>] (kthread+0x0/0x90) from [<c003e698>] (do_exit+0x0/0x6fc)
>  r6:00000000 r5:00000000 r4:00000000

> mmc0: clock 0Hz busmode 2 powermode 2 cs 1 Vdd 20 width 0 timing 0

I'm guessing that for some reason part of the MMC stack tried
to set hz == 0, triggering that warning ... I recall seeing it
do that a long time ago, but that was without any WARN_ON() in
the code.  The entire reason that atmel_spi will accept a
command to set the clock rate to zero is because the MMC stack
was using that convention.  ;)

- Dave


> ****** end of extract ***********
> 
> (I have attached a console debug output, including dmesg output, as well)
> 
> FYI, I am using a blank 16MB SD card with FAT filesystem.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-07  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-06 21:32 SD/MMC over SPI on 2.6.24-rc1 cksim
     [not found] ` <200711062132.lA6LWOLr005428-kStlDfoawLFc9vzhF02D5Ynh5Q2U4q7d@public.gmane.org>
2007-11-06 22:47   ` David Brownell
2007-11-07  6:12   ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).