天天看點

S3C6410驅動IDE硬碟

S3C6410提供兩種方式驅動IDE硬碟,PIO模式和UDMA模式,兩種模式分别使用不同的接口線。硬體接口如下圖

S3C6410驅動IDE硬碟

https://p-blog.csdn.net/images/p_blog_csdn_net/guetcw/EntryImages/20091015/444.jpg

2.5寸以下的IDE硬碟接口大都是3.3V可以直接和6410的IO連接配接不需要電平轉換。

PIO模式使用Xm0這組總線,UDMA模式使用Xhi這組總線,兩組總線不能同時候接到IDE硬碟,隻能選擇一種,将另一組的串聯電阻去掉。

在系統資料庫中添加如下資訊

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/6410_CF]

 "Prefix"="IDE"

 "Dll"="s3c6410_cf_atapi.dll"

 "Order"=dword:15

 "Class"=dword:01

 "SubClass"=dword:01

 "ConfigEntry"="GenericConfig"  ; PCI configuration entry point ;;maybe not required

 "Legacy"=dword:01    ; legacy, use Irq for primary and Irq+1 for secondary ;;maybe not required

 "Irq"=dword:54     ; CFCon Virtual IRQ = 84 (0x54), Physical IRQ = 46

 "SysIntr"=dword:00    ; SysIntr not specified

 "DMAAlignment"=dword:04   ; default DMA alignment

 "SoftResetTimeout"=dword:5   ; ATA/ATAPI spec defines 31s ceiling; this is too long

 "StatusPollCycles"=dword:100  ; Status register DRQ/BSY polling; 256 poll cycles

 "StatusPollsPerCycle"=dword:20  ; Status register DRQ/BSY polling; 32 polls per cycle

 "StatusPollCyclePause"=dword:05  ; Status register DRQ/BSY polling; 5 milliseconds between poll cycles

 "IoBase"=multi_sz:"0x70300000","0x70300000"

 "IoLen"=multi_sz:"0x1998","0x1998"

 "RegisterStride"=dword:4   ; Ref. Board ATA register stride; register block is word-contiguous

 "InterfaceType"=dword:0   ; Internal

 "DeviceControlOffset"=dword:20

 "AlternateStatusOffset"=dword:20

 "DeviceId"=dword:00

 "SpawnFunction"="CreateRomi"  ; Reference Board specific instantiation function

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/6410_CF/Device0]

 "Prefix"="DSK"

 "Dll"="s3c6410_cf_atapi.dll"

 "Order"=dword:16

 "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

  "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

 "InterruptDriven"=dword:00   ; en(1) dis(0)able interrupt driven I/O

 "DMA"=dword:00     ; disable DMA. DMA is not supported

 "DoubleBufferSize"=dword:10000  ; 128 sector (65536 byte) double buffer

 "DrqDataBlockSize"=dword:200  ; 1 sector (512 byte) DRQ data block

 "WriteCache"=dword:01    ; enable on-disk write cache

 "LookAhead"=dword:01    ; enable on-disk look-ahead

 "DeviceId"=dword:00    ; device 0, i.e., primary master

 "TransferMode"=dword:ff   ; use mode 0;

 "EnablePDMA"=dword:1    ; 0 = PIO, 1 = PDMA. We recommend PDMA mode.

 "EnableUDMA"=dword:1    ; 0 = PIO, 1 = UDMA. We recommend UDMA mode.

 "IndirectMode"=dword:1   ; 0 = Direct, 1 = Indirect. (To use UDMA, It should be '0'. UDMA is only working on DIRECT MODE.)

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/6410_CF]

 "Name"="ATA Type Storage"

 "Folder"="ATADisk"

"IndirectMode"=dword:1 這裡選擇控制模式,0為PIO模式,1為UDMA模式。添加後編譯BSP包下的DRIVERS/CF_ATAPI。