Commit 7009af8c authored by Vitaly Wool's avatar Vitaly Wool Committed by Ralf Baechle

[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: default avatarVitaly Wool <vitalywool@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 4a61f173
...@@ -440,13 +440,11 @@ config MIPS_XXS1500 ...@@ -440,13 +440,11 @@ config MIPS_XXS1500
config PNX8550_V2PCI config PNX8550_V2PCI
bool "Philips PNX8550 based Viper2-PCI board" bool "Philips PNX8550 based Viper2-PCI board"
depends on BROKEN
select PNX8550 select PNX8550
select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN
config PNX8550_JBS config PNX8550_JBS
bool "Philips PNX8550 based JBS board" bool "Philips PNX8550 based JBS board"
depends on BROKEN
select PNX8550 select PNX8550
select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN
......
...@@ -90,7 +90,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs) ...@@ -90,7 +90,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
unsigned int pending = read_c0_status() & read_c0_cause(); unsigned int pending = read_c0_status() & read_c0_cause();
if (pending & STATUSF_IP2) if (pending & STATUSF_IP2)
do_IRQ(2, regs); hw0_irqdispatch(2, regs);
else if (pending & STATUSF_IP7) { else if (pending & STATUSF_IP7) {
if (read_c0_config7() & 0x01c0) if (read_c0_config7() & 0x01c0)
timer_irqdispatch(7, regs); timer_irqdispatch(7, regs);
......
...@@ -17,15 +17,13 @@ ...@@ -17,15 +17,13 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/resource.h> #include <linux/resource.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_ip3106.h> #include <linux/serial_pnx8xxx.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <int.h> #include <int.h>
#include <usb.h> #include <usb.h>
#include <uart.h> #include <uart.h>
extern struct uart_ops ip3106_pops;
static struct resource pnx8550_usb_ohci_resources[] = { static struct resource pnx8550_usb_ohci_resources[] = {
[0] = { [0] = {
.start = PNX8550_USB_OHCI_OP_BASE, .start = PNX8550_USB_OHCI_OP_BASE,
...@@ -63,31 +61,29 @@ static struct resource pnx8550_uart_resources[] = { ...@@ -63,31 +61,29 @@ static struct resource pnx8550_uart_resources[] = {
}, },
}; };
struct ip3106_port ip3106_ports[] = { struct pnx8xxx_port pnx8xxx_ports[] = {
[0] = { [0] = {
.port = { .port = {
.type = PORT_IP3106, .type = PORT_PNX8XXX,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
.membase = (void __iomem *)PNX8550_UART_PORT0, .membase = (void __iomem *)PNX8550_UART_PORT0,
.mapbase = PNX8550_UART_PORT0, .mapbase = PNX8550_UART_PORT0,
.irq = PNX8550_UART_INT(0), .irq = PNX8550_UART_INT(0),
.uartclk = 3692300, .uartclk = 3692300,
.fifosize = 16, .fifosize = 16,
.ops = &ip3106_pops,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.line = 0, .line = 0,
}, },
}, },
[1] = { [1] = {
.port = { .port = {
.type = PORT_IP3106, .type = PORT_PNX8XXX,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
.membase = (void __iomem *)PNX8550_UART_PORT1, .membase = (void __iomem *)PNX8550_UART_PORT1,
.mapbase = PNX8550_UART_PORT1, .mapbase = PNX8550_UART_PORT1,
.irq = PNX8550_UART_INT(1), .irq = PNX8550_UART_INT(1),
.uartclk = 3692300, .uartclk = 3692300,
.fifosize = 16, .fifosize = 16,
.ops = &ip3106_pops,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.line = 1, .line = 1,
}, },
...@@ -111,12 +107,12 @@ static struct platform_device pnx8550_usb_ohci_device = { ...@@ -111,12 +107,12 @@ static struct platform_device pnx8550_usb_ohci_device = {
}; };
static struct platform_device pnx8550_uart_device = { static struct platform_device pnx8550_uart_device = {
.name = "ip3106-uart", .name = "pnx8xxx-uart",
.id = -1, .id = -1,
.dev = { .dev = {
.dma_mask = &uart_dmamask, .dma_mask = &uart_dmamask,
.coherent_dma_mask = 0xffffffff, .coherent_dma_mask = 0xffffffff,
.platform_data = ip3106_ports, .platform_data = pnx8xxx_ports,
}, },
.num_resources = ARRAY_SIZE(pnx8550_uart_resources), .num_resources = ARRAY_SIZE(pnx8550_uart_resources),
.resource = pnx8550_uart_resources, .resource = pnx8550_uart_resources,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/serial_ip3106.h> #include <linux/serial_pnx8xxx.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <uart.h> #include <uart.h>
...@@ -126,7 +126,7 @@ void prom_putchar(char c) ...@@ -126,7 +126,7 @@ void prom_putchar(char c)
{ {
if (pnx8550_console_port != -1) { if (pnx8550_console_port != -1) {
/* Wait until FIFO not full */ /* Wait until FIFO not full */
while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16) while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & PNX8XXX_UART_FIFO_TXFIFO) >> 16) >= 16)
; ;
/* Send one char */ /* Send one char */
ip3106_fifo(UART_BASE, pnx8550_console_port) = c; ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/serial_ip3106.h> #include <linux/serial_pnx8xxx.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/cpu.h> #include <asm/cpu.h>
...@@ -56,7 +56,7 @@ extern char *prom_getcmdline(void); ...@@ -56,7 +56,7 @@ extern char *prom_getcmdline(void);
struct resource standard_io_resources[] = { struct resource standard_io_resources[] = {
{ {
.start = .0x00, .start = 0x00,
.end = 0x1f, .end = 0x1f,
.name = "dma1", .name = "dma1",
.flags = IORESOURCE_BUSY .flags = IORESOURCE_BUSY
...@@ -144,7 +144,7 @@ void __init plat_mem_setup(void) ...@@ -144,7 +144,7 @@ void __init plat_mem_setup(void)
/* We must initialize the UART (console) before prom_printf */ /* We must initialize the UART (console) before prom_printf */
/* Set LCR to 8-bit and BAUD to 38400 (no 5) */ /* Set LCR to 8-bit and BAUD to 38400 (no 5) */
ip3106_lcr(UART_BASE, pnx8550_console_port) = ip3106_lcr(UART_BASE, pnx8550_console_port) =
IP3106_UART_LCR_8BIT; PNX8XXX_UART_LCR_8BIT;
ip3106_baud(UART_BASE, pnx8550_console_port) = 5; ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
} }
......
...@@ -13,4 +13,18 @@ ...@@ -13,4 +13,18 @@
#define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x) #define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x)
#define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19) #define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19)
/* early macros needed for prom/kgdb */
#define ip3106_lcr(base,port) *(volatile u32 *)(base+(port*0x1000) + 0x000)
#define ip3106_mcr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x004)
#define ip3106_baud(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x008)
#define ip3106_cfg(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x00C)
#define ip3106_fifo(base, port) *(volatile u32 *)(base+(port*0x1000) + 0x028)
#define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0)
#define ip3106_ien(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE4)
#define ip3106_iclr(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE8)
#define ip3106_iset(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFEC)
#define ip3106_pd(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFF4)
#define ip3106_mid(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFFC)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment