OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [block/] [qd6580.c] - Blame information for rev 1626

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 *  linux/drivers/block/qd6580.c       Version 0.02  Feb 09, 1996
3
 *
4
 *  Copyright (C) 1996  Linus Torvalds & author (see below)
5
 */
6
 
7
/*
8
 * QDI QD6580 EIDE controller fast support by Colten Edwards.
9
 * No net access, but (maybe) can be reached at pje120@cs.usask.ca
10
 */
11
 
12
#undef REALLY_SLOW_IO           /* most systems can safely undef this */
13
 
14
#include <linux/types.h>
15
#include <linux/kernel.h>
16
#include <linux/delay.h>
17
#include <linux/timer.h>
18
#include <linux/mm.h>
19
#include <linux/ioport.h>
20
#include <linux/blkdev.h>
21
#include <linux/hdreg.h>
22
#include <asm/io.h>
23
#include "ide.h"
24
#include "ide_modes.h"
25
 
26
/*
27
 * Register 0xb3 looks like:
28
 *      0x4f is fast            mode3 ?
29
 *      0x3f is medium          mode2 ?
30
 *      0x2f is slower          mode1 ?
31
 *      0x1f is slower yet      mode0 ?
32
 *      0x0f ???                ???
33
 *
34
 * Don't know whether this sets BOTH drives, or just the first drive.
35
 * Don't know if there is a separate setting for the second drive.
36
 *
37
 * Feel free to patch this if you have one of these beasts
38
 * and can work out the answers!
39
 *
40
 * I/O ports are 0xb0 0xb2 and 0xb3
41
 *
42
 * More research on qd6580 being done by willmore@cig.mot.com (David)
43
 *      -- this is apparently a *dual* IDE interface
44
 */
45
 
46
static void tune_qd6580 (ide_drive_t *drive, byte pio)
47
{
48
        unsigned long flags;
49
 
50
        pio = ide_get_best_pio_mode(drive, pio, 3, NULL);
51
 
52
        save_flags(flags);
53
        cli();
54
        outb_p(0x8d,0xb0);
55
        outb_p(0x0 ,0xb2);
56
        outb_p(((pio+1)<<4)|0x0f,0xb3);
57
        inb(0x3f6);
58
        restore_flags(flags);
59
}
60
 
61
void init_qd6580 (void)
62
{
63
        ide_hwifs[0].chipset = ide_qd6580;
64
        ide_hwifs[1].chipset = ide_qd6580;
65
        ide_hwifs[0].tuneproc = &tune_qd6580;
66
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.