mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [RESEND 1] 8250_hp300: unuse register_serial/unregister_serial
       [not found] ` <Pine.LNX.4.62.0504041051390.14107@numbat.sonytel.be>
@ 2005-04-04 13:43   ` Kars de Jong
  2005-04-04 14:06     ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Kars de Jong @ 2005-04-04 13:43 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Russell King, Linux Kernel List

On Mon, 2005-04-04 at 10:52 +0200, Geert Uytterhoeven wrote:
> 	Hi Russell,
> 
> On Mon, 4 Apr 2005, Russell King wrote:
> > ----- Forwarded message from Russell King <rmk@arm.linux.org.uk> -----
> > 
> > Date:	Thu, 24 Mar 2005 13:19:57 +0000
> > From:	Russell King <rmk@arm.linux.org.uk>
> > To:	jongk@linux-m68k.org, geert@linux-m68k.org
> > Cc:	Linux Kernel List <linux-kernel@vger.kernel.org>
> > Subject: 8250_hp300: unuse register_serial/unregister_serial
> > 
> > Kars, Geert,
> > 
> > Here's a patch which converts 8250_hp300 to use serial8250_register_port
> > and serial8250_unregister_port, rather than register_serial/
> > unregister_serial.
> > 
> > The 8250-variants allow you to associate the struct device with the port,
> > allowing sysfs to indicate which device owns which serial port.  Plus, we
> > stop using a potentially obsolete (and functionally inferior) function.
> > 
> > This patch is untested; please test, and send bug fixes.
> > 
> > Note: if you need power management, that should come via your device
> > driver, calling serial8250_suspend_port() / serial8250_resume_port()
> > as appropriate.
> 
> For me it's OK. But I don't have an HP9000/300 to test. Kars?

Sorry, I've been busy the past few days (getting married and stuff), I
did look at the patch but didn't get around to send a reply.

I needed the following extra changes, after that it compiles and works
on my HP300:

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
ttyS0 at MMIO 0x690011 (irq = 5) is a 16550A
ttyS1 at MMIO 0x41c040 (irq = 0) is a 16550
ttyS2 at MMIO 0x41c060 (irq = 0) is a 16550


Kind regards,

Kars.

--- linux-2.6-m68k-hp/drivers/serial/8250_hp300.c	2005-04-04 15:38:13.448568529 +0200
+++ linux-2.6-m68k-hp/drivers/serial/8250_hp300.c.new	2005-04-04 15:11:27.000000000 +0200
@@ -9,15 +9,15 @@
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/tty.h>
 #include <linux/serial.h>
-#include <linux/serialP.h>
 #include <linux/serial_core.h>
 #include <linux/delay.h>
 #include <linux/dio.h>
 #include <linux/console.h>
 #include <asm/io.h>
 
+#include "8250.h"
+
 #if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI)
 #warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure?
 #endif
@@ -180,14 +180,14 @@
 	port.irq = d->ipl;
 	port.uartclk = HPDCA_BAUD_BASE * 16;
 	port.mapbase = (d->resource.start + UART_OFFSET);
-	port.membase = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE);
+	port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
 	port.regshift = 1;
 	port.dev = &d->dev;
 	line = serial8250_register_port(&port);
 
 	if (line < 0) {
 		printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
-		       " irq %d failed\n", d->scode, serial_req.irq);
+		       " irq %d failed\n", d->scode, port.irq);
 		return -ENOMEM;
 	}
 
@@ -261,7 +261,7 @@
 		uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
 		/* XXX - no interrupt support yet */
 		uport.irq = 0;
-		uport.baud_base = HPAPCI_BAUD_BASE * 16;
+		uport.uartclk = HPAPCI_BAUD_BASE * 16;
 		uport.mapbase = base;
 		uport.membase = (char *)(base + DIO_VIRADDRBASE);
 		uport.regshift = 2;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND 1] 8250_hp300: unuse register_serial/unregister_serial
  2005-04-04 13:43   ` [RESEND 1] 8250_hp300: unuse register_serial/unregister_serial Kars de Jong
@ 2005-04-04 14:06     ` Russell King
  2005-04-04 14:29       ` Kars de Jong
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2005-04-04 14:06 UTC (permalink / raw)
  To: Kars de Jong; +Cc: Geert Uytterhoeven, Linux Kernel List

On Mon, Apr 04, 2005 at 03:43:32PM +0200, Kars de Jong wrote:
> Sorry, I've been busy the past few days (getting married and stuff), I
> did look at the patch but didn't get around to send a reply.

Congrats.

> I needed the following extra changes, after that it compiles and works
> on my HP300:
> 
> Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
> ttyS0 at MMIO 0x690011 (irq = 5) is a 16550A
> ttyS1 at MMIO 0x41c040 (irq = 0) is a 16550
> ttyS2 at MMIO 0x41c060 (irq = 0) is a 16550

Thanks for testing.  I've incorporated your changes.  One question - do
you need linux/serial.h included in there?

I attach the updated patch.

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej orig/drivers/serial/8250_hp300.c linux/drivers/serial/8250_hp300.c
--- orig/drivers/serial/8250_hp300.c	Mon Nov 15 09:16:28 2004
+++ linux/drivers/serial/8250_hp300.c	Mon Apr  4 15:03:31 2005
@@ -9,15 +9,14 @@
 #include <linux/init.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/tty.h>
-#include <linux/serial.h>
-#include <linux/serialP.h>
 #include <linux/serial_core.h>
 #include <linux/delay.h>
 #include <linux/dio.h>
 #include <linux/console.h>
 #include <asm/io.h>
 
+#include "8250.h"
+
 #if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI)
 #warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure?
 #endif
@@ -163,7 +162,7 @@ int __init hp300_setup_serial_console(vo
 static int __devinit hpdca_init_one(struct dio_dev *d,
                                 const struct dio_device_id *ent)
 {
-	struct serial_struct serial_req;
+	struct uart_port port;
 	int line;
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -172,21 +171,22 @@ static int __devinit hpdca_init_one(stru
 		return 0;
 	}
 #endif
-	memset(&serial_req, 0, sizeof(struct serial_struct));
+	memset(&port, 0, sizeof(struct uart_port));
 
 	/* Memory mapped I/O */
-	serial_req.io_type = SERIAL_IO_MEM;
-	serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
-	serial_req.irq = d->ipl;
-	serial_req.baud_base = HPDCA_BAUD_BASE;
-	serial_req.iomap_base = (d->resource.start + UART_OFFSET);
-	serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE);
-	serial_req.iomem_reg_shift = 1;
-	line = register_serial(&serial_req);
+	port.iotype = UPIO_MEM;
+	port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
+	port.irq = d->ipl;
+	port.uartclk = HPDCA_BAUD_BASE * 16;
+	port.mapbase = (d->resource.start + UART_OFFSET);
+	port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
+	port.regshift = 1;
+	port.dev = &d->dev;
+	line = serial8250_register_port(&port);
 
 	if (line < 0) {
 		printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
-		       " irq %d failed\n", d->scode, serial_req.irq);
+		       " irq %d failed\n", d->scode, port.irq);
 		return -ENOMEM;
 	}
 
@@ -209,7 +209,7 @@ static int __init hp300_8250_init(void)
 #ifdef CONFIG_HPAPCI
 	int line;
 	unsigned long base;
-	struct serial_struct serial_req;
+	struct uart_port uport;
 	struct hp300_port *port;
 	int i;
 #endif
@@ -251,25 +251,25 @@ static int __init hp300_8250_init(void)
 		if (!port)
 			return -ENOMEM;
 
-		memset(&serial_req, 0, sizeof(struct serial_struct));
+		memset(&uport, 0, sizeof(struct uart_port));
 
 		base = (FRODO_BASE + FRODO_APCI_OFFSET(i));
 
 		/* Memory mapped I/O */
-		serial_req.io_type = SERIAL_IO_MEM;
-		serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
+		uport.iotype = UPIO_MEM;
+		uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
 		/* XXX - no interrupt support yet */
-		serial_req.irq = 0;
-		serial_req.baud_base = HPAPCI_BAUD_BASE;
-		serial_req.iomap_base = base;
-		serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE);
-		serial_req.iomem_reg_shift = 2;
+		uport.irq = 0;
+		uport.uartclk = HPAPCI_BAUD_BASE * 16;
+		uport.mapbase = base;
+		uport.membase = (char *)(base + DIO_VIRADDRBASE);
+		uport.regshift = 2;
 
-		line = register_serial(&serial_req);
+		line = serial8250_register_port(&uport);
 
 		if (line < 0) {
 			printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d"
-			       " irq %d failed\n", i, serial_req.irq);
+			       " irq %d failed\n", i, uport.irq);
 			kfree(port);
 			continue;
 		}
@@ -299,7 +299,7 @@ static void __devexit hpdca_remove_one(s
 		/* Disable board-interrupts */
 		out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0);
 	}
-	unregister_serial(line);
+	serial8250_unregister_port(line);
 }
 #endif
 
@@ -309,7 +309,7 @@ static void __exit hp300_8250_exit(void)
 	struct hp300_port *port, *to_free;
 
 	for (port = hp300_ports; port; ) {
-		unregister_serial(port->line);
+		serial8250_unregister_port(port->line);
 		to_free = port;
 		port = port->next;
 		kfree(to_free);


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND 1] 8250_hp300: unuse register_serial/unregister_serial
  2005-04-04 14:06     ` Russell King
@ 2005-04-04 14:29       ` Kars de Jong
  0 siblings, 0 replies; 3+ messages in thread
From: Kars de Jong @ 2005-04-04 14:29 UTC (permalink / raw)
  To: Russell King; +Cc: Geert Uytterhoeven, Linux Kernel List

On Mon, 2005-04-04 at 15:06 +0100, Russell King wrote:

> Thanks for testing.  I've incorporated your changes.  One question - do
> you need linux/serial.h included in there?

Yes, because it contains the prototype for early_serial_setup().

It might be a good idea to use the early_serial_console_init() instead
though.


Kind regards,

Kars.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-04-04 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050404094934.A32454@flint.arm.linux.org.uk>
     [not found] ` <Pine.LNX.4.62.0504041051390.14107@numbat.sonytel.be>
2005-04-04 13:43   ` [RESEND 1] 8250_hp300: unuse register_serial/unregister_serial Kars de Jong
2005-04-04 14:06     ` Russell King
2005-04-04 14:29       ` Kars de Jong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®