parisc: fix serial ports on C8000 workstation
Subsystems (2)
Helge Deller
maintainerPATCH 1/1 parisc: fix serial ports on C8000 workstation
From: Thomas Bogendoerfer <[email protected]>
The C8000 workstation (64 bit kernel only) has a somewhat different serial port configuration that other models.
Thonmas Bogendoerfers sent a patch to fix this in September 2010, which was now minimally modified by me.
arch/parisc/kernel/hardware.c +1 -0
@@ -1205,6 +1205,7 @@ static struct hp_hardware hp_hardware_list[] = { {HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"}, {HPHW_FIO, 0x004, 0x00340, 0x0, "BARCO CX4500 VME Grphx Cnsl"}, {HPHW_FIO, 0x004, 0x00360, 0x0, "Hughes TOG VME FDDI"}, + {HPHW_FIO, 0x076, 0x000AD, 0x00, "Crestone Peak RS-232"}, {HPHW_IOA, 0x185, 0x0000B, 0x00, "Java BC Summit Port"}, {HPHW_IOA, 0x1FF, 0x0000B, 0x00, "Hitachi Ghostview Summit Port"}, {HPHW_IOA, 0x580, 0x0000B, 0x10, "U2-IOA BC Runway Port"},
drivers/parisc/iosapic.c +66 -0
78 lines not on this page · raw message
drivers/tty/serial/8250/8250_gsc.c +9 -1
@@ -30,6 +30,12 @@ static int __init serial_init_chip(struct parisc_device *dev)unsigned long address;int err; +#ifdef CONFIG_64BIT +extern int iosapic_serial_irq (int cellnum); +if (!dev->irq && (dev->id.sversion ==0xad )) + dev->irq =iosapic_serial_irq (dev->mod_index-1 ); +#endif +if (!dev->irq) {/* We find some unattached serial ports by walking native * busses. These should be silently ignored. Otherwise,
@@ -51,7 +57,8 @@ static int __init serial_init_chip(struct parisc_device *dev)memset (&uart,0 ,sizeof (uart)); uart.port.iotype =UPIO_MEM ;/* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */ - uart.port.uartclk =7272727 ; + uart.port.uartclk = (dev->id.sversion !=0xad ) ? +7272727 :1843200 ; uart.port.mapbase = address; uart.port.membase =ioremap_nocache (address,16 ); uart.port.irq = dev->irq;
@@ -73,6 +80,7 @@ static struct parisc_device_id serial_tbl[] = { { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 }, { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c }, { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d }, + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x000ad }, { 0 } };
Quoted 6 lines · Helge Deller
From: Thomas Bogendoerfer <[email protected]>
The C8000 workstation (64 bit kernel only) has a somewhat different serial port configuration that other models.
Thonmas Bogendoerfers sent a patch to fix this in September 2010, which was now minimally modified by me.
Cool, that explains why it doesn't work for me. And it saves me the time to debug what _I_ did wrong ;)
Quoted 5 lines
(quoted diff) +0
-0
b/drivers/tty/serial/8250/8250_gsc.cindex 097dff9..bb91b47 100644
drivers/tty/serial/8250/8250_gsc.c static int __init serial_init_chip(struct parisc_device · line 38
Quoted 9 lines
drivers/tty/serial/8250/8250_gsc.c +6
-0@@ -30,6 +30,12 @@ static int __init serial_init_chip(struct parisc_device *dev) unsigned long address;int err; +#ifdef CONFIG_64BIT +extern int iosapic_serial_irq (int cellnum); +if (!dev->irq && (dev->id.sversion ==0xad )) + dev->irq =iosapic_serial_irq (dev->mod_index-1 ); +#endif +
Forward declaration in the middle of a function. Is this permitted? By standard and by coding style? Looks strange to me.
drivers/tty/serial/8250/8250_gsc.c static int __init serial_init_chip(struct parisc_device · line 61
Quoted 10 lines
drivers/tty/serial/8250/8250_gsc.c +2
-1if (!dev->irq) {/* We find some unattached serial ports by walking native * busses. These should be silently ignored. Otherwise, @@ -51,7 +57,8 @@ static int __init serial_init_chip(struct parisc_device *dev) memset(&uart, 0, sizeof(uart)); uart.port.iotype =UPIO_MEM ;/* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */ - uart.port.uartclk =7272727 ; + uart.port.uartclk = (dev->id.sversion !=0xad ) ? +7272727 :1843200 ;
If there is a nice comment explaining 72 another nice comment for the other number should be added.
Eike
Quoted 7 lines · Rolf Eike Beer
drivers/tty/serial/8250/8250_gsc.c static int __init serial_init_chip(struct parisc_device *dev) · line 61
Quoted 4 lines
/* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */drivers/tty/serial/8250/8250_gsc.c +2
-1- uart.port.uartclk =7272727 ; + uart.port.uartclk = (dev->id.sversion !=0xad ) ? +7272727 :1843200 ;If there is a nice comment explaining 72 another nice comment for the other number should be added.
1.8432 MHz is a common oscillator frequency for UARTs. See for example,
http://en.wikipedia.org/wiki/Crystal_oscillator_frequencies
Dave
--
John David Anglin [email protected]
Helge Deller
maintainerQuoted 3 lines
Quoted 3 lines
The C8000 workstation (64 bit kernel only) has a somewhat different serial port configuration that other models.
Thonmas Bogendoerfers sent a patch to fix this in September 2010, w=
hich
Quoted 1 line
Quoted 1 line
was now minimally modified by me.
I shouldn't send patches that late... too many typos and not very good = patch description :-)
Quoted 1 line
Cool, that explains why it doesn't work for me. And it saves me the t=
ime to
Quoted 1 line
debug what _I_ did wrong ;)
Rolf, the original patch from Thomas Bogend=C3=B6rfer including his com= ments is here:
http://comments.gmane.org/gmane.linux.ports.parisc/3258
(if you need the patch only, go here: https://patchwork.kernel.org/patc=
h/357572/raw/)
Maybe you want to clean up the other parts, e.g. impmi or pci_mmap?
Helge
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Helge Deller
Maybe you want to clean up the other parts, e.g. impmi or
pci_mmap?
ipmi is already cleaned up, but I didn't get any response from the maintainer.
http://www.spinics.net/lists/linux-parisc/msg03191.html
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Am 10.06.2013 12:00, schrieb Thomas Bogendoerfer:
Quoted 7 lines · Helge Deller
Quoted 1 line
Maybe you want to clean up the other parts, e.g. impmi or
pci_mmap?ipmi is already cleaned up, but I didn't get any response from the maintainer.
parisc_registered should be a bool, and you don't reset it on unregister_parisc_driver. If this can be compiled as module you get bad effects (i.e. OOPS, crash ) on repeated modprobe/rmmod.
Quoted 1 line
info->irq= 0; /* no interrup */
There is a 't' missing at the end.
I would say resend the patch, it probably got lost.
Eike