From: James S. <jsi...@us...> - 2002-01-28 20:48:50
|
Update of /cvsroot/linux-mips/linux/drivers/ide In directory usw-pr-cvs1:/tmp/cvs-serv13243/drivers/ide Modified Files: Config.in Added Files: Makefile ide-swarm.c ide.c Log Message: Swarm IDE support. --- NEW FILE: ide-swarm.c --- /* * Copyright (C) 2001 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Derived loosely from ide-pmac.c, so: * * Copyright (C) 1998 Paul Mackerras. * Copyright (C) 1995-1998 Mark Lord */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/ide.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/sibyte/sb1250_int.h> #include <asm/sibyte/swarm_ide.h> void __init swarm_ide_probe(void) { int i; ide_hwif_t *hwif; /* * Find the first untaken slot in hwifs */ for (i = 0; i < MAX_HWIFS; i++) { if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET]) { break; } } if (i == MAX_HWIFS) { printk("No space for SWARM onboard IDE driver in ide_hwifs[]. Not enabled.\n"); return; } /* Set up our stuff */ hwif = &ide_hwifs[i]; hwif->hw.io_ports[IDE_DATA_OFFSET] = SWARM_IDE_REG(0x1f0); hwif->hw.io_ports[IDE_ERROR_OFFSET] = SWARM_IDE_REG(0x1f1); hwif->hw.io_ports[IDE_NSECTOR_OFFSET] = SWARM_IDE_REG(0x1f2); hwif->hw.io_ports[IDE_SECTOR_OFFSET] = SWARM_IDE_REG(0x1f3); hwif->hw.io_ports[IDE_LCYL_OFFSET] = SWARM_IDE_REG(0x1f4); hwif->hw.io_ports[IDE_HCYL_OFFSET] = SWARM_IDE_REG(0x1f5); hwif->hw.io_ports[IDE_SELECT_OFFSET] = SWARM_IDE_REG(0x1f6); hwif->hw.io_ports[IDE_STATUS_OFFSET] = SWARM_IDE_REG(0x1f7); hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SWARM_IDE_REG(0x3f6); hwif->hw.io_ports[IDE_IRQ_OFFSET] = SWARM_IDE_REG(0x3f7); // hwif->hw->ack_intr = swarm_ide_ack_intr; hwif->hw.irq = SWARM_IDE_INT; hwif->ideproc = swarm_ideproc; memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); hwif->irq = hwif->hw.irq; printk("SWARM onboard IDE configured as device %i\n", i); } --- NEW FILE: ide.c --- /* * linux/drivers/ide/ide.c Version 6.31 June 9, 2000 * * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) */ /* * Mostly written by Mark Lord <ml...@po...> * and Gadi Oxman <ga...@ne...> * and Andre Hedrick <an...@li...> * * See linux/MAINTAINERS for address of current maintainer. * * This is the multiple IDE interface driver, as evolved from hd.c. * It supports up to MAX_HWIFS IDE interfaces, on one or more IRQs (usually 14 & 15). * There can be up to two drives per interface, as per the ATA-2 spec. * * Primary: ide0, port 0x1f0; major=3; hda is minor=0; hdb is minor=64 * Secondary: ide1, port 0x170; major=22; hdc is minor=0; hdd is minor=64 [...3757 lines suppressed...] for (index = 0; index < MAX_HWIFS; ++index) { ide_unregister(index); #if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) if (ide_hwifs[index].dma_base) (void) ide_release_dma(&ide_hwifs[index]); #endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ } #ifdef CONFIG_PROC_FS proc_ide_destroy(); #endif devfs_unregister (ide_devfs_handle); } #else /* !MODULE */ __setup("", ide_setup); #endif /* MODULE */ Index: Config.in =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/ide/Config.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Config.in 2001/12/03 17:31:27 1.6 +++ Config.in 2002/01/28 20:48:47 1.7 @@ -105,6 +105,9 @@ define_bool CONFIG_BLK_DEV_IDEPCI $CONFIG_BLK_DEV_IDEDMA_PMAC fi fi + if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then + bool ' SWARM onboard IDE support' CONFIG_BLK_DEV_IDE_SWARM + fi if [ "$CONFIG_ARCH_ACORN" = "y" ]; then dep_bool ' ICS IDE interface support' CONFIG_BLK_DEV_IDE_ICSIDE $CONFIG_ARCH_ACORN dep_bool ' ICS DMA support' CONFIG_BLK_DEV_IDEDMA_ICS $CONFIG_BLK_DEV_IDE_ICSIDE |