Exemplo n.º 1
0
void ps_uart_state_dump(struct tty_struct *tty)
{
    struct ps_core_s *ps_core_d = NULL;
    ps_get_core_reference(&ps_core_d);
    if (unlikely((NULL == ps_core_d) || (NULL == tty)))
    {
        PS_PRINT_ERR("ps_core_d ot tty is NULL\n");
        return;
    }

    PS_PRINT_INFO("===pre uart&tty state===\n");
    ps_uart_state_print(&g_uart_state_pre);
    PS_PRINT_INFO("===cur uart&tty state===\n");
    ps_uart_state_get(tty);
    ps_uart_state_print(&g_uart_state);
    PS_PRINT_INFO("chars in tty tx buf len=%x\n", tty_chars_in_buffer(ps_core_d->tty));

    return;
}
Exemplo n.º 2
0
void ps_uart_state_dump(struct tty_struct *tty)
{
    struct ps_core_s *ps_core_d = NULL;
    struct uart_state *state = NULL;

    ps_get_core_reference(&ps_core_d);
    if (unlikely((NULL == ps_core_d) || (NULL == tty)))
    {
        PS_PRINT_ERR("ps_core_d ot tty is NULL\n");
        return;
    }

    state = tty->driver_data;
    if (unlikely(NULL == state->uart_port))
    {
        PS_PRINT_ERR("uart_port is NULL\n");
        return;
    }

    PS_PRINT_INFO("===pre uart&tty state===\n");
    ps_uart_state_print(&g_uart_state_pre);
    PS_PRINT_INFO("===cur uart&tty state===\n");
    ps_uart_state_get(tty);
    ps_uart_state_print(&g_uart_state);
    PS_PRINT_INFO("chars in tty tx buf len=%x\n", tty_chars_in_buffer(ps_core_d->tty));
    PS_PRINT_INFO("uart port mctrl:0x%x\n", state->uart_port->mctrl);

    PS_PRINT_INFO("DR   :0x%x\n", readw(state->uart_port->membase + 0x00));
    PS_PRINT_INFO("FR   :0x%x\n", readw(state->uart_port->membase + 0x18));
    PS_PRINT_INFO("IBRD :0x%x\n", readw(state->uart_port->membase + 0x24));
    PS_PRINT_INFO("FBRD :0x%x\n", readw(state->uart_port->membase + 0x28));
    PS_PRINT_INFO("LCR_H:0x%x\n", readw(state->uart_port->membase + 0x2C));
    PS_PRINT_INFO("CR   :0x%x\n", readw(state->uart_port->membase + 0x30));
    PS_PRINT_INFO("IFLS :0x%x\n", readw(state->uart_port->membase + 0x34));
    PS_PRINT_INFO("IMSC :0x%x\n", readw(state->uart_port->membase + 0x38));
    PS_PRINT_INFO("RIS  :0x%x\n", readw(state->uart_port->membase + 0x3C));
    PS_PRINT_INFO("MIS  :0x%x\n", readw(state->uart_port->membase + 0x40));

    return;
}