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/config.h>
20 #include <linux/init.h>
23 #include <asm/machvec.h>
25 #include <asm/landisk/iodata_landisk.h>
28 void landisk_time_init(void);
29 void init_landisk_IRQ(void);
32 int landisk_buzzerparam;
35 /* cycle the led's in the clasic knightrider/sun pattern */
36 static void heartbeat_landisk(void)
38 static unsigned int cnt = 0, blink = 0x00, period = 25;
39 volatile u8 *p = (volatile u8 *)PA_LED;
42 if ((landisk_ledparam & 0x080) == 0)
53 data = (blink & 0x01) ? (landisk_ledparam >> 16) : 0;
54 data |= (blink & 0x02) ? (landisk_ledparam >> 8) : 0;
55 data |= landisk_ledparam;
58 if (landisk_buzzerparam & 0x1) {
65 if (((landisk_ledparam & 0x007f7f00) == 0) &&
66 (landisk_buzzerparam == 0))
67 landisk_ledparam &= (~0x0080);
69 landisk_buzzerparam >>= 1;
72 static void landisk_power_off(void)
74 ctrl_outb(0x01, PA_SHUTDOWN);
77 static void check_usl5p(void)
79 volatile u8 *p = (volatile u8 *)PA_LED;
87 landisk_arch = (tmp2 == 0x40);
88 if (landisk_arch == 1) {
90 landisk_ledparam = 0x00000380;
91 landisk_ledparam |= (tmp1 & 0x07c);
94 landisk_ledparam = 0x02000180;
95 landisk_ledparam |= 0x04;
102 static int __init landisk_cf_init(void)
105 unsigned long paddrbase, psize;
107 /* open I/O area window */
108 paddrbase = virt_to_phys((void *)PA_AREA5_IO);
110 prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
111 area5_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
112 if (!area5_io_base) {
113 printk("allocate_cf_area : can't open CF I/O window!\n");
117 paddrbase = virt_to_phys((void *)PA_AREA6_IO);
119 prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
120 area6_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
121 if (!area6_io_base) {
122 printk("allocate_cf_area : can't open HDD I/O window!\n");
126 printk(KERN_INFO "Allocate Area5/6 success.\n");
128 /* XXX : do we need attribute and common-memory area also? */
133 static void __init landisk_setup(char **cmdline_p)
135 device_initcall(landisk_cf_init);
137 landisk_buzzerparam = 0;
140 printk(KERN_INFO "I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
142 board_time_init = landisk_time_init;
143 pm_power_off = landisk_power_off;
149 struct sh_machine_vector mv_landisk __initmv = {
150 .mv_name = "LANDISK",
151 .mv_setup = landisk_setup,
153 .mv_inb = landisk_inb,
154 .mv_inw = landisk_inw,
155 .mv_inl = landisk_inl,
156 .mv_outb = landisk_outb,
157 .mv_outw = landisk_outw,
158 .mv_outl = landisk_outl,
159 .mv_inb_p = landisk_inb_p,
160 .mv_inw_p = landisk_inw,
161 .mv_inl_p = landisk_inl,
162 .mv_outb_p = landisk_outb_p,
163 .mv_outw_p = landisk_outw,
164 .mv_outl_p = landisk_outl,
165 .mv_insb = landisk_insb,
166 .mv_insw = landisk_insw,
167 .mv_insl = landisk_insl,
168 .mv_outsb = landisk_outsb,
169 .mv_outsw = landisk_outsw,
170 .mv_outsl = landisk_outsl,
171 .mv_ioport_map = landisk_ioport_map,
172 .mv_init_irq = init_landisk_IRQ,
173 #ifdef CONFIG_HEARTBEAT
174 .mv_heartbeat = heartbeat_landisk,