bootmode: remove build warnings
[profile/mobile/platform/kernel/u-boot-tm1.git] / property / calibration_detect.c
index e5a5614..d9902b8 100644 (file)
@@ -1,5 +1,6 @@
 #include "calibration_detect.h"
 #include <stdbool.h>
+#include <malloc.h>
 
 static unsigned int nv_buffer[256]={0};
 static int s_is_calibration_mode = 0;
@@ -38,13 +39,15 @@ typedef  struct tag_cali_command {
        unsigned char   sub_cmd;
 } COMMAND_T;
 
+extern int get_mode_from_gpio(void);
+extern int do_fs_file_read(char *mpart, char *filenm, void *buf, int len);
 extern int serial_tstc(void);
 static unsigned long long start_time;
 static unsigned long long now_time;
 
 
 
-static caliberate_device = CALIBERATE_DEVICE_NULL;
+static int caliberate_device = CALIBERATE_DEVICE_NULL;
 
 static void send_caliberation_request(void)
 {
@@ -123,14 +126,12 @@ unsigned int check_caliberate(uint8_t * buf, int len)
 
 int pctool_mode_detect_uart(void)
 {
-       int ret;
        int i ;
        unsigned int caliberate_mode;
        uint8_t buf[20];
        int got = 0;
 
        printf("%s\n", "uart calibrate detecting");
-       loff_t off = 0;
        send_caliberation_request();
 
 #ifdef CONFIG_MODEM_CALIBERATE
@@ -138,7 +139,7 @@ int pctool_mode_detect_uart(void)
                buf[i] = i + 'a';
 
        start_time = get_timer_masked();
-        printf("uart calibrate configuration start_time=%d\n", start_time);
+        printf("uart calibrate configuration start_time=%llu\n", start_time);
        while (1) {
                got = receive_caliberation_response(buf, sizeof(buf));
                if (caliberate_device == CALIBERATE_DEVICE_UART)
@@ -247,11 +248,12 @@ int check_pctool_cmd(uint8_t* buf, int len)
        return command;
 }
 
-extern int power_button_pressed(void);
 static int count_ms;
 static unsigned long long start_time;
 static unsigned long long now_time;
 
+#if 0
+extern int power_button_pressed(void);
 static int recheck_power_button(void)
 {
     int cnt = 0;
@@ -270,6 +272,8 @@ static int recheck_power_button(void)
         }
     }while(1);
 }
+#endif
+
 int is_timeout(void)
 {
 
@@ -307,7 +311,7 @@ void cali_usb_debug(uint8_t *buf)
                        if(usb_trans_status)
                                                printf("func: %s line %d usb trans with error %d\n", __func__, __LINE__, usb_trans_status);
                        ret = gs_read(buf, &count);
-                       printf("func: %s readly read %d\n", __func__, count);
+                       printf("func: %s readly read %d ret(%d)\n", __func__, count, ret);
                        if(usb_trans_status)
                                printf("func: %s line %d usb trans with error %d\n", __func__, __LINE__, usb_trans_status);
                        for(i = 0; i<count; i++)
@@ -317,9 +321,8 @@ void cali_usb_debug(uint8_t *buf)
 
 #endif
 }
-int cali_usb_prepare()
+int cali_usb_prepare(void)
 {
-       int ret = 0;
        usb_in_cal(1);
        if(dwc_otg_driver_init() < 0)
                {
@@ -333,7 +336,7 @@ int cali_usb_prepare()
                }
        return 1;
 }
-int cali_usb_enum()
+int cali_usb_enum(void)
 {
        int ret = 0;
        count_ms = get_cal_enum_ms();
@@ -449,7 +452,6 @@ int translate_packet(char *dest,char *src,int size)
 
 int prepare_reply_buf(uint8_t* buf, int status)
 {
-    int ret = 0;
     char *rsp_ptr;
     MSG_HEAD_T* msg_head_ptr;
     TOOLS_DIAG_AP_CNF_T* aprsp;
@@ -474,7 +476,7 @@ int prepare_reply_buf(uint8_t* buf, int status)
     aprsp->status = status;
     aprsp->length = CALIBERATE_CNF_LEN;
 
-    total_len = translate_packet((unsigned char*)pctool_cnf_buf,(unsigned char*)rsp_ptr,((MSG_HEAD_T*)rsp_ptr)->len);
+    total_len = translate_packet((char*)pctool_cnf_buf,(char*)rsp_ptr,((MSG_HEAD_T*)rsp_ptr)->len);
     free(rsp_ptr);
     return total_len;
 }
@@ -483,8 +485,7 @@ int pctool_mode_detect(void)
 {
 
        int ret , command;
-       unsigned int caliberate_mode;
-       loff_t off = 0;
+
         printf("%s\n", "uart cooperating with pc tool");
         if(get_mode_from_gpio())
              return pctool_mode_detect_uart();