Root/qiboot/src/serial.h

1/*
2 * (C) Copyright 2007 OpenMoko, Inc.
3 * Author: xiangfu liu <xiangfu@openmoko.org>
4 *
5 * Configuation settings for the FIC Neo GTA02 Linux GSM phone
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23
24#ifndef __SERIAL_H__
25#define __SERIAL_H__
26
27#define UART0 0
28#define UART1 1
29#define UART2 2
30
31#define rGPHCON (*(volatile unsigned *)0x56000070) /*UART 0 Line control*/
32
33#define rULCON0 (*(volatile unsigned *)0x50000000) /*UART 0 Line control*/
34#define rUCON0 (*(volatile unsigned *)0x50000004) /*UART 0 Control*/
35#define rUFCON0 (*(volatile unsigned *)0x50000008) /*UART 0 FIFO control*/
36#define rUMCON0 (*(volatile unsigned *)0x5000000c) /*UART 0 Modem control*/
37#define rUTRSTAT0 (*(volatile unsigned *)0x50000010) /*UART 0 Tx/Rx status*/
38#define rUERSTAT0 (*(volatile unsigned *)0x50000014) /*UART 0 Rx error status*/
39#define rUFSTAT0 (*(volatile unsigned *)0x50000018) /*UART 0 FIFO status*/
40#define rUMSTAT0 (*(volatile unsigned *)0x5000001c) /*UART 0 Modem status*/
41#define rUBRDIV0 (*(volatile unsigned *)0x50000028) /*UART 0 Baud rate divisor*/
42
43#define rULCON1 (*(volatile unsigned *)0x50004000) /*UART 1 Line control*/
44#define rUCON1 (*(volatile unsigned *)0x50004004) /*UART 1 Control*/
45#define rUFCON1 (*(volatile unsigned *)0x50004008) /*UART 1 FIFO control*/
46#define rUMCON1 (*(volatile unsigned *)0x5000400c) /*UART 1 Modem control*/
47#define rUTRSTAT1 (*(volatile unsigned *)0x50004010) /*UART 1 Tx/Rx status*/
48#define rUERSTAT1 (*(volatile unsigned *)0x50004014) /*UART 1 Rx error status*/
49#define rUFSTAT1 (*(volatile unsigned *)0x50004018) /*UART 1 FIFO status*/
50#define rUMSTAT1 (*(volatile unsigned *)0x5000401c) /*UART 1 Modem status*/
51#define rUBRDIV1 (*(volatile unsigned *)0x50004028) /*UART 1 Baud rate divisor*/
52
53#define rULCON2 (*(volatile unsigned *)0x50008000) /*UART 2 Line control*/
54#define rUCON2 (*(volatile unsigned *)0x50008004) /*UART 2 Control*/
55#define rUFCON2 (*(volatile unsigned *)0x50008008) /*UART 2 FIFO control*/
56#define rUTRSTAT2 (*(volatile unsigned *)0x50008010) /*UART 2 Tx/Rx status*/
57#define rUERSTAT2 (*(volatile unsigned *)0x50008014) /*UART 2 Rx error status*/
58#define rUFSTAT2 (*(volatile unsigned *)0x50008018) /*UART 2 FIFO status*/
59#define rUBRDIV2 (*(volatile unsigned *)0x50008028) /*UART 2 Baud rate divisor*/
60
61#define WrUTXH0(ch) (*(volatile unsigned char *)0x50000020)=(unsigned char)(ch)
62#define RdURXH0() (*(volatile unsigned char *)0x50000024)
63#define WrUTXH1(ch) (*(volatile unsigned char *)0x50004020)=(unsigned char)(ch)
64#define RdURXH1() (*(volatile unsigned char *)0x50004024)
65#define WrUTXH2(ch) (*(volatile unsigned char *)0x50008020)=(unsigned char)(ch)
66#define RdURXH2() (*(volatile unsigned char *)0x50008024)
67
68
69
70// I/O PORT
71#define rGPACON (*(volatile unsigned *)0x56000000)
72#define rGPADAT (*(volatile unsigned *)0x56000004)
73
74#define rGPBCON (*(volatile unsigned *)0x56000010)
75#define rGPBDAT (*(volatile unsigned *)0x56000014)
76#define rGPBUP (*(volatile unsigned *)0x56000018)
77
78#define rGPCCON (*(volatile unsigned *)0x56000020)
79#define rGPCDAT (*(volatile unsigned *)0x56000024)
80#define rGPCUP (*(volatile unsigned *)0x56000028)
81
82#define rGPDCON (*(volatile unsigned *)0x56000030)
83#define rGPDDAT (*(volatile unsigned *)0x56000034)
84#define rGPDUP (*(volatile unsigned *)0x56000038)
85
86#define rGPECON (*(volatile unsigned *)0x56000040)
87#define rGPEDAT (*(volatile unsigned *)0x56000044)
88#define rGPEUP (*(volatile unsigned *)0x56000048)
89
90#define rGPFCON (*(volatile unsigned *)0x56000050)
91#define rGPFDAT (*(volatile unsigned *)0x56000054)
92#define rGPFUP (*(volatile unsigned *)0x56000058)
93
94#define rGPGCON (*(volatile unsigned *)0x56000060)
95#define rGPGDAT (*(volatile unsigned *)0x56000064)
96#define rGPGUP (*(volatile unsigned *)0x56000068)
97
98#define rGPHCON (*(volatile unsigned *)0x56000070)
99#define rGPHDAT (*(volatile unsigned *)0x56000074)
100#define rGPHUP (*(volatile unsigned *)0x56000078)
101
102#define rGPJCON (*(volatile unsigned *)0x560000d0) //Port J control
103#define rGPJDAT (*(volatile unsigned *)0x560000d4) //Port J data
104#define rGPJUP (*(volatile unsigned *)0x560000d8) //Port J data
105
106void port_init(void);
107void serial_init (const int uart);
108void serial_putc (const int uart,const char c);
109int printk(const char *fmt, ...);
110int puts(const char *string);
111
112#endif
113

Archive Download this file



interactive