[OpenBIOS] [commit] r1315 - trunk/openbios-devel/drivers

repository service svn at openbios.org
Mon Aug 25 15:07:56 CEST 2014


Author: mcayland
Date: Mon Aug 25 15:07:56 2014
New Revision: 1315
URL: http://tracker.coreboot.org/trac/openbios/changeset/1315

Log:
macio ide: Fix dev tree entries for macio ide ports

Only add the two ide ports that are emulated by QEMU to the device
tree to avoid clients trying to access the non-existent third one and
fix their names and properties for mac99 to match those used by Apple.
This makes MorphOS able to find and use these.

Signed-off-by: BALATON Zoltan <balaton at eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/drivers/ide.c
   trunk/openbios-devel/drivers/macio.c

Modified: trunk/openbios-devel/drivers/ide.c
==============================================================================
--- trunk/openbios-devel/drivers/ide.c	Mon Aug 25 15:07:53 2014	(r1314)
+++ trunk/openbios-devel/drivers/ide.c	Mon Aug 25 15:07:56 2014	(r1315)
@@ -1526,6 +1526,10 @@
 	u32 props[8];
 	struct ide_channel *chan;
 
+	/* IDE ports on Macs are numbered from 3.
+	 * Also see comments in macio.c:openpic_init() */
+	current_channel = 3;
+
 	for (i = 0; i < nb_channels; i++, current_channel++) {
 
 		chan = malloc(sizeof(struct ide_channel));
@@ -1574,7 +1578,8 @@
 
 		dnode = find_dev(nodebuff);
 
-		set_property(dnode, "compatible", "heathrow-ata", 13);
+		set_property(dnode, "compatible", (is_oldworld() ?
+			     "heathrow-ata" : "keylargo-ata"), 13);
 
 		props[0] = 0x00000526;
 		props[1] = 0x00000085;

Modified: trunk/openbios-devel/drivers/macio.c
==============================================================================
--- trunk/openbios-devel/drivers/macio.c	Mon Aug 25 15:07:53 2014	(r1314)
+++ trunk/openbios-devel/drivers/macio.c	Mon Aug 25 15:07:56 2014	(r1315)
@@ -136,7 +136,7 @@
 	int i;
         unsigned int it_shift = macio_nvram_shift();
 
-	for (i=0; i< arch_nvram_size() ; i++)
+	for (i=0; i < arch_nvram_size(); i++)
 		nvram[i << it_shift] = buf[i];
 #ifdef DUMP_NVRAM
 	printk("new nvram:\n");
@@ -203,13 +203,16 @@
         target_node = find_dev("/pci/mac-io/escc/ch-b");
         set_int_property(target_node, "interrupt-parent", dnode);
 
-        target_node = find_dev("/pci/mac-io/ata-1");
-        set_int_property(target_node, "interrupt-parent", dnode);
-
-        target_node = find_dev("/pci/mac-io/ata-2");
+        /* QEMU only emulates 2 of the 3 ata buses currently */
+        /* 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");
         set_int_property(target_node, "interrupt-parent", dnode);
 
-        target_node = find_dev("/pci/mac-io/ata-3");
+        target_node = find_dev("/pci/mac-io/ata-4");
         set_int_property(target_node, "interrupt-parent", dnode);
 
         target_node = find_dev("/pci/mac-io/via-cuda");
@@ -312,7 +315,7 @@
         /* The NewWorld NVRAM is not located in the MacIO device */
         macio_nvram_init("", 0);
         escc_init(path, addr);
-        macio_ide_init(path, addr, 3);
+        macio_ide_init(path, addr, 2);
         openpic_init(path, addr);
 	ob_unin_init();
 }



More information about the OpenBIOS mailing list