Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / sh / boards / cat68701 / setup.c
blobae8a350ade53e94ca8e26b442edc47aaca06f815
1 /*
2 * linux/arch/sh/boards/cat68701/setup.c
4 * Copyright (C) 2000 Niibe Yutaka
5 * 2001 Yutaro Ebihara
7 * Setup routines for A-ONE Corp CAT-68701 SH7708 Board
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
15 #include <asm/io.h>
16 #include <asm/machvec.h>
17 #include <asm/mach/io.h>
18 #include <linux/config.h>
19 #include <linux/module.h>
20 #include <linux/init.h>
21 #include <linux/sched.h>
23 const char *get_system_type(void)
25 return "CAT-68701";
28 #ifdef CONFIG_HEARTBEAT
29 void heartbeat_cat68701()
31 static unsigned int cnt = 0, period = 0 , bit = 0;
32 cnt += 1;
33 if (cnt < period) {
34 return;
36 cnt = 0;
38 /* Go through the points (roughly!):
39 * f(0)=10, f(1)=16, f(2)=20, f(5)=35,f(inf)->110
41 period = 110 - ( (300<<FSHIFT)/
42 ((avenrun[0]/5) + (3<<FSHIFT)) );
44 if(bit){ bit=0; }else{ bit=1; }
45 outw(bit<<15,0x3fe);
47 #endif /* CONFIG_HEARTBEAT */
49 unsigned long cat68701_isa_port2addr(unsigned long offset)
51 /* CompactFlash (IDE) */
52 if (((offset >= 0x1f0) && (offset <= 0x1f7)) || (offset==0x3f6))
53 return 0xba000000 + offset;
55 /* INPUT PORT */
56 if ((offset >= 0x3fc) && (offset <= 0x3fd))
57 return 0xb4007000 + offset;
59 /* OUTPUT PORT */
60 if ((offset >= 0x3fe) && (offset <= 0x3ff))
61 return 0xb4007400 + offset;
63 return offset + 0xb4000000; /* other I/O (EREA 5)*/
67 * The Machine Vector
70 struct sh_machine_vector mv_cat68701 __initmv = {
71 .mv_nr_irqs = 32,
72 .mv_isa_port2addr = cat68701_isa_port2addr,
73 .mv_irq_demux = cat68701_irq_demux,
75 .mv_init_irq = init_cat68701_IRQ,
76 #ifdef CONFIG_HEARTBEAT
77 .mv_heartbeat = heartbeat_cat68701,
78 #endif
80 ALIAS_MV(cat68701)
82 int __init platform_setup(void)
84 /* dummy read erea5 (CS8900A) */