/**
* @file icss_pruInit.h
*
* @brief Include file for PRU Init functions
*
* \par
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
* \par
*/
#ifndef _ICSS_PRUINIT_H_
#define _ICSS_PRUINIT_H_

/**
* @def INTERFACE_MAC
*      Interface macid index
*/
#define INTERFACE_MAC 0
/**
* @def PORT1_MAC
*      Port1 macid index
*/
#define PORT1_MAC	  1
/**
* @def PORT2_MAC
*      Port2 macid index
*/
#define PORT2_MAC	  2
/**
* @def STATIC_FORWARD_TABLE
*      Load Forward table
*/
#define STATIC_FORWARD_TABLE 0
/**
* @def STATIC_RECEIVE_TABLE
*      Load receive table
*/
#define STATIC_RECEIVE_TABLE 1

/**
* @brief ICSS port Ioctl command
*
*/
enum t_portCmd {PORT_ENABLE = 0,	/**Enable Port*/
	            PORT_DISABLE};		/**Disabel Port*/
/**
* @brief ICSS port Ioctl port number
*
*/
enum t_portNum {ICSSPORT1 = 0,		/**Port 1*/
	           ICSSPORT2};			/**Port 2*/


/**Interface Macid*/
extern Uint8 ifMAC[];

/**
* @brief  Function to enables the PRU's and start the switch
*
* @retval 0 on success
*/
Int8 StartSwitch(void);

/**
* @brief  Function disable the prus and stops the switch
*
* @retval 0 on success
*/
Int8 StopSwitch(void);
/**
* @brief  Function to initialize and configure ICSS
*
* @retval 0 on success
*/
Int8 ICSSSwitchInit();
/**
* @brief   API to load firmware to PRU
*
* @param firmware_load start address of firmware to be loaded
* @param firmware_length size of firmware
* @param pruinst the pru to which firmware is to be loaded
*
* @retval success(0) or failure (<0)
*/
Int8 LoadPruFirmware(unsigned int * firmware_load,unsigned int firmware_length,unsigned int pruinst);
/**
* @brief  function to enable and disable Physical ports
*
* @param port port number
* @param command  whether disable or enable
*
* @retval 0 on success
*/
Int8 ICSSIoctl(enum t_portNum port, enum t_portCmd command);
/**
* @brief   This function returns the MAC address for the EVM
* @details This is a copy of the starterware code but writes the bytes
*			in reverse order to match PRU-ICSS switch
*     	 	Currently we read the second MAC address stored in the
*      		device in order to reserve first one for other ports.
*
* @param addrIdx the MAC address index.
* @param macAddr the Pointer where the MAC address shall be stored
*
* @retval none
*/
void SocMACAddrGet(unsigned int addrIdx, unsigned char *macAddr);
/**
* @brief   Loads multicast static table to ICSS memory
*
* @param staticTable	 		start address of the static table
* @param staticTableLength	length of the static table
* @param staticTableType	type of static table
* 			'static_table_type' can take one of the below values. \n
*			0 - Forward Table
*			1 - Receive Table
* @param portNumber Portnumber
*
* @retval success(0) or failure (<0)
*/
Int32 LoadStaticTable(const unsigned int * staticTable, Uint8 staticTableLength, Uint8 staticTableType, Uint8 portNumber);

#endif /* _ICSS_PRUINIT_H_ */



