Line 335... |
Line 335... |
/* Simulation hook. Must be called every clock cycle to simulate all UART
|
/* Simulation hook. Must be called every clock cycle to simulate all UART
|
devices. It does internal functional UART simulation. */
|
devices. It does internal functional UART simulation. */
|
void uart_clock16(int i)
|
void uart_clock16(int i)
|
{
|
{
|
int retval;
|
int retval;
|
|
|
|
/* Schedule for later */
|
|
SCHED_ADD (uart_clock16, i, cycles + UART_CLOCK_DIVIDER);
|
|
|
/* If VAPI is not selected, UART communicates with two file streams;
|
/* If VAPI is not selected, UART communicates with two file streams;
|
if VAPI is selected, we use VAPI streams. */
|
if VAPI is selected, we use VAPI streams. */
|
|
|
/* if txfs is corrupted, skip this uart. */
|
/* if txfs is corrupted, skip this uart. */
|
if (!config.uarts[i].vapi_id && !uarts[i].txfs) return;
|
if (!config.uarts[i].vapi_id && !uarts[i].txfs) return;
|
|
|
if (uarts[i].vapi.next_break_cnt >= 0)
|
if (uarts[i].vapi.next_break_cnt >= 0)
|
if (--uarts[i].vapi.next_break_cnt < 0) {
|
if (--uarts[i].vapi.next_break_cnt < 0) {
|
Line 542... |
Line 545... |
}
|
}
|
if (!(uarts[i].regs.iir & UART_IIR_NO_INT)) {
|
if (!(uarts[i].regs.iir & UART_IIR_NO_INT)) {
|
debug (4, "uarts[i].regs.iir = %i\t", uarts[i].regs.iir);
|
debug (4, "uarts[i].regs.iir = %i\t", uarts[i].regs.iir);
|
report_interrupt(config.uarts[i].irq);
|
report_interrupt(config.uarts[i].irq);
|
}
|
}
|
SCHED_ADD (uart_clock16, i, cycles + UART_CLOCK_DIVIDER);
|
|
}
|
}
|
|
|
/* Reset. It initializes all registers of all UART devices to zero values,
|
/* Reset. It initializes all registers of all UART devices to zero values,
|
(re)opens all RX/TX file streams and places devices in memory address
|
(re)opens all RX/TX file streams and places devices in memory address
|
space. */
|
space. */
|
Line 595... |
Line 597... |
uarts[i].slowdown = UART_FGETC_SLOWDOWN;
|
uarts[i].slowdown = UART_FGETC_SLOWDOWN;
|
|
|
uarts[i].regs.lcr = UART_LCR_RESET;
|
uarts[i].regs.lcr = UART_LCR_RESET;
|
uarts[i].vapi.cur_break = uarts[i].vapi.cur_break_cnt = uarts[i].vapi.next_break = 0;
|
uarts[i].vapi.cur_break = uarts[i].vapi.cur_break_cnt = uarts[i].vapi.next_break = 0;
|
uarts[i].vapi.next_break_cnt = -1;
|
uarts[i].vapi.next_break_cnt = -1;
|
|
printf ("%i\n", i);
|
SCHED_ADD (uart_clock16, i, cycles + UART_CLOCK_DIVIDER);
|
SCHED_ADD (uart_clock16, i, cycles + UART_CLOCK_DIVIDER);
|
}
|
}
|
}
|
}
|
|
|
/* Print register values on stdout. */
|
/* Print register values on stdout. */
|