--- zzzz-none-000/linux-2.4.17/drivers/ide/ide.c 2001-10-25 20:58:35.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/ide/ide.c 2004-11-24 13:23:46.000000000 +0000 @@ -230,23 +230,14 @@ static void init_hwif_data (unsigned int index) { unsigned int unit; - hw_regs_t hw; ide_hwif_t *hwif = &ide_hwifs[index]; /* bulk initialize hwif & drive info with zeros */ memset(hwif, 0, sizeof(ide_hwif_t)); - memset(&hw, 0, sizeof(hw_regs_t)); /* fill in any non-zero initial values */ hwif->index = index; - ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); - memcpy(&hwif->hw, &hw, sizeof(hw)); - memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); - hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; -#ifdef CONFIG_BLK_DEV_HD - if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) - hwif->noprobe = 1; /* may be overridden by ide_setup() */ -#endif /* CONFIG_BLK_DEV_HD */ + hwif->noprobe = 1; hwif->major = ide_hwif_to_major[index]; hwif->name[0] = 'i'; hwif->name[1] = 'd'; @@ -273,6 +264,31 @@ } /* + * Old compatability function - initialise ports using ide_default_io_base + */ +static void ide_old_init_default_hwifs(void) +{ + unsigned int index; + ide_ioreg_t base; + ide_hwif_t *hwif; + + for (index = 0; index < MAX_HWIFS; index++) { + hwif = &ide_hwifs[index]; + + base = ide_default_io_base(index); + +#if !defined(CONFIG_REDWOOD_4) /* Redwood 4 has a base of 0x00000000 */ + if (base) +#endif + { + ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->hw.irq); + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); + hwif->noprobe = 0; + } + } +} + +/* * init_ide_data() sets reasonable default values into all fields * of all instances of the hwifs and drives, but only on the first call. * Subsequent calls have no effect (they don't wipe out anything). @@ -301,8 +317,16 @@ init_hwif_data(index); /* Add default hw interfaces */ + ide_old_init_default_hwifs(); ide_init_default_hwifs(); +#ifdef CONFIG_BLK_DEV_HD + /* Check for any clashes with hd.c driver */ + for (index = 0; index < MAX_HWIFS; ++index) + if (ide_hwifs[index].hw.io_ports[IDE_DATA_OFFSET] == HD_DATA) + hwif->noprobe = 1; /* may be overridden by ide_setup() */ +#endif /* CONFIG_BLK_DEV_HD */ + idebus_parameter = 0; system_bus_speed = 0; } @@ -1367,7 +1391,10 @@ * the driver. This makes the driver much more friendlier to shared IRQs * than previous designs, while remaining 100% (?) SMP safe and capable. */ -static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) +/* --BenH: made non-static as ide-pmac.c uses it to kick the hwgroup back + * into life on wakeup from machine sleep. + */ +void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) { ide_drive_t *drive; ide_hwif_t *hwif; @@ -1884,7 +1911,6 @@ if (drive->part[p].nr_sects > 0) { kdev_t devp = MKDEV(major, minor+p); invalidate_device(devp, 1); - set_blocksize(devp, 1024); } drive->part[p].start_sect = 0; drive->part[p].nr_sects = 0; @@ -3379,6 +3405,12 @@ macide_init(); } #endif /* CONFIG_BLK_DEV_MAC_IDE */ +#ifdef CONFIG_BLK_DEV_CPCI405_IDE + { + extern void cpci405ide_init(void); + cpci405ide_init(); + } +#endif /* CONFIG_BLK_DEV_CPCI405_IDE */ #ifdef CONFIG_BLK_DEV_Q40IDE { extern void q40ide_init(void);