[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/lynq/lib/liblynq-log/include/liblog/liblog.h b/src/lynq/lib/liblynq-log/include/liblog/liblog.h
new file mode 100644
index 0000000..7a36e97
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/liblog.h
@@ -0,0 +1,140 @@
+#ifndef __LIBLOG_H__
+#define __LIBLOG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+//Log模块是否使能
+#define LOG_ENABLE              1      
+
+
+#if LOG_ENABLE
+
+#define ENABLE(X)               (1<<(X))
+
+//****************************************************************************//
+//*************************User configuration start**************************//
+//****************************************************************************//
+
+typedef enum
+{
+	LOG_VERBOSE = 0,   //从0开始,自行添加
+	LOG_ERROR,  
+	LOG_WARNING,
+	LOG_INFO,
+	LOG_DEBUG,  
+	LOG_LEVEL_MAX//不可删除
+}log_level_enum;
+
+typedef enum
+{
+  LOG_OTHERS = 0,        //从0开始,自行添加
+  LOG_MQTT,
+  LOG_SPI,
+  LOG_THREADTEST_DBUS,
+  LOG_THREADHANDLE,
+  LOG_HTTP,
+  LOG_FTP,
+  LOG_TAG_MAX,            //不可删除
+} log_tag_enum;
+
+
+typedef struct
+{
+	char open_log_level;
+	char open_module_log_num;
+	char open_module_log[LOG_TAG_MAX];
+}log_level_str;
+
+
+//Log等级全局使能                 ENABLE(LOG_VERBOSE)添加此条件控制是否只执行优先级高的:添加则为只要在模块内调用的都打印,不添加则为执行模块优先级最高的
+#define LOG_LEVEL_ENABLE      	  ENABLE(LOG_VERBOSE)
+//#define LOG_LEVEL_ENABLE        ENABLE(LOG_VERBOSE)|ENABLE(LOG_DEBUG)|ENABLE(LOG_INFO)|ENABLE(LOG_WARNING)|ENABLE(LOG_ERROR)
+
+
+//根据Tag枚举索引排序
+static unsigned int LogTagEnableInfoTable[LOG_TAG_MAX] =
+{   
+//    ENABLE(LOG_VERBOSE)|ENABLE(LOG_DEBUG)|ENABLE(LOG_INFO)|ENABLE(LOG_WARNING)|ENABLE(LOG_ERROR), 
+//	ENABLE(LOG_VERBOSE),
+//	ENABLE(LOG_VERBOSE),
+//	ENABLE(LOG_WARNING),
+};
+
+const static char * LogTagNameInfoTable[LOG_TAG_MAX] =
+{
+    "OTHERS",\
+    "MQTT",\
+    "SPI",\
+    "THREADTEST_DBUS",\
+    "THREADHANDLE",\
+    "HTTP",\
+    "FTP",
+};
+
+const static char * LogLevelNameInfoTable[LOG_LEVEL_MAX] =
+{
+    "[VERBOSE]","[ERROR]","[WARNING]","[INFO]","[DEBUG]" //lt add @2021.7.22 for []
+};
+
+#endif //LOG_ENABLE
+
+void lynq_log_global_output(log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name:		lynq_log_output
+** Description			lynq_log_output
+** Input parameters:    Tag:Tag类型(log_level_enum)
+                        Level:Tag下打印level(log_tag_enum)
+                        format:printf打印的不定长参数
+** Returned value:		None
+** Created by:		
+*********************************************************************************************************/
+void lynq_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name:		lynq_update_log_output
+** Description			ÖØÐ»ñÈ¡logµÈ¼¶²¢Ê¹ÆäÉúЧ
+** Input parameters:    Tag:TagÀàÐÍ(log_level_enum)
+                        Level:TagÏ´òÓ¡level(log_tag_enum)
+                        format:printf´òÓ¡µÄ²»¶¨³¤²ÎÊý
+** Returned value:		None
+** Created by:	
+*********************************************************************************************************/
+void lynq_update_log_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+/*********************************************************************************************************
+** Function name:		lynq_fget_log_level
+** Description			读取日志配置信息
+** Input parameters:    open_log_level:开启log日志等级
+                        open_module_log_num:开启日志模块的个数
+						open_module_log:开启日子服务的模块                 
+** Returned value:		0:成功,-1:失败
+** Created by:	
+*********************************************************************************************************/
+int lynq_read_store_log_deploy(log_level_str *log_level_read_level_str);
+
+/*********************************************************************************************************
+** Function name:		lynq_enable_log_serve
+** Description			使能日志服务
+** Input parameters:    None                
+** Returned value:		None
+** Created by:	
+*********************************************************************************************************/
+void lynq_log_printf_output(log_tag_enum Tag,log_level_enum Level,const char *format,...);
+
+
+/********************************************************************************************************
+*********************************************************************************************************/
+
+void lynq_log_configuration_set(char *log_name,char log_data_arr);
+void lynq_log_configuration_init(char *log_name);
+
+void lynq_store_log_test(void);
+void lynq_read_set_log_test(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  //__LOG_H__
diff --git a/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h b/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h
new file mode 100644
index 0000000..578800d
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/lynq_deflog.h
@@ -0,0 +1,31 @@
+#ifndef __LYNQ_DEFLOG_H__

+#define __LYNQ_DEFLOG_H__

+#include "liblog.h"

+

+#ifdef __cplusplus
+extern "C" {
+#endif

+

+#ifndef USER_LOG_TAG 

+#define LYVERBLOG(X...)  lynq_log_global_output(LOG_VERBOSE,X)

+#define LYERRLOG(X...)  lynq_log_global_output(LOG_ERROR,X)

+#define LYWARNLOG(X...)  lynq_log_global_output(LOG_WARNING,X)

+#define LYINFLOG(X...)  lynq_log_global_output(LOG_INFO,X)

+#define LYDBGLOG(X...)  lynq_log_global_output(LOG_DEBUG,X)

+#define LYLOGSET(a) lynq_log_configuration_set(USER_LOG_TAG,a)

+#define LYLOGEINIT(Y) lynq_log_configuration_init(Y)

+#else

+#define LYVERBLOG(X...)  

+#define LYERRLOG(X...)  

+#define LYWARNLOG(X...)  

+#define LYINFLOG(X...)  

+#define LYDBGLOG(X...)  

+#define LYLOGSET(a)

+#define LYLOGEINIT(Y)

+#endif

+

+#ifdef __cplusplus
+}
+#endif

+

+#endif  //__LYNQ_DEFLOG_H__
\ No newline at end of file
diff --git a/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h b/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h
new file mode 100644
index 0000000..87ef3ee
--- /dev/null
+++ b/src/lynq/lib/liblynq-log/include/liblog/lynq_nand.h
@@ -0,0 +1,18 @@
+#ifndef __LYNQ_NAND_H__

+#define __LYNQ_NAND_H__

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+

+

+int lynq_nand_store_log_message(char *log_message,size_t log_message_len);

+int lynq_nand_get_log_message(char *log_message,size_t log_message_len,off_t offset);

+int lynq_nand_read_data_test(void);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /*__LYNQ_NAND_H__*/
\ No newline at end of file