Subject: Re: BootX ide/OF interaction (or lack therof question)
To: Chris Tribo <t1345@hopi.dtcc.edu>
From: Benjamin Herrenschmidt <benh@mipsys.com>
List: port-macppc
Date: 12/02/1999 10:30:49
On Wed, Dec 1, 1999, Chris Tribo <t1345@hopi.dtcc.edu> wrote:

>    I was paging through the BootX 1.3 Source code, and I see where BootX
>resets the SCSI bus(es), and where it kills off the current MacOS device
>drivers. No where do I see a mention of ide/ATA/ATAPI devices. Does BootX
>continue to use the IDE drivers in the state that MacOS left them in so it
>does not encounter the OF 2.0f1 problem most of us Beige G3 owners have?
>    This is my first time dwelling on source code that isn't my own, and I
>don't have code warrior to open the BootX project file. Does anyone know
>enough forth to be able to issue ata-reset and ata-enable through OF?

There is no BootX 1.3, are you meaning 1.1.3 or 1.2b3 ? There have been
significant changes between 1.1.x versions and 1.2 versions.

BootX contains code in pre_strap_ppc.c that will reset all sorts of known
devices. This is done mostly to prevent them from bus-mastering to main
memory while the Linux kernel moves itself down to 0. Latest versions
also do an ATA reset (using the IDE control register).

There is nothing like an ATA enable in BootX, since it runs from MacOS,
ATA will already have been enabled.

If you want to be sure the proper ASIC cells in mac-io are enabled (IDE,
SCSI, ...), you should look at the feature control bits. They are located
at mac-io base +0x38. You can find a definition of most of them in the
linux source tree in include/asm/ohare.h or in OpenFirmware, under the
mac-io node. I have made an updated list for heathrow controllers, I'll
post it later (I don't have it with me now).

Basically, OF ata-enable uses those feature bits to enable the ATA cell
in the ASIC. The ata-reset is a normal reset done via the IDE control
register. There is also a bit in the feature control for asserting the
IDE reset line (hard reset), but to my knowledge, it's not used by OF.