Further work on Darwin/OS X shows that IOKit expects both the hard disk and cdrom to be attached to the ata-3 controller for QEMU's mac99 machine.
Currently OpenBIOS generates an ata-3 and an ata-4 controller (and by default attaches the cdrom to the ata-4 controller) meaning that IOKit would fail to locate and mount the cdrom on boot. Resolve this by instantiating 2 ata-3 controller nodes instead which also is a better match for a real device tree.
The relevant changes to the device tree are shown below:
Before:
fff542a8 /pci@80000000/mac-io@3/ata-3@20000 (ata) fff54540 /pci@80000000/mac-io@3/ata-4@21000 (ata) fff547d8 /pci@80000000/mac-io@3/ata-4@21000/cdrom@0 (block)
After:
fff542a8 /pci@80000000/mac-io@3/ata-3@20000 (ata) fff54540 /pci@80000000/mac-io@3/ata-3@21000 (ata) fff547d8 /pci@80000000/mac-io@3/ata-3@21000/cdrom@0 (block)
The OpenBIOS IDE code currently works by using the device name internally to reference the controller node, which of course breaks when 2 nodes are given the same name property. Patches 1-4 switch the OpenBIOS IDE code over to reference controller nodes by phandle rather than name, while patch 5 does the actual switch from 1 ata-3 and 1 ata-4 controller to 2 ata-3 controllers.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (5): ide: use REGISTER_NAMED_NODE_PHANDLE rather than REGISTER_NAMED_NODE libopenbios: introduce new get_path_from_ph() helper function ide: switch IDE init functions over to use new get_path_from_ph() helper ide: reference IDE channels by phandle, not device name macio: switch over to use 2 ata-3 ide controllers
openbios-devel/drivers/ide.c | 46 +++++++++---------------- openbios-devel/drivers/ide.h | 2 +- openbios-devel/drivers/pci.c | 8 ++--- openbios-devel/include/libopenbios/bindings.h | 1 + openbios-devel/libopenbios/bindings.c | 8 +++++ 5 files changed, 31 insertions(+), 34 deletions(-)