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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-ia64/] [ide.h] - Blame information for rev 1774

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

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *  linux/include/asm-ia64/ide.h
3
 *
4
 *  Copyright (C) 1994-1996  Linus Torvalds & authors
5
 */
6
 
7
/*
8
 *  This file contains the ia64 architecture specific IDE code.
9
 */
10
 
11
#ifndef __ASM_IA64_IDE_H
12
#define __ASM_IA64_IDE_H
13
 
14
#ifdef __KERNEL__
15
 
16
#include <linux/config.h>
17
 
18
#include <linux/irq.h>
19
 
20
#ifndef MAX_HWIFS
21
# ifdef CONFIG_BLK_DEV_IDEPCI
22
#define MAX_HWIFS       10
23
# else
24
#define MAX_HWIFS       6
25
# endif
26
#endif
27
 
28
static __inline__ int ide_default_irq(ide_ioreg_t base)
29
{
30
        switch (base) {
31
                case 0x1f0: return isa_irq_to_vector(14);
32
                case 0x170: return isa_irq_to_vector(15);
33
                case 0x1e8: return isa_irq_to_vector(11);
34
                case 0x168: return isa_irq_to_vector(10);
35
                case 0x1e0: return isa_irq_to_vector(8);
36
                case 0x160: return isa_irq_to_vector(12);
37
                default:
38
                        return 0;
39
        }
40
}
41
 
42
static __inline__ ide_ioreg_t ide_default_io_base(int index)
43
{
44
        switch (index) {
45
                case 0:  return 0x1f0;
46
                case 1: return 0x170;
47
                case 2: return 0x1e8;
48
                case 3: return 0x168;
49
                case 4: return 0x1e0;
50
                case 5: return 0x160;
51
                default:
52
                        return 0;
53
        }
54
}
55
 
56
static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
57
{
58
        ide_ioreg_t reg = data_port;
59
        int i;
60
 
61
        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
62
                hw->io_ports[i] = reg;
63
                reg += 1;
64
        }
65
        if (ctrl_port) {
66
                hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
67
        } else {
68
                hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
69
        }
70
        if (irq != NULL)
71
                *irq = 0;
72
        hw->io_ports[IDE_IRQ_OFFSET] = 0;
73
}
74
 
75
static __inline__ void ide_init_default_hwifs(void)
76
{
77
#ifndef CONFIG_BLK_DEV_IDEPCI
78
        hw_regs_t hw;
79
        int index;
80
 
81
        for(index = 0; index < MAX_HWIFS; index++) {
82
                ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
83
                hw.irq = ide_default_irq(ide_default_io_base(index));
84
                ide_register_hw(&hw, NULL);
85
        }
86
#endif /* CONFIG_BLK_DEV_IDEPCI */
87
}
88
 
89
#include <asm-generic/ide_iops.h>
90
 
91
#endif /* __KERNEL__ */
92
 
93
#endif /* __ASM_IA64_IDE_H */

powered by: WebSVN 2.1.0

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