- int i, flags;
- struct bcm_serial * info;
-
- // Print the driver version information
- printk(VER_STR);
- serial_driver = alloc_tty_driver(BCM_NUM_UARTS);
- if (!serial_driver)
- return -ENOMEM;
-
- serial_driver->owner = THIS_MODULE;
-// serial_driver->devfs_name = "tts/";
-// serial_driver.magic = TTY_DRIVER_MAGIC;
- serial_driver->name = "ttyS";
- serial_driver->major = TTY_MAJOR;
- serial_driver->minor_start = 64;
-// serial_driver.num = BCM_NUM_UARTS;
- serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
- serial_driver->subtype = SERIAL_TYPE_NORMAL;
- serial_driver->init_termios = tty_std_termios;
- serial_driver->init_termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
- serial_driver->flags = TTY_DRIVER_REAL_RAW;
-
- serial_driver->termios = serial_termios;
- serial_driver->termios_locked = serial_termios_locked;
-
- tty_set_operations(serial_driver, &rs_ops);
-
- if (tty_register_driver (serial_driver))
- panic("Couldn't register serial driver\n");
-
- //save_flags(flags); cli();
- spin_lock_irqsave(&bcm963xx_serial_lock, flags);
-
- for (i = 0; i < BCM_NUM_UARTS; i++)
- {
- info = &multi[i];
- lines[i] = info;
- info->magic = SERIAL_MAGIC;
- info->port = (Uart *) ((char *)UART_BASE + (i * 0x20));
- info->tty = 0;
- info->irq = (2 - i) + 8;
- info->line = i;
- info->close_delay = 50;
- info->closing_wait = 3000;
- info->x_char = 0;
- info->event = 0;
- info->count = 0;
- info->blocked_open = 0;
- info->normal_termios = serial_driver->init_termios;
- init_waitqueue_head(&info->open_wait);
- init_waitqueue_head(&info->close_wait);
-
- /* If we are pointing to address zero then punt - not correctly
- * set up in setup.c to handle this.
- */
- if (! info->port)
- return 0;
- BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
- }
-
- /* order matters here... the trick is that flags
- * is updated... in request_irq - to immediatedly obliterate
- * it is unwise.
- */
- spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
- return 0;
+ int i, flags;
+ struct bcm_serial *info;
+
+ // Print the driver version information
+ printk(VER_STR);
+ serial_driver = alloc_tty_driver(BCM_NUM_UARTS);
+ if (!serial_driver)
+ return -ENOMEM;
+
+ serial_driver->owner = THIS_MODULE;
+ serial_driver->name = "ttyS";
+ serial_driver->major = TTY_MAJOR;
+ serial_driver->minor_start = 64;
+ serial_driver->num = 1;
+ serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
+ serial_driver->subtype = SERIAL_TYPE_NORMAL;
+ serial_driver->init_termios = tty_std_termios;
+ serial_driver->init_termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
+ serial_driver->flags = TTY_DRIVER_REAL_RAW;
+
+ serial_driver->termios = serial_termios;
+ serial_driver->termios_locked = serial_termios_locked;
+
+ tty_set_operations(serial_driver, &rs_ops);
+
+ if (tty_register_driver(serial_driver))
+ panic("Couldn't register serial driver\n");
+
+ //save_flags(flags); cli();
+ spin_lock_irqsave(&bcm963xx_serial_lock, flags);
+
+ for (i = 0; i < 1; i++) {
+ info = &multi[i];
+ lines[i] = info;
+ info->magic = SERIAL_MAGIC;
+ info->port = (Uart *) ((char *) UART_BASE + (i * 0x20));
+ info->tty = 0;
+ info->irq = (2 - i) + 8;
+ info->line = i;
+ info->close_delay = 50;
+ info->closing_wait = 3000;
+ info->x_char = 0;
+ info->event = 0;
+ info->count = 0;
+ info->blocked_open = 0;
+ info->normal_termios = serial_driver->init_termios;
+ init_waitqueue_head(&info->open_wait);
+ init_waitqueue_head(&info->close_wait);
+
+ /* If we are pointing to address zero then punt - not correctly
+ * set up in setup.c to handle this.
+ */
+ if (!info->port)
+ return 0;
+ BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
+ }
+
+ /* order matters here... the trick is that flags
+ * is updated... in request_irq - to immediatedly obliterate
+ * it is unwise.
+ */
+ spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
+ return 0;