summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@intel.com>2010-09-24 15:36:24 -0700
committerSaul Wold <Saul.Wold@intel.com>2010-09-24 16:43:21 -0700
commit239a368d5715d8f5b7733f9400339c2350c49369 (patch)
tree2953f12b45e590d9e14b6f72f8e4ee7188e41508 /meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch
parentc5b9525263dac6844d152e40acf8cee4d27b60bc (diff)
downloadpoky-239a368d5715d8f5b7733f9400339c2350c49369.tar.gz
netbook: Correct netbook build by moving netbook configuration from moblin to meta
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Diffstat (limited to 'meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch268
1 files changed, 268 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch b/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch
new file mode 100644
index 0000000000..3eab49a49a
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-netbook-2.6.33.2/linux-2.6.34-moorestown-ipc-host-driver.patch
@@ -0,0 +1,268 @@
1From 60bb8e915a1e55c5a562e59e694d37559d62de92 Mon Sep 17 00:00:00 2001
2From: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
3Date: Mon, 3 Aug 2009 14:46:37 +0530
4Subject: [PATCH 073/104] IPC Host driver for MRSTN. It is disabled by default. This driver implements basic ioctls to support testing of IPC driver from user space. It supports Device firmware upgrade feature to be invoked by user-space application.
5
6modified: drivers/misc/Kconfig
7 modified: drivers/misc/Makefile
8 new file: drivers/misc/mrst_test_ipc/Makefile
9 new file: drivers/misc/mrst_test_ipc/ipc_module.c
10
11Signed-off-by: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
12---
13 drivers/misc/Kconfig | 9 ++
14 drivers/misc/Makefile | 1 +
15 drivers/misc/mrst_test_ipc/Makefile | 5 +
16 drivers/misc/mrst_test_ipc/ipc_module.c | 196 +++++++++++++++++++++++++++++++
17 4 files changed, 211 insertions(+), 0 deletions(-)
18 create mode 100644 drivers/misc/mrst_test_ipc/Makefile
19 create mode 100644 drivers/misc/mrst_test_ipc/ipc_module.c
20
21diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
22index feb9cd9..5a7c342 100644
23--- a/drivers/misc/Kconfig
24+++ b/drivers/misc/Kconfig
25@@ -260,6 +260,15 @@ config MRST_RAR_HANDLER
26
27 If unsure, say N.
28
29+config MRST_IPC_TEST
30+ tristate "IPC driver for testing IPC on Moorestown platform"
31+ depends on X86
32+ ---help---
33+ IPC test driver for Intel Moorestown platform
34+ Intel Moorestown platform.
35+
36+ If unsure, say N.
37+
38 config MRST_VIB
39 tristate "vibrator driver for Intel Moorestown platform"
40 help
41diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
42index 0c24f0f..bce8396 100644
43--- a/drivers/misc/Makefile
44+++ b/drivers/misc/Makefile
45@@ -14,6 +14,7 @@ obj-$(CONFIG_TIFM_CORE) += tifm_core.o
46 obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o
47 obj-$(CONFIG_PHANTOM) += phantom.o
48 obj-$(CONFIG_SGI_IOC4) += ioc4.o
49+obj-$(CONFIG_MRST_IPC_TEST) += mrst_test_ipc/
50 obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
51 obj-$(CONFIG_KGDB_TESTS) += kgdbts.o
52 obj-$(CONFIG_SGI_XP) += sgi-xp/
53diff --git a/drivers/misc/mrst_test_ipc/Makefile b/drivers/misc/mrst_test_ipc/Makefile
54new file mode 100644
55index 0000000..047d7db
56--- /dev/null
57+++ b/drivers/misc/mrst_test_ipc/Makefile
58@@ -0,0 +1,5 @@
59+
60+obj-$(CONFIG_MRST_IPC_TEST) := test_ipc_mrst.o
61+
62+test_ipc_mrst-y := ipc_module.o \
63+
64diff --git a/drivers/misc/mrst_test_ipc/ipc_module.c b/drivers/misc/mrst_test_ipc/ipc_module.c
65new file mode 100644
66index 0000000..51ef8de
67--- /dev/null
68+++ b/drivers/misc/mrst_test_ipc/ipc_module.c
69@@ -0,0 +1,196 @@
70+/*
71+ * ipc_module.c - Interface for IPC driver funtions exported by IPC driver
72+ * interfaces for Moorsetown platform.
73+ *
74+ * Copyright (C) 2009 Intel Corp
75+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+ *
77+ * This program is free software; you can redistribute it and/or modify
78+ * it under the terms of the GNU General Public License as published by
79+ * the Free Software Foundation; version 2 of the License.
80+ *
81+ * This program is distributed in the hope that it will be useful, but
82+ * WITHOUT ANY WARRANTY; without even the implied warranty of
83+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
84+ * General Public License for more details.
85+ *
86+ * You should have received a copy of the GNU General Public License along
87+ * with this program; if not, write to the Free Software Foundation, Inc.,
88+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
89+ *
90+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91+ *
92+ * This driver provides IOCTL interfaces to call IPC driver module for
93+ * Moorestown platform.
94+ *
95+ * Author: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
96+ */
97+
98+#include <linux/module.h>
99+#include <linux/kernel.h>
100+
101+#include <linux/slab.h>
102+#include <linux/fs.h>
103+#include <linux/errno.h>
104+#include <linux/types.h>
105+#include <linux/proc_fs.h>
106+#include <linux/fcntl.h>
107+#include <linux/init.h>
108+#include <linux/delay.h>
109+#include <linux/sched.h>
110+#include <linux/ioport.h>
111+
112+#include <linux/io.h>
113+#include <linux/uaccess.h>
114+#include <linux/time.h>
115+
116+#include <asm/ipc_defs.h>
117+
118+static u32 major;
119+#define MAX_FW_SIZE 264192
120+
121+int init_ipc_driver(void);
122+int ipc_ioctl(struct inode *inode, struct file *filp, u32 cmd,
123+ unsigned long arg);
124+const struct file_operations ipc_fops = {
125+ioctl:ipc_ioctl,
126+};
127+
128+
129+int ipc_ioctl(struct inode *inode, struct file *filp, u32 cmd,
130+ unsigned long arg)
131+{
132+ u32 upper = 0;
133+ struct ipc_pmic_reg_data p_read_reg_data = { 0 };
134+ struct ipc_pmic_mod_reg_data p_read_mod_reg_data = { 0 };
135+ struct ipc_pmic_reg_data p_write_reg_data = { 0 };
136+ u8 ipc_blocking_flag = TRUE;
137+
138+ int ret_val;
139+ /*Device FW upgrade support*/
140+ u8 *fw_buf = NULL ;
141+
142+ switch (cmd) {
143+ case IPC_PMIC_REGISTER_READ:
144+ {
145+ printk(KERN_INFO
146+ "ipc_driver IPC_PMIC_REGISTER_READ received\n");
147+ ret_val =
148+ copy_from_user(&p_read_reg_data,
149+ (struct ipc_pmic_reg_data *)arg,
150+ sizeof(struct ipc_pmic_reg_data));
151+ if (ret_val < 0) {
152+ printk(KERN_DEBUG
153+ "copy_from_user FAILED!! <%s> function\
154+ in <%s> file at <%d> line no\n",\
155+ __func__, __FILE__, __LINE__);
156+ return E_READ_USER_DATA;
157+ }
158+
159+ ipc_pmic_register_read(&p_read_reg_data);
160+ ret_val =
161+ copy_to_user((struct ipc_pmic_reg_data *)arg,
162+ &p_read_reg_data,
163+ sizeof(struct ipc_pmic_reg_data));
164+ break;
165+ }
166+ case IPC_PMIC_REGISTER_READ_MODIFY:
167+ {
168+ printk(KERN_INFO "ioctl\
169+ IPC_PMIC_REGISTER_READ_MODIFY received\n");
170+ ret_val =
171+ copy_from_user(&p_read_mod_reg_data,
172+ (struct ipc_pmic_mod_reg_data *)arg,
173+ sizeof(struct ipc_pmic_mod_reg_data));
174+ if (ret_val < 0) {
175+ printk(KERN_DEBUG
176+ "copy_from_user FAILED!! <%s> function\
177+ in <%s> file at <%d> line no\n",\
178+ __func__, __FILE__, __LINE__);
179+ return E_READ_USER_DATA;
180+ }
181+ ipc_pmic_register_read_modify(&p_read_mod_reg_data);
182+ ret_val =
183+ copy_to_user((struct ipc_pmic_mod_reg_data *)arg,
184+ &p_read_mod_reg_data,
185+ sizeof(struct ipc_pmic_mod_reg_data));
186+ break;
187+ }
188+ case IPC_PMIC_REGISTER_WRITE:
189+ {
190+ ret_val =
191+ copy_from_user(&p_write_reg_data,
192+ (struct ipc_pmic_reg_data *)arg,
193+ sizeof(struct ipc_pmic_reg_data));
194+ if (ret_val < 0) {
195+ printk(KERN_DEBUG
196+ "copy_from_user FAILED!! <%s> function\
197+ in <%s> file at <%d> line no\n",\
198+ __func__, __FILE__, __LINE__);
199+ return E_WRITE_USER_DATA;
200+ }
201+ ipc_pmic_register_write(&p_write_reg_data,
202+ ipc_blocking_flag);
203+ ret_val =
204+ copy_to_user((struct ipc_pmic_reg_data *)arg,
205+ &p_write_reg_data,
206+ sizeof(struct ipc_pmic_reg_data));
207+ break;
208+ }
209+ case DEVICE_FW_UPGRADE:
210+ {
211+ printk(KERN_INFO "ioctl DEVICE_FW_UPGRADE received\n");
212+ fw_buf = kmalloc(MAX_FW_SIZE, GFP_KERNEL);
213+ if (fw_buf == NULL) {
214+ printk(KERN_ERR "ipc_test: kmalloc failed! \n");
215+ return -EBUSY;
216+ }
217+ ret_val = copy_from_user(fw_buf, (u8 *)arg,
218+ MAX_FW_SIZE);
219+ if (ret_val < 0) {
220+ printk(KERN_DEBUG
221+ "copy_from_user FAILED!! <%s> function\
222+ in <%s> file at <%d> line no\n",\
223+ __func__, __FILE__, __LINE__);
224+ return -EINVAL;
225+ }
226+ ipc_device_fw_upgrade(fw_buf, MAX_FW_SIZE);
227+ break;
228+ }
229+ default:
230+ {
231+ printk(KERN_INFO
232+ "ioctl <UNRECOGNIZED> received\n");
233+ break;
234+ }
235+ }
236+ return upper;
237+}
238+
239+static int __init ipc_module_init(void)
240+{
241+ printk(KERN_INFO "Init ipc_module\n");
242+
243+ major = register_chrdev(0, "mid_ipc", &ipc_fops);
244+ if (major < 0) {
245+ printk(KERN_ERR "ipc_test : failed to get major\n");
246+ return major;
247+ }
248+
249+ init_ipc_driver ( ) ;
250+ return SUCCESS;
251+
252+}
253+
254+static void __exit ipc_module_exit(void)
255+{
256+ unregister_chrdev(major, "mid_ipc");
257+}
258+
259+module_init(ipc_module_init);
260+module_exit(ipc_module_exit);
261+
262+MODULE_LICENSE("GPL V2");
263+MODULE_DESCRIPTION("Test Driver for MRST IPC driver");
264+MODULE_AUTHOR("Sreenidhi Gurudatt")
265+
266--
2671.6.2.5
268