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