diff --git a/[refs] b/[refs] index 8a43e3d230e3..09c1a0dec527 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 446b097a426f0fa7d37bd2576bdf6d72d6483ac1 +refs/heads/master: 457cd4f5e3011da47f2f76e2bdc545ffcc1189db diff --git a/trunk/arch/arm/mach-ep93xx/Kconfig b/trunk/arch/arm/mach-ep93xx/Kconfig index 5a1b8c05c958..ea8549bfbef2 100644 --- a/trunk/arch/arm/mach-ep93xx/Kconfig +++ b/trunk/arch/arm/mach-ep93xx/Kconfig @@ -88,20 +88,6 @@ config MACH_TS72XX Say 'Y' here if you want your kernel to support the Technologic Systems TS-72xx board. -choice - prompt "Select a UART for early kernel messages" - -config EP93XX_EARLY_UART1 - bool "UART1" - -config EP93XX_EARLY_UART2 - bool "UART2" - -config EP93XX_EARLY_UART3 - bool "UART3" - -endchoice - endmenu endif diff --git a/trunk/arch/arm/mach-ep93xx/adssphere.c b/trunk/arch/arm/mach-ep93xx/adssphere.c index 8e3bbb5299e9..aa1fb352fb8f 100644 --- a/trunk/arch/arm/mach-ep93xx/adssphere.c +++ b/trunk/arch/arm/mach-ep93xx/adssphere.c @@ -47,12 +47,36 @@ static struct ep93xx_eth_data adssphere_eth_data = { .phy_id = 1, }; +static struct resource adssphere_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device adssphere_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &adssphere_eth_data, + }, + .num_resources = 2, + .resource = adssphere_eth_resource, +}; + static void __init adssphere_init_machine(void) { ep93xx_init_devices(); platform_device_register(&adssphere_flash); - ep93xx_register_eth(&adssphere_eth_data, 1); + memcpy(adssphere_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(&adssphere_eth_device); } MACHINE_START(ADSSPHERE, "ADS Sphere board") diff --git a/trunk/arch/arm/mach-ep93xx/core.c b/trunk/arch/arm/mach-ep93xx/core.c index 52ee8aa046c4..f99f43669392 100644 --- a/trunk/arch/arm/mach-ep93xx/core.c +++ b/trunk/arch/arm/mach-ep93xx/core.c @@ -157,7 +157,7 @@ static unsigned char gpio_int_type2[3]; static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; -static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; +static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x5c }; void ep93xx_gpio_update_int_params(unsigned port) { @@ -461,41 +461,6 @@ static struct platform_device ep93xx_ohci_device = { .resource = ep93xx_ohci_resources, }; -static struct ep93xx_eth_data ep93xx_eth_data; - -static struct resource ep93xx_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device ep93xx_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &ep93xx_eth_data, - }, - .num_resources = ARRAY_SIZE(ep93xx_eth_resource), - .resource = ep93xx_eth_resource, -}; - -void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) -{ - if (copy_addr) { - memcpy(data->dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - } - - ep93xx_eth_data = *data; - platform_device_register(&ep93xx_eth_device); -} - extern void ep93xx_gpio_init(void); void __init ep93xx_init_devices(void) diff --git a/trunk/arch/arm/mach-ep93xx/edb9302.c b/trunk/arch/arm/mach-ep93xx/edb9302.c index 899784f3b7b8..97550c0ad7b0 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9302.c +++ b/trunk/arch/arm/mach-ep93xx/edb9302.c @@ -43,16 +43,10 @@ static struct platform_device edb9302_flash = { .resource = &edb9302_flash_resource, }; -static struct ep93xx_eth_data edb9302_eth_data = { - .phy_id = 1, -}; - static void __init edb9302_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9302_flash); - - ep93xx_register_eth(&edb9302_eth_data, 1); } MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/edb9302a.c b/trunk/arch/arm/mach-ep93xx/edb9302a.c index ea7e4eb0cc2d..99b01d44bf1c 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9302a.c +++ b/trunk/arch/arm/mach-ep93xx/edb9302a.c @@ -47,12 +47,36 @@ static struct ep93xx_eth_data edb9302a_eth_data = { .phy_id = 1, }; +static struct resource edb9302a_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device edb9302a_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &edb9302a_eth_data, + }, + .num_resources = 2, + .resource = edb9302a_eth_resource, +}; + static void __init edb9302a_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9302a_flash); - ep93xx_register_eth(&edb9302a_eth_data, 1); + memcpy(edb9302a_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(&edb9302a_eth_device); } MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/edb9307.c b/trunk/arch/arm/mach-ep93xx/edb9307.c index 7dee28e9d7f9..9fb72d01a36c 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9307.c +++ b/trunk/arch/arm/mach-ep93xx/edb9307.c @@ -47,12 +47,36 @@ static struct ep93xx_eth_data edb9307_eth_data = { .phy_id = 1, }; +static struct resource edb9307_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device edb9307_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &edb9307_eth_data, + }, + .num_resources = 2, + .resource = edb9307_eth_resource, +}; + static void __init edb9307_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9307_flash); - ep93xx_register_eth(&edb9307_eth_data, 1); + memcpy(edb9307_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(&edb9307_eth_device); } MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/edb9312.c b/trunk/arch/arm/mach-ep93xx/edb9312.c index 3f660d1fc966..87267a574f5e 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9312.c +++ b/trunk/arch/arm/mach-ep93xx/edb9312.c @@ -44,16 +44,10 @@ static struct platform_device edb9312_flash = { .resource = &edb9312_flash_resource, }; -static struct ep93xx_eth_data edb9312_eth_data = { - .phy_id = 1, -}; - static void __init edb9312_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9312_flash); - - ep93xx_register_eth(&edb9312_eth_data, 1); } MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/edb9315.c b/trunk/arch/arm/mach-ep93xx/edb9315.c index a1e76c329daa..7e373950be4d 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9315.c +++ b/trunk/arch/arm/mach-ep93xx/edb9315.c @@ -43,16 +43,10 @@ static struct platform_device edb9315_flash = { .resource = &edb9315_flash_resource, }; -static struct ep93xx_eth_data edb9315_eth_data = { - .phy_id = 1, -}; - static void __init edb9315_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9315_flash); - - ep93xx_register_eth(&edb9315_eth_data, 1); } MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/edb9315a.c b/trunk/arch/arm/mach-ep93xx/edb9315a.c index cbd77bf18aaf..08a7c9bfb689 100644 --- a/trunk/arch/arm/mach-ep93xx/edb9315a.c +++ b/trunk/arch/arm/mach-ep93xx/edb9315a.c @@ -47,12 +47,36 @@ static struct ep93xx_eth_data edb9315a_eth_data = { .phy_id = 1, }; +static struct resource edb9315a_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device edb9315a_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &edb9315a_eth_data, + }, + .num_resources = 2, + .resource = edb9315a_eth_resource, +}; + static void __init edb9315a_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9315a_flash); - ep93xx_register_eth(&edb9315a_eth_data, 1); + memcpy(edb9315a_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(&edb9315a_eth_device); } MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board") diff --git a/trunk/arch/arm/mach-ep93xx/gesbc9312.c b/trunk/arch/arm/mach-ep93xx/gesbc9312.c index 8a67e53cba61..9b41ec1f089e 100644 --- a/trunk/arch/arm/mach-ep93xx/gesbc9312.c +++ b/trunk/arch/arm/mach-ep93xx/gesbc9312.c @@ -44,15 +44,36 @@ static struct platform_device gesbc9312_flash = { }; static struct ep93xx_eth_data gesbc9312_eth_data = { - .phy_id = 1, + .phy_id = 1, +}; + +static struct resource gesbc9312_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device gesbc9312_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &gesbc9312_eth_data, + }, + .num_resources = 2, + .resource = gesbc9312_eth_resource, }; static void __init gesbc9312_init_machine(void) { ep93xx_init_devices(); platform_device_register(&gesbc9312_flash); - - ep93xx_register_eth(&gesbc9312_eth_data, 0); + platform_device_register(&gesbc9312_eth_device); } MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx") diff --git a/trunk/arch/arm/mach-ep93xx/gpio.c b/trunk/arch/arm/mach-ep93xx/gpio.c index 468d5234da74..0f3fb87ca4be 100644 --- a/trunk/arch/arm/mach-ep93xx/gpio.c +++ b/trunk/arch/arm/mach-ep93xx/gpio.c @@ -141,10 +141,10 @@ static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) static struct ep93xx_gpio_chip ep93xx_gpio_banks[] = { EP93XX_GPIO_BANK("A", 0x00, 0x10, 0), EP93XX_GPIO_BANK("B", 0x04, 0x14, 8), - EP93XX_GPIO_BANK("C", 0x08, 0x18, 40), + EP93XX_GPIO_BANK("C", 0x30, 0x34, 40), EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24), EP93XX_GPIO_BANK("E", 0x20, 0x24, 32), - EP93XX_GPIO_BANK("F", 0x30, 0x34, 16), + EP93XX_GPIO_BANK("F", 0x08, 0x18, 16), EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48), EP93XX_GPIO_BANK("H", 0x40, 0x44, 56), }; diff --git a/trunk/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/trunk/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index 22d6c9a6e4ca..9f4458c8e070 100644 --- a/trunk/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/trunk/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h @@ -5,40 +5,6 @@ #ifndef __ASM_ARCH_EP93XX_REGS_H #define __ASM_ARCH_EP93XX_REGS_H -/* - * EP93xx Physical Memory Map: - * - * The ASDO pin is sampled at system reset to select a synchronous or - * asynchronous boot configuration. When ASDO is "1" (i.e. pulled-up) - * the synchronous boot mode is selected. When ASDO is "0" (i.e - * pulled-down) the asynchronous boot mode is selected. - * - * In synchronous boot mode nSDCE3 is decoded starting at physical address - * 0x00000000 and nCS0 is decoded starting at 0xf0000000. For asynchronous - * boot mode they are swapped with nCS0 decoded at 0x00000000 ann nSDCE3 - * decoded at 0xf0000000. - * - * There is known errata for the EP93xx dealing with External Memory - * Configurations. Please refer to "AN273: EP93xx Silicon Rev E Design - * Guidelines" for more information. This document can be found at: - * - * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf - */ - -#define EP93XX_CS0_PHYS_BASE_ASYNC 0x00000000 /* ASDO Pin = 0 */ -#define EP93XX_SDCE3_PHYS_BASE_SYNC 0x00000000 /* ASDO Pin = 1 */ -#define EP93XX_CS1_PHYS_BASE 0x10000000 -#define EP93XX_CS2_PHYS_BASE 0x20000000 -#define EP93XX_CS3_PHYS_BASE 0x30000000 -#define EP93XX_PCMCIA_PHYS_BASE 0x40000000 -#define EP93XX_CS6_PHYS_BASE 0x60000000 -#define EP93XX_CS7_PHYS_BASE 0x70000000 -#define EP93XX_SDCE0_PHYS_BASE 0xc0000000 -#define EP93XX_SDCE1_PHYS_BASE 0xd0000000 -#define EP93XX_SDCE2_PHYS_BASE 0xe0000000 -#define EP93XX_SDCE3_PHYS_BASE_ASYNC 0xf0000000 /* ASDO Pin = 0 */ -#define EP93XX_CS0_PHYS_BASE_SYNC 0xf0000000 /* ASDO Pin = 1 */ - /* * EP93xx linux memory map: * diff --git a/trunk/arch/arm/mach-ep93xx/include/mach/platform.h b/trunk/arch/arm/mach-ep93xx/include/mach/platform.h index db2489d3bda7..b5c182473f5d 100644 --- a/trunk/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/trunk/arch/arm/mach-ep93xx/include/mach/platform.h @@ -4,17 +4,17 @@ #ifndef __ASSEMBLY__ +void ep93xx_map_io(void); +void ep93xx_init_irq(void); +void ep93xx_init_time(unsigned long); +void ep93xx_init_devices(void); +extern struct sys_timer ep93xx_timer; + struct ep93xx_eth_data { unsigned char dev_addr[6]; unsigned char phy_id; }; -void ep93xx_map_io(void); -void ep93xx_init_irq(void); -void ep93xx_init_time(unsigned long); -void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); -void ep93xx_init_devices(void); -extern struct sys_timer ep93xx_timer; #endif diff --git a/trunk/arch/arm/mach-ep93xx/include/mach/uncompress.h b/trunk/arch/arm/mach-ep93xx/include/mach/uncompress.h index 16026c2b1c8c..1fd2f17de325 100644 --- a/trunk/arch/arm/mach-ep93xx/include/mach/uncompress.h +++ b/trunk/arch/arm/mach-ep93xx/include/mach/uncompress.h @@ -31,19 +31,10 @@ static void __raw_writel(unsigned int value, unsigned int ptr) *((volatile unsigned int *)ptr) = value; } -#if defined(CONFIG_EP93XX_EARLY_UART1) -#define UART_BASE EP93XX_UART1_PHYS_BASE -#elif defined(CONFIG_EP93XX_EARLY_UART2) -#define UART_BASE EP93XX_UART2_PHYS_BASE -#elif defined(CONFIG_EP93XX_EARLY_UART3) -#define UART_BASE EP93XX_UART3_PHYS_BASE -#else -#define UART_BASE EP93XX_UART1_PHYS_BASE -#endif - -#define PHYS_UART_DATA (UART_BASE + 0x00) -#define PHYS_UART_FLAG (UART_BASE + 0x18) -#define UART_FLAG_TXFF 0x20 + +#define PHYS_UART1_DATA 0x808c0000 +#define PHYS_UART1_FLAG 0x808c0018 +#define UART1_FLAG_TXFF 0x20 static inline void putc(int c) { @@ -51,11 +42,11 @@ static inline void putc(int c) for (i = 0; i < 1000; i++) { /* Transmit fifo not full? */ - if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)) + if (!(__raw_readb(PHYS_UART1_FLAG) & UART1_FLAG_TXFF)) break; } - __raw_writeb(c, PHYS_UART_DATA); + __raw_writeb(c, PHYS_UART1_DATA); } static inline void flush(void) diff --git a/trunk/arch/arm/mach-ep93xx/micro9.c b/trunk/arch/arm/mach-ep93xx/micro9.c index 72c8d44f4ddb..de047a5c8112 100644 --- a/trunk/arch/arm/mach-ep93xx/micro9.c +++ b/trunk/arch/arm/mach-ep93xx/micro9.c @@ -29,9 +29,38 @@ static struct ep93xx_eth_data micro9_eth_data = { .phy_id = 0x1f, }; +static struct resource micro9_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device micro9_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = µ9_eth_data, + }, + .num_resources = ARRAY_SIZE(micro9_eth_resource), + .resource = micro9_eth_resource, +}; + +static void __init micro9_eth_init(void) +{ + memcpy(micro9_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(µ9_eth_device); +} + static void __init micro9_init(void) { - ep93xx_register_eth(µ9_eth_data, 1); + micro9_eth_init(); } /* diff --git a/trunk/arch/arm/mach-ep93xx/ts72xx.c b/trunk/arch/arm/mach-ep93xx/ts72xx.c index 61e7d664fd22..c3cbff126d0c 100644 --- a/trunk/arch/arm/mach-ep93xx/ts72xx.c +++ b/trunk/arch/arm/mach-ep93xx/ts72xx.c @@ -161,6 +161,28 @@ static struct ep93xx_eth_data ts72xx_eth_data = { .phy_id = 1, }; +static struct resource ts72xx_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device ts72xx_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &ts72xx_eth_data, + }, + .num_resources = 2, + .resource = ts72xx_eth_resource, +}; + static void __init ts72xx_init_machine(void) { ep93xx_init_devices(); @@ -168,7 +190,9 @@ static void __init ts72xx_init_machine(void) platform_device_register(&ts72xx_flash); platform_device_register(&ts72xx_rtc_device); - ep93xx_register_eth(&ts72xx_eth_data, 1); + memcpy(ts72xx_eth_data.dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + platform_device_register(&ts72xx_eth_device); } MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") diff --git a/trunk/drivers/serial/serial_ks8695.c b/trunk/drivers/serial/serial_ks8695.c index b9cbfc87f616..998e89dc5aaf 100644 --- a/trunk/drivers/serial/serial_ks8695.c +++ b/trunk/drivers/serial/serial_ks8695.c @@ -63,8 +63,44 @@ #define UART_DUMMY_LSR_RX 0x100 #define UART_PORT_SIZE (KS8695_USR - KS8695_URRB + 4) -#define tx_enabled(port) ((port)->unused[0]) -#define rx_enabled(port) ((port)->unused[1]) +static inline int tx_enabled(struct uart_port *port) +{ + return port->unused[0] & 1; +} + +static inline int rx_enabled(struct uart_port *port) +{ + return port->unused[0] & 2; +} + +static inline int ms_enabled(struct uart_port *port) +{ + return port->unused[0] & 4; +} + +static inline void ms_enable(struct uart_port *port, int enabled) +{ + if(enabled) + port->unused[0] |= 4; + else + port->unused[0] &= ~4; +} + +static inline void rx_enable(struct uart_port *port, int enabled) +{ + if(enabled) + port->unused[0] |= 2; + else + port->unused[0] &= ~2; +} + +static inline void tx_enable(struct uart_port *port, int enabled) +{ + if(enabled) + port->unused[0] |= 1; + else + port->unused[0] &= ~1; +} #ifdef SUPPORT_SYSRQ @@ -75,7 +111,7 @@ static void ks8695uart_stop_tx(struct uart_port *port) { if (tx_enabled(port)) { disable_irq(KS8695_IRQ_UART_TX); - tx_enabled(port) = 0; + tx_enable(port, 0); } } @@ -83,7 +119,7 @@ static void ks8695uart_start_tx(struct uart_port *port) { if (!tx_enabled(port)) { enable_irq(KS8695_IRQ_UART_TX); - tx_enabled(port) = 1; + tx_enable(port, 1); } } @@ -91,18 +127,24 @@ static void ks8695uart_stop_rx(struct uart_port *port) { if (rx_enabled(port)) { disable_irq(KS8695_IRQ_UART_RX); - rx_enabled(port) = 0; + rx_enable(port, 0); } } static void ks8695uart_enable_ms(struct uart_port *port) { - enable_irq(KS8695_IRQ_UART_MODEM_STATUS); + if (!ms_enabled(port)) { + enable_irq(KS8695_IRQ_UART_MODEM_STATUS); + ms_enable(port,1); + } } static void ks8695uart_disable_ms(struct uart_port *port) { - disable_irq(KS8695_IRQ_UART_MODEM_STATUS); + if (ms_enabled(port)) { + disable_irq(KS8695_IRQ_UART_MODEM_STATUS); + ms_enable(port,0); + } } static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) @@ -285,8 +327,9 @@ static int ks8695uart_startup(struct uart_port *port) int retval; set_irq_flags(KS8695_IRQ_UART_TX, IRQF_VALID | IRQF_NOAUTOEN); - tx_enabled(port) = 0; - rx_enabled(port) = 1; + tx_enable(port, 0); + rx_enable(port, 1); + ms_enable(port, 1); /* * Allocate the IRQ