we must to use the DMA mode, how to do it? thanks. chendh ----- Original Message ----- From: Steve Spano To: 'chendh' Cc: [EMAIL PROTECTED] ; [email protected] Sent: Friday, November 17, 2006 5:43 PM Subject: RE: Using both ATA and EMIF
See my last message I posted I had to disable DMA mode Put the HDD into PIO-0 mode Lock the kernel And apply the save_local_irq to disable interrupts That did the trick I posted a message with my code segment on how to do this Steve Spano FLE -----Original Message----- From: chendh [mailto:[EMAIL PROTECTED] Sent: Friday, November 17, 2006 4:01 AM To: Steve Spano Cc: [EMAIL PROTECTED]; [email protected] Subject: Re: Using both ATA and EMIF hi,all I have tried to use lock_kernel and unlock_kernel rather than spinlocks. Unfortunately, when copy some data to hard disk while changing PINMUX0 to enabe EMIF, this will cause write error. Both in DMA and PIO mode will fail. The error information is as follows: hdb: status timeout: status=0xff { Busy } ide: failed opcode was: unknown hdb: drive not ready for command ide0: reset: master: ECC circuitry error hdb: task_out_intr: status=0x31 { DeviceFault SeekComplete Error } hdb: task_out_intr: error=0xff { DriveStatusError BadCRC UncorrectableError Sect orIdNotFound TrackZeroNotFound AddrMarkNotFound }, LBAsect=268435455, sector=502 7507 ide: failed opcode was: unknown ide0: reset: master: ECC circuitry error end_request: I/O error, dev hdb, sector 5027507 Buffer I/O error on device hdb1, logical block 5027444 lost page write due to I/O error on hdb1 end_request: I/O error, dev hdb, sector 5027508 Buffer I/O error on device hdb1, logical block 5027445 lost page write due to I/O error on hdb1 end_request: I/O error, dev hdb, sector 5027509 Buffer I/O error on device hdb1, logical block 5027446 lost page write due to I/O error on hdb1 end_request: I/O error, dev hdb, sector 5027510 Buffer I/O error on device hdb1, logical block The result is worse than use spinlock, :) Could you try to practise the whole process? 1)mount /dev/hda1 /mnt 2)cp something.tgz /mnt 3)change to EMIF, mdelay(100), return to ATA, for some loop hard disk works in DMA or PIO. thanks. chendh ----- Original Message ----- From: Steve Spano To: chendh Sent: Thursday, November 16, 2006 11:36 AM Subject: Re: Using both ATA and EMIF I think i used lock_kernel and unlock_kernel rather than spinlocks your format is the same as mine lock enable do something disable unlock should work for you try lock_kernel and unlock_kernel -----Original Message----- From: "chendh" <[EMAIL PROTECTED]> To: "Steve Spano" <[EMAIL PROTECTED]> Date: Thu, 16 Nov 2006 10:36:14 +0800 Subject: Re: Using both ATA and EMIF hi, I use the variable "spinlock_t ide_lock" the lock kernel, then change PINMUX0, do my actions, and return PINMUX0 and unlock the kernel. The changes just like: change to EMIF: spin_lock_irq(&ide_lock); enable_emif(); do_something(); disable_emif(); spin_unlock(&ide_lock); //success spin_unlock_irq(&ide_lock); //failed, why?? in ide drivers, I change nothing. In PIO mode, the above method is OK, but DMA mode is FAILED. DMA is out of control of CPU, how to lock kernel? Can you help me? thanks. chendh iFLYTEK ----- Original Message ----- From: Steve Spano To: 'chendh' ; [email protected] Sent: Wednesday, November 15, 2006 10:50 PM Subject: RE: Using both ATA and EMIF Hi We are using the same scheme in a driver (VPFE) to issue read/writes to and FPGA. Just make sure you lock the kernel, set PINMUX0, do your read/write, then return PINMUX0 and unlock the kernel DMA mode appears to work fine as well Steve Spano FLE -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of chendh Sent: Wednesday, November 15, 2006 3:32 AM To: [email protected] Subject: Using both ATA and EMIF hi,everyone I have tried to use both ata and emif, they can be used at the same time.I try to send some control commands via EMIF, while copy some data to ATA hard disk. you can just to use they as follows: 1)change PINMUX0 to enable ATA after kernel boot time 2)when you want to use emif bus to control some device, you can change PINMUX0 to disable ATA and enable EMIF,then do something. 3)after finishing to use emif, change PINMUX0 to enable ATA, now ata is accessible notice: 1)the occasion to change PINMUX0 to enable EMIF is very important, you must ensure ATA has finished one operation, otherwise, may cause errors. I know how to ensure it when access ATA hard disk via PIO mode, but don't known how to do it when access ATA hard disk via DMA or UDMA mode, Can anybody help me? ------------------------------------------ jit chen ANHUI USTC iFLYTEK CO.,LTD Tel: 021-52955071 web: www.iflytek.com
_______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
