9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] HPT-370 ATA-100 chip (was: Hardware detection problems)
@ 2002-09-20  1:55 Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2002-09-20  1:55 UTC (permalink / raw)
  To: 9fans

Thanks.  What you sent is a perfectly fine diff.
We do these things by hand (so that we understand
what's going on in the source), some indication of
what was changed is always appreciated.
Others sometimes just send the whole files
with the changes clearly marked.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] HPT-370 ATA-100 chip (was: Hardware detection problems)
  2002-09-16  4:02 [9fans] Hardware detection problems jmk
@ 2002-09-20  1:40 ` Richard Powell
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Powell @ 2002-09-20  1:40 UTC (permalink / raw)
  To: 9fans

jmk@plan9.bell-labs.com wrote:
> The code hooks are all there for additional controllers
> (devata.c:/^atalegacy).
> Some glue needs to be added to devsd.c:/^sdreset.
>
>
> ------------------------------------------------------------------------
>
> Subject:
> Re: [9fans] Hardware detection problems
> From:
> "Russ Cox" <rsc@plan9.bell-labs.com>
> Date:
> Sun, 15 Sep 2002 22:56:22 -0400
> To:
> 9fans@cse.psu.edu
>
>
> If you know the ports and interrupts,
> it might suffice just to add the appropriate
> probes.
>
> Russ

Thanks for all the help.  I finally figured some things out an made some
progress.  I can now detect all four IDE ports and boot directly from
sdE0.  I've include a context diff of the changes I made to
9/pc/sdata.c.  I also made similar changes to 9/boot/sdata.c for 9load.

Is there a preferred format for patches?


Notes:
- The debug code was commented out because the two IDE ports on the chip
share the same IRQ (11).  That caused a flood of Inil20+ messages when I
had a disk on each port.  Next time, I'll change it to a different symbol.

- I'm not sure about setting pi to 0x85 vs. 0x5, but it doesn't seem to
hurt.


diff -c sdata.c.org  sdata.c

------------------------------ cut here -----------------------
*** sdata.c.org Thu Sep 19 00:19:00 2002
--- sdata.c     Thu Sep 19 00:19:00 2002
***************
*** 1557,1564 ****
--- 1557,1566 ----
         status = inb(cmdport+Status);
         if((drive = ctlr->curdrive) == nil){
                 iunlock(ctlr);
+ /*
                 if((DEBUG & DbgDEBUG) && ctlr->command != Cedd)
                         print("Inil%2.2uX+", ctlr->command);
+ */
                 return;
         }

***************
*** 1671,1676 ****
--- 1673,1682 ----
                  * 2) put 0 in the programming interface byte (probably
                  *    as a consequence of 1) above).
                  */
+
+ print("PCI: ccrb %02x  ccru %02x  ccrp %04x  did %04x  vid %04x\n",
+       p->ccrb, p->ccru, p->ccrp, p->did, p->vid);
+
                 if(p->ccrb != 0x01 || (p->ccru != 0x01 && p->ccru != 0x80))
                         continue;
                 pi = p->ccrp;
***************
*** 1707,1712 ****
--- 1713,1721 ----
                          * Bugfix code here...
                          */
                         break;
+               case (0x0004<<16)|0x1103:       /* HighPoint HPT-370 */
+                       pi = 0x85;
+                       break;
                 case (0x0646<<16)|0x1095:       /* CMD 646 */
                 case (0x0571<<16)|0x1106:       /* VIA 82C686 */
                 case (0x0211<<16)|0x1166:       /* ServerWorks IB6566 */
***************
*** 1716,1727 ****
                 case (0x7111<<16)|0x8086:       /* 82371[AE]B (PIIX4[E]) */
                         break;
                 }
-
                 for(channel = 0; channel < 2; channel++){
                         if(pi & (1<<(2*channel))){
                                 sdev = ataprobe(p->mem[0+2*channel].bar
& ~0x01,
                                                 p->mem[1+2*channel].bar
& ~0x01,
                                                 p->intl);
                                 if(sdev == nil)
                                         continue;

--- 1725,1736 ----
                 case (0x7111<<16)|0x8086:       /* 82371[AE]B (PIIX4[E]) */
                         break;
                 }
                 for(channel = 0; channel < 2; channel++){
                         if(pi & (1<<(2*channel))){
                                 sdev = ataprobe(p->mem[0+2*channel].bar
& ~0x01,
                                                 p->mem[1+2*channel].bar
& ~0x01,
                                                 p->intl);
+ print("Probed: %d  sdev %x\n", channel, (int)sdev);
                                 if(sdev == nil)
                                         continue;
---------------------------- end of diff -------------------------



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-20  1:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-20  1:55 [9fans] HPT-370 ATA-100 chip (was: Hardware detection problems) Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-09-16  4:02 [9fans] Hardware detection problems jmk
2002-09-20  1:40 ` [9fans] HPT-370 ATA-100 chip (was: Hardware detection problems) Richard Powell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).