/* 68328serial.c: Serial port driver for 68328 microcontroller * * Copyright (C) 1995 David S. Miller <davem@caip.rutgers.edu> * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com> * Copyright (C) 1998, 1999 D. Jeff Dionne <jeff@uclinux.org> * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com> * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com> * Copyright (C) 2002 Greg Ungerer <gerg@snapgear.com> * * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca> * Multiple UART support Daniel Potts <danielp@cse.unsw.edu.au> * Power management support Daniel Potts <danielp@cse.unsw.edu.au> * VZ Second Serial Port enable Phil Wilshire * 2.4/2.5 port David McCullough */#include<asm/dbg.h>#include<linux/module.h>#include<linux/errno.h>#include<linux/signal.h>#include<linux/sched.h>#include<linux/timer.h>#include<linux/interrupt.h>#include<linux/tty.h>#include<linux/tty_flip.h>#include<linux/major.h>#include<linux/string.h>#include<linux/fcntl.h>#include<linux/mm.h>#include<linux/kernel.h>#include<linux/console.h>#include<linux/reboot.h>#include<linux/keyboard.h>#include<linux/init.h>#include<linux/pm.h>#include<linux/bitops.h>#include<linux/delay.h>#include<linux/gfp.h>#include<asm/io.h>#include<asm/irq.h>#include<asm/system.h>#include<asm/delay.h>#include<asm/uaccess.h>/* (es) *//* note: perhaps we can murge these files, so that you can just * define 1 of them, and they can sort that out for themselves */#if defined(CONFIG_M68EZ328)#include<asm/MC68EZ328.h>#else#if defined(CONFIG_M68VZ328)#include<asm/MC68VZ328.h>#else#include<asm/MC68328.h>#endif /* CONFIG_M68VZ328 */#endif /* CONFIG_M68EZ328 */#include"68328serial.h"/* Turn off usage of real serial interrupt code, to "support" Copilot */#ifdef CONFIG_XCOPILOT_BUGS#undef USE_INTS#else#define USE_INTS#endifstaticstructm68k_serialm68k_soft[NR_PORTS];staticunsignedintuart_irqs[NR_PORTS]=UART_IRQ_DEFNS;/* multiple ports are contiguous in memory */m68328_uart*uart_addr=(m68328_uart*)USTCNT_ADDR;structtty_structm68k_ttys;structm68k_serial*m68k_consinfo=0;#define M68K_CLOCK (16667000) /* FIXME: 16MHz is likely wrong */structtty_driver*serial_driver;/* number of characters left in xmit buffer before we ask for more */#define WAKEUP_CHARS 256/* Debugging... DEBUG_INTR is bad to use when one of the zs * lines is your console ;( */#undef SERIAL_DEBUG_INTR#undef SERIAL_DEBUG_OPEN#undef SERIAL_DEBUG_FLOW#define RS_ISR_PASS_LIMIT 256staticvoidchange_speed(structm68k_serial