diff options
Diffstat (limited to 'drivers/ide/cris/ide-cris.c')
-rw-r--r-- | drivers/ide/cris/ide-cris.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index 325e608d9e62..8c3294c4d23e 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -673,9 +673,8 @@ static void cris_ide_input_data (ide_drive_t *drive, void *, unsigned int); | |||
673 | static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int); | 673 | static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int); |
674 | static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int); | 674 | static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int); |
675 | static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int); | 675 | static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int); |
676 | static int cris_dma_on (ide_drive_t *drive); | ||
677 | 676 | ||
678 | static void cris_dma_off(ide_drive_t *drive) | 677 | static void cris_dma_host_set(ide_drive_t *drive, int on) |
679 | { | 678 | { |
680 | } | 679 | } |
681 | 680 | ||
@@ -755,13 +754,11 @@ static void cris_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
755 | cris_ide_set_speed(TYPE_DMA, 0, strobe, hold); | 754 | cris_ide_set_speed(TYPE_DMA, 0, strobe, hold); |
756 | } | 755 | } |
757 | 756 | ||
758 | void __init | 757 | static int __init init_e100_ide(void) |
759 | init_e100_ide (void) | ||
760 | { | 758 | { |
761 | hw_regs_t hw; | 759 | hw_regs_t hw; |
762 | int ide_offsets[IDE_NR_PORTS]; | 760 | int ide_offsets[IDE_NR_PORTS], h, i; |
763 | int h; | 761 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
764 | int i; | ||
765 | 762 | ||
766 | printk("ide: ETRAX FS built-in ATA DMA controller\n"); | 763 | printk("ide: ETRAX FS built-in ATA DMA controller\n"); |
767 | 764 | ||
@@ -778,9 +775,11 @@ init_e100_ide (void) | |||
778 | ide_offsets, | 775 | ide_offsets, |
779 | 0, 0, cris_ide_ack_intr, | 776 | 0, 0, cris_ide_ack_intr, |
780 | ide_default_irq(0)); | 777 | ide_default_irq(0)); |
781 | ide_register_hw(&hw, NULL, 1, &hwif); | 778 | hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); |
782 | if (hwif == NULL) | 779 | if (hwif == NULL) |
783 | continue; | 780 | continue; |
781 | ide_init_port_data(hwif, hwif->index); | ||
782 | ide_init_port_hw(hwif, &hw); | ||
784 | hwif->mmio = 1; | 783 | hwif->mmio = 1; |
785 | hwif->chipset = ide_etrax100; | 784 | hwif->chipset = ide_etrax100; |
786 | hwif->set_pio_mode = &cris_set_pio_mode; | 785 | hwif->set_pio_mode = &cris_set_pio_mode; |
@@ -789,6 +788,7 @@ init_e100_ide (void) | |||
789 | hwif->ata_output_data = &cris_ide_output_data; | 788 | hwif->ata_output_data = &cris_ide_output_data; |
790 | hwif->atapi_input_bytes = &cris_atapi_input_bytes; | 789 | hwif->atapi_input_bytes = &cris_atapi_input_bytes; |
791 | hwif->atapi_output_bytes = &cris_atapi_output_bytes; | 790 | hwif->atapi_output_bytes = &cris_atapi_output_bytes; |
791 | hwif->dma_host_set = &cris_dma_host_set; | ||
792 | hwif->ide_dma_end = &cris_dma_end; | 792 | hwif->ide_dma_end = &cris_dma_end; |
793 | hwif->dma_setup = &cris_dma_setup; | 793 | hwif->dma_setup = &cris_dma_setup; |
794 | hwif->dma_exec_cmd = &cris_dma_exec_cmd; | 794 | hwif->dma_exec_cmd = &cris_dma_exec_cmd; |
@@ -799,9 +799,6 @@ init_e100_ide (void) | |||
799 | hwif->OUTBSYNC = &cris_ide_outbsync; | 799 | hwif->OUTBSYNC = &cris_ide_outbsync; |
800 | hwif->INB = &cris_ide_inb; | 800 | hwif->INB = &cris_ide_inb; |
801 | hwif->INW = &cris_ide_inw; | 801 | hwif->INW = &cris_ide_inw; |
802 | hwif->dma_host_off = &cris_dma_off; | ||
803 | hwif->dma_host_on = &cris_dma_on; | ||
804 | hwif->dma_off_quietly = &cris_dma_off; | ||
805 | hwif->cbl = ATA_CBL_PATA40; | 802 | hwif->cbl = ATA_CBL_PATA40; |
806 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | 803 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; |
807 | hwif->pio_mask = ATA_PIO4, | 804 | hwif->pio_mask = ATA_PIO4, |
@@ -809,6 +806,8 @@ init_e100_ide (void) | |||
809 | hwif->drives[1].autotune = 1; | 806 | hwif->drives[1].autotune = 1; |
810 | hwif->ultra_mask = cris_ultra_mask; | 807 | hwif->ultra_mask = cris_ultra_mask; |
811 | hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ | 808 | hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ |
809 | |||
810 | idx[h] = hwif->index; | ||
812 | } | 811 | } |
813 | 812 | ||
814 | /* Reset pulse */ | 813 | /* Reset pulse */ |
@@ -821,14 +820,12 @@ init_e100_ide (void) | |||
821 | cris_ide_set_speed(TYPE_PIO, ATA_PIO4_SETUP, ATA_PIO4_STROBE, ATA_PIO4_HOLD); | 820 | cris_ide_set_speed(TYPE_PIO, ATA_PIO4_SETUP, ATA_PIO4_STROBE, ATA_PIO4_HOLD); |
822 | cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD); | 821 | cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD); |
823 | cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); | 822 | cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); |
824 | } | ||
825 | 823 | ||
826 | static int cris_dma_on (ide_drive_t *drive) | 824 | ide_device_add(idx); |
827 | { | 825 | |
828 | return 0; | 826 | return 0; |
829 | } | 827 | } |
830 | 828 | ||
831 | |||
832 | static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16))); | 829 | static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16))); |
833 | 830 | ||
834 | /* | 831 | /* |
@@ -1060,3 +1057,5 @@ static void cris_dma_start(ide_drive_t *drive) | |||
1060 | LED_DISK_READ(1); | 1057 | LED_DISK_READ(1); |
1061 | } | 1058 | } |
1062 | } | 1059 | } |
1060 | |||
1061 | module_init(init_e100_ide); | ||