[OpenBIOS] [PATCH] Add USB OHCI + HID driver

BALATON Zoltan balaton at eik.bme.hu
Wed Jun 4 13:24:08 CEST 2014


On Wed, 4 Jun 2014, Segher Boessenkool wrote:
> There surely is support for a host bridge?

Yes, for uninorth but PowerMac3,1 on real hardware has an additional 
bridge between the host bridge and the pci devices according to the device 
tree dumps I've seen and comments in QEMU that say it is not enabled 
because it is not supported by the firmware. I meant that bridge.

>>>Add pci details should just remain in pci.c. Export a function to 
>>>enable bus mastering inside there and we should be safe from an 
>>>abstraction level pov.
>>
>> The code setting the bus master bit we are talking about _is_ in 
>> drivers/pci.c already. Do you want me to move it to it's own function 
>> and use that for both pci-ohci and rtl8139? (It's just three lines 
>> though and the same pattern is used for setting other bits elswhere so 
>> this could be done as a clean up afterwards maybe as a macro.)
>
> I agree that the code that decides when to enable bus mastering should 
> be in the device driver.

Now I'm confused. One of you say it should be in pci.c the other says it 
should be in the device driver which is usbohci.c in this case. Currently 
it is in a function in pci.c which is only called for the only ohci 
controller supported so I think it satisfies both so no change needed. Did 
I misunderstood something?

> It would be nice to test this on real hardware.  If no one has that,
> just try to make sure your new code will not fail on hardware where
> the old code worked (like, don't run any "dangerous" code unless your
> device is detected).

I can't test on real hardware. The ohci driver is only used if an Apple 
Keylargo OHCI controller is detected that is fairly specific to mac99 
machines where the current code probably does not work now due to the 
bridge issue above. So did I miss something?

Regards,
BALATON Zoltan




More information about the OpenBIOS mailing list