- struct uart_port port;
- static char options[16];
- int mapsize = 64;
-
- memset(&port, 0, sizeof(port));
- port.uartclk = uart->clock_rate;
- if (!port.uartclk) /* some FW doesn't supply this */
- port.uartclk = BASE_BAUD * 16;
-
- if (uart->addr.address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
- port.mapbase = uart->addr.address;
- port.membase = ioremap(port.mapbase, mapsize);
- if (!port.membase) {
- printk(KERN_ERR "%s: couldn't ioremap 0x%lx-0x%lx\n",
- __FUNCTION__, port.mapbase, port.mapbase + mapsize);
- return;
- }
- port.iotype = UPIO_MEM;
- } else if (uart->addr.address_space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
- port.iobase = uart->addr.address;
- port.iotype = UPIO_PORT;
- } else
- return;
-
- switch (uart->pci_prog_intfc) {
- case 0x0: port.type = PORT_8250; break;
- case 0x1: port.type = PORT_16450; break;
- case 0x2: port.type = PORT_16550; break;
- case 0x3: port.type = PORT_16650; break;
- case 0x4: port.type = PORT_16750; break;
- case 0x5: port.type = PORT_16850; break;
- case 0x6: port.type = PORT_16C950; break;
- default: port.type = PORT_UNKNOWN; break;
- }
-
- port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;