diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-06-12 06:46:17 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-06-12 06:46:35 -0400 |
commit | 5cf8da7bc03570bc15ef1b59e584dfb9e0f47e51 (patch) | |
tree | 8b3abca6736c2ac96c60d2eb17cdfb93be4c8502 | |
parent | 71ab91157e9d849a5a0c5fcd1ce68d236c3ca703 (diff) |
microblaze: Remove architecture heart beat code
There is no reason to keep this gpio based code in architecture. Use
ledtrig-heartbeat.c instead which is much more flexible then this
ancient code.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | arch/microblaze/Kconfig.debug | 7 | ||||
-rw-r--r-- | arch/microblaze/include/asm/setup.h | 3 | ||||
-rw-r--r-- | arch/microblaze/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/heartbeat.c | 72 | ||||
-rw-r--r-- | arch/microblaze/kernel/timer.c | 7 |
5 files changed, 0 insertions, 91 deletions
diff --git a/arch/microblaze/Kconfig.debug b/arch/microblaze/Kconfig.debug index 331a3bb66297..93a737c8d1a6 100644 --- a/arch/microblaze/Kconfig.debug +++ b/arch/microblaze/Kconfig.debug | |||
@@ -8,11 +8,4 @@ config TRACE_IRQFLAGS_SUPPORT | |||
8 | 8 | ||
9 | source "lib/Kconfig.debug" | 9 | source "lib/Kconfig.debug" |
10 | 10 | ||
11 | config HEART_BEAT | ||
12 | bool "Heart beat function for kernel" | ||
13 | default n | ||
14 | help | ||
15 | This option turns on/off heart beat kernel functionality. | ||
16 | First GPIO node is taken. | ||
17 | |||
18 | endmenu | 11 | endmenu |
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index d5384f6f36f7..a38e4a56e3c6 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h | |||
@@ -19,9 +19,6 @@ extern char cmd_line[COMMAND_LINE_SIZE]; | |||
19 | 19 | ||
20 | extern char *klimit; | 20 | extern char *klimit; |
21 | 21 | ||
22 | void microblaze_heartbeat(void); | ||
23 | void microblaze_setup_heartbeat(void); | ||
24 | |||
25 | # ifdef CONFIG_MMU | 22 | # ifdef CONFIG_MMU |
26 | extern void mmu_reset(void); | 23 | extern void mmu_reset(void); |
27 | # endif /* CONFIG_MMU */ | 24 | # endif /* CONFIG_MMU */ |
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile index 7e99cf6984a1..3a53378d66d9 100644 --- a/arch/microblaze/kernel/Makefile +++ b/arch/microblaze/kernel/Makefile | |||
@@ -8,7 +8,6 @@ ifdef CONFIG_FUNCTION_TRACER | |||
8 | CFLAGS_REMOVE_timer.o = -pg | 8 | CFLAGS_REMOVE_timer.o = -pg |
9 | CFLAGS_REMOVE_intc.o = -pg | 9 | CFLAGS_REMOVE_intc.o = -pg |
10 | CFLAGS_REMOVE_early_printk.o = -pg | 10 | CFLAGS_REMOVE_early_printk.o = -pg |
11 | CFLAGS_REMOVE_heartbeat.o = -pg | ||
12 | CFLAGS_REMOVE_ftrace.o = -pg | 11 | CFLAGS_REMOVE_ftrace.o = -pg |
13 | CFLAGS_REMOVE_process.o = -pg | 12 | CFLAGS_REMOVE_process.o = -pg |
14 | endif | 13 | endif |
@@ -22,7 +21,6 @@ obj-y += dma.o exceptions.o \ | |||
22 | 21 | ||
23 | obj-y += cpu/ | 22 | obj-y += cpu/ |
24 | 23 | ||
25 | obj-$(CONFIG_HEART_BEAT) += heartbeat.o | ||
26 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o | 24 | obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o |
27 | obj-$(CONFIG_MMU) += misc.o | 25 | obj-$(CONFIG_MMU) += misc.o |
28 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 26 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c deleted file mode 100644 index 87aa942eee8c..000000000000 --- a/arch/microblaze/kernel/heartbeat.c +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> | ||
3 | * Copyright (C) 2007-2009 PetaLogix | ||
4 | * Copyright (C) 2006 Atmark Techno, Inc. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/sched.h> | ||
12 | #include <linux/sched/loadavg.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/of.h> | ||
15 | |||
16 | #include <asm/setup.h> | ||
17 | #include <asm/page.h> | ||
18 | |||
19 | static unsigned int base_addr; | ||
20 | |||
21 | void microblaze_heartbeat(void) | ||
22 | { | ||
23 | static unsigned int cnt, period, dist; | ||
24 | |||
25 | if (base_addr) { | ||
26 | if (cnt == 0 || cnt == dist) | ||
27 | out_be32(base_addr, 1); | ||
28 | else if (cnt == 7 || cnt == dist + 7) | ||
29 | out_be32(base_addr, 0); | ||
30 | |||
31 | if (++cnt > period) { | ||
32 | cnt = 0; | ||
33 | /* | ||
34 | * The hyperbolic function below modifies the heartbeat | ||
35 | * period length in dependency of the current (5min) | ||
36 | * load. It goes through the points f(0)=126, f(1)=86, | ||
37 | * f(5)=51, f(inf)->30. | ||
38 | */ | ||
39 | period = ((672 << FSHIFT) / (5 * avenrun[0] + | ||
40 | (7 << FSHIFT))) + 30; | ||
41 | dist = period / 4; | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | |||
46 | void microblaze_setup_heartbeat(void) | ||
47 | { | ||
48 | struct device_node *gpio = NULL; | ||
49 | int *prop; | ||
50 | int j; | ||
51 | const char * const gpio_list[] = { | ||
52 | "xlnx,xps-gpio-1.00.a", | ||
53 | NULL | ||
54 | }; | ||
55 | |||
56 | for (j = 0; gpio_list[j] != NULL; j++) { | ||
57 | gpio = of_find_compatible_node(NULL, NULL, gpio_list[j]); | ||
58 | if (gpio) | ||
59 | break; | ||
60 | } | ||
61 | |||
62 | if (gpio) { | ||
63 | base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL)); | ||
64 | base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); | ||
65 | pr_notice("Heartbeat GPIO at 0x%x\n", base_addr); | ||
66 | |||
67 | /* GPIO is configured as output */ | ||
68 | prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL); | ||
69 | if (prop) | ||
70 | out_be32(base_addr + 4, 0); | ||
71 | } | ||
72 | } | ||
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 7de941cbbd94..a6683484b3a1 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c | |||
@@ -156,9 +156,6 @@ static inline void timer_ack(void) | |||
156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 156 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
157 | { | 157 | { |
158 | struct clock_event_device *evt = &clockevent_xilinx_timer; | 158 | struct clock_event_device *evt = &clockevent_xilinx_timer; |
159 | #ifdef CONFIG_HEART_BEAT | ||
160 | microblaze_heartbeat(); | ||
161 | #endif | ||
162 | timer_ack(); | 159 | timer_ack(); |
163 | evt->event_handler(evt); | 160 | evt->event_handler(evt); |
164 | return IRQ_HANDLED; | 161 | return IRQ_HANDLED; |
@@ -318,10 +315,6 @@ static int __init xilinx_timer_init(struct device_node *timer) | |||
318 | return ret; | 315 | return ret; |
319 | } | 316 | } |
320 | 317 | ||
321 | #ifdef CONFIG_HEART_BEAT | ||
322 | microblaze_setup_heartbeat(); | ||
323 | #endif | ||
324 | |||
325 | ret = xilinx_clocksource_init(); | 318 | ret = xilinx_clocksource_init(); |
326 | if (ret) | 319 | if (ret) |
327 | return ret; | 320 | return ret; |