Exemplo n.º 1
0
/*
 * Internal UARTs need to be initialized for the 8250 autoconfig to work
 * properly. Note that the TX watermark initialization may not be needed
 * once the 8250.c watermark handling code is merged.
 */
static inline void __init omap_serial_reset(struct plat_serial8250_port *p)
{
	serial_write_reg(p, UART_OMAP_MDR1, 0x07);
	serial_write_reg(p, UART_OMAP_SCR, 0x08);
	serial_write_reg(p, UART_OMAP_MDR1, 0x00);
	serial_write_reg(p, UART_OMAP_SYSC, 0x01);
}
Exemplo n.º 2
0
static void serial_hardware_init(int speed, int word_bits,
				 int parity, int stop_bits)
{
	unsigned char reg;

#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
	/* Disable interrupts. */
	serial_write_reg(0, 0x01);

	/* Assert RTS and DTR. */
	serial_write_reg(3, 0x04);

	/* Set the divisor latch. */
	reg = serial_read_reg(0x03);
	serial_write_reg(reg | 0x80, 0x03);

	/* Write the divisor. */
	uint16_t divisor = 115200 / speed;
	serial_write_reg(divisor & 0xFF, 0x00);
	serial_write_reg(divisor >> 8, 0x01);

	/* Restore the previous value of the divisor.
	 * And set 8 bits per character */
	serial_write_reg((reg & ~0x80) | 3, 0x03);
#endif
}
static void __init davinci_serial_reset(struct plat_serial8250_port *p)
{
	unsigned int pwremu = 0;

	serial_write_reg(p, UART_IER, 0);  /* disable all interrupts */

	/* reset both transmitter and receiver: bits 14,13 = UTRST, URRST */
	serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
	mdelay(10);

	pwremu |= (0x3 << 13);
	pwremu |= 0x1;
	serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);

	if (cpu_is_davinci_dm646x())
		serial_write_reg(p, UART_DM646X_SCR,
				 UART_DM646X_SCR_TX_WATERMARK);
}
Exemplo n.º 4
0
static void __init davinci_serial_reset(struct plat_serial8250_port *p)
{
	unsigned int pwremu = 0;

	serial_write_reg(p, UART_IER, 0);  

	
	serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
	mdelay(10);

	pwremu |= (0x3 << 13);
	pwremu |= 0x1;
	serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);

	if (cpu_is_davinci_dm646x())
		serial_write_reg(p, UART_DM646X_SCR,
				 UART_DM646X_SCR_TX_WATERMARK);
}
Exemplo n.º 5
0
void serial_putchar(unsigned int c)
{
	if (!serial_hardware_is_present)
		return;
	while ((serial_read_reg(0x05) & 0x20) == 0) ;
	serial_write_reg(c, 0x00);
	if (c == '\n')
		serial_putchar('\r');
}
Exemplo n.º 6
0
void serial_putchar(unsigned int c)
{
	if (!serial_hardware_is_present)
		return;
#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
	while ((serial_read_reg(0x05) & 0x20) == 0) ;
#endif
	serial_write_reg(c, 0x00);
}
Exemplo n.º 7
0
void serial_putchar(unsigned int c)
{
	if (!serial_hardware_is_present)
		return;
#if !CONFIG(LP_PL011_SERIAL_CONSOLE)
	while ((serial_read_reg(0x05) & 0x20) == 0) ;
#endif
	serial_write_reg(c, 0x00);
	if (c == '\n')
		serial_putchar('\r');
}