aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/cchips
diff options
context:
space:
mode:
authorKristoffer Ericson <kristoffer.ericson@gmail.com>2007-07-17 00:52:38 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-07-19 23:18:19 -0400
commit4aafae27d0ce73f8507b8983b36006b734aa343a (patch)
tree0bdaf22415bf272a4cb9d7e061a4d860f114abe4 /arch/sh/cchips
parente6c972f21828f16d12704e5cf67d6f79c26cb53b (diff)
sh: hd64461 tidying.
Kill off the hd64461 io.c, as all of the hd64461 users are now using the generic I/O routines. [ hd64461/ moved to hd64461.c by Paul ] Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/cchips')
-rw-r--r--arch/sh/cchips/hd6446x/Makefile2
-rw-r--r--arch/sh/cchips/hd6446x/hd64461.c (renamed from arch/sh/cchips/hd6446x/hd64461/setup.c)1
-rw-r--r--arch/sh/cchips/hd6446x/hd64461/Makefile6
-rw-r--r--arch/sh/cchips/hd6446x/hd64461/io.c150
4 files changed, 2 insertions, 157 deletions
diff --git a/arch/sh/cchips/hd6446x/Makefile b/arch/sh/cchips/hd6446x/Makefile
new file mode 100644
index 000000000000..a106dd9db986
--- /dev/null
+++ b/arch/sh/cchips/hd6446x/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_HD64461) += hd64461.o
2obj-$(CONFIG_HD64465) += hd64465/
diff --git a/arch/sh/cchips/hd6446x/hd64461/setup.c b/arch/sh/cchips/hd6446x/hd64461.c
index 4d49b5cbcc13..97f6512aa1b7 100644
--- a/arch/sh/cchips/hd6446x/hd64461/setup.c
+++ b/arch/sh/cchips/hd6446x/hd64461.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: setup.c,v 1.5 2004/03/16 00:07:50 lethal Exp $
3 * Copyright (C) 2000 YAEGASHI Takeshi 2 * Copyright (C) 2000 YAEGASHI Takeshi
4 * Hitachi HD64461 companion chip support 3 * Hitachi HD64461 companion chip support
5 */ 4 */
diff --git a/arch/sh/cchips/hd6446x/hd64461/Makefile b/arch/sh/cchips/hd6446x/hd64461/Makefile
deleted file mode 100644
index bff4b92e388c..000000000000
--- a/arch/sh/cchips/hd6446x/hd64461/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1#
2# Makefile for the HD64461
3#
4
5obj-y := setup.o io.o
6
diff --git a/arch/sh/cchips/hd6446x/hd64461/io.c b/arch/sh/cchips/hd6446x/hd64461/io.c
deleted file mode 100644
index 7909a1b7b512..000000000000
--- a/arch/sh/cchips/hd6446x/hd64461/io.c
+++ /dev/null
@@ -1,150 +0,0 @@
1/*
2 * Copyright (C) 2000 YAEGASHI Takeshi
3 * Typical I/O routines for HD64461 system.
4 */
5
6#include <asm/io.h>
7#include <asm/hd64461.h>
8
9#define MEM_BASE (CONFIG_HD64461_IOBASE - HD64461_STBCR)
10
11static __inline__ unsigned long PORT2ADDR(unsigned long port)
12{
13 /* 16550A: HD64461 internal */
14 if (0x3f8<=port && port<=0x3ff)
15 return CONFIG_HD64461_IOBASE + 0x8000 + ((port-0x3f8)<<1);
16 if (0x2f8<=port && port<=0x2ff)
17 return CONFIG_HD64461_IOBASE + 0x7000 + ((port-0x2f8)<<1);
18
19#ifdef CONFIG_HD64461_ENABLER
20 /* NE2000: HD64461 PCMCIA channel 0 (I/O) */
21 if (0x300<=port && port<=0x31f)
22 return 0xba000000 + port;
23
24 /* ide0: HD64461 PCMCIA channel 1 (memory) */
25 /* On HP690, CF in slot 1 is configured as a memory card
26 device. See CF+ and CompactFlash Specification for the
27 detail of CF's memory mapped addressing. */
28 if (0x1f0<=port && port<=0x1f7) return 0xb5000000 + port;
29 if (port == 0x3f6) return 0xb50001fe;
30 if (port == 0x3f7) return 0xb50001ff;
31
32 /* ide1 */
33 if (0x170<=port && port<=0x177) return 0xba000000 + port;
34 if (port == 0x376) return 0xba000376;
35 if (port == 0x377) return 0xba000377;
36#endif
37
38 /* ??? */
39 if (port < 0xf000) return 0xa0000000 + port;
40 /* PCMCIA channel 0, I/O (0xba000000) */
41 if (port < 0x10000) return 0xba000000 + port - 0xf000;
42
43 /* HD64461 internal devices (0xb0000000) */
44 if (port < 0x20000) return CONFIG_HD64461_IOBASE + port - 0x10000;
45
46 /* PCMCIA channel 0, I/O (0xba000000) */
47 if (port < 0x30000) return 0xba000000 + port - 0x20000;
48
49 /* PCMCIA channel 1, memory (0xb5000000) */
50 if (port < 0x40000) return 0xb5000000 + port - 0x30000;
51
52 /* Whole physical address space (0xa0000000) */
53 return 0xa0000000 + (port & 0x1fffffff);
54}
55
56unsigned char hd64461_inb(unsigned long port)
57{
58 return *(volatile unsigned char*)PORT2ADDR(port);
59}
60
61unsigned char hd64461_inb_p(unsigned long port)
62{
63 unsigned long v = *(volatile unsigned char*)PORT2ADDR(port);
64 ctrl_delay();
65 return v;
66}
67
68unsigned short hd64461_inw(unsigned long port)
69{
70 return *(volatile unsigned short*)PORT2ADDR(port);
71}
72
73unsigned int hd64461_inl(unsigned long port)
74{
75 return *(volatile unsigned long*)PORT2ADDR(port);
76}
77
78void hd64461_outb(unsigned char b, unsigned long port)
79{
80 *(volatile unsigned char*)PORT2ADDR(port) = b;
81}
82
83void hd64461_outb_p(unsigned char b, unsigned long port)
84{
85 *(volatile unsigned char*)PORT2ADDR(port) = b;
86 ctrl_delay();
87}
88
89void hd64461_outw(unsigned short b, unsigned long port)
90{
91 *(volatile unsigned short*)PORT2ADDR(port) = b;
92}
93
94void hd64461_outl(unsigned int b, unsigned long port)
95{
96 *(volatile unsigned long*)PORT2ADDR(port) = b;
97}
98
99void hd64461_insb(unsigned long port, void *buffer, unsigned long count)
100{
101 volatile unsigned char* addr=(volatile unsigned char*)PORT2ADDR(port);
102 unsigned char *buf=buffer;
103 while(count--) *buf++=*addr;
104}
105
106void hd64461_insw(unsigned long port, void *buffer, unsigned long count)
107{
108 volatile unsigned short* addr=(volatile unsigned short*)PORT2ADDR(port);
109 unsigned short *buf=buffer;
110 while(count--) *buf++=*addr;
111}
112
113void hd64461_insl(unsigned long port, void *buffer, unsigned long count)
114{
115 volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
116 unsigned long *buf=buffer;
117 while(count--) *buf++=*addr;
118}
119
120void hd64461_outsb(unsigned long port, const void *buffer, unsigned long count)
121{
122 volatile unsigned char* addr=(volatile unsigned char*)PORT2ADDR(port);
123 const unsigned char *buf=buffer;
124 while(count--) *addr=*buf++;
125}
126
127void hd64461_outsw(unsigned long port, const void *buffer, unsigned long count)
128{
129 volatile unsigned short* addr=(volatile unsigned short*)PORT2ADDR(port);
130 const unsigned short *buf=buffer;
131 while(count--) *addr=*buf++;
132}
133
134void hd64461_outsl(unsigned long port, const void *buffer, unsigned long count)
135{
136 volatile unsigned long* addr=(volatile unsigned long*)PORT2ADDR(port);
137 const unsigned long *buf=buffer;
138 while(count--) *addr=*buf++;
139}
140
141unsigned short hd64461_readw(void __iomem *addr)
142{
143 return ctrl_inw(MEM_BASE+(unsigned long __force)addr);
144}
145
146void hd64461_writew(unsigned short b, void __iomem *addr)
147{
148 ctrl_outw(b, MEM_BASE+(unsigned long __force)addr);
149}
150