diff options
-rw-r--r-- | arch/arm/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/common/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/common/bL_switcher_dummy_if.c | 71 |
3 files changed, 80 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ade70017fd65..cfcb0d8d6f85 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1556,6 +1556,14 @@ config BL_SWITCHER | |||
1556 | transparently handle transition between a cluster of A15's | 1556 | transparently handle transition between a cluster of A15's |
1557 | and a cluster of A7's in a big.LITTLE system. | 1557 | and a cluster of A7's in a big.LITTLE system. |
1558 | 1558 | ||
1559 | config BL_SWITCHER_DUMMY_IF | ||
1560 | tristate "Simple big.LITTLE switcher user interface" | ||
1561 | depends on BL_SWITCHER && DEBUG_KERNEL | ||
1562 | help | ||
1563 | This is a simple and dummy char dev interface to control | ||
1564 | the big.LITTLE switcher core code. It is meant for | ||
1565 | debugging purposes only. | ||
1566 | |||
1559 | choice | 1567 | choice |
1560 | prompt "Memory split" | 1568 | prompt "Memory split" |
1561 | default VMSPLIT_3G | 1569 | default VMSPLIT_3G |
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index 2586240d5a45..5c8584c4944d 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile | |||
@@ -18,3 +18,4 @@ AFLAGS_mcpm_head.o := -march=armv7-a | |||
18 | AFLAGS_vlock.o := -march=armv7-a | 18 | AFLAGS_vlock.o := -march=armv7-a |
19 | obj-$(CONFIG_TI_PRIV_EDMA) += edma.o | 19 | obj-$(CONFIG_TI_PRIV_EDMA) += edma.o |
20 | obj-$(CONFIG_BL_SWITCHER) += bL_switcher.o | 20 | obj-$(CONFIG_BL_SWITCHER) += bL_switcher.o |
21 | obj-$(CONFIG_BL_SWITCHER_DUMMY_IF) += bL_switcher_dummy_if.o | ||
diff --git a/arch/arm/common/bL_switcher_dummy_if.c b/arch/arm/common/bL_switcher_dummy_if.c new file mode 100644 index 000000000000..3f47f1203c6b --- /dev/null +++ b/arch/arm/common/bL_switcher_dummy_if.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * arch/arm/common/bL_switcher_dummy_if.c -- b.L switcher dummy interface | ||
3 | * | ||
4 | * Created by: Nicolas Pitre, November 2012 | ||
5 | * Copyright: (C) 2012-2013 Linaro Limited | ||
6 | * | ||
7 | * Dummy interface to user space for debugging purpose only. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/fs.h> | ||
17 | #include <linux/miscdevice.h> | ||
18 | #include <asm/uaccess.h> | ||
19 | #include <asm/bL_switcher.h> | ||
20 | |||
21 | static ssize_t bL_switcher_write(struct file *file, const char __user *buf, | ||
22 | size_t len, loff_t *pos) | ||
23 | { | ||
24 | unsigned char val[3]; | ||
25 | unsigned int cpu, cluster; | ||
26 | int ret; | ||
27 | |||
28 | pr_debug("%s\n", __func__); | ||
29 | |||
30 | if (len < 3) | ||
31 | return -EINVAL; | ||
32 | |||
33 | if (copy_from_user(val, buf, 3)) | ||
34 | return -EFAULT; | ||
35 | |||
36 | /* format: <cpu#>,<cluster#> */ | ||
37 | if (val[0] < '0' || val[0] > '9' || | ||
38 | val[1] != ',' || | ||
39 | val[2] < '0' || val[2] > '1') | ||
40 | return -EINVAL; | ||
41 | |||
42 | cpu = val[0] - '0'; | ||
43 | cluster = val[2] - '0'; | ||
44 | ret = bL_switch_request(cpu, cluster); | ||
45 | |||
46 | return ret ? : len; | ||
47 | } | ||
48 | |||
49 | static const struct file_operations bL_switcher_fops = { | ||
50 | .write = bL_switcher_write, | ||
51 | .owner = THIS_MODULE, | ||
52 | }; | ||
53 | |||
54 | static struct miscdevice bL_switcher_device = { | ||
55 | MISC_DYNAMIC_MINOR, | ||
56 | "b.L_switcher", | ||
57 | &bL_switcher_fops | ||
58 | }; | ||
59 | |||
60 | static int __init bL_switcher_dummy_if_init(void) | ||
61 | { | ||
62 | return misc_register(&bL_switcher_device); | ||
63 | } | ||
64 | |||
65 | static void __exit bL_switcher_dummy_if_exit(void) | ||
66 | { | ||
67 | misc_deregister(&bL_switcher_device); | ||
68 | } | ||
69 | |||
70 | module_init(bL_switcher_dummy_if_init); | ||
71 | module_exit(bL_switcher_dummy_if_exit); | ||