static int mvme162_scc_init(void) { struct scc_port *port; if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) return (-ENODEV); printk(KERN_INFO "SCC: MVME162 Serial Driver\n"); /* Init channel A */ port = &scc_ports[0]; port->channel = CHANNEL_A; port->ctrlp = (volatile unsigned char *)MVME_SCC_A_ADDR; port->datap = port->ctrlp + 2; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT, "SCC-A TX", port); request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT, "SCC-A status", port); request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT, "SCC-A RX", port); request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-A special cond", port); { SCC_ACCESS_INIT(port); /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); /* Set the interrupt vector */ SCCwrite(INT_VECTOR_REG, MVME162_IRQ_SCC_BASE); /* Interrupt parameters: vector includes status, status low */ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT); SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB); } /* Init channel B */ port = &scc_ports[1]; port->channel = CHANNEL_B; port->ctrlp = (volatile unsigned char *)MVME_SCC_B_ADDR; port->datap = port->ctrlp + 2; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT, "SCC-B TX", port); request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT, "SCC-B status", port); request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT, "SCC-B RX", port); request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-B special cond", port); { SCC_ACCESS_INIT(port); /* Either channel will do */ /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); } /* Ensure interrupts are enabled in the MC2 chip */ *(volatile char *)0xfff4201d = 0x14; /* Initialise the tty driver structures and register */ scc_init_portstructs(); scc_init_drivers(); return 0; }
static int __init bvme6000_scc_init(void) { struct scc_port *port; int error; printk(KERN_INFO "SCC: BVME6000 Serial Driver\n"); /* Init channel A */ port = &scc_ports[0]; port->channel = CHANNEL_A; port->ctrlp = (volatile unsigned char *)BVME_SCC_A_ADDR; port->datap = port->ctrlp + 4; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; error = request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, "SCC-A TX", port); if (error) goto fail; error = request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, "SCC-A status", port); if (error) goto fail_free_a_tx; error = request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, "SCC-A RX", port); if (error) goto fail_free_a_stat; error = request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, "SCC-A special cond", port); if (error) goto fail_free_a_rx; { SCC_ACCESS_INIT(port); /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); /* Set the interrupt vector */ SCCwrite(INT_VECTOR_REG, BVME_IRQ_SCC_BASE); /* Interrupt parameters: vector includes status, status low */ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT); SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB); } /* Init channel B */ port = &scc_ports[1]; port->channel = CHANNEL_B; port->ctrlp = (volatile unsigned char *)BVME_SCC_B_ADDR; port->datap = port->ctrlp + 4; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; error = request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, "SCC-B TX", port); if (error) goto fail_free_a_spcond; error = request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, "SCC-B status", port); if (error) goto fail_free_b_tx; error = request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, "SCC-B RX", port); if (error) goto fail_free_b_stat; error = request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, "SCC-B special cond", port); if (error) goto fail_free_b_rx; { SCC_ACCESS_INIT(port); /* Either channel will do */ /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); } /* Initialise the tty driver structures and register */ scc_init_portstructs(); scc_init_drivers(); return 0; fail: free_irq(BVME_IRQ_SCCA_STAT, port); fail_free_a_tx: free_irq(BVME_IRQ_SCCA_RX, port); fail_free_a_stat: free_irq(BVME_IRQ_SCCA_SPCOND, port); fail_free_a_rx: free_irq(BVME_IRQ_SCCB_TX, port); fail_free_a_spcond: free_irq(BVME_IRQ_SCCB_STAT, port); fail_free_b_tx: free_irq(BVME_IRQ_SCCB_RX, port); fail_free_b_stat: free_irq(BVME_IRQ_SCCB_SPCOND, port); fail_free_b_rx: return error; }
static int mvme147_scc_init(void) { struct scc_port *port; printk(KERN_INFO "SCC: MVME147 Serial Driver\n"); /* Init channel A */ port = &scc_ports[0]; port->channel = CHANNEL_A; port->ctrlp = (volatile unsigned char *)M147_SCC_A_ADDR; port->datap = port->ctrlp + 1; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, SA_INTERRUPT, "SCC-A TX", port); request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, SA_INTERRUPT, "SCC-A status", port); request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, SA_INTERRUPT, "SCC-A RX", port); request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-A special cond", port); { SCC_ACCESS_INIT(port); /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); /* Set the interrupt vector */ SCCwrite(INT_VECTOR_REG, MVME147_IRQ_SCC_BASE); /* Interrupt parameters: vector includes status, status low */ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT); SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB); } /* Init channel B */ port = &scc_ports[1]; port->channel = CHANNEL_B; port->ctrlp = (volatile unsigned char *)M147_SCC_B_ADDR; port->datap = port->ctrlp + 1; port->port_a = &scc_ports[0]; port->port_b = &scc_ports[1]; request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, SA_INTERRUPT, "SCC-B TX", port); request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, SA_INTERRUPT, "SCC-B status", port); request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, SA_INTERRUPT, "SCC-B RX", port); request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, SA_INTERRUPT, "SCC-B special cond", port); { SCC_ACCESS_INIT(port); /* disable interrupts for this channel */ SCCwrite(INT_AND_DMA_REG, 0); } /* Ensure interrupts are enabled in the PCC chip */ m147_pcc->serial_cntrl=PCC_LEVEL_SERIAL|PCC_INT_ENAB; /* Initialise the tty driver structures and register */ scc_init_portstructs(); scc_init_drivers(); return 0; }