Communication Example Code
Copyright © 2002 Marvell
CONFIDENTIAL
Doc. No. MV-S300165-00, Rev. A
May 21, 2002, Preliminary
Document Classification: Proprietary Information
Page 161
sdma.h: SDMA structs and function declaration.
void gtUartDevInit(MPSC_UART_CHAN* pChan)
{
UINT32 tempRegValue;
short mpscPortsExist[NUMBER_OF_MPSC_PORTS];
PORT_ALLOCATION_STRUCT allocStruct;
MPSC_PORT_CONFIG TempPortConfig; /* Initial config of MPSC channel */
BRG_CONFIG_TUNING cfgTunBrg; /* Initial configuration of the BRG engine */
MPSC_SDCMR commandMpsc;
/* Initialize the Communication Unit memory pool */
usrMemInit();
mpscPortsExist[MPSC_AS_UART_CONSOLE] = MPSC_PORT_AS_UART;
/* set all mpscs direct to their ports */
GT_REG_WRITE(MAIN_ROUTING_REGISTER, 0x7ffe38);
/* connect the MPSC and Ethernet as RMII ports */
GT_REG_WRITE(SERIAL_PORT_MULTIPLEX, 0x1102);
UARTPort = MPSC_AS_UART_CONSOLE;
/* Set UARTPort to work with BRG 0 */
tempRegValue = GetDefaultRegisterValue(RCRR);
tempRegValue = tempRegValue & (~(0xf << (UARTPort*8)));
tempRegValue = tempRegValue | (UART_PORT << (UARTPort*8));
/* set the register value in an internal table */
SetDefaultRegisterValue(RCRR,tempRegValue);
GT_REG_WRITE(RECEIVE_CLOCK_ROUTING_REGISTER,tempRegValue);
tempRegValue = GetDefaultRegisterValue(TCRR);
tempRegValue = tempRegValue & (~(0xf << (UARTPort*8)));
tempRegValue = tempRegValue | (UART_PORT << (UARTPort*8));
/* set the register value in an internal table */
SetDefaultRegisterValue(TCRR,tempRegValue);
GT_REG_WRITE(TRANSMIT_CLOCK_ROUTING_REGISTER,tempRegValue);
/* initialization of the BRG engine */
BRG_DEFAULT_CONFIG_GET(&(cfgTunBrg.config),UART_PORT);