diff --git a/ti/runtime/netapi/tools/module/netapimod.c b/ti/runtime/netapi/tools/module/netapimod.c
-/*
- * File name: netapi_mod.c
- *
- * Description: NETAPI utility module.
- *
- * Copyright (C) 2011 Texas Instruments, Incorporated
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
- * whether express or implied; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/proc_fs.h>
-
-#include <linux/version.h>
-#include <linux/unistd.h>
-#include <asm/unistd.h>
-#include <linux/wait.h>
-#include <linux/sched.h>
-#include <linux/timer.h>
-#include <linux/string.h>
-#include <linux/if.h>
-
-#include <asm/irq.h>
-#include <linux/clk.h>
-
-#include <asm/mach/map.h>
-
-#include <mach/vmalloc.h>
-#include <mach/common.h>
-#include <mach/time.h>
-#include <mach/cputype.h>
-#include <mach/psc.h>
-#include <mach/cp_intc.h>
-#include <mach/irqs.h>
-#include <mach/gpio.h>
-#include <mach/hardware.h>
-#include <mach/cp_intd.h>
-#include <mach/tci6614.h>
-
-
-
-#define NETAPIMOD_DEBUG
-
-#ifdef NETAPIMOD_DEBUG
-# define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
-#else
-# define DPRINTK(fmt, args...)
-#endif
-
-
-
-//extern long davinci_ck_get_arm_rate(void);
-static void MPU_Enable_userModeAccess(void)
-{
- unsigned int reg_addr,i,count,defRegVal;
- void __iomem * temp_reg;
- defRegVal = 0x3FFFFFF;
- reg_addr = 0x2368208;
- count = 5;
-
- for(i=1;i<=count;i++)
- {
- temp_reg= ioremap(reg_addr, 4);
- __raw_writel(defRegVal, temp_reg) ;
- iounmap(temp_reg);
- //*((unsigned int*)(reg_addr)) = defRegVal;
- reg_addr = reg_addr + 0x10;
- }
-
- reg_addr = 0x2370208;
- count = 16;
-
- for(i=1;i<=count;i++)
- {
- temp_reg= ioremap(reg_addr, 4);
- __raw_writel(defRegVal,temp_reg) ;
- iounmap(temp_reg);
- // *((unsigned int*)(reg_addr)) = defRegVal;
- reg_addr = reg_addr + 0x10;
- }
-
-
- reg_addr = 0x2378208;
- count = 1;
-
- for(i=1;i<=count;i++)
- {
- temp_reg= ioremap(reg_addr, 4);
- __raw_writel(defRegVal, temp_reg) ;
- iounmap(temp_reg);
-
-// *((unsigned int*)(reg_addr)) = defRegVal;
- reg_addr = reg_addr + 0x10;
- }
-}
-
-/*********************************************************************************
-* FUNCTION: netapi_init_proc
-*
-**********************************************************************************
-*
-* DESCRIPTION: Forms output for /proc/netapi file
-*********************************************************************************/
-static int netapi_init_proc(char *buf, char **start, off_t offset,
- int count, int *eof, void *data)
-{
- unsigned long val;
- int len=0;
- struct clk *clk = clk_get((struct device *) NULL,"main_div_chip_clk1");
-
- //enable user access to qmss h/w
- MPU_Enable_userModeAccess();
-
- //pmcr <- single clock, reset, enable
- val = 0x4|0x1;
- asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));
-
- //userenr <- enable user space access [this won't work from user space obviously!]
- val = 1;
- asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r"(val));
-
- //start things
- val = 0x80000000;
- asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(val));
-
- len += sprintf(buf + len, "netapi proc entry\n");
- len += sprintf(buf + len, "===========================\n");
- len += sprintf(buf + len, "enabled PMU for user space\n");
- asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(val));
- len += sprintf(buf + len,"current ccnt = %d\n", val);
- len += sprintf(buf + len,"arm cpu freq = %d \n", clk? (int) clk_get_rate(clk): -1);
- //len += sprintf(buf + len,"arm cpu freq = %d %d\n", davinci_ck_get_arm_rate(),clk? (int) clk_get_rate(clk): -1);
- *eof = 1;
-
- return len;
-}
-
-
-/*********************************************************************************
-* FUNCTION: netapi_stats_proc
-*
-**********************************************************************************
-*
-* DESCRIPTION: Forms output for /proc/netapi_stats file
-*********************************************************************************/
-static int netapi_stats_proc(char *buf, char **start, off_t offset,
- int count, int *eof, void *data)
-{
-
- int len = 0;
- len += sprintf(buf + len, "NETAPI Stats:\n");
- len += sprintf(buf + len, "=============================================\n");
- len += sprintf(buf + len, "...coming...\n");
- *eof = 1;
- return len;
-}
-
-
-/*********************************************************************************
-* FUNCTION: netapimod_init_module
-*
-* DESCRIPTION:Initialization routine for netapi kernel device
-*********************************************************************************/
-static int __init netapimod_init_module(void)
-{
- void * priv = NULL;
-
- DPRINTK("netapimod_init_module: init\n");
-
- create_proc_read_entry("netapi", 0, NULL, netapi_init_proc, (void *)priv);
- // create_proc_read_entry("netapi_stats", 0, NULL, netapi_stats_proc, (void *)priv);
-
- //enable user access to qmss h/w
- MPU_Enable_userModeAccess();
-
- DPRINTK("NETAPI module loaded \n");
- return 0;
-}
-
-/*********************************************************************************
- * FUNCTION: netapimod_cleanup_module
- *
- * DESCRIPTION:
- *********************************************************************************/
-static void __exit netapimod_cleanup_module(void)
-{
- /* need to remove proc entries, etc */
- DPRINTK("netapi module unloaded\n");
- return;
-}
-
-module_init(netapimod_init_module);
-module_exit(netapimod_cleanup_module);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Texas Instruments Incorporated");
-MODULE_DESCRIPTION("TI NETAPI core module.");
-MODULE_SUPPORTED_DEVICE("Texas Instruments netapi");
-
-
+/*\r
+ * File name: netapi_mod.c\r
+ *\r
+ * Description: NETAPI utility module.\r
+ *\r
+ * Copyright (C) 2011 Texas Instruments, Incorporated\r
+ * \r
+ * This program is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License as published by the\r
+ * Free Software Foundation version 2.\r
+ *\r
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,\r
+ * whether express or implied; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * General Public License for more details.\r
+ */\r
+\r
+#include <linux/init.h>\r
+#include <linux/module.h>\r
+#include <linux/kernel.h>\r
+#include <linux/proc_fs.h>\r
+\r
+#include <linux/version.h>\r
+#include <linux/unistd.h>\r
+#include <asm/unistd.h>\r
+#include <linux/wait.h>\r
+#include <linux/sched.h>\r
+#include <linux/timer.h>\r
+#include <linux/string.h>\r
+#include <linux/if.h>\r
+\r
+#include <asm/irq.h>\r
+#include <linux/clk.h>\r
+\r
+#include <asm/mach/map.h>\r
+\r
+#include <mach/vmalloc.h>\r
+#include <mach/common.h>\r
+#include <mach/time.h>\r
+#include <mach/cputype.h>\r
+#include <mach/psc.h>\r
+#include <mach/cp_intc.h>\r
+#include <mach/irqs.h>\r
+#include <mach/gpio.h>\r
+#include <mach/hardware.h>\r
+#include <mach/cp_intd.h>\r
+#include <mach/tci6614.h>\r
+\r
+\r
+\r
+#define NETAPIMOD_DEBUG \r
+\r
+#ifdef NETAPIMOD_DEBUG\r
+# define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)\r
+#else\r
+# define DPRINTK(fmt, args...)\r
+#endif\r
+\r
+\r
+\r
+//extern long davinci_ck_get_arm_rate(void);\r
+static void MPU_Enable_userModeAccess(void)\r
+{\r
+ unsigned int reg_addr,i,count,defRegVal;\r
+ void __iomem * temp_reg;\r
+ defRegVal = 0x3FFFFFF;\r
+ reg_addr = 0x2368208;\r
+ count = 5; \r
+ \r
+ for(i=1;i<=count;i++)\r
+ {\r
+ temp_reg= ioremap(reg_addr, 4);\r
+ __raw_writel(defRegVal, temp_reg) ;\r
+ iounmap(temp_reg);\r
+ //*((unsigned int*)(reg_addr)) = defRegVal;\r
+ reg_addr = reg_addr + 0x10;\r
+ }\r
+ \r
+ reg_addr = 0x2370208;\r
+ count = 16; \r
+ \r
+ for(i=1;i<=count;i++)\r
+ {\r
+ temp_reg= ioremap(reg_addr, 4);\r
+ __raw_writel(defRegVal,temp_reg) ;\r
+ iounmap(temp_reg);\r
+ // *((unsigned int*)(reg_addr)) = defRegVal;\r
+ reg_addr = reg_addr + 0x10;\r
+ }\r
+ \r
+ \r
+ reg_addr = 0x2378208;\r
+ count = 1; \r
+ \r
+ for(i=1;i<=count;i++)\r
+ {\r
+ temp_reg= ioremap(reg_addr, 4);\r
+ __raw_writel(defRegVal, temp_reg) ;\r
+ iounmap(temp_reg);\r
+\r
+// *((unsigned int*)(reg_addr)) = defRegVal;\r
+ reg_addr = reg_addr + 0x10;\r
+ }\r
+}\r
+\r
+/*********************************************************************************\r
+* FUNCTION: netapi_init_proc\r
+*\r
+**********************************************************************************\r
+*\r
+* DESCRIPTION: Forms output for /proc/netapi file\r
+*********************************************************************************/\r
+static int netapi_init_proc(char *buf, char **start, off_t offset,\r
+ int count, int *eof, void *data)\r
+{\r
+ unsigned long val;\r
+ int len=0;\r
+ struct clk *clk = clk_get((struct device *) NULL,"main_div_chip_clk1"); \r
+ \r
+ //enable user access to qmss h/w\r
+ MPU_Enable_userModeAccess(); \r
+\r
+ //pmcr <- single clock, reset, enable\r
+ val = 0x4|0x1;\r
+ asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));\r
+\r
+ //userenr <- enable user space access [this won't work from user space obviously!]\r
+ val = 1;\r
+ asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r"(val));\r
+\r
+ //start things \r
+ val = 0x80000000;\r
+ asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(val));\r
+\r
+ len += sprintf(buf + len, "netapi proc entry\n");\r
+ len += sprintf(buf + len, "===========================\n");\r
+ len += sprintf(buf + len, "enabled PMU for user space\n");\r
+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(val));\r
+ len += sprintf(buf + len,"current ccnt = %d\n", val);\r
+ len += sprintf(buf + len,"arm cpu freq = %d \n", clk? (int) clk_get_rate(clk): -1);\r
+ //len += sprintf(buf + len,"arm cpu freq = %d %d\n", davinci_ck_get_arm_rate(),clk? (int) clk_get_rate(clk): -1);\r
+ *eof = 1;\r
+ \r
+ return len;\r
+}\r
+\r
+\r
+/*********************************************************************************\r
+* FUNCTION: netapi_stats_proc\r
+*\r
+**********************************************************************************\r
+*\r
+* DESCRIPTION: Forms output for /proc/netapi_stats file\r
+*********************************************************************************/\r
+static int netapi_stats_proc(char *buf, char **start, off_t offset,\r
+ int count, int *eof, void *data)\r
+{\r
+ \r
+ int len = 0;\r
+ len += sprintf(buf + len, "NETAPI Stats:\n");\r
+ len += sprintf(buf + len, "=============================================\n");\r
+ len += sprintf(buf + len, "...coming...\n");\r
+ *eof = 1;\r
+ return len;\r
+}\r
+\r
+\r
+/*********************************************************************************\r
+* FUNCTION: netapimod_init_module\r
+*\r
+* DESCRIPTION:Initialization routine for netapi kernel device\r
+*********************************************************************************/\r
+static int __init netapimod_init_module(void)\r
+{\r
+ void * priv = NULL; \r
+ \r
+ DPRINTK("netapimod_init_module: init\n");\r
+\r
+ create_proc_read_entry("netapi", 0, NULL, netapi_init_proc, (void *)priv);\r
+ // create_proc_read_entry("netapi_stats", 0, NULL, netapi_stats_proc, (void *)priv);\r
+\r
+ //enable user access to qmss h/w\r
+ MPU_Enable_userModeAccess();\r
+\r
+ DPRINTK("NETAPI module loaded \n");\r
+ return 0;\r
+}\r
+\r
+/*********************************************************************************\r
+ * FUNCTION: netapimod_cleanup_module\r
+ *\r
+ * DESCRIPTION:\r
+ *********************************************************************************/\r
+static void __exit netapimod_cleanup_module(void)\r
+{\r
+ /* need to remove proc entries, etc */\r
+ DPRINTK("netapi module unloaded\n");\r
+ return;\r
+}\r
+\r
+module_init(netapimod_init_module);\r
+module_exit(netapimod_cleanup_module);\r
+\r
+MODULE_LICENSE("GPL v2");\r
+MODULE_AUTHOR("Texas Instruments Incorporated");\r
+MODULE_DESCRIPTION("TI NETAPI core module.");\r
+MODULE_SUPPORTED_DEVICE("Texas Instruments netapi");\r
+\r
+\r