blob: 05cc7dc00e0c14371ec7a5b7ddcbc5b06ca1642e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Copyright (C) 1994-1996 Linus Torvalds & authors
4 */
5
6/* Copyright(c) 1996 Kars de Jong */
7/* Based on the ide driver from 1.2.13pl8 */
8
9/*
10 * Credits (alphabetical):
11 *
12 * - Bjoern Brauel
13 * - Kars de Jong
14 * - Torsten Ebeling
15 * - Dwight Engen
16 * - Thorsten Floeck
17 * - Roman Hodek
18 * - Guenther Kelleter
19 * - Chris Lawrence
20 * - Michael Rausch
21 * - Christian Sauer
22 * - Michael Schmitz
23 * - Jes Soerensen
24 * - Michael Thurm
25 * - Geert Uytterhoeven
26 */
27
28#ifndef _M68K_IDE_H
29#define _M68K_IDE_H
30
31#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <asm/setup.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35
Jate Sujjavanichdc6ae5e2010-06-07 11:39:30 -040036#ifdef CONFIG_MMU
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038/*
39 * Get rid of defs from io.h - ide has its private and conflicting versions
40 * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
41 * always use the `raw' MMIO versions
42 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#undef readb
44#undef readw
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#undef writeb
46#undef writew
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define readb in_8
49#define readw in_be16
50#define __ide_mm_insw(port, addr, n) raw_insw((u16 *)port, addr, n)
Linus Torvalds1da177e2005-04-16 15:20:36 -070051#define __ide_mm_insl(port, addr, n) raw_insl((u32 *)port, addr, n)
52#define writeb(val, port) out_8(port, val)
53#define writew(val, port) out_be16(port, val)
54#define __ide_mm_outsw(port, addr, n) raw_outsw((u16 *)port, addr, n)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055#define __ide_mm_outsl(port, addr, n) raw_outsl((u32 *)port, addr, n)
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Jate Sujjavanichdc6ae5e2010-06-07 11:39:30 -040057#else
58
59#define __ide_mm_insw(port, addr, n) io_insw((unsigned int)port, addr, n)
60#define __ide_mm_insl(port, addr, n) io_insl((unsigned int)port, addr, n)
61#define __ide_mm_outsw(port, addr, n) io_outsw((unsigned int)port, addr, n)
62#define __ide_mm_outsl(port, addr, n) io_outsl((unsigned int)port, addr, n)
63
64#endif /* CONFIG_MMU */
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#endif /* __KERNEL__ */
67#endif /* _M68K_IDE_H */