<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>I’ve tried to add this several times to via the bug report tool on the website, but get stuck in a loop on the captcha page.  </div>
<div>Can I post this here to get it looked at?</div>
<div> </div>
<div> </div>
<div>Filo does not boot from the CF or PCMCIA controllers.  I did find a work around, some 70 prom flashes later..</div>
<div> </div>
<div>I've limited the scope of my work to ide.c, for the legacy boot, not the grub-compatible.</div>
<div> </div>
<div>This is one will need the help of a real developer to fix properly.</div>
<div> </div>
<div>Here is what I've found:</div>
<div>Problem 1:</div>
<div>There are 2 types of detections for IDE interfaces:</div>
<div>if ((sata && class == 0x180) || (pata && class == 0x101)) {</div>
<div>  and</div>
<div>if (hdr == HEADER_TYPE_BRIDGE || hdr == HEADER_TYPE_CARDBUS) {</div>
<div> </div>
<div>The 2nd does not work...  The first excludes the CF/PC-CARD because it doesn't include the correct class.  I have no idea how to fix the CARDBUS check.  It's got stuff that reaches into the libpayload code..  </div>
<div>So I've made this modification:</div>
<div>if ((sata && class == 0x180) || (pata && class == 0x101) || (pata && class == 0x607)) {</div>
<div>This explicitly directs the driver to treat the CF as an IDE device.</div>
<div>That part works, and it does to a proper detection once it's in the "if" statement. The problem is, as far as I can tell detects this card before all others, and stops.  I can see no other IDE channels once I set this.</div>
<div> </div>
<div>Problem 2:</div>
<div>We enter this in "native PCI mode", which is ok.</div>
<div>      if ((prog_if & mask) || (devclass != 0x0101)) {</div>
<div>                debug("native PCI mode\n");</div>
<div>                if ((ctrl_index & 1) == 0) {</div>
<div>                        /* Primary channel */</div>
<div>                        ctrl->cmd_base = pci_read_resource(dev, 0);</div>
<div>                        ctrl->ctrl_base = pci_read_resource(dev, 1);</div>
<div>                } else {</div>
<div>                        /* Secondary channel */</div>
<div>                        ctrl->cmd_base = pci_read_resource(dev, 2);</div>
<div>                        ctrl->ctrl_base = pci_read_resource(dev, 3);</div>
<div>                }</div>
<div>                ctrl->cmd_base &= ~3;</div>
<div>                ctrl->ctrl_base &= ~3;</div>
<div> </div>
<div>What is not ok, is that we are now using pci_read_resource to set the ctrl->* stuff when we _explicitly_ listed those elsewhere..  Obviously that doesn't work...  I have no idea why we do the "&= ~3" either, so I'm not inclined to mess with it.</div>
<div>What does work, is adding these two lines after those:</div>
<div>                ctrl->cmd_base = 0x1e0;</div>
<div>                ctrl->ctrl_base = 0x1ec;</div>
<div>Obviously we just overwrite all the crap we just set with the pci_read call and the additional lines.</div>
<div> </div>
<div>Once these are done, the machine can boot of the CF slot, but ONLY the CF slot.</div>
<div> </div>
<div>A real fix would probably be cool.</div>
<div> </div>
<div> </div>
</font>
</body>
</html>