From: "Bryan Althouse" <bryan.althouse@3phoenix.com>
To: "'Alan Cox'" <alan@lxorguk.ukuu.org.uk>
Cc: <linux-mips@linux-mips.org>
Subject: RE: ATA devices attached to arbitary busses
Date: Fri, 6 May 2005 11:19:47 -0400 [thread overview]
Message-ID: <20050506152006Z8225995-1340+6646@linux-mips.org> (raw)
In-Reply-To: <1115316338.19844.100.camel@localhost.localdomain>
Alan,
Thank you, that is very helpful. I think I understand, but let me ramble a
bit so that you can correct me if I am wrong.
All IDE drives should have the identical memory map. But, the kernel does
not communicate directly with the drive, it communicates though an IDE host
adaptor (which may have different implementations). If the host adaptor's
memory map "matches" that of the IDE drive spec, then you consider it to be
a "standard port layout"? Since my host adaptor will be implemented in an
FPGA, if I give it the IDE memory map defined in ide.h, then your example
code will be applicable.
The memory map defined in ide.h makes sense to me (it seems to match the IDE
drive memory map) until we get down to offset 6 (IDE_SELECT_OFFSET). From
here down, I have trouble matching the #define names with the register
names/descriptions from the IDE spec. Also, I am puzzled as to why there
are 10 registers defined in ide.h when my IDE spec only shows 9. The IDE
spec that I am referencing looks like this:
CS0 CS1 DA2 DA1 DA0 READ WRITE
A N 0 0 0 Data Data
A N 0 0 1 Error Features
A N 0 1 0 Sector Count Sector Count
A N 0 1 1 Sector Number Sector Number
A N 1 0 0 Cylinder Low Cylinder Low
A N 1 0 1 Cylinder High Cylinder High
A N 1 1 0 Device/Head Device/Head
A N 1 1 1 Status Command
N A 1 1 0 Alternate Status Device Control (IRQ en/dis)
ide.h shows the following offsets:
#define IDE_DATA_OFFSET (0)
#define IDE_ERROR_OFFSET (1)
#define IDE_NSECTOR_OFFSET (2)
#define IDE_SECTOR_OFFSET (3)
#define IDE_LCYL_OFFSET (4)
#define IDE_HCYL_OFFSET (5)
#define IDE_SELECT_OFFSET (6)
#define IDE_STATUS_OFFSET (7)
#define IDE_CONTROL_OFFSET (8)
#define IDE_IRQ_OFFSET (9)
Do you know of an IDE host adapter chipset which is standard? If someone
knows of a part number, I could look up its datasheet. This would probably
clear up my confusion. Thanks again!
Bryan
>It really depends on the complexity of your controller. If you are just
>doing PIO with generic IDE interfacing then its simply a matter of
>telling Linux that there is an interface at these addresses with these
>port operations and it'll just do the rest for you, except hotplug.
WARNING: multiple messages have this Message-ID (diff)
From: "Bryan Althouse" <bryan.althouse@3phoenix.com>
To: 'Alan Cox' <alan@lxorguk.ukuu.org.uk>
Cc: linux-mips@linux-mips.org
Subject: RE: ATA devices attached to arbitary busses
Date: Fri, 6 May 2005 11:19:47 -0400 [thread overview]
Message-ID: <20050506152006Z8225995-1340+6646@linux-mips.org> (raw)
Message-ID: <20050506151947.odlCy5ojUf619MbOnXQuSUZrwCk6j4kuhKmC6OCOzHg@z> (raw)
In-Reply-To: <1115316338.19844.100.camel@localhost.localdomain>
Alan,
Thank you, that is very helpful. I think I understand, but let me ramble a
bit so that you can correct me if I am wrong.
All IDE drives should have the identical memory map. But, the kernel does
not communicate directly with the drive, it communicates though an IDE host
adaptor (which may have different implementations). If the host adaptor's
memory map "matches" that of the IDE drive spec, then you consider it to be
a "standard port layout"? Since my host adaptor will be implemented in an
FPGA, if I give it the IDE memory map defined in ide.h, then your example
code will be applicable.
The memory map defined in ide.h makes sense to me (it seems to match the IDE
drive memory map) until we get down to offset 6 (IDE_SELECT_OFFSET). From
here down, I have trouble matching the #define names with the register
names/descriptions from the IDE spec. Also, I am puzzled as to why there
are 10 registers defined in ide.h when my IDE spec only shows 9. The IDE
spec that I am referencing looks like this:
CS0 CS1 DA2 DA1 DA0 READ WRITE
A N 0 0 0 Data Data
A N 0 0 1 Error Features
A N 0 1 0 Sector Count Sector Count
A N 0 1 1 Sector Number Sector Number
A N 1 0 0 Cylinder Low Cylinder Low
A N 1 0 1 Cylinder High Cylinder High
A N 1 1 0 Device/Head Device/Head
A N 1 1 1 Status Command
N A 1 1 0 Alternate Status Device Control (IRQ en/dis)
ide.h shows the following offsets:
#define IDE_DATA_OFFSET (0)
#define IDE_ERROR_OFFSET (1)
#define IDE_NSECTOR_OFFSET (2)
#define IDE_SECTOR_OFFSET (3)
#define IDE_LCYL_OFFSET (4)
#define IDE_HCYL_OFFSET (5)
#define IDE_SELECT_OFFSET (6)
#define IDE_STATUS_OFFSET (7)
#define IDE_CONTROL_OFFSET (8)
#define IDE_IRQ_OFFSET (9)
Do you know of an IDE host adapter chipset which is standard? If someone
knows of a part number, I could look up its datasheet. This would probably
clear up my confusion. Thanks again!
Bryan
>It really depends on the complexity of your controller. If you are just
>doing PIO with generic IDE interfacing then its simply a matter of
>telling Linux that there is an interface at these addresses with these
>port operations and it'll just do the rest for you, except hotplug.
next prev parent reply other threads:[~2005-05-06 15:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-05 17:56 ATA devices attached to arbitary busses Bryan Althouse
2005-05-05 17:56 ` Bryan Althouse
2005-05-05 18:05 ` Alan Cox
2005-05-06 15:19 ` Bryan Althouse [this message]
2005-05-06 15:19 ` Bryan Althouse
2005-05-06 16:47 ` Geert Uytterhoeven
2005-05-06 17:09 ` Bryan Althouse
[not found] <200505061709.j46H9L3a021796@nerdnet.nl>
2005-05-06 17:12 ` Geert Uytterhoeven
2005-05-06 17:36 ` Maciej W. Rozycki
2005-05-06 19:57 ` Bryan Althouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050506152006Z8225995-1340+6646@linux-mips.org \
--to=bryan.althouse@3phoenix.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox