/*******************************************************************************
**
**  onuPonTxPowerControlInit
**  ____________________________________________________________________________
**
**  DESCRIPTION: The function initialyzes TX power control pins
**
**  PARAMETERS:  None
**
**  OUTPUTS:     None
**
**  RETURNS:     MV_OK or error
**
*******************************************************************************/
MV_STATUS onuPonTxPowerControlInit(void)
{
	MV_U32		gpioPinNum, gpioGroup, gpioMask;
	MV_U32		regVal, mppGroup;
	MV_GPP_HAL_DATA	halData;
	MV_U32		devId = mvCtrlModelGet();
	MV_STATUS	status = MV_OK;

	gpioPinNum = mvBoarGpioPinNumGet(BOARD_GPP_PON_XVR_TX_POWER, 0);
	if (gpioPinNum != MV_ERROR) {
		mppGroup = mvCtrlMppRegGet(gpioPinNum / 8);
		/* Set TX power MPP to GPP mode */
		regVal = MV_REG_READ(mppGroup);
		regVal &= ~(0xf << ((gpioPinNum % 8) * 4));
		MV_REG_WRITE(mppGroup, regVal);

		halData.ctrlRev = mvCtrlRevGet();

		status = mvGppInit(&halData);
		if (status == MV_OK) {
			/* Set TX power GPP pin direction to OUT */
			gpioGroup = gpioPinNum / 32;
			gpioMask = 1 << gpioPinNum;
			status = mvGppTypeSet(gpioGroup, gpioMask, (MV_GPP_OUT & gpioMask));
		}

	} else if (devId == MV_6601_DEV_ID)
		status = MV_ERROR;

	return(status);
}
Example #2
0
int board_init (void)
{
	DECLARE_GLOBAL_DATA_PTR;

#ifdef	CONFIG_FLASH_CFI_DRIVER
	int portwidth;
	MV_U32 devParam;
#endif
#if defined(MV_INCLUDE_TWSI)
	MV_TWSI_ADDR slave;
#endif
	MV_GPP_HAL_DATA gppHalData;

	unsigned int i;

	maskAllInt();

	/* must initialize the int in order for udelay to work */
	//alior interrupt_init();
	timer_init();

	/* Init the Board environment module (device bank params init) */
	mvBoardEnvInit();

#if defined(MV_INCLUDE_TWSI)
	slave.type = ADDR7_BIT;
	slave.address = 0;
	mvTwsiInit(0, CONFIG_SYS_I2C_SPEED, CONFIG_SYS_TCLK, &slave, 0);
#endif

	/* Init the Controlloer environment module (MPP init) */
	mvCtrlEnvInit();

	mvBoardDebugLed(3);

	/* Init the Controller CPU interface */
	mvCpuIfInit(mvCpuAddrWinMap);

	/* Init the GPIO sub-system */
	gppHalData.ctrlRev = mvCtrlRevGet();
	mvGppInit(&gppHalData);

	/* arch number of Integrator Board */
	gd->bd->bi_arch_number = 529; //KW2 arch number

	/* adress of boot parameters */
	gd->bd->bi_boot_params = 0x00000100;

	/* relocate the exception vectors */
	/* U-Boot is running from DRAM at this stage */
	for(i = 0; i < 0x100; i+=4)
	{
		*(unsigned int *)(0x0 + i) = *(unsigned int*)(TEXT_BASE + i);
	}

	mvBoardDebugLed(4);
	
	return 0;
}
int board_init(void)
{
	DECLARE_GLOBAL_DATA_PTR;

	if (whoAmI() != 0)
		return 0;

#if defined(MV_INCLUDE_TWSI)
	MV_TWSI_ADDR slave;
#endif

	unsigned int i;

	maskAllInt();
	/* Init the Board environment module (device bank params init) */
	mvBoardEnvInit();


#if defined(MV_INCLUDE_TWSI)
	slave.type = ADDR7_BIT;
	slave.address = 0;
	mvTwsiInit(0, CONFIG_SYS_I2C_SPEED, CONFIG_SYS_TCLK, &slave, 0);
#endif

	/* Init the Controlloer environment module (MPP init) */
	mvCtrlEnvInit();

#if defined(CONFIG_DISPLAY_CPUINFO)
	late_print_cpuinfo();          /* display cpu info (and speed) */
#endif

	mvBoardDebugLed(2);

	mvCpuIfInit(mvCpuAddrWinMap);

#ifdef MV_NOR_BOOT
	env_init();
#endif

	/* Init the GPIO sub-system */
	MV_GPP_HAL_DATA gppHalData;
	gppHalData.ctrlRev = mvCtrlRevGet();
	mvGppInit(&gppHalData);

	gd->bd->bi_arch_number = 528;
	gd->bd->bi_boot_params = 0x00000100;

	/* relocate the exception vectors */
	/* U-Boot is running from DRAM at this stage */
	for (i = 0; i < 0x100; i += 4)
		*(unsigned int*)(0x0 + i) =
			*(unsigned int*)(CONFIG_SYS_TEXT_BASE + i);

	mvBoardDebugLed(4);
	return 0;
}
int board_init (void)
{
	DECLARE_GLOBAL_DATA_PTR;
	int clock_divisor;
	unsigned int i;
	MV_GPP_HAL_DATA gppHalData;
	clock_divisor = (CONFIG_SYS_TCLK / 16)/115200;

	/* muti-core support, initiate each Uart to each cpu */
	mvUartInit(whoAmI(), clock_divisor, mvUartBase(whoAmI()));
	if (whoAmI() != 0)
		return 0;

#if defined(MV_INCLUDE_TWSI)
	MV_TWSI_ADDR slave;
#endif
	maskAllInt();

	/* must initialize the int in order for udelay to work */
	/* interrupt_init(); - no interrupt handling in u-boot */
	timer_init();

	/* Init the Board environment module (device bank params init) */
	mvBoardEnvInit();

#if defined(MV_INCLUDE_TWSI)
	slave.type = ADDR7_BIT;
	slave.address = 0;
	mvTwsiInit(0, CONFIG_SYS_I2C_SPEED, CONFIG_SYS_TCLK, &slave, 0);
#endif

	/* Init the Controlloer environment module (MPP init) */
	mvCtrlEnvInit();

#if defined(CONFIG_DISPLAY_CPUINFO)
	late_print_cpuinfo();          /* display cpu info (and speed) */
#endif
	mvBoardDebugLed(2);

	/* Init the Controller CPU interface */
	mvCpuIfInit(mvCpuAddrWinMap);
#if defined(MV_NOR_BOOT)
	env_init();
#endif
	if (mvBoardCpssBoardIdSet(mvBoardIdGet()) != MV_OK)
		printf("%s: Error: Failed to set Board ID for CPSS!\n", __func__);

	/* Init the GPIO sub-system */
	gppHalData.ctrlRev = mvCtrlRevGet();
	mvGppInit(&gppHalData);

	/* arch number of Integrator Board */
	gd->bd->bi_arch_number=mv_get_arch_number();

	/* adress of boot parameters */
	gd->bd->bi_boot_params = 0x00000100;

	/* relocate the exception vectors */
	/* U-Boot is running from DRAM at this stage */
	for(i = 0; i < 0x100; i+=4) {
		*(unsigned int *)(0x0 + i) = *(unsigned int*)(CONFIG_SYS_TEXT_BASE + i);
	}
	mvBoardDebugLed(4);
	return 0;
}