[U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus

Wolfgang Denk
2010-09-06T06:05:57Z

Dear Albert ARIBAUD,

In message <4C848200.7080401@free.fr> you wrote:
>
> > First, CONFIG_SYS_IDE_* is for "IDE" (aka "Integrated Drive
> > Electronics"), now usually references as "Parallel ATA", as defined
> > by the underlying AT Attachment (ATA) and AT Attachment Packet
> > Interface (ATAPI) standards. It is my understanding that these
> > standards allow for one or two devices on the bus. So if there was any
> > CONFIG_SYS_IDE_MAXDEVICE_PER_BUS, it would have to be set to 2, which
> > renders it useless.
>
> You're right, and actually this is an overlook on my part, as the
> current set of port configs has _ATA_ in in addition to _IDE. Would the
> name CONFIG_SYS_ATA_IDE_MAXDEVICEPERBUS make you be happier?

No. See the AT Attachment (ATA) and AT Attachment Packe Interface
(ATAPI) standards.

> > happens if you want (or need) to setb the limit to 1, and I insert a
> > PCI PATA controller card with 2 devices attached to a bus?
>
> Indeed; and additionally, who says you can only have two IDE busses? I
> am facing the case right now with the MV88SX6081, which is an 8-ports
> controller.

But this is NOT an PATA controller, right?

> I have thus started a patch where the CONFIG_SYS_ATA_IDE{0,1}_OFFSET are
> replaced with a single one, CONFIG_SYS_ATA_IDE_OFFSETS, defined as an
> open array of values, which allows as many ports as required. For e.g.
> openrd_base, the config for ATA ports would change from:

We should not use "IDE" code on non-IDE devices. If there are common
code parts, these should be split off and generalized as needed
(without reference to "ATA" or "IDE").

> /* OpenRD's two kirkwood busses are SATA: 1 device per bux max) */
> #define CONFIG_SYS_ATA_IDE_CONFIG { \
> { KW_SATA_PORT0_OFFSET, 1}, \
> { KW_SATA_PORT1_OFFSET, 1} \

No. It is inherently wrong to use "*IDE*" in combination with a SATA
device.

> How about the two suggestions above?

No.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When all else fails, read the instructions.