/**
 * \file   plat_cpsw.h
 *
 *  \brief 
 *
*/
/*
 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
 */

#ifndef _PLAT_CPSW_H
#define _PLAT_CPSW_H
/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */
#include "hw_types.h"
#include "soc_AM335x.h"
#include "hw_control_AM335x.h"

/* ========================================================================== */
/*                           Macros & Typedefs                                */
/* ========================================================================== */
#define CPSW_GMII_SEL_MODE                    (0x00u) 
#define CPSW_MDIO_SEL_MODE                    (0x00u)
/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */

/* ========================================================================== */
/*                            Global Variables Declarations                   */
/* ========================================================================== */

/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */

/**
 * \brief   This function selects the CPSW pins 
 *          
 * \param   None
 *
 * \return  TRUE/FALSE
 *
 */
void CPSWPinMuxSetup_Ind(void);
/**
 * \brief   This function sets the MII mode for both ports
 *
 * \param   None
 *
 * \return  None.
 */
void PortMIIModeSelect(void);
/**
 * \brief   This function sets the RMII mode for both ports
 *
 * \param   None
 *
 * \return  None.
 */
void PortRMIIModeSelect(void);
/**
 * \brief   This function sets the RMII mode for both ports
 *
 * \param   None
 *
 * \return  None.
 */
void PortModeSelect_Ind(void);
/**
 * \brief   This routine reads data from CDCE913 Clock Synthesizer device through I2C.
 *
 * \param   instance    
 *   readBuf				[IN]    Read data buffer
 *   registerAddr			[IN]    address
 *
 * \return  
 *   SUCCESS for success  
 *   FAIL for error   
 *
 **/
int RMIIClockRead(unsigned char registerAddr, unsigned char *readBuf);
/**
 * \brief    This routine writes data to CDCE913 Clock Synthesizer.It takes the buffer to be written as a
 *           parameter and length of the buffer.
 *
 * \param   instance    
 *   registerAddr			[IN]	Register address for writing data
 *   writeData				[IN]    Write data
 *
 * \return  
 *   SUCCESS for success  
 *   FAIL for error   
 *
 **/
int RMIIClockWrite(unsigned char registerAddr, unsigned char writeData);
/**
 * \brief   Routine to 
 *
 * \param   instance    
 *
 *
 * \return  None.
 *
 **/
int RMIIClock_setup();

#endif

