Subject: Re: adb_direct code hanging on PB180 -- suggestions?
To: None <port-mac68k@NetBSD.ORG>
From: Takashi Hamada <hamada@next.etron.kanazawa-it.ac.jp>
List: port-mac68k
Date: 12/07/1997 13:26:42
Sorry I am so late in answering the question.

At 03:45 97.12.5, John P. Wittkoski wrote:
> Tim Bessie wrote:
> 
> >         This bit of code loops forever, as the "if (send_string[0]..." condition
> >         is always true.  That is, ADBNumDevices is constantly bumped up, and
> >         it is always greater than 'i', and it loops forever.  Since ADBDevTable[]
> >         is only 16-elements long, this is a problem anyway.  Does anyone
> >         know why this might be happening?
> 
> Probably because the PB-specific routines that are called by the
> adb_op_sync routine are not working right.

I also think that there is no problem in adb_direct.c because the PM routine
worked properly with current kernel source on my PB550c. So I also suspect 
that the Power Manager routine for the PB1xx models or something related to 
the PB1xx models has a problem. 


> >            Looking at the code just now, I noticed that adb_intr() has no
> >            code for case ADB_HW_PB.  Is this desired, or has it just happened
> >            that nobody's written an interrupt routine for powerbooks?
> 
> The Powerbooks use pm_intr instead of adb_intr to catch the interrupts.
> You should look through the pm_direct.c code for details.

Yes, adb_intr() is not used for getting the ADB data on the PowerBooks
because the Power Manager IC actually acts as the ADB transceiver. When a 
keyboard or a mouse is operated, the PM IC occurs an interrupt to tell that. 
Then pm_intr() handles it and extract the ADB data from the data sent from 
the PM IC. After that, pm_intr() calls a proper ADB routine which is in 
adb_direct.c to process the data.


> > Any suggestions for making this stuff work would be greatly
> > appreciated.  I don't know anything about apple architecture,
                        [ snip snap ]
> If you are interested in looking at fixing the pm_direct.c code, or
> improving it, I'd suggest looking through it and perhaps contacting
> Takashi himself. He probably has some insite on where to start looking.

Any help would be appriciate. :-) Especially I would be grateful it if 
you could send me a patch for enabling the internal video on the PB180. 
I would borrow the PB180 from my friend and would also try fixing the 
pm_direct.c code if the patch is available.

Thanks,