Skip to content

Commit 9a66d18

Browse files
tsbogendhdeller
authored andcommitted
parisc: fix serial ports on C8000 workstation
The C8000 workstation (64 bit kernel only) has a somewhat different serial port configuration than other models. Thomas Bogendoerfer sent a patch to fix this in September 2010, which was now minimally modified by me. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 91ea820 commit 9a66d18

3 files changed

Lines changed: 76 additions & 1 deletion

File tree

‎arch/parisc/kernel/hardware.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ static struct hp_hardware hp_hardware_list[] = {
12051205
{HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"},
12061206
{HPHW_FIO, 0x004, 0x00340, 0x0, "BARCO CX4500 VME Grphx Cnsl"},
12071207
{HPHW_FIO, 0x004, 0x00360, 0x0, "Hughes TOG VME FDDI"},
1208+
{HPHW_FIO, 0x076, 0x000AD, 0x00, "Crestone Peak RS-232"},
12081209
{HPHW_IOA, 0x185, 0x0000B, 0x00, "Java BC Summit Port"},
12091210
{HPHW_IOA, 0x1FF, 0x0000B, 0x00, "Hitachi Ghostview Summit Port"},
12101211
{HPHW_IOA, 0x580, 0x0000B, 0x10, "U2-IOA BC Runway Port"},

‎drivers/parisc/iosapic.c‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,70 @@ int iosapic_fixup_irq(void *isi_obj, struct pci_dev *pcidev)
811811
return pcidev->irq;
812812
}
813813

814+
static struct iosapic_info *first_isi = NULL;
815+
816+
#ifdef CONFIG_64BIT
817+
int iosapic_serial_irq(int num)
818+
{
819+
struct iosapic_info *isi = first_isi;
820+
struct irt_entry *irte = NULL; /* only used if PAT PDC */
821+
struct vector_info *vi;
822+
int isi_line; /* line used by device */
823+
824+
/* lookup IRT entry for isi/slot/pin set */
825+
irte = &irt_cell[num];
826+
827+
DBG_IRT("iosapic_serial_irq(): irte %p %x %x %x %x %x %x %x %x\n",
828+
irte,
829+
irte->entry_type,
830+
irte->entry_length,
831+
irte->polarity_trigger,
832+
irte->src_bus_irq_devno,
833+
irte->src_bus_id,
834+
irte->src_seg_id,
835+
irte->dest_iosapic_intin,
836+
(u32) irte->dest_iosapic_addr);
837+
isi_line = irte->dest_iosapic_intin;
838+
839+
/* get vector info for this input line */
840+
vi = isi->isi_vector + isi_line;
841+
DBG_IRT("iosapic_serial_irq: line %d vi 0x%p\n", isi_line, vi);
842+
843+
/* If this IRQ line has already been setup, skip it */
844+
if (vi->irte)
845+
goto out;
846+
847+
vi->irte = irte;
848+
849+
/*
850+
* Allocate processor IRQ
851+
*
852+
* XXX/FIXME The txn_alloc_irq() code and related code should be
853+
* moved to enable_irq(). That way we only allocate processor IRQ
854+
* bits for devices that actually have drivers claiming them.
855+
* Right now we assign an IRQ to every PCI device present,
856+
* regardless of whether it's used or not.
857+
*/
858+
vi->txn_irq = txn_alloc_irq(8);
859+
860+
if (vi->txn_irq < 0)
861+
panic("I/O sapic: couldn't get TXN IRQ\n");
862+
863+
/* enable_irq() will use txn_* to program IRdT */
864+
vi->txn_addr = txn_alloc_addr(vi->txn_irq);
865+
vi->txn_data = txn_alloc_data(vi->txn_irq);
866+
867+
vi->eoi_addr = isi->addr + IOSAPIC_REG_EOI;
868+
vi->eoi_data = cpu_to_le32(vi->txn_data);
869+
870+
cpu_claim_irq(vi->txn_irq, &iosapic_interrupt_type, vi);
871+
872+
out:
873+
874+
return vi->txn_irq;
875+
}
876+
#endif
877+
814878

815879
/*
816880
** squirrel away the I/O Sapic Version
@@ -877,6 +941,8 @@ void *iosapic_register(unsigned long hpa)
877941
vip->irqline = (unsigned char) cnt;
878942
vip->iosapic = isi;
879943
}
944+
if (!first_isi)
945+
first_isi = isi;
880946
return isi;
881947
}
882948

‎drivers/tty/serial/8250/8250_gsc.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ static int __init serial_init_chip(struct parisc_device *dev)
3030
unsigned long address;
3131
int err;
3232

33+
#ifdef CONFIG_64BIT
34+
extern int iosapic_serial_irq(int cellnum);
35+
if (!dev->irq && (dev->id.sversion == 0xad))
36+
dev->irq = iosapic_serial_irq(dev->mod_index-1);
37+
#endif
38+
3339
if (!dev->irq) {
3440
/* We find some unattached serial ports by walking native
3541
* busses. These should be silently ignored. Otherwise,
@@ -51,7 +57,8 @@ static int __init serial_init_chip(struct parisc_device *dev)
5157
memset(&uart, 0, sizeof(uart));
5258
uart.port.iotype = UPIO_MEM;
5359
/* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */
54-
uart.port.uartclk = 7272727;
60+
uart.port.uartclk = (dev->id.sversion != 0xad) ?
61+
7272727 : 1843200;
5562
uart.port.mapbase = address;
5663
uart.port.membase = ioremap_nocache(address, 16);
5764
uart.port.irq = dev->irq;
@@ -73,6 +80,7 @@ static struct parisc_device_id serial_tbl[] = {
7380
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 },
7481
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c },
7582
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d },
83+
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x000ad },
7684
{ 0 }
7785
};
7886

0 commit comments

Comments
 (0)