Beispiel #1
0
void rs_kgdb_hook(int tty_no)
{
	struct serial_state *ser = &rs_table[tty_no];

	kdb_port_info.state = ser;
	kdb_port_info.magic = SERIAL_MAGIC;
	kdb_port_info.port  = tty_no;
	kdb_port_info.flags = ser->flags;

	/*
	 * Clear all interrupts
	 */
	/* Clear all the transmitter FIFO counters (pointer and status) */
	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
	/* Clear all the receiver FIFO counters (pointer and status) */
	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
	/* Clear all interrupts */
	ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX | 
		IP3106_UART_INT_ALLTX;

	/*
	 * Now, initialize the UART
	 */
	ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
	ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
}
void __init plat_mem_setup(void)
{
	int i;
	char* argptr;

	board_setup();  /* board specific setup */

        _machine_restart = pnx8550_machine_restart;
        _machine_halt = pnx8550_machine_halt;
        pm_power_off = pnx8550_machine_power_off;

	/* Clear the Global 2 Register, PCI Inta Output Enable Registers
	   Bit 1:Enable DAC Powerdown
	  -> 0:DACs are enabled and are working normally
	     1:DACs are powerdown
	   Bit 0:Enable of PCI inta output
	  -> 0 = Disable PCI inta output
	     1 = Enable PCI inta output
	*/
	PNX8550_GLB2_ENAB_INTA_O = 0;

	/* IO/MEM resources. */
	set_io_port_base(PNX8550_PORT_BASE);
	ioport_resource.start = 0;
	ioport_resource.end = ~0;
	iomem_resource.start = 0;
	iomem_resource.end = ~0;

	/* Request I/O space for devices on this board */
	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
		request_resource(&ioport_resource, standard_io_resources + i);

	/* Place the Mode Control bit for GPIO pin 16 in primary function */
	/* Pin 16 is used by UART1, UA1_TX                                */
	outl((PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_16_BIT) |
			(PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_17_BIT),
			PNX8550_GPIO_MC1);

	argptr = prom_getcmdline();
	if ((argptr = strstr(argptr, "console=ttyS")) != NULL) {
		argptr += strlen("console=ttyS");
		pnx8550_console_port = *argptr == '0' ? 0 : 1;

		/* We must initialize the UART (console) before early printk */
		/* Set LCR to 8-bit and BAUD to 38400 (no 5)                */
		ip3106_lcr(UART_BASE, pnx8550_console_port) =
			PNX8XXX_UART_LCR_8BIT;
		ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
	}

	return;
}