Beispiel #1
0
void hw_reset_platform(void)
{
  UINT8  reset_control_register;

  // Write the ICH register required to perform a platform reset (Cold Reset)
  reset_control_register = hw_read_port_8(RESET_CONTROL_REGISTER_IO_PORT);

  SET_CPU_RESET( reset_control_register );
  SET_SYSTEM_RESET( reset_control_register );

  hw_write_port_8 (RESET_CONTROL_REGISTER_IO_PORT, reset_control_register);

  // Never returns
  VMM_DEADLOOP ();
}
Beispiel #2
0
/*
 * Checks h/w handshake lines for "go" status.  Count the number of times it
 * was "stop".  In UART_HANDSHAKE_AUTO mode, after a limit is reached force
 * the status to "go".
 */
static boolean_t is_hw_tx_handshake_go(mon_serial_device_t *p_device)
{
	/* Modem Status Register image */
	uart_msr_t msr;
	/* flags transmit "go" by h/w handshake */
	boolean_t hw_handshake_go;

	if ((p_device->handshake_mode == UART_HANDSHAKE_AUTO) ||
	    (p_device->handshake_mode == UART_HANDSHAKE_HW)) {
		/* Read the h/w handshake signals */

		msr.data =
			hw_read_port_8(p_device->io_base + UART_REGISTER_MSR);
		hw_handshake_go = (msr.bits.cts == 1) && (msr.bits.dsr == 1);

		if (hw_handshake_go) {
			/* Other side set h/w handshake to "go".  Reset the counter. */

			update_avg(&p_device->hw_handshake_stopped_count_avg,
				p_device->hw_handshake_stopped_count);
			p_device->hw_handshake_stopped_count = 0;
		} else if (p_device->hw_handshake_stopped_count >=
			   hw_handshake_stopped_limit) {
			/* Other side has indicated h/w handshake "stop" for too long. */

			if (p_device->handshake_mode == UART_HANDSHAKE_AUTO) {
				/* In auto mode, assume the h/w handshake is stuck and force */
				/* the status to "go" */

				hw_handshake_go = TRUE;
				p_device->num_chars_hw_handshake_auto_go++;
				if (p_device->hw_handshake_stopped_count ==
				    hw_handshake_stopped_limit) {
					/* Update the statistic only on the first character */
					/* we decided to auto-go */

					update_avg(
						&p_device->hw_handshake_stopped_count_avg,
						p_device->hw_handshake_stopped_count);
					p_device->hw_handshake_stopped_count++;
				}
			}
		} else {
			/* Increment the stop count and update the statistics */

			if (p_device->hw_handshake_stopped_count == 0) {
				/* We just stopped, increment the stops statistics counter */

				p_device->num_chars_hw_handshake_stopped++;
			}

			p_device->hw_handshake_stopped_count++;

			update_max(&p_device->hw_handshake_stopped_count_max,
				p_device->hw_handshake_stopped_count);
		}
	} else {
		/* No h/w handshake, always "go" */

		hw_handshake_go = TRUE;
	}

	return hw_handshake_go;
}