diff options
Diffstat (limited to 'arch/sh/boards/mach-microdev')
-rw-r--r-- | arch/sh/boards/mach-microdev/Makefile | 3 | ||||
-rw-r--r-- | arch/sh/boards/mach-microdev/led.c | 101 | ||||
-rw-r--r-- | arch/sh/boards/mach-microdev/setup.c | 10 |
3 files changed, 0 insertions, 114 deletions
diff --git a/arch/sh/boards/mach-microdev/Makefile b/arch/sh/boards/mach-microdev/Makefile index 1387dd6c85eb..57f6375043f4 100644 --- a/arch/sh/boards/mach-microdev/Makefile +++ b/arch/sh/boards/mach-microdev/Makefile | |||
@@ -3,6 +3,3 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := setup.o irq.o io.o | 5 | obj-y := setup.o irq.o io.o |
6 | |||
7 | obj-$(CONFIG_HEARTBEAT) += led.o | ||
8 | |||
diff --git a/arch/sh/boards/mach-microdev/led.c b/arch/sh/boards/mach-microdev/led.c deleted file mode 100644 index 36e54b47a752..000000000000 --- a/arch/sh/boards/mach-microdev/led.c +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/superh/microdev/led.c | ||
3 | * | ||
4 | * Copyright (C) 2002 Stuart Menefy <stuart.menefy@st.com> | ||
5 | * Copyright (C) 2003 Richard Curnow (Richard.Curnow@superh.com) | ||
6 | * | ||
7 | * May be copied or modified under the terms of the GNU General Public | ||
8 | * License. See linux/COPYING for more information. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <asm/io.h> | ||
13 | |||
14 | #define LED_REGISTER 0xa6104d20 | ||
15 | |||
16 | static void mach_led_d9(int value) | ||
17 | { | ||
18 | unsigned long reg; | ||
19 | reg = ctrl_inl(LED_REGISTER); | ||
20 | reg &= ~1; | ||
21 | reg |= (value & 1); | ||
22 | ctrl_outl(reg, LED_REGISTER); | ||
23 | return; | ||
24 | } | ||
25 | |||
26 | static void mach_led_d10(int value) | ||
27 | { | ||
28 | unsigned long reg; | ||
29 | reg = ctrl_inl(LED_REGISTER); | ||
30 | reg &= ~2; | ||
31 | reg |= ((value & 1) << 1); | ||
32 | ctrl_outl(reg, LED_REGISTER); | ||
33 | return; | ||
34 | } | ||
35 | |||
36 | |||
37 | #ifdef CONFIG_HEARTBEAT | ||
38 | #include <linux/sched.h> | ||
39 | |||
40 | static unsigned char banner_table[] = { | ||
41 | 0x11, 0x01, 0x11, 0x01, 0x11, 0x03, | ||
42 | 0x11, 0x01, 0x11, 0x01, 0x13, 0x03, | ||
43 | 0x11, 0x01, 0x13, 0x01, 0x13, 0x01, 0x11, 0x03, | ||
44 | 0x11, 0x03, | ||
45 | 0x11, 0x01, 0x13, 0x01, 0x11, 0x03, | ||
46 | 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x07, | ||
47 | 0x13, 0x01, 0x13, 0x03, | ||
48 | 0x11, 0x01, 0x11, 0x03, | ||
49 | 0x13, 0x01, 0x11, 0x01, 0x13, 0x01, 0x11, 0x03, | ||
50 | 0x11, 0x01, 0x13, 0x01, 0x11, 0x03, | ||
51 | 0x13, 0x01, 0x13, 0x01, 0x13, 0x03, | ||
52 | 0x13, 0x01, 0x11, 0x01, 0x11, 0x03, | ||
53 | 0x11, 0x03, | ||
54 | 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x13, 0x07, | ||
55 | 0xff | ||
56 | }; | ||
57 | |||
58 | static void banner(void) | ||
59 | { | ||
60 | static int pos = 0; | ||
61 | static int count = 0; | ||
62 | |||
63 | if (count) { | ||
64 | count--; | ||
65 | } else { | ||
66 | int val = banner_table[pos]; | ||
67 | if (val == 0xff) { | ||
68 | pos = 0; | ||
69 | val = banner_table[pos]; | ||
70 | } | ||
71 | pos++; | ||
72 | mach_led_d10((val >> 4) & 1); | ||
73 | count = 10 * (val & 0xf); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | /* From heartbeat_harp in the stboards directory */ | ||
78 | /* acts like an actual heart beat -- ie thump-thump-pause... */ | ||
79 | void microdev_heartbeat(void) | ||
80 | { | ||
81 | static unsigned cnt = 0, period = 0, dist = 0; | ||
82 | |||
83 | if (cnt == 0 || cnt == dist) | ||
84 | mach_led_d9(1); | ||
85 | else if (cnt == 7 || cnt == dist+7) | ||
86 | mach_led_d9(0); | ||
87 | |||
88 | if (++cnt > period) { | ||
89 | cnt = 0; | ||
90 | /* The hyperbolic function below modifies the heartbeat period | ||
91 | * length in dependency of the current (5min) load. It goes | ||
92 | * through the points f(0)=126, f(1)=86, f(5)=51, | ||
93 | * f(inf)->30. */ | ||
94 | period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30; | ||
95 | dist = period / 4; | ||
96 | } | ||
97 | |||
98 | banner(); | ||
99 | } | ||
100 | |||
101 | #endif | ||
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c index a9202fe3cb59..9f5a97812e75 100644 --- a/arch/sh/boards/mach-microdev/setup.c +++ b/arch/sh/boards/mach-microdev/setup.c | |||
@@ -18,12 +18,6 @@ | |||
18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
19 | #include <asm/machvec.h> | 19 | #include <asm/machvec.h> |
20 | 20 | ||
21 | extern void microdev_heartbeat(void); | ||
22 | |||
23 | |||
24 | /****************************************************************************/ | ||
25 | |||
26 | |||
27 | /* | 21 | /* |
28 | * Setup for the SMSC FDC37C93xAPM | 22 | * Setup for the SMSC FDC37C93xAPM |
29 | */ | 23 | */ |
@@ -398,8 +392,4 @@ static struct sh_machine_vector mv_sh4202_microdev __initmv = { | |||
398 | .mv_outsl = microdev_outsl, | 392 | .mv_outsl = microdev_outsl, |
399 | 393 | ||
400 | .mv_init_irq = init_microdev_irq, | 394 | .mv_init_irq = init_microdev_irq, |
401 | |||
402 | #ifdef CONFIG_HEARTBEAT | ||
403 | .mv_heartbeat = microdev_heartbeat, | ||
404 | #endif | ||
405 | }; | 395 | }; |