--- linux/drivers/char/serial.c Wed Jun 7 23:26:42 2000 +++ linux-pmac-stable-test/drivers/char/serial.c Tue Nov 14 19:08:32 2000 @@ -150,6 +150,12 @@ #include #include +#ifdef CONFIG_MAC_SERIAL +#define SERIAL_DEV_OFFSET 4 +#else +#define SERIAL_DEV_OFFSET 0 +#endif + #ifdef SERIAL_INLINE #define _INLINE_ inline #endif @@ -3130,7 +3136,7 @@ serial_driver.driver_name = "serial"; serial_driver.name = "ttyS"; serial_driver.major = TTY_MAJOR; - serial_driver.minor_start = 64; + serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET; serial_driver.num = NR_PORTS; serial_driver.type = TTY_DRIVER_TYPE_SERIAL; serial_driver.subtype = SERIAL_TYPE_NORMAL; @@ -3194,11 +3200,22 @@ state->icount.frame = state->icount.parity = 0; state->icount.overrun = state->icount.brk = 0; state->irq = irq_cannonicalize(state->irq); - if (check_region(state->port,8)) - continue; - if (state->flags & ASYNC_BOOT_AUTOCONF) - autoconfig(state); +#ifdef CONFIG_PPC + /* PowerMacs don't have legacy serial ports on IOs and would machine check */ + if (_machine != _MACH_Pmac) { +#endif + if (check_region(state->port,8)) + continue; + if (state->flags & ASYNC_BOOT_AUTOCONF) + autoconfig(state); +#ifdef CONFIG_PPC + } +#endif } +#ifdef CONFIG_PPC + if (_machine == _MACH_Pmac) + return 0; +#endif /* * Detect the IRQ only once every port is initialised, * because some 16450 do not reset to 0 the MCR register. @@ -3268,22 +3285,22 @@ state->irq = detect_uart_irq(state); printk(KERN_INFO "tty%02d at 0x%04x (irq = %d) is a %s\n", - state->line, state->port, state->irq, + state->line + SERIAL_DEV_OFFSET, state->port, state->irq, uart_config[state->type].name); - return state->line; + return state->line + SERIAL_DEV_OFFSET; } void unregister_serial(int line) { unsigned long flags; - struct serial_state *state = &rs_table[line]; + struct serial_state *state = &rs_table[line + SERIAL_DEV_OFFSET]; save_flags(flags); cli(); if (state->info && state->info->tty) tty_hangup(state->info->tty); state->type = PORT_UNKNOWN; - printk(KERN_INFO "tty%02d unloaded\n", state->line); + printk(KERN_INFO "tty%02d unloaded\n", state->line + SERIAL_DEV_OFFSET); restore_flags(flags); }