blob: d755d41b99310f85e05d2a5d47e7c41bb945c662 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_M32R_IDE_H
2#define _ASM_M32R_IDE_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004/*
5 * linux/include/asm-m32r/ide.h
6 *
7 * Copyright (C) 1994-1996 Linus Torvalds & authors
8 */
9
10/*
11 * This file contains the i386 architecture specific IDE code.
12 */
13
14#ifdef __KERNEL__
15
Hirokazu Takatafabb6262007-02-10 01:43:40 -080016#include <asm/m32r.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018static __inline__ int ide_default_irq(unsigned long base)
19{
20 switch (base) {
Hirokazu Takatad93f7de2006-12-08 02:35:57 -080021#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
22 || defined(CONFIG_PLAT_OPSPUT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 case 0x1f0: return PLD_IRQ_CFIREQ;
24 default:
25 return 0;
Hirokazu Takataad09d582005-11-28 13:44:00 -080026#elif defined(CONFIG_PLAT_MAPPI3)
27 case 0x1f0: return PLD_IRQ_CFIREQ;
28 case 0x170: return PLD_IRQ_IDEIREQ;
29 default:
30 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#else
32 case 0x1f0: return 14;
33 case 0x170: return 15;
34 case 0x1e8: return 11;
35 case 0x168: return 10;
36 case 0x1e0: return 8;
37 case 0x160: return 12;
38 default:
39 return 0;
40#endif
41 }
42}
43
44static __inline__ unsigned long ide_default_io_base(int index)
45{
46 switch (index) {
Bartlomiej Zolnierkiewiczac32f322008-07-24 22:53:27 +020047#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
48 || defined(CONFIG_PLAT_OPSPUT)
49 case 0: return 0x1f0;
50#elif defined(CONFIG_PLAT_MAPPI3)
51 case 0: return 0x1f0;
52 case 1: return 0x170;
53#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 case 0: return 0x1f0;
55 case 1: return 0x170;
56 case 2: return 0x1e8;
57 case 3: return 0x168;
58 case 4: return 0x1e0;
59 case 5: return 0x160;
Bartlomiej Zolnierkiewiczac32f322008-07-24 22:53:27 +020060#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 default:
62 return 0;
63 }
64}
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#include <asm-generic/ide_iops.h>
67
68#endif /* __KERNEL__ */
69
70#endif /* _ASM_M32R_IDE_H */