//#include "api_flash.h"\r
#include "rknand_base.h"\r
#include <linux/clk.h>\r
+#include <linux/cpufreq.h>\r
\r
#define DRIVER_NAME "rk29xxnand"\r
\r
-const char rknand_base_version[] = "rknand_base.c version: 4.34 20120401";\r
+const char rknand_base_version[] = "rknand_base.c version: 4.38 20120717";\r
#define NAND_DEBUG_LEVEL0 0\r
#define NAND_DEBUG_LEVEL1 1\r
#define NAND_DEBUG_LEVEL2 2\r
static char *ptrac_buf = grknand_trac_buf;\r
void trac_log(long lba,int len, int mod)\r
{\r
+ unsigned long long t;\r
+ unsigned long nanosec_rem;\r
+ t = cpu_clock(UINT_MAX);\r
+ nanosec_rem = do_div(t, 1000000000);\r
if(mod)\r
- ptrac_buf += sprintf(ptrac_buf,"W %d %d \n",lba,len);\r
+ ptrac_buf += sprintf(ptrac_buf,"[%5lu.%06lu] W %d %d \n",(unsigned long) t, nanosec_rem / 1000,lba,len);\r
else\r
- ptrac_buf += sprintf(ptrac_buf,"R %d %d \n",lba,len);\r
+ ptrac_buf += sprintf(ptrac_buf,"[%5lu.%06lu] R %d %d \n",(unsigned long) t, nanosec_rem / 1000,lba,len);\r
+}\r
+\r
+void trac_logs(char *s)\r
+{\r
+ unsigned long long t;\r
+ unsigned long nanosec_rem;\r
+ t = cpu_clock(UINT_MAX);\r
+ nanosec_rem = do_div(t, 1000000000);\r
+ ptrac_buf += sprintf(ptrac_buf,"[%5lu.%06lu] %s\n",(unsigned long) t, nanosec_rem / 1000,s);\r
}\r
\r
static int rkNand_trac_read(char *page, char **start, off_t off, int count, int *eof,\r
int len;\r
\r
len = ptrac_buf - grknand_trac_buf - off;\r
- printk("rkNand_trac_read: page=%x,off=%x,count=%x ,len=%x \n",(int)page,(int)off,count,len);\r
+ //printk("rkNand_trac_read: page=%x,off=%x,count=%x ,len=%x \n",(int)page,(int)off,count,len);\r
\r
if (len < 0)\r
len = 0;\r
if(gpNandInfo->nand_timing_config)\r
{\r
nandc_clk_rate = newclk;\r
- gpNandInfo->nand_timing_config( nandc_clk_rate / 1000); // KHz\r
+ //gpNandInfo->nand_timing_config( nandc_clk_rate / 1000); // KHz\r
}\r
}\r
return 0;\r
static int rknand_suspend(struct platform_device *pdev, pm_message_t state)\r
{\r
gpNandInfo->rknand.rknand_schedule_enable = 0;\r
+ if(gpNandInfo->rknand_suspend)\r
+ gpNandInfo->rknand_suspend(); \r
NAND_DEBUG(NAND_DEBUG_LEVEL0,"rknand_suspend: \n");\r
return 0;\r
}\r
\r
static int rknand_resume(struct platform_device *pdev)\r
{\r
+ if(gpNandInfo->rknand_resume)\r
+ gpNandInfo->rknand_resume(); \r
gpNandInfo->rknand.rknand_schedule_enable = 1;\r
NAND_DEBUG(NAND_DEBUG_LEVEL0,"rknand_resume: \n");\r
return 0;\r