LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 04-28-2008, 05:32 AM   #1
ravi_chobey
Member
 
Registered: Sep 2007
Location: Bangalore,India
Distribution: Fedora,Mandriva,Debian
Posts: 180

Rep: Reputation: 30
Red face ATA Protocol


Hi All,

Sir,Currently i am working on a Seagate PATA hard drive(Model No-ST3802110A , 80 GB),implementing ATA protocol on that.I am facing some problems while reading the data register of that hard drive.I am working to Standard ATA-3 PIO data in protocol.

I am facing a problem while executing Identify device command.I am performing the flow as per flow mentioned in ATA datasheet as follows:
1) reading status register and checking for BSY bit. I am getting it low whenever hard disk is not busy. So that is fine
2)Now selecting device by setting dev bit low. I am setting it low because it's status should match with the cable_Select pin. In my hardware cable select is connected to ground. So i am writing A0h in device/head register.
3)Reading the status register and checking for BSY and DRDY bits. I am getting BSY = 0 and DRDY = 1. So it is ok.
4)Writing command ECh in command register.[Identify Device = ECh].
5) Checking for Error bit in status register and BSY bit also. I am getting BSY low and ERR bit low. That means no error has occured till now.
5(a)) i have provided a delay of 81 microseconds,before reading the data register.
6) Now I am checking for DRQ bit. But i am not getting DRQ = 1 as per the flow mentioned in ATA-3 Datasheet.
Even if I ignore DRQ bit, and start reading data register, i always get FF00, which is not as per outputs mentioned in datasheet for Identify device command. I am getting all 256 words as FF00h only.

Even i have tried the CHECK POWER MODE command,but i am getting the default values which are stored in Sector(Count and Number) and Cylinder(Count and Number) registers. I should get 00h or 80h or FFh in sector count register. But I am getting 01h which is the default value of this register. That means I am not getting proper response, also hard drive is not setting error bit in status register. So I am not able to guess where the problem is taking place.

So i am facing this problem for last many days and i am not getting any proper documents on internet to sort out this issue.If any body can support me in sorting out this issue,please support me for this.

Thanks & Regards,
Ravi Chobey
 
Old 04-28-2008, 12:43 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Have you looked at the Linux driver source code? They would seem to be a reliable reference point.
--- rod.
 
Old 05-01-2008, 11:28 AM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
as far as documentation goes try this:
google://d0791r4c-ATA
 
Old 05-03-2008, 01:16 AM   #4
ravi_chobey
Member
 
Registered: Sep 2007
Location: Bangalore,India
Distribution: Fedora,Mandriva,Debian
Posts: 180

Original Poster
Rep: Reputation: 30
Talking

Thanks to all who has send me the replies and also the question viewers for taking time to read ATA question.I have sorted out the issue and now now i am trying to read the first sector of hard disk.

Regards,
Ravi Chobey
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel boot option for using enhanced mode P-ATA+S-ATA dont_stop_me Linux - Hardware 0 12-22-2006 03:39 PM
HP Omnibook 6000 Hard drive interface: ATA-100 or ATA-6? shortname Linux - Laptop and Netbook 3 05-11-2005 09:22 PM
How do I use a parallel ATA drive on a serial ATA controller? sigmaris Linux - Hardware 2 08-21-2004 07:41 PM
help. ATA/SCSI Serial-ATA error: "ATA: Abnormal Status" xin Linux - Hardware 10 09-05-2003 10:59 PM
Unsupported protocol 'Compression Control Protocol' (0x80fd) received RKris Linux - Software 0 08-21-2002 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration