[OpenBIOS] [PATCH 5/5] macio: switch over to use 2 ata-3 ide controllers

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Thu Dec 24 20:53:59 CET 2015


This better matches real device trees and fixes Darwin/OS X boot from CDROM
under the QEMU mac99 machine (it seems that IOKit will only detect macio IDE
devices connected to an ata-3 ide controller rather than the previous ata-4
ide controller).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/drivers/ide.c |    6 +++---
 openbios-devel/drivers/pci.c |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/openbios-devel/drivers/ide.c b/openbios-devel/drivers/ide.c
index 5ebaf5a..1da60c8 100644
--- a/openbios-devel/drivers/ide.c
+++ b/openbios-devel/drivers/ide.c
@@ -1542,10 +1542,10 @@ int macio_ide_init(const char *path, uint32_t addr, int nb_channels)
 	struct ide_channel *chan;
 
 	/* IDE ports on Macs are numbered from 3.
-	 * Also see comments in macio.c:openpic_init() */
+	 * Also see comments in pci.c:ob_pci_host_set_interrupt_map() */
 	current_channel = 3;
 
-	for (i = 0; i < nb_channels; i++, current_channel++) {
+	for (i = 0; i < nb_channels; i++) {
 
 		chan = malloc(sizeof(struct ide_channel));
 
@@ -1651,7 +1651,7 @@ int macio_ide_init(const char *path, uint32_t addr, int nb_channels)
 		OLDWORLD(set_property(dnode, "AAPL,address",
 				      (char *)&props, 2*sizeof(props[0])));
 
-		props[0] = 0;
+		props[0] = i;
 		set_property(dnode, "AAPL,bus-id", (char*)props,
 			 1 * sizeof(props[0]));
 		IDE_DPRINTF(DEV_NAME": [io ports 0x%lx]\n",
diff --git a/openbios-devel/drivers/pci.c b/openbios-devel/drivers/pci.c
index 935ecb8..1cb25e6 100644
--- a/openbios-devel/drivers/pci.c
+++ b/openbios-devel/drivers/pci.c
@@ -1430,12 +1430,12 @@ static void ob_pci_host_set_interrupt_map(phandle_t host)
         /* On a new world Mac these are not numbered but named by the
          * ATA version they support. Thus we have: ata-3, ata-3, ata-4
          * On g3beige they all called just ide.
-         * We take ata-3 and ata-4 which seems to work for both
-         * at least for clients we care about */
-        target_node = find_dev("/pci/mac-io/ata-3");
+         * We take 2 x ata-3 buses which seems to work for
+         * at least the clients we care about */
+        target_node = find_dev("/pci/mac-io/ata-3 at 20000");
         set_int_property(target_node, "interrupt-parent", dnode);
 
-        target_node = find_dev("/pci/mac-io/ata-4");
+        target_node = find_dev("/pci/mac-io/ata-3 at 21000");
         set_int_property(target_node, "interrupt-parent", dnode);
 
         target_node = find_dev("/pci/mac-io/via-cuda");
-- 
1.7.10.4




More information about the OpenBIOS mailing list