📄 1006.ide.patch
字号:
unsigned long arg) { @@ -1986,6 +2218,11 @@ } case CDROMREADAUDIO: { struct cdrom_read_audio ra;++#ifdef CONFIG_SD_CDROM_DMAPACKET+ IOCTL_IN(arg, struct cdrom_read_audio, ra);+ return cdda_read_audio(cmd, cdi, &cgc, &ra);+#else int lba, nr; IOCTL_IN(arg, struct cdrom_read_audio, ra);@@ -2037,6 +2274,7 @@ } kfree(cgc.buffer); return ret;+#endif } case CDROMSUBCHNL: { struct cdrom_subchnl q;@@ -2392,6 +2630,7 @@ EXPORT_SYMBOL(cdrom_mode_sense); EXPORT_SYMBOL(init_cdrom_command); EXPORT_SYMBOL(cdrom_find_device);+EXPORT_SYMBOL(cdrom_get_media_event); #ifdef CONFIG_SYSCTL diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/ide/Config.in linuxmips-2.4.30/drivers/ide/Config.in--- linuxmips-2.4.30.ref/drivers/ide/Config.in 2004-11-18 16:28:37.000000000 -0800+++ linuxmips-2.4.30/drivers/ide/Config.in 2007-05-08 10:41:54.000000000 -0700@@ -159,6 +159,8 @@ if [ "$CONFIG_IDEDMA_PCI_AUTO" = "y" -o \ "$CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO" = "y" -o \+ "$CONFIG_BLK_DEV_TANGO2_ISAIDEDMA" = "y" -o \+ "$CONFIG_BLK_DEV_TANGO2_BMIDEDMA" = "y" -o \ "$CONFIG_IDEDMA_ICS_AUTO" = "y" ]; then define_bool CONFIG_IDEDMA_AUTO y else@@ -190,6 +192,45 @@ ## dep_mbool CONFIG_BLK_DEV_NTF_DISK $CONFIG_BLK_DEV_IDEDISK ##fi +if [ "$CONFIG_TANGO2" = "y" ]; then+if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then+ dep_tristate ' EM86xx ISA IDE controller' CONFIG_BLK_DEV_TANGO2_ISAIDE $CONFIG_BLK_DEV_IDE+ if [ "$CONFIG_BLK_DEV_TANGO2_ISAIDE" != "n" ]; then+ bool ' IDE Multiword DMA support' CONFIG_BLK_DEV_TANGO2_ISAIDEDMA+ bool ' Automatic peripheral bus timing setting' CONFIG_BLK_DEV_TANGO2_ISAIDETIMING+ fi++ dep_tristate ' EM86xx Bus Master IDE controller' CONFIG_BLK_DEV_TANGO2_BMIDE $CONFIG_BLK_DEV_IDE+ if [ "$CONFIG_BLK_DEV_TANGO2_BMIDE" != "n" ]; then+ bool ' IDE DMA support' CONFIG_BLK_DEV_TANGO2_BMIDEDMA+ if [ "$CONFIG_BLK_DEV_TANGO2_BMIDEDMA" = "y" ]; then+ bool ' IDE UDMA support' CONFIG_BLK_DEV_TANGO2_BMIDEUDMA+ fi+ fi++ if [ "$CONFIG_BLK_DEV_TANGO2_BMIDE" != "n" -o "$CONFIG_BLK_DEV_TANGO2_ISAIDE" != "n" ]; then+ define_bool CONFIG_SD_IDE_FASTPROBE y+ if [ "$CONFIG_BLK_DEV_IDECD" = "y" ]; then+ bool ' Enable CDROM wait for spin-up' CONFIG_SD_CDROM_WAIT+ if [ "$CONFIG_SD_CDROM_WAIT" = "y" ]; then+ int ' CDROM spin-up wait time (in seconds)' CONFIG_SD_CDROM_WAIT_TIME 5+ fi+ fi+ fi++ if [ "$CONFIG_BLK_DEV_TANGO2_ISAIDEDMA" = "y" -o "$CONFIG_BLK_DEV_TANGO2_BMIDEDMA" = "y" ]; then+ define_bool CONFIG_BLK_DEV_IDEDMA y+ if [ "$CONFIG_BLK_DEV_IDECD" = "y" ]; then+ bool ' Use DMA for ATAPI packet command' CONFIG_SD_CDROM_DMAPACKET+ bool ' Keep DMA mode even I/O failed on non-HDD' CONFIG_SD_CDROM_KEEP_DMA+ bool ' Enable user level direct DMA operation' CONFIG_SD_CDROM_DIRECT_DMA+ fi+ fi+fi+fi+++ dep_tristate 'Support for IDE Raid controllers (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL dep_tristate ' Support Promise software RAID (Fasttrak(tm)) (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_PDC $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID dep_tristate ' Highpoint 370 software RAID (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_HPT $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAIDdiff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/ide/ide.c linuxmips-2.4.30/drivers/ide/ide.c--- linuxmips-2.4.30.ref/drivers/ide/ide.c 2004-08-14 11:38:49.000000000 -0700+++ linuxmips-2.4.30/drivers/ide/ide.c 2007-05-08 10:41:54.000000000 -0700@@ -211,6 +211,7 @@ extern ide_driver_t idedefault_driver; static void setup_driver_defaults (ide_drive_t *drive);+static int num_hwifs; /* * Do not even *think* about calling this!@@ -305,6 +306,7 @@ /* Initialise all interface structures */ for (index = 0; index < MAX_HWIFS; ++index) init_hwif_data(index);+ num_hwifs = 0; /* Add default hw interfaces */ ide_init_default_hwifs();@@ -1148,7 +1150,7 @@ */ int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp) {- int index, retry = 1;+ int index, retry = 1, ret = -1; ide_hwif_t *hwif; do {@@ -1186,12 +1188,18 @@ create_proc_ide_interfaces(); #endif ide_driver_module(1);+#if defined(CONFIG_BLK_DEV_TANGO2_ISAIDE_MODULE) || defined(CONFIG_BLK_DEV_TANGO2_BMIDE_MODULE)+ initializing = 1;+#endif } if (hwifp) *hwifp = hwif; - return (initializing || hwif->present) ? index : -1;+ ret = (initializing || hwif->present) ? index : -1;+ if (ret >= 0)+ num_hwifs++;+ return(ret); } EXPORT_SYMBOL(ide_register_hw);@@ -1919,6 +1927,9 @@ */ return ide_revalidate_disk(inode->i_rdev); }+#ifdef CONFIG_BLK_DEV_TANGO2_BMIDE+ HWIF(drive)->ide_dma_check(drive);+#endif return 0; } case BLKROSET:@@ -2566,6 +2577,18 @@ buddha_init(); } #endif /* CONFIG_BLK_DEV_BUDDHA */+#ifdef CONFIG_BLK_DEV_TANGO2_BMIDE+ {+ extern void em86xx_bmide_init(void);+ em86xx_bmide_init();+ }+#endif+#ifdef CONFIG_BLK_DEV_TANGO2_ISAIDE+ {+ extern void em86xx_isaide_init(void);+ em86xx_isaide_init();+ }+#endif } void __init ide_init_builtin_subdrivers (void)@@ -2631,13 +2654,15 @@ probe_for_hwifs (); #ifdef CONFIG_BLK_DEV_IDE- if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])- ide_get_lock(NULL, NULL); /* for atari only */+ if (num_hwifs > 0) {+ if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])+ ide_get_lock(NULL, NULL); /* for atari only */ - (void) ideprobe_init();+ (void)ideprobe_init(); - if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])- ide_release_lock(); /* for atari only */+ if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])+ ide_release_lock(); /* for atari only */+ } #endif /* CONFIG_BLK_DEV_IDE */ #ifdef CONFIG_PROC_FSdiff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linuxmips-2.4.30.ref/drivers/ide/ide-cd.c linuxmips-2.4.30/drivers/ide/ide-cd.c--- linuxmips-2.4.30.ref/drivers/ide/ide-cd.c 2005-03-18 04:13:25.000000000 -0800+++ linuxmips-2.4.30/drivers/ide/ide-cd.c 2007-05-08 10:43:55.000000000 -0700@@ -317,6 +317,11 @@ #include "ide-cd.h" +#ifdef CONFIG_SD_CDROM_WAIT+#define CONFIG_SD_CDROM_WAIT_TICKS (CONFIG_SD_CDROM_WAIT_TIME * HZ)+static unsigned long cdrom_wait = 0;+#endif+ /**************************************************************************** * Generic packet command support and error handling routines. */@@ -447,21 +452,15 @@ if (failed_command != NULL) { - int lo=0, mid, hi= ARY_LEN (packet_command_texts);+ int lo, hi= ARY_LEN (packet_command_texts); s = NULL; - while (hi > lo) {- mid = (lo + hi) / 2;- if (packet_command_texts[mid].packet_command ==- failed_command->c[0]) {- s = packet_command_texts[mid].text;- break;- }- if (packet_command_texts[mid].packet_command >- failed_command->c[0])- hi = mid;- else- lo = mid+1;+ for (lo = 0; lo < hi; lo ++) {+ if (packet_command_texts[lo].packet_command ==+ failed_command->c[0]) {+ s = packet_command_texts[lo].text;+ break;+ } } printk (" The failed \"%s\" packet command was: \n \"", s);@@ -688,6 +687,11 @@ uptodate = 1; ide_cdrom_end_request(drive, uptodate);++#ifdef CONFIG_SD_CDROM_WAIT+ if (uptodate)+ cdrom_wait = 0;+#endif } @@ -785,12 +789,31 @@ too many times. */ if (++rq->errors > ERROR_MAX) do_end_request = 1;- } else if (sense_key == ILLEGAL_REQUEST ||- sense_key == DATA_PROTECT) {+ } else if (sense_key == DATA_PROTECT) {+ /* No point in retrying after an illegal+ request or data protect error.*/+ ide_dump_status (drive, "command error", stat);+ do_end_request = 1;+ } else if (sense_key == ILLEGAL_REQUEST) {+#ifdef CONFIG_SD_CDROM_WAIT+ if (cdrom_wait == 0)+ cdrom_wait = jiffies;+ if (time_after(cdrom_wait + CONFIG_SD_CDROM_WAIT_TICKS, jiffies)) {+ printk("%s: retrying operation.\n", drive->name);+ do_end_request = 0;+ } else {+ /* No point in retrying after an illegal+ request or data protect error.*/+ cdrom_wait = 0;+ ide_dump_status (drive, "command error", stat);+ do_end_request = 1;+ }+#else /* No point in retrying after an illegal request or data protect error.*/ ide_dump_status (drive, "command error", stat); do_end_request = 1;+#endif } else if (sense_key == MEDIUM_ERROR) { /* No point in re-trying a zillion times on a bad * sector... If we got here the error is not correctable */@@ -1432,7 +1455,21 @@ if (cdrom_read_from_buffer(drive)) return ide_stopped; - cdrom_attempt_remerge(drive, rq);+#if !defined(CONFIG_BLK_DEV_TANGO2_ISAIDEDMA) && !defined(CONFIG_BLK_DEV_TANGO2_BMIDEDMA)+ // by Ho Lee 2003/09/18+ // TANGO2 IDE DMA has maximum sector limition (refer to ide-probe.c)+ // block I/O interface build request queue based on the max_sector[],+ // but cdrom_attempt_remerge may merge the request and build the + // bigger request queue (up to 256 sectors), which is not adequate+ // to TANGO2 IDE DMA+ // by Ho Lee 2004/04/13+ // Since the driver makes use of MBUS interrupt to split the transfer,+ // merging does not make a problem.+// cdrom_attempt_remerge(drive, rq);+#else+// Don't do the remerge+// cdrom_attempt_remerge(drive, rq);+#endif /* Clear the local sector buffer. */ info->nsectors_buffered = 0;@@ -1466,6 +1503,26 @@ ide_startstop_t startstop; u8 lowcyl = 0, highcyl = 0; +#ifdef CONFIG_SD_CDROM_DMAPACKET+ struct cdrom_info *info = drive->driver_data;+ int dma = info->dma;+ int dma_error;++ /* Check for errors. */+ if (dma) {+ info->dma = 0;+ if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {+ /*+ * We don't disable drive DMA for packet DMA errors.+ * It's handled in cdda_read_audio()+ */+ /* HWIF(drive)->dmaproc(ide_dma_off, drive); */+ pc->stat = 2; /* 2 -> DMA error */+ printk(KERN_ERR "CDROM packet DMA error\n");+ }+ }+#endif+ /* Check for errors. */ if (cdrom_decode_status(&startstop, drive, 0, &stat)) return startstop;@@ -1477,6 +1534,16 @@ len = lowcyl + (256 * highcyl); +#ifdef CONFIG_SD_CDROM_DMAPACKET+ if (dma) {+ /*+ * If DMA succeeded, we have all the data+ */+ pc->buffer += pc->buflen;+ pc->buflen = 0;+ }+#endif+ /* If DRQ is clear, the command has completed. Complain if we still have data left to transfer. */ if ((stat & DRQ_STAT) == 0) {@@ -1501,7 +1568,11 @@ printk ("%s: cdrom_pc_intr: data underrun %d\n", drive->name, pc->buflen); */- pc->stat = 1;+ // XXX sigma - let's make it ok to send more memory+ // than requested if we are just reading the TOC+ if (pc->c[0] != 0x43)+ pc->stat = 1;+ cdrom_end_request(drive, 1); } return ide_stopped;@@ -1551,6 +1622,8 @@ "appears confused (ireason = 0x%2x)\n", drive->name, ireason); pc->stat = 1;+ cdrom_end_request (drive, 1);+ return ide_stopped; } /* Now we wait for another interrupt. */@@ -1579,7 +1652,15 @@ struct packet_command *pc = (struct packet_command *)rq->buffer; struct cdrom_info *info = drive->driver_data; +#ifdef CONFIG_SD_CDROM_DMAPACKET+ if (rq->bh) {+ info->dma = 1;+ } else {+ info->dma = 0;+ }+#else info->dma = 0;+#endif info->cmd = 0; pc->stat = 0; len = pc->buflen;@@ -1602,19 +1683,49 @@ } while (sleep); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -