2 * arch/sh/boards/landisk/setup.c
4 * Copyright (C) 2000 Kazumoto Kojima
5 * Copyright (C) 2002 Paul Mundt
7 * I-O DATA Device, Inc. LANDISK Support.
9 * Modified for LANDISK by
10 * Atom Create Engineering Co., Ltd. 2002.
12 * modifed by kogiidena
15 * This file is subject to the terms and conditions of the GNU General Public
16 * License. See the file "COPYING" in the main directory of this archive
19 #include <linux/init.h>
22 #include <asm/machvec.h>
24 #include <asm/landisk/iodata_landisk.h>
27 void landisk_time_init(void);
28 void init_landisk_IRQ(void);
31 int landisk_buzzerparam
;
34 /* cycle the led's in the clasic knightrider/sun pattern */
35 static void heartbeat_landisk(void)
37 static unsigned int cnt
= 0, blink
= 0x00, period
= 25;
38 volatile u8
*p
= (volatile u8
*)PA_LED
;
41 if ((landisk_ledparam
& 0x080) == 0)
52 data
= (blink
& 0x01) ? (landisk_ledparam
>> 16) : 0;
53 data
|= (blink
& 0x02) ? (landisk_ledparam
>> 8) : 0;
54 data
|= landisk_ledparam
;
57 if (landisk_buzzerparam
& 0x1) {
64 if (((landisk_ledparam
& 0x007f7f00) == 0) &&
65 (landisk_buzzerparam
== 0))
66 landisk_ledparam
&= (~0x0080);
68 landisk_buzzerparam
>>= 1;
71 static void landisk_power_off(void)
73 ctrl_outb(0x01, PA_SHUTDOWN
);
76 static void check_usl5p(void)
78 volatile u8
*p
= (volatile u8
*)PA_LED
;
86 landisk_arch
= (tmp2
== 0x40);
87 if (landisk_arch
== 1) {
89 landisk_ledparam
= 0x00000380;
90 landisk_ledparam
|= (tmp1
& 0x07c);
93 landisk_ledparam
= 0x02000180;
94 landisk_ledparam
|= 0x04;
101 static int __init
landisk_cf_init(void)
104 unsigned long paddrbase
, psize
;
106 /* open I/O area window */
107 paddrbase
= virt_to_phys((void *)PA_AREA5_IO
);
109 prot
= PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16
);
110 area5_io_base
= p3_ioremap(paddrbase
, psize
, prot
.pgprot
);
111 if (!area5_io_base
) {
112 printk("allocate_cf_area : can't open CF I/O window!\n");
116 paddrbase
= virt_to_phys((void *)PA_AREA6_IO
);
118 prot
= PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16
);
119 area6_io_base
= p3_ioremap(paddrbase
, psize
, prot
.pgprot
);
120 if (!area6_io_base
) {
121 printk("allocate_cf_area : can't open HDD I/O window!\n");
125 printk(KERN_INFO
"Allocate Area5/6 success.\n");
127 /* XXX : do we need attribute and common-memory area also? */
132 static void __init
landisk_setup(char **cmdline_p
)
134 device_initcall(landisk_cf_init
);
136 landisk_buzzerparam
= 0;
139 printk(KERN_INFO
"I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
141 board_time_init
= landisk_time_init
;
142 pm_power_off
= landisk_power_off
;
148 struct sh_machine_vector mv_landisk __initmv
= {
149 .mv_name
= "LANDISK",
150 .mv_setup
= landisk_setup
,
152 .mv_inb
= landisk_inb
,
153 .mv_inw
= landisk_inw
,
154 .mv_inl
= landisk_inl
,
155 .mv_outb
= landisk_outb
,
156 .mv_outw
= landisk_outw
,
157 .mv_outl
= landisk_outl
,
158 .mv_inb_p
= landisk_inb_p
,
159 .mv_inw_p
= landisk_inw
,
160 .mv_inl_p
= landisk_inl
,
161 .mv_outb_p
= landisk_outb_p
,
162 .mv_outw_p
= landisk_outw
,
163 .mv_outl_p
= landisk_outl
,
164 .mv_insb
= landisk_insb
,
165 .mv_insw
= landisk_insw
,
166 .mv_insl
= landisk_insl
,
167 .mv_outsb
= landisk_outsb
,
168 .mv_outsw
= landisk_outsw
,
169 .mv_outsl
= landisk_outsl
,
170 .mv_ioport_map
= landisk_ioport_map
,
171 .mv_init_irq
= init_landisk_IRQ
,
172 #ifdef CONFIG_HEARTBEAT
173 .mv_heartbeat
= heartbeat_landisk
,