linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* pmac_ide_init_hwif_ports duplicate
@ 2001-08-27  5:16 Joseph P. Garcia
  0 siblings, 0 replies; only message in thread
From: Joseph P. Garcia @ 2001-08-27  5:16 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

pmac_ide_init_hwif_ports exists in two forms in the latest benh kernel.  a generic coding in pmac_setup.c for pci chips (pcmcia iirc), and a coding in ide-pmac.c for pmac specific applications.  On boot, the ide-pmac.c coding is used, but since the pmac_setup.c coding is used in the ppc function structure setup, the pmac_setup.c code is used everywhere else.  One consequence is that mediabays are no longer hot swappable.

I wonder if the pmac_setup.c coding is needed.  If it is, where?  If the only places that need the ide-pmac.c coding are ide-pmac.c and mediabay.c, then the attached patch should be a good fix.  It works by explicitly calling the ide-pmac.c coding, then calling ide_register_hw instead of ide_register.  The more generic pmac_setup.c coding is left as default for any other hot swappable ata subsystem.

Is this code going in the correct direction?  (ide_register is kinda hinted as being legacy)

Thanks.

--
Joseph P. Garcia
http://www.lycestra.com/

[-- Attachment #2: pmac_cdbay.patch --]
[-- Type: application/octet-stream, Size: 1978 bytes --]

--- linux-2.4.9-benh0-benh20010819-JPG1/drivers/macintosh/mediabay.c	Tue Aug  7 07:48:53 2001
+++ linux-2.4.9-benh0-benh20010819-JPG3/drivers/macintosh/mediabay.c	Sun Aug 26 02:26:51 2001
@@ -105,6 +105,9 @@
    (assumes the media-bay contains an ide device) */
 //#define MB_IDE_READY(i)	((inb(media_bays[i].cd_base + 0x70) & 0xc0) == 0x40)
 #define MB_IDE_READY(i)	((inb(media_bays[i].cd_base + 0x70) & 0x80) == 0)
+#include <linux/ide.h>
+void pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+										 ide_ioreg_t ctrl_port, int *irq);
 #endif
 
 /* Note: All delays are not in milliseconds and converted to HZ relative
@@ -473,8 +476,11 @@
 			bay->timer = 0;
 			bay->state = mb_up;
 			if (bay->cd_index < 0) {
+				hw_regs_t hw;
 				pmu_suspend();
-				bay->cd_index = ide_register(bay->cd_base, 0, bay->cd_irq);
+				pmac_ide_init_hwif_ports(&hw, (ide_ioreg_t) bay->cd_base, 0, NULL);
+				hw.irq = bay->cd_irq;
+				bay->cd_index = ide_register_hw(&hw, NULL);
 				pmu_resume();
 			}
 			if (bay->cd_index == -1) {
--- linux-2.4.9-benh0-benh20010819-JPG1/arch/ppc/kernel/pmac_setup.c	Sun Aug 19 14:01:33 2001
+++ linux-2.4.9-benh0-benh20010819-JPG3/arch/ppc/kernel/pmac_setup.c	Sun Aug 26 02:09:42 2001
@@ -617,7 +617,7 @@
  * for the IDE controller in the ohare/paddington/heathrow/keylargo.
  */
 static void __pmac
-pmac_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
+pmac_pci_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
 		ide_ioreg_t ctrl_port, int *irq)
 {
 	ide_ioreg_t reg = data_port;
@@ -795,7 +795,7 @@
         ppc_ide_md.ide_check_region	= pmac_ide_check_region;
         ppc_ide_md.ide_request_region	= pmac_ide_request_region;
         ppc_ide_md.ide_release_region	= pmac_ide_release_region;
-        ppc_ide_md.ide_init_hwif	= pmac_ide_init_hwif_ports;
+        ppc_ide_md.ide_init_hwif	= pmac_pci_ide_init_hwif_ports;
 #endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
 
 #ifdef CONFIG_BOOTX_TEXT

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-27  5:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-27  5:16 pmac_ide_init_hwif_ports duplicate Joseph P. Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).