Does s3cmci driver support DMA data transfer?

Lonsn lonsn at 163.com
Sun Jan 13 11:04:58 CET 2008


I have tested s3cmci driver with linux 2.6.24-rc5, but failed. s3cmci patch is from : http://svn.openmoko.org/branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch.
When I used linux-2.6.21.3 kernel with related s3cmci patch, the sd card works well.

The following is my kernel boot messages:
Starting kernel ...

Uncompressing Linux............................................................ done, booting the kernel.
Linux version 2.6.24-rc5 (Lonsn at localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #2 Sun Jan 13 17:53:13 CST 8CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: MOTION2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 304.000 MHz, memory 101.333 MHz, peripheral 50.666 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 6096
Kernel command line: root=/dev/ram0 rw console=ttySAC0,115200 initrd=0x30800000,0x400000 mem=24m
irq: clearing pending ext status 00110000
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 128 (order: 7, 512 bytes)
timer tcon=00500000, tcnt a4ed, tcfg 00000200,00000000, usec 00001e51
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 24MB = 24MB total
Memory: 18256KB available (1632K code, 222K data, 84K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: Clock Support, DVS off
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c2000000, irq 33
DMA channel 1 at c2000040, irq 34
DMA channel 2 at c2000080, irq 35
DMA channel 3 at c20000c0, irq 36
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 4096K
NetWinder Floating Point Emulator V0.97 (double precision)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
s3c2440-sdi s3c2440-sdi: powered down.
s3c2440-sdi s3c2440-sdi: initialisation done.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 84K
init started: BusyBox v1.5.1 (2007-06-12 15:38:24 CST) multi-call binary
starting pid 703, tty '': '/etc/init.d/rcS'
Welcome to Motion Detection Board
Any question, contact lonsn at 163.com
starting pid 705, tty '': '/bin/sh'
MOTION2440# s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: CMD[FAIL(-110)] #3 op:CMD5 arg:0x00000000 flags:0x082e1 retries:3 Status:nothing to complete
s3c2440-sdi s3c2440-sdi: CMD[FAIL(-110)] #4 op:CMD5 arg:0x00000000 flags:0x082e1 retries:2 Status:nothing to complete
s3c2440-sdi s3c2440-sdi: CMD[FAIL(-110)] #5 op:CMD5 arg:0x00000000 flags:0x082e1 retries:1 Status:nothing to complete
s3c2440-sdi s3c2440-sdi: CMD[FAIL(-110)] #6 op:CMD5 arg:0x00000000 flags:0x082e1 retries:0 Status:nothing to complete
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 16888kHz (requested: 25000kHz).
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1985024KiB
 mmcblk0:<7>mmc0: starting CMD18 arg 00000000 flags 000000b5
Unable to handle kernel paging request at virtual address c1800000
pgd = c0c60000
[c1800000] *pgd=00000000
Internal error: Oops: 805 [#1]
Modules linked in:
CPU: 0    Not tainted  (2.6.24-rc5 #2)
PC is at pio_tasklet+0x2f8/0x880
LR is at 0x1
pc : [<c01423dc>]    lr : [<00000001>]    psr: 20000013
sp : c01b7ecc  ip : 00000001  fp : c01b7ef0
r10: 3001a43c  r9 : 41129200  r8 : 3001a470
r7 : 00000000  r6 : 0000000a  r5 : c144d9a0  r4 : c2600040
r3 : c1800000  r2 : 00000000  r1 : c1450044  r0 : c144c000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: c000717f  Table: 30c60000  DAC: 00000017
Process swapper (pid: 0, stack limit = 0xc01b6258)
Stack: (0xc01b7ecc to 0xc01b8000)
7ec0:                            00000025 c0d22fc0 00000000 c01de8c8 0000000a
7ee0: 00000000 c01b7f04 c01b7ef4 c003b628 c01420f4 00000001 c01b7f20 c01b7f08
7f00: c003b97c c003b5b8 c01c1fe4 00000025 c01ea934 c01b7f30 c01b7f24 c003ba30
7f20: c003b930 c01b7f50 c01b7f34 c001d048 c003b9fc ffffffff f4000000 00200000
7f40: c01b9ba0 c01b7fa8 c01b7f54 c001da44 c001d010 c1449e20 f410000c 00000000
7f60: 60000013 c001edbc c01b6000 c001bf2c c01b9ba0 3001a470 41129200 3001a43c
7f80: c01b7fa8 c01b7f9c c01b7f9c c001ee1c c001ee28 60000013 ffffffff c01b7fc0
7fa0: c01b7fac c001ec80 c001edcc c01e11fc c01cce6c c01b7fd0 c01b7fc4 c0142c8c
7fc0: c001ec54 c01b7ff4 c01b7fd4 c0008b04 c0142c4c c0008470 c001bf2c c0007175
7fe0: c01cd2f0 c001bf24 00000000 c01b7ff8 30008034 c00088a4 00000000 00000000
Backtrace:
[<c01420e4>] (pio_tasklet+0x0/0x880) from [<c003b628>] (tasklet_action+0x80/0xdc)
 r7:00000000 r6:0000000a r5:c01de8c8 r4:00000000
[<c003b5a8>] (tasklet_action+0x0/0xdc) from [<c003b97c>] (__do_softirq+0x5c/0xcc)
 r4:00000001
[<c003b920>] (__do_softirq+0x0/0xcc) from [<c003ba30>] (irq_exit+0x44/0x4c)
 r6:c01ea934 r5:00000025 r4:c01c1fe4
[<c003b9ec>] (irq_exit+0x0/0x4c) from [<c001d048>] (asm_do_IRQ+0x48/0x5c)
[<c001d000>] (asm_do_IRQ+0x0/0x5c) from [<c001da44>] (__irq_svc+0x24/0xa0)
Exception stack(0xc01b7f54 to 0xc01b7f9c)
7f40:                                              c1449e20 f410000c 00000000
7f60: 60000013 c001edbc c01b6000 c001bf2c c01b9ba0 3001a470 41129200 3001a43c
7f80: c01b7fa8 c01b7f9c c01b7f9c c001ee1c c001ee28 60000013 ffffffff
 r7:c01b9ba0 r6:00200000 r5:f4000000 r4:ffffffff
[<c001edbc>] (default_idle+0x0/0x78) from [<c001ec80>] (cpu_idle+0x3c/0x58)
[<c001ec44>] (cpu_idle+0x0/0x58) from [<c0142c8c>] (rest_init+0x50/0x60)
 r5:c01cce6c r4:c01e11fc
[<c0142c3c>] (rest_init+0x0/0x60) from [<c0008b04>] (start_kernel+0x270/0x2dc)
[<c0008894>] (start_kernel+0x0/0x2dc) from [<30008034>] (0x30008034)
Code: e5953040 e5952014 e7d22003 e5953068 (e4c32001)
Kernel panic - not syncing: Fatal exception in interrupt


    在2008-01-12,"Harald Welte" <laforge at openmoko.org> 写道: On Wed, Jan 09, 2008 at 10:16:01PM +0800, Lonsn wrote:
> Hi:
> I'm now using s3cmci patch(http://svnweb.openmoko.org/branches/src/target/kernel/2.6.21.x/patches/s3c_mci.patch?rev=2805&view=auto) and it works well. The SD card write speed is about 26Mbits/s(S3C2440A 400MHz, Sandisk UltraIII 2GB sd card).
> But the CPU load is too heavy(80%). So I want to let s3cmci driver work in DMA mode. I changed host->dodma = 1;


> But it doesn't work and the driver cann't detect the sd card. Does
> anyone use the s3cmci driver in DMA mode successfully?

I don't think anyone has used it with DMA in a long time (probably no
later than 2.6.14 or even 2.6.10).  There have been DMA API changes that
might not be reflected in the driver.

I strongly recommend you use the driver that is present in the 2.6.24.x
branch of the openmoko svn (which is also what has been submitted to
linux-arm-kernel some weeks back).

> Another question: Can sd card work speed be more than 25MHz? As I
> know, the maximum sdi clock of S3C2440A is 33MHz(APB clock=67MHz,
> prescaler value=1) and UltraIII sd card can support 40MHz
> frequency(20MBytes/s). If we can let s3cmci driver works in 33MHz
> modes, maybe the sd card IO performance could be increased a lot. But
> the sdi clock works only 22.5MHz(prescaler value=2) mode now.

I don't think anyone has tried this yet.

-- 
- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080113/49178ef8/attachment.htm 


More information about the openmoko-kernel mailing list