changeset 165:9dbf3248a197

starting to compile ETM
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 19 Nov 2013 04:23:29 +0000
parents d78219c43fbf
children 13af69b6a3dc
files gsm-fw/riviera/rvf/rvf_pool_size.h gsm-fw/services/etm/Makefile gsm-fw/services/etm/etm.h gsm-fw/services/etm/etm_api.c gsm-fw/services/etm/etm_api.h gsm-fw/services/etm/etm_at.h gsm-fw/services/etm/etm_config.h gsm-fw/services/etm/etm_env.h gsm-fw/services/etm/etm_messages_i.h gsm-fw/services/etm/etm_misc.h gsm-fw/services/etm/etm_trace.h
diffstat 11 files changed, 102 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/riviera/rvf/rvf_pool_size.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/riviera/rvf/rvf_pool_size.h	Tue Nov 19 04:23:29 2013 +0000
@@ -166,7 +166,7 @@
  * ETM SWE
  */
 #ifdef RVM_ETM_SWE
-  #include "etm/etm_pool_size.h"
+  #include "../../services/etm/etm_pool_size.h"
   #define RVF_ETM_POOL_SIZE  (ETM_POOL_SIZE)
 #else
   #define RVF_ETM_POOL_SIZE  (0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/services/etm/Makefile	Tue Nov 19 04:23:29 2013 +0000
@@ -0,0 +1,18 @@
+CC=	arm-elf-gcc
+CFLAGS=	-O2 -fno-builtin -mthumb-interwork -mthumb
+LD=	arm-elf-ld
+
+OBJS=	etm_api.o
+
+HDRS=	etm.h etm_api.h etm_at.h etm_audio_err.h etm_config.h etm_env.h \
+	etm_messages_i.h etm_misc.h etm_pool_size.h etm_trace.h etm_version.h
+
+all:	xipcode.o
+
+${OBJS}:	${HDRS}
+
+xipcode.o:	${OBJS}
+	${LD} -r -o $@ ${OBJS}
+
+clean:
+	rm -f *.[oa] *errs
--- a/gsm-fw/services/etm/etm.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm.h	Tue Nov 19 04:23:29 2013 +0000
@@ -52,7 +52,7 @@
     ETM_RESERVED11 = 0x0E,
     ETM_RESERVED12 = 0x0F,
 
- ETM_CUST      = 0xC0, // Customize id
+    ETM_CUST       = 0xC0, // Customize id
     ETM_CUST1      = 0xC1, // Customize id
     ETM_CUST2      = 0xC2, // Customize id
     ETM_CUST3      = 0xC3, // Customize id
@@ -80,7 +80,7 @@
     ETM_IMEI_ERROR   = -100 * ETM_IMEI,
     ETM_PWR_ERROR    = -100 * ETM_PWR,
     ETM_BT_ERROR     = -100 * ETM_BT,
-	ETM_FFS_ERROR    = -100 * ETM_FFS2, 
+    ETM_FFS_ERROR    = -100 * ETM_FFS2, 
 
     ETM_TEST_ERROR   = -100 * ETM_TEST, // used for test of dll's
 
--- a/gsm-fw/services/etm/etm_api.c	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_api.c	Tue Nov 19 04:23:29 2013 +0000
@@ -19,14 +19,14 @@
  *********************************************************************************/
 
 
-#include "etm/etm.h"
-#include "etm/etm_env.h"
-#include "etm/etm_messages_i.h"
-#include "etm/etm_trace.h"
+#include "etm.h"
+#include "etm_env.h"
+#include "etm_messages_i.h"
+#include "etm_trace.h"
 
-#include "etm/etm_misc.h"
+#include "etm_misc.h"
 
-#include "rvf/rvf_api.h"
+#include "../../riviera/rvf/rvf_api.h"
 
 #include <string.h> 
 
@@ -44,15 +44,17 @@
  *			the return value of rvf_send_msg otherwise.
  *********************************************************************************/
 
-int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback)
+int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id,
+		 ETM_CALLBACK_FUNC callback)
 {
-	/* Type for a registration event. */
-	T_ETM_REGISTER_REQ *etm_registration_p;
+    /* Type for a registration event. */
+    T_ETM_REGISTER_REQ *etm_registration_p;
 
-	tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name);
+    tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name);
 
     /* Allocate the memory for the message to send */
-    if ((etm_registration_p = (T_ETM_REGISTER_REQ*) etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL)
+    if ((etm_registration_p = (T_ETM_REGISTER_REQ*)
+				etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL)
             return ETM_NOMEM; 
 
     /* Fill the message id */
@@ -65,22 +67,21 @@
 
     /* Fill the message parameters */
     memcpy(etm_registration_p->name, name, strlen(name));
-	etm_registration_p->mid              = mid;
-	etm_registration_p->task_id          = task_id;
-	etm_registration_p->addr_id          = addr_id;
-	etm_registration_p->rx_callback_func = callback; 
+    etm_registration_p->mid              = mid;
+    etm_registration_p->task_id          = task_id;
+    etm_registration_p->addr_id          = addr_id;
+    etm_registration_p->rx_callback_func = callback; 
 
-	/* Send the message using mailbox. */
-	return rvf_send_msg(etm_env_ctrl_blk->addr_id,
-						(void*) etm_registration_p);
+    /* Send the message using mailbox. */
+    return rvf_send_msg(etm_env_ctrl_blk->addr_id, (void*) etm_registration_p);
 }
 
 
 /********************************************************************************
- * Cleans ETM register tables, i.e. set/clean the variable at their initialization
- * state for a specific entity.
- * This function can be used to reinitialize ETM register database without having to
- * start/stop it.
+ * Cleans ETM register tables, i.e. set/clean the variable at their
+ * initialization state for a specific entity.
+ * This function can be used to reinitialize ETM register database without
+ * having to start/stop it.
  *
  * This is a bridge function. It sends ETM_UNREGISTER message to ETM.
  *
@@ -90,13 +91,14 @@
 
 int etm_unregister(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback)
 {
-	/* Type for a start input event. */
-	T_ETM_UNREGISTER *etm_unregister_p;
-    
-	tr_etm(TgTrEtmLow, "ETM API: _unregister bridge function");
-    
+    /* Type for a start input event. */
+    T_ETM_UNREGISTER *etm_unregister_p;
+
+    tr_etm(TgTrEtmLow, "ETM API: _unregister bridge function");
+
     /* Allocate the memory for the message to send */
-    if ((etm_unregister_p = (T_ETM_UNREGISTER*) etm_malloc(sizeof(T_ETM_UNREGISTER))) == NULL)
+    if ((etm_unregister_p = (T_ETM_UNREGISTER*)
+				etm_malloc(sizeof(T_ETM_UNREGISTER))) == NULL)
             return ETM_NOMEM; 
 
     /* Fill the message id */
@@ -109,14 +111,13 @@
 
     /* Fill the message parameters */
     memcpy(etm_unregister_p->name, name, strlen(name));
-	etm_unregister_p->mid              = mid;
-	etm_unregister_p->task_id          = task_id;
-	etm_unregister_p->addr_id          = addr_id;
-	etm_unregister_p->rx_callback_func = callback;
+    etm_unregister_p->mid              = mid;
+    etm_unregister_p->task_id          = task_id;
+    etm_unregister_p->addr_id          = addr_id;
+    etm_unregister_p->rx_callback_func = callback;
 
-	/* Send the message using mailbox. */
-	return rvf_send_msg(etm_env_ctrl_blk->addr_id,
-						(void*) etm_unregister_p);
+    /* Send the message using mailbox. */
+    return rvf_send_msg(etm_env_ctrl_blk->addr_id, (void*) etm_unregister_p);
 }
 
 
@@ -142,7 +143,7 @@
 
 int etm_get16(void *buf)
 {
-   unsigned char *p = buf;
+    unsigned char *p = buf;
 
     int value =
         (*p++ | (*p << 8));
@@ -277,4 +278,3 @@
 
     return error;
 }
-
--- a/gsm-fw/services/etm/etm_api.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_api.h	Tue Nov 19 04:23:29 2013 +0000
@@ -22,8 +22,8 @@
 #ifndef __ETM_API_H_
 #define __ETM_API_H_
 
-#include "etm/etm_misc.h"
-#include "etm/etm_messages_i.h"
+#include "etm_misc.h"
+#include "etm_messages_i.h"
 
 /******************************************************************************
  * ETM Packet
@@ -33,7 +33,6 @@
     T_RV_HDR  header;
     char      size;
     uint8     data[255];
-    
 } T_ETM_MAIL;
 
 
@@ -47,7 +46,6 @@
 {
     T_RV_HDR  header;
     char      data[255];
-    
 } T_ETM_DATA_READY;
 
 
--- a/gsm-fw/services/etm/etm_at.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_at.h	Tue Nov 19 04:23:29 2013 +0000
@@ -20,7 +20,7 @@
 #ifndef __ETM_AT_H_
 #define __ETM_AT_H_
 
-#include "etm/etm_env.h" // Need because use of T_ETM_ENV_CTRL_BLK 
+#include "etm_env.h" // Need because use of T_ETM_ENV_CTRL_BLK 
 
 
 /** External ref "global variables" structure. */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/services/etm/etm_config.h	Tue Nov 19 04:23:29 2013 +0000
@@ -0,0 +1,12 @@
+/*
+ * This header file is a FreeCalypso addition.  Here we define a few
+ * C preprocessor symbols controlling which parts of ETM are to be
+ * included; we are going to enable these pieces as we get ready to
+ * integrate them.
+ */
+
+#include "../../include/config.h"
+
+#define	ETM_ATP_SUPPORT		0
+#define	ETM_AUDIO_SUPPORT	0
+#define	ETM_LCC_SUPPORT		0
--- a/gsm-fw/services/etm/etm_env.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_env.h	Tue Nov 19 04:23:29 2013 +0000
@@ -5,7 +5,8 @@
  * Declarations of the Riviera Generic Functions 
  * (except handle message and handle timer).
  *
- * @author	aurent Sollier (l-sollier@ti.com) and Kim T. Peteren (ktp@ti.com)
+ * @author	Laurent Sollier (l-sollier@ti.com) and
+ *		Kim T. Peteren (ktp@ti.com)
  * @version 0.1
  *
 
@@ -23,8 +24,8 @@
 #ifndef _ETM_ENV_H_
 #define _ETM_ENV_H_
 
-#include "rvm/rvm_gen.h"
-#include "etm/etm_pool_size.h"	/* Stack & Memory Bank sizes definitions */
+#include "../../riviera/rvm/rvm_gen.h"
+#include "etm_pool_size.h"	/* Stack & Memory Bank sizes definitions */
 
 /**
  * Mailbox ID used by the SWE.
@@ -46,9 +47,9 @@
  */
 typedef struct ctrl_blk
 {
-    T_RVF_MB_ID		prim_id;
-    T_RVF_ADDR_ID	addr_id;
-    T_RVM_RETURN	(*error_ft)(T_RVM_NAME        swe_name, 
+    T_RVF_MB_ID	    prim_id;
+    T_RVF_ADDR_ID   addr_id;
+    T_RVM_RETURN    (*error_ft)(T_RVM_NAME        swe_name, 
                                 T_RVM_RETURN      error_cause,
                                 T_RVM_ERROR_TYPE  error_type,
                                 T_RVM_STRING      error_msg);
--- a/gsm-fw/services/etm/etm_messages_i.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_messages_i.h	Tue Nov 19 04:23:29 2013 +0000
@@ -25,8 +25,8 @@
 #ifndef _ETM_MESSAGES_I_H_
 #define _ETM_MESSAGES_I_H_
 
-#include "rv/rv_general.h"
-#include "rvm/rvm_use_id_list.h"
+#include "../../riviera/rv/rv_general.h"
+#include "../../riviera/rvm/rvm_use_id_list.h"
 
 
 typedef int (*ETM_CALLBACK_FUNC)(uint8*, int);
@@ -63,12 +63,12 @@
     /** Message header. */
     T_RV_HDR  header;
 
-    /** Magic key sequence informations. */
+    /** ETM specifics. */
     char                name[ETM_NAME_MAX_LEN];
     int                 mid;
-	int                 task_id;
+    int                 task_id;
     T_RVF_ADDR_ID       addr_id;
-	ETM_CALLBACK_FUNC	rx_callback_func;
+    ETM_CALLBACK_FUNC	rx_callback_func;
 
 }  T_ETM_REGISTER_REQ;
 /*@}*/
@@ -91,12 +91,12 @@
 {
     /** Message header. */
     T_RV_HDR  header;
-    /** Magic key sequence informations. */
+    /** ETM specifics. */
     char                name[ETM_NAME_MAX_LEN];
     int                 mid;
-	int                 task_id;
+    int                 task_id;
     T_RVF_ADDR_ID       addr_id;      
-	ETM_CALLBACK_FUNC	rx_callback_func;
+    ETM_CALLBACK_FUNC	rx_callback_func;
     
 }  T_ETM_UNREGISTER;
 /*@}*/
@@ -120,7 +120,7 @@
     /** Message header. */
     T_RV_HDR  header;
 
-    /** Magic key sequence informations. */
+    /** ETM specifics. */
     int          size;
     char         mid;
     uint8        data[255];
@@ -146,7 +146,7 @@
 {
     /** Message header. */
     T_RV_HDR  header;
-    /** Magic key sequence informations. */
+    /** ETM specifics. */
     int          size;
     char         cid;
     uint8        data[255];
--- a/gsm-fw/services/etm/etm_misc.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_misc.h	Tue Nov 19 04:23:29 2013 +0000
@@ -25,28 +25,19 @@
  * Usefull Header 
  *****************************************************************************/
 
-#ifndef _WINDOWS
-#include "swconfig.cfg"
-#include "sys.cfg"
-#include "chipset.cfg"
-//#include "testmode.cfg"
-#endif
+#include "etm_config.h"
 
-#include "l1_confg.h"
+#include "../../L1/include/l1_confg.h"
 
 /* Riviera useful header */
-#include "rv/rv_general.h"
-#include "rvm/rvm_gen.h"
-#include "rvf/rvf_target.h"
-#include "rvf/rvf_api.h"
-#include "rvt/rvt_gen.h"
+#include "../../riviera/rv/rv_general.h"
+#include "../../riviera/rvm/rvm_gen.h"
+#include "../../riviera/rvf/rvf_target.h"
+#include "../../riviera/rvf/rvf_api.h"
+#include "../../riviera/rvt/rvt_gen.h"
 
-
+#if 0	// FreeCalypso
 /* include the usefull L1 header */
-#ifdef _WINDOWS
-#define BOOL_FLAG
-#define CHAR_FLAG
-#endif
 
 #include "l1_types.h"
 #include "l1audio_const.h"
@@ -68,19 +59,16 @@
 #include "l1_msgty.h"
 #include "l1_signa.h"
 
-#ifdef _WINDOWS
-#define L1_ASYNC_C
-#endif
-
 #include "l1_varex.h"
 
+#endif
 
 /******************************************************************************
  * Defines 
  *****************************************************************************/
 
 #define TM3_PACKET_SIZE 128
-#define ETM_PACEKT_SIZE 256
+#define ETM_PACKET_SIZE 256
 
 // This is the return TM3 packet structure
 // HACK! - taken from l1tm_msgty.h
@@ -101,7 +89,7 @@
     int index;           // index into data[] - for put()/get() functions
     unsigned char  mid;
     unsigned char  status;
-    unsigned char  data[ETM_PACEKT_SIZE]; // include cksum
+    unsigned char  data[ETM_PACKET_SIZE]; // include cksum
 } T_ETM_PKT;
 
 
--- a/gsm-fw/services/etm/etm_trace.h	Mon Nov 18 06:39:44 2013 +0000
+++ b/gsm-fw/services/etm/etm_trace.h	Tue Nov 19 04:23:29 2013 +0000
@@ -20,7 +20,7 @@
 #ifndef _ETM_TRACE_H_
 #define _ETM_TRACE_H_
 
-#include "etm/etm.h"
+#include "etm.h"
 
 void tr_etm(unsigned trmask, char *format, ...);
 void tr_etm_hexdump(unsigned int mask, const void *p, int size);