Aubrey Li | 10ebdd9 | 2007-03-19 01:24:52 +0800 | [diff] [blame] | 1 | /* |
| 2 | * U-boot - bf537_serial.h Serial Driver defines |
| 3 | * |
Aubrey Li | 314d22f | 2007-04-05 18:31:18 +0800 | [diff] [blame] | 4 | * Copyright (c) 2005-2007 Analog Devices Inc. |
Aubrey Li | 10ebdd9 | 2007-03-19 01:24:52 +0800 | [diff] [blame] | 5 | * |
| 6 | * This file is based on |
| 7 | * bf533_serial.h: Definitions for the BlackFin BF533 DSP serial driver. |
| 8 | * Copyright (C) 2003 Bas Vermeulen <bas@buyways.nl> |
| 9 | * BuyWays B.V. (www.buyways.nl) |
| 10 | * |
| 11 | * Based heavily on: |
| 12 | * blkfinserial.h: Definitions for the BlackFin DSP serial driver. |
| 13 | * |
| 14 | * Copyright (C) 2001 Tony Z. Kou tonyko@arcturusnetworks.com |
| 15 | * Copyright (C) 2001 Arcturus Networks Inc. <www.arcturusnetworks.com> |
| 16 | * |
| 17 | * Based on code from 68328serial.c which was: |
| 18 | * Copyright (C) 1995 David S. Miller <davem@caip.rutgers.edu> |
| 19 | * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com> |
| 20 | * Copyright (C) 1998, 1999 D. Jeff Dionne <jeff@uclinux.org> |
| 21 | * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com> |
| 22 | * |
| 23 | * (C) Copyright 2000-2004 |
| 24 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 25 | * |
| 26 | * See file CREDITS for list of people who contributed to this |
| 27 | * project. |
| 28 | * |
| 29 | * This program is free software; you can redistribute it and/or |
| 30 | * modify it under the terms of the GNU General Public License as |
| 31 | * published by the Free Software Foundation; either version 2 of |
| 32 | * the License, or (at your option) any later version. |
| 33 | * |
| 34 | * This program is distributed in the hope that it will be useful, |
| 35 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 36 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 37 | * GNU General Public License for more details. |
| 38 | * |
| 39 | * You should have received a copy of the GNU General Public License |
| 40 | * along with this program; if not, write to the Free Software |
Aubrey Li | 314d22f | 2007-04-05 18:31:18 +0800 | [diff] [blame] | 41 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 42 | * MA 02110-1301 USA |
Aubrey Li | 10ebdd9 | 2007-03-19 01:24:52 +0800 | [diff] [blame] | 43 | */ |
| 44 | |
| 45 | #ifndef _Bf537_SERIAL_H |
| 46 | #define _Bf537_SERIAL_H |
| 47 | |
| 48 | #include <linux/config.h> |
| 49 | #include <asm/blackfin.h> |
| 50 | |
| 51 | #define SYNC_ALL __asm__ __volatile__ ("ssync;\n") |
| 52 | #define ACCESS_LATCH *pUART_LCR |= UART_LCR_DLAB; |
| 53 | #define ACCESS_PORT_IER *pUART_LCR &= (~UART_LCR_DLAB); |
| 54 | |
| 55 | void serial_setbrg(void); |
| 56 | static void local_put_char(char ch); |
| 57 | void calc_baud(void); |
| 58 | void serial_setbrg(void); |
| 59 | int serial_init(void); |
| 60 | void serial_putc(const char c); |
| 61 | int serial_tstc(void); |
| 62 | int serial_getc(void); |
| 63 | void serial_puts(const char *s); |
| 64 | static void local_put_char(char ch); |
| 65 | |
| 66 | int baud_table[5] = { 9600, 19200, 38400, 57600, 115200 }; |
| 67 | |
| 68 | struct { |
| 69 | unsigned char dl_high; |
| 70 | unsigned char dl_low; |
| 71 | } hw_baud_table[5]; |
| 72 | |
| 73 | #ifdef CONFIG_STAMP |
| 74 | extern unsigned long pll_div_fact; |
| 75 | #endif |
| 76 | |
| 77 | #endif |