+#ifdef CONFIG_OC_PBM_DRV
+
+void pbm_drv_init()
+{
+ int rv = 0;
+
+ /* set rs485 mode for UART1 */
+ /* dsr(txd), cts(rxd), rts(rs485_dir), rxd, txd */
+ PINSEL0 = (PINSEL0 & ~0xFFFF0000) | 0x01550000;
+
+ PBMCHIP_INFO(PBMCHIP_DRV_DESCRIPTION ", "
+ PBMCHIP_DRV_VERSION ", "
+ PBMCHIP_DRV_COPYRIGHT "\n");
+
+ pbm_dev = pbm_alloc_dev(PBM_UART);
+ if (!pbm_dev)
+ PBM_PRINT("unable to allocate device\n");
+
+ PBM_LOCK_INIT(&pbm_dev->lock);
+ PBM_LOCK_INIT(&pbm_dev->irq_lock);
+
+ pbm_dev->node_res = &pbm_8250_res;
+ pbm_8250_res.ioport = PBM_8250_PORT;
+ pbm_8250_res.irq = PBM_8250_IRQ;
+ PBMCHIP_INFO("port=0x%04x irq=%d\n",
+ pbm_8250_res.ioport, pbm_8250_res.irq);
+
+ /* disable all interrupts */
+ pbm_outb(pbm_dev, UART_IER, 0x00);
+
+ /* get default parameters*/
+ pbm_8250_get_params(pbm_dev, 0);
+ /* chip operations and registering to pbmcore */
+ pbm_dev->chops = chops;
+ rv = pbm_register_chip(pbm_dev);
+ if (rv)
+ PBM_PRINT("unable to register chip\n");
+
+ rv = request_irq(pbm_8250_res.irq, pbm_8250_intr, 0, "pbm_8250", pbm_dev);
+
+ pbm_8250_int_off_all(pbm_dev);
+ pbm_8250_int_on_all(pbm_dev);
+
+ /* a hack to generate THRE interrupt on LPC2148 */
+ pbm_outb(pbm_dev, UART_TX, 0x00);
+}
+
+#endif /* CONFIG_OC_PBM_DRV */
+