view src/cs/drivers/drv_app/r2d/r2d_env.c @ 685:3fb7384e820d

tpudrv12.h: FCDEV3B goes back to being itself A while back we had the idea of a FreeCalypso modem family whereby our current fcdev3b target would some day morph into fcmodem, with multiple FC modem family products, potentially either triband or quadband, being firmware-compatible with each other and with our original FCDEV3B. But in light of the discovery of Tango modules that earlier idea is now being withdrawn: instead the already existing Tango hw is being adopted into our FreeCalypso family. Tango cannot be firmware-compatible with triband OM/FCDEV3B targets because the original quadband RFFE on Tango modules is wired in TI's original Leonardo arrangement. Because this Leonardo/Tango way is now becoming the official FreeCalypso way of driving quadband RFFEs thanks to the adoption of Tango into our FC family, our earlier idea of extending FIC's triband RFFE control signals with TSPACT5 no longer makes much sense - we will probably never produce any new hardware with that once-proposed arrangement. Therefore, that triband-or-quadband FCFAM provision is being removed from the code base, and FCDEV3B goes back to being treated the same way as CONFIG_TARGET_GTAMODEM for RFFE control purposes.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Sep 2020 21:03:08 +0000
parents 945cf7f506b2
children
line wrap: on
line source

/**
                                                                          
	@file:	r2d_env.c	
	
	@author Christophe Favergeon                              
                                                                          
    @version	0.5	

    Purpose:	Environment  for the software entity
                of Riviera 2D system (higher software layer)     
	
*/

/*
																			
 	Date       	Modification												
  ------------------------------------									
    06/02/2001	Create		
	10/18/2001  Version 0.5 for first integration with Riviera database
																											    
																			
 (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
*/


#include "rv/general.h"

#include "rvm/rvm_gen.h"
#include "rvm/rvm_ext_priorities.h"
#include "rvm/rvm_use_id_list.h"


#include "r2d/r2d.h"
#include "r2d/r2d_env.h"
#include "r2d/r2d_messages.h"
#include "r2d/uwire.h" 

#include <string.h>


extern void r2d_core(UINT32 param);

/* global pointer to the error function */
T_RVM_RETURN (*r2d_error_ft)(T_RVM_NAME swe_name, T_RVM_RETURN error_cause, \
					T_RVM_ERROR_TYPE error_type,T_RVM_STRING error_msg);



/* global addr id */
T_RVF_ADDR_ID r2d_addr_id;



/* global memory bank ID */
T_RVF_MB_ID r2d_mb_id;

/* Global standard graphical context */
T_R2D_GC_PTR r2d_g_lcd_gc=NULL;

/* For communication with the task */
T_R2D_EVT * p_msg;

extern T_RVM_RETURN r2d_initializations(void);
extern T_RVM_RETURN r2d_cleanup();
extern UINT32 r2d_get_memory_bank_size();
/******************************************************************************
* Function	  : xxx_get_info
*
* Description : This function is called by the RV manager to learn 
*				xxx requirements in terms of memory, SWEs...
*
* Parameters  : T_RVM_INFO_SWE  * swe_info: pointer to the structure to fill
*				containing infos related to the xxx SWE.
*
* Return      :  T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN r2d_get_info(T_RVM_INFO_SWE  * infoSWE)
{

	/* SWE info */
	
	memcpy ( (UINT8 *) infoSWE->type_info.type4.swe_name, "R2D", 4);
	infoSWE->swe_type = RVM_SWE_TYPE_4;
	infoSWE->type_info.type4.stack_size=R2D_STACK_SIZE;
    infoSWE->type_info.type4.priority=RVM_R2D_TASK_PRIORITY;
	infoSWE->type_info.type4.swe_use_id=R2D_USE_ID;



	
	/* memory bank info */
	infoSWE->type_info.type4.nb_mem_bank= 1;

	
	
	memcpy ((UINT8 *) infoSWE->type_info.type4.mem_bank[0].bank_name, "R2D_PRIM", 9);
	infoSWE->type_info.type4.mem_bank[0].initial_params.size          = r2d_get_memory_bank_size();
	infoSWE->type_info.type4.mem_bank[0].initial_params.watermark     = r2d_get_memory_bank_size()-1000;
	

	/* linked SWE info */
	/* this SWE does not require any SWE to run */
	infoSWE->type_info.type4.nb_linked_swe = 0;
	
	
	/* generic functions */
	infoSWE->type_info.type4.set_info=r2d_set_info;
	infoSWE->type_info.type4.init     = r2d_init;
	infoSWE->type_info.type4.stop     = r2d_stop;
	infoSWE->type_info.type4.kill     = r2d_kill;
	infoSWE->type_info.type4.core = r2d_start;


	return RVM_OK;
}


/******************************************************************************
* Function	  : xxx_set_info
*
* Description : This function is called by the RV manager to inform  
*				the xxx SWE about task_id, mb_id and error function.
*
* Parameters  : - T_RVM_TASK_ID  taskId[]: array of task_id.
*					taskId[0] contains xxx task_id.
*				- T_RVF_MB_ID mbId[]: array of memory bank ids.
*				- callback function to call in case of unrecoverable error.
*
* Return      : T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN  r2d_set_info	(	T_RVF_ADDR_ID	addr_id,
						  T_RV_RETURN	 return_path[],
								T_RVF_MB_ID		bk_id_table[],
								T_RVM_CB_FUNC	call_back_error_ft)


{

	/* store the pointer to the error function */
	r2d_error_ft = call_back_error_ft ;

	r2d_addr_id=addr_id;


	/* Store MB id */
	r2d_mb_id = bk_id_table[0];

	/* return_path of linked SWE -> not used */

	return RVM_OK;
}




/******************************************************************************
* Function	  : xxx_start
*
* Description : This function is called by the RV manager to start the xxx
*				SWE, it is the body of the task.
*
* Parameters  : None
*
* Return      : T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN r2d_start(void)
{
	/*
	** Branch to main task core
	*/
	if (r2d_g_lcd_gc!=NULL)
	{
	  r2d_erase(r2d_g_lcd_gc);
	  r2d_core(0);
	  return RV_OK;
	}
	else
		return RV_MEMORY_ERR;
}



/******************************************************************************
* Function	  : xxx_stop
*
* Description : This function is called by the RV manager to stop the xxx SWE.
*
* Parameters  : None
*
* Return      : T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN r2d_stop(void)
{
	/*
	** other SWEs have not been killed yet, xxx can send messages to other SWEs
	*/
	return RVM_OK;
}

/******************************************************************************
* Function	  : xxx_kill
*
* Description : This function is called by the RV manager to kill the xxx 
*				SWE, after the xxx_stop function has been called.
*
* Parameters  : None
*
* Return      : T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN r2d_kill (void)
{
    r2d_cleanup();
	return RV_OK;
}




/******************************************************************************
* Function	  : xxx_init
*
* Description : This function is called by the RV manager to initialize the 
*				xxx SWE before creating the task and calling xxx_start. 
*
* Parameters  : None
*
* Return      : T_RVM_RETURN
* 
* History	  : 0.1 (20-August-2000)
*									
*
******************************************************************************/
T_RVM_RETURN r2d_init(void)
{
return(r2d_initializations());
}