版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、 基于ARM920T微處理器的IDE硬盤接口設(shè)計(jì)與實(shí)現(xiàn) 何明聰 胡繼承 孫世磊 時(shí)間:2010年01月28日 字 體: 大 中 小 關(guān)鍵詞:<"cblue" " target='_blank'>ARM<"cblue" " t
2、arget='_blank'>接口<"cblue" " target='_blank'>ARM920T<"cblue" " target='_blank'>ARM <"cblue" " target='_blank'>ARM &
3、#160; 1 引言 20世紀(jì)90年代后期,嵌入式系統(tǒng)在工業(yè)控制、遠(yuǎn)程監(jiān)控和數(shù)據(jù)采集等領(lǐng)域的應(yīng)用日趨廣泛,人們對嵌入式系統(tǒng)的存儲(chǔ)容量也提出了較高的要求。因此研制適用于嵌入式系統(tǒng)的大容量、高速率、高可靠性的數(shù)據(jù)存儲(chǔ)系統(tǒng)變得日益重要。本文針對一款基于<"cblue" " " title="ARM">ARM" title="ARM">ARM" title="ARM">ARM&q
4、uot; title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM
5、">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM"
6、title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM"
7、;>ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title
8、="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">
9、ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title=&quo
10、t;ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM&q
11、uot; title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM
12、">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM"
13、title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM"
14、;>ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title
15、="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">
16、ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title=&quo
17、t;ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM&q
18、uot; title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM
19、">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM"
20、title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM"
21、;>ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title
22、="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">
23、ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title=&quo
24、t;ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM&q
25、uot; title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM
26、">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM"
27、title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM"
28、;>ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title
29、="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">
30、ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title=&quo
31、t;ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM&q
32、uot; title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM
33、">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM"
34、title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM"
35、;>ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title
36、="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">
37、ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title="ARM">ARM" title=&quo
38、t;ARM">ARM" title="ARM">ARM920T芯片的開發(fā)板,根據(jù)ATA硬盤<"cblue" " title="接口">接口規(guī)范,設(shè)計(jì)了IDE硬盤接口電路,實(shí)現(xiàn)了對IDE硬盤的讀寫,可以在Linux系統(tǒng)中對其上的文件系統(tǒng)自由訪問,達(dá)到了高速率和高可靠性的要求。2 <"cblue" " title="ARM920T">ARM920T與S3C2410介紹 ARM 包
39、括一系列微處理芯片技術(shù)。ARM920T是ARM系列微處理器的一種,它采用5階段管道化ARM9TDMI內(nèi)核,同時(shí)配備了Thumb擴(kuò)展、EmbeddedICE調(diào)試技術(shù)和Harvard總線。在生產(chǎn)工藝相同的情況下,性能可達(dá)ARM7TDMI芯片的兩倍之多。ARM920T系列主要應(yīng)用于機(jī)頂盒產(chǎn)品、掌上電腦、筆記本電腦和打印機(jī)。 S3C2410處理器是Samsung 公司基于ARM公司的ARM920T處理器核,采用0.18umSU造工藝的32位微控制器。該處理器擁有獨(dú)立的16KB指令Cache和16KB數(shù)據(jù)Cache、MMU、支持TFT的LCD控制器、NAND閃存控制器
40、、3路UART、4路DMA、4路帶PWM的Timer、I/O口、RTC、8路10位ADC、TouchScreen接口、IIC-BuS接口、IIS-BuS接口、2個(gè)USB主機(jī)、1個(gè)USB設(shè)備、SD主機(jī)和MMC接口和2路SPI。S3C2410處理器最高可運(yùn)行在268MHz。3 IDE接口及其規(guī)范 IDE(Integrated Drive Electronics)是從IBM PC/AT上使用的ATA接口發(fā)展而來的。IDE/ATA磁盤驅(qū)動(dòng)器與早期的ATA驅(qū)動(dòng)器相比,增加了任務(wù)文件寄存器,包括數(shù)據(jù)寄存器、狀態(tài)寄存器以及反映地址的驅(qū)動(dòng)器號(hào)、磁頭號(hào)、道號(hào)和扇區(qū)號(hào)寄存器等。
41、ATA接口規(guī)范定義了信號(hào)電纜和電源線的電器特征、互聯(lián)信號(hào)的電器和邏輯特征,還定義了存儲(chǔ)設(shè)備中可操作的寄存器以及命令和協(xié)議。3.1 寄存器 規(guī)范定義了兩組寄存器:命令寄存器和控制寄存器。命令寄存器用來接收命令和傳送數(shù)據(jù),控制寄存器用來控制磁盤操作。常用的寄存器包括數(shù)據(jù)寄存器、命令寄存器、驅(qū)動(dòng)器/磁頭寄存器、柱面號(hào)寄存器、扇區(qū)號(hào)寄存器、扇區(qū)數(shù)寄存器和狀態(tài)寄存器。3.2 數(shù)據(jù)傳輸方式 ATA接口規(guī)范定義了兩種數(shù)據(jù)傳輸方式:可編程I/O(PIO)方式和DMA方式。PIO傳送方式下,CPU對控制器的訪問都是通過PIO進(jìn)行的,包括從控
42、制器讀取狀態(tài)信息和錯(cuò)誤信息,以及向控制器發(fā)送命令和參數(shù)。在一次PIO數(shù)據(jù)傳輸過程中,CPU先選址,然后使讀/寫信號(hào)有效,CPU或控制器放數(shù)據(jù)到數(shù)據(jù)總線,控制器或CPU讀取數(shù)據(jù),操作完成后,釋放總線,這樣一次數(shù)據(jù)傳輸完成。DMA方式,即直接內(nèi)存訪問,CPU把緩沖區(qū)的地址與需要讀寫的長度告訴外設(shè),外設(shè)在準(zhǔn)備好后向CPU發(fā)出一個(gè)DMA請求,要求CPU暫停使用內(nèi)存,獲得同意后就直接在內(nèi)存和外設(shè)之間傳輸數(shù)據(jù),完成后再把對內(nèi)存的訪問權(quán)歸還給CPU。4 硬件實(shí)現(xiàn) 如圖1所示,S3C2410與硬盤之間接口電路分為3個(gè)部分:片選信號(hào)、數(shù)據(jù)信號(hào)和控制信號(hào)。硬盤上寄存器分為兩組,
43、分別由IDE_CS0和IDE_CS1選中,DA0DA2則用于組內(nèi)寄存器尋址;數(shù)據(jù)線DD0DD15因存在輸入/輸出方向問題,故用nOE(讀信號(hào))接buffer(74LVTH162245)的DIR引腳來控制緩沖器方向;控制信號(hào)部分因該CPU與硬盤之間DMA時(shí)序不一致,故采用一塊EPM7032AETC44-7芯片用于調(diào)整其時(shí)序。PIO模式下,不需要DMARQ和nDMACK信號(hào),DMA模式下,這兩個(gè)信號(hào)才起作用。5 軟件實(shí)現(xiàn) 硬盤驅(qū)動(dòng)程序?qū)崿F(xiàn)分為初始化、打開設(shè)備、設(shè)備I/O操作和釋放設(shè)備等幾部分。5.1 硬盤初始化 與X86不同,
44、在ARM 體系結(jié)構(gòu)中,對內(nèi)存和外設(shè)的訪問使用統(tǒng)一的指令,所以要對外設(shè)地址進(jìn)行內(nèi)存映射。也就是說,通過一張表將I/O地址映射到內(nèi)存空間中來,這部分工作是在系統(tǒng)初始化期間完成的。 在IDE子系統(tǒng)初始化期間,Linux系統(tǒng)一旦發(fā)現(xiàn)一個(gè)IDE控制器,就設(shè)置它的ide_hwif_t結(jié)構(gòu)來反映這個(gè)控制器和與之相連的磁盤;向Linux的VFS登記每一個(gè)控制器,并分別把它加到blk_dev和blkdevs向量表中;請求控制適當(dāng)?shù)腎RQ中斷(主IDE控制器是14,次IDE控制器是15)和I/O空間(主控制器0x1f0,次控制器0x170):為每一個(gè)找到的IDE控制器在gend
45、isk列表中增加一個(gè)條目。 IDE硬盤的初始化工作由idedisk_init完成: (1)在數(shù)組ide_hwifs中找出已登記得各IDE控制器控制的所有IDE硬盤(一個(gè)控制器最多控制兩個(gè)硬盤),每個(gè)IDE硬盤對應(yīng)一個(gè)ide_drive_t結(jié)構(gòu)。 (2)對找到的每個(gè)IDE硬盤,調(diào)用函數(shù)ide_register_subdriver填寫各IDE硬盤結(jié)構(gòu)中的相關(guān)信息域,主要是填寫其驅(qū)動(dòng)程序結(jié)構(gòu)ide_driver_t。硬盤驅(qū)動(dòng)中的函數(shù)do_rw_disk通過向磁盤控制寄存器寫參數(shù)啟動(dòng)磁盤操作,完
46、成真正的數(shù)據(jù)讀寫。 (3)對找到的每個(gè)IDE硬盤,調(diào)用函數(shù)idedisk_setup進(jìn)一步設(shè)置其ide_drive_t結(jié)構(gòu),包括設(shè)置該結(jié)構(gòu)的settings域、doorlocking域、cyl、head、sect域、id域等。5.2 打開設(shè)備 打開塊設(shè)備的操作與打開普通文件的操作基本相同。 (1)在當(dāng)前進(jìn)程的文件描述符表中為打開文件找一個(gè)空位,申請一塊內(nèi)存,用于建立新文件的打開文件對象,即結(jié)構(gòu)file。 (2)解析設(shè)備特殊文件名,獲得其VFSinode和dentry結(jié)構(gòu),根據(jù)dentry結(jié)構(gòu)填寫file結(jié)構(gòu),尤其是將file結(jié)構(gòu)的f_op域設(shè)為其VFSinode中的缺省文件操作。 (3)執(zhí)行該文件操作集中的open操作,即blkdev_open,它根據(jù)設(shè)備特殊文件的主次設(shè)備號(hào)從blkdevs向量表中取出已經(jīng)注冊的文件操作集(file_operations)fops,用該結(jié)構(gòu)代替file結(jié)構(gòu)中的f_op域。 (4)執(zhí)行中新文件操作集中的open操作,即bl帶頭kdev_open,它根據(jù)VFS
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度LED燈具安裝與節(jié)能效果評估合同3篇
- 2024糧食購銷代理合作合同版B版
- 2024薪資保密制度與員工隱私保護(hù)專項(xiàng)合同3篇
- 2025年度現(xiàn)代農(nóng)業(yè)土地承包種植技術(shù)引進(jìn)合同3篇
- 2025年度智能大門研發(fā)與購銷合同4篇
- 2025年度數(shù)據(jù)中心能源優(yōu)化承包經(jīng)營協(xié)議4篇
- 2024水泵安裝項(xiàng)目施工合作合同版B版
- 2025年度五星級酒店廚師服務(wù)合同細(xì)則4篇
- 2024跨越國界的藝術(shù)品買賣合同
- 2025年度水利工程承攬工程施工合同4篇
- 銳途管理人員測評試題目的
- 焊接材料-DIN-8555-標(biāo)準(zhǔn)
- 工程索賠真實(shí)案例范本
- 重癥醫(yī)學(xué)科運(yùn)用PDCA循環(huán)降低ICU失禁性皮炎發(fā)生率品管圈QCC持續(xù)質(zhì)量改進(jìn)成果匯報(bào)
- 個(gè)人股權(quán)證明書
- 醫(yī)院運(yùn)送工作介紹
- 重癥患者的容量管理
- 學(xué)習(xí)游戲?qū)χ行W(xué)生學(xué)業(yè)成績的影響
- 小學(xué)四年級上冊遞等式計(jì)算100題及答案
- 新版?zhèn)€人簡歷Excel表格模板共2聯(lián)
- (完整)中國象棋教案
評論
0/150
提交評論