diff options
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | arch/metag/Kconfig | 12 | ||||
-rw-r--r-- | arch/metag/configs/meta1_defconfig | 3 | ||||
-rw-r--r-- | arch/metag/configs/meta2_defconfig | 3 | ||||
-rw-r--r-- | arch/metag/configs/meta2_smp_defconfig | 3 | ||||
-rw-r--r-- | arch/metag/include/asm/da.h | 43 | ||||
-rw-r--r-- | arch/metag/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/metag/kernel/da.c | 23 | ||||
-rw-r--r-- | arch/metag/kernel/setup.c | 15 |
9 files changed, 105 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 9b2b7699da4d..a6a0c352e559 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -5042,6 +5042,8 @@ F: Documentation/devicetree/bindings/metag/ | |||
5042 | F: drivers/clocksource/metag_generic.c | 5042 | F: drivers/clocksource/metag_generic.c |
5043 | F: drivers/irqchip/irq-metag.c | 5043 | F: drivers/irqchip/irq-metag.c |
5044 | F: drivers/irqchip/irq-metag-ext.c | 5044 | F: drivers/irqchip/irq-metag-ext.c |
5045 | F: drivers/tty/metag_da.c | ||
5046 | F: fs/imgdafs/ | ||
5045 | 5047 | ||
5046 | MICROBLAZE ARCHITECTURE | 5048 | MICROBLAZE ARCHITECTURE |
5047 | M: Michal Simek <monstr@monstr.eu> | 5049 | M: Michal Simek <monstr@monstr.eu> |
diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig index f6846ad5d3a8..30adc7875daa 100644 --- a/arch/metag/Kconfig +++ b/arch/metag/Kconfig | |||
@@ -214,6 +214,18 @@ config METAG_PERFCOUNTER_IRQS | |||
214 | When disabled, Performance Counters information will be collected | 214 | When disabled, Performance Counters information will be collected |
215 | based on Timer Interrupt. | 215 | based on Timer Interrupt. |
216 | 216 | ||
217 | config METAG_DA | ||
218 | bool "DA support" | ||
219 | help | ||
220 | Say Y if you plan to use a DA debug adapter with Linux. The presence | ||
221 | of the DA will be detected automatically at boot, so it is safe to say | ||
222 | Y to this option even when booting without a DA. | ||
223 | |||
224 | This enables support for services provided by DA JTAG debug adapters, | ||
225 | such as: | ||
226 | - communication over DA channels (such as the console driver). | ||
227 | - use of the DA filesystem. | ||
228 | |||
217 | menu "Boot options" | 229 | menu "Boot options" |
218 | 230 | ||
219 | config METAG_BUILTIN_DTB | 231 | config METAG_BUILTIN_DTB |
diff --git a/arch/metag/configs/meta1_defconfig b/arch/metag/configs/meta1_defconfig index 837c235ab67a..ad663ca53208 100644 --- a/arch/metag/configs/meta1_defconfig +++ b/arch/metag/configs/meta1_defconfig | |||
@@ -14,6 +14,7 @@ CONFIG_PARTITION_ADVANCED=y | |||
14 | # CONFIG_IOSCHED_CFQ is not set | 14 | # CONFIG_IOSCHED_CFQ is not set |
15 | CONFIG_FLATMEM_MANUAL=y | 15 | CONFIG_FLATMEM_MANUAL=y |
16 | CONFIG_META12_FPGA=y | 16 | CONFIG_META12_FPGA=y |
17 | CONFIG_METAG_DA=y | ||
17 | CONFIG_HZ_100=y | 18 | CONFIG_HZ_100=y |
18 | CONFIG_DEVTMPFS=y | 19 | CONFIG_DEVTMPFS=y |
19 | CONFIG_DEVTMPFS_MOUNT=y | 20 | CONFIG_DEVTMPFS_MOUNT=y |
@@ -27,6 +28,8 @@ CONFIG_BLK_DEV_RAM_SIZE=16384 | |||
27 | # CONFIG_SERIO is not set | 28 | # CONFIG_SERIO is not set |
28 | # CONFIG_VT is not set | 29 | # CONFIG_VT is not set |
29 | # CONFIG_LEGACY_PTYS is not set | 30 | # CONFIG_LEGACY_PTYS is not set |
31 | CONFIG_DA_TTY=y | ||
32 | CONFIG_DA_CONSOLE=y | ||
30 | # CONFIG_DEVKMEM is not set | 33 | # CONFIG_DEVKMEM is not set |
31 | # CONFIG_HW_RANDOM is not set | 34 | # CONFIG_HW_RANDOM is not set |
32 | # CONFIG_HWMON is not set | 35 | # CONFIG_HWMON is not set |
diff --git a/arch/metag/configs/meta2_defconfig b/arch/metag/configs/meta2_defconfig index e5bada83dd76..47922e9306af 100644 --- a/arch/metag/configs/meta2_defconfig +++ b/arch/metag/configs/meta2_defconfig | |||
@@ -16,6 +16,7 @@ CONFIG_PARTITION_ADVANCED=y | |||
16 | CONFIG_METAG_L2C=y | 16 | CONFIG_METAG_L2C=y |
17 | CONFIG_FLATMEM_MANUAL=y | 17 | CONFIG_FLATMEM_MANUAL=y |
18 | CONFIG_METAG_HALT_ON_PANIC=y | 18 | CONFIG_METAG_HALT_ON_PANIC=y |
19 | CONFIG_METAG_DA=y | ||
19 | CONFIG_HZ_100=y | 20 | CONFIG_HZ_100=y |
20 | CONFIG_DEVTMPFS=y | 21 | CONFIG_DEVTMPFS=y |
21 | # CONFIG_STANDALONE is not set | 22 | # CONFIG_STANDALONE is not set |
@@ -28,6 +29,8 @@ CONFIG_BLK_DEV_RAM_SIZE=16384 | |||
28 | # CONFIG_SERIO is not set | 29 | # CONFIG_SERIO is not set |
29 | # CONFIG_VT is not set | 30 | # CONFIG_VT is not set |
30 | # CONFIG_LEGACY_PTYS is not set | 31 | # CONFIG_LEGACY_PTYS is not set |
32 | CONFIG_DA_TTY=y | ||
33 | CONFIG_DA_CONSOLE=y | ||
31 | # CONFIG_DEVKMEM is not set | 34 | # CONFIG_DEVKMEM is not set |
32 | # CONFIG_HW_RANDOM is not set | 35 | # CONFIG_HW_RANDOM is not set |
33 | # CONFIG_HWMON is not set | 36 | # CONFIG_HWMON is not set |
diff --git a/arch/metag/configs/meta2_smp_defconfig b/arch/metag/configs/meta2_smp_defconfig index 41983a20db72..f5082505872d 100644 --- a/arch/metag/configs/meta2_smp_defconfig +++ b/arch/metag/configs/meta2_smp_defconfig | |||
@@ -17,6 +17,7 @@ CONFIG_METAG_L2C=y | |||
17 | CONFIG_FLATMEM_MANUAL=y | 17 | CONFIG_FLATMEM_MANUAL=y |
18 | CONFIG_METAG_HALT_ON_PANIC=y | 18 | CONFIG_METAG_HALT_ON_PANIC=y |
19 | CONFIG_SMP=y | 19 | CONFIG_SMP=y |
20 | CONFIG_METAG_DA=y | ||
20 | CONFIG_HZ_100=y | 21 | CONFIG_HZ_100=y |
21 | CONFIG_DEVTMPFS=y | 22 | CONFIG_DEVTMPFS=y |
22 | # CONFIG_STANDALONE is not set | 23 | # CONFIG_STANDALONE is not set |
@@ -29,6 +30,8 @@ CONFIG_BLK_DEV_RAM_SIZE=16384 | |||
29 | # CONFIG_SERIO is not set | 30 | # CONFIG_SERIO is not set |
30 | # CONFIG_VT is not set | 31 | # CONFIG_VT is not set |
31 | # CONFIG_LEGACY_PTYS is not set | 32 | # CONFIG_LEGACY_PTYS is not set |
33 | CONFIG_DA_TTY=y | ||
34 | CONFIG_DA_CONSOLE=y | ||
32 | # CONFIG_DEVKMEM is not set | 35 | # CONFIG_DEVKMEM is not set |
33 | # CONFIG_HW_RANDOM is not set | 36 | # CONFIG_HW_RANDOM is not set |
34 | # CONFIG_HWMON is not set | 37 | # CONFIG_HWMON is not set |
diff --git a/arch/metag/include/asm/da.h b/arch/metag/include/asm/da.h new file mode 100644 index 000000000000..81bd5212fb03 --- /dev/null +++ b/arch/metag/include/asm/da.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Meta DA JTAG debugger control. | ||
3 | * | ||
4 | * Copyright 2012 Imagination Technologies Ltd. | ||
5 | */ | ||
6 | |||
7 | #ifndef _METAG_DA_H_ | ||
8 | #define _METAG_DA_H_ | ||
9 | |||
10 | #ifdef CONFIG_METAG_DA | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | extern bool _metag_da_present; | ||
16 | |||
17 | /** | ||
18 | * metag_da_enabled() - Find whether a DA is currently enabled. | ||
19 | * | ||
20 | * Returns: true if a DA was detected, false if not. | ||
21 | */ | ||
22 | static inline bool metag_da_enabled(void) | ||
23 | { | ||
24 | return _metag_da_present; | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * metag_da_probe() - Try and detect a connected DA. | ||
29 | * | ||
30 | * This is used at start up to detect whether a DA is active. | ||
31 | * | ||
32 | * Returns: 0 on detection, -err otherwise. | ||
33 | */ | ||
34 | int __init metag_da_probe(void); | ||
35 | |||
36 | #else /* !CONFIG_METAG_DA */ | ||
37 | |||
38 | #define metag_da_enabled() false | ||
39 | #define metag_da_probe() do {} while (0) | ||
40 | |||
41 | #endif | ||
42 | |||
43 | #endif /* _METAG_DA_H_ */ | ||
diff --git a/arch/metag/kernel/Makefile b/arch/metag/kernel/Makefile index a5e4ba6fd20a..d7675f4a5df8 100644 --- a/arch/metag/kernel/Makefile +++ b/arch/metag/kernel/Makefile | |||
@@ -28,6 +28,7 @@ obj-y += user_gateway.o | |||
28 | obj-$(CONFIG_PERF_EVENTS) += perf/ | 28 | obj-$(CONFIG_PERF_EVENTS) += perf/ |
29 | 29 | ||
30 | obj-$(CONFIG_METAG_COREMEM) += coremem.o | 30 | obj-$(CONFIG_METAG_COREMEM) += coremem.o |
31 | obj-$(CONFIG_METAG_DA) += da.o | ||
31 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 32 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
32 | obj-$(CONFIG_FUNCTION_TRACER) += ftrace_stub.o | 33 | obj-$(CONFIG_FUNCTION_TRACER) += ftrace_stub.o |
33 | obj-$(CONFIG_MODULES) += metag_ksyms.o | 34 | obj-$(CONFIG_MODULES) += metag_ksyms.o |
diff --git a/arch/metag/kernel/da.c b/arch/metag/kernel/da.c new file mode 100644 index 000000000000..52aabb658fde --- /dev/null +++ b/arch/metag/kernel/da.c | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Meta DA JTAG debugger control. | ||
3 | * | ||
4 | * Copyright 2012 Imagination Technologies Ltd. | ||
5 | */ | ||
6 | |||
7 | |||
8 | #include <linux/io.h> | ||
9 | #include <linux/kernel.h> | ||
10 | #include <asm/da.h> | ||
11 | #include <asm/metag_mem.h> | ||
12 | |||
13 | bool _metag_da_present; | ||
14 | |||
15 | int __init metag_da_probe(void) | ||
16 | { | ||
17 | _metag_da_present = (metag_in32(T0VECINT_BHALT) == 1); | ||
18 | if (_metag_da_present) | ||
19 | pr_info("DA present\n"); | ||
20 | else | ||
21 | pr_info("DA not present\n"); | ||
22 | return 0; | ||
23 | } | ||
diff --git a/arch/metag/kernel/setup.c b/arch/metag/kernel/setup.c index 74e2c1f812a5..89f9cdc389e8 100644 --- a/arch/metag/kernel/setup.c +++ b/arch/metag/kernel/setup.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <asm/hwthread.h> | 37 | #include <asm/hwthread.h> |
38 | #include <asm/mmzone.h> | 38 | #include <asm/mmzone.h> |
39 | #include <asm/l2cache.h> | 39 | #include <asm/l2cache.h> |
40 | #include <asm/da.h> | ||
40 | #include <asm/prom.h> | 41 | #include <asm/prom.h> |
41 | #include <asm/mach/arch.h> | 42 | #include <asm/mach/arch.h> |
42 | #include <asm/core_reg.h> | 43 | #include <asm/core_reg.h> |
@@ -60,6 +61,11 @@ extern char _heap_start[]; | |||
60 | extern u32 __dtb_start[]; | 61 | extern u32 __dtb_start[]; |
61 | #endif | 62 | #endif |
62 | 63 | ||
64 | #ifdef CONFIG_DA_CONSOLE | ||
65 | /* Our early channel based console driver */ | ||
66 | extern struct console dash_console; | ||
67 | #endif | ||
68 | |||
63 | struct machine_desc *machine_desc __initdata; | 69 | struct machine_desc *machine_desc __initdata; |
64 | 70 | ||
65 | /* | 71 | /* |
@@ -180,6 +186,15 @@ void __init setup_arch(char **cmdline_p) | |||
180 | 186 | ||
181 | metag_cache_probe(); | 187 | metag_cache_probe(); |
182 | 188 | ||
189 | metag_da_probe(); | ||
190 | #ifdef CONFIG_DA_CONSOLE | ||
191 | if (metag_da_enabled()) { | ||
192 | /* An early channel based console driver */ | ||
193 | register_console(&dash_console); | ||
194 | add_preferred_console("ttyDA", 1, NULL); | ||
195 | } | ||
196 | #endif | ||
197 | |||
183 | /* try interpreting the argument as a device tree */ | 198 | /* try interpreting the argument as a device tree */ |
184 | machine_desc = setup_machine_fdt(original_cmd_line); | 199 | machine_desc = setup_machine_fdt(original_cmd_line); |
185 | /* if it doesn't look like a device tree it must be a command line */ | 200 | /* if it doesn't look like a device tree it must be a command line */ |