return 0;
}
-int green(void)
-{
- for (int *i = (int *) 0x17200000; i < 0x17177000 + 0x177000; i++)
- *i = 0xff00ff00;
-
- return 0;
-}
-
-int blue(void)
-{
- for (int *i = (int *) 0x17200000; i < 0x17177000 + 0x177000; i++)
- *i = 0xff0000ff;
-
- return 0;
-}
-
static const init_fnc_t init_sequence_f[] = {
setup_mon_len,
#ifdef CONFIG_OF_CONTROL
env_init, /* initialize environment */
init_baud_rate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
- green,
console_init_f, /* stage 1 init of console */
display_options, /* say that we are here */
- blue,
display_text_info, /* show debugging info if required */
checkcpu,
#if defined(CONFIG_SYSRESET)
void ns16550_init(struct ns16550 *com_port, int baud_divisor)
{
-#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_OMAP34XX)
- /*
- * On some OMAP3/OMAP4 devices when UART3 is configured for boot mode
- * before SPL starts only THRE bit is set. We have to empty the
- * transmitter before initialization starts.
- */
- if ((serial_in(&com_port->lsr) & (UART_LSR_TEMT | UART_LSR_THRE))
- == UART_LSR_THRE) {
- if (baud_divisor != -1)
- ns16550_setbrg(com_port, baud_divisor);
- else {
- // Re-use old baud rate divisor to flush transmit reg.
- const int dll = serial_in(&com_port->dll);
- const int dlm = serial_in(&com_port->dlm);
- const int divisor = dll | (dlm << 8);
- ns16550_setbrg(com_port, divisor);
- }
- serial_out(0, &com_port->mdr1);
- }
-#endif
-
- while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT))
- ;
-
- serial_out(CFG_SYS_NS16550_IER, &com_port->ier);
-#if defined(CONFIG_ARCH_OMAP2PLUS) || defined(CONFIG_OMAP_SERIAL)
- serial_out(0x7, &com_port->mdr1); /* mode select reset TL16C750*/
-#endif
-
- serial_out(UART_MCRVAL, &com_port->mcr);
- serial_out(ns16550_getfcr(com_port), &com_port->fcr);
- /* initialize serial config to 8N1 before writing baudrate */
- serial_out(UART_LCRVAL, &com_port->lcr);
- if (baud_divisor != -1)
- ns16550_setbrg(com_port, baud_divisor);
-#if defined(CONFIG_ARCH_OMAP2PLUS) || defined(CONFIG_SOC_DA8XX) || \
- defined(CONFIG_OMAP_SERIAL)
- /* /16 is proper to hit 115200 with 48MHz */
- serial_out(0, &com_port->mdr1);
-#endif
-#if defined(CONFIG_ARCH_KEYSTONE)
- serial_out(UART_REG_VAL_PWREMU_MGMT_UART_ENABLE, &com_port->regC);
-#endif
}
#if !CONFIG_IS_ENABLED(NS16550_MIN_FUNCTIONS)