[MIPS] PNX8550 fixups

This patch fixes the compilation errors on PNX8550 and hard-to-track
bug in interrupt handling.
It also corresponds to the latest changes in PNX8550 serial driver.

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by Vitaly Wool and committed by Ralf Baechle 7009af8c 4a61f173

+26 -18
-2
arch/mips/Kconfig
··· 440 440 441 441 config PNX8550_V2PCI 442 442 bool "Philips PNX8550 based Viper2-PCI board" 443 - depends on BROKEN 444 443 select PNX8550 445 444 select SYS_SUPPORTS_LITTLE_ENDIAN 446 445 447 446 config PNX8550_JBS 448 447 bool "Philips PNX8550 based JBS board" 449 - depends on BROKEN 450 448 select PNX8550 451 449 select SYS_SUPPORTS_LITTLE_ENDIAN 452 450
+1 -1
arch/mips/philips/pnx8550/common/int.c
··· 90 90 unsigned int pending = read_c0_status() & read_c0_cause(); 91 91 92 92 if (pending & STATUSF_IP2) 93 - do_IRQ(2, regs); 93 + hw0_irqdispatch(2, regs); 94 94 else if (pending & STATUSF_IP7) { 95 95 if (read_c0_config7() & 0x01c0) 96 96 timer_irqdispatch(7, regs);
+6 -10
arch/mips/philips/pnx8550/common/platform.c
··· 17 17 #include <linux/init.h> 18 18 #include <linux/resource.h> 19 19 #include <linux/serial.h> 20 - #include <linux/serial_ip3106.h> 20 + #include <linux/serial_pnx8xxx.h> 21 21 #include <linux/platform_device.h> 22 22 23 23 #include <int.h> 24 24 #include <usb.h> 25 25 #include <uart.h> 26 - 27 - extern struct uart_ops ip3106_pops; 28 26 29 27 static struct resource pnx8550_usb_ohci_resources[] = { 30 28 [0] = { ··· 61 63 }, 62 64 }; 63 65 64 - struct ip3106_port ip3106_ports[] = { 66 + struct pnx8xxx_port pnx8xxx_ports[] = { 65 67 [0] = { 66 68 .port = { 67 - .type = PORT_IP3106, 69 + .type = PORT_PNX8XXX, 68 70 .iotype = UPIO_MEM, 69 71 .membase = (void __iomem *)PNX8550_UART_PORT0, 70 72 .mapbase = PNX8550_UART_PORT0, 71 73 .irq = PNX8550_UART_INT(0), 72 74 .uartclk = 3692300, 73 75 .fifosize = 16, 74 - .ops = &ip3106_pops, 75 76 .flags = UPF_BOOT_AUTOCONF, 76 77 .line = 0, 77 78 }, 78 79 }, 79 80 [1] = { 80 81 .port = { 81 - .type = PORT_IP3106, 82 + .type = PORT_PNX8XXX, 82 83 .iotype = UPIO_MEM, 83 84 .membase = (void __iomem *)PNX8550_UART_PORT1, 84 85 .mapbase = PNX8550_UART_PORT1, 85 86 .irq = PNX8550_UART_INT(1), 86 87 .uartclk = 3692300, 87 88 .fifosize = 16, 88 - .ops = &ip3106_pops, 89 89 .flags = UPF_BOOT_AUTOCONF, 90 90 .line = 1, 91 91 }, ··· 107 111 }; 108 112 109 113 static struct platform_device pnx8550_uart_device = { 110 - .name = "ip3106-uart", 114 + .name = "pnx8xxx-uart", 111 115 .id = -1, 112 116 .dev = { 113 117 .dma_mask = &uart_dmamask, 114 118 .coherent_dma_mask = 0xffffffff, 115 - .platform_data = ip3106_ports, 119 + .platform_data = pnx8xxx_ports, 116 120 }, 117 121 .num_resources = ARRAY_SIZE(pnx8550_uart_resources), 118 122 .resource = pnx8550_uart_resources,
+2 -2
arch/mips/philips/pnx8550/common/prom.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/init.h> 15 15 #include <linux/string.h> 16 - #include <linux/serial_ip3106.h> 16 + #include <linux/serial_pnx8xxx.h> 17 17 18 18 #include <asm/bootinfo.h> 19 19 #include <uart.h> ··· 126 126 { 127 127 if (pnx8550_console_port != -1) { 128 128 /* Wait until FIFO not full */ 129 - while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16) 129 + while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & PNX8XXX_UART_FIFO_TXFIFO) >> 16) >= 16) 130 130 ; 131 131 /* Send one char */ 132 132 ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
+3 -3
arch/mips/philips/pnx8550/common/setup.c
··· 24 24 #include <linux/mm.h> 25 25 #include <linux/delay.h> 26 26 #include <linux/interrupt.h> 27 - #include <linux/serial_ip3106.h> 27 + #include <linux/serial_pnx8xxx.h> 28 28 #include <linux/pm.h> 29 29 30 30 #include <asm/cpu.h> ··· 56 56 57 57 struct resource standard_io_resources[] = { 58 58 { 59 - .start = .0x00, 59 + .start = 0x00, 60 60 .end = 0x1f, 61 61 .name = "dma1", 62 62 .flags = IORESOURCE_BUSY ··· 144 144 /* We must initialize the UART (console) before prom_printf */ 145 145 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */ 146 146 ip3106_lcr(UART_BASE, pnx8550_console_port) = 147 - IP3106_UART_LCR_8BIT; 147 + PNX8XXX_UART_LCR_8BIT; 148 148 ip3106_baud(UART_BASE, pnx8550_console_port) = 5; 149 149 } 150 150
+14
include/asm-mips/mach-pnx8550/uart.h
··· 13 13 #define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x) 14 14 #define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19) 15 15 16 + /* early macros needed for prom/kgdb */ 17 + 18 + #define ip3106_lcr(base,port) *(volatile u32 *)(base+(port*0x1000) + 0x000) 19 + #define ip3106_mcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x004) 20 + #define ip3106_baud(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x008) 21 + #define ip3106_cfg(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x00C) 22 + #define ip3106_fifo(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x028) 23 + #define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0) 24 + #define ip3106_ien(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE4) 25 + #define ip3106_iclr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE8) 26 + #define ip3106_iset(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFEC) 27 + #define ip3106_pd(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFF4) 28 + #define ip3106_mid(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFFC) 29 + 16 30 #endif