/*
 * include/asm-ppc/mv_serial.h
 * 
 * Definitions for MATRIX Vision mvBox Platform
 *
 * MATRIX Vision GmbH
 * Talstr. 16
 * Oppenweiler
 * Germany
 *
 * Based on Sandpoint by...
 * Author: Mark A. Greer
 *         mgreer@mvista.com
 *
 * Copyright 2001 MontaVista Software Inc.
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
*/
#ifndef __ASMPPC_MV_SERIAL_H
#define __ASMPPC_MV_SERIAL_H

#include <linux/config.h>

#include "mv.h"

	#define BASE_BAUD					115200	
	#define MV_SB0						(0xfe0003f8)	
	#define MV_SB1						(0xfe0002f8)	
	#define SERIAL_SB0_IRQ				4
	#define SERIAL_SB1_IRQ				3

	#define MPC10X_EUMB_DUART_OFFSET1	0x4500	/*(MPC10X_EUMB_DUART_OFFSET + 0x500)*/ 
	#define MPC10X_EUMB_DUART_OFFSET2	0x4600	/*(MPC10X_EUMB_DUART_OFFSET + 0x600)*/ 
	#define MV_EPIC0					(MVBOX_MPC10X_MAPB_EUMB_BASE + MPC10X_EUMB_DUART_OFFSET1)
	#define MV_EPIC1					(MVBOX_MPC10X_MAPB_EUMB_BASE + MPC10X_EUMB_DUART_OFFSET2)
	#define SERIAL_EPIC0_IRQ			8
	#define SERIAL_EPIC1_IRQ			9
	#define EPIC_BASE_BAUD 				(66000000 / 16)


#ifdef CONFIG_SERIAL_MANY_PORTS
 #define RS_TABLE_SIZE  64
#else
 #define RS_TABLE_SIZE  2
#endif

/* Rate for the clock for the onboard serial chip */

#ifdef CONFIG_SERIAL_DETECT_IRQ
 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#else
 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#endif


#define STD_SERIAL_PORT_EPIC0 \
        0, EPIC_BASE_BAUD, MV_EPIC0, SERIAL_EPIC0_IRQ, STD_COM_FLAGS, \
		iomem_base: (u8 *)MV_EPIC0,		  \
		io_type: SERIAL_IO_MEM 		  

#define STD_SERIAL_PORT_EPIC1 \
        0, EPIC_BASE_BAUD, MV_EPIC1, SERIAL_EPIC1_IRQ, STD_COM_FLAGS, \
		iomem_base: (u8 *)MV_EPIC1,		  \
		io_type: SERIAL_IO_MEM 			  

#define STD_SERIAL_PORT_SB0 \
        0, BASE_BAUD, MV_SB0, SERIAL_SB0_IRQ, STD_COM_FLAGS, \
		iomem_base: (u8 *)MV_SB0,		  \
		io_type: SERIAL_IO_MEM				  

#define STD_SERIAL_PORT_SB1 \
        0, BASE_BAUD, MV_SB1, SERIAL_SB1_IRQ, STD_COM_FLAGS, \
		iomem_base: (u8 *)MV_SB1,		  \
		io_type: SERIAL_IO_MEM				  

#define STD_SERIAL_PORT_EPIC_DFNS \
			{STD_SERIAL_PORT_EPIC0},{STD_SERIAL_PORT_EPIC1}

#define STD_SERIAL_PORT_SB_DFNS \
			{STD_SERIAL_PORT_SB0},{STD_SERIAL_PORT_SB1}

#define SERIAL_PORT_DFNS STD_SERIAL_PORT_EPIC_DFNS

#endif /* __ASMPPC_MV_SERIAL_H */
