int serial_init (void) { DECLARE_GLOBAL_DATA_PTR; int clock_divisor = (CONFIG_SYS_TCLK / 16)/gd->baudrate; if (whoAmI() == MASTER_CPU) { #ifdef CONFIG_SYS_INIT_CHAN1 mvUartInit(0, clock_divisor, mvUartBase(0)); #endif } #if defined(MV78XX0) if ((whoAmI() == MASTER_CPU) || (whoAmI() == SLAVE_CPU)) #endif { #ifdef CONFIG_SYS_INIT_CHAN2 mvUartInit(1, clock_divisor, mvUartBase(1)); #endif } #if 0 /* print banner */ print_mvBanner(); #endif return (0); }
void serial_setbrg (void) { DECLARE_GLOBAL_DATA_PTR; int clock_divisor = (CONFIG_SYS_TCLK / 16)/gd->baudrate; #ifdef CONFIG_SYS_INIT_CHAN1 mvUartInit(0, clock_divisor, mvUartBase(0)); #endif #ifdef CONFIG_SYS_INIT_CHAN2 mvUartInit(1, clock_divisor, mvUartBase(1)); #endif }
int serial_init (void) { DECLARE_GLOBAL_DATA_PTR; if (whoAmI() == MASTER_CPU) { int clock_divisor = (CONFIG_SYS_TCLK / 16)/gd->baudrate; #ifdef CONFIG_SYS_INIT_CHAN1 mvUartInit(0, clock_divisor, mvUartBase(0)); #endif #ifdef CONFIG_SYS_INIT_CHAN2 mvUartInit(1, clock_divisor, mvUartBase(1)); #endif } /* print banner */ #if !defined(DB_88AP510_PCAC) print_mvBanner(); #endif return (0); }
MV_U8 getCDirect() { volatile MV_UART_PORT *pUartPort = mvUartBase(0); while ((pUartPort->lsr & LSR_DR) == 0) ; return (pUartPort->rbr); }
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; }